@fragiola/primitives-react 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +38 -2
- package/dist/accordion--E-5hjWo.js +210 -0
- package/dist/accordion--E-5hjWo.js.map +1 -0
- package/dist/accordion.d.ts +4 -0
- package/dist/accordion.js +1 -0
- package/dist/alert-dialog-7FIAj98B.js +37 -0
- package/dist/alert-dialog-7FIAj98B.js.map +1 -0
- package/dist/alert-dialog.d.ts +9 -0
- package/dist/alert-dialog.js +1 -0
- package/dist/aspect-ratio-CUADsevg.js +19 -0
- package/dist/aspect-ratio-CUADsevg.js.map +1 -0
- package/dist/aspect-ratio.d.ts +3 -0
- package/dist/aspect-ratio.js +1 -0
- package/dist/async-list-7ljWFMgA.js +35 -0
- package/dist/async-list-7ljWFMgA.js.map +1 -0
- package/dist/async-list.d.ts +2 -0
- package/dist/async-list.js +1 -0
- package/dist/autocomplete-virtual-BE8dDDgU.js +56 -0
- package/dist/autocomplete-virtual-BE8dDDgU.js.map +1 -0
- package/dist/autocomplete-virtual.d.ts +4 -0
- package/dist/autocomplete-virtual.js +3 -0
- package/dist/autocomplete.d.ts +9 -0
- package/dist/autocomplete.js +1 -0
- package/dist/avatar-CABjoLs9.js +101 -0
- package/dist/avatar-CABjoLs9.js.map +1 -0
- package/dist/avatar.d.ts +3 -0
- package/dist/avatar.js +1 -0
- package/dist/breadcrumbs-nG0Rq3kX.js +69 -0
- package/dist/breadcrumbs-nG0Rq3kX.js.map +1 -0
- package/dist/breadcrumbs.d.ts +3 -0
- package/dist/breadcrumbs.js +1 -0
- package/dist/button-B6h8UkhR.js +30 -0
- package/dist/button-B6h8UkhR.js.map +1 -0
- package/dist/button-props-DWfy1ZSo.js +69 -0
- package/dist/button-props-DWfy1ZSo.js.map +1 -0
- package/dist/button.d.ts +3 -0
- package/dist/button.js +1 -0
- package/dist/calendar-preset-Cs-hy-_0.js +70 -0
- package/dist/calendar-preset-Cs-hy-_0.js.map +1 -0
- package/dist/calendar-preset.d.ts +4 -0
- package/dist/calendar-preset.js +3 -0
- package/dist/calendar-root-base-CIkiSebb.js +515 -0
- package/dist/calendar-root-base-CIkiSebb.js.map +1 -0
- package/dist/calendar-row-BO5kyOgq.d.ts +84 -0
- package/dist/calendar-value-DCOjO7og.d.ts +23 -0
- package/dist/calendar-view-DT9i5Xg_.js +157 -0
- package/dist/calendar-view-DT9i5Xg_.js.map +1 -0
- package/dist/calendar-view.d.ts +6 -0
- package/dist/calendar-view.js +4 -0
- package/dist/calendar.d.ts +7 -0
- package/dist/calendar.js +1 -0
- package/dist/carousel-ClQsQ135.js +436 -0
- package/dist/carousel-ClQsQ135.js.map +1 -0
- package/dist/carousel.d.ts +4 -0
- package/dist/carousel.js +1 -0
- package/dist/cascade-select-DZlpKUok.js +582 -0
- package/dist/cascade-select-DZlpKUok.js.map +1 -0
- package/dist/cascade-select.d.ts +7 -0
- package/dist/cascade-select.js +1 -0
- package/dist/change-details-CPSkPCNw.d.ts +32 -0
- package/dist/checkbox-CbmkKNfv.js +165 -0
- package/dist/checkbox-CbmkKNfv.js.map +1 -0
- package/dist/checkbox-group-_UrFCUgQ.js +99 -0
- package/dist/checkbox-group-_UrFCUgQ.js.map +1 -0
- package/dist/checkbox-group-context-CoGqgxBM.js +6 -0
- package/dist/checkbox-group-context-CoGqgxBM.js.map +1 -0
- package/dist/checkbox-group.d.ts +4 -0
- package/dist/checkbox-group.js +1 -0
- package/dist/checkbox.d.ts +4 -0
- package/dist/checkbox.js +1 -0
- package/dist/clipboard-CvgO1qhh.js +189 -0
- package/dist/clipboard-CvgO1qhh.js.map +1 -0
- package/dist/clipboard.d.ts +4 -0
- package/dist/clipboard.js +1 -0
- package/dist/collapsible-Dh0TUP6l.js +112 -0
- package/dist/collapsible-Dh0TUP6l.js.map +1 -0
- package/dist/collapsible.d.ts +4 -0
- package/dist/collapsible.js +1 -0
- package/dist/color-area-BGo6tZxX.js +311 -0
- package/dist/color-area-BGo6tZxX.js.map +1 -0
- package/dist/color-area.d.ts +4 -0
- package/dist/color-area.js +1 -0
- package/dist/color-field-B9QEKyQ1.js +334 -0
- package/dist/color-field-B9QEKyQ1.js.map +1 -0
- package/dist/color-field.d.ts +4 -0
- package/dist/color-field.js +1 -0
- package/dist/color-picker-BNOtqWUK.js +276 -0
- package/dist/color-picker-BNOtqWUK.js.map +1 -0
- package/dist/color-picker-binding-D9xBS_my.js +6 -0
- package/dist/color-picker-binding-D9xBS_my.js.map +1 -0
- package/dist/color-picker-popover-CV_wP6KG.js +195 -0
- package/dist/color-picker-popover-CV_wP6KG.js.map +1 -0
- package/dist/color-picker-popover.d.ts +7 -0
- package/dist/color-picker-popover.js +1 -0
- package/dist/color-picker.d.ts +4 -0
- package/dist/color-picker.js +1 -0
- package/dist/color-slider-Bw940FJr.js +357 -0
- package/dist/color-slider-Bw940FJr.js.map +1 -0
- package/dist/color-slider.d.ts +4 -0
- package/dist/color-slider.js +1 -0
- package/dist/color-swatch-C9ws0xF4.js +37 -0
- package/dist/color-swatch-C9ws0xF4.js.map +1 -0
- package/dist/color-swatch-picker-CnmTr1SY.js +286 -0
- package/dist/color-swatch-picker-CnmTr1SY.js.map +1 -0
- package/dist/color-swatch-picker.d.ts +4 -0
- package/dist/color-swatch-picker.js +1 -0
- package/dist/color-swatch.d.ts +3 -0
- package/dist/color-swatch.js +1 -0
- package/dist/color-wheel--n8w5fIJ.js +247 -0
- package/dist/color-wheel--n8w5fIJ.js.map +1 -0
- package/dist/color-wheel.d.ts +4 -0
- package/dist/color-wheel.js +1 -0
- package/dist/combobox-virtual-BI-l10BE.js +61 -0
- package/dist/combobox-virtual-BI-l10BE.js.map +1 -0
- package/dist/combobox-virtual.d.ts +4 -0
- package/dist/combobox-virtual.js +3 -0
- package/dist/combobox.d.ts +9 -0
- package/dist/combobox.js +1 -0
- package/dist/command-virtual-CxNLxsih.js +56 -0
- package/dist/command-virtual-CxNLxsih.js.map +1 -0
- package/dist/command-virtual.d.ts +4 -0
- package/dist/command-virtual.js +3 -0
- package/dist/command.d.ts +5 -0
- package/dist/command.js +1 -0
- package/dist/context-menu-DGj2L-Sv.js +131 -0
- package/dist/context-menu-DGj2L-Sv.js.map +1 -0
- package/dist/context-menu.d.ts +8 -0
- package/dist/context-menu.js +1 -0
- package/dist/date-field-C1nhThPd.js +33 -0
- package/dist/date-field-C1nhThPd.js.map +1 -0
- package/dist/date-field-root-CzSo5iKL.d.ts +26 -0
- package/dist/date-field-root-base-B-050SUC.js +185 -0
- package/dist/date-field-root-base-B-050SUC.js.map +1 -0
- package/dist/date-field-segment-BoS-ohDh.d.ts +67 -0
- package/dist/date-field.d.ts +6 -0
- package/dist/date-field.js +1 -0
- package/dist/date-picker-input-BCaKff7A.js +29 -0
- package/dist/date-picker-input-BCaKff7A.js.map +1 -0
- package/dist/date-picker-input-root-base-Cc3mE-NR.d.ts +17 -0
- package/dist/date-picker-input-root-base-D4VaBnpf.js +361 -0
- package/dist/date-picker-input-root-base-D4VaBnpf.js.map +1 -0
- package/dist/date-picker-input.d.ts +7 -0
- package/dist/date-picker-input.js +3 -0
- package/dist/date-picker-trigger-BKPvZbRg.js +304 -0
- package/dist/date-picker-trigger-BKPvZbRg.js.map +1 -0
- package/dist/date-picker-trigger-DHsAhBf2.d.ts +51 -0
- package/dist/date-picker.d.ts +11 -0
- package/dist/date-picker.js +1 -0
- package/dist/date-range-field-C-ID01oa.js +34 -0
- package/dist/date-range-field-C-ID01oa.js.map +1 -0
- package/dist/date-range-field-input-BkLpldTx.js +33 -0
- package/dist/date-range-field-input-BkLpldTx.js.map +1 -0
- package/dist/date-range-field-input-BwCNo15l.d.ts +13 -0
- package/dist/date-range-field-root-CmZ3c7xn.d.ts +31 -0
- package/dist/date-range-field-root-base-DWH3nqmz.d.ts +23 -0
- package/dist/date-range-field-root-base-z8S5aSCs.js +261 -0
- package/dist/date-range-field-root-base-z8S5aSCs.js.map +1 -0
- package/dist/date-range-field.d.ts +9 -0
- package/dist/date-range-field.js +1 -0
- package/dist/date-range-picker-input-DlIdTD-J.js +30 -0
- package/dist/date-range-picker-input-DlIdTD-J.js.map +1 -0
- package/dist/date-range-picker-input.d.ts +10 -0
- package/dist/date-range-picker-input.js +3 -0
- package/dist/date-range-picker.d.ts +11 -0
- package/dist/date-range-picker.js +1 -0
- package/dist/dialog-DDE15qBB.js +33 -0
- package/dist/dialog-DDE15qBB.js.map +1 -0
- package/dist/dialog-root-base-DDMrqDC9.js +328 -0
- package/dist/dialog-root-base-DDMrqDC9.js.map +1 -0
- package/dist/dialog-title-BitK2i0A.d.ts +78 -0
- package/dist/dialog.d.ts +9 -0
- package/dist/dialog.js +1 -0
- package/dist/direction-BfW1BOg1.js +22 -0
- package/dist/direction-BfW1BOg1.js.map +1 -0
- package/dist/direction-context-CiRdNJmu.js +11 -0
- package/dist/direction-context-CiRdNJmu.js.map +1 -0
- package/dist/direction.d.ts +2 -0
- package/dist/direction.js +1 -0
- package/dist/drawer-CaPOhMl-.js +302 -0
- package/dist/drawer-CaPOhMl-.js.map +1 -0
- package/dist/drawer.d.ts +9 -0
- package/dist/drawer.js +1 -0
- package/dist/drop-zone-q0-5u2cs.js +86 -0
- package/dist/drop-zone-q0-5u2cs.js.map +1 -0
- package/dist/drop-zone.d.ts +4 -0
- package/dist/drop-zone.js +1 -0
- package/dist/editable-vU6vYZOD.js +403 -0
- package/dist/editable-vU6vYZOD.js.map +1 -0
- package/dist/editable.d.ts +4 -0
- package/dist/editable.js +1 -0
- package/dist/field-DibhXWF6.js +308 -0
- package/dist/field-DibhXWF6.js.map +1 -0
- package/dist/field.d.ts +4 -0
- package/dist/field.js +1 -0
- package/dist/fieldset-Cz80P2jc.js +53 -0
- package/dist/fieldset-Cz80P2jc.js.map +1 -0
- package/dist/fieldset-context-CeaxEBvi.js +6 -0
- package/dist/fieldset-context-CeaxEBvi.js.map +1 -0
- package/dist/fieldset.d.ts +3 -0
- package/dist/fieldset.js +1 -0
- package/dist/file-upload-BIRibICU.js +513 -0
- package/dist/file-upload-BIRibICU.js.map +1 -0
- package/dist/file-upload.d.ts +4 -0
- package/dist/file-upload.js +1 -0
- package/dist/form-DNAaFPpL.js +87 -0
- package/dist/form-DNAaFPpL.js.map +1 -0
- package/dist/form-context-BW-nK6kl.js +6 -0
- package/dist/form-context-BW-nK6kl.js.map +1 -0
- package/dist/form.d.ts +3 -0
- package/dist/form.js +1 -0
- package/dist/hover-card-CRDpA_zU.js +317 -0
- package/dist/hover-card-CRDpA_zU.js.map +1 -0
- package/dist/hover-card.d.ts +9 -0
- package/dist/hover-card.js +1 -0
- package/dist/index-0bXL0iXX.d.ts +25 -0
- package/dist/index-6f2s5HfF.d.ts +30 -0
- package/dist/index-9WYWziGt.d.ts +42 -0
- package/dist/index-B57uQVXT.d.ts +100 -0
- package/dist/index-BA629roy.d.ts +52 -0
- package/dist/index-BC5bS-vC.d.ts +30 -0
- package/dist/index-BDbTYsJR.d.ts +77 -0
- package/dist/index-BEaxabvv.d.ts +80 -0
- package/dist/index-BLRo_PJD.d.ts +58 -0
- package/dist/index-BMt816ZL.d.ts +51 -0
- package/dist/index-BQJrDd_G.d.ts +108 -0
- package/dist/index-BUJIeLCT.d.ts +37 -0
- package/dist/index-BZxd4oqB.d.ts +111 -0
- package/dist/index-B_JVgpGe.d.ts +13 -0
- package/dist/index-BdxleDV0.d.ts +104 -0
- package/dist/index-Be4w9GAc.d.ts +13 -0
- package/dist/index-Bht8ohW3.d.ts +31 -0
- package/dist/index-Bk1NBvxD.d.ts +75 -0
- package/dist/index-BmtcAsQr.d.ts +44 -0
- package/dist/index-BmuEv-h3.d.ts +35 -0
- package/dist/index-BnPLIkKG.d.ts +31 -0
- package/dist/index-BoJU86K5.d.ts +52 -0
- package/dist/index-Bq6yByLv.d.ts +50 -0
- package/dist/index-Bqt2th2p.d.ts +41 -0
- package/dist/index-BrXfSGo2.d.ts +51 -0
- package/dist/index-BsvcTJ_x.d.ts +17 -0
- package/dist/index-BxcCz-NS.d.ts +36 -0
- package/dist/index-C3y4g2fs.d.ts +21 -0
- package/dist/index-C8-b81Jh.d.ts +20 -0
- package/dist/index-C8KLM25T.d.ts +31 -0
- package/dist/index-C9TSddnB.d.ts +140 -0
- package/dist/index-CCnaczzE.d.ts +32 -0
- package/dist/index-CD6hgnl1.d.ts +86 -0
- package/dist/index-CEN3o4Pw.d.ts +35 -0
- package/dist/index-CFlhfs3y.d.ts +30 -0
- package/dist/index-CIQU06ga.d.ts +36 -0
- package/dist/index-CNUEsZ_M.d.ts +51 -0
- package/dist/index-CNYBtgVC.d.ts +53 -0
- package/dist/index-CQJHcuzo.d.ts +76 -0
- package/dist/index-CTw9ONha.d.ts +69 -0
- package/dist/index-CU9QnAha.d.ts +32 -0
- package/dist/index-CcwKZWPY.d.ts +92 -0
- package/dist/index-Cjl7RT2o.d.ts +17 -0
- package/dist/index-ClfKp-sZ.d.ts +21 -0
- package/dist/index-CqGIxPDB.d.ts +82 -0
- package/dist/index-CsXJJ0G8.d.ts +41 -0
- package/dist/index-Cyjcq7lp.d.ts +28 -0
- package/dist/index-CzB9dDcM.d.ts +22 -0
- package/dist/index-D1-zqp2Q.d.ts +44 -0
- package/dist/index-D59OFWyx.d.ts +53 -0
- package/dist/index-D9lx4wAU.d.ts +21 -0
- package/dist/index-DHrnPQEE.d.ts +128 -0
- package/dist/index-DHwyHITu.d.ts +131 -0
- package/dist/index-DQ68aV2P.d.ts +21 -0
- package/dist/index-DQAkgf9_.d.ts +14 -0
- package/dist/index-DRow1231.d.ts +31 -0
- package/dist/index-DTGZeJU7.d.ts +29 -0
- package/dist/index-DU7jtvI8.d.ts +24 -0
- package/dist/index-DVjhOpXu.d.ts +42 -0
- package/dist/index-DZoqbcd6.d.ts +26 -0
- package/dist/index-Da0eVQHO.d.ts +62 -0
- package/dist/index-DhNPJa6U.d.ts +31 -0
- package/dist/index-DnQAamhU.d.ts +27 -0
- package/dist/index-DoFrs7Az.d.ts +16 -0
- package/dist/index-DorcIjVk.d.ts +20 -0
- package/dist/index-Dx-yMTdt.d.ts +81 -0
- package/dist/index-J4LbimqY.d.ts +79 -0
- package/dist/index-L6Mp2njJ.d.ts +81 -0
- package/dist/index-OmXQjsNi.d.ts +37 -0
- package/dist/index-PpCPWRbt.d.ts +30 -0
- package/dist/index-Pq-ztBxR.d.ts +34 -0
- package/dist/index-Qgz-Dnsj.d.ts +73 -0
- package/dist/index-R3h8-VcD.d.ts +32 -0
- package/dist/index-WtAHbmtb.d.ts +88 -0
- package/dist/index-dKoYaA3K.d.ts +38 -0
- package/dist/index-fgqEotIa.d.ts +16 -0
- package/dist/index-gvpnQy8T.d.ts +87 -0
- package/dist/index-kY3Yo50q.d.ts +68 -0
- package/dist/index-ndFpL4W9.d.ts +15 -0
- package/dist/index-oLgwTyCz.d.ts +45 -0
- package/dist/index-pSrGVYre.d.ts +40 -0
- package/dist/index-t4CBZJDG.d.ts +65 -0
- package/dist/index-wC8PY0fW.d.ts +16 -0
- package/dist/index-wv0Lafz4.d.ts +46 -0
- package/dist/index-zEeZUMLc.d.ts +29 -0
- package/dist/index.d.ts +125 -0
- package/dist/index.js +104 -0
- package/dist/label-DN9tJMXl.js +24 -0
- package/dist/label-DN9tJMXl.js.map +1 -0
- package/dist/label.d.ts +3 -0
- package/dist/label.js +1 -0
- package/dist/link-D3xYrfPK.js +22 -0
- package/dist/link-D3xYrfPK.js.map +1 -0
- package/dist/link-props-Shu8RU_5.js +27 -0
- package/dist/link-props-Shu8RU_5.js.map +1 -0
- package/dist/link.d.ts +3 -0
- package/dist/link.js +1 -0
- package/dist/listbox-virtual-C4wz3TOa.js +281 -0
- package/dist/listbox-virtual-C4wz3TOa.js.map +1 -0
- package/dist/listbox-virtual.d.ts +6 -0
- package/dist/listbox-virtual.js +3 -0
- package/dist/listbox.d.ts +5 -0
- package/dist/listbox.js +1 -0
- package/dist/live-region-style-Xgiu9ttw.js +48 -0
- package/dist/live-region-style-Xgiu9ttw.js.map +1 -0
- package/dist/menu-bar-context-1duNlOWo.js +14 -0
- package/dist/menu-bar-context-1duNlOWo.js.map +1 -0
- package/dist/menu-oZj27rvf.js +123 -0
- package/dist/menu-oZj27rvf.js.map +1 -0
- package/dist/menu-separator-CzAc4jM8.d.ts +143 -0
- package/dist/menu-submenu-trigger-BykOQORL.js +672 -0
- package/dist/menu-submenu-trigger-BykOQORL.js.map +1 -0
- package/dist/menu.d.ts +10 -0
- package/dist/menu.js +1 -0
- package/dist/menubar-wjJF54GJ.js +213 -0
- package/dist/menubar-wjJF54GJ.js.map +1 -0
- package/dist/menubar.d.ts +3 -0
- package/dist/menubar.js +1 -0
- package/dist/meter-11PgO99t.js +120 -0
- package/dist/meter-11PgO99t.js.map +1 -0
- package/dist/meter.d.ts +3 -0
- package/dist/meter.js +1 -0
- package/dist/month-calendar-value-CNJcsqcv.d.ts +5 -0
- package/dist/month-calendar-value-D_au-Kbz.js +35 -0
- package/dist/month-calendar-value-D_au-Kbz.js.map +1 -0
- package/dist/month-calendar.d.ts +6 -0
- package/dist/month-calendar.js +1 -0
- package/dist/month-picker-DFjFvjo9.js +26 -0
- package/dist/month-picker-DFjFvjo9.js.map +1 -0
- package/dist/month-picker-root-base-CI7jcllI.js +162 -0
- package/dist/month-picker-root-base-CI7jcllI.js.map +1 -0
- package/dist/month-picker-root-base-SELhczoy.d.ts +28 -0
- package/dist/month-picker.d.ts +10 -0
- package/dist/month-picker.js +3 -0
- package/dist/month-range-calendar-BmnWB6OD.js +28 -0
- package/dist/month-range-calendar-BmnWB6OD.js.map +1 -0
- package/dist/month-range-calendar.d.ts +6 -0
- package/dist/month-range-calendar.js +3 -0
- package/dist/month-range-picker-TfMtxi2X.js +26 -0
- package/dist/month-range-picker-TfMtxi2X.js.map +1 -0
- package/dist/month-range-picker.d.ts +10 -0
- package/dist/month-range-picker.js +3 -0
- package/dist/multiple-calendar-EBsuTzYQ.js +133 -0
- package/dist/multiple-calendar-EBsuTzYQ.js.map +1 -0
- package/dist/multiple-calendar.d.ts +7 -0
- package/dist/multiple-calendar.js +3 -0
- package/dist/navigation-menu-82shSjXS.js +660 -0
- package/dist/navigation-menu-82shSjXS.js.map +1 -0
- package/dist/navigation-menu.d.ts +5 -0
- package/dist/navigation-menu.js +1 -0
- package/dist/number-field-BUNkL15K.js +491 -0
- package/dist/number-field-BUNkL15K.js.map +1 -0
- package/dist/number-field.d.ts +4 -0
- package/dist/number-field.js +1 -0
- package/dist/otp-field-BMKBhv0O.js +363 -0
- package/dist/otp-field-BMKBhv0O.js.map +1 -0
- package/dist/otp-field.d.ts +4 -0
- package/dist/otp-field.js +1 -0
- package/dist/overlay-handle-DOyqO4oY.js +62 -0
- package/dist/overlay-handle-DOyqO4oY.js.map +1 -0
- package/dist/overlay-handle-DzzlzKqP.d.ts +16 -0
- package/dist/pagination-CMWaQSpr.js +173 -0
- package/dist/pagination-CMWaQSpr.js.map +1 -0
- package/dist/pagination.d.ts +4 -0
- package/dist/pagination.js +1 -0
- package/dist/parts-B2E7RN77.d.ts +170 -0
- package/dist/parts-BHkvkEgf.js +485 -0
- package/dist/parts-BHkvkEgf.js.map +1 -0
- package/dist/parts-BJ94V7Kv.d.ts +24 -0
- package/dist/parts-BL0sXepP.d.ts +101 -0
- package/dist/parts-BjC20sfl.d.ts +19 -0
- package/dist/parts-BnbJ2FWv.d.ts +81 -0
- package/dist/parts-C688_OLH.js +24 -0
- package/dist/parts-C688_OLH.js.map +1 -0
- package/dist/parts-C81p8gpg.d.ts +147 -0
- package/dist/parts-CDVlldST.js +721 -0
- package/dist/parts-CDVlldST.js.map +1 -0
- package/dist/parts-CNp1lOIU.js +24 -0
- package/dist/parts-CNp1lOIU.js.map +1 -0
- package/dist/parts-CXjEfLf7.d.ts +125 -0
- package/dist/parts-CrriPiIL.js +29 -0
- package/dist/parts-CrriPiIL.js.map +1 -0
- package/dist/parts-DVNSEjIO.d.ts +19 -0
- package/dist/parts-DmQ9WqOP.js +512 -0
- package/dist/parts-DmQ9WqOP.js.map +1 -0
- package/dist/parts-DoQQN1Io.d.ts +96 -0
- package/dist/parts-VT0Ohb06.js +806 -0
- package/dist/parts-VT0Ohb06.js.map +1 -0
- package/dist/parts-XRa0gd47.js +350 -0
- package/dist/parts-XRa0gd47.js.map +1 -0
- package/dist/parts-_ZriSS4p.js +376 -0
- package/dist/parts-_ZriSS4p.js.map +1 -0
- package/dist/password-input-BQAySlmc.js +212 -0
- package/dist/password-input-BQAySlmc.js.map +1 -0
- package/dist/password-input.d.ts +4 -0
- package/dist/password-input.js +1 -0
- package/dist/picker-binding-context-7ci59zS0.js +22 -0
- package/dist/picker-binding-context-7ci59zS0.js.map +1 -0
- package/dist/popover-C5UaRJpT.js +295 -0
- package/dist/popover-C5UaRJpT.js.map +1 -0
- package/dist/popover.d.ts +9 -0
- package/dist/popover.js +1 -0
- package/dist/progress-2d64jFqb.js +141 -0
- package/dist/progress-2d64jFqb.js.map +1 -0
- package/dist/progress.d.ts +3 -0
- package/dist/progress.js +1 -0
- package/dist/radio-Mvw36nnF.js +128 -0
- package/dist/radio-Mvw36nnF.js.map +1 -0
- package/dist/radio-group-D7DchtVK.js +149 -0
- package/dist/radio-group-D7DchtVK.js.map +1 -0
- package/dist/radio-group-context-DRe2PyiF.js +6 -0
- package/dist/radio-group-context-DRe2PyiF.js.map +1 -0
- package/dist/radio-group.d.ts +4 -0
- package/dist/radio-group.js +1 -0
- package/dist/radio.d.ts +3 -0
- package/dist/radio.js +1 -0
- package/dist/range-calendar-BMxPzzAr.js +32 -0
- package/dist/range-calendar-BMxPzzAr.js.map +1 -0
- package/dist/range-calendar.d.ts +6 -0
- package/dist/range-calendar.js +1 -0
- package/dist/rating-DQdIL_nz.js +303 -0
- package/dist/rating-DQdIL_nz.js.map +1 -0
- package/dist/rating.d.ts +4 -0
- package/dist/rating.js +1 -0
- package/dist/render-C7XnxB7f.js +40 -0
- package/dist/render-C7XnxB7f.js.map +1 -0
- package/dist/render-element-DXbUbfgN.js +66 -0
- package/dist/render-element-DXbUbfgN.js.map +1 -0
- package/dist/render-element-Pwuv2wsL.d.ts +13 -0
- package/dist/render.d.ts +3 -0
- package/dist/render.js +1 -0
- package/dist/roving-context-BVp0I9UN.js +16 -0
- package/dist/roving-context-BVp0I9UN.js.map +1 -0
- package/dist/scroll-area-CGaVLKik.js +274 -0
- package/dist/scroll-area-CGaVLKik.js.map +1 -0
- package/dist/scroll-area.d.ts +3 -0
- package/dist/scroll-area.js +1 -0
- package/dist/search-field-DqGQt6pC.js +207 -0
- package/dist/search-field-DqGQt6pC.js.map +1 -0
- package/dist/search-field.d.ts +4 -0
- package/dist/search-field.js +1 -0
- package/dist/segmented-control-BYrnLASo.js +316 -0
- package/dist/segmented-control-BYrnLASo.js.map +1 -0
- package/dist/segmented-control.d.ts +4 -0
- package/dist/segmented-control.js +1 -0
- package/dist/select-virtual-9vDaEiye.js +55 -0
- package/dist/select-virtual-9vDaEiye.js.map +1 -0
- package/dist/select-virtual.d.ts +4 -0
- package/dist/select-virtual.js +3 -0
- package/dist/select.d.ts +8 -0
- package/dist/select.js +1 -0
- package/dist/separator-ChAJks2Q.js +18 -0
- package/dist/separator-ChAJks2Q.js.map +1 -0
- package/dist/separator.d.ts +3 -0
- package/dist/separator.js +1 -0
- package/dist/slider-DZiqQ18C.js +437 -0
- package/dist/slider-DZiqQ18C.js.map +1 -0
- package/dist/slider.d.ts +4 -0
- package/dist/slider.js +1 -0
- package/dist/state-attributes-DhboDeMS.js +14 -0
- package/dist/state-attributes-DhboDeMS.js.map +1 -0
- package/dist/steps-t_FxFH9P.js +251 -0
- package/dist/steps-t_FxFH9P.js.map +1 -0
- package/dist/steps.d.ts +4 -0
- package/dist/steps.js +1 -0
- package/dist/switch-D3zj8gtg.js +137 -0
- package/dist/switch-D3zj8gtg.js.map +1 -0
- package/dist/switch.d.ts +4 -0
- package/dist/switch.js +1 -0
- package/dist/tabs-o83wz1hF.js +285 -0
- package/dist/tabs-o83wz1hF.js.map +1 -0
- package/dist/tabs.d.ts +4 -0
- package/dist/tabs.js +1 -0
- package/dist/tag-group-gmBdCkE4.js +354 -0
- package/dist/tag-group-gmBdCkE4.js.map +1 -0
- package/dist/tag-group.d.ts +4 -0
- package/dist/tag-group.js +1 -0
- package/dist/tags-input-Co9pI732.js +555 -0
- package/dist/tags-input-Co9pI732.js.map +1 -0
- package/dist/tags-input.d.ts +4 -0
- package/dist/tags-input.js +1 -0
- package/dist/time-field-qqgemJB1.js +35 -0
- package/dist/time-field-qqgemJB1.js.map +1 -0
- package/dist/time-field.d.ts +5 -0
- package/dist/time-field.js +1 -0
- package/dist/time-range-field-BurnJee0.js +36 -0
- package/dist/time-range-field-BurnJee0.js.map +1 -0
- package/dist/time-range-field.d.ts +7 -0
- package/dist/time-range-field.js +1 -0
- package/dist/toast-ChdTo_Md.js +341 -0
- package/dist/toast-ChdTo_Md.js.map +1 -0
- package/dist/toast.d.ts +4 -0
- package/dist/toast.js +1 -0
- package/dist/toggle-W5tihPuD.js +65 -0
- package/dist/toggle-W5tihPuD.js.map +1 -0
- package/dist/toggle-group-DpJ794rw.js +73 -0
- package/dist/toggle-group-DpJ794rw.js.map +1 -0
- package/dist/toggle-group-context-Bp44l1NR.js +6 -0
- package/dist/toggle-group-context-Bp44l1NR.js.map +1 -0
- package/dist/toggle-group.d.ts +4 -0
- package/dist/toggle-group.js +1 -0
- package/dist/toggle.d.ts +4 -0
- package/dist/toggle.js +1 -0
- package/dist/toolbar-DfjePeEZ.js +178 -0
- package/dist/toolbar-DfjePeEZ.js.map +1 -0
- package/dist/toolbar.d.ts +3 -0
- package/dist/toolbar.js +1 -0
- package/dist/tooltip-CqZtSspz.js +320 -0
- package/dist/tooltip-CqZtSspz.js.map +1 -0
- package/dist/tooltip.d.ts +9 -0
- package/dist/tooltip.js +1 -0
- package/dist/use-color-picker-binding-D0R-FsfF.js +17 -0
- package/dist/use-color-picker-binding-D0R-FsfF.js.map +1 -0
- package/dist/use-controllable-state-Dm8eNkgP.js +36 -0
- package/dist/use-controllable-state-Dm8eNkgP.js.map +1 -0
- package/dist/use-element-tpFZ-kuA.js +10 -0
- package/dist/use-element-tpFZ-kuA.js.map +1 -0
- package/dist/use-field-control-CL_nOU7T.js +131 -0
- package/dist/use-field-control-CL_nOU7T.js.map +1 -0
- package/dist/use-overlay-portal-Cfv6qtTO.js +18 -0
- package/dist/use-overlay-portal-Cfv6qtTO.js.map +1 -0
- package/dist/use-overlay-portal-D8GjZ-m7.d.ts +13 -0
- package/dist/use-overlay-root-BDO5E_0S.d.ts +23 -0
- package/dist/use-overlay-root-eXuUlCpV.js +225 -0
- package/dist/use-overlay-root-eXuUlCpV.js.map +1 -0
- package/dist/use-overlay-trigger-CxW1Z6Q6.js +74 -0
- package/dist/use-overlay-trigger-CxW1Z6Q6.js.map +1 -0
- package/dist/use-overlay-trigger-PP99t2ZF.d.ts +11 -0
- package/dist/use-panel-transition-CKMdsqPR.js +145 -0
- package/dist/use-panel-transition-CKMdsqPR.js.map +1 -0
- package/dist/use-positioner-BpxM4U5Y.d.ts +11 -0
- package/dist/use-positioner-DtJR980s.js +56 -0
- package/dist/use-positioner-DtJR980s.js.map +1 -0
- package/dist/use-presence-Cwi_UTLe.js +97 -0
- package/dist/use-presence-Cwi_UTLe.js.map +1 -0
- package/dist/use-required-context-Cjd_CYnv.js +11 -0
- package/dist/use-required-context-Cjd_CYnv.js.map +1 -0
- package/dist/use-roving-composite-D0vtGxm8.js +82 -0
- package/dist/use-roving-composite-D0vtGxm8.js.map +1 -0
- package/dist/use-roving-item-Dxe3phsZ.js +42 -0
- package/dist/use-roving-item-Dxe3phsZ.js.map +1 -0
- package/dist/use-segment-group--unFuh-Z.js +307 -0
- package/dist/use-segment-group--unFuh-Z.js.map +1 -0
- package/dist/use-virtual-rows-B5N0qgmT.js +99 -0
- package/dist/use-virtual-rows-B5N0qgmT.js.map +1 -0
- package/dist/use-virtual-rows-BQFqR0_e.d.ts +16 -0
- package/dist/year-calendar-CroBMFMN.js +28 -0
- package/dist/year-calendar-CroBMFMN.js.map +1 -0
- package/dist/year-calendar.d.ts +6 -0
- package/dist/year-calendar.js +3 -0
- package/dist/year-picker-DJVxXtPh.js +26 -0
- package/dist/year-picker-DJVxXtPh.js.map +1 -0
- package/dist/year-picker.d.ts +10 -0
- package/dist/year-picker.js +3 -0
- package/dist/year-range-calendar-Cz2WYDV2.js +28 -0
- package/dist/year-range-calendar-Cz2WYDV2.js.map +1 -0
- package/dist/year-range-calendar.d.ts +6 -0
- package/dist/year-range-calendar.js +3 -0
- package/dist/year-range-picker-9f7L5Hgx.js +26 -0
- package/dist/year-range-picker-9f7L5Hgx.js.map +1 -0
- package/dist/year-range-picker.d.ts +10 -0
- package/dist/year-range-picker.js +3 -0
- package/package.json +553 -3
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as useControllableState } from "./use-controllable-state-Dm8eNkgP.js";
|
|
2
|
+
import { t as useElement } from "./use-element-tpFZ-kuA.js";
|
|
3
|
+
import { t as useRovingComposite } from "./use-roving-composite-D0vtGxm8.js";
|
|
4
|
+
import { t as renderElement } from "./render-element-DXbUbfgN.js";
|
|
5
|
+
import { n as scopeOfElement, t as RovingContext } from "./roving-context-BVp0I9UN.js";
|
|
6
|
+
import { t as stateAttributes } from "./state-attributes-DhboDeMS.js";
|
|
7
|
+
import { t as ToggleGroupContext } from "./toggle-group-context-Bp44l1NR.js";
|
|
8
|
+
import { useCallback, useContext, useMemo } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
// src/components/toggle-group/toggle-group.tsx
|
|
11
|
+
const NONE = [];
|
|
12
|
+
/**
|
|
13
|
+
* Toggles sharing one value (spec/toggle-group.md, Base UI's ToggleGroup with the APG toolbar's
|
|
14
|
+
* keys): one tab stop, the arrows move the focus. Inside a Toolbar it opens no roving focus of
|
|
15
|
+
* its own: its Toggles are the toolbar's items (spec/toolbar.md, "Nested composites").
|
|
16
|
+
*/
|
|
17
|
+
function ToggleGroup({ value: valueProp, defaultValue = NONE, onValueChange, multiple = false, disabled: disabledProp = false, orientation: orientationProp = "horizontal", loopFocus = true, ...props }) {
|
|
18
|
+
const [value, setValue] = useControllableState(valueProp, defaultValue, (next, details) => onValueChange?.([...next], details));
|
|
19
|
+
const [element, ref] = useElement();
|
|
20
|
+
const outer = scopeOfElement(useContext(RovingContext), element);
|
|
21
|
+
const disabled = disabledProp || (outer?.disabled ?? false);
|
|
22
|
+
const orientation = outer?.orientation ?? orientationProp;
|
|
23
|
+
const own = useRovingComposite({
|
|
24
|
+
orientation: orientationProp,
|
|
25
|
+
loopFocus,
|
|
26
|
+
disabled: false,
|
|
27
|
+
root: element
|
|
28
|
+
});
|
|
29
|
+
const setPressed = useCallback((item, pressed, details) => {
|
|
30
|
+
const others = value.filter((entry) => entry !== item);
|
|
31
|
+
const next = pressed ? multiple ? [...others, item] : [item] : others;
|
|
32
|
+
setValue(next, details);
|
|
33
|
+
}, [
|
|
34
|
+
value,
|
|
35
|
+
multiple,
|
|
36
|
+
setValue
|
|
37
|
+
]);
|
|
38
|
+
const context = useMemo(() => ({
|
|
39
|
+
value,
|
|
40
|
+
disabled,
|
|
41
|
+
setPressed
|
|
42
|
+
}), [
|
|
43
|
+
value,
|
|
44
|
+
disabled,
|
|
45
|
+
setPressed
|
|
46
|
+
]);
|
|
47
|
+
const state = {
|
|
48
|
+
value: [...value],
|
|
49
|
+
disabled,
|
|
50
|
+
multiple,
|
|
51
|
+
orientation
|
|
52
|
+
};
|
|
53
|
+
const rendered = renderElement("div", props, state, {
|
|
54
|
+
role: "group",
|
|
55
|
+
"data-primitives-part": "toggle-group-root",
|
|
56
|
+
...stateAttributes({
|
|
57
|
+
orientation,
|
|
58
|
+
multiple,
|
|
59
|
+
disabled
|
|
60
|
+
}),
|
|
61
|
+
onKeyDown: outer === null ? own.onKeyDown : void 0
|
|
62
|
+
}, ref);
|
|
63
|
+
return /* @__PURE__ */ jsx(ToggleGroupContext.Provider, {
|
|
64
|
+
value: context,
|
|
65
|
+
children: /* @__PURE__ */ jsx(RovingContext.Provider, {
|
|
66
|
+
value: outer ?? own.scope,
|
|
67
|
+
children: rendered
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export { ToggleGroup as t };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=toggle-group-DpJ794rw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group-DpJ794rw.js","names":[],"sources":["../src/components/toggle-group/toggle-group.tsx"],"sourcesContent":["import type { RovingOrientation } from \"@fragiola/primitives/collection\";\nimport { useCallback, useContext, useMemo } from \"react\";\nimport { useControllableState } from \"../../hooks/use-controllable-state.ts\";\nimport { useElement } from \"../../hooks/use-element.ts\";\nimport { useRovingComposite } from \"../../hooks/use-roving-composite.ts\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { RovingContext, scopeOfElement } from \"../../utils/roving-context.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { ToggleGroupContext } from \"../toggle/toggle-group-context.ts\";\n\nexport interface ToggleGroupState {\n value: string[];\n disabled: boolean;\n multiple: boolean;\n orientation: RovingOrientation;\n}\n\nexport interface ToggleGroupProps extends PartProps<ToggleGroupState> {\n /** The values of the pressed toggles (controlled). */\n value?: readonly string[];\n /** The values pressed at first (default `[]`). */\n defaultValue?: readonly string[];\n /** Every change of the pressed values (reason `none`). */\n onValueChange?: (value: string[], details: ChangeDetails) => void;\n /** Several toggles may be pressed (default `false`). */\n multiple?: boolean;\n /** Every toggle is disabled. */\n disabled?: boolean;\n /** The arrow keys' axis (default `\"horizontal\"`); a Toolbar's inside one. */\n orientation?: RovingOrientation;\n /** The arrows wrap from the last toggle to the first and back (default `true`). */\n loopFocus?: boolean;\n}\n\nconst NONE: readonly string[] = [];\n\n/**\n * Toggles sharing one value (spec/toggle-group.md, Base UI's ToggleGroup with the APG toolbar's\n * keys): one tab stop, the arrows move the focus. Inside a Toolbar it opens no roving focus of\n * its own: its Toggles are the toolbar's items (spec/toolbar.md, \"Nested composites\").\n */\nexport function ToggleGroup({\n value: valueProp,\n defaultValue = NONE,\n onValueChange,\n multiple = false,\n disabled: disabledProp = false,\n orientation: orientationProp = \"horizontal\",\n loopFocus = true,\n ...props\n}: ToggleGroupProps) {\n const [value, setValue] = useControllableState<\n readonly string[],\n ChangeDetails\n >(valueProp, defaultValue, (next, details) =>\n onValueChange?.([...next], details),\n );\n const [element, ref] = useElement<HTMLElement>();\n // a Toolbar's scope around it, unless the group is outside the toolbar's element (in a popup\n // a portal renders from the toolbar: \"Nested composites\", 6)\n const outer = scopeOfElement(useContext(RovingContext), element);\n const disabled = disabledProp || (outer?.disabled ?? false);\n const orientation = outer?.orientation ?? orientationProp;\n const own = useRovingComposite({\n orientation: orientationProp,\n loopFocus,\n disabled: false,\n root: element,\n });\n\n const setPressed = useCallback(\n (item: string, pressed: boolean, details: ChangeDetails) => {\n const others = value.filter((entry) => entry !== item);\n const next = pressed\n ? multiple\n ? [...others, item]\n : [item]\n : others;\n setValue(next, details);\n },\n [value, multiple, setValue],\n );\n const context = useMemo(\n () => ({ value, disabled, setPressed }),\n [value, disabled, setPressed],\n );\n const state = { value: [...value], disabled, multiple, orientation };\n const rendered = renderElement(\n \"div\",\n props,\n state,\n {\n role: \"group\",\n \"data-primitives-part\": \"toggle-group-root\",\n ...stateAttributes({ orientation, multiple, disabled }),\n // inside a Toolbar, the toolbar's root handles the keys\n onKeyDown: outer === null ? own.onKeyDown : undefined,\n },\n ref,\n );\n // always one provider (the toolbar's scope passed on, or its own), so the group's element is\n // never remade when it finds out where it is\n return (\n <ToggleGroupContext.Provider value={context}>\n <RovingContext.Provider value={outer ?? own.scope}>\n {rendered}\n </RovingContext.Provider>\n </ToggleGroupContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;AAmCA,MAAM,OAA0B,CAAC;;;;;;AAOjC,SAAgB,YAAY,EACxB,OAAO,WACP,eAAe,MACf,eACA,WAAW,OACX,UAAU,eAAe,OACzB,aAAa,kBAAkB,cAC/B,YAAY,MACZ,GAAG,SACc;CACjB,MAAM,CAAC,OAAO,YAAY,qBAGxB,WAAW,eAAe,MAAM,YAC9B,gBAAgB,CAAC,GAAG,IAAI,GAAG,OAAO,CACtC;CACA,MAAM,CAAC,SAAS,OAAO,WAAwB;CAG/C,MAAM,QAAQ,eAAe,WAAW,aAAa,GAAG,OAAO;CAC/D,MAAM,WAAW,iBAAiB,OAAO,YAAY;CACrD,MAAM,cAAc,OAAO,eAAe;CAC1C,MAAM,MAAM,mBAAmB;EAC3B,aAAa;EACb;EACA,UAAU;EACV,MAAM;CACV,CAAC;CAED,MAAM,aAAa,aACd,MAAc,SAAkB,YAA2B;EACxD,MAAM,SAAS,MAAM,QAAQ,UAAU,UAAU,IAAI;EACrD,MAAM,OAAO,UACP,WACI,CAAC,GAAG,QAAQ,IAAI,IAChB,CAAC,IAAI,IACT;EACN,SAAS,MAAM,OAAO;CAC1B,GACA;EAAC;EAAO;EAAU;CAAQ,CAC9B;CACA,MAAM,UAAU,eACL;EAAE;EAAO;EAAU;CAAW,IACrC;EAAC;EAAO;EAAU;CAAU,CAChC;CACA,MAAM,QAAQ;EAAE,OAAO,CAAC,GAAG,KAAK;EAAG;EAAU;EAAU;CAAY;CACnE,MAAM,WAAW,cACb,OACA,OACA,OACA;EACI,MAAM;EACN,wBAAwB;EACxB,GAAG,gBAAgB;GAAE;GAAa;GAAU;EAAS,CAAC;EAEtD,WAAW,UAAU,OAAO,IAAI,YAAY,KAAA;CAChD,GACA,GACJ;CAGA,OACI,oBAAC,mBAAmB,UAApB;EAA6B,OAAO;EAChC,UAAA,oBAAC,cAAc,UAAf;GAAwB,OAAO,SAAS,IAAI;GACvC,UAAA;EACmB,CAAA;CACC,CAAA;AAErC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group-context-Bp44l1NR.js","names":[],"sources":["../src/components/toggle/toggle-group-context.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\n\n/**\n * What a ToggleGroup gives its Toggles (spec/toggle-group.md). It lives in the Toggle's folder, so\n * a Toggle alone ships no ToggleGroup code; `/toggle-group` is built on `/toggle`\n * (`ENTRY_DEPENDENCIES`).\n */\nexport interface ToggleGroupContextValue {\n /** The values of the pressed toggles. */\n value: readonly string[];\n disabled: boolean;\n /** A Toggle of the group was pressed or released. */\n setPressed: (\n value: string,\n pressed: boolean,\n details: ChangeDetails,\n ) => void;\n}\n\nexport const ToggleGroupContext = createContext<ToggleGroupContextValue | null>(\n null,\n);\n"],"mappings":";;AAoBA,MAAa,qBAAqB,cAC9B,IACJ"}
|
|
@@ -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 { i as ToggleGroupState, n as ToggleGroup, r as ToggleGroupProps, t as RovingOrientation } from "./index-CU9QnAha.js";
|
|
4
|
+
export { type ChangeDetails, type ChangeReason, type RenderProp, type RovingOrientation, ToggleGroup, type ToggleGroupProps, type ToggleGroupState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as ToggleGroup } from "./toggle-group-DpJ794rw.js";
|
package/dist/toggle.d.ts
ADDED
|
@@ -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 { n as ToggleProps, r as ToggleState, t as Toggle } from "./index-BUJIeLCT.js";
|
|
4
|
+
export { type ChangeDetails, type ChangeReason, type RenderProp, Toggle, type ToggleProps, type ToggleState };
|
package/dist/toggle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Toggle } from "./toggle-W5tihPuD.js";
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { t as useRequiredContext } from "./use-required-context-Cjd_CYnv.js";
|
|
2
|
+
import { t as useRovingItem } from "./use-roving-item-Dxe3phsZ.js";
|
|
3
|
+
import { t as buttonProps } from "./button-props-DWfy1ZSo.js";
|
|
4
|
+
import { t as renderElement } from "./render-element-DXbUbfgN.js";
|
|
5
|
+
import { t as stateAttributes } from "./state-attributes-DhboDeMS.js";
|
|
6
|
+
import { t as RovingContext } from "./roving-context-BVp0I9UN.js";
|
|
7
|
+
import { t as useElement } from "./use-element-tpFZ-kuA.js";
|
|
8
|
+
import { t as useRovingComposite } from "./use-roving-composite-D0vtGxm8.js";
|
|
9
|
+
import { createContext, useContext, useMemo } from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
// src/components/toolbar/toolbar-context.ts
|
|
12
|
+
const ToolbarContext = createContext(null);
|
|
13
|
+
// src/components/toolbar/toolbar-button.tsx
|
|
14
|
+
/** A button of a toolbar (spec/toolbar.md): Button's behaviour, an item of the toolbar's focus. */
|
|
15
|
+
function ToolbarButton({ disabled: disabledProp = false, focusableWhenDisabled = false, nativeButton = true, type, onClick, onMouseDown, onPointerDown, onKeyDown, onKeyUp, onFocus, ...props }) {
|
|
16
|
+
const { orientation } = useRequiredContext(ToolbarContext, "Toolbar.Button");
|
|
17
|
+
const item = useRovingItem((scopeDisabled) => !(disabledProp || scopeDisabled) || focusableWhenDisabled);
|
|
18
|
+
const disabled = disabledProp || (item.scope?.disabled ?? false);
|
|
19
|
+
return renderElement("button", props, {
|
|
20
|
+
orientation,
|
|
21
|
+
disabled
|
|
22
|
+
}, {
|
|
23
|
+
...buttonProps({
|
|
24
|
+
disabled,
|
|
25
|
+
focusableWhenDisabled,
|
|
26
|
+
nativeButton,
|
|
27
|
+
type,
|
|
28
|
+
tabIndex: item.tabIndex,
|
|
29
|
+
composite: true,
|
|
30
|
+
onClick,
|
|
31
|
+
onMouseDown,
|
|
32
|
+
onPointerDown,
|
|
33
|
+
onKeyDown,
|
|
34
|
+
onKeyUp
|
|
35
|
+
}),
|
|
36
|
+
"data-primitives-part": "toolbar-button",
|
|
37
|
+
...stateAttributes({
|
|
38
|
+
orientation,
|
|
39
|
+
disabled
|
|
40
|
+
}),
|
|
41
|
+
onFocus: (event) => {
|
|
42
|
+
item.onFocus();
|
|
43
|
+
onFocus?.(event);
|
|
44
|
+
}
|
|
45
|
+
}, item.ref);
|
|
46
|
+
}
|
|
47
|
+
// src/components/toolbar/toolbar-group.tsx
|
|
48
|
+
/**
|
|
49
|
+
* A group of a toolbar's items (spec/toolbar.md): no focus of its own; it passes its `disabled`
|
|
50
|
+
* on to the items inside it through the toolbar's roving scope ("Nested composites").
|
|
51
|
+
*/
|
|
52
|
+
function ToolbarGroup({ disabled: disabledProp = false, children, ...props }) {
|
|
53
|
+
const { orientation } = useRequiredContext(ToolbarContext, "Toolbar.Group");
|
|
54
|
+
const scope = useContext(RovingContext);
|
|
55
|
+
const disabled = disabledProp || (scope?.disabled ?? false);
|
|
56
|
+
const inner = useMemo(() => scope === null ? null : {
|
|
57
|
+
...scope,
|
|
58
|
+
disabled
|
|
59
|
+
}, [scope, disabled]);
|
|
60
|
+
return renderElement("div", {
|
|
61
|
+
...props,
|
|
62
|
+
children: /* @__PURE__ */ jsx(RovingContext.Provider, {
|
|
63
|
+
value: inner,
|
|
64
|
+
children
|
|
65
|
+
})
|
|
66
|
+
}, {
|
|
67
|
+
orientation,
|
|
68
|
+
disabled
|
|
69
|
+
}, {
|
|
70
|
+
role: "group",
|
|
71
|
+
"data-primitives-part": "toolbar-group",
|
|
72
|
+
...stateAttributes({
|
|
73
|
+
orientation,
|
|
74
|
+
disabled
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// src/components/toolbar/toolbar-input.tsx
|
|
79
|
+
/**
|
|
80
|
+
* A text input of a toolbar (spec/toolbar.md): an item of the toolbar's focus that keeps its caret
|
|
81
|
+
* keys until the caret reaches the text's edge.
|
|
82
|
+
*/
|
|
83
|
+
function ToolbarInput({ disabled: disabledProp = false, focusableWhenDisabled = false, ...props }) {
|
|
84
|
+
const { orientation } = useRequiredContext(ToolbarContext, "Toolbar.Input");
|
|
85
|
+
const item = useRovingItem((scopeDisabled) => !(disabledProp || scopeDisabled) || focusableWhenDisabled);
|
|
86
|
+
const disabled = disabledProp || (item.scope?.disabled ?? false);
|
|
87
|
+
const preventWhenDisabled = (event) => {
|
|
88
|
+
if (disabled) event.preventDefault();
|
|
89
|
+
};
|
|
90
|
+
return renderElement("input", props, {
|
|
91
|
+
orientation,
|
|
92
|
+
disabled
|
|
93
|
+
}, {
|
|
94
|
+
disabled: disabled && !focusableWhenDisabled ? true : void 0,
|
|
95
|
+
"aria-disabled": disabled && focusableWhenDisabled ? "true" : void 0,
|
|
96
|
+
readOnly: disabled && focusableWhenDisabled ? true : void 0,
|
|
97
|
+
tabIndex: item.tabIndex,
|
|
98
|
+
"data-primitives-part": "toolbar-input",
|
|
99
|
+
...stateAttributes({
|
|
100
|
+
orientation,
|
|
101
|
+
disabled
|
|
102
|
+
}),
|
|
103
|
+
onClick: preventWhenDisabled,
|
|
104
|
+
onPointerDown: preventWhenDisabled,
|
|
105
|
+
onFocus: item.onFocus
|
|
106
|
+
}, item.ref);
|
|
107
|
+
}
|
|
108
|
+
// src/components/toolbar/toolbar-link.tsx
|
|
109
|
+
/** A link of a toolbar (spec/toolbar.md): an item of the toolbar's focus; it cannot be disabled. */
|
|
110
|
+
function ToolbarLink(props) {
|
|
111
|
+
const { orientation } = useRequiredContext(ToolbarContext, "Toolbar.Link");
|
|
112
|
+
const item = useRovingItem(() => true);
|
|
113
|
+
return renderElement("a", props, { orientation }, {
|
|
114
|
+
tabIndex: item.tabIndex,
|
|
115
|
+
"data-primitives-part": "toolbar-link",
|
|
116
|
+
...stateAttributes({ orientation }),
|
|
117
|
+
onFocus: item.onFocus
|
|
118
|
+
}, item.ref);
|
|
119
|
+
}
|
|
120
|
+
// src/components/toolbar/toolbar-root.tsx
|
|
121
|
+
/**
|
|
122
|
+
* A set of controls that is one tab stop (spec/toolbar.md, the APG toolbar): the roving-focus
|
|
123
|
+
* scope every item inside registers with, a ToggleGroup's Toggles included ("Nested composites").
|
|
124
|
+
*/
|
|
125
|
+
function ToolbarRoot({ orientation = "horizontal", loopFocus = true, disabled = false, ...props }) {
|
|
126
|
+
const [element, ref] = useElement();
|
|
127
|
+
const { scope, onKeyDown } = useRovingComposite({
|
|
128
|
+
orientation,
|
|
129
|
+
loopFocus,
|
|
130
|
+
disabled,
|
|
131
|
+
root: element
|
|
132
|
+
});
|
|
133
|
+
const context = useMemo(() => ({ orientation }), [orientation]);
|
|
134
|
+
const state = {
|
|
135
|
+
orientation,
|
|
136
|
+
disabled
|
|
137
|
+
};
|
|
138
|
+
return /* @__PURE__ */ jsx(ToolbarContext.Provider, {
|
|
139
|
+
value: context,
|
|
140
|
+
children: /* @__PURE__ */ jsx(RovingContext.Provider, {
|
|
141
|
+
value: scope,
|
|
142
|
+
children: renderElement("div", props, state, {
|
|
143
|
+
role: "toolbar",
|
|
144
|
+
"aria-orientation": orientation,
|
|
145
|
+
"data-primitives-part": "toolbar-root",
|
|
146
|
+
...stateAttributes({
|
|
147
|
+
orientation,
|
|
148
|
+
disabled
|
|
149
|
+
}),
|
|
150
|
+
onKeyDown
|
|
151
|
+
}, ref)
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
// src/components/toolbar/toolbar-separator.tsx
|
|
156
|
+
/** A separator across a toolbar's orientation (spec/toolbar.md), not focusable. */
|
|
157
|
+
function ToolbarSeparator(props) {
|
|
158
|
+
const orientation = useRequiredContext(ToolbarContext, "Toolbar.Separator").orientation === "horizontal" ? "vertical" : "horizontal";
|
|
159
|
+
return renderElement("div", props, { orientation }, {
|
|
160
|
+
role: "separator",
|
|
161
|
+
"aria-orientation": orientation,
|
|
162
|
+
"data-primitives-part": "toolbar-separator",
|
|
163
|
+
...stateAttributes({ orientation })
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
// src/components/toolbar/parts.ts
|
|
167
|
+
/** spec/toolbar.md */
|
|
168
|
+
const Toolbar = {
|
|
169
|
+
Root: ToolbarRoot,
|
|
170
|
+
Button: ToolbarButton,
|
|
171
|
+
Link: ToolbarLink,
|
|
172
|
+
Input: ToolbarInput,
|
|
173
|
+
Group: ToolbarGroup,
|
|
174
|
+
Separator: ToolbarSeparator
|
|
175
|
+
};
|
|
176
|
+
export { Toolbar as t };
|
|
177
|
+
|
|
178
|
+
//# sourceMappingURL=toolbar-DfjePeEZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-DfjePeEZ.js","names":[],"sources":["../src/components/toolbar/toolbar-context.ts","../src/components/toolbar/toolbar-button.tsx","../src/components/toolbar/toolbar-group.tsx","../src/components/toolbar/toolbar-input.tsx","../src/components/toolbar/toolbar-link.tsx","../src/components/toolbar/toolbar-root.tsx","../src/components/toolbar/toolbar-separator.tsx","../src/components/toolbar/parts.ts"],"sourcesContent":["import type { RovingOrientation } from \"@fragiola/primitives/collection\";\nimport { createContext } from \"react\";\n\n/** What a Toolbar.Root gives its parts (spec/toolbar.md); its items register with its roving scope. */\nexport interface ToolbarContextValue {\n orientation: RovingOrientation;\n}\n\nexport const ToolbarContext = createContext<ToolbarContextValue | null>(null);\n\n/** The parts' state: the toolbar's orientation, and whether the part is disabled. */\nexport interface ToolbarItemState {\n orientation: RovingOrientation;\n disabled: boolean;\n}\n","import type {\n FocusEvent,\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n PointerEventHandler,\n} from \"react\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { useRovingItem } from \"../../hooks/use-roving-item.ts\";\nimport { buttonProps } from \"../../utils/button-props.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { ToolbarContext, type ToolbarItemState } from \"./toolbar-context.ts\";\n\nexport interface ToolbarButtonProps extends PartProps<ToolbarItemState> {\n /** The button ignores presses and keys. */\n disabled?: boolean;\n /** A disabled button the arrows still reach (spec/toolbar.md, \"Disabled items\"). */\n focusableWhenDisabled?: boolean;\n /** Whether the rendered element is a native `<button>` (default `true`), as Button's. */\n nativeButton?: boolean;\n /** Forwarded; a native button is `type=\"button\"` unless given. */\n type?: \"button\" | \"submit\" | \"reset\";\n onClick?: MouseEventHandler<HTMLElement>;\n onMouseDown?: MouseEventHandler<HTMLElement>;\n onPointerDown?: PointerEventHandler<HTMLElement>;\n onKeyDown?: KeyboardEventHandler<HTMLElement>;\n onKeyUp?: KeyboardEventHandler<HTMLElement>;\n onFocus?: FocusEventHandler<HTMLElement>;\n}\n\n/** A button of a toolbar (spec/toolbar.md): Button's behaviour, an item of the toolbar's focus. */\nexport function ToolbarButton({\n disabled: disabledProp = false,\n focusableWhenDisabled = false,\n nativeButton = true,\n type,\n onClick,\n onMouseDown,\n onPointerDown,\n onKeyDown,\n onKeyUp,\n onFocus,\n ...props\n}: ToolbarButtonProps) {\n const { orientation } = useRequiredContext(\n ToolbarContext,\n \"Toolbar.Button\",\n );\n const item = useRovingItem(\n (scopeDisabled) =>\n !(disabledProp || scopeDisabled) || focusableWhenDisabled,\n );\n const disabled = disabledProp || (item.scope?.disabled ?? false);\n const state = { orientation, disabled };\n return renderElement(\n \"button\",\n props,\n state,\n {\n ...buttonProps({\n disabled,\n focusableWhenDisabled,\n nativeButton,\n type,\n tabIndex: item.tabIndex,\n composite: true,\n onClick,\n onMouseDown,\n onPointerDown,\n onKeyDown,\n onKeyUp,\n }),\n \"data-primitives-part\": \"toolbar-button\",\n ...stateAttributes({ orientation, disabled }),\n onFocus: (event: FocusEvent<HTMLElement>) => {\n item.onFocus();\n onFocus?.(event);\n },\n },\n item.ref,\n );\n}\n","import { useContext, useMemo } from \"react\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { RovingContext } from \"../../utils/roving-context.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { ToolbarContext, type ToolbarItemState } from \"./toolbar-context.ts\";\n\nexport interface ToolbarGroupProps extends PartProps<ToolbarItemState> {\n /** Every item in it is disabled. */\n disabled?: boolean;\n}\n\n/**\n * A group of a toolbar's items (spec/toolbar.md): no focus of its own; it passes its `disabled`\n * on to the items inside it through the toolbar's roving scope (\"Nested composites\").\n */\nexport function ToolbarGroup({\n disabled: disabledProp = false,\n children,\n ...props\n}: ToolbarGroupProps) {\n const { orientation } = useRequiredContext(ToolbarContext, \"Toolbar.Group\");\n const scope = useContext(RovingContext);\n const disabled = disabledProp || (scope?.disabled ?? false);\n const inner = useMemo(\n () => (scope === null ? null : { ...scope, disabled }),\n [scope, disabled],\n );\n return renderElement(\n \"div\",\n {\n ...props,\n children: (\n <RovingContext.Provider value={inner}>\n {children}\n </RovingContext.Provider>\n ),\n },\n { orientation, disabled },\n {\n role: \"group\",\n \"data-primitives-part\": \"toolbar-group\",\n ...stateAttributes({ orientation, disabled }),\n },\n );\n}\n","import type { MouseEvent, PointerEvent } from \"react\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { useRovingItem } from \"../../hooks/use-roving-item.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { ToolbarContext, type ToolbarItemState } from \"./toolbar-context.ts\";\n\nexport interface ToolbarInputProps extends PartProps<ToolbarItemState> {\n /** The input ignores presses and typing. */\n disabled?: boolean;\n /** A disabled input the arrows still reach: `aria-disabled` and `readonly` (spec/toolbar.md). */\n focusableWhenDisabled?: boolean;\n}\n\n/**\n * A text input of a toolbar (spec/toolbar.md): an item of the toolbar's focus that keeps its caret\n * keys until the caret reaches the text's edge.\n */\nexport function ToolbarInput({\n disabled: disabledProp = false,\n focusableWhenDisabled = false,\n ...props\n}: ToolbarInputProps) {\n const { orientation } = useRequiredContext(ToolbarContext, \"Toolbar.Input\");\n const item = useRovingItem(\n (scopeDisabled) =>\n !(disabledProp || scopeDisabled) || focusableWhenDisabled,\n );\n const disabled = disabledProp || (item.scope?.disabled ?? false);\n const preventWhenDisabled = (\n event: MouseEvent<HTMLElement> | PointerEvent<HTMLElement>,\n ) => {\n if (disabled) {\n event.preventDefault();\n }\n };\n return renderElement(\n \"input\",\n props,\n { orientation, disabled },\n {\n disabled: disabled && !focusableWhenDisabled ? true : undefined,\n \"aria-disabled\":\n disabled && focusableWhenDisabled ? \"true\" : undefined,\n readOnly: disabled && focusableWhenDisabled ? true : undefined,\n tabIndex: item.tabIndex,\n \"data-primitives-part\": \"toolbar-input\",\n ...stateAttributes({ orientation, disabled }),\n onClick: preventWhenDisabled,\n onPointerDown: preventWhenDisabled,\n onFocus: item.onFocus,\n },\n item.ref,\n );\n}\n","import { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { useRovingItem } from \"../../hooks/use-roving-item.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { ToolbarContext } from \"./toolbar-context.ts\";\n\nexport interface ToolbarLinkState {\n orientation: \"horizontal\" | \"vertical\";\n}\n\nexport type ToolbarLinkProps = PartProps<ToolbarLinkState>;\n\n/** A link of a toolbar (spec/toolbar.md): an item of the toolbar's focus; it cannot be disabled. */\nexport function ToolbarLink(props: ToolbarLinkProps) {\n const { orientation } = useRequiredContext(ToolbarContext, \"Toolbar.Link\");\n const item = useRovingItem(() => true);\n return renderElement(\n \"a\",\n props,\n { orientation },\n {\n tabIndex: item.tabIndex,\n \"data-primitives-part\": \"toolbar-link\",\n ...stateAttributes({ orientation }),\n onFocus: item.onFocus,\n },\n item.ref,\n );\n}\n","import type { RovingOrientation } from \"@fragiola/primitives/collection\";\nimport { useMemo } from \"react\";\nimport { useElement } from \"../../hooks/use-element.ts\";\nimport { useRovingComposite } from \"../../hooks/use-roving-composite.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { RovingContext } from \"../../utils/roving-context.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { ToolbarContext } from \"./toolbar-context.ts\";\n\nexport interface ToolbarRootState {\n orientation: RovingOrientation;\n disabled: boolean;\n}\n\nexport interface ToolbarRootProps extends PartProps<ToolbarRootState> {\n /** The arrow keys' axis (default `\"horizontal\"`). */\n orientation?: RovingOrientation;\n /** The arrows wrap from the last item to the first and back (default `true`). */\n loopFocus?: boolean;\n /** Every Button, Input, Toggle and ToggleGroup in it is disabled. */\n disabled?: boolean;\n}\n\n/**\n * A set of controls that is one tab stop (spec/toolbar.md, the APG toolbar): the roving-focus\n * scope every item inside registers with, a ToggleGroup's Toggles included (\"Nested composites\").\n */\nexport function ToolbarRoot({\n orientation = \"horizontal\",\n loopFocus = true,\n disabled = false,\n ...props\n}: ToolbarRootProps) {\n const [element, ref] = useElement<HTMLElement>();\n const { scope, onKeyDown } = useRovingComposite({\n orientation,\n loopFocus,\n disabled,\n root: element,\n });\n const context = useMemo(() => ({ orientation }), [orientation]);\n const state = { orientation, disabled };\n return (\n <ToolbarContext.Provider value={context}>\n <RovingContext.Provider value={scope}>\n {renderElement(\n \"div\",\n props,\n state,\n {\n role: \"toolbar\",\n \"aria-orientation\": orientation,\n \"data-primitives-part\": \"toolbar-root\",\n ...stateAttributes({ orientation, disabled }),\n onKeyDown,\n },\n ref,\n )}\n </RovingContext.Provider>\n </ToolbarContext.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 { ToolbarContext } from \"./toolbar-context.ts\";\n\nexport interface ToolbarSeparatorState {\n /** Across the toolbar's: `\"vertical\"` in a horizontal toolbar. */\n orientation: \"horizontal\" | \"vertical\";\n}\n\nexport type ToolbarSeparatorProps = PartProps<ToolbarSeparatorState>;\n\n/** A separator across a toolbar's orientation (spec/toolbar.md), not focusable. */\nexport function ToolbarSeparator(props: ToolbarSeparatorProps) {\n const toolbar = useRequiredContext(ToolbarContext, \"Toolbar.Separator\");\n const orientation =\n toolbar.orientation === \"horizontal\" ? \"vertical\" : \"horizontal\";\n return renderElement(\n \"div\",\n props,\n { orientation },\n {\n role: \"separator\",\n \"aria-orientation\": orientation,\n \"data-primitives-part\": \"toolbar-separator\",\n ...stateAttributes({ orientation }),\n },\n );\n}\n","import { ToolbarButton } from \"./toolbar-button.tsx\";\nimport { ToolbarGroup } from \"./toolbar-group.tsx\";\nimport { ToolbarInput } from \"./toolbar-input.tsx\";\nimport { ToolbarLink } from \"./toolbar-link.tsx\";\nimport { ToolbarRoot } from \"./toolbar-root.tsx\";\nimport { ToolbarSeparator } from \"./toolbar-separator.tsx\";\n\n/** spec/toolbar.md */\nexport const Toolbar = {\n Root: ToolbarRoot,\n Button: ToolbarButton,\n Link: ToolbarLink,\n Input: ToolbarInput,\n Group: ToolbarGroup,\n Separator: ToolbarSeparator,\n};\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,iBAAiB,cAA0C,IAAI;;;ACwB5E,SAAgB,cAAc,EAC1B,UAAU,eAAe,OACzB,wBAAwB,OACxB,eAAe,MACf,MACA,SACA,aACA,eACA,WACA,SACA,SACA,GAAG,SACgB;CACnB,MAAM,EAAE,gBAAgB,mBACpB,gBACA,gBACJ;CACA,MAAM,OAAO,eACR,kBACG,EAAE,gBAAgB,kBAAkB,qBAC5C;CACA,MAAM,WAAW,iBAAiB,KAAK,OAAO,YAAY;CAE1D,OAAO,cACH,UACA,OACA;EAJY;EAAa;CAIrB,GACJ;EACI,GAAG,YAAY;GACX;GACA;GACA;GACA;GACA,UAAU,KAAK;GACf,WAAW;GACX;GACA;GACA;GACA;GACA;EACJ,CAAC;EACD,wBAAwB;EACxB,GAAG,gBAAgB;GAAE;GAAa;EAAS,CAAC;EAC5C,UAAU,UAAmC;GACzC,KAAK,QAAQ;GACb,UAAU,KAAK;EACnB;CACJ,GACA,KAAK,GACT;AACJ;;;;;;AClEA,SAAgB,aAAa,EACzB,UAAU,eAAe,OACzB,UACA,GAAG,SACe;CAClB,MAAM,EAAE,gBAAgB,mBAAmB,gBAAgB,eAAe;CAC1E,MAAM,QAAQ,WAAW,aAAa;CACtC,MAAM,WAAW,iBAAiB,OAAO,YAAY;CACrD,MAAM,QAAQ,cACH,UAAU,OAAO,OAAO;EAAE,GAAG;EAAO;CAAS,GACpD,CAAC,OAAO,QAAQ,CACpB;CACA,OAAO,cACH,OACA;EACI,GAAG;EACH,UACI,oBAAC,cAAc,UAAf;GAAwB,OAAO;GAC1B;EACmB,CAAA;CAEhC,GACA;EAAE;EAAa;CAAS,GACxB;EACI,MAAM;EACN,wBAAwB;EACxB,GAAG,gBAAgB;GAAE;GAAa;EAAS,CAAC;CAChD,CACJ;AACJ;;;;;;AC3BA,SAAgB,aAAa,EACzB,UAAU,eAAe,OACzB,wBAAwB,OACxB,GAAG,SACe;CAClB,MAAM,EAAE,gBAAgB,mBAAmB,gBAAgB,eAAe;CAC1E,MAAM,OAAO,eACR,kBACG,EAAE,gBAAgB,kBAAkB,qBAC5C;CACA,MAAM,WAAW,iBAAiB,KAAK,OAAO,YAAY;CAC1D,MAAM,uBACF,UACC;EACD,IAAI,UACA,MAAM,eAAe;CAE7B;CACA,OAAO,cACH,SACA,OACA;EAAE;EAAa;CAAS,GACxB;EACI,UAAU,YAAY,CAAC,wBAAwB,OAAO,KAAA;EACtD,iBACI,YAAY,wBAAwB,SAAS,KAAA;EACjD,UAAU,YAAY,wBAAwB,OAAO,KAAA;EACrD,UAAU,KAAK;EACf,wBAAwB;EACxB,GAAG,gBAAgB;GAAE;GAAa;EAAS,CAAC;EAC5C,SAAS;EACT,eAAe;EACf,SAAS,KAAK;CAClB,GACA,KAAK,GACT;AACJ;;;ACzCA,SAAgB,YAAY,OAAyB;CACjD,MAAM,EAAE,gBAAgB,mBAAmB,gBAAgB,cAAc;CACzE,MAAM,OAAO,oBAAoB,IAAI;CACrC,OAAO,cACH,KACA,OACA,EAAE,YAAY,GACd;EACI,UAAU,KAAK;EACf,wBAAwB;EACxB,GAAG,gBAAgB,EAAE,YAAY,CAAC;EAClC,SAAS,KAAK;CAClB,GACA,KAAK,GACT;AACJ;;;;;;ACDA,SAAgB,YAAY,EACxB,cAAc,cACd,YAAY,MACZ,WAAW,OACX,GAAG,SACc;CACjB,MAAM,CAAC,SAAS,OAAO,WAAwB;CAC/C,MAAM,EAAE,OAAO,cAAc,mBAAmB;EAC5C;EACA;EACA;EACA,MAAM;CACV,CAAC;CACD,MAAM,UAAU,eAAe,EAAE,YAAY,IAAI,CAAC,WAAW,CAAC;CAC9D,MAAM,QAAQ;EAAE;EAAa;CAAS;CACtC,OACI,oBAAC,eAAe,UAAhB;EAAyB,OAAO;EAC5B,UAAA,oBAAC,cAAc,UAAf;GAAwB,OAAO;GAC1B,UAAA,cACG,OACA,OACA,OACA;IACI,MAAM;IACN,oBAAoB;IACpB,wBAAwB;IACxB,GAAG,gBAAgB;KAAE;KAAa;IAAS,CAAC;IAC5C;GACJ,GACA,GACJ;EACoB,CAAA;CACH,CAAA;AAEjC;;;AChDA,SAAgB,iBAAiB,OAA8B;CAE3D,MAAM,cADU,mBAAmB,gBAAgB,mBAEzC,CAAC,CAAC,gBAAgB,eAAe,aAAa;CACxD,OAAO,cACH,OACA,OACA,EAAE,YAAY,GACd;EACI,MAAM;EACN,oBAAoB;EACpB,wBAAwB;EACxB,GAAG,gBAAgB,EAAE,YAAY,CAAC;CACtC,CACJ;AACJ;;;ACpBA,MAAa,UAAU;CACnB,MAAM;CACN,QAAQ;CACR,MAAM;CACN,OAAO;CACP,OAAO;CACP,WAAW;AACf"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { n as RenderProp } from "./render-element-Pwuv2wsL.js";
|
|
2
|
+
import { a as ToolbarRootProps, c as ToolbarLinkState, d as ToolbarButtonProps, f as ToolbarItemState, i as ToolbarSeparatorState, l as ToolbarInputProps, n as Toolbar, o as ToolbarRootState, r as ToolbarSeparatorProps, s as ToolbarLinkProps, t as RovingOrientation, u as ToolbarGroupProps } from "./index-CD6hgnl1.js";
|
|
3
|
+
export { type RenderProp, type RovingOrientation, Toolbar, type ToolbarButtonProps, type ToolbarGroupProps, type ToolbarInputProps, type ToolbarItemState, type ToolbarLinkProps, type ToolbarLinkState, type ToolbarRootProps, type ToolbarRootState, type ToolbarSeparatorProps, type ToolbarSeparatorState };
|
package/dist/toolbar.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Toolbar } from "./toolbar-DfjePeEZ.js";
|
|
@@ -0,0 +1,320 @@
|
|
|
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 OverlayHandleStore } from "./overlay-handle-DOyqO4oY.js";
|
|
5
|
+
import { t as useOverlayPortal } from "./use-overlay-portal-Cfv6qtTO.js";
|
|
6
|
+
import { t as usePositioner } from "./use-positioner-DtJR980s.js";
|
|
7
|
+
import { t as useOverlayRoot } from "./use-overlay-root-eXuUlCpV.js";
|
|
8
|
+
import { n as useOverlayTrigger, t as useAttachHandle } from "./use-overlay-trigger-CxW1Z6Q6.js";
|
|
9
|
+
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
import { interceptEscape } from "@fragiola/primitives/layers";
|
|
12
|
+
import { trackHoverBridge } from "@fragiola/primitives/pointer";
|
|
13
|
+
import { createDelayGroup, createHoverIntent } from "@fragiola/primitives/hover";
|
|
14
|
+
// src/components/tooltip/tooltip-context.ts
|
|
15
|
+
const TooltipProviderContext = createContext(null);
|
|
16
|
+
const TooltipContext = createContext(null);
|
|
17
|
+
// src/components/tooltip/tooltip-arrow.tsx
|
|
18
|
+
/** Points at the anchor; placed along the popup's edge by the positioner. */
|
|
19
|
+
function TooltipArrow(props) {
|
|
20
|
+
const context = useRequiredContext(TooltipContext, "Tooltip.Arrow");
|
|
21
|
+
return renderElement("div", props, context.placed, {
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
"data-primitives-part": "tooltip-arrow",
|
|
24
|
+
...stateAttributes({
|
|
25
|
+
open: context.open,
|
|
26
|
+
closed: !context.open,
|
|
27
|
+
side: context.placed.side,
|
|
28
|
+
align: context.placed.align
|
|
29
|
+
})
|
|
30
|
+
}, context.setArrow);
|
|
31
|
+
}
|
|
32
|
+
// src/components/tooltip/tooltip-handle.ts
|
|
33
|
+
/** Creates a Tooltip handle (`Tooltip.createHandle`), for Triggers outside the Root. */
|
|
34
|
+
function createTooltipHandle() {
|
|
35
|
+
return new OverlayHandleStore("tooltip");
|
|
36
|
+
}
|
|
37
|
+
// src/components/tooltip/tooltip-popup.tsx
|
|
38
|
+
/** The `tooltip`; never takes focus (spec/tooltip.md). */
|
|
39
|
+
function TooltipPopup(props) {
|
|
40
|
+
const context = useRequiredContext(TooltipContext, "Tooltip.Popup");
|
|
41
|
+
const { open, instant, placed } = context;
|
|
42
|
+
const status = context.presence.status;
|
|
43
|
+
return renderElement("div", props, {
|
|
44
|
+
open,
|
|
45
|
+
instant,
|
|
46
|
+
...placed
|
|
47
|
+
}, {
|
|
48
|
+
id: context.popupId,
|
|
49
|
+
role: "tooltip",
|
|
50
|
+
"data-primitives-part": "tooltip-popup",
|
|
51
|
+
...stateAttributes({
|
|
52
|
+
open,
|
|
53
|
+
closed: !open,
|
|
54
|
+
side: placed.side,
|
|
55
|
+
align: placed.align,
|
|
56
|
+
instant,
|
|
57
|
+
"starting-style": status === "starting",
|
|
58
|
+
"ending-style": status === "ending"
|
|
59
|
+
})
|
|
60
|
+
}, context.setPopup);
|
|
61
|
+
}
|
|
62
|
+
// src/components/tooltip/tooltip-portal.tsx
|
|
63
|
+
function TooltipPortal(props) {
|
|
64
|
+
const context = useRequiredContext(TooltipContext, "Tooltip.Portal");
|
|
65
|
+
return useOverlayPortal(context.presence.mounted, props);
|
|
66
|
+
}
|
|
67
|
+
// src/components/tooltip/tooltip-positioner.tsx
|
|
68
|
+
/** Places the popup next to its anchor (spec/tooltip.md, "Positioning"). */
|
|
69
|
+
function TooltipPositioner({ side, align, sideOffset, alignOffset, collisionPadding, anchor, ...props }) {
|
|
70
|
+
const context = useRequiredContext(TooltipContext, "Tooltip.Positioner");
|
|
71
|
+
const placed = usePositioner({
|
|
72
|
+
side,
|
|
73
|
+
align,
|
|
74
|
+
sideOffset,
|
|
75
|
+
alignOffset,
|
|
76
|
+
collisionPadding,
|
|
77
|
+
anchor
|
|
78
|
+
}, {
|
|
79
|
+
side: "top",
|
|
80
|
+
align: "center"
|
|
81
|
+
}, context.trigger, context.positioner, context.arrow, context.presence.mounted);
|
|
82
|
+
const { setPlaced } = context;
|
|
83
|
+
useLayoutEffect(() => setPlaced(placed), [placed, setPlaced]);
|
|
84
|
+
const state = {
|
|
85
|
+
open: context.open,
|
|
86
|
+
...placed
|
|
87
|
+
};
|
|
88
|
+
return renderElement("div", props, state, {
|
|
89
|
+
role: "presentation",
|
|
90
|
+
hidden: context.presence.mounted ? void 0 : true,
|
|
91
|
+
"data-primitives-part": "tooltip-positioner",
|
|
92
|
+
...stateAttributes({
|
|
93
|
+
open: context.open,
|
|
94
|
+
closed: !context.open,
|
|
95
|
+
side: placed.side,
|
|
96
|
+
align: placed.align
|
|
97
|
+
})
|
|
98
|
+
}, context.setPositioner);
|
|
99
|
+
}
|
|
100
|
+
// src/components/tooltip/tooltip-provider.tsx
|
|
101
|
+
/** A delay group: shared delays and the instant hand-off (spec/tooltip.md). */
|
|
102
|
+
function TooltipProvider({ delay = 600, closeDelay = 0, timeout = 400, children }) {
|
|
103
|
+
const timeoutRef = useRef(timeout);
|
|
104
|
+
timeoutRef.current = timeout;
|
|
105
|
+
const [group] = useState(() => createDelayGroup({ timeout: () => timeoutRef.current }));
|
|
106
|
+
const value = useMemo(() => ({
|
|
107
|
+
delay,
|
|
108
|
+
closeDelay,
|
|
109
|
+
group
|
|
110
|
+
}), [
|
|
111
|
+
delay,
|
|
112
|
+
closeDelay,
|
|
113
|
+
group
|
|
114
|
+
]);
|
|
115
|
+
return /* @__PURE__ */ jsx(TooltipProviderContext.Provider, {
|
|
116
|
+
value,
|
|
117
|
+
children
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// src/components/tooltip/tooltip-root.tsx
|
|
121
|
+
/** Holds the tooltip's state and its hover intent; renders no element (spec/tooltip.md). */
|
|
122
|
+
function TooltipRoot({ delay: delayProp, closeDelay: closeDelayProp, disabled = false, handle, children, ...overlayProps }) {
|
|
123
|
+
const root = useOverlayRoot(overlayProps);
|
|
124
|
+
const provider = useContext(TooltipProviderContext);
|
|
125
|
+
const ownGroup = useMemo(() => createDelayGroup({ timeout: 0 }), []);
|
|
126
|
+
const group = provider?.group ?? ownGroup;
|
|
127
|
+
const delay = delayProp ?? provider?.delay ?? 600;
|
|
128
|
+
const closeDelay = closeDelayProp ?? provider?.closeDelay ?? 0;
|
|
129
|
+
const [instant, setInstant] = useState(false);
|
|
130
|
+
const [arrow, setArrow] = useState(null);
|
|
131
|
+
const [placed, setPlaced] = useState({
|
|
132
|
+
side: "top",
|
|
133
|
+
align: "center"
|
|
134
|
+
});
|
|
135
|
+
const { open, setOpen, trigger, popup } = root;
|
|
136
|
+
const blocked = useRef(false);
|
|
137
|
+
const openedByHover = useRef(false);
|
|
138
|
+
const hovered = useRef(null);
|
|
139
|
+
const pendingTrigger = useRef(null);
|
|
140
|
+
const pendingEvent = useRef(void 0);
|
|
141
|
+
const triggers = useRef(root.triggers);
|
|
142
|
+
triggers.current = root.triggers;
|
|
143
|
+
const show = useCallback((reason, isInstant, event, from) => {
|
|
144
|
+
if (setOpen(true, reason, event, from)) {
|
|
145
|
+
openedByHover.current = reason === "trigger-hover";
|
|
146
|
+
setInstant(isInstant);
|
|
147
|
+
}
|
|
148
|
+
}, [setOpen]);
|
|
149
|
+
const hide = useCallback((reason, event) => {
|
|
150
|
+
setOpen(false, reason, event);
|
|
151
|
+
}, [setOpen]);
|
|
152
|
+
const intent = useMemo(() => createHoverIntent({
|
|
153
|
+
open: () => show("trigger-hover", false, pendingEvent.current, pendingTrigger.current),
|
|
154
|
+
close: () => hide("trigger-hover")
|
|
155
|
+
}), [show, hide]);
|
|
156
|
+
useEffect(() => intent.cancel, [intent]);
|
|
157
|
+
const hoverStart = useCallback((from, event) => {
|
|
158
|
+
hovered.current = from;
|
|
159
|
+
if (disabled || blocked.current) return;
|
|
160
|
+
if (open) {
|
|
161
|
+
intent.cancel();
|
|
162
|
+
if (from !== trigger) show("trigger-hover", true, event, from);
|
|
163
|
+
} else if (group.isInstant()) {
|
|
164
|
+
intent.cancel();
|
|
165
|
+
show("trigger-hover", true, event, from);
|
|
166
|
+
} else {
|
|
167
|
+
pendingTrigger.current = from;
|
|
168
|
+
pendingEvent.current = event;
|
|
169
|
+
intent.enter(delay);
|
|
170
|
+
}
|
|
171
|
+
}, [
|
|
172
|
+
disabled,
|
|
173
|
+
open,
|
|
174
|
+
trigger,
|
|
175
|
+
group,
|
|
176
|
+
intent,
|
|
177
|
+
show,
|
|
178
|
+
delay
|
|
179
|
+
]);
|
|
180
|
+
const hoverEnd = useCallback((from) => {
|
|
181
|
+
if (hovered.current === from) hovered.current = null;
|
|
182
|
+
blocked.current = false;
|
|
183
|
+
if (!open) intent.cancel();
|
|
184
|
+
}, [open, intent]);
|
|
185
|
+
const press = useCallback((event) => {
|
|
186
|
+
blocked.current = true;
|
|
187
|
+
intent.cancel();
|
|
188
|
+
if (open) hide("trigger-press", event);
|
|
189
|
+
}, [
|
|
190
|
+
open,
|
|
191
|
+
intent,
|
|
192
|
+
hide
|
|
193
|
+
]);
|
|
194
|
+
const closeForGroup = useRef(() => hide("trigger-hover"));
|
|
195
|
+
closeForGroup.current = () => hide("trigger-hover");
|
|
196
|
+
const groupMember = useRef(() => closeForGroup.current());
|
|
197
|
+
useEffect(() => {
|
|
198
|
+
if (!open) return;
|
|
199
|
+
const member = groupMember.current;
|
|
200
|
+
group.opened(member);
|
|
201
|
+
return () => group.closed(member);
|
|
202
|
+
}, [open, group]);
|
|
203
|
+
useEffect(() => {
|
|
204
|
+
if (!open || !openedByHover.current || trigger === null) return;
|
|
205
|
+
return trackHoverBridge(trigger, popup, {
|
|
206
|
+
inside: () => intent.cancel(),
|
|
207
|
+
outside: () => {
|
|
208
|
+
const other = hovered.current;
|
|
209
|
+
if (other !== null && other !== trigger && other.isConnected && triggers.current.includes(other)) {
|
|
210
|
+
intent.cancel();
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
intent.leave(closeDelay);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}, [
|
|
217
|
+
open,
|
|
218
|
+
trigger,
|
|
219
|
+
popup,
|
|
220
|
+
intent,
|
|
221
|
+
closeDelay
|
|
222
|
+
]);
|
|
223
|
+
useEffect(() => {
|
|
224
|
+
if (!open || trigger === null) return;
|
|
225
|
+
return interceptEscape(trigger.ownerDocument, (event) => {
|
|
226
|
+
intent.cancel();
|
|
227
|
+
hide("escape-key", event);
|
|
228
|
+
});
|
|
229
|
+
}, [
|
|
230
|
+
open,
|
|
231
|
+
trigger,
|
|
232
|
+
intent,
|
|
233
|
+
hide
|
|
234
|
+
]);
|
|
235
|
+
const value = useMemo(() => ({
|
|
236
|
+
...root,
|
|
237
|
+
show,
|
|
238
|
+
hide,
|
|
239
|
+
hoverStart,
|
|
240
|
+
hoverEnd,
|
|
241
|
+
press,
|
|
242
|
+
instant,
|
|
243
|
+
disabled,
|
|
244
|
+
arrow,
|
|
245
|
+
setArrow,
|
|
246
|
+
placed,
|
|
247
|
+
setPlaced
|
|
248
|
+
}), [
|
|
249
|
+
root,
|
|
250
|
+
show,
|
|
251
|
+
hide,
|
|
252
|
+
hoverStart,
|
|
253
|
+
hoverEnd,
|
|
254
|
+
press,
|
|
255
|
+
instant,
|
|
256
|
+
disabled,
|
|
257
|
+
arrow,
|
|
258
|
+
placed
|
|
259
|
+
]);
|
|
260
|
+
useAttachHandle(handle, value);
|
|
261
|
+
return /* @__PURE__ */ jsx(TooltipContext.Provider, {
|
|
262
|
+
value,
|
|
263
|
+
children: typeof children === "function" ? children({ payload: root.payload }) : children
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
// src/components/tooltip/tooltip-trigger.tsx
|
|
267
|
+
function isFocusVisible(element) {
|
|
268
|
+
try {
|
|
269
|
+
return element.matches(":focus-visible");
|
|
270
|
+
} catch {
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/** A described control and the anchor; with a `handle`, anywhere in the page (spec/tooltip.md). */
|
|
275
|
+
function TooltipTrigger({ handle, payload, id: idProp, ...props }) {
|
|
276
|
+
const { root, id, ref, active } = useOverlayTrigger(TooltipContext, "Tooltip.Trigger", {
|
|
277
|
+
handle,
|
|
278
|
+
payload,
|
|
279
|
+
id: idProp
|
|
280
|
+
});
|
|
281
|
+
const { "aria-describedby": describedBy, ...rest } = props;
|
|
282
|
+
const description = [describedBy, active ? root?.popupId : void 0].filter(Boolean).join(" ") || void 0;
|
|
283
|
+
return renderElement("button", rest, { open: active }, {
|
|
284
|
+
type: "button",
|
|
285
|
+
id,
|
|
286
|
+
"aria-describedby": description,
|
|
287
|
+
"data-primitives-part": "tooltip-trigger",
|
|
288
|
+
...stateAttributes({ "popup-open": active }),
|
|
289
|
+
onPointerEnter: (event) => {
|
|
290
|
+
if (event.pointerType !== "touch") root?.hoverStart(event.currentTarget, event.nativeEvent);
|
|
291
|
+
},
|
|
292
|
+
onPointerLeave: (event) => {
|
|
293
|
+
if (event.pointerType !== "touch") root?.hoverEnd(event.currentTarget);
|
|
294
|
+
},
|
|
295
|
+
onPointerDown: (event) => {
|
|
296
|
+
if (event.pointerType !== "touch") root?.press(event.nativeEvent);
|
|
297
|
+
},
|
|
298
|
+
onFocus: (event) => {
|
|
299
|
+
if (root !== null && !root.disabled && isFocusVisible(event.currentTarget)) root.show("trigger-focus", true, event.nativeEvent, event.currentTarget);
|
|
300
|
+
},
|
|
301
|
+
onBlur: (event) => {
|
|
302
|
+
if (active) root?.hide("trigger-focus", event.nativeEvent);
|
|
303
|
+
}
|
|
304
|
+
}, ref);
|
|
305
|
+
}
|
|
306
|
+
// src/components/tooltip/parts.ts
|
|
307
|
+
/** spec/tooltip.md */
|
|
308
|
+
const Tooltip = {
|
|
309
|
+
Provider: TooltipProvider,
|
|
310
|
+
Root: TooltipRoot,
|
|
311
|
+
Trigger: TooltipTrigger,
|
|
312
|
+
Portal: TooltipPortal,
|
|
313
|
+
Positioner: TooltipPositioner,
|
|
314
|
+
Popup: TooltipPopup,
|
|
315
|
+
Arrow: TooltipArrow,
|
|
316
|
+
createHandle: createTooltipHandle
|
|
317
|
+
};
|
|
318
|
+
export { createTooltipHandle as n, Tooltip as t };
|
|
319
|
+
|
|
320
|
+
//# sourceMappingURL=tooltip-CqZtSspz.js.map
|