@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
|
@@ -0,0 +1,251 @@
|
|
|
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 useControllableState } from "./use-controllable-state-Dm8eNkgP.js";
|
|
5
|
+
import { createContext, useId, useMemo } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
// src/components/steps/steps-context.ts
|
|
8
|
+
const StepsContext = createContext(null);
|
|
9
|
+
/** The Item a Trigger, an Indicator or a Separator sits in. */
|
|
10
|
+
const StepsItemContext = createContext(null);
|
|
11
|
+
/** Whether a step can be reached from the current one (spec/steps.md). */
|
|
12
|
+
function stepReachable(context, index) {
|
|
13
|
+
if (index <= context.step || !context.linear) return true;
|
|
14
|
+
for (let before = 0; before < index; before++) if (!context.isStepValid(before)) return false;
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
function stepsItemState(context, index) {
|
|
18
|
+
return {
|
|
19
|
+
index,
|
|
20
|
+
current: index === context.step,
|
|
21
|
+
completed: index < context.step,
|
|
22
|
+
incomplete: index > context.step,
|
|
23
|
+
disabled: !stepReachable(context, index),
|
|
24
|
+
orientation: context.orientation
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const stepsContentId = (baseId, index) => `${baseId}-content-${index}`;
|
|
28
|
+
// src/components/steps/steps-completed-content.tsx
|
|
29
|
+
/** What shows once every step is done (spec/steps.md): `hidden` until then. */
|
|
30
|
+
function StepsCompletedContent(props) {
|
|
31
|
+
const { step, count, completed, orientation } = useRequiredContext(StepsContext, "Steps.CompletedContent");
|
|
32
|
+
return renderElement("div", props, {
|
|
33
|
+
step,
|
|
34
|
+
count,
|
|
35
|
+
completed,
|
|
36
|
+
orientation
|
|
37
|
+
}, {
|
|
38
|
+
hidden: !completed,
|
|
39
|
+
"data-primitives-part": "steps-completed-content"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
// src/components/steps/steps-content.tsx
|
|
43
|
+
/** The content of one step (spec/steps.md): `hidden` unless it is the current one. */
|
|
44
|
+
function StepsContent({ index, ...props }) {
|
|
45
|
+
const context = useRequiredContext(StepsContext, "Steps.Content");
|
|
46
|
+
const state = stepsItemState(context, index);
|
|
47
|
+
return renderElement("div", props, state, {
|
|
48
|
+
id: stepsContentId(context.baseId, index),
|
|
49
|
+
hidden: !state.current,
|
|
50
|
+
"data-primitives-part": "steps-content",
|
|
51
|
+
...stateAttributes({ current: state.current })
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
// src/components/steps/use-steps-item.ts
|
|
55
|
+
/** The Root's context and the enclosing Item's state, for a part inside an Item. */
|
|
56
|
+
function useStepsItem(part) {
|
|
57
|
+
const context = useRequiredContext(StepsContext, part);
|
|
58
|
+
return {
|
|
59
|
+
context,
|
|
60
|
+
state: stepsItemState(context, useRequiredContext(StepsItemContext, part))
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// src/components/steps/steps-indicator.tsx
|
|
64
|
+
/** Its step's number or check mark (spec/steps.md), hidden from assistive technology. */
|
|
65
|
+
function StepsIndicator(props) {
|
|
66
|
+
const { state } = useStepsItem("Steps.Indicator");
|
|
67
|
+
return renderElement("span", props, state, {
|
|
68
|
+
"aria-hidden": "true",
|
|
69
|
+
"data-primitives-part": "steps-indicator",
|
|
70
|
+
...stateAttributes({
|
|
71
|
+
current: state.current,
|
|
72
|
+
completed: state.completed,
|
|
73
|
+
incomplete: state.incomplete
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// src/components/steps/steps-item.tsx
|
|
78
|
+
/** One step (spec/steps.md): `aria-current="step"` while it is the current one. */
|
|
79
|
+
function StepsItem({ index, ...props }) {
|
|
80
|
+
const state = stepsItemState(useRequiredContext(StepsContext, "Steps.Item"), index);
|
|
81
|
+
return /* @__PURE__ */ jsx(StepsItemContext.Provider, {
|
|
82
|
+
value: index,
|
|
83
|
+
children: renderElement("li", props, state, {
|
|
84
|
+
"aria-current": state.current ? "step" : void 0,
|
|
85
|
+
"data-primitives-part": "steps-item",
|
|
86
|
+
...itemAttributes(state)
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** A step's `data-*` attributes (spec/steps.md, "State attributes and ARIA"). */
|
|
91
|
+
function itemAttributes(state) {
|
|
92
|
+
return stateAttributes({
|
|
93
|
+
current: state.current,
|
|
94
|
+
completed: state.completed,
|
|
95
|
+
incomplete: state.incomplete,
|
|
96
|
+
disabled: state.disabled,
|
|
97
|
+
orientation: state.orientation
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
// src/components/steps/steps-list.tsx
|
|
101
|
+
/** The steps, an ordered list (spec/steps.md); the app names it. */
|
|
102
|
+
function StepsList(props) {
|
|
103
|
+
const { step, count, completed, orientation } = useRequiredContext(StepsContext, "Steps.List");
|
|
104
|
+
return renderElement("ol", props, {
|
|
105
|
+
step,
|
|
106
|
+
count,
|
|
107
|
+
completed,
|
|
108
|
+
orientation
|
|
109
|
+
}, {
|
|
110
|
+
"data-primitives-part": "steps-list",
|
|
111
|
+
...stateAttributes({ orientation })
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// src/components/steps/steps-step-trigger.tsx
|
|
115
|
+
/** A PrevTrigger or a NextTrigger (spec/steps.md): disabled where it cannot move. */
|
|
116
|
+
function useStepsStepTrigger(kind, name, { onClick, ...props }) {
|
|
117
|
+
const context = useRequiredContext(StepsContext, name);
|
|
118
|
+
const target = kind === "prev" ? context.step - 1 : context.step + 1;
|
|
119
|
+
const disabled = kind === "prev" ? context.step <= 0 : context.step >= context.count || context.linear && !context.isStepValid(context.step);
|
|
120
|
+
return renderElement("button", props, {
|
|
121
|
+
step: Math.min(context.count, Math.max(0, target)),
|
|
122
|
+
disabled
|
|
123
|
+
}, {
|
|
124
|
+
type: "button",
|
|
125
|
+
disabled: disabled || void 0,
|
|
126
|
+
onClick: (event) => {
|
|
127
|
+
if (disabled) return;
|
|
128
|
+
context.setStep(target, {
|
|
129
|
+
reason: kind === "prev" ? "previous-press" : "next-press",
|
|
130
|
+
event: event.nativeEvent
|
|
131
|
+
});
|
|
132
|
+
onClick?.(event);
|
|
133
|
+
},
|
|
134
|
+
"data-primitives-part": `steps-${kind}-trigger`,
|
|
135
|
+
...stateAttributes({ disabled })
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// src/components/steps/steps-next-trigger.tsx
|
|
139
|
+
/**
|
|
140
|
+
* The step after, past the last the completed state (spec/steps.md): disabled once completed, and
|
|
141
|
+
* in a linear process while the current step is not valid.
|
|
142
|
+
*/
|
|
143
|
+
function StepsNextTrigger(props) {
|
|
144
|
+
return useStepsStepTrigger("next", "Steps.NextTrigger", props);
|
|
145
|
+
}
|
|
146
|
+
// src/components/steps/steps-prev-trigger.tsx
|
|
147
|
+
/** The step before (spec/steps.md): disabled on the first step. */
|
|
148
|
+
function StepsPrevTrigger(props) {
|
|
149
|
+
return useStepsStepTrigger("prev", "Steps.PrevTrigger", props);
|
|
150
|
+
}
|
|
151
|
+
// src/components/steps/steps-root.tsx
|
|
152
|
+
const ALWAYS_VALID = () => true;
|
|
153
|
+
/** A process in a fixed number of steps (spec/steps.md): it holds the step and the validation. */
|
|
154
|
+
function StepsRoot({ step: stepProp, defaultStep = 0, onStepChange, count: countProp, linear = false, isStepValid = ALWAYS_VALID, orientation = "horizontal", ...props }) {
|
|
155
|
+
const count = Math.max(0, Math.floor(countProp));
|
|
156
|
+
const [own, setOwn] = useControllableState(stepProp, defaultStep, onStepChange);
|
|
157
|
+
const step = Math.min(count, Math.max(0, Math.floor(own)));
|
|
158
|
+
const completed = step === count;
|
|
159
|
+
const baseId = useId();
|
|
160
|
+
const context = useMemo(() => ({
|
|
161
|
+
step,
|
|
162
|
+
count,
|
|
163
|
+
completed,
|
|
164
|
+
orientation,
|
|
165
|
+
linear,
|
|
166
|
+
isStepValid,
|
|
167
|
+
baseId,
|
|
168
|
+
setStep: (next, details) => {
|
|
169
|
+
const target = Math.min(count, Math.max(0, next));
|
|
170
|
+
if (target !== step) setOwn(target, details);
|
|
171
|
+
}
|
|
172
|
+
}), [
|
|
173
|
+
step,
|
|
174
|
+
count,
|
|
175
|
+
completed,
|
|
176
|
+
orientation,
|
|
177
|
+
linear,
|
|
178
|
+
isStepValid,
|
|
179
|
+
baseId,
|
|
180
|
+
setOwn
|
|
181
|
+
]);
|
|
182
|
+
const state = {
|
|
183
|
+
step,
|
|
184
|
+
count,
|
|
185
|
+
completed,
|
|
186
|
+
orientation
|
|
187
|
+
};
|
|
188
|
+
return /* @__PURE__ */ jsx(StepsContext.Provider, {
|
|
189
|
+
value: context,
|
|
190
|
+
children: renderElement("div", props, state, {
|
|
191
|
+
"data-primitives-part": "steps-root",
|
|
192
|
+
...stateAttributes({
|
|
193
|
+
orientation,
|
|
194
|
+
completed
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
// src/components/steps/steps-separator.tsx
|
|
200
|
+
/** The line from its step to the next (spec/steps.md), hidden from assistive technology. */
|
|
201
|
+
function StepsSeparator(props) {
|
|
202
|
+
const { state } = useStepsItem("Steps.Separator");
|
|
203
|
+
return renderElement("div", props, state, {
|
|
204
|
+
"aria-hidden": "true",
|
|
205
|
+
"data-primitives-part": "steps-separator",
|
|
206
|
+
...stateAttributes({
|
|
207
|
+
current: state.current,
|
|
208
|
+
completed: state.completed,
|
|
209
|
+
incomplete: state.incomplete,
|
|
210
|
+
orientation: state.orientation
|
|
211
|
+
})
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
// src/components/steps/steps-trigger.tsx
|
|
215
|
+
/** Moves to its Item's step (spec/steps.md): disabled while that step cannot be reached. */
|
|
216
|
+
function StepsTrigger({ onClick, ...props }) {
|
|
217
|
+
const { context, state } = useStepsItem("Steps.Trigger");
|
|
218
|
+
return renderElement("button", props, state, {
|
|
219
|
+
type: "button",
|
|
220
|
+
disabled: state.disabled || void 0,
|
|
221
|
+
"aria-current": state.current ? "step" : void 0,
|
|
222
|
+
"aria-controls": stepsContentId(context.baseId, state.index),
|
|
223
|
+
onClick: (event) => {
|
|
224
|
+
if (state.disabled) return;
|
|
225
|
+
context.setStep(state.index, {
|
|
226
|
+
reason: "trigger-press",
|
|
227
|
+
event: event.nativeEvent
|
|
228
|
+
});
|
|
229
|
+
onClick?.(event);
|
|
230
|
+
},
|
|
231
|
+
"data-primitives-part": "steps-trigger",
|
|
232
|
+
...itemAttributes(state)
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
// src/components/steps/parts.ts
|
|
236
|
+
/** spec/steps.md */
|
|
237
|
+
const Steps = {
|
|
238
|
+
Root: StepsRoot,
|
|
239
|
+
List: StepsList,
|
|
240
|
+
Item: StepsItem,
|
|
241
|
+
Trigger: StepsTrigger,
|
|
242
|
+
Indicator: StepsIndicator,
|
|
243
|
+
Separator: StepsSeparator,
|
|
244
|
+
Content: StepsContent,
|
|
245
|
+
PrevTrigger: StepsPrevTrigger,
|
|
246
|
+
NextTrigger: StepsNextTrigger,
|
|
247
|
+
CompletedContent: StepsCompletedContent
|
|
248
|
+
};
|
|
249
|
+
export { Steps as t };
|
|
250
|
+
|
|
251
|
+
//# sourceMappingURL=steps-t_FxFH9P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps-t_FxFH9P.js","names":[],"sources":["../src/components/steps/steps-context.ts","../src/components/steps/steps-completed-content.tsx","../src/components/steps/steps-content.tsx","../src/components/steps/use-steps-item.ts","../src/components/steps/steps-indicator.tsx","../src/components/steps/steps-item.tsx","../src/components/steps/steps-list.tsx","../src/components/steps/steps-step-trigger.tsx","../src/components/steps/steps-next-trigger.tsx","../src/components/steps/steps-prev-trigger.tsx","../src/components/steps/steps-root.tsx","../src/components/steps/steps-separator.tsx","../src/components/steps/steps-trigger.tsx","../src/components/steps/parts.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\n\n/** What the Root renders with (spec/steps.md). */\nexport interface StepsState {\n /** The current step, from 0; `count` once completed. */\n step: number;\n count: number;\n /** Every step is done. */\n completed: boolean;\n orientation: \"horizontal\" | \"vertical\";\n}\n\nexport interface StepsContextValue extends StepsState {\n linear: boolean;\n isStepValid: (index: number) => boolean;\n baseId: string;\n setStep: (step: number, details: ChangeDetails) => void;\n}\n\nexport const StepsContext = createContext<StepsContextValue | null>(null);\n\n/** The Item a Trigger, an Indicator or a Separator sits in. */\nexport const StepsItemContext = createContext<number | null>(null);\n\n/** What a step's parts render with: its index and where it is from the current step. */\nexport interface StepsItemState {\n index: number;\n current: boolean;\n completed: boolean;\n incomplete: boolean;\n /** The step cannot be reached (spec/steps.md, \"Which steps can be reached\"). */\n disabled: boolean;\n orientation: \"horizontal\" | \"vertical\";\n}\n\n/** Whether a step can be reached from the current one (spec/steps.md). */\nexport function stepReachable(\n context: Pick<StepsContextValue, \"step\" | \"linear\" | \"isStepValid\">,\n index: number,\n): boolean {\n if (index <= context.step || !context.linear) {\n return true;\n }\n for (let before = 0; before < index; before++) {\n if (!context.isStepValid(before)) {\n return false;\n }\n }\n return true;\n}\n\nexport function stepsItemState(\n context: StepsContextValue,\n index: number,\n): StepsItemState {\n return {\n index,\n current: index === context.step,\n completed: index < context.step,\n incomplete: index > context.step,\n disabled: !stepReachable(context, index),\n orientation: context.orientation,\n };\n}\n\nexport const stepsContentId = (baseId: string, index: number) =>\n `${baseId}-content-${index}`;\n","import { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { StepsContext, type StepsState } from \"./steps-context.ts\";\n\nexport type StepsCompletedContentProps = PartProps<StepsState>;\n\n/** What shows once every step is done (spec/steps.md): `hidden` until then. */\nexport function StepsCompletedContent(props: StepsCompletedContentProps) {\n const context = useRequiredContext(StepsContext, \"Steps.CompletedContent\");\n const { step, count, completed, orientation } = context;\n return renderElement(\n \"div\",\n props,\n { step, count, completed, orientation },\n {\n hidden: !completed,\n \"data-primitives-part\": \"steps-completed-content\",\n },\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 StepsContext,\n type StepsItemState,\n stepsContentId,\n stepsItemState,\n} from \"./steps-context.ts\";\n\nexport interface StepsContentProps extends PartProps<StepsItemState> {\n /** Its step, from 0. */\n index: number;\n}\n\n/** The content of one step (spec/steps.md): `hidden` unless it is the current one. */\nexport function StepsContent({ index, ...props }: StepsContentProps) {\n const context = useRequiredContext(StepsContext, \"Steps.Content\");\n const state = stepsItemState(context, index);\n return renderElement(\"div\", props, state, {\n id: stepsContentId(context.baseId, index),\n hidden: !state.current,\n \"data-primitives-part\": \"steps-content\",\n ...stateAttributes({ current: state.current }),\n });\n}\n","import { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport {\n StepsContext,\n type StepsContextValue,\n StepsItemContext,\n type StepsItemState,\n stepsItemState,\n} from \"./steps-context.ts\";\n\n/** The Root's context and the enclosing Item's state, for a part inside an Item. */\nexport function useStepsItem(part: string): {\n context: StepsContextValue;\n state: StepsItemState;\n} {\n const context = useRequiredContext(StepsContext, part);\n const index = useRequiredContext(StepsItemContext, part);\n return { context, state: stepsItemState(context, index) };\n}\n","import { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport type { StepsItemState } from \"./steps-context.ts\";\nimport { useStepsItem } from \"./use-steps-item.ts\";\n\nexport type StepsIndicatorProps = PartProps<StepsItemState>;\n\n/** Its step's number or check mark (spec/steps.md), hidden from assistive technology. */\nexport function StepsIndicator(props: StepsIndicatorProps) {\n const { state } = useStepsItem(\"Steps.Indicator\");\n return renderElement(\"span\", props, state, {\n \"aria-hidden\": \"true\",\n \"data-primitives-part\": \"steps-indicator\",\n ...stateAttributes({\n current: state.current,\n completed: state.completed,\n incomplete: state.incomplete,\n }),\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 StepsContext,\n StepsItemContext,\n type StepsItemState,\n stepsItemState,\n} from \"./steps-context.ts\";\n\nexport interface StepsItemProps extends PartProps<StepsItemState> {\n /** Its step, from 0. */\n index: number;\n}\n\n/** One step (spec/steps.md): `aria-current=\"step\"` while it is the current one. */\nexport function StepsItem({ index, ...props }: StepsItemProps) {\n const context = useRequiredContext(StepsContext, \"Steps.Item\");\n const state = stepsItemState(context, index);\n return (\n <StepsItemContext.Provider value={index}>\n {renderElement(\"li\", props, state, {\n \"aria-current\": state.current ? \"step\" : undefined,\n \"data-primitives-part\": \"steps-item\",\n ...itemAttributes(state),\n })}\n </StepsItemContext.Provider>\n );\n}\n\n/** A step's `data-*` attributes (spec/steps.md, \"State attributes and ARIA\"). */\nexport function itemAttributes(\n state: StepsItemState,\n): Record<`data-${string}`, string> {\n return stateAttributes({\n current: state.current,\n completed: state.completed,\n incomplete: state.incomplete,\n disabled: state.disabled,\n orientation: state.orientation,\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 { StepsContext, type StepsState } from \"./steps-context.ts\";\n\nexport type StepsListProps = PartProps<StepsState>;\n\n/** The steps, an ordered list (spec/steps.md); the app names it. */\nexport function StepsList(props: StepsListProps) {\n const context = useRequiredContext(StepsContext, \"Steps.List\");\n const { step, count, completed, orientation } = context;\n return renderElement(\n \"ol\",\n props,\n { step, count, completed, orientation },\n {\n \"data-primitives-part\": \"steps-list\",\n ...stateAttributes({ orientation }),\n },\n );\n}\n","import type { MouseEvent, MouseEventHandler, ReactNode } from \"react\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { StepsContext } from \"./steps-context.ts\";\n\n/** What a PrevTrigger or a NextTrigger renders with. */\nexport interface StepsStepTriggerState {\n /** The step it moves to. */\n step: number;\n disabled: boolean;\n}\n\nexport interface StepsStepTriggerProps\n extends PartProps<StepsStepTriggerState> {\n onClick?: MouseEventHandler<HTMLElement>;\n}\n\n/** A PrevTrigger or a NextTrigger (spec/steps.md): disabled where it cannot move. */\nexport function useStepsStepTrigger(\n kind: \"prev\" | \"next\",\n name: string,\n { onClick, ...props }: StepsStepTriggerProps,\n): ReactNode {\n const context = useRequiredContext(StepsContext, name);\n const target = kind === \"prev\" ? context.step - 1 : context.step + 1;\n const disabled =\n kind === \"prev\"\n ? context.step <= 0\n : context.step >= context.count ||\n (context.linear && !context.isStepValid(context.step));\n return renderElement(\n \"button\",\n props,\n { step: Math.min(context.count, Math.max(0, target)), disabled },\n {\n type: \"button\",\n disabled: disabled || undefined,\n onClick: (event: MouseEvent<HTMLElement>) => {\n if (disabled) {\n return;\n }\n context.setStep(target, {\n reason: kind === \"prev\" ? \"previous-press\" : \"next-press\",\n event: event.nativeEvent,\n });\n onClick?.(event);\n },\n \"data-primitives-part\": `steps-${kind}-trigger`,\n ...stateAttributes({ disabled }),\n },\n );\n}\n","import {\n type StepsStepTriggerProps,\n useStepsStepTrigger,\n} from \"./steps-step-trigger.tsx\";\n\nexport type StepsNextTriggerProps = StepsStepTriggerProps;\n\n/**\n * The step after, past the last the completed state (spec/steps.md): disabled once completed, and\n * in a linear process while the current step is not valid.\n */\nexport function StepsNextTrigger(props: StepsNextTriggerProps) {\n return useStepsStepTrigger(\"next\", \"Steps.NextTrigger\", props);\n}\n","import {\n type StepsStepTriggerProps,\n useStepsStepTrigger,\n} from \"./steps-step-trigger.tsx\";\n\nexport type StepsPrevTriggerProps = StepsStepTriggerProps;\n\n/** The step before (spec/steps.md): disabled on the first step. */\nexport function StepsPrevTrigger(props: StepsPrevTriggerProps) {\n return useStepsStepTrigger(\"prev\", \"Steps.PrevTrigger\", props);\n}\n","import { useId, useMemo } from \"react\";\nimport { useControllableState } from \"../../hooks/use-controllable-state.ts\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { StepsContext, type StepsState } from \"./steps-context.ts\";\n\nexport interface StepsRootProps extends PartProps<StepsState> {\n /** The current step, from 0; `count` is the completed state (controlled). */\n step?: number;\n /** The step at first (default `0`). */\n defaultStep?: number;\n /** Every step change, with its reason. */\n onStepChange?: (step: number, details: ChangeDetails) => void;\n /** The number of steps. */\n count: number;\n /** A step can only be reached once every step before it is valid. */\n linear?: boolean;\n /** Whether a step is valid (default: every step), read at each render. */\n isStepValid?: (index: number) => boolean;\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nconst ALWAYS_VALID = () => true;\n\n/** A process in a fixed number of steps (spec/steps.md): it holds the step and the validation. */\nexport function StepsRoot({\n step: stepProp,\n defaultStep = 0,\n onStepChange,\n count: countProp,\n linear = false,\n isStepValid = ALWAYS_VALID,\n orientation = \"horizontal\",\n ...props\n}: StepsRootProps) {\n const count = Math.max(0, Math.floor(countProp));\n const [own, setOwn] = useControllableState(\n stepProp,\n defaultStep,\n onStepChange,\n );\n const step = Math.min(count, Math.max(0, Math.floor(own)));\n const completed = step === count;\n const baseId = useId();\n const context = useMemo(\n () => ({\n step,\n count,\n completed,\n orientation,\n linear,\n isStepValid,\n baseId,\n setStep: (next: number, details: ChangeDetails) => {\n const target = Math.min(count, Math.max(0, next));\n if (target !== step) {\n setOwn(target, details);\n }\n },\n }),\n [\n step,\n count,\n completed,\n orientation,\n linear,\n isStepValid,\n baseId,\n setOwn,\n ],\n );\n const state: StepsState = { step, count, completed, orientation };\n return (\n <StepsContext.Provider value={context}>\n {renderElement(\"div\", props, state, {\n \"data-primitives-part\": \"steps-root\",\n ...stateAttributes({ orientation, completed }),\n })}\n </StepsContext.Provider>\n );\n}\n","import { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport type { StepsItemState } from \"./steps-context.ts\";\nimport { useStepsItem } from \"./use-steps-item.ts\";\n\nexport type StepsSeparatorProps = PartProps<StepsItemState>;\n\n/** The line from its step to the next (spec/steps.md), hidden from assistive technology. */\nexport function StepsSeparator(props: StepsSeparatorProps) {\n const { state } = useStepsItem(\"Steps.Separator\");\n return renderElement(\"div\", props, state, {\n \"aria-hidden\": \"true\",\n \"data-primitives-part\": \"steps-separator\",\n ...stateAttributes({\n current: state.current,\n completed: state.completed,\n incomplete: state.incomplete,\n orientation: state.orientation,\n }),\n });\n}\n","import type { MouseEvent, MouseEventHandler } from \"react\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { type StepsItemState, stepsContentId } from \"./steps-context.ts\";\nimport { itemAttributes } from \"./steps-item.tsx\";\nimport { useStepsItem } from \"./use-steps-item.ts\";\n\nexport interface StepsTriggerProps extends PartProps<StepsItemState> {\n onClick?: MouseEventHandler<HTMLElement>;\n}\n\n/** Moves to its Item's step (spec/steps.md): disabled while that step cannot be reached. */\nexport function StepsTrigger({ onClick, ...props }: StepsTriggerProps) {\n const { context, state } = useStepsItem(\"Steps.Trigger\");\n return renderElement(\"button\", props, state, {\n type: \"button\",\n disabled: state.disabled || undefined,\n \"aria-current\": state.current ? \"step\" : undefined,\n \"aria-controls\": stepsContentId(context.baseId, state.index),\n onClick: (event: MouseEvent<HTMLElement>) => {\n if (state.disabled) {\n return;\n }\n context.setStep(state.index, {\n reason: \"trigger-press\",\n event: event.nativeEvent,\n });\n onClick?.(event);\n },\n \"data-primitives-part\": \"steps-trigger\",\n ...itemAttributes(state),\n });\n}\n","import { StepsCompletedContent } from \"./steps-completed-content.tsx\";\nimport { StepsContent } from \"./steps-content.tsx\";\nimport { StepsIndicator } from \"./steps-indicator.tsx\";\nimport { StepsItem } from \"./steps-item.tsx\";\nimport { StepsList } from \"./steps-list.tsx\";\nimport { StepsNextTrigger } from \"./steps-next-trigger.tsx\";\nimport { StepsPrevTrigger } from \"./steps-prev-trigger.tsx\";\nimport { StepsRoot } from \"./steps-root.tsx\";\nimport { StepsSeparator } from \"./steps-separator.tsx\";\nimport { StepsTrigger } from \"./steps-trigger.tsx\";\n\n/** spec/steps.md */\nexport const Steps = {\n Root: StepsRoot,\n List: StepsList,\n Item: StepsItem,\n Trigger: StepsTrigger,\n Indicator: StepsIndicator,\n Separator: StepsSeparator,\n Content: StepsContent,\n PrevTrigger: StepsPrevTrigger,\n NextTrigger: StepsNextTrigger,\n CompletedContent: StepsCompletedContent,\n};\n"],"mappings":";;;;;;;AAoBA,MAAa,eAAe,cAAwC,IAAI;;AAGxE,MAAa,mBAAmB,cAA6B,IAAI;;AAcjE,SAAgB,cACZ,SACA,OACO;CACP,IAAI,SAAS,QAAQ,QAAQ,CAAC,QAAQ,QAClC,OAAO;CAEX,KAAK,IAAI,SAAS,GAAG,SAAS,OAAO,UACjC,IAAI,CAAC,QAAQ,YAAY,MAAM,GAC3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,WAAW,MAAM;GACjB,YAAY,MAAM;GAClB,aAAa,MAAM;EACvB,CAAC;CACL,CAAC;AACL;;;ACTA,SAAgB,aAAa,EAAE,SAAS,GAAG,SAA4B;CACnE,MAAM,EAAE,SAAS,UAAU,aAAa,eAAe;CACvD,OAAO,cAAc,UAAU,OAAO,OAAO;EACzC,MAAM;EACN,UAAU,MAAM,YAAY,KAAA;EAC5B,gBAAgB,MAAM,UAAU,SAAS,KAAA;EACzC,iBAAiB,eAAe,QAAQ,QAAQ,MAAM,KAAK;EAC3D,UAAU,UAAmC;GACzC,IAAI,MAAM,UACN;GAEJ,QAAQ,QAAQ,MAAM,OAAO;IACzB,QAAQ;IACR,OAAO,MAAM;GACjB,CAAC;GACD,UAAU,KAAK;EACnB;EACA,wBAAwB;EACxB,GAAG,eAAe,KAAK;CAC3B,CAAC;AACL;;;ACnBA,MAAa,QAAQ;CACjB,MAAM;CACN,MAAM;CACN,MAAM;CACN,SAAS;CACT,WAAW;CACX,WAAW;CACX,SAAS;CACT,aAAa;CACb,aAAa;CACb,kBAAkB;AACtB"}
|
package/dist/steps.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 { a as StepsPrevTriggerProps, c as StepsStepTriggerState, d as StepsIndicatorProps, f as StepsContentProps, h as StepsState, i as StepsRootProps, l as StepsListProps, m as StepsItemState, n as StepsTriggerProps, o as StepsNextTriggerProps, p as StepsCompletedContentProps, r as StepsSeparatorProps, s as StepsStepTriggerProps, t as Steps, u as StepsItemProps } from "./index-B57uQVXT.js";
|
|
4
|
+
export { type ChangeDetails, type ChangeReason, type RenderProp, Steps, type StepsCompletedContentProps, type StepsContentProps, type StepsIndicatorProps, type StepsItemProps, type StepsItemState, type StepsListProps, type StepsNextTriggerProps, type StepsPrevTriggerProps, type StepsRootProps, type StepsSeparatorProps, type StepsState, type StepsStepTriggerProps, type StepsStepTriggerState, type StepsTriggerProps };
|
package/dist/steps.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Steps } from "./steps-t_FxFH9P.js";
|
|
@@ -0,0 +1,137 @@
|
|
|
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 useFieldControl } from "./use-field-control-CL_nOU7T.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 useRequiredContext } from "./use-required-context-Cjd_CYnv.js";
|
|
7
|
+
import { createContext, useEffect, useId, useRef } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { VISUALLY_HIDDEN_INPUT_STYLE, bridgeForm } from "@fragiola/primitives/form";
|
|
10
|
+
// src/components/switch/switch-context.ts
|
|
11
|
+
const SwitchContext = createContext(null);
|
|
12
|
+
/** `data-checked` / `data-unchecked` (exactly one), and the switch's flags (spec/switch.md). */
|
|
13
|
+
function switchAttributes(state) {
|
|
14
|
+
return {
|
|
15
|
+
checked: state.checked,
|
|
16
|
+
unchecked: !state.checked,
|
|
17
|
+
disabled: state.disabled,
|
|
18
|
+
readonly: state.readOnly,
|
|
19
|
+
required: state.required
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// src/components/switch/switch-root.tsx
|
|
23
|
+
const NOOP = () => {};
|
|
24
|
+
/** A `switch` with its hidden form inputs (spec/switch.md, the APG switch). */
|
|
25
|
+
function SwitchRoot({ checked: checkedProp, defaultChecked = false, onCheckedChange, disabled: disabledProp = false, required = false, readOnly = false, name, value = "on", uncheckedValue, id: idProp, children, ...props }) {
|
|
26
|
+
const generatedId = useId();
|
|
27
|
+
const id = idProp ?? generatedId;
|
|
28
|
+
const [checked, setChecked] = useControllableState(checkedProp, defaultChecked, onCheckedChange);
|
|
29
|
+
const [button, buttonRef] = useElement();
|
|
30
|
+
const input = useRef(null);
|
|
31
|
+
const field = useFieldControl({
|
|
32
|
+
id,
|
|
33
|
+
labelable: true,
|
|
34
|
+
value: checked,
|
|
35
|
+
filled: checked,
|
|
36
|
+
input: () => input.current,
|
|
37
|
+
focusTarget: () => button
|
|
38
|
+
});
|
|
39
|
+
const disabled = disabledProp || field.disabled;
|
|
40
|
+
const latest = useRef({
|
|
41
|
+
checked,
|
|
42
|
+
defaultChecked,
|
|
43
|
+
setChecked,
|
|
44
|
+
reset: field.reset
|
|
45
|
+
});
|
|
46
|
+
latest.current = {
|
|
47
|
+
checked,
|
|
48
|
+
defaultChecked,
|
|
49
|
+
setChecked,
|
|
50
|
+
reset: field.reset
|
|
51
|
+
};
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const element = input.current;
|
|
54
|
+
if (element === null) return;
|
|
55
|
+
return bridgeForm(element, {
|
|
56
|
+
reset: () => {
|
|
57
|
+
const current = latest.current;
|
|
58
|
+
current.reset();
|
|
59
|
+
current.setChecked(current.defaultChecked, { reason: "none" });
|
|
60
|
+
element.checked = current.checked;
|
|
61
|
+
},
|
|
62
|
+
invalid: () => button
|
|
63
|
+
});
|
|
64
|
+
}, [button]);
|
|
65
|
+
const state = {
|
|
66
|
+
checked,
|
|
67
|
+
disabled,
|
|
68
|
+
readOnly,
|
|
69
|
+
required
|
|
70
|
+
};
|
|
71
|
+
const formName = field.name ?? name;
|
|
72
|
+
return /* @__PURE__ */ jsxs(SwitchContext.Provider, {
|
|
73
|
+
value: state,
|
|
74
|
+
children: [
|
|
75
|
+
renderElement("button", {
|
|
76
|
+
...props,
|
|
77
|
+
children
|
|
78
|
+
}, state, {
|
|
79
|
+
type: "button",
|
|
80
|
+
role: "switch",
|
|
81
|
+
id,
|
|
82
|
+
disabled,
|
|
83
|
+
"aria-checked": checked ? "true" : "false",
|
|
84
|
+
"aria-required": required ? "true" : void 0,
|
|
85
|
+
"aria-readonly": readOnly ? "true" : void 0,
|
|
86
|
+
...field.aria,
|
|
87
|
+
"data-primitives-part": "switch-root",
|
|
88
|
+
...field.attributes,
|
|
89
|
+
...stateAttributes(switchAttributes(state)),
|
|
90
|
+
onClick: () => {
|
|
91
|
+
if (!disabled && !readOnly) setChecked(!checked, { reason: "none" });
|
|
92
|
+
},
|
|
93
|
+
onFocus: field.onFocus,
|
|
94
|
+
onBlur: field.onBlur
|
|
95
|
+
}, buttonRef),
|
|
96
|
+
/* @__PURE__ */ jsx("input", {
|
|
97
|
+
ref: input,
|
|
98
|
+
type: "checkbox",
|
|
99
|
+
"aria-hidden": "true",
|
|
100
|
+
tabIndex: -1,
|
|
101
|
+
name: formName,
|
|
102
|
+
value,
|
|
103
|
+
checked,
|
|
104
|
+
required,
|
|
105
|
+
disabled,
|
|
106
|
+
onChange: NOOP,
|
|
107
|
+
style: VISUALLY_HIDDEN_INPUT_STYLE,
|
|
108
|
+
"data-primitives-part": "switch-input"
|
|
109
|
+
}),
|
|
110
|
+
!checked && uncheckedValue !== void 0 && /* @__PURE__ */ jsx("input", {
|
|
111
|
+
type: "hidden",
|
|
112
|
+
name: formName,
|
|
113
|
+
value: uncheckedValue,
|
|
114
|
+
disabled,
|
|
115
|
+
"data-primitives-part": "switch-unchecked-input"
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// src/components/switch/switch-thumb.tsx
|
|
121
|
+
/** The moving part, always rendered; the recipe places it from `data-checked` (spec/switch.md). */
|
|
122
|
+
function SwitchThumb(props) {
|
|
123
|
+
const state = useRequiredContext(SwitchContext, "Switch.Thumb");
|
|
124
|
+
return renderElement("span", props, state, {
|
|
125
|
+
"data-primitives-part": "switch-thumb",
|
|
126
|
+
...stateAttributes(switchAttributes(state))
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
// src/components/switch/parts.ts
|
|
130
|
+
/** spec/switch.md */
|
|
131
|
+
const Switch = {
|
|
132
|
+
Root: SwitchRoot,
|
|
133
|
+
Thumb: SwitchThumb
|
|
134
|
+
};
|
|
135
|
+
export { Switch as t };
|
|
136
|
+
|
|
137
|
+
//# sourceMappingURL=switch-D3zj8gtg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-D3zj8gtg.js","names":[],"sources":["../src/components/switch/switch-context.ts","../src/components/switch/switch-root.tsx","../src/components/switch/switch-thumb.tsx","../src/components/switch/parts.ts"],"sourcesContent":["import { createContext } from \"react\";\n\nexport interface SwitchState {\n checked: boolean;\n disabled: boolean;\n readOnly: boolean;\n required: boolean;\n}\n\nexport const SwitchContext = createContext<SwitchState | null>(null);\n\n/** `data-checked` / `data-unchecked` (exactly one), and the switch's flags (spec/switch.md). */\nexport function switchAttributes(state: SwitchState) {\n return {\n checked: state.checked,\n unchecked: !state.checked,\n disabled: state.disabled,\n readonly: state.readOnly,\n required: state.required,\n };\n}\n","import {\n bridgeForm,\n VISUALLY_HIDDEN_INPUT_STYLE,\n} from \"@fragiola/primitives/form\";\nimport { useEffect, useId, useRef } from \"react\";\nimport { useControllableState } from \"../../hooks/use-controllable-state.ts\";\nimport { useElement } from \"../../hooks/use-element.ts\";\nimport { useFieldControl } from \"../../hooks/use-field-control.ts\";\nimport type { ChangeDetails } from \"../../utils/change-details.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n SwitchContext,\n type SwitchState,\n switchAttributes,\n} from \"./switch-context.ts\";\n\nexport interface SwitchRootProps extends PartProps<SwitchState> {\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean, details: ChangeDetails) => void;\n disabled?: boolean;\n required?: boolean;\n /** Focusable and submitted, but a press or a key does not toggle it. */\n readOnly?: boolean;\n name?: string;\n /** Submitted while on (`\"on\"`). */\n value?: string;\n /** Submitted while off, when given (Base UI); nothing is submitted while off without it. */\n uncheckedValue?: string;\n id?: string;\n}\n\nconst NOOP = () => {};\n\n/** A `switch` with its hidden form inputs (spec/switch.md, the APG switch). */\nexport function SwitchRoot({\n checked: checkedProp,\n defaultChecked = false,\n onCheckedChange,\n disabled: disabledProp = false,\n required = false,\n readOnly = false,\n name,\n value = \"on\",\n uncheckedValue,\n id: idProp,\n children,\n ...props\n}: SwitchRootProps) {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const [checked, setChecked] = useControllableState(\n checkedProp,\n defaultChecked,\n onCheckedChange,\n );\n const [button, buttonRef] = useElement<HTMLElement>();\n const input = useRef<HTMLInputElement>(null);\n const field = useFieldControl({\n id,\n labelable: true,\n value: checked,\n filled: checked,\n input: () => input.current,\n focusTarget: () => button,\n });\n const disabled = disabledProp || field.disabled;\n\n const latest = useRef({\n checked,\n defaultChecked,\n setChecked,\n reset: field.reset,\n });\n latest.current = {\n checked,\n defaultChecked,\n setChecked,\n reset: field.reset,\n };\n useEffect(() => {\n const element = input.current;\n if (element === null) {\n return undefined;\n }\n return bridgeForm(element, {\n reset: () => {\n const current = latest.current;\n current.reset();\n current.setChecked(current.defaultChecked, { reason: \"none\" });\n // the rendered state, which a render that changes it patches again (a controlled\n // switch that refuses the reset keeps its input)\n element.checked = current.checked;\n },\n invalid: () => button,\n });\n }, [button]);\n\n const state = { checked, disabled, readOnly, required };\n const formName = field.name ?? name;\n return (\n <SwitchContext.Provider value={state}>\n {renderElement(\n \"button\",\n { ...props, children },\n state,\n {\n type: \"button\",\n role: \"switch\",\n id,\n disabled,\n \"aria-checked\": checked ? \"true\" : \"false\",\n \"aria-required\": required ? \"true\" : undefined,\n \"aria-readonly\": readOnly ? \"true\" : undefined,\n ...field.aria,\n \"data-primitives-part\": \"switch-root\",\n ...field.attributes,\n ...stateAttributes(switchAttributes(state)),\n // Space and Enter click a native button: both toggle (APG, Base UI)\n onClick: () => {\n if (!disabled && !readOnly) {\n setChecked(!checked, { reason: \"none\" });\n }\n },\n onFocus: field.onFocus,\n onBlur: field.onBlur,\n },\n buttonRef,\n )}\n <input\n ref={input}\n type=\"checkbox\"\n aria-hidden=\"true\"\n tabIndex={-1}\n name={formName}\n value={value}\n checked={checked}\n required={required}\n disabled={disabled}\n onChange={NOOP}\n style={VISUALLY_HIDDEN_INPUT_STYLE}\n data-primitives-part=\"switch-input\"\n />\n {!checked && uncheckedValue !== undefined && (\n <input\n type=\"hidden\"\n name={formName}\n value={uncheckedValue}\n disabled={disabled}\n data-primitives-part=\"switch-unchecked-input\"\n />\n )}\n </SwitchContext.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 SwitchContext,\n type SwitchState,\n switchAttributes,\n} from \"./switch-context.ts\";\n\nexport type SwitchThumbProps = PartProps<SwitchState>;\n\n/** The moving part, always rendered; the recipe places it from `data-checked` (spec/switch.md). */\nexport function SwitchThumb(props: SwitchThumbProps) {\n const state = useRequiredContext(SwitchContext, \"Switch.Thumb\");\n return renderElement(\"span\", props, state, {\n \"data-primitives-part\": \"switch-thumb\",\n ...stateAttributes(switchAttributes(state)),\n });\n}\n","import { SwitchRoot } from \"./switch-root.tsx\";\nimport { SwitchThumb } from \"./switch-thumb.tsx\";\n\n/** spec/switch.md */\nexport const Switch = {\n Root: SwitchRoot,\n Thumb: SwitchThumb,\n};\n"],"mappings":";;;;;;;;;;AASA,MAAa,gBAAgB,cAAkC,IAAI;;AAGnE,SAAgB,iBAAiB,OAAoB;CACjD,OAAO;EACH,SAAS,MAAM;EACf,WAAW,CAAC,MAAM;EAClB,UAAU,MAAM;EAChB,UAAU,MAAM;EAChB,UAAU,MAAM;CACpB;AACJ;;ACaA,MAAM,aAAa,CAAC;;AAGpB,SAAgB,WAAW,EACvB,SAAS,aACT,iBAAiB,OACjB,iBACA,UAAU,eAAe,OACzB,WAAW,OACX,WAAW,OACX,MACA,Q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AAS,EAAE,QAAQ,OAAO,CAAC;IAE/C;IACA,SAAS,MAAM;IACf,QAAQ,MAAM;GAClB,GACA,SACJ;GACA,oBAAC,SAAD;IACI,KAAK;IACL,MAAK;IACL,eAAY;IACZ,UAAU;IACV,MAAM;IACC;IACE;IACC;IACA;IACV,UAAU;IACV,OAAO;IACP,wBAAqB;GACxB,CAAA;GACA,CAAC,WAAW,mBAAmB,KAAA,KAC5B,oBAAC,SAAD;IACI,MAAK;IACL,MAAM;IACN,OAAO;IACG;IACV,wBAAqB;GACxB,CAAA;EAEe;;AAEhC;;;AC/IA,SAAgB,YAAY,OAAyB;CACjD,MAAM,QAAQ,mBAAmB,eAAe,cAAc;CAC9D,OAAO,cAAc,QAAQ,OAAO,OAAO;EACvC,wBAAwB;EACxB,GAAG,gBAAgB,iBAAiB,KAAK,CAAC;CAC9C,CAAC;AACL;;;ACdA,MAAa,SAAS;CAClB,MAAM;CACN,OAAO;AACX"}
|
package/dist/switch.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 { i as SwitchState, n as SwitchThumbProps, r as SwitchRootProps, t as Switch } from "./index-Pq-ztBxR.js";
|
|
4
|
+
export { type ChangeDetails, type ChangeReason, type RenderProp, Switch, type SwitchRootProps, type SwitchState, type SwitchThumbProps };
|
package/dist/switch.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Switch } from "./switch-D3zj8gtg.js";
|