@fragiola/primitives-react 0.0.0-stage → 0.1.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/CHANGELOG.md +67 -0
- 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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @fragiola/primitives-react
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#86](https://github.com/fragiola/primitives/pull/86) [`6c9709d`](https://github.com/fragiola/primitives/commit/6c9709d93ecb80e5eeefd7b0ac5ef2399b02416d) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Calendar systems and time zones, computed in-house on `Intl`, natively in React, Vue and Angular. The toolkit gains `/calendar-systems`: the 13 systems of the catalog (`gregory`, `buddhist`, `japanese`, `roc`, `persian`, `indian`, `islamicCivil`, `islamicTbla`, `islamicUmalqura`, `hebrew`, `coptic`, `ethiopic`, `ethioaa`), one export each, with their fields, eras, leap months, month and year math and names. Every date component takes an injected `calendar` (`calendar={persian}`): the day calendars, pickers, month and year calendars and pickers, CalendarView and the date fields show and edit the system's months, years and eras (an editable era segment where the system has several, 13-month years); values stay ISO, and a month or year picker in a system submits its first day's ISO date with the RFC 9557 annotation (`2026-10-23[u-ca=persian]`). The toolkit gains `/time-zone`: `ZonedDateTime`, the offset lookup, instants, DST gaps and overlaps with Temporal's `disambiguation`, zoned math, RFC 9557 ISO text and `timeZone(id)`. DateField, DateRangeField, DatePickerInput and DateRangePickerInput take `timeZone`, `hideTimeZone` and `disambiguation`: zoned values, a time zone name segment, the typed wall time resolved in the zone, the zoned ISO text submitted. No component imports either entry, so an app that passes no calendar and no zone bundles none of their code.
|
|
8
|
+
|
|
9
|
+
- [#85](https://github.com/fragiola/primitives/pull/85) [`2fef26d`](https://github.com/fragiola/primitives/commit/2fef26d1c42933b683e234fc7eb6038199f46ee1) Thanks [@maurodesouza](https://github.com/maurodesouza)! - The calendar variants, natively in React, Vue and Angular, each in its own entry. `/multiple-calendar` (`MultipleCalendar`, the Calendar's parts): several dates (`PlainDate[]`, sorted), a press or Enter / Space toggles a date, `maxSelected`, `aria-multiselectable`, one hidden input per date with `name`, form reset. `/calendar-preset` (`CalendarPreset`): a button that sets a Calendar's or RangeCalendar's value to a date, a range or a function of today (reason `item-press`), inline or in any picker (a typed picker's segments follow), `data-selected` while current, disabled when out of reach. `/month-calendar`, `/month-range-calendar`, `/year-calendar`, `/year-range-calendar`: APG grids of the 12 months of a year and of pages of 12 years, the calendar's keys mapped to them, `min`, `max`, `isUnavailable`, `columns`, a range mode, `PlainYearMonth` / `PlainYear` values. `/month-picker`, `/month-range-picker`, `/year-picker`, `/year-range-picker`: the DatePicker's parts with a month or year value, submitting `2026-11`, `2026-03/2026-06`, `2026`, `2020/2024`. `/calendar-view` (`CalendarView`: `Root`, `Trigger`): a calendar's day, month and year views, inline or in a picker's popup, the new view's focused cell taking the focus on each switch. The toolkit gains `/month-year` (the month and year values, the 12-item grid and its keys, their `Intl` names). Every existing entry is unchanged.
|
|
10
|
+
|
|
11
|
+
- [#67](https://github.com/fragiola/primitives/pull/67) [`7d8f3c3`](https://github.com/fragiola/primitives/commit/7d8f3c33d312b5244fb0d4eccafc7537a6088abd) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Collections, natively in React, Vue and Angular, each in its own entry. `/listbox` (`Root`, `Item`, `ItemIndicator`, `Group`, `GroupLabel`, `Separator`): the APG listbox that stays on the page, single or `multiple`, the APG's two selection models (`selectionBehavior`: `"toggle"`, where Space toggles and a move never selects, or `"replace"`, where the selection follows the focus and Ctrl moves without selecting), Shift and Ctrl ranges from the keyboard and the pointer, Ctrl+A to select all, the arrows along `orientation` (mirrored in RTL), Home, End, PageUp, PageDown and typeahead, `loopFocus`, focusable disabled options that are never selected, a roving tab stop on the first selected option, hidden inputs for native forms and the Field layer. `/autocomplete` (`Root`, `InputGroup`, `Input`, `Trigger`, `Clear`, `Value`, `Status`, `Portal`, `Positioner`, `Popup`, `Empty`, `List`, `Group`, `GroupLabel`, `Separator`, `Item`): a free-text input whose value is the text, with the APG's four autocomplete behaviours (`mode`: `list`, `both` and `inline` with the inline completion selected after the caret and accepted on blur, `none`), Combobox's built-in filtering (`filter`, `limit`, `locale`, groups), suggestions that may change as they load, `openOnInputClick`, `autoHighlight`, Escape that closes the list then clears the text, and the Input as the form control and the Field's. The toolkit gains `/selection`, the collections mechanism (`createListModel`, `applySelection`, `listKeyTarget`, `listPressSelection`, `pageTarget`), which only list collections import.
|
|
12
|
+
|
|
13
|
+
- [#111](https://github.com/fragiola/primitives/pull/111) [`349a6a2`](https://github.com/fragiola/primitives/commit/349a6a2aec56e0d5f69795cc08c953f94a7cc4cd) Thanks [@maurodesouza](https://github.com/maurodesouza)! - The color controls, natively in React, Vue and Angular, each in its own entry, on the toolkit's new color model. `/color` (toolkit): an immutable `Color` (a plain object in `rgb`, `hsl` or `hsb`, with alpha), `parseColor` (hex, `rgb()`, `hsl()`, `hsb()`; `null` for anything else), `formatColor` (`hex`, `hexa`, the functions, `css`), `convertColor` with a fixed precision per channel (rgb whole numbers, hue, saturation, lightness and brightness to 2 decimals, alpha to 4; round trips unit-tested), the channels' ranges and steps, their `Intl` text, the CSS gradients of a track, an area and a wheel, and an area's and a wheel's keys and geometry. `/color-slider` (`ColorSlider`: `Root`, `Label`, `Output`, `Track`, `Thumb`): the APG slider on one channel, its track a gradient, RTL, vertical, a Field control submitting the color as hex. `/color-area` (`ColorArea`: `Root`, `Thumb`, `Input`): two channels on a 2D area as two APG sliders (one native range input per axis), the focus following the axis a key moved, pointer drag. `/color-wheel` (`ColorWheel`: `Root`, `Track`, `Thumb`): the hue on a ring, wrapping, its inner and outer radius. `/color-field` (`ColorField`: `Root`, `Input`): a hex textbox, or the APG spinbutton for one channel, committed on Enter and blur, a Field control. Only the color components import `/color`; every existing entry is unchanged.
|
|
14
|
+
|
|
15
|
+
- [#112](https://github.com/fragiola/primitives/pull/112) [`bdb079e`](https://github.com/fragiola/primitives/commit/bdb079e4f944166b6c21588e393cef6a3507b180) Thanks [@maurodesouza](https://github.com/maurodesouza)! - The color pickers, natively in React, Vue and Angular, each in its own entry, completing the Color family. `/color-swatch` (`ColorSwatch`): a color over the recipe's checkerboard, an `img` named by the app (else by the color's CSS text). `/color-swatch-picker` (`ColorSwatchPicker`: `Root`, `Item`): the APG listbox of swatches laid out in rows, ArrowUp and ArrowDown moving between the rows, a Field control submitting the color as hex. `/color-picker` (`ColorPicker`: `Root`, `FormatSelect`, `EyeDropperTrigger`): one color shared with the ColorArea, ColorSlider, ColorWheel, ColorField, ColorSwatchPicker and ColorSwatch inside it (a control with its own `value` or `defaultValue` keeps its own state), a format switch converting the value to its space, the browser's eyedropper where `EyeDropper` exists, a Field control submitting the color as hex; it bundles no overlay code. `/color-picker-popover` (`ColorPickerPopover`: `Root`, `Trigger`, `Portal`, `Positioner`, `Popup`): its opt-in non-modal popup on Popover's overlay lifecycle. The four color controls read an enclosing picker. The toolkit adds `openEyeDropper` and `supportsEyeDropper` to `/color` and `rowTarget` to `/selection`. Every other entry is unchanged.
|
|
16
|
+
|
|
17
|
+
- [#113](https://github.com/fragiola/primitives/pull/113) [`ffc61ee`](https://github.com/fragiola/primitives/commit/ffc61ee937691c5440d719919d39f73f0a4a3fbe) Thanks [@maurodesouza](https://github.com/maurodesouza)! - The command palette and the cascade select, natively in React, Vue and Angular, each in its own entry. `/command` (`Command`: `Root`, `Input`, `List`, `Item`, `Group`, `GroupLabel`, `Separator`, `Empty`, `Loading`): the APG combobox with a listbox that is always shown, the focus kept in the input (`aria-activedescendant`), built-in filtering by `commandScore` (substring and word prefix, an Item's `keywords`; `filter` replaces it, `null` turns it off), non-matching Items and empty Groups hidden, the best match highlighted as the text changes, Enter running the highlighted Item's `onSelect`, nested `pages` with Backspace on an empty input going back, `loading` with a busy list and the `Loading` and `Empty` live regions; a Command inside a Dialog opened by Ctrl/⌘+K is a documented composition, not a part. `/command-virtual` (`CommandVirtual.List`): the opt-in virtual list over an `items` array (10 000 items in the conformance suite), so `/command` bundles no `/virtual` code. `/cascade-select` (`CascadeSelect`: `Root`, `Trigger`, `Value`, `Portal`, `Positioner`, `Popup`, `Level`, `Item`, `ItemIndicator`): a select-only combobox whose popup holds one listbox per open level, ArrowRight and ArrowLeft opening and closing a level (swapped in RTL), typeahead per level, the value as the path of keys, `changeOnSelect` to choose a parent, levels opened on hover after a delay with Menu's safe triangle, a Field control submitting the path joined by `valueSeparator`. The toolkit gains `/command` (the scorer, `commandMatches`, `bestMatch`, `commandKeyTarget`) and `/cascade` (the levels of a path and `cascadeKeyAction`). Every other entry is unchanged.
|
|
18
|
+
|
|
19
|
+
- [#42](https://github.com/fragiola/primitives/pull/42) [`9a25db8`](https://github.com/fragiola/primitives/commit/9a25db8bbabbf9839df1d67c7b7d5609a9fc3da3) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Controls and display components, natively in React, Vue and Angular, each in its own entry. `/button`: a native `button` or a `render` element with `role="button"` and a native button's keys (`nativeButton`), `disabled` and `focusableWhenDisabled`. `/radio-group` and `/radio`: the APG radio group (one tab stop at the checked radio, arrows move and check, mirrored in RTL through the direction provider, `loopFocus`, `orientation`), hidden radio inputs (`name`, `required`, form reset) and Field support. `/switch`: the APG switch (`Root`, `Thumb`) with a hidden checkbox input, `uncheckedValue`, `required`, `readOnly` and Field support. `/progress`: a `progressbar` (`Root`, `Label`, `Value`, `Track`, `Indicator`), determinate or indeterminate (`value={null}`), `min`/`max`, `format`/`locale`, `data-progressing`/`data-complete`/`data-indeterminate` and the `--progress-indicator-size` variable. `/avatar`: `Root`, `Image` (rendered only once loaded, `onLoadingStatusChange`) and `Fallback` (`delay`). `/separator`: `role="separator"` with `aria-orientation`, or `decorative`. The toolkit gains `radioKeyTarget` (`/collection`), `progressValue` (`/range`) and a new `/image` entry (`watchImageStatus`).
|
|
20
|
+
|
|
21
|
+
- [#15](https://github.com/fragiola/primitives/pull/15) [`4a14f67`](https://github.com/fragiola/primitives/commit/4a14f670452fb8496e93f6a8da760db076368bb5) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Calendar, RangeCalendar, DatePicker and DateRangePicker, natively in React, Vue and Angular, one entry each (`/calendar`, `/range-calendar`, `/date-picker`, `/date-range-picker`) over shared modules: a month grid with the APG date grid's keyboard (Home and End by week, Page Up and Page Down by month, with Shift by year), `min`, `max`, unavailable dates, several visible months, the locale's names and first weekday from `Intl`, and plain `{ year, month, day }` dates with no time zone. A RangeCalendar previews the range being chosen and swaps a reversed one. The pickers are non-modal popups holding a bound calendar: they open on the value, close on a choice and return focus to the trigger (`data-popup-open` on it). Every part carries `data-primitives-part`, `calendar-*` or `range-calendar-*`, `date-picker-*` or `date-range-picker-*`, by its root.
|
|
22
|
+
|
|
23
|
+
- [#43](https://github.com/fragiola/primitives/pull/43) [`8b728c8`](https://github.com/fragiola/primitives/commit/8b728c80a53e76ce2182c395e181e24a8a67e5bd) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Disclosure components, natively in React, Vue and Angular, each in its own entry. `/collapsible` (`Root`, `Trigger`, `Panel`): the APG disclosure, `open`/`defaultOpen`, `disabled`, and a panel animatable in CSS with no layout jump: `--collapsible-panel-height`/`-width` are the content's size in pixels while it opens or closes (set before the transition starts) and `auto` at rest, with `data-starting-style`/`data-ending-style`; `keepMounted`, and `hiddenUntilFound` (`hidden="until-found"`: the browser's find-in-page opens a closed panel). `/accordion` (`Root`, `Item`, `Header`, `Trigger`, `Panel`): the APG accordion, `value`/`defaultValue` as an array, `multiple`, `disabled`, `orientation`, `loopFocus`, the arrows, Home and End between the enabled triggers (mirrored in RTL), and the same panel mechanics with `--accordion-panel-height`/`-width`. Tabs gains `data-activation-direction` (physical: `left`, `right`, `up`, `down`, `none`) on every part, panel enter and exit states (`data-starting-style`, `data-ending-style`, `inert` while exiting, with `keepMounted`), and the Indicator's physical variables `--active-tab-left`/`-right`/`-top`/`-bottom`/`-width`/`-height`. The toolkit gains `measurePanelSize`, `freezePanelSize`, `panelSizeVariables` and `watchBeforeMatch` (`/presence`), and `accordionKeyTarget`, `activationDirection` and `tabsIndicatorBox` (`/collection`).
|
|
24
|
+
|
|
25
|
+
- [#45](https://github.com/fragiola/primitives/pull/45) [`2cdeeb7`](https://github.com/fragiola/primitives/commit/2cdeeb753fb0af082792230a89e16b5014fd541b) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Drawer and NavigationMenu, natively in React, Vue and Angular, which complete stage 1. The toolkit gains the `/swipe` entry: `watchSwipe` (pointer and touch swipes that lock on an axis after 6 px, with pointer capture, scroll containment and a touch that does not scroll the page), `swipeRelease`, `swipeMovement`, `swipeProgress` and `resolveSnapPoints`; only Drawer imports it. New entry `/drawer`, built on Dialog's parts plus a `Content`: a modal panel at an edge (`swipeDirection`, `"down"` by default) dismissed by a swipe (the new reason `swipe`), with snap points (`snapPoints`, `snapPoint` / `defaultSnapPoint` / `onSnapPointChange`), nested drawers (`data-nested-drawer-open`, `--nested-drawers`), `data-swiping`, `data-swipe-direction`, `data-swipe-dismiss`, `data-expanded` and the variables `--drawer-swipe-movement-x`, `--drawer-swipe-movement-y`, `--drawer-snap-point-offset` and `--drawer-swipe-progress`, and a Drawer handle. New entry `/navigation-menu`: the APG disclosure navigation menu with Base UI's parts (Root, List, Item, Trigger, Icon, Content, Link, Portal, Backdrop, Positioner, Popup, Viewport, Arrow), hover and press opening with delays, the arrow keys between the items, the open key into a Content, one shared popup sized by the open Content (`--popup-width`, `--popup-height`, `--positioner-width`, `--positioner-height`), `data-activation-direction` on the Contents, and nested levels through the overlay tree.
|
|
26
|
+
|
|
27
|
+
- [#41](https://github.com/fragiola/primitives/pull/41) [`61ea9c0`](https://github.com/fragiola/primitives/commit/61ea9c01d64c76faeb14373afaddf31bf7152170) Thanks [@maurodesouza](https://github.com/maurodesouza)! - The Field layer to production, natively in React, Vue and Angular. Field's `validate` may be async (the latest run wins, a value already validated is not validated again), `Field.Error`'s `match` takes a function of the validity, and `validationMode` defaults to the enclosing Form's. New entries `/fieldset` (a `fieldset` named by its Legend, disabling every Field inside it, nested ones too) and `/form` (a native form that validates every field on submission, blocks it and focuses the first invalid field, shows server `errors` on the fields they name and reports `onClearErrors`). Every form control is a Field control: CheckboxGroup joins Checkbox, Select, Slider and Combobox, and the DatePicker and DateRangePicker gain form support (`name`, a visually hidden input with ISO dates, the range as `start/end`, `required`, `disabled`, `readOnly`, form reset). Slider gains `Label`, `Value` (an `<output>`), `format` and `locale` (Angular's value type is now `SliderRootValue`, `SliderValue` being the new directive). New entries `/direction` (`DirectionProvider` and `useDirection` / `injectDirection` / `provideDirection`, read by Tabs, Slider, Menu, Combobox's chips, the calendars and every positioned popup, with the computed direction as fallback) and `/render` (React's `useRender` and `mergeProps`, Vue's `renderPart`, `asProp` and `stateAttributes`, Angular's `dataValue` and `dataValues`). The toolkit's form entry gains `createFieldValidator`, the Form's errors and submission guard; a form bridge now focuses only the first invalid control's primitive; `getDirection` and `anchorFloating` take a provided direction.
|
|
28
|
+
|
|
29
|
+
- [#114](https://github.com/fragiola/primitives/pull/114) [`a875764`](https://github.com/fragiola/primitives/commit/a87576477ac4c06f476a23f9591b244a89addf5e) Thanks [@maurodesouza](https://github.com/maurodesouza)! - DropZone and FileUpload, natively in React, Vue and Angular, each in its own entry. `/drop-zone` (`DropZone.Root`): a drop target for files (native file drag only), an APG button that opens the browser's file dialog on Enter, Space or a click and takes a paste of files (Ctrl/⌘+V), `accept` filtering into accepted and rejected files, `multiple`, `disabled`, `data-drop-target` while files are dragged over it, and a polite live region the app's `announcement` text is written into. `/file-upload` (`FileUpload`: `Root`, `Label`, `Dropzone`, `Trigger`, `HiddenInput`, `ItemGroup`, `Item`, `ItemName`, `ItemSizeText`, `ItemPreview`, `ItemPreviewImage`, `ItemDeleteTrigger`, `ClearTrigger`): a form control holding the accepted files (`value`), checked by `accept`, `maxFiles`, `minFileSize`, `maxFileSize` and `validate` into a rejected list with its reasons (`invalid-type`, `too-large`, `too-small`, `too-many`, the app's own), sizes in the locale's decimal bytes from `Intl.NumberFormat`, image previews through object URLs revoked when they unmount, the focus moved on when an Item is deleted, and a Field control whose files reach the native form through its hidden file input (assigned with a `DataTransfer`), `required` and form reset included; no upload transport. The toolkit gains `/file` (`watchFileDrop`, `openFileDialog`, `acceptsFile`, `acceptFiles`, `checkFiles`, `formatFileSize`, `assignFiles`). Every other entry is unchanged.
|
|
30
|
+
|
|
31
|
+
- [#12](https://github.com/fragiola/primitives/pull/12) [`adcfc42`](https://github.com/fragiola/primitives/commit/adcfc421cdda72b2ff8c91943b43fd3dd4ebb48e) Thanks [@maurodesouza](https://github.com/maurodesouza)! - First version: the framework-free DOM toolkit (`@fragiola/primitives`, one entry per mechanism) and Dialog and Tabs, natively in React, Vue and Angular, one entry per component.
|
|
32
|
+
|
|
33
|
+
- [#14](https://github.com/fragiola/primitives/pull/14) [`7c154f1`](https://github.com/fragiola/primitives/commit/7c154f169d3febbfb10228345e9822f8f25e33f6) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Field, Checkbox, CheckboxGroup, Slider, Select and Combobox, natively in React, Vue and Angular, one entry each (`/field`, `/checkbox`, `/checkbox-group`, `/slider`, `/select`, `/combobox`), with form support: hidden inputs, native submit, reset and validation, and the Field layer. Select keeps DOM focus on its trigger with `aria-activedescendant`, Tab chooses the highlighted option, a printable key on the closed trigger opens the list on the match, and a `modal` option (non-modal by default) locks the scroll and blocks the outside pointer. Combobox filters its `items`, takes object values and `multiple` with chips, and resets its text on Escape. The toolkit's collection entry gains `scrollIntoViewWithin`.
|
|
34
|
+
|
|
35
|
+
- [#40](https://github.com/fragiola/primitives/pull/40) [`aa1fee3`](https://github.com/fragiola/primitives/commit/aa1fee3ac90fd1965446e77ab7bc4227ad08e9cb) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Hardening: the Stage 0 follow-ups and server rendering. Angular's overlays play their exit transition before they unmount, as React's and Vue's, and can be reopened during it; Angular's Tabs Indicator is structural (`*tabsIndicator`), not rendered while no tab is selected. A close made through a controlled `open` uses its own reason for the focus return (a Popover returns focus left inside it); a Tooltip.Provider keeps one delay group when its props change and reads `timeout` reactively; a key on an open Menu trigger leaves no pending highlight; Escape cancels a RangeCalendar's started range before an enclosing picker, dialog or popover closes; Vue decides a calendar's picker binding from its current props, and types the Combobox callbacks by the consumer's own item (`ComboboxFilter`, `ComboboxItemEquality`, `ComboboxItemToString`). Every component renders on the server and hydrates without a mismatch: a calendar with no `locale` renders `en-US` first and takes the document's language once mounted, Angular's ids come from an application's own counter, Angular's hidden inputs are added after hydration, and the Tabs Indicator's `renderBeforeHydration` places it before hydration with an inline script (the toolkit's `placeTabsIndicator`). The toolkit's `createDelayGroup` takes a `timeout` getter, `interceptEscape` a `when` filter, and an overlay session returns focus left inside a closing overlay for its `whenUnfocused` reasons.
|
|
36
|
+
|
|
37
|
+
- [#66](https://github.com/fragiola/primitives/pull/66) [`ff00fb9`](https://github.com/fragiola/primitives/commit/ff00fb90318d343d4ad3bbc2066a4d69278a8016) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Inputs, natively in React, Vue and Angular, each in its own entry. `/label`: a standalone `<label>` that names its control by `for` or by wrapping it, focuses a target `for` cannot label (a Slider's thumb) and selects no text on a double press. `/number-field` (`Root`, `Group`, `Input`, `Increment`, `Decrement`, `ScrubArea`, `ScrubAreaCursor`): the APG spinbutton, a number or `null` with `min`, `max`, `step`, `smallStep`, `largeStep`, `snapOnStep` and `clampOnBlur`, the arrows, Page Up/Down, Home and End, held buttons that repeat, an opt-in wheel (`allowWheelScrub`), a scrub area under the pointer lock with its virtual cursor, `format` and `locale` through `Intl.NumberFormat` with the localized text read back (grouping, decimal separators, Arabic-Indic digits, currency and percent), a hidden number input for native forms and the Field layer. `/meter`: the APG meter (`Root`, `Label`, `Value`, `Track`, `Indicator`), its value written by `format`/`locale`. `/otp-field` (`Root`, `Input`): one native input per slot in a named group with one tab stop, typing forward, Backspace back, Delete, the arrows (mirrored in RTL), paste and one-time-code autofill, `length`, `validationType` (digits, letters, both, any, or a `RegExp`), `mask`, `onValueComplete`, `onValueInvalid`, a hidden input whose pattern refuses an incomplete code, and the Field layer. The toolkit gains `/number` (`formatNumber`, `parseNumber`, `isNumberText`, `stepNumber`, `clampNumber`, `watchAutoRepeat`, `watchScrub`), and `/form` a Label's press and the OTP value rules.
|
|
38
|
+
|
|
39
|
+
- [#110](https://github.com/fragiola/primitives/pull/110) [`b3f9578`](https://github.com/fragiola/primitives/commit/b3f9578876189f63946779be36cd0377a094455c) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Navigation, natively in React, Vue and Angular, each in its own entry. `/link` (`Link`): the APG link on your anchor or your router's link (React `render`, Vue `as`, Angular on `routerLink`'s anchor), `current` (`aria-current="page"`) and `disabled` (`aria-disabled`, still a tab stop, its click stopped in its capture phase so no router navigates); no router dependency. `/breadcrumbs` (`Breadcrumbs`: `Root`, `List`, `Item`, `Link`, `Current`, `Separator`, `Ellipsis`): the APG breadcrumb, a named `nav` of an ordered list, separators hidden from assistive technology, an Ellipsis you compose with a Menu's trigger. `/steps` (`Steps`: `Root`, `List`, `Item`, `Trigger`, `Indicator`, `Separator`, `Content`, `PrevTrigger`, `NextTrigger`, `CompletedContent`): a process in `count` steps, an ordered list with `aria-current="step"`, `step` / `defaultStep` / `onStepChange` (reasons `trigger-press`, `previous-press`, `next-press`), the completed state at `count`, `linear` with `isStepValid`, `orientation`. `/carousel` (`Carousel`: `Root`, `ItemGroup`, `Item`, `PrevTrigger`, `NextTrigger`, `IndicatorGroup`, `Indicator`, `AutoplayTrigger`): the APG carousel, basic or tabbed (`variant`), native CSS scroll snapping, `slidesPerPage`, `slidesPerMove`, `loop`, `orientation`, `spacing`, a mouse drag, `page` and `playing` controlled or not, a rotation every `delay` that focus entering stops and a hover pauses (keeping the time it had left), `aria-live` off while rotating, RTL. Two new change reasons, `autoplay` and `focus-in`. The toolkit gains `/carousel` (the pages, the scroll to a page and the page a scroll settled on, the mouse drag, the hover and focus watch and the rotation's delay). Every existing component entry is unchanged.
|
|
40
|
+
|
|
41
|
+
- [#44](https://github.com/fragiola/primitives/pull/44) [`28add86`](https://github.com/fragiola/primitives/commit/28add86384c2f734c36a3c7d6a30c203b540379c) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Overlays to production, natively in React, Vue and Angular. A tree of nested overlays: an overlay opened from another one's popup is its child, so outside presses, Escape, focus traps and focus-out watches work across a Popover inside a Dialog, menus opened from popovers, and portals, and closing an overlay closes the ones opened from it (the toolkit's `/layers`: `owner`, `backdrops`, `onParentClose`). Every overlay's `onOpenChange` receives `OpenChangeDetails` (`reason`, the new `imperative-action` reason, `event`, `trigger`, `cancel()`, `isCanceled`, `preventUnmountOnClose()`), and every overlay gains `onOpenChangeComplete`, imperative actions (`close()`, `unmount()`: React `actionsRef`, Vue the Root's template ref, Angular the root directive), the Portal's `keepMounted` and `data-closed`. Detached triggers for Dialog, AlertDialog, Popover, Menu and Tooltip: `createHandle()` (`create<Component>Handle`), triggers anywhere with `handle`, `payload` and `id`, the active trigger's payload in the Root's content, `triggerId` / `defaultTriggerId`, and the handle's `open`, `openWithPayload`, `close` and `isOpen`. Dialog gains a `Viewport` part, `data-nested`, `data-nested-dialog-open`, `--nested-dialogs` and Backdrop `forceRender`. New entries `/alert-dialog` (`role="alertdialog"`, no outside dismissal, focus on the least destructive action, built on Dialog's parts) and `/context-menu` (right-click at the pointer, a 500 ms touch long press, Shift+F10 and the ContextMenu key, built on Menu's parts). Menu gains `CheckboxItem`, `CheckboxItemIndicator`, `RadioGroup`, `RadioItem` and `RadioItemIndicator`; Select gains `Group`, `GroupLabel`, `Separator`, `ItemText` and an optional `items`. The toolkit gains `virtualAnchor` (`/positioning`), `watchLongPress` (`/pointer`) and `trapFocus`'s `holdOutsidePress` (`/focus`); `anchorFloating` no longer flips a top or bottom placement's start and end twice in RTL. The Angular portal no longer reads `document` on a server.
|
|
42
|
+
|
|
43
|
+
- [#13](https://github.com/fragiola/primitives/pull/13) [`d5fc5e5`](https://github.com/fragiola/primitives/commit/d5fc5e5ebd5ce18cd7ff58496afd52141befd07e) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Popover, Tooltip and Menu (with submenus), natively in React, Vue and Angular, one entry each (`/popover`, `/tooltip`, `/menu`). Popover focuses its first tabbable element and, after a press outside, returns focus to its trigger unless the press focused something; Tooltip wires `role="tooltip"` and `aria-describedby` and stays open while hovered; Menu is non-modal by default with a `modal` option. The toolkit's sides follow Base UI: `top`, `bottom`, `inline-start`, `inline-end`, `left`, `right`.
|
|
44
|
+
|
|
45
|
+
- [#84](https://github.com/fragiola/primitives/pull/84) [`d1a01e5`](https://github.com/fragiola/primitives/commit/d1a01e5d543c42bb45253c119d7d643ea91e72bc) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Range fields and the pickers' typed input, natively in React, Vue and Angular, each in its own entry. `/date-range-field` (`Root`, `Input` with a required `range`, `"start"` or `"end"`, `Segment`): a start and an end date (or date and time) typed in segments, each an APG spinbutton, as one sequence (typing moves on into the end, Backspace and the arrows cross back), a `DateRange` value once both ends are complete, an end before the start invalid through the hidden inputs' crossed `min` / `max` (`rangeOverflow` / `rangeUnderflow`), `startName` and `endName`, `min`, `max`, `isDateUnavailable`, `granularity`, `required`, `readOnly`, `disabled`, form reset and Field support. `/time-range-field`: the same over a `TimeRange` (no range across midnight). `/date-picker-input` (`DatePickerInput`: `Root`, `Segments`, `Segment`) and `/date-range-picker-input` (`DateRangePickerInput`): opt-in roots that replace the picker's Root and add DateField segments beside its Trigger, bound both ways (a typed entry sets the value only when complete and valid, a chosen date fills the segments, a time granularity's calendar chooses the date part and keeps the typed time), with the picker's form and the segments as the Field control; `/date-picker` and `/date-range-picker` are unchanged. The toolkit's `segmentTarget` moves across several groups, and `/time` gains the `TimeRange` type.
|
|
46
|
+
|
|
47
|
+
- [#70](https://github.com/fragiola/primitives/pull/70) [`0446ffb`](https://github.com/fragiola/primitives/commit/0446ffb8b82dfa6b76016c33e7a11df06feee7f8) Thanks [@maurodesouza](https://github.com/maurodesouza)! - ScrollArea, Pagination and AspectRatio, natively in React, Vue and Angular, each in its own entry, completing stage 2. `/scroll-area` (`Root`, `Viewport`, `Content`, `Scrollbar`, `Thumb`, `Corner`): native scrolling (keyboard, wheel, touch) with custom scrollbars whose thumb drags and whose track takes a press, a scrollbar rendered only while its axis overflows (`keepMounted`), `data-scrolling`, `data-hovering`, the overflow attributes (`data-has-overflow-*`, `data-overflow-{x,y}-{start,end}`, logical in RTL, `overflowEdgeThreshold`) and the `--scroll-area-overflow-*`, `--scroll-area-thumb-*` and `--scroll-area-corner-*` variables, and a viewport tab stop only while it overflows with nothing focusable in it. `/pagination` (`Root`, `Item`, `Ellipsis`, `Previous`, `Next`, `First`, `Last`): a `nav` landmark with `page`/`defaultPage`/`onPageChange`, `count` or `total` and `pageSize`, `siblingCount`, `boundaryCount`, `aria-current="page"`, buttons or links (`nativeButton`), disabled edges. `/aspect-ratio`: one box at a `ratio`. The toolkit gains `/scroll-area` (`createScrollArea`, the scroll area's measurement and pointer) and `/pagination` (`paginationRange`, `pageCount`, `clampPage`), which only these components import.
|
|
48
|
+
|
|
49
|
+
- [#83](https://github.com/fragiola/primitives/pull/83) [`22f6eb0`](https://github.com/fragiola/primitives/commit/22f6eb0a8422ab98c7ab17423d5cbbe556c4b7c0) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Segmented date and time fields, natively in React, Vue and Angular, each in its own entry. `/date-field` (`Root`, `Input`, `Segment`): a date typed in segments, each an APG spinbutton, in the order, digits and names `Intl` gives the locale; digits fill a segment and move on, the arrows step it with a wrap, Page Up/Down by a larger step, Home and End to its edges, ArrowLeft and ArrowRight to the segment on that side of the screen, Backspace erases; `granularity` (`day`, or `hour`, `minute`, `second` for a `PlainDateTime`), `placeholderValue`, `hourCycle`, `min`, `max`, `isDateUnavailable` (invalid values carry `data-invalid`), `locale`, a hidden native `date` or `datetime-local` input for forms, and the Field layer. `/time-field`: the same anatomy over a `PlainTime`, with the locale's hour cycle and the day period typed by its first letter, submitting an ISO time. The toolkit gains `/time` (`PlainTime`, `PlainDateTime`, their comparison, math and ISO text) and `/segments` (the segment editing on `Intl.DateTimeFormat#formatToParts`), written in-house with no date library; only the two fields import them.
|
|
50
|
+
|
|
51
|
+
- [#108](https://github.com/fragiola/primitives/pull/108) [`2f1dc46`](https://github.com/fragiola/primitives/commit/2f1dc468857df4cfacc689463cbc68953fa94b60) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Tags, natively in React, Vue and Angular, each in its own entry. `/tag-group` (`Root`, `Label`, `List`, `Tag`, `TagCell`, `RemoveButton`): React Aria's grid of tags (a `grid` of `row`s with one `gridcell` each, a `group` while empty), one tab stop, the arrows of both axes (mirrored in RTL), Home and End, `loopFocus`, `selectionMode` `none`, `single` or `multiple` (Space, Enter, a press), `disabledKeys` and disabled tags that never take focus, `onRemove` from Delete, Backspace or a RemoveButton with the focus moved to the next tag, else the previous one, else the List, `data-empty`, and the Field layer's label and description. `/tags-input` (`Root`, `Control`, `Input`, `Tag`, `TagText`, `TagRemove`, `TagInput`, `ClearTrigger`): a text input whose Enter, `delimiter` and pasted lists add trimmed tags, refused as duplicates (unless `allowDuplicates`), past `max` or by `validate` (`onValueInvalid` with its `cause`), the tags reached with Backspace and the arrows and removed with Backspace or Delete, `editable` tags edited in place, `blurBehavior` (`"add"`, `"clear"`), a controlled text (`inputValue`), one hidden input per tag for native forms (submit, reset, `required`) and the Field layer. The toolkit gains the tags' keys in `/collection` (`tagGroupKeyTarget`, `removalFocusIndex`, `tagsInputInputKeyTarget`, `tagsInputTagKeyTarget`) and their rules in `/form` (`takeTags`, `editTag`, `typesDelimiter`). Every existing entry is unchanged. Choices, in their own entries too. `/segmented-control` (`Root`, `Item`, `ItemText`, `Indicator`): the APG radio group (a `radiogroup` of `radio` Items, one tab stop, every arrow moves and checks, RTL, `loopFocus`, `orientation`, disabled Items skipped) with an Indicator whose ten `--segment-indicator-*` variables (logical and physical, from the Root's padding box) follow the checked Item on a value change, a resize and the direction, `renderBeforeHydration` and `nonce` as Tabs', a hidden input for native forms (submit, reset, `required`) and the Field layer. `/rating` (`Root`, `Item`, `HiddenInput`): the APG's rating radio group (a `radio` per star, named by the app), `count`, `allowHalf` (half steps by the keys and by the inline-start half of a star, RTL included), `allowClear`, `readOnly`, `disabled`, a pointer preview (`highlighted`, `half`), arrows stepping the value with Home and End, the Root's and the Item's children functions, native forms and the Field layer. The toolkit gains `segmentIndicatorBox` and `placeSegmentIndicator` in `/collection` and `ratingKeyTarget`, `ratingValueAt` and `ratingItemState` in `/range`.
|
|
52
|
+
|
|
53
|
+
- [#109](https://github.com/fragiola/primitives/pull/109) [`dc21e7c`](https://github.com/fragiola/primitives/commit/dc21e7c678aad87c99b8129ca705a7a5775763b3) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Text inputs, natively in React, Vue and Angular, each in its own entry. `/password-input` (`Root`, `Input`, `VisibilityTrigger`): a native input whose `type` switches between `password` and `text`, `visible`, `defaultVisible` and `onVisibleChange`, the trigger an APG toggle button (`aria-pressed`, `aria-controls`) whose pointer press keeps the focus in the Input and whose change keeps its selection, the text hidden again on a form submission and reset, `autoComplete` and every attribute passed through, native forms and the Field layer. `/search-field` (`Root`, `Input`, `ClearButton`): React Aria's search field, `type="search"`, Escape clearing a query and left to the page on an empty field, Enter calling `onSubmit` (Angular `(valueSubmit)`), a ClearButton out of the tab order that focuses the Input, native forms and the Field layer. `/clipboard` (`Root`, `Trigger`, `Indicator`, `Input`): a copy with the asynchronous Clipboard API, `timeout`, `onStatusChange` (`idle`, `copied`, `failed`), a polite live region with the app's `announcement` and `failedAnnouncement`, and on a refused write the Input focused with its text selected (no `execCommand` fallback). `/editable` (`Root`, `Area`, `Preview`, `Input`, `EditTrigger`, `SubmitTrigger`, `CancelTrigger`): a text edited in place, `activationMode` (`focus`, `click`, `dblclick`, `none`), `submitMode` (`enter`, `blur`, `both`, `none`), `onValueCommit` and `onValueRevert`, Escape reverting, the focus returned to the EditTrigger or the Preview, `placeholder`, `maxLength`, `readOnly`, `disabled`, an `input` or a `textarea`, native forms and the Field layer. The change reasons gain `submit-press` and `cancel-press`. The toolkit gains `/clipboard` (`writeClipboard`, `announceText`). Every existing entry is unchanged.
|
|
54
|
+
|
|
55
|
+
- [#69](https://github.com/fragiola/primitives/pull/69) [`da38200`](https://github.com/fragiola/primitives/commit/da382005a845e55717d493aff43ebaa6797f4c59) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Toast and HoverCard, natively in React, Vue and Angular, each in its own entry (`/toast`, `/hover-card`). Toast renders a toast queue that lives outside every framework: `createToastManager` (also from each `/toast` entry) holds the app's notifications, so a plain module can import it and add toasts with no component, with `add`, `update`, `close`, promise toasts (loading, then success or error), a `limit` with the rest queued (their timers wait), priorities, per-toast timeouts and pauses while hovered, focused or the page is hidden. Its Viewport is an F6 landmark with two live regions (polite and assertive) that announce each toast once, in order; its Root swipes away through the toolkit's `/swipe`, stacks with `--toast-index`, `--toast-offset-y` and `--toast-height`, and exits through presence (React `Toast.useToastManager`, Vue `useToastManager`, Angular `injectToastManager`). HoverCard (Base UI's PreviewCard) previews a link on hover and keyboard focus after `delay`, stays open while hovered across a safe area, closes after `closeDelay`, Escape or an outside press, never moves focus, and has detached triggers and the overlay lifecycle. The toolkit gains `/toast` (`createToastManager`, `watchToastViewport`, `measureToastHeight`); no new dependency.
|
|
56
|
+
|
|
57
|
+
- [#65](https://github.com/fragiola/primitives/pull/65) [`8ec7b25`](https://github.com/fragiola/primitives/commit/8ec7b252198cd52289e48d845721a6ce6c5532f4) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Toggles and bars, natively in React, Vue and Angular, each in its own entry. `/toggle`: a pressed button (`aria-pressed`, `data-pressed`), `pressed`/`defaultPressed`/`onPressedChange`, `value` for a group, `disabled`, on Button's behaviour (`nativeButton`). `/toggle-group`: single or `multiple` (the value is always an array of strings), `orientation`, `loopFocus`, `disabled`, one tab stop with the orientation's arrows (mirrored in RTL), Home and End. `/toolbar` (`Root`, `Button`, `Link`, `Input`, `Group`, `Separator`): the APG toolbar, one tab stop for the whole bar, the arrows, Home and End between its items, `orientation`, `loopFocus`, disabled items skipped unless `focusableWhenDisabled`; a ToggleGroup inside it joins its roving focus with no tab stop of its own, and an `Input` keeps its caret keys. `/menubar`: the APG menubar on Menu (its menus are `Menu.Root`s, their triggers the bar's items), one tab stop, the arrows moving between menus and opening the neighbour's while one is open, Down/Up/Enter/Space opening on the first or last item, hover switching once a menu is open, Escape back to the item, submenus and checkable items, `orientation`, `loopFocus`, `modal`, `disabled`, RTL. The toolkit gains the roving focus in `/collection` (`rovingKeyTarget`, `rovingKeys`, `rovingTabStop`, `textFieldKeepsKey`, `inDocumentOrder`).
|
|
58
|
+
|
|
59
|
+
- [#68](https://github.com/fragiola/primitives/pull/68) [`0b436f9`](https://github.com/fragiola/primitives/commit/0b436f9aa9ecf0caeb960998ea42aa672dac396e) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Virtual and async lists, natively in React, Vue and Angular, each an opt-in entry of its own, so a Listbox, Select, Combobox or Autocomplete that does not use them ships the same code. `/listbox-virtual` (`ListboxVirtual.Root` over `items`), `/select-virtual`, `/combobox-virtual` and `/autocomplete-virtual` (a `List` that replaces the component's List) render only the options in view of a list of thousands, with measured or fixed sizes (`itemSize`, `measure`), `overscan`, the keys, the typeahead, ranges and select all over every item, `aria-activedescendant` and the tab stop always on a rendered option, `aria-setsize` and `aria-posinset` on every option, `loading` (`data-loading`, `aria-busy`) and `onLoadMore` when the last row comes into view (Angular: a row directive per component and `loadMore`). `/async-list` (`useAsyncList`, Angular `injectAsyncList`) loads pages through a loader, with the filter text, load more, the loading and error states and a stale load aborted. The toolkit gains `/virtual` (`createVirtualizer`, `virtualLayout`, `pageIndex`, `scrollContainer`: written in-house, no new dependency) and `/async-list` (`createAsyncList`).
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- [#107](https://github.com/fragiola/primitives/pull/107) [`aa1ac78`](https://github.com/fragiola/primitives/commit/aa1ac78d75e4a0cf425e750a370c88f6afcecc53) Thanks [@maurodesouza](https://github.com/maurodesouza)! - The date family is smaller for an app that passes no `calendar` and no `timeZone`, with no behaviour change: the calendar systems and time zones carry the code they change, and the shared calendar, field and segment code calls one optional hook per concern. `/segments` is 427 B (min + gzip) smaller than after the calendar systems, every segmented field about 400 B, the React and Vue month and year pickers about 550 B, CalendarView about 300 B. `CalendarSystem` gains its segment hooks (`segmentFormat`, `segmentRange`, `segmentSample`, `segmentValuesOf`, `segmentsToDate`), `CalendarUnits` gains `page`, `today` and `nearest`, `TimeZone` gains `choose`, `wallTime`, `segmentOptions`, `segmentText` and `segmentsToDateTime`. Angular's `/month-calendar` no longer exports `ISO_UNITS` (use `unitsOf`). `pnpm size` budgets every date entry (`docs/size.md`, "Date budgets").
|
|
64
|
+
|
|
65
|
+
- [#65](https://github.com/fragiola/primitives/pull/65) [`8ccbff9`](https://github.com/fragiola/primitives/commit/8ccbff9b67b1664fd862942d5d11e8c9eaec5643) Thanks [@maurodesouza](https://github.com/maurodesouza)! - Stage 1 follow-ups. A Checkbox writes its rendered state back onto its hidden input after a form reset, so a controlled checkbox that refuses the reset keeps a matching input. The Tabs Indicator takes a `nonce` for its `renderBeforeHydration` script (Angular: `*tabsIndicator="true; nonce: cspNonce"`, else Angular's `CSP_NONCE`), so it runs under a Content Security Policy. An async `validate` in a mode that does not validate on change hides a shown error at once on a change. In a native form that mixes a picker and native controls, the browser no longer moves the focus on to a later invalid native control after the picker's trigger took it (the toolkit's form bridge). A calendar with no `locale` follows a later change of the document's `lang` (the toolkit's `watchDocumentLanguage`). A hover-opened Tooltip and NavigationMenu panel close when the pointer leaves the window or the iframe at once (the toolkit's `watchPointerExit`).
|
|
66
|
+
- Updated dependencies [[`6c9709d`](https://github.com/fragiola/primitives/commit/6c9709d93ecb80e5eeefd7b0ac5ef2399b02416d), [`2fef26d`](https://github.com/fragiola/primitives/commit/2fef26d1c42933b683e234fc7eb6038199f46ee1), [`7d8f3c3`](https://github.com/fragiola/primitives/commit/7d8f3c33d312b5244fb0d4eccafc7537a6088abd), [`349a6a2`](https://github.com/fragiola/primitives/commit/349a6a2aec56e0d5f69795cc08c953f94a7cc4cd), [`bdb079e`](https://github.com/fragiola/primitives/commit/bdb079e4f944166b6c21588e393cef6a3507b180), [`ffc61ee`](https://github.com/fragiola/primitives/commit/ffc61ee937691c5440d719919d39f73f0a4a3fbe), [`9a25db8`](https://github.com/fragiola/primitives/commit/9a25db8bbabbf9839df1d67c7b7d5609a9fc3da3), [`aa1ac78`](https://github.com/fragiola/primitives/commit/aa1ac78d75e4a0cf425e750a370c88f6afcecc53), [`8b728c8`](https://github.com/fragiola/primitives/commit/8b728c80a53e76ce2182c395e181e24a8a67e5bd), [`2cdeeb7`](https://github.com/fragiola/primitives/commit/2cdeeb753fb0af082792230a89e16b5014fd541b), [`61ea9c0`](https://github.com/fragiola/primitives/commit/61ea9c01d64c76faeb14373afaddf31bf7152170), [`a875764`](https://github.com/fragiola/primitives/commit/a87576477ac4c06f476a23f9591b244a89addf5e), [`adcfc42`](https://github.com/fragiola/primitives/commit/adcfc421cdda72b2ff8c91943b43fd3dd4ebb48e), [`7c154f1`](https://github.com/fragiola/primitives/commit/7c154f169d3febbfb10228345e9822f8f25e33f6), [`aa1fee3`](https://github.com/fragiola/primitives/commit/aa1fee3ac90fd1965446e77ab7bc4227ad08e9cb), [`ff00fb9`](https://github.com/fragiola/primitives/commit/ff00fb90318d343d4ad3bbc2066a4d69278a8016), [`b3f9578`](https://github.com/fragiola/primitives/commit/b3f9578876189f63946779be36cd0377a094455c), [`28add86`](https://github.com/fragiola/primitives/commit/28add86384c2f734c36a3c7d6a30c203b540379c), [`d5fc5e5`](https://github.com/fragiola/primitives/commit/d5fc5e5ebd5ce18cd7ff58496afd52141befd07e), [`d1a01e5`](https://github.com/fragiola/primitives/commit/d1a01e5d543c42bb45253c119d7d643ea91e72bc), [`0446ffb`](https://github.com/fragiola/primitives/commit/0446ffb8b82dfa6b76016c33e7a11df06feee7f8), [`22f6eb0`](https://github.com/fragiola/primitives/commit/22f6eb0a8422ab98c7ab17423d5cbbe556c4b7c0), [`8ccbff9`](https://github.com/fragiola/primitives/commit/8ccbff9b67b1664fd862942d5d11e8c9eaec5643), [`2f1dc46`](https://github.com/fragiola/primitives/commit/2f1dc468857df4cfacc689463cbc68953fa94b60), [`dc21e7c`](https://github.com/fragiola/primitives/commit/dc21e7c678aad87c99b8129ca705a7a5775763b3), [`da38200`](https://github.com/fragiola/primitives/commit/da382005a845e55717d493aff43ebaa6797f4c59), [`8ec7b25`](https://github.com/fragiola/primitives/commit/8ec7b252198cd52289e48d845721a6ce6c5532f4), [`0b436f9`](https://github.com/fragiola/primitives/commit/0b436f9aa9ecf0caeb960998ea42aa672dac396e)]:
|
|
67
|
+
- @fragiola/primitives@0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mauro de Souza
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @fragiola/primitives-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Headless, accessible React 19 primitives of [Fragiola Primitives](https://fragiola.com/primitives):
|
|
4
|
+
behaviour, keyboard, focus and ARIA, with no CSS, no icons and no text. You render and style every
|
|
5
|
+
part; state comes out as `data-*` and ARIA attributes.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @fragiola/primitives-react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**One entry per component**: import from `@fragiola/primitives-react/<component>` (or the root,
|
|
12
|
+
which only re-exports them). An app that uses Dialog and Tabs bundles only those two.
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { Dialog } from "@fragiola/primitives-react/dialog";
|
|
16
|
+
|
|
17
|
+
<Dialog.Root>
|
|
18
|
+
<Dialog.Trigger>Edit profile</Dialog.Trigger>
|
|
19
|
+
<Dialog.Portal>
|
|
20
|
+
<Dialog.Backdrop />
|
|
21
|
+
<Dialog.Popup>
|
|
22
|
+
<Dialog.Title>Edit profile</Dialog.Title>
|
|
23
|
+
<Dialog.Description>Change your display name.</Dialog.Description>
|
|
24
|
+
<Dialog.Close>Close</Dialog.Close>
|
|
25
|
+
</Dialog.Popup>
|
|
26
|
+
</Dialog.Portal>
|
|
27
|
+
</Dialog.Root>;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| entry | namespace |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `/dialog` | `Dialog`: `Root`, `Trigger`, `Portal`, `Backdrop`, `Popup`, `Title`, `Description`, `Close` |
|
|
33
|
+
| `/tabs` | `Tabs`: `Root`, `List`, `Tab`, `Indicator`, `Panel` |
|
|
34
|
+
|
|
35
|
+
Every part takes `render` (an element, or `(props, state) => node`), `className` and `style` (a
|
|
36
|
+
value or a function of the state) and a `ref`; other props are forwarded, and your handlers run
|
|
37
|
+
after the part's own. Every element carries `data-primitives-part="<component>-<part>"`.
|
|
38
|
+
|
|
39
|
+
Peer dependencies: `react` and `react-dom` 19. ESM only. MIT licence.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { t as useRequiredContext } from "./use-required-context-Cjd_CYnv.js";
|
|
2
|
+
import { t as renderElement } from "./render-element-DXbUbfgN.js";
|
|
3
|
+
import { t as stateAttributes } from "./state-attributes-DhboDeMS.js";
|
|
4
|
+
import { t as usePanelTransition } from "./use-panel-transition-CKMdsqPR.js";
|
|
5
|
+
import { t as DirectionContext } from "./direction-context-CiRdNJmu.js";
|
|
6
|
+
import { t as useControllableState } from "./use-controllable-state-Dm8eNkgP.js";
|
|
7
|
+
import { createContext, useCallback, useContext, useId, useMemo } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { accordionKeyTarget } from "@fragiola/primitives/collection";
|
|
10
|
+
import { getDirection } from "@fragiola/primitives/direction";
|
|
11
|
+
// src/components/accordion/accordion-context.ts
|
|
12
|
+
const AccordionContext = createContext(null);
|
|
13
|
+
const AccordionItemContext = createContext(null);
|
|
14
|
+
const triggerId = (baseId, value) => `${baseId}-trigger-${encodeURIComponent(value)}`;
|
|
15
|
+
const panelId = (baseId, value) => `${baseId}-panel-${encodeURIComponent(value)}`;
|
|
16
|
+
/** `data-open` / `data-closed` (exactly one) and `data-disabled` (spec/accordion.md). */
|
|
17
|
+
function itemAttributes(state) {
|
|
18
|
+
return {
|
|
19
|
+
open: state.open,
|
|
20
|
+
closed: !state.open,
|
|
21
|
+
disabled: state.disabled
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
// src/components/accordion/accordion-header.tsx
|
|
25
|
+
/** The heading around a Trigger, an `h3` (spec/accordion.md). */
|
|
26
|
+
function AccordionHeader(props) {
|
|
27
|
+
const item = useRequiredContext(AccordionItemContext, "Accordion.Header");
|
|
28
|
+
const state = {
|
|
29
|
+
open: item.open,
|
|
30
|
+
disabled: item.disabled,
|
|
31
|
+
orientation: item.orientation
|
|
32
|
+
};
|
|
33
|
+
return renderElement("h3", props, state, {
|
|
34
|
+
"data-primitives-part": "accordion-header",
|
|
35
|
+
...stateAttributes(itemAttributes(state))
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
// src/components/accordion/accordion-item.tsx
|
|
39
|
+
/** One section: its header and its panel (spec/accordion.md). */
|
|
40
|
+
function AccordionItem({ value, disabled: disabledProp = false, ...props }) {
|
|
41
|
+
const root = useRequiredContext(AccordionContext, "Accordion.Item");
|
|
42
|
+
const open = root.value.includes(value);
|
|
43
|
+
const disabled = root.disabled || disabledProp;
|
|
44
|
+
const { toggle, orientation, baseId } = root;
|
|
45
|
+
const setOpen = useCallback((next, reason) => toggle(value, next, reason), [toggle, value]);
|
|
46
|
+
const context = useMemo(() => ({
|
|
47
|
+
value,
|
|
48
|
+
open,
|
|
49
|
+
disabled,
|
|
50
|
+
orientation,
|
|
51
|
+
triggerId: triggerId(baseId, value),
|
|
52
|
+
panelId: panelId(baseId, value),
|
|
53
|
+
setOpen
|
|
54
|
+
}), [
|
|
55
|
+
value,
|
|
56
|
+
open,
|
|
57
|
+
disabled,
|
|
58
|
+
orientation,
|
|
59
|
+
baseId,
|
|
60
|
+
setOpen
|
|
61
|
+
]);
|
|
62
|
+
const state = {
|
|
63
|
+
open,
|
|
64
|
+
disabled,
|
|
65
|
+
orientation
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ jsx(AccordionItemContext.Provider, {
|
|
68
|
+
value: context,
|
|
69
|
+
children: renderElement("div", props, state, {
|
|
70
|
+
"data-primitives-part": "accordion-item",
|
|
71
|
+
...stateAttributes({
|
|
72
|
+
...itemAttributes(state),
|
|
73
|
+
orientation
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// src/components/accordion/accordion-panel.tsx
|
|
79
|
+
/** A section's content, a `region` named by its Trigger (spec/accordion.md). */
|
|
80
|
+
function AccordionPanel({ keepMounted = false, hiddenUntilFound = false, ...props }) {
|
|
81
|
+
const item = useRequiredContext(AccordionItemContext, "Accordion.Panel");
|
|
82
|
+
const { open, disabled, orientation } = item;
|
|
83
|
+
const panel = usePanelTransition({
|
|
84
|
+
open,
|
|
85
|
+
prefix: "accordion",
|
|
86
|
+
keepMounted,
|
|
87
|
+
hiddenUntilFound,
|
|
88
|
+
onFound: () => item.setOpen(true, "none")
|
|
89
|
+
});
|
|
90
|
+
if (!panel.rendered) return null;
|
|
91
|
+
const state = {
|
|
92
|
+
open,
|
|
93
|
+
disabled,
|
|
94
|
+
orientation,
|
|
95
|
+
transitionStatus: panel.status
|
|
96
|
+
};
|
|
97
|
+
return renderElement("div", props, state, {
|
|
98
|
+
role: "region",
|
|
99
|
+
id: item.panelId,
|
|
100
|
+
"aria-labelledby": item.triggerId,
|
|
101
|
+
hidden: panel.hidden || void 0,
|
|
102
|
+
"data-primitives-part": "accordion-panel",
|
|
103
|
+
...stateAttributes({
|
|
104
|
+
...itemAttributes({
|
|
105
|
+
open,
|
|
106
|
+
disabled
|
|
107
|
+
}),
|
|
108
|
+
orientation,
|
|
109
|
+
"starting-style": panel.status === "starting",
|
|
110
|
+
"ending-style": panel.status === "ending"
|
|
111
|
+
}),
|
|
112
|
+
style: panel.style
|
|
113
|
+
}, panel.ref);
|
|
114
|
+
}
|
|
115
|
+
// src/components/accordion/accordion-root.tsx
|
|
116
|
+
const NONE = [];
|
|
117
|
+
/** spec/accordion.md (the APG accordion) */
|
|
118
|
+
function AccordionRoot({ value: valueProp, defaultValue = NONE, onValueChange, multiple = false, disabled = false, orientation = "vertical", loopFocus = true, ...props }) {
|
|
119
|
+
const [value, setValue] = useControllableState(valueProp, defaultValue, onValueChange);
|
|
120
|
+
const direction = useContext(DirectionContext);
|
|
121
|
+
const baseId = useId();
|
|
122
|
+
const toggle = useCallback((item, open, reason) => {
|
|
123
|
+
const next = open ? multiple ? [...value.filter((entry) => entry !== item), item] : [item] : value.filter((entry) => entry !== item);
|
|
124
|
+
setValue(next, { reason });
|
|
125
|
+
}, [
|
|
126
|
+
value,
|
|
127
|
+
multiple,
|
|
128
|
+
setValue
|
|
129
|
+
]);
|
|
130
|
+
const onKeyDown = (event) => {
|
|
131
|
+
const root = event.currentTarget;
|
|
132
|
+
const triggers = [...root.querySelectorAll("[data-primitives-part=\"accordion-trigger\"]")].filter((trigger) => !trigger.disabled && trigger.closest("[data-primitives-part=\"accordion-root\"]") === root);
|
|
133
|
+
const current = triggers.indexOf(event.target);
|
|
134
|
+
if (current === -1) return;
|
|
135
|
+
const index = accordionKeyTarget(event.key, current, triggers.length, {
|
|
136
|
+
orientation,
|
|
137
|
+
rtl: getDirection(root, direction) === "rtl",
|
|
138
|
+
loop: loopFocus
|
|
139
|
+
});
|
|
140
|
+
if (index === null) return;
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
triggers[index]?.focus();
|
|
143
|
+
};
|
|
144
|
+
const context = useMemo(() => ({
|
|
145
|
+
value,
|
|
146
|
+
toggle,
|
|
147
|
+
disabled,
|
|
148
|
+
orientation,
|
|
149
|
+
baseId
|
|
150
|
+
}), [
|
|
151
|
+
value,
|
|
152
|
+
toggle,
|
|
153
|
+
disabled,
|
|
154
|
+
orientation,
|
|
155
|
+
baseId
|
|
156
|
+
]);
|
|
157
|
+
const state = {
|
|
158
|
+
value,
|
|
159
|
+
disabled,
|
|
160
|
+
orientation
|
|
161
|
+
};
|
|
162
|
+
return /* @__PURE__ */ jsx(AccordionContext.Provider, {
|
|
163
|
+
value: context,
|
|
164
|
+
children: renderElement("div", props, state, {
|
|
165
|
+
"data-primitives-part": "accordion-root",
|
|
166
|
+
...stateAttributes({
|
|
167
|
+
orientation,
|
|
168
|
+
disabled
|
|
169
|
+
}),
|
|
170
|
+
onKeyDown
|
|
171
|
+
})
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
// src/components/accordion/accordion-trigger.tsx
|
|
175
|
+
/** A header's button (spec/accordion.md): Enter and Space through its native click. */
|
|
176
|
+
function AccordionTrigger(props) {
|
|
177
|
+
const item = useRequiredContext(AccordionItemContext, "Accordion.Trigger");
|
|
178
|
+
const { open, disabled } = item;
|
|
179
|
+
return renderElement("button", props, {
|
|
180
|
+
open,
|
|
181
|
+
disabled,
|
|
182
|
+
orientation: item.orientation
|
|
183
|
+
}, {
|
|
184
|
+
type: "button",
|
|
185
|
+
id: item.triggerId,
|
|
186
|
+
"aria-expanded": open ? "true" : "false",
|
|
187
|
+
"aria-controls": open ? item.panelId : void 0,
|
|
188
|
+
disabled: disabled || void 0,
|
|
189
|
+
"data-primitives-part": "accordion-trigger",
|
|
190
|
+
...stateAttributes({
|
|
191
|
+
disabled,
|
|
192
|
+
"panel-open": open
|
|
193
|
+
}),
|
|
194
|
+
onClick: () => {
|
|
195
|
+
if (!disabled) item.setOpen(!open, "trigger-press");
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
// src/components/accordion/parts.ts
|
|
200
|
+
/** spec/accordion.md */
|
|
201
|
+
const Accordion = {
|
|
202
|
+
Root: AccordionRoot,
|
|
203
|
+
Item: AccordionItem,
|
|
204
|
+
Header: AccordionHeader,
|
|
205
|
+
Trigger: AccordionTrigger,
|
|
206
|
+
Panel: AccordionPanel
|
|
207
|
+
};
|
|
208
|
+
export { Accordion as t };
|
|
209
|
+
|
|
210
|
+
//# sourceMappingURL=accordion--E-5hjWo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion--E-5hjWo.js","names":[],"sources":["../src/components/accordion/accordion-context.ts","../src/components/accordion/accordion-header.tsx","../src/components/accordion/accordion-item.tsx","../src/components/accordion/accordion-panel.tsx","../src/components/accordion/accordion-root.tsx","../src/components/accordion/accordion-trigger.tsx","../src/components/accordion/parts.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { ChangeReason } from \"../../utils/change-details.ts\";\n\nexport type AccordionOrientation = \"horizontal\" | \"vertical\";\n\nexport interface AccordionRootState {\n value: string[];\n disabled: boolean;\n orientation: AccordionOrientation;\n}\n\nexport interface AccordionContextValue {\n value: string[];\n /** Opens or closes an item (in single mode, opening one closes the open one). */\n toggle: (item: string, open: boolean, reason: ChangeReason) => void;\n disabled: boolean;\n orientation: AccordionOrientation;\n baseId: string;\n}\n\nexport const AccordionContext = createContext<AccordionContextValue | null>(\n null,\n);\n\nexport interface AccordionItemState {\n open: boolean;\n disabled: boolean;\n orientation: AccordionOrientation;\n}\n\nexport interface AccordionItemContextValue extends AccordionItemState {\n value: string;\n triggerId: string;\n panelId: string;\n setOpen: (open: boolean, reason: ChangeReason) => void;\n}\n\nexport const AccordionItemContext =\n createContext<AccordionItemContextValue | null>(null);\n\n// A value may hold any character: it is encoded, so the ids hold no whitespace\nexport const triggerId = (baseId: string, value: string) =>\n `${baseId}-trigger-${encodeURIComponent(value)}`;\nexport const panelId = (baseId: string, value: string) =>\n `${baseId}-panel-${encodeURIComponent(value)}`;\n\n/** `data-open` / `data-closed` (exactly one) and `data-disabled` (spec/accordion.md). */\nexport function itemAttributes(state: { open: boolean; disabled: boolean }) {\n return {\n open: state.open,\n closed: !state.open,\n disabled: state.disabled,\n };\n}\n","import { 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 AccordionItemContext,\n type AccordionItemState,\n itemAttributes,\n} from \"./accordion-context.ts\";\n\nexport type AccordionHeaderProps = PartProps<AccordionItemState>;\n\n/** The heading around a Trigger, an `h3` (spec/accordion.md). */\nexport function AccordionHeader(props: AccordionHeaderProps) {\n const item = useRequiredContext(AccordionItemContext, \"Accordion.Header\");\n const state = {\n open: item.open,\n disabled: item.disabled,\n orientation: item.orientation,\n };\n return renderElement(\"h3\", props, state, {\n \"data-primitives-part\": \"accordion-header\",\n ...stateAttributes(itemAttributes(state)),\n });\n}\n","import { useCallback, useMemo } from \"react\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport type { ChangeReason } from \"../../utils/change-details.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n AccordionContext,\n AccordionItemContext,\n type AccordionItemState,\n itemAttributes,\n panelId,\n triggerId,\n} from \"./accordion-context.ts\";\n\nexport interface AccordionItemProps extends PartProps<AccordionItemState> {\n value: string;\n disabled?: boolean;\n}\n\n/** One section: its header and its panel (spec/accordion.md). */\nexport function AccordionItem({\n value,\n disabled: disabledProp = false,\n ...props\n}: AccordionItemProps) {\n const root = useRequiredContext(AccordionContext, \"Accordion.Item\");\n const open = root.value.includes(value);\n const disabled = root.disabled || disabledProp;\n const { toggle, orientation, baseId } = root;\n const setOpen = useCallback(\n (next: boolean, reason: ChangeReason) => toggle(value, next, reason),\n [toggle, value],\n );\n const context = useMemo(\n () => ({\n value,\n open,\n disabled,\n orientation,\n triggerId: triggerId(baseId, value),\n panelId: panelId(baseId, value),\n setOpen,\n }),\n [value, open, disabled, orientation, baseId, setOpen],\n );\n const state = { open, disabled, orientation };\n return (\n <AccordionItemContext.Provider value={context}>\n {renderElement(\"div\", props, state, {\n \"data-primitives-part\": \"accordion-item\",\n ...stateAttributes({ ...itemAttributes(state), orientation }),\n })}\n </AccordionItemContext.Provider>\n );\n}\n","import { usePanelTransition } from \"../../hooks/use-panel-transition.ts\";\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 AccordionItemContext,\n type AccordionOrientation,\n itemAttributes,\n} from \"./accordion-context.ts\";\n\nexport interface AccordionPanelState {\n open: boolean;\n disabled: boolean;\n orientation: AccordionOrientation;\n transitionStatus: \"starting\" | \"ending\" | undefined;\n}\n\nexport interface AccordionPanelProps extends PartProps<AccordionPanelState> {\n /** Keep a closed panel in the DOM, `hidden` (default `false`). */\n keepMounted?: boolean;\n /** Keep a closed panel in the DOM, `hidden=\"until-found\"`: find-in-page opens it. */\n hiddenUntilFound?: boolean;\n}\n\n/** A section's content, a `region` named by its Trigger (spec/accordion.md). */\nexport function AccordionPanel({\n keepMounted = false,\n hiddenUntilFound = false,\n ...props\n}: AccordionPanelProps) {\n const item = useRequiredContext(AccordionItemContext, \"Accordion.Panel\");\n const { open, disabled, orientation } = item;\n const panel = usePanelTransition({\n open,\n prefix: \"accordion\",\n keepMounted,\n hiddenUntilFound,\n onFound: () => item.setOpen(true, \"none\"),\n });\n if (!panel.rendered) {\n return null;\n }\n const state = {\n open,\n disabled,\n orientation,\n transitionStatus: panel.status,\n };\n return renderElement(\n \"div\",\n props,\n state,\n {\n role: \"region\",\n id: item.panelId,\n \"aria-labelledby\": item.triggerId,\n hidden: panel.hidden || undefined,\n \"data-primitives-part\": \"accordion-panel\",\n ...stateAttributes({\n ...itemAttributes({ open, disabled }),\n orientation,\n \"starting-style\": panel.status === \"starting\",\n \"ending-style\": panel.status === \"ending\",\n }),\n style: panel.style,\n },\n panel.ref,\n );\n}\n","import { accordionKeyTarget } from \"@fragiola/primitives/collection\";\nimport { getDirection } from \"@fragiola/primitives/direction\";\nimport {\n type KeyboardEvent,\n useCallback,\n useContext,\n useId,\n useMemo,\n} from \"react\";\nimport { DirectionContext } from \"../../direction/direction-context.ts\";\nimport { useControllableState } from \"../../hooks/use-controllable-state.ts\";\nimport type {\n ChangeDetails,\n ChangeReason,\n} from \"../../utils/change-details.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n AccordionContext,\n type AccordionOrientation,\n type AccordionRootState,\n} from \"./accordion-context.ts\";\n\nexport interface AccordionRootProps extends PartProps<AccordionRootState> {\n /** The values of the open items. */\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[], details: ChangeDetails) => void;\n /** Several items may be open (default `false`). */\n multiple?: boolean;\n disabled?: boolean;\n orientation?: AccordionOrientation;\n /** Whether the arrow keys wrap from the last trigger to the first and back (default `true`). */\n loopFocus?: boolean;\n}\n\nconst NONE: string[] = [];\n\n/** spec/accordion.md (the APG accordion) */\nexport function AccordionRoot({\n value: valueProp,\n defaultValue = NONE,\n onValueChange,\n multiple = false,\n disabled = false,\n orientation = \"vertical\",\n loopFocus = true,\n ...props\n}: AccordionRootProps) {\n const [value, setValue] = useControllableState(\n valueProp,\n defaultValue,\n onValueChange,\n );\n const direction = useContext(DirectionContext);\n const baseId = useId();\n const toggle = useCallback(\n (item: string, open: boolean, reason: ChangeReason) => {\n const next = open\n ? multiple\n ? [...value.filter((entry) => entry !== item), item]\n : [item]\n : value.filter((entry) => entry !== item);\n setValue(next, { reason });\n },\n [value, multiple, setValue],\n );\n\n // the arrows, Home and End move among the enabled triggers (spec/accordion.md, \"Keyboard\")\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n const root = event.currentTarget;\n const triggers = [\n ...root.querySelectorAll<HTMLButtonElement>(\n '[data-primitives-part=\"accordion-trigger\"]',\n ),\n ].filter(\n (trigger) =>\n !trigger.disabled &&\n trigger.closest('[data-primitives-part=\"accordion-root\"]') ===\n root,\n );\n const current = triggers.indexOf(event.target as HTMLButtonElement);\n if (current === -1) {\n return;\n }\n const index = accordionKeyTarget(event.key, current, triggers.length, {\n orientation,\n rtl: getDirection(root, direction) === \"rtl\",\n loop: loopFocus,\n });\n if (index === null) {\n return;\n }\n event.preventDefault();\n triggers[index]?.focus();\n };\n\n const context = useMemo(\n () => ({ value, toggle, disabled, orientation, baseId }),\n [value, toggle, disabled, orientation, baseId],\n );\n const state = { value, disabled, orientation };\n return (\n <AccordionContext.Provider value={context}>\n {renderElement(\"div\", props, state, {\n \"data-primitives-part\": \"accordion-root\",\n ...stateAttributes({ orientation, disabled }),\n onKeyDown,\n })}\n </AccordionContext.Provider>\n );\n}\n","import { 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 AccordionItemContext,\n type AccordionItemState,\n} from \"./accordion-context.ts\";\n\nexport type AccordionTriggerProps = PartProps<AccordionItemState>;\n\n/** A header's button (spec/accordion.md): Enter and Space through its native click. */\nexport function AccordionTrigger(props: AccordionTriggerProps) {\n const item = useRequiredContext(AccordionItemContext, \"Accordion.Trigger\");\n const { open, disabled } = item;\n return renderElement(\n \"button\",\n props,\n { open, disabled, orientation: item.orientation },\n {\n type: \"button\",\n id: item.triggerId,\n \"aria-expanded\": open ? \"true\" : \"false\",\n \"aria-controls\": open ? item.panelId : undefined,\n disabled: disabled || undefined,\n \"data-primitives-part\": \"accordion-trigger\",\n ...stateAttributes({ disabled, \"panel-open\": open }),\n onClick: () => {\n if (!disabled) {\n item.setOpen(!open, \"trigger-press\");\n }\n },\n },\n );\n}\n","import { AccordionHeader } from \"./accordion-header.tsx\";\nimport { AccordionItem } from \"./accordion-item.tsx\";\nimport { AccordionPanel } from \"./accordion-panel.tsx\";\nimport { AccordionRoot } from \"./accordion-root.tsx\";\nimport { AccordionTrigger } from \"./accordion-trigger.tsx\";\n\n/** spec/accordion.md */\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Header: AccordionHeader,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n};\n"],"mappings":";;;;;;;;;;;AAoBA,MAAa,mBAAmB,cAC5B,IACJ;AAeA,MAAa,uBACT,cAAgD,IAAI;AAGxD,MAAa,aAAa,QAAgB,UACtC,GAAG,OAAO,WAAW,mBAAmB,KAAK;AACjD,MAAa,WAAW,QAAgB,UACpC,GAAG,OAAO,SAAS,mBAAmB,KAAK;;AAG/C,SAAgB,eAAe,OAA6C;CACxE,OAAO;EACH,MAAM,MAAM;EACZ,QAAQ,CAAC,MAAM;EACf,UAAU,MAAM;CACpB;AACJ;;;ACzCA,SAAgB,gBAAgB,OAA6B;CACzD,MAAM,OAAO,mBAAmB,sBAAsB,kBAAkB;CACxE,MAAM,QAAQ;EACV,MAAM,KAAK;EACX,UAAU,KAAK;EACf,aAAa,KAAK;CACtB;CACA,OAAO,cAAc,MAAM,OAAO,OAAO;EACrC,wBAAwB;EACxB,GAAG,gBAAgB,eAAe,KAAK,CAAC;CAC5C,CAAC;AACL;;;ACHA,SAAgB,cAAc,EAC1B,OACA,UAAU,eAAe,OACzB,GAAG,SACgB;CACnB,MAAM,OAAO,mBAAmB,kBAAkB,gBAAgB;CAClE,MAAM,OAAO,KAAK,MAAM,SAAS,KAAK;CACtC,MAAM,WAAW,KAAK,YAAY;CAClC,MAAM,EAAE,QAAQ,aAAa,WAAW;CACxC,MAAM,UAAU,aACX,MAAe,WAAyB,OAAO,OAAO,MAAM,MAAM,GACnE,CAAC,QAAQ,KAAK,CAClB;CACA,MAAM,UAAU,eACL;EACH;EACA;EACA;EACA;EACA,WAAW,UAAU,QAAQ,KAAK;EAClC,SAAS,QAAQ,QAAQ,KAAK;EAC9B;CACJ,IACA;EAAC;EAAO;EAAM;EAAU;EAAa;EAAQ;CAAO,CACxD;CACA,MAAM,QAAQ;EAAE;EAAM;EAAU;CAAY;CAC5C,OACI,oBAAC,qBAAqB,UAAtB;EAA+B,OAAO;EACjC,UAAA,cAAc,OAAO,OAAO,OAAO;GAChC,wBAAwB;GACxB,GAAG,gBAAgB;IAAE,GAAG,eAAe,KAAK;IAAG;GAAY,CAAC;EAChE,CAAC;CAC0B,CAAA;AAEvC;;;AC7BA,SAAgB,eAAe,EAC3B,cAAc,OACd,mBAAmB,OACnB,GAAG,SACiB;CACpB,MAAM,OAAO,mBAAmB,sBAAsB,iBAAiB;CACvE,MAAM,EAAE,MAAM,UAAU,gBAAgB;CACxC,MAAM,QAAQ,mBAAmB;EAC7B;EACA,QAAQ;EACR;EACA;EACA,eAAe,KAAK,QAAQ,MAAM,MAAM;CAC5C,CAAC;CACD,IAAI,CAAC,MAAM,UACP,OAAO;CAEX,MAAM,QAAQ;EACV;EACA;EACA;EACA,kBAAkB,MAAM;CAC5B;CACA,OAAO,cACH,OACA,OACA,OACA;EACI,MAAM;EACN,IAAI,KAAK;EACT,mBAAmB,KAAK;EACxB,QAAQ,MAAM,UAAU,KAAA;EACxB,wBAAwB;EACxB,GAAG,gBAAgB;GACf,GAAG,eAAe;IAAE;IAAM;GAAS,CAAC;GACpC;GACA,kBAAkB,MAAM,WAAW;GACnC,gBAAgB,MAAM,WAAW;EACrC,CAAC;EACD,OAAO,MAAM;CACjB,GACA,MAAM,GACV;AACJ;;AChCA,MAAM,OAAiB,CAAC;;AAGxB,SAAgB,cAAc,EAC1B,OAAO,WACP,eAAe,MACf,eACA,WAAW,OACX,WAAW,OACX,cAAc,YACd,YAAY,MACZ,GAAG,SACgB;CACnB,MAAM,CAAC,OAAO,YAAY,qBACtB,WACA,cACA,aACJ;CACA,MAAM,YAAY,WAAW,gBAAgB;CAC7C,MAAM,SAAS,MAAM;CACrB,MAAM,SAAS,aACV,MAAc,MAAe,WAAyB;EACnD,MAAM,OAAO,OACP,WACI,CAAC,GAAG,MAAM,QAAQ,UAAU,UAAU,IAAI,GAAG,IAAI,IACjD,CAAC,IAAI,IACT,MAAM,QAAQ,UAAU,UAAU,IAAI;EAC5C,SAAS,MAAM,EAAE,OAAO,CAAC;CAC7B,GACA;EAAC;EAAO;EAAU;CAAQ,CAC9B;CAGA,MAAM,aAAa,UAAsC;EACrD,MAAM,OAAO,MAAM;EACnB,MAAM,WAAW,CACb,GAAG,KAAK,iBACJ,8CACJ,CACJ,CAAC,CAAC,QACG,YACG,CAAC,QAAQ,YACT,QAAQ,QAAQ,2CAAyC,MACrD,IACZ;EACA,MAAM,UAAU,SAAS,QAAQ,MAAM,MAA2B;EAClE,IAAI,YAAY,IACZ;EAEJ,MAAM,QAAQ,mBAAmB,MAAM,KAAK,SAAS,SAAS,QAAQ;GAClE;GACA,KAAK,aAAa,MAAM,SAAS,MAAM;GACvC,MAAM;EACV,CAAC;EACD,IAAI,UAAU,MACV;EAEJ,MAAM,eAAe;EACrB,SAAS,MAAM,EAAE,MAAM;CAC3B;CAEA,MAAM,UAAU,eACL;EAAE;EAAO;EAAQ;EAAU;EAAa;CAAO,IACtD;EAAC;EAAO;EAAQ;EAAU;EAAa;CAAM,CACjD;CACA,MAAM,QAAQ;EAAE;EAAO;EAAU;CAAY;CAC7C,OACI,oBAAC,iBAAiB,UAAlB;EAA2B,OAAO;EAC7B,UAAA,cAAc,OAAO,OAAO,OAAO;GAChC,wBAAwB;GACxB,GAAG,gBAAgB;IAAE;IAAa;GAAS,CAAC;GAC5C;EACJ,CAAC;CACsB,CAAA;AAEnC;;;ACpGA,SAAgB,iBAAiB,OAA8B;CAC3D,MAAM,OAAO,mBAAmB,sBAAsB,mBAAmB;CACzE,MAAM,EAAE,MAAM,aAAa;CAC3B,OAAO,cACH,UACA,OACA;EAAE;EAAM;EAAU,aAAa,KAAK;CAAY,GAChD;EACI,MAAM;EACN,IAAI,KAAK;EACT,iBAAiB,OAAO,SAAS;EACjC,iBAAiB,OAAO,KAAK,UAAU,KAAA;EACvC,UAAU,YAAY,KAAA;EACtB,wBAAwB;EACxB,GAAG,gBAAgB;GAAE;GAAU,cAAc;EAAK,CAAC;EACnD,eAAe;GACX,IAAI,CAAC,UACD,KAAK,QAAQ,CAAC,MAAM,eAAe;EAE3C;CACJ,CACJ;AACJ;;;AC1BA,MAAa,YAAY;CACrB,MAAM;CACN,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;AACX"}
|
|
@@ -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 { a as AccordionPanelState, c as AccordionItemState, i as AccordionPanelProps, l as AccordionOrientation, n as AccordionTriggerProps, o as AccordionItemProps, r as AccordionRootProps, s as AccordionHeaderProps, t as Accordion, u as AccordionRootState } from "./index-Da0eVQHO.js";
|
|
4
|
+
export { Accordion, type AccordionHeaderProps, type AccordionItemProps, type AccordionItemState, type AccordionOrientation, type AccordionPanelProps, type AccordionPanelState, type AccordionRootProps, type AccordionRootState, type AccordionTriggerProps, type ChangeDetails, type ChangeReason, type RenderProp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Accordion } from "./accordion--E-5hjWo.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { t as OverlayHandleStore } from "./overlay-handle-DOyqO4oY.js";
|
|
2
|
+
import { a as DialogPortal, c as DialogClose, i as DialogTitle, l as DialogBackdrop, n as DialogViewport, o as DialogPopup, r as DialogTrigger, s as DialogDescription, t as DialogRootBase } from "./dialog-root-base-DDMrqDC9.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/components/alert-dialog/alert-dialog-handle.ts
|
|
5
|
+
/** Creates an AlertDialog handle (`AlertDialog.createHandle`), for Triggers outside the Root. */
|
|
6
|
+
function createAlertDialogHandle() {
|
|
7
|
+
return new OverlayHandleStore("alert-dialog");
|
|
8
|
+
}
|
|
9
|
+
// src/components/alert-dialog/alert-dialog-root.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Holds the alert dialog's state; renders no element (spec/alert-dialog.md). Its parts are
|
|
12
|
+
* Dialog's, named `alert-dialog-*`: always modal, never dismissed from outside, its first Close
|
|
13
|
+
* focused on open.
|
|
14
|
+
*/
|
|
15
|
+
function AlertDialogRoot(props) {
|
|
16
|
+
return /* @__PURE__ */ jsx(DialogRootBase, {
|
|
17
|
+
...props,
|
|
18
|
+
component: "alert-dialog"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
// src/components/alert-dialog/parts.ts
|
|
22
|
+
/** spec/alert-dialog.md: Dialog's parts, named `alert-dialog-*` by the Root */
|
|
23
|
+
const AlertDialog = {
|
|
24
|
+
Root: AlertDialogRoot,
|
|
25
|
+
Trigger: DialogTrigger,
|
|
26
|
+
Portal: DialogPortal,
|
|
27
|
+
Backdrop: DialogBackdrop,
|
|
28
|
+
Viewport: DialogViewport,
|
|
29
|
+
Popup: DialogPopup,
|
|
30
|
+
Title: DialogTitle,
|
|
31
|
+
Description: DialogDescription,
|
|
32
|
+
Close: DialogClose,
|
|
33
|
+
createHandle: createAlertDialogHandle
|
|
34
|
+
};
|
|
35
|
+
export { createAlertDialogHandle as n, AlertDialog as t };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=alert-dialog-7FIAj98B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog-7FIAj98B.js","names":[],"sources":["../src/components/alert-dialog/alert-dialog-handle.ts","../src/components/alert-dialog/alert-dialog-root.tsx","../src/components/alert-dialog/parts.ts"],"sourcesContent":["import {\n type OverlayHandle,\n OverlayHandleStore,\n} from \"../../utils/overlay-handle.ts\";\n\n/** An AlertDialog's handle: its detached Triggers and imperative opening (spec/alert-dialog.md). */\nexport interface AlertDialogHandle<Payload = unknown>\n extends OverlayHandle<Payload> {\n readonly component: \"alert-dialog\";\n}\n\n/** Creates an AlertDialog handle (`AlertDialog.createHandle`), for Triggers outside the Root. */\nexport function createAlertDialogHandle<\n Payload = unknown,\n>(): AlertDialogHandle<Payload> {\n return new OverlayHandleStore<Payload>(\n \"alert-dialog\",\n ) as AlertDialogHandle<Payload>;\n}\n","import {\n DialogRootBase,\n type DialogRootSharedProps,\n} from \"../dialog/dialog-root-base.tsx\";\nimport type { AlertDialogHandle } from \"./alert-dialog-handle.ts\";\n\nexport interface AlertDialogRootProps<Payload = unknown>\n extends DialogRootSharedProps<Payload> {\n /** Connects Triggers rendered outside the Root (spec/alert-dialog.md, \"Detached triggers\"). */\n handle?: AlertDialogHandle<Payload>;\n}\n\n/**\n * Holds the alert dialog's state; renders no element (spec/alert-dialog.md). Its parts are\n * Dialog's, named `alert-dialog-*`: always modal, never dismissed from outside, its first Close\n * focused on open.\n */\nexport function AlertDialogRoot<Payload = unknown>(\n props: AlertDialogRootProps<Payload>,\n) {\n return <DialogRootBase {...props} component=\"alert-dialog\" />;\n}\n","import type { ReactNode } from \"react\";\nimport { DialogBackdrop } from \"../dialog/dialog-backdrop.tsx\";\nimport { DialogClose } from \"../dialog/dialog-close.tsx\";\nimport { DialogDescription } from \"../dialog/dialog-description.tsx\";\nimport { DialogPopup } from \"../dialog/dialog-popup.tsx\";\nimport { DialogPortal } from \"../dialog/dialog-portal.tsx\";\nimport { DialogTitle } from \"../dialog/dialog-title.tsx\";\nimport { DialogTrigger } from \"../dialog/dialog-trigger.tsx\";\nimport { DialogViewport } from \"../dialog/dialog-viewport.tsx\";\nimport { createAlertDialogHandle } from \"./alert-dialog-handle.ts\";\nimport { AlertDialogRoot } from \"./alert-dialog-root.tsx\";\nimport type { AlertDialogTriggerProps } from \"./alert-dialog-trigger-props.ts\";\n\n/** spec/alert-dialog.md: Dialog's parts, named `alert-dialog-*` by the Root */\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n // Dialog's Trigger, typed with an AlertDialog handle\n Trigger: DialogTrigger as <Payload = unknown>(\n props: AlertDialogTriggerProps<Payload>,\n ) => ReactNode,\n Portal: DialogPortal,\n Backdrop: DialogBackdrop,\n Viewport: DialogViewport,\n Popup: DialogPopup,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n createHandle: createAlertDialogHandle,\n};\n"],"mappings":";;;;;AAYA,SAAgB,0BAEgB;CAC5B,OAAO,IAAI,mBACP,cACJ;AACJ;;;;;;;ACDA,SAAgB,gBACZ,OACF;CACE,OAAO,oBAAC,gBAAD;EAAgB,GAAI;EAAO,WAAU;CAAgB,CAAA;AAChE;;;ACPA,MAAa,cAAc;CACvB,MAAM;CAEN,SAAS;CAGT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;CACP,cAAc;AAClB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { a as OverlayActions, i as OpenChangeDetails, n as ChangeReason, r as FocusTarget, t as ChangeDetails } from "./change-details-CPSkPCNw.js";
|
|
2
|
+
import { n as RenderProp } from "./render-element-Pwuv2wsL.js";
|
|
3
|
+
import { t as OverlayPortalProps } from "./use-overlay-portal-D8GjZ-m7.js";
|
|
4
|
+
import { n as OverlayTriggerRootProps, t as OverlayRootProps } from "./use-overlay-root-BDO5E_0S.js";
|
|
5
|
+
import { t as OverlayHandle } from "./overlay-handle-DzzlzKqP.js";
|
|
6
|
+
import { t as OverlayTriggerProps } from "./use-overlay-trigger-PP99t2ZF.js";
|
|
7
|
+
import { g as DialogPopupState, h as DialogPopupProps, l as DialogTriggerState, o as DialogViewportState, p as DialogPortalProps, v as DialogBackdropProps, y as DialogBackdropState } from "./dialog-title-BitK2i0A.js";
|
|
8
|
+
import { a as createAlertDialogHandle, i as AlertDialogHandle, n as AlertDialogTriggerProps, r as AlertDialogRootProps, t as AlertDialog } from "./index-Bqt2th2p.js";
|
|
9
|
+
export { AlertDialog, type DialogBackdropProps as AlertDialogBackdropProps, type DialogBackdropState as AlertDialogBackdropState, type AlertDialogHandle, type DialogPopupProps as AlertDialogPopupProps, type DialogPopupState as AlertDialogPopupState, type DialogPortalProps as AlertDialogPortalProps, type AlertDialogRootProps, type AlertDialogTriggerProps, type DialogTriggerState as AlertDialogTriggerState, type DialogViewportState as AlertDialogViewportState, type ChangeDetails, type ChangeReason, type FocusTarget, type OpenChangeDetails, type OverlayActions, type OverlayHandle, type OverlayPortalProps, type OverlayRootProps, type OverlayTriggerProps, type OverlayTriggerRootProps, type RenderProp, createAlertDialogHandle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as AlertDialog, n as createAlertDialogHandle } from "./alert-dialog-7FIAj98B.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as renderElement } from "./render-element-DXbUbfgN.js";
|
|
2
|
+
// src/components/aspect-ratio/aspect-ratio.tsx
|
|
3
|
+
/**
|
|
4
|
+
* A box that keeps its content at a ratio (spec/aspect-ratio.md): a structural
|
|
5
|
+
* `aspect-ratio`, and nothing else.
|
|
6
|
+
*/
|
|
7
|
+
function AspectRatio({ ratio: ratioProp = 1, ...props }) {
|
|
8
|
+
const ratio = Number.isFinite(ratioProp) && ratioProp > 0 ? ratioProp : 1;
|
|
9
|
+
return renderElement("div", props, { ratio }, {
|
|
10
|
+
style: {
|
|
11
|
+
aspectRatio: String(ratio),
|
|
12
|
+
minHeight: 0
|
|
13
|
+
},
|
|
14
|
+
"data-primitives-part": "aspect-ratio-root"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export { AspectRatio as t };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=aspect-ratio-CUADsevg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aspect-ratio-CUADsevg.js","names":[],"sources":["../src/components/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["import { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\n\n/** What an AspectRatio renders with (spec/aspect-ratio.md). */\nexport interface AspectRatioState {\n /** The width over the height. */\n ratio: number;\n}\n\nexport interface AspectRatioProps extends PartProps<AspectRatioState> {\n /** The width over the height (default `1`; not a positive finite number: `1`). */\n ratio?: number;\n}\n\n/**\n * A box that keeps its content at a ratio (spec/aspect-ratio.md): a structural\n * `aspect-ratio`, and nothing else.\n */\nexport function AspectRatio({\n ratio: ratioProp = 1,\n ...props\n}: AspectRatioProps) {\n const ratio = Number.isFinite(ratioProp) && ratioProp > 0 ? ratioProp : 1;\n return renderElement(\n \"div\",\n props,\n { ratio },\n {\n style: { aspectRatio: String(ratio), minHeight: 0 },\n \"data-primitives-part\": \"aspect-ratio-root\",\n },\n );\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,YAAY,EACxB,OAAO,YAAY,GACnB,GAAG,SACc;CACjB,MAAM,QAAQ,OAAO,SAAS,SAAS,KAAK,YAAY,IAAI,YAAY;CACxE,OAAO,cACH,OACA,OACA,EAAE,MAAM,GACR;EACI,OAAO;GAAE,aAAa,OAAO,KAAK;GAAG,WAAW;EAAE;EAClD,wBAAwB;CAC5B,CACJ;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as AspectRatio } from "./aspect-ratio-CUADsevg.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createAsyncList } from "@fragiola/primitives/async-list";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
// src/async-list/use-async-list.ts
|
|
4
|
+
/**
|
|
5
|
+
* An async list in React state (spec/virtual-lists.md, "The mechanisms"): the toolkit's
|
|
6
|
+
* `createAsyncList`, loading its first page once mounted and aborting the load in flight when
|
|
7
|
+
* unmounted. The first render (on a server too) is `loading`, with no items.
|
|
8
|
+
*/
|
|
9
|
+
function useAsyncList(options) {
|
|
10
|
+
const loader = useRef(options.load);
|
|
11
|
+
loader.current = options.load;
|
|
12
|
+
const [list] = useState(() => createAsyncList({
|
|
13
|
+
load: (request) => loader.current(request),
|
|
14
|
+
filterText: options.filterText,
|
|
15
|
+
onChange: (next) => setState(next)
|
|
16
|
+
}));
|
|
17
|
+
const [state, setState] = useState(() => ({
|
|
18
|
+
...list.state(),
|
|
19
|
+
status: "loading"
|
|
20
|
+
}));
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
list.reload();
|
|
23
|
+
return () => list.abort();
|
|
24
|
+
}, [list]);
|
|
25
|
+
return {
|
|
26
|
+
...state,
|
|
27
|
+
loading: state.status === "loading" || state.status === "loading-more",
|
|
28
|
+
reload: list.reload,
|
|
29
|
+
loadMore: list.loadMore,
|
|
30
|
+
setFilterText: list.setFilterText
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export { useAsyncList as t };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=async-list-7ljWFMgA.js.map
|