@bi-digital/react 0.3.2 → 0.3.4
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/dist/alert-C6PxDwHt.js.map +1 -1
- package/dist/{alert-footer-DL4rCThp.js → alert-footer-DfjvFlBv.js} +2 -3
- package/dist/{alert-footer-DL4rCThp.js.map → alert-footer-DfjvFlBv.js.map} +1 -1
- package/dist/avatar-6Q2xwviO.js.map +1 -1
- package/dist/{badge-D9OVAKG8.js → badge-tKh0f84O.js} +2 -3
- package/dist/{badge-D9OVAKG8.js.map → badge-tKh0f84O.js.map} +1 -1
- package/dist/{button-fhd-JARc.js → button-BzU7DrNe.js} +2 -3
- package/dist/{button-fhd-JARc.js.map → button-BzU7DrNe.js.map} +1 -1
- package/dist/{card-action-D8M3_IVq.js → card-action-DiyQo6bH.js} +3 -4
- package/dist/{card-action-D8M3_IVq.js.map → card-action-DiyQo6bH.js.map} +1 -1
- package/dist/card-actions-CIsnmxsm.js.map +1 -1
- package/dist/{card-content-DkEHp8mv.js → card-content-BUc3uxiV.js} +2 -3
- package/dist/{card-content-DkEHp8mv.js.map → card-content-BUc3uxiV.js.map} +1 -1
- package/dist/card-date-Bd87BGDE.js.map +1 -1
- package/dist/card-header-D-RMd4xS.js.map +1 -1
- package/dist/card-media-DhU2_Ueq.js.map +1 -1
- package/dist/{card-QAnFhTk6.js → card-xvRovR7u.js} +2 -3
- package/dist/{card-QAnFhTk6.js.map → card-xvRovR7u.js.map} +1 -1
- package/dist/{checkbox-ZR1Z2PCF.js → checkbox-D04YsX0C.js} +4 -4
- package/dist/{checkbox-ZR1Z2PCF.js.map → checkbox-D04YsX0C.js.map} +1 -1
- package/dist/checkbox-subsection-BPe5aj-W.js.map +1 -1
- package/dist/{chip-b9xUiF7_.js → chip-BXBQ6E1H.js} +2 -3
- package/dist/{chip-b9xUiF7_.js.map → chip-BXBQ6E1H.js.map} +1 -1
- package/dist/components/alert/alert-footer.d.ts +2 -2
- package/dist/components/alert/alert-footer.js +1 -1
- package/dist/components/alert/alert.d.ts +2 -2
- package/dist/components/alert/index.d.ts +2 -2
- package/dist/components/alert/index.js +1 -1
- package/dist/components/avatar/avatar.d.ts +2 -2
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/badge/badge.d.ts +2 -2
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/index.js +1 -1
- package/dist/components/card/card-action.d.ts +2 -2
- package/dist/components/card/card-action.js +2 -2
- package/dist/components/card/card-actions.d.ts +2 -2
- package/dist/components/card/card-content.d.ts +2 -2
- package/dist/components/card/card-content.js +1 -1
- package/dist/components/card/card-date.d.ts +2 -2
- package/dist/components/card/card-header.d.ts +2 -2
- package/dist/components/card/card-media.d.ts +2 -2
- package/dist/components/card/card.d.ts +2 -2
- package/dist/components/card/card.js +1 -1
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/card/index.js +4 -4
- package/dist/components/checkbox/checkbox-subsection.d.ts +2 -2
- package/dist/components/checkbox/checkbox.d.ts +2 -2
- package/dist/components/checkbox/checkbox.js +5 -5
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.js +5 -5
- package/dist/components/chip/chip.d.ts +2 -2
- package/dist/components/chip/chip.js +1 -1
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/index.js +1 -1
- package/dist/components/dialog/dialog-close-button.d.ts +2 -2
- package/dist/components/dialog/dialog-close-button.js +2 -2
- package/dist/components/dialog/dialog-content.d.ts +2 -2
- package/dist/components/dialog/dialog-content.js +1 -1
- package/dist/components/dialog/dialog-footer.d.ts +2 -2
- package/dist/components/dialog/dialog-footer.js +1 -1
- package/dist/components/dialog/dialog-header.d.ts +2 -2
- package/dist/components/dialog/dialog-header.js +1 -1
- package/dist/components/dialog/dialog-trigger.d.ts +2 -2
- package/dist/components/dialog/dialog-trigger.js +2 -2
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dialog/index.d.ts +2 -2
- package/dist/components/dialog/index.js +7 -7
- package/dist/components/drawer/drawer-close-button.d.ts +2 -2
- package/dist/components/drawer/drawer-close-button.js +8 -8
- package/dist/components/drawer/drawer-content.d.ts +2 -2
- package/dist/components/drawer/drawer-content.js +8 -8
- package/dist/components/drawer/drawer-footer.d.ts +2 -2
- package/dist/components/drawer/drawer-footer.js +8 -8
- package/dist/components/drawer/drawer-header.d.ts +2 -2
- package/dist/components/drawer/drawer-header.js +8 -8
- package/dist/components/drawer/drawer-trigger-context.js +7 -7
- package/dist/components/drawer/drawer-trigger.d.ts +2 -2
- package/dist/components/drawer/drawer-trigger.js +8 -8
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/drawer/drawer.js +8 -8
- package/dist/components/drawer/index.d.ts +2 -2
- package/dist/components/drawer/index.js +13 -13
- package/dist/components/dropdown/dropdown-button.d.ts +2 -2
- package/dist/components/dropdown/dropdown-button.js +2 -2
- package/dist/components/dropdown/dropdown-trigger-context.d.ts +2 -2
- package/dist/components/dropdown/dropdown-trigger-context.js +3 -3
- package/dist/components/dropdown/dropdown-trigger.d.ts +2 -2
- package/dist/components/dropdown/dropdown-trigger.js +4 -4
- package/dist/components/dropdown/dropdown.d.ts +2 -2
- package/dist/components/dropdown/dropdown.js +4 -4
- package/dist/components/dropdown/index.d.ts +2 -2
- package/dist/components/dropdown/index.js +6 -6
- package/dist/components/field/field-affix.d.ts +2 -2
- package/dist/components/field/field-affix.js +1 -1
- package/dist/components/field/field-description.d.ts +2 -2
- package/dist/components/field/field-description.js +1 -1
- package/dist/components/field/field.d.ts +2 -2
- package/dist/components/field/field.js +1 -1
- package/dist/components/field/index.d.ts +2 -2
- package/dist/components/field/index.js +3 -3
- package/dist/components/fieldset/fieldset-description.d.ts +2 -2
- package/dist/components/fieldset/fieldset-description.js +1 -1
- package/dist/components/fieldset/fieldset-legend.d.ts +2 -2
- package/dist/components/fieldset/fieldset-legend.js +2 -2
- package/dist/components/fieldset/fieldset.d.ts +2 -2
- package/dist/components/fieldset/index.d.ts +2 -2
- package/dist/components/fieldset/index.js +3 -3
- package/dist/components/filter-group/filter-group.d.ts +2 -2
- package/dist/components/filter-group/index.d.ts +2 -2
- package/dist/components/footer/footer.d.ts +2 -2
- package/dist/components/footer/footer.js +2 -2
- package/dist/components/footer/index.d.ts +2 -2
- package/dist/components/footer/index.js +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +45 -45
- package/dist/components/input/index.d.ts +2 -2
- package/dist/components/input/input.d.ts +2 -2
- package/dist/components/label/index.d.ts +2 -2
- package/dist/components/label/index.js +1 -1
- package/dist/components/label/label.d.ts +2 -2
- package/dist/components/label/label.js +1 -1
- package/dist/components/link/index.d.ts +2 -2
- package/dist/components/link/index.js +1 -1
- package/dist/components/link/link.d.ts +2 -2
- package/dist/components/link/link.js +1 -1
- package/dist/components/logo/index.d.ts +2 -2
- package/dist/components/logo/logo.d.ts +2 -2
- package/dist/components/navbar/index.d.ts +2 -2
- package/dist/components/navbar/navbar.d.ts +2 -2
- package/dist/components/navbar/sub-navbar.d.ts +2 -2
- package/dist/components/pagination/index.d.ts +2 -2
- package/dist/components/pagination/index.js +3 -3
- package/dist/components/pagination/pagination-button.d.ts +2 -2
- package/dist/components/pagination/pagination-button.js +2 -2
- package/dist/components/pagination/pagination-item.js +1 -1
- package/dist/components/pagination/pagination.d.ts +2 -2
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.js +3 -3
- package/dist/components/popover/popover-trigger.d.ts +2 -2
- package/dist/components/popover/popover-trigger.js +2 -2
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/radio/index.d.ts +2 -2
- package/dist/components/radio/index.js +5 -5
- package/dist/components/radio/radio.d.ts +2 -2
- package/dist/components/radio/radio.js +5 -5
- package/dist/components/search/index.d.ts +2 -2
- package/dist/components/search/index.js +5 -5
- package/dist/components/search/search.d.ts +2 -2
- package/dist/components/search/search.js +5 -5
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/index.js +2 -2
- package/dist/components/select/select-optgroup.d.ts +2 -2
- package/dist/components/select/select-optgroup.js +1 -1
- package/dist/components/select/select-option.d.ts +2 -2
- package/dist/components/select/select-option.js +1 -1
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/selectfield/index.d.ts +2 -2
- package/dist/components/selectfield/index.js +8 -8
- package/dist/components/selectfield/selectfield.d.ts +2 -2
- package/dist/components/selectfield/selectfield.js +8 -8
- package/dist/components/skip-link/index.d.ts +2 -2
- package/dist/components/skip-link/index.js +1 -1
- package/dist/components/skip-link/skip-link.d.ts +2 -2
- package/dist/components/skip-link/skip-link.js +1 -1
- package/dist/components/spinner/index.d.ts +2 -2
- package/dist/components/spinner/spinner.d.ts +2 -2
- package/dist/components/sticky-header/index.d.ts +2 -2
- package/dist/components/sticky-header/index.js +1 -1
- package/dist/components/sticky-header/sticky-header.d.ts +1 -1
- package/dist/components/sticky-header/sticky-header.js +1 -1
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/index.js +2 -2
- package/dist/components/tabs/tab.d.ts +2 -2
- package/dist/components/tabs/tab.js +2 -2
- package/dist/components/tabs/tabs-list.d.ts +2 -2
- package/dist/components/tabs/tabs-panel.d.ts +2 -2
- package/dist/components/tabs/tabs.d.ts +2 -2
- package/dist/components/textarea/index.d.ts +2 -2
- package/dist/components/textarea/textarea.d.ts +2 -2
- package/dist/components/textfield/index.d.ts +2 -2
- package/dist/components/textfield/index.js +6 -6
- package/dist/components/textfield/textfield.d.ts +2 -2
- package/dist/components/textfield/textfield.js +6 -6
- package/dist/components/validation-message/index.d.ts +2 -2
- package/dist/components/validation-message/index.js +1 -1
- package/dist/components/validation-message/validation-message.d.ts +2 -2
- package/dist/components/validation-message/validation-message.js +1 -1
- package/dist/{dialog-DzGRZgbP.js → dialog-DLouxw4y.js} +2 -3
- package/dist/dialog-DLouxw4y.js.map +1 -0
- package/dist/{dialog-close-button-C1omdnIn.js → dialog-close-button-DNOVMUt7.js} +2 -2
- package/dist/{dialog-close-button-C1omdnIn.js.map → dialog-close-button-DNOVMUt7.js.map} +1 -1
- package/dist/{dialog-content-R35XpbSj.js → dialog-content-ByDqO6K-.js} +2 -3
- package/dist/{dialog-content-R35XpbSj.js.map → dialog-content-ByDqO6K-.js.map} +1 -1
- package/dist/{dialog-footer-AoiCz_Uj.js → dialog-footer-xGzY5JMf.js} +2 -3
- package/dist/{dialog-footer-AoiCz_Uj.js.map → dialog-footer-xGzY5JMf.js.map} +1 -1
- package/dist/{dialog-header-Bbq9DcHX.js → dialog-header-D3I5Q8fm.js} +2 -3
- package/dist/{dialog-header-Bbq9DcHX.js.map → dialog-header-D3I5Q8fm.js.map} +1 -1
- package/dist/{dialog-trigger-DinHpkua.js → dialog-trigger-BgCUVVqE.js} +2 -2
- package/dist/{dialog-trigger-DinHpkua.js.map → dialog-trigger-BgCUVVqE.js.map} +1 -1
- package/dist/dialog-trigger-context-51mA5fz3.js.map +1 -1
- package/dist/{drawer-CZ05Lizo.js → drawer-D71b1GFM.js} +2 -2
- package/dist/{drawer-CZ05Lizo.js.map → drawer-D71b1GFM.js.map} +1 -1
- package/dist/{drawer-close-button-DC39bNW2.js → drawer-close-button-DUl-Rv_Q.js} +2 -2
- package/dist/{drawer-close-button-DC39bNW2.js.map → drawer-close-button-DUl-Rv_Q.js.map} +1 -1
- package/dist/{drawer-content-CFc-rxBo.js → drawer-content-ClBmFSOu.js} +2 -2
- package/dist/{drawer-content-CFc-rxBo.js.map → drawer-content-ClBmFSOu.js.map} +1 -1
- package/dist/{drawer-footer-CfHjfvEg.js → drawer-footer--sVRArFE.js} +2 -2
- package/dist/{drawer-footer-CfHjfvEg.js.map → drawer-footer--sVRArFE.js.map} +1 -1
- package/dist/{drawer-header-DK4XoaaW.js → drawer-header-CltvXMkH.js} +2 -2
- package/dist/{drawer-header-DK4XoaaW.js.map → drawer-header-CltvXMkH.js.map} +1 -1
- package/dist/{drawer-trigger-Do9Htx5M.js → drawer-trigger-DFM774gy.js} +2 -2
- package/dist/{drawer-trigger-Do9Htx5M.js.map → drawer-trigger-DFM774gy.js.map} +1 -1
- package/dist/drawer-trigger-context-BUWPPdas.js.map +1 -1
- package/dist/{dropdown-b7acNLZb.js → dropdown-D6CTkQ5a.js} +2 -2
- package/dist/{dropdown-b7acNLZb.js.map → dropdown-D6CTkQ5a.js.map} +1 -1
- package/dist/dropdown-Fzf2CeX4.js.map +1 -1
- package/dist/{dropdown-button-FQqIwqdp.js → dropdown-button-CywUProG.js} +2 -2
- package/dist/{dropdown-button-FQqIwqdp.js.map → dropdown-button-CywUProG.js.map} +1 -1
- package/dist/dropdown-item-DQQXQC4J.js.map +1 -1
- package/dist/dropdown-list-DB1mST67.js.map +1 -1
- package/dist/{dropdown-trigger-Fwrigwtg.js → dropdown-trigger-C_CyL38J.js} +2 -2
- package/dist/{dropdown-trigger-Fwrigwtg.js.map → dropdown-trigger-C_CyL38J.js.map} +1 -1
- package/dist/dropdown-trigger-context-BCcyoZEx.js.map +1 -1
- package/dist/{field-DFMMLG-d.js → field-Dul9LBgF.js} +2 -3
- package/dist/{field-DFMMLG-d.js.map → field-Dul9LBgF.js.map} +1 -1
- package/dist/{field-affix-npc6m7XL.js → field-affix-C5w3NK4H.js} +3 -5
- package/dist/{field-affix-npc6m7XL.js.map → field-affix-C5w3NK4H.js.map} +1 -1
- package/dist/{field-description-Dhm1VA08.js → field-description-Yya33j8H.js} +2 -3
- package/dist/{field-description-Dhm1VA08.js.map → field-description-Yya33j8H.js.map} +1 -1
- package/dist/fieldset-Bpu4CRKG.js.map +1 -1
- package/dist/{fieldset-description-DiHvcLh-.js → fieldset-description-Dbu9_oUQ.js} +2 -3
- package/dist/{fieldset-description-DiHvcLh-.js.map → fieldset-description-Dbu9_oUQ.js.map} +1 -1
- package/dist/{fieldset-legend-CR4srn2-.js → fieldset-legend-BBKsX2hf.js} +2 -2
- package/dist/{fieldset-legend-CR4srn2-.js.map → fieldset-legend-BBKsX2hf.js.map} +1 -1
- package/dist/filter-group-Fzw9g6JB.js.map +1 -1
- package/dist/{footer-B9sjkncE.js → footer-C7EDtlw0.js} +2 -2
- package/dist/{footer-B9sjkncE.js.map → footer-C7EDtlw0.js.map} +1 -1
- package/dist/footer-links-BIUrxu38.js.map +1 -1
- package/dist/index-Cp46Zvz-.d.ts +1 -0
- package/dist/input-Dr7BnTyd.js.map +1 -1
- package/dist/{label-DUzvAx-T.js → label-DG_ojO9g.js} +2 -3
- package/dist/{label-DUzvAx-T.js.map → label-DG_ojO9g.js.map} +1 -1
- package/dist/{link-BqDeZAJF.js → link-Dmgzb_KP.js} +2 -3
- package/dist/{link-BqDeZAJF.js.map → link-Dmgzb_KP.js.map} +1 -1
- package/dist/logo-QKrYvRFP.js.map +1 -1
- package/dist/main.d.ts +2 -2
- package/dist/main.js +45 -45
- package/dist/navbar-Dxv7GQO0.js.map +1 -1
- package/dist/pagination-DH6vZYMO.js.map +1 -1
- package/dist/{pagination-button-CMSNwkeT.js → pagination-button-Dw341heB.js} +2 -2
- package/dist/{pagination-button-CMSNwkeT.js.map → pagination-button-Dw341heB.js.map} +1 -1
- package/dist/{pagination-item-DzskmZxf.js → pagination-item-wXC7T4rH.js} +2 -3
- package/dist/{pagination-item-DzskmZxf.js.map → pagination-item-wXC7T4rH.js.map} +1 -1
- package/dist/popover-DOMLkRA5.js.map +1 -1
- package/dist/{popover-DmA4qMtu.js → popover-pki5aMm2.js} +2 -4
- package/dist/popover-pki5aMm2.js.map +1 -0
- package/dist/{popover-trigger-Chi8uvRM.js → popover-trigger-BoB6rkG4.js} +2 -2
- package/dist/{popover-trigger-Chi8uvRM.js.map → popover-trigger-BoB6rkG4.js.map} +1 -1
- package/dist/popover-trigger-context-Cre9Mczn.js.map +1 -1
- package/dist/{radio-DAC5mhl3.js → radio-CDZoe1OO.js} +4 -4
- package/dist/{radio-DAC5mhl3.js.map → radio-CDZoe1OO.js.map} +1 -1
- package/dist/{search-DzjgrvFl.js → search-CmU2iA48.js} +4 -4
- package/dist/search-CmU2iA48.js.map +1 -0
- package/dist/select-R87VdG5U.js.map +1 -1
- package/dist/{select-optgroup-jowSQvbc.js → select-optgroup-DTnIUQEq.js} +2 -3
- package/dist/{select-optgroup-jowSQvbc.js.map → select-optgroup-DTnIUQEq.js.map} +1 -1
- package/dist/{select-option-WAhhr82L.js → select-option-BFmgqY3h.js} +2 -3
- package/dist/{select-option-WAhhr82L.js.map → select-option-BFmgqY3h.js.map} +1 -1
- package/dist/{selectfield-BD-t6Mmm.js → selectfield-CZ37jU-y.js} +5 -5
- package/dist/{selectfield-BD-t6Mmm.js.map → selectfield-CZ37jU-y.js.map} +1 -1
- package/dist/{skip-link-CbdX4Taw.js → skip-link-iWhLptx_.js} +2 -3
- package/dist/{skip-link-CbdX4Taw.js.map → skip-link-iWhLptx_.js.map} +1 -1
- package/dist/spinner-Ch5bEQBR.js.map +1 -1
- package/dist/{sticky-header-C9uGD3u6.d.ts → sticky-header-BMeHtK7e.d.ts} +3 -3
- package/dist/{sticky-header-gE5HX2ug.js → sticky-header-DOQD4Wye.js} +2 -3
- package/dist/{sticky-header-gE5HX2ug.js.map → sticky-header-DOQD4Wye.js.map} +1 -1
- package/dist/{sub-navbar-BdJ9EKsU.js → sub-navbar-DTTytyEQ.js} +7 -9
- package/dist/sub-navbar-DTTytyEQ.js.map +1 -0
- package/dist/sub-navbar-DkxQv0WJ.js.map +1 -1
- package/dist/{tab-BvSndQZ_.js → tab-BEnC2rri.js} +2 -2
- package/dist/{tab-BvSndQZ_.js.map → tab-BEnC2rri.js.map} +1 -1
- package/dist/tabs-C70z_5SJ.js.map +1 -1
- package/dist/tabs-list-npvK06bl.js.map +1 -1
- package/dist/tabs-panel-L8HovooI.js.map +1 -1
- package/dist/textarea-B1fAOfkt.js.map +1 -1
- package/dist/{textfield-DwLkaC2S.js → textfield-BH0g7AtT.js} +6 -6
- package/dist/{textfield-DwLkaC2S.js.map → textfield-BH0g7AtT.js.map} +1 -1
- package/dist/useCheckboxGroup-BDH3ewt8.js.map +1 -1
- package/dist/useIsElementAboveViewport-lmdnXDdc.js.map +1 -1
- package/dist/useMediaQuery-ICPWsO_p.js.map +1 -1
- package/dist/useMergeRefs-DC710CHX.js.map +1 -1
- package/dist/usePagination-DQR72JNE.js.map +1 -1
- package/dist/useScrollDirection-C2EmQi0U.js.map +1 -1
- package/dist/utilities/hooks/index.d.ts +2 -2
- package/dist/utilities/hooks/usePagination/usePagination.d.ts +2 -2
- package/dist/utilities/index.d.ts +2 -2
- package/dist/{validation-message-CPGA4DxM.js → validation-message-J5bvdg8v.js} +2 -3
- package/dist/{validation-message-CPGA4DxM.js.map → validation-message-J5bvdg8v.js.map} +1 -1
- package/dist/vanilla/index.js +1 -1
- package/dist/vanilla/sub-navbar/index.js +1 -1
- package/dist/vite-env.d.ts +1 -2
- package/package.json +21 -10
- package/dist/dialog-DzGRZgbP.js.map +0 -1
- package/dist/index-Cv0onxlx.d.ts +0 -1
- package/dist/popover-DmA4qMtu.js.map +0 -1
- package/dist/search-DzjgrvFl.js.map +0 -1
- package/dist/sub-navbar-BdJ9EKsU.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-button-
|
|
1
|
+
{"version":3,"file":"pagination-button-Dw341heB.js","names":[],"sources":["../src/components/pagination/pagination-button.tsx"],"sourcesContent":["import { AriaAttributes } from 'react';\nimport { Button, type ButtonProps } from '../button';\n\nexport type PaginationButtonProps = ButtonProps & {\n /**\n * Toggle button as active\n * @default false\n */\n 'aria-current'?: AriaAttributes['aria-current'];\n};\n\nexport const PaginationButton = ({ ref, ...rest }: PaginationButtonProps) => (\n <Button variant='text' icon ref={ref} {...rest} />\n);\n"],"mappings":";;;;AAWA,MAAa,oBAAoB,EAAE,IAAK,GAAG,WACzC,oBAAC;CAAO,SAAQ;CAAO;CAAU;CAAK,GAAI;EAAQ"}
|
|
@@ -3,8 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
//#region src/components/pagination/pagination-item.tsx
|
|
5
5
|
const PaginationItem = ({ ref, asChild, children,...rest }) => {
|
|
6
|
-
|
|
7
|
-
return /* @__PURE__ */ jsx(Component, {
|
|
6
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "li", {
|
|
8
7
|
ref,
|
|
9
8
|
...rest,
|
|
10
9
|
children
|
|
@@ -13,4 +12,4 @@ const PaginationItem = ({ ref, asChild, children,...rest }) => {
|
|
|
13
12
|
|
|
14
13
|
//#endregion
|
|
15
14
|
export { PaginationItem };
|
|
16
|
-
//# sourceMappingURL=pagination-item-
|
|
15
|
+
//# sourceMappingURL=pagination-item-wXC7T4rH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-item-
|
|
1
|
+
{"version":3,"file":"pagination-item-wXC7T4rH.js","names":[],"sources":["../src/components/pagination/pagination-item.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { HTMLAttributes, Ref } from 'react';\n\nexport type PaginationItemProps = HTMLAttributes<HTMLLIElement> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n ref?: Ref<HTMLLIElement>;\n};\n\nexport const PaginationItem = ({ ref, asChild, children, ...rest }: PaginationItemProps) => {\n const Component = asChild ? Slot : 'li';\n return (\n <Component ref={ref} {...rest}>\n {children}\n </Component>\n );\n};\n"],"mappings":";;;;AAYA,MAAa,kBAAkB,EAAE,KAAK,SAAS,SAAU,GAAG,WAAgC;AAE1F,QACE,oBAFgB,UAAU,OAAO;EAEjB;EAAK,GAAI;EACtB;GACS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-DOMLkRA5.js","names":["cleanup: (() => void) | undefined"
|
|
1
|
+
{"version":3,"file":"popover-DOMLkRA5.js","names":["cleanup: (() => void) | undefined"],"sources":["../src/vanilla/popover/index.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift, hide } from '@floating-ui/dom';\nimport type { Middleware, Placement } from '@floating-ui/dom';\n\nexport type InitPopoverOptions = {\n /** The id of the popover to initialize. The trigger element should have a `aria-controls` attribute with the same id. */\n id: string;\n /**\n * Placement of the popover relative to the trigger.\n * @default 'top'\n */\n placement?: Placement;\n /**\n * Additional middleware to use for positioning the popover.\n *\n * @example\n * Prevent the popover from overflowing the navbar by using the `size` middleware:\n * ```ts\n * positionMiddleware: [\n * size({\n * apply: ({ availableHeight, elements, ...state }) => {\n * const available = `${Math.max(0, availableHeight)}px`;\n * const maxHeight = state.placement.includes('top')\n * ? `calc(${available} - var(--bi-layout-navbar-height, 0))`\n * : available;\n * elements.floating.style.maxHeight = maxHeight;\n * },\n * padding,\n * })\n * ]}\n * ```\n */\n positionMiddleware?: Middleware[];\n /**\n * Whether to disable auto placement.\n * @default false\n */\n disableAutoPlacement?: boolean;\n /**\n * The padding used by the `offset` middleware.\n * @default '20'\n */\n padding?: number;\n};\n\n/**\n * Initializes the popover.\n * @param options - InitPopoverOptions\n * @returns A function to programmatically toggle the popover.\n */\nexport const initPopover = ({\n id,\n disableAutoPlacement = false,\n placement = 'top',\n positionMiddleware = [],\n padding = 20,\n}: InitPopoverOptions) => {\n let cleanup: (() => void) | undefined;\n const popover = document.getElementById(id);\n const triggerSelector = `[aria-controls=\"${id}\"]`;\n const trigger = document.querySelector(triggerSelector);\n\n if (!popover || !trigger) return;\n\n const togglePopover = (open: boolean) => {\n if (open) {\n cleanup = autoUpdate(trigger, popover, () => {\n computePosition(trigger, popover, {\n middleware: [\n offset(padding),\n ...(disableAutoPlacement ? [] : [flip({ padding }), shift({ padding })]),\n ...positionMiddleware,\n hide({ padding }),\n ],\n strategy: 'fixed',\n placement,\n }).then(({ x, y, middlewareData }) => {\n popover.style.translate = `${x}px ${y}px`;\n popover.style.visibility = middlewareData.hide?.referenceHidden ? 'hidden' : 'visible';\n });\n });\n popover.setAttribute('aria-hidden', 'false');\n trigger.setAttribute('aria-expanded', 'true');\n } else {\n cleanup?.();\n popover.setAttribute('aria-hidden', 'true');\n trigger.setAttribute('aria-expanded', 'false');\n }\n };\n\n document.addEventListener(\n 'click',\n (event) => {\n const el = event.target as Element | null;\n const isTrigger = el?.closest?.(triggerSelector);\n const isOutside = !isTrigger && !popover.contains(el as Node);\n const isOpen = popover.getAttribute('aria-hidden') === 'false';\n\n if (isTrigger) {\n togglePopover(!isOpen);\n }\n if (isOutside && isOpen) {\n togglePopover(false);\n }\n },\n true,\n );\n\n return togglePopover;\n};\n"],"mappings":";;;;;;;;AAiDA,MAAa,eAAe,EAC1B,IACA,uBAAuB,OACvB,YAAY,OACZ,qBAAqB,EAAE,EACvB,UAAU,SACc;CACxB,IAAIA;CACJ,MAAM,UAAU,SAAS,eAAe,GAAG;CAC3C,MAAM,kBAAkB,mBAAmB,GAAG;CAC9C,MAAM,UAAU,SAAS,cAAc,gBAAgB;AAEvD,KAAI,CAAC,WAAW,CAAC,QAAS;CAE1B,MAAM,iBAAiB,SAAkB;AACvC,MAAI,MAAM;AACR,aAAU,WAAW,SAAS,eAAe;AAC3C,oBAAgB,SAAS,SAAS;KAChC,YAAY;MACV,OAAO,QAAQ;MACf,GAAI,uBAAuB,EAAE,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;MACvE,GAAG;MACH,KAAK,EAAE,SAAS,CAAC;MAClB;KACD,UAAU;KACV;KACD,CAAC,CAAC,MAAM,EAAE,GAAG,GAAG,qBAAqB;AACpC,aAAQ,MAAM,YAAY,GAAG,EAAE,KAAK,EAAE;AACtC,aAAQ,MAAM,aAAa,eAAe,MAAM,kBAAkB,WAAW;MAC7E;KACF;AACF,WAAQ,aAAa,eAAe,QAAQ;AAC5C,WAAQ,aAAa,iBAAiB,OAAO;SACxC;AACL,cAAW;AACX,WAAQ,aAAa,eAAe,OAAO;AAC3C,WAAQ,aAAa,iBAAiB,QAAQ;;;AAIlD,UAAS,iBACP,UACC,UAAU;EACT,MAAM,KAAK,MAAM;EACjB,MAAM,YAAY,IAAI,UAAU,gBAAgB;EAChD,MAAM,YAAY,CAAC,aAAa,CAAC,QAAQ,SAAS,GAAW;EAC7D,MAAM,SAAS,QAAQ,aAAa,cAAc,KAAK;AAEvD,MAAI,UACF,eAAc,CAAC,OAAO;AAExB,MAAI,aAAa,OACf,eAAc,MAAM;IAGxB,KACD;AAED,QAAO"}
|
|
@@ -44,9 +44,7 @@ const Popover = ({ id, className, onOpenChange, open, placement = "top", disable
|
|
|
44
44
|
const popover = popoverRef.current;
|
|
45
45
|
const handleClick = (event) => {
|
|
46
46
|
const el = event.target;
|
|
47
|
-
|
|
48
|
-
const isOutside = !isTrigger && !popover?.contains(el);
|
|
49
|
-
if (isOutside) setIsOpen(false);
|
|
47
|
+
if (!el?.closest?.(`[aria-controls="${popover?.id}"]`) && !popover?.contains(el)) setIsOpen(false);
|
|
50
48
|
};
|
|
51
49
|
const handleKeydown = (event) => {
|
|
52
50
|
if (event.key !== "Escape" || !isOpen) return;
|
|
@@ -104,4 +102,4 @@ const Popover = ({ id, className, onOpenChange, open, placement = "top", disable
|
|
|
104
102
|
|
|
105
103
|
//#endregion
|
|
106
104
|
export { Popover };
|
|
107
|
-
//# sourceMappingURL=popover-
|
|
105
|
+
//# sourceMappingURL=popover-pki5aMm2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover-pki5aMm2.js","names":["cl"],"sources":["../src/components/popover/popover.tsx"],"sourcesContent":["// Thanks to Designsystemet:\n// https://github.com/digdir/designsystemet/blob/8aa6dc274e5b0338d15572f44b5dd3fab6fa4eb1/packages/react/src/components/Popover/Popover.tsx\n\nimport { autoUpdate, computePosition, flip, offset, shift, hide } from '@floating-ui/dom';\nimport type { Middleware, Placement } from '@floating-ui/dom';\nimport { Slot } from '@radix-ui/react-slot';\nimport cl from 'clsx/lite';\nimport { use, useRef } from 'react';\nimport type { HTMLAttributes, Ref } from 'react';\nimport { useEffect } from 'react';\nimport type { DefaultProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\nimport { useMergeRefs } from '../../utilities/hooks/useMergeRefs/useMergeRefs';\nimport { Context } from './popover-trigger-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\n\nexport type PopoverProps = MergeRight<\n DefaultProps & HTMLAttributes<HTMLDivElement>,\n {\n /**\n * `id` to connect the trigger with the popover - required when not using PopoverContext.\n */\n id?: string;\n /**\n * Placement of the popover on the trigger.\n * @default 'top'\n */\n placement?: Placement;\n /**\n * When a boolean is provided, the popover will be controlled.\n * @default undefined\n */\n open?: boolean;\n /**\n * Callback when the open state changes.\n * @param open - The new open state of the popover.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Whether to disable auto placement.\n * @default false\n */\n disableAutoPlacement?: boolean;\n /**\n * Additional middleware to use for positioning the popover.\n *\n * @example\n * Prevent the popover from overflowing the navbar by using the `size` middleware:\n * ```ts\n * positionMiddleware={[\n * size({\n * apply: ({ availableHeight, elements, ...state }) => {\n * const available = `${Math.max(0, availableHeight)}px`;\n * const maxHeight = state.placement.includes('top')\n * ? `calc(${available} - var(--bi-layout-navbar-height, 0))`\n * : available;\n * elements.floating.style.maxHeight = maxHeight;\n * },\n * padding,\n * })\n * ]}\n * ```\n */\n positionMiddleware?: Middleware[];\n /**\n * The padding used by the `offset` middleware.\n * @default '20'\n */\n padding?: number;\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n ref?: Ref<HTMLDivElement>;\n }\n>;\n\n/**\n * Popover component, used to display content in a popover over an element.\n *\n * @example with TriggerContext\n * <PopoverTriggerContext>\n * <PopoverTrigger>Open Popover</PopoverTrigger>\n * <Popover>\n * Content\n * </Popover>\n * </PopoverTriggerContext>\n *\n * @example without TriggerContext\n * <Button aria-controls=\"my-popover\" aria-expanded={open}>Open Popover</Button>\n * <Popover open={open} onOpenChange={onOpenChange} id=\"my-popover\">\n * Content\n * </Popover>\n */\nexport const Popover = ({\n id,\n className,\n onOpenChange,\n open,\n placement = 'top',\n disableAutoPlacement = false,\n positionMiddleware = [],\n padding = 20,\n dark = false,\n asChild = false,\n ref,\n ...rest\n}: PopoverProps) => {\n const Component = asChild ? Slot : 'div';\n\n const popoverRef = useRef<HTMLDivElement>(null);\n const isControlled = useRef(open !== undefined);\n const mergedRefs = useMergeRefs([popoverRef, ref]);\n const { popoverId, setPopoverId, popoverOpen, setPopoverOpen } = use(Context);\n\n const [isOpen, setIsOpen] = useControllableState({\n prop: isControlled.current ? open : popoverOpen,\n onChange: (val) => {\n onOpenChange?.(val);\n setPopoverOpen?.(val);\n },\n defaultProp: false,\n caller: 'Popover',\n });\n\n useEffect(() => {\n const popover = popoverRef.current;\n const handleClick = (event: MouseEvent) => {\n const el = event.target as Element | null;\n const isTrigger = el?.closest?.(`[aria-controls=\"${popover?.id}\"]`);\n const isOutside = !isTrigger && !popover?.contains(el as Node);\n\n if (isOutside) {\n setIsOpen(false);\n }\n };\n\n const handleKeydown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || !isOpen) return;\n event.preventDefault(); // Prevent closing fullscreen in Safari\n setIsOpen(false);\n };\n\n document.addEventListener('click', handleClick, true); // Use capture to execute before React event API\n document.addEventListener('keydown', handleKeydown);\n return () => {\n document.removeEventListener('click', handleClick, true);\n document.removeEventListener('keydown', handleKeydown);\n };\n }, [isOpen, setIsOpen]);\n\n useEffect(() => {\n const popover = popoverRef.current;\n const trigger = document.querySelector(`[aria-controls=\"${popover?.id}\"]`);\n\n if (popover && trigger && isOpen)\n return autoUpdate(trigger, popover, () => {\n computePosition(trigger, popover, {\n middleware: [\n offset(padding),\n ...(disableAutoPlacement ? [] : [flip({ padding }), shift({ padding })]),\n ...positionMiddleware,\n hide({ padding, strategy: 'escaped' }),\n ],\n strategy: 'fixed',\n placement,\n }).then(({ x, y, middlewareData }) => {\n popover.style.translate = `${x}px ${y}px`;\n popover.style.visibility = middlewareData.hide?.referenceHidden ? 'hidden' : 'visible';\n });\n });\n }, [isOpen, placement, id, disableAutoPlacement, positionMiddleware, padding]);\n\n // Update context with id\n useEffect(() => {\n if (id) setPopoverId?.(id);\n }, [id, setPopoverId]);\n\n return (\n <Component\n className={cl('bi-popover', className)}\n id={id || popoverId}\n aria-hidden={!isOpen}\n data-dark={dark}\n ref={mergedRefs}\n {...rest}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,MAAa,WAAW,EACtB,IACA,WACA,cACA,MACA,YAAY,OACZ,uBAAuB,OACvB,qBAAqB,EAAE,EACvB,UAAU,IACV,OAAO,OACP,UAAU,OACV,IACA,GAAG,WACe;CAClB,MAAM,YAAY,UAAU,OAAO;CAEnC,MAAM,aAAa,OAAuB,KAAK;CAC/C,MAAM,eAAe,OAAO,SAAS,OAAU;CAC/C,MAAM,aAAa,aAAa,CAAC,YAAY,IAAI,CAAC;CAClD,MAAM,EAAE,WAAW,cAAc,aAAa,mBAAmB,IAAI,QAAQ;CAE7E,MAAM,CAAC,QAAQ,aAAa,qBAAqB;EAC/C,MAAM,aAAa,UAAU,OAAO;EACpC,WAAW,QAAQ;AACjB,kBAAe,IAAI;AACnB,oBAAiB,IAAI;;EAEvB,aAAa;EACb,QAAQ;EACT,CAAC;AAEF,iBAAgB;EACd,MAAM,UAAU,WAAW;EAC3B,MAAM,eAAe,UAAsB;GACzC,MAAM,KAAK,MAAM;AAIjB,OAFkB,CADA,IAAI,UAAU,mBAAmB,SAAS,GAAG,IAAI,IACnC,CAAC,SAAS,SAAS,GAAW,CAG5D,WAAU,MAAM;;EAIpB,MAAM,iBAAiB,UAAyB;AAC9C,OAAI,MAAM,QAAQ,YAAY,CAAC,OAAQ;AACvC,SAAM,gBAAgB;AACtB,aAAU,MAAM;;AAGlB,WAAS,iBAAiB,SAAS,aAAa,KAAK;AACrD,WAAS,iBAAiB,WAAW,cAAc;AACnD,eAAa;AACX,YAAS,oBAAoB,SAAS,aAAa,KAAK;AACxD,YAAS,oBAAoB,WAAW,cAAc;;IAEvD,CAAC,QAAQ,UAAU,CAAC;AAEvB,iBAAgB;EACd,MAAM,UAAU,WAAW;EAC3B,MAAM,UAAU,SAAS,cAAc,mBAAmB,SAAS,GAAG,IAAI;AAE1E,MAAI,WAAW,WAAW,OACxB,QAAO,WAAW,SAAS,eAAe;AACxC,mBAAgB,SAAS,SAAS;IAChC,YAAY;KACV,OAAO,QAAQ;KACf,GAAI,uBAAuB,EAAE,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;KACvE,GAAG;KACH,KAAK;MAAE;MAAS,UAAU;MAAW,CAAC;KACvC;IACD,UAAU;IACV;IACD,CAAC,CAAC,MAAM,EAAE,GAAG,GAAG,qBAAqB;AACpC,YAAQ,MAAM,YAAY,GAAG,EAAE,KAAK,EAAE;AACtC,YAAQ,MAAM,aAAa,eAAe,MAAM,kBAAkB,WAAW;KAC7E;IACF;IACH;EAAC;EAAQ;EAAW;EAAI;EAAsB;EAAoB;EAAQ,CAAC;AAG9E,iBAAgB;AACd,MAAI,GAAI,gBAAe,GAAG;IACzB,CAAC,IAAI,aAAa,CAAC;AAEtB,QACE,oBAAC;EACC,WAAWA,KAAG,cAAc,UAAU;EACtC,IAAI,MAAM;EACV,eAAa,CAAC;EACd,aAAW;EACX,KAAK;EACL,GAAI;GACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from "./button-
|
|
1
|
+
import { Button } from "./button-BzU7DrNe.js";
|
|
2
2
|
import { Context } from "./popover-trigger-context-Cre9Mczn.js";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -43,4 +43,4 @@ const PopoverTrigger = ({ id, inline, asChild, ref,...rest }) => {
|
|
|
43
43
|
|
|
44
44
|
//#endregion
|
|
45
45
|
export { PopoverTrigger };
|
|
46
|
-
//# sourceMappingURL=popover-trigger-
|
|
46
|
+
//# sourceMappingURL=popover-trigger-BoB6rkG4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-trigger-
|
|
1
|
+
{"version":3,"file":"popover-trigger-BoB6rkG4.js","names":[],"sources":["../src/components/popover/popover-trigger.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { type HTMLAttributes, Ref, use } from 'react';\nimport type { DefaultProps } from '../../types';\nimport { Button, type ButtonProps } from '../button';\nimport { Context } from './popover-trigger-context';\n\nexport type PopoverTriggerProps =\n | ({\n /**\n * Will render the trigger as inline text.\n * @default false\n */\n inline?: true;\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n ref?: Ref<HTMLButtonElement>;\n } & HTMLAttributes<HTMLButtonElement> &\n DefaultProps)\n | ({\n /**\n * Will not render the trigger as inline text.\n * @default false\n */\n inline?: false;\n } & ButtonProps);\n\n/**\n * PopoverTrigger component, used to trigger a popover.\n *\n * @example\n * <PopoverTriggerContext>\n * <PopoverTrigger>Open Popover</PopoverTrigger>\n * <Popover>\n * Content\n * </Popover>\n * </PopoverTriggerContext>\n *\n * @example inline\n * <PopoverTriggerContext>\n * <Paragraph>\n * We can use it <PopoverTrigger inline={true}>inline</PopoverTrigger>.\n * </Paragraph>\n * <Popover>\n * Content\n * </Popover>\n * </PopoverTriggerContext>\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const PopoverTrigger = ({ id, inline, asChild, ref, ...rest }: PopoverTriggerProps) => {\n const { popoverId, popoverOpen, setPopoverOpen } = use(Context);\n const Component = asChild ? Slot : inline ? 'button' : Button;\n\n const popoverProps = Object.assign(\n {\n onClick: () => setPopoverOpen?.((prev) => !prev),\n 'aria-controls': popoverId,\n 'aria-expanded': popoverOpen,\n ...(inline\n ? {\n 'data-popover': 'inline',\n }\n : {}),\n },\n rest,\n );\n\n return <Component ref={ref} {...popoverProps} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa,kBAAkB,EAAE,IAAI,QAAQ,SAAS,IAAK,GAAG,WAAgC;CAC5F,MAAM,EAAE,WAAW,aAAa,mBAAmB,IAAI,QAAQ;CAC/D,MAAM,YAAY,UAAU,OAAO,SAAS,WAAW;CAEvD,MAAM,eAAe,OAAO,OAC1B;EACE,eAAe,kBAAkB,SAAS,CAAC,KAAK;EAChD,iBAAiB;EACjB,iBAAiB;EACjB,GAAI,SACA,EACE,gBAAgB,UACjB,GACD,EAAE;EACP,EACD,KACD;AAED,QAAO,oBAAC;EAAe;EAAK,GAAI;GAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-trigger-context-Cre9Mczn.js","names":[],"sources":["../src/components/popover/popover-trigger-context.tsx"],"sourcesContent":["import { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { createContext, useId, useState } from 'react';\nimport type { ReactNode } from 'react';\n\nexport const Context = createContext<{\n popoverId?: string;\n setPopoverId?: (id: string) => void;\n popoverOpen?: boolean;\n setPopoverOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n}>({});\n\nexport type PopoverTriggerContextProps = {\n children: ReactNode;\n /**\n * When a boolean is provided, the popover will be controlled.\n * @default undefined\n */\n open?: boolean;\n /**\n * Callback when the open state changes.\n * @param open - The new open state of the popover.\n */\n onOpenChange?: (open: boolean) => void;\n};\n\n/**\n * PopoverTriggerContext component, use to wrap a PopoverTrigger and Popover.\n *\n * @example\n * <PopoverTriggerContext>\n * <PopoverTrigger>Open Popover</PopoverTrigger>\n * <Popover>\n * Content\n * </Popover>\n * </PopoverTriggerContext>\n */\nexport const PopoverTriggerContext = ({ children, open, onOpenChange }: PopoverTriggerContextProps) => {\n const randomPopoverId = useId();\n const [popoverId, setPopoverId] = useState(randomPopoverId);\n const [popoverOpen, setPopoverOpen] = useControllableState({\n prop: open,\n onChange: onOpenChange,\n defaultProp: false,\n caller: 'PopoverTriggerContext',\n });\n\n return <Context value={{ popoverId, setPopoverId, popoverOpen, setPopoverOpen }}>{children}</Context>;\n};\n"],"mappings":";;;;;AAIA,MAAa,UAAU,cAKpB,
|
|
1
|
+
{"version":3,"file":"popover-trigger-context-Cre9Mczn.js","names":[],"sources":["../src/components/popover/popover-trigger-context.tsx"],"sourcesContent":["import { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { createContext, useId, useState } from 'react';\nimport type { ReactNode } from 'react';\n\nexport const Context = createContext<{\n popoverId?: string;\n setPopoverId?: (id: string) => void;\n popoverOpen?: boolean;\n setPopoverOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n}>({});\n\nexport type PopoverTriggerContextProps = {\n children: ReactNode;\n /**\n * When a boolean is provided, the popover will be controlled.\n * @default undefined\n */\n open?: boolean;\n /**\n * Callback when the open state changes.\n * @param open - The new open state of the popover.\n */\n onOpenChange?: (open: boolean) => void;\n};\n\n/**\n * PopoverTriggerContext component, use to wrap a PopoverTrigger and Popover.\n *\n * @example\n * <PopoverTriggerContext>\n * <PopoverTrigger>Open Popover</PopoverTrigger>\n * <Popover>\n * Content\n * </Popover>\n * </PopoverTriggerContext>\n */\nexport const PopoverTriggerContext = ({ children, open, onOpenChange }: PopoverTriggerContextProps) => {\n const randomPopoverId = useId();\n const [popoverId, setPopoverId] = useState(randomPopoverId);\n const [popoverOpen, setPopoverOpen] = useControllableState({\n prop: open,\n onChange: onOpenChange,\n defaultProp: false,\n caller: 'PopoverTriggerContext',\n });\n\n return <Context value={{ popoverId, setPopoverId, popoverOpen, setPopoverOpen }}>{children}</Context>;\n};\n"],"mappings":";;;;;AAIA,MAAa,UAAU,cAKpB,EAAE,CAAC;;;;;;;;;;;;AA2BN,MAAa,yBAAyB,EAAE,UAAU,MAAM,mBAA+C;CACrG,MAAM,kBAAkB,OAAO;CAC/B,MAAM,CAAC,WAAW,gBAAgB,SAAS,gBAAgB;CAC3D,MAAM,CAAC,aAAa,kBAAkB,qBAAqB;EACzD,MAAM;EACN,UAAU;EACV,aAAa;EACb,QAAQ;EACT,CAAC;AAEF,QAAO,oBAAC;EAAQ,OAAO;GAAE;GAAW;GAAc;GAAa;GAAgB;EAAG;GAAmB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Field } from "./field-
|
|
2
|
-
import { FieldDescription } from "./field-description-
|
|
1
|
+
import { Field } from "./field-Dul9LBgF.js";
|
|
2
|
+
import { FieldDescription } from "./field-description-Yya33j8H.js";
|
|
3
3
|
import { Input } from "./input-Dr7BnTyd.js";
|
|
4
|
-
import { Label } from "./label-
|
|
4
|
+
import { Label } from "./label-DG_ojO9g.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { useId } from "react";
|
|
7
7
|
|
|
@@ -42,4 +42,4 @@ const Radio = ({ dark, label, description, error, fullwidth, style, className, r
|
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
44
|
export { Radio };
|
|
45
|
-
//# sourceMappingURL=radio-
|
|
45
|
+
//# sourceMappingURL=radio-CDZoe1OO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-
|
|
1
|
+
{"version":3,"file":"radio-CDZoe1OO.js","names":[],"sources":["../src/components/radio/radio.tsx"],"sourcesContent":["import { useId, type ReactNode, type Ref } from 'react';\n\nimport type { LabelRequiredProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\nimport { Field, FieldDescription } from '../field';\nimport { Input, type InputProps } from '../input';\nimport { Label } from '../label';\n\nexport type RadioProps = MergeRight<\n LabelRequiredProps & Omit<InputProps, 'type' | 'role' | 'size'>,\n {\n /** Label */\n label?: ReactNode;\n /** Description */\n description?: ReactNode;\n /** Add error indication to the radio. */\n error?: boolean;\n /** If true, the radio will take up the full width of the container, and not just \"fit-content\" which is default */\n fullwidth?: boolean;\n ref?: Ref<HTMLInputElement>;\n }\n>;\n\nexport const Radio = ({\n dark,\n label,\n description,\n error,\n fullwidth,\n style,\n className,\n ref,\n id,\n 'aria-describedby': ariaDescribedByProp,\n ...props\n}: RadioProps) => {\n const descriptionId = useId();\n\n const ariaDescribedBy = [description ? descriptionId : '', ariaDescribedByProp].join(' ').trim() || undefined;\n\n return (\n <Field className={className} data-dark={dark} style={style} fullwidth={fullwidth} asChild>\n <label>\n <Input\n type='radio'\n id={id}\n ref={ref}\n aria-invalid={error || undefined}\n aria-describedby={ariaDescribedBy}\n dark={dark}\n {...props}\n />\n {label && (\n <Label weight='medium' htmlFor={id} asChild>\n <span>{label}</span>\n </Label>\n )}\n {description && (\n // Aria-hidden is used to prevent screen readers from reading the description twice:\n // once as part of the label and once from being connected through aria-describedby.\n <FieldDescription aria-hidden='true' id={descriptionId}>\n {description}\n </FieldDescription>\n )}\n </label>\n </Field>\n );\n};\n"],"mappings":";;;;;;;;AAuBA,MAAa,SAAS,EACpB,MACA,OACA,aACA,OACA,WACA,OACA,WACA,KACA,IACA,oBAAoB,oBACpB,GAAG,YACa;CAChB,MAAM,gBAAgB,OAAO;CAE7B,MAAM,kBAAkB,CAAC,cAAc,gBAAgB,IAAI,oBAAoB,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI;AAEpG,QACE,oBAAC;EAAiB;EAAW,aAAW;EAAa;EAAkB;EAAW;YAChF,qBAAC;GACC,oBAAC;IACC,MAAK;IACD;IACC;IACL,gBAAc,SAAS;IACvB,oBAAkB;IACZ;IACN,GAAI;KACJ;GACD,SACC,oBAAC;IAAM,QAAO;IAAS,SAAS;IAAI;cAClC,oBAAC,oBAAM,QAAa;KACd;GAET,eAGC,oBAAC;IAAiB,eAAY;IAAO,IAAI;cACtC;KACgB;MAEf;GACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Button } from "./button-
|
|
2
|
-
import { Field } from "./field-
|
|
3
|
-
import { FieldAffix, FieldAffixes } from "./field-affix-
|
|
1
|
+
import { Button } from "./button-BzU7DrNe.js";
|
|
2
|
+
import { Field } from "./field-Dul9LBgF.js";
|
|
3
|
+
import { FieldAffix, FieldAffixes } from "./field-affix-C5w3NK4H.js";
|
|
4
4
|
import { Input } from "./input-Dr7BnTyd.js";
|
|
5
5
|
import clsx from "clsx/lite";
|
|
6
6
|
import { CrossSmallIcon, MagnefyingGlassIcon } from "@bi-digital/icons";
|
|
@@ -58,4 +58,4 @@ const Search = ({ className, onSubmit, onReset, clearAriaLabel = "Clear", size =
|
|
|
58
58
|
|
|
59
59
|
//#endregion
|
|
60
60
|
export { Search };
|
|
61
|
-
//# sourceMappingURL=search-
|
|
61
|
+
//# sourceMappingURL=search-CmU2iA48.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-CmU2iA48.js","names":[],"sources":["../src/components/search/search.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport { Field, FieldAffixes, FieldAffix } from '../field';\nimport { Input, type InputProps } from '../input';\nimport { CrossSmallIcon, MagnefyingGlassIcon } from '@bi-digital/icons';\nimport type { MergeRight } from '../../utilities';\nimport { Button } from '../button';\n\nexport type SearchProps = MergeRight<\n Omit<InputProps, 'type' | 'size'>,\n {\n /**\n * Size of the search.\n * @default 'medium'\n */\n size?: 'medium' | 'large';\n /** Called when the user presses enter. You can use this to for example navigate on submit. */\n onSubmit?: (value: string) => void;\n /** Called when the user resets the search input. */\n onReset?: (value: string) => void;\n /**\n * Aria-label for the clear button.\n * @defaultValue 'Clear'\n */\n clearAriaLabel?: string;\n /** If true, the selectfield will take up the full available width */\n fullwidth?: boolean;\n }\n>;\n\nexport const Search = ({\n className,\n onSubmit,\n onReset,\n clearAriaLabel = 'Clear',\n size = 'medium',\n ref,\n dark,\n style,\n fullwidth,\n ...props\n}: SearchProps) => {\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n if (onSubmit) {\n const input = e.currentTarget.querySelector('input');\n onSubmit(input?.value || '');\n }\n };\n const handleReset = () => {\n if (onReset) {\n onReset('');\n }\n };\n return (\n <Field className={clsx('bi-search', className)} data-dark={dark} style={style} fullwidth={fullwidth} asChild>\n <form onSubmit={handleSubmit} onReset={handleReset}>\n <FieldAffixes>\n <FieldAffix>\n <MagnefyingGlassIcon size={size} />\n </FieldAffix>\n <Input type='text' ref={ref} size={size} dark={dark} {...props} />\n <FieldAffix aria-hidden='false'>\n <Button aria-label={clearAriaLabel} icon size={size} dark={dark} variant='text' type='reset'>\n <CrossSmallIcon size={size} aria-hidden='true' />\n </Button>\n </FieldAffix>\n </FieldAffixes>\n </form>\n </Field>\n );\n};\n"],"mappings":";;;;;;;;;AA6BA,MAAa,UAAU,EACrB,WACA,UACA,SACA,iBAAiB,SACjB,OAAO,UACP,KACA,MACA,OACA,UACA,GAAG,YACc;CACjB,MAAM,gBAAgB,MAAwC;AAC5D,IAAE,gBAAgB;AAClB,MAAI,UAAU;GACZ,MAAM,QAAQ,EAAE,cAAc,cAAc,QAAQ;AACpD,YAAS,OAAO,SAAS,GAAG;;;CAGhC,MAAM,oBAAoB;AACxB,MAAI,QACF,SAAQ,GAAG;;AAGf,QACE,oBAAC;EAAM,WAAW,KAAK,aAAa,UAAU;EAAE,aAAW;EAAa;EAAkB;EAAW;YACnG,oBAAC;GAAK,UAAU;GAAc,SAAS;aACrC,qBAAC;IACC,oBAAC,wBACC,oBAAC,uBAA0B,OAAQ,GACxB;IACb,oBAAC;KAAM,MAAK;KAAY;KAAW;KAAY;KAAM,GAAI;MAAS;IAClE,oBAAC;KAAW,eAAY;eACtB,oBAAC;MAAO,cAAY;MAAgB;MAAW;MAAY;MAAM,SAAQ;MAAO,MAAK;gBACnF,oBAAC;OAAqB;OAAM,eAAY;QAAS;OAC1C;MACE;OACA;IACV;GACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-R87VdG5U.js","names":[],"sources":["../src/components/select/select.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport type { Ref, SelectHTMLAttributes } from 'react';\nimport type { MergeRight } from '../../utilities';\nimport type { DefaultProps } from '../../types';\n\nexport type SelectProps = MergeRight<\n DefaultProps & Omit<SelectHTMLAttributes<HTMLSelectElement>, 'multiple' | 'size'>,\n {\n /**\n * Size of the select.\n * @default 'medium'\n */\n size?: 'medium' | 'large';\n /** Mark the select as readOnly */\n readOnly?: boolean;\n ref?: Ref<HTMLSelectElement>;\n }\n>;\n\nexport const Select = ({ className, dark, onKeyDown, onMouseDown, size, ref, ...props }: SelectProps) => {\n return (\n <select\n className={clsx('bi-input', className)}\n data-dark={dark}\n data-size={size}\n ref={ref}\n onKeyDown={(event) => {\n if (event.key === 'Tab') return;\n if (props.readOnly) event.preventDefault(); // Make readOnly work for select\n onKeyDown?.(event);\n }}\n onMouseDown={(event) => {\n if (props.readOnly) event.preventDefault(); // Make readOnly work for select\n onMouseDown?.(event);\n }}\n {...props}\n />\n );\n};\n"],"mappings":";;;;AAmBA,MAAa,
|
|
1
|
+
{"version":3,"file":"select-R87VdG5U.js","names":[],"sources":["../src/components/select/select.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport type { Ref, SelectHTMLAttributes } from 'react';\nimport type { MergeRight } from '../../utilities';\nimport type { DefaultProps } from '../../types';\n\nexport type SelectProps = MergeRight<\n DefaultProps & Omit<SelectHTMLAttributes<HTMLSelectElement>, 'multiple' | 'size'>,\n {\n /**\n * Size of the select.\n * @default 'medium'\n */\n size?: 'medium' | 'large';\n /** Mark the select as readOnly */\n readOnly?: boolean;\n ref?: Ref<HTMLSelectElement>;\n }\n>;\n\nexport const Select = ({ className, dark, onKeyDown, onMouseDown, size, ref, ...props }: SelectProps) => {\n return (\n <select\n className={clsx('bi-input', className)}\n data-dark={dark}\n data-size={size}\n ref={ref}\n onKeyDown={(event) => {\n if (event.key === 'Tab') return;\n if (props.readOnly) event.preventDefault(); // Make readOnly work for select\n onKeyDown?.(event);\n }}\n onMouseDown={(event) => {\n if (props.readOnly) event.preventDefault(); // Make readOnly work for select\n onMouseDown?.(event);\n }}\n {...props}\n />\n );\n};\n"],"mappings":";;;;AAmBA,MAAa,UAAU,EAAE,WAAW,MAAM,WAAW,aAAa,MAAM,IAAK,GAAG,YAAyB;AACvG,QACE,oBAAC;EACC,WAAW,KAAK,YAAY,UAAU;EACtC,aAAW;EACX,aAAW;EACN;EACL,YAAY,UAAU;AACpB,OAAI,MAAM,QAAQ,MAAO;AACzB,OAAI,MAAM,SAAU,OAAM,gBAAgB;AAC1C,eAAY,MAAM;;EAEpB,cAAc,UAAU;AACtB,OAAI,MAAM,SAAU,OAAM,gBAAgB;AAC1C,iBAAc,MAAM;;EAEtB,GAAI;GACJ"}
|
|
@@ -3,8 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
//#region src/components/select/select-optgroup.tsx
|
|
5
5
|
const SelectOptgroup = ({ asChild, ref,...props }) => {
|
|
6
|
-
|
|
7
|
-
return /* @__PURE__ */ jsx(Component, {
|
|
6
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "optgroup", {
|
|
8
7
|
...props,
|
|
9
8
|
ref
|
|
10
9
|
});
|
|
@@ -12,4 +11,4 @@ const SelectOptgroup = ({ asChild, ref,...props }) => {
|
|
|
12
11
|
|
|
13
12
|
//#endregion
|
|
14
13
|
export { SelectOptgroup };
|
|
15
|
-
//# sourceMappingURL=select-optgroup-
|
|
14
|
+
//# sourceMappingURL=select-optgroup-DTnIUQEq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-optgroup-
|
|
1
|
+
{"version":3,"file":"select-optgroup-DTnIUQEq.js","names":[],"sources":["../src/components/select/select-optgroup.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport type { OptgroupHTMLAttributes, Ref } from 'react';\nimport type { MergeRight } from '../../utilities';\nimport type { AsChildProps } from '../../types';\n\nexport type SelectOptgroupProps = MergeRight<\n AsChildProps & OptgroupHTMLAttributes<HTMLOptGroupElement>,\n {\n ref?: Ref<HTMLOptGroupElement>;\n }\n>;\n\nexport const SelectOptgroup = ({ asChild, ref, ...props }: SelectOptgroupProps) => {\n const Component = asChild ? Slot : 'optgroup';\n return <Component {...props} ref={ref} />;\n};\n"],"mappings":";;;;AAYA,MAAa,kBAAkB,EAAE,SAAS,IAAK,GAAG,YAAiC;AAEjF,QAAO,oBADW,UAAU,OAAO;EACjB,GAAI;EAAY;GAAO"}
|
|
@@ -3,8 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
//#region src/components/select/select-option.tsx
|
|
5
5
|
const SelectOption = ({ asChild, ref,...props }) => {
|
|
6
|
-
|
|
7
|
-
return /* @__PURE__ */ jsx(Component, {
|
|
6
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "option", {
|
|
8
7
|
...props,
|
|
9
8
|
ref
|
|
10
9
|
});
|
|
@@ -12,4 +11,4 @@ const SelectOption = ({ asChild, ref,...props }) => {
|
|
|
12
11
|
|
|
13
12
|
//#endregion
|
|
14
13
|
export { SelectOption };
|
|
15
|
-
//# sourceMappingURL=select-option-
|
|
14
|
+
//# sourceMappingURL=select-option-BFmgqY3h.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-option-
|
|
1
|
+
{"version":3,"file":"select-option-BFmgqY3h.js","names":[],"sources":["../src/components/select/select-option.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport type { OptionHTMLAttributes, Ref } from 'react';\nimport type { MergeRight } from '../../utilities';\nimport type { AsChildProps } from '../../types';\n\nexport type SelectOptionProps = MergeRight<\n AsChildProps & OptionHTMLAttributes<HTMLOptionElement>,\n {\n ref?: Ref<HTMLOptionElement>;\n }\n>;\n\nexport const SelectOption = ({ asChild, ref, ...props }: SelectOptionProps) => {\n const Component = asChild ? Slot : 'option';\n return <Component {...props} ref={ref} />;\n};\n"],"mappings":";;;;AAYA,MAAa,gBAAgB,EAAE,SAAS,IAAK,GAAG,YAA+B;AAE7E,QAAO,oBADW,UAAU,OAAO;EACjB,GAAI;EAAY;GAAO"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Field } from "./field-
|
|
2
|
-
import { FieldDescription } from "./field-description-
|
|
3
|
-
import { Label } from "./label-
|
|
1
|
+
import { Field } from "./field-Dul9LBgF.js";
|
|
2
|
+
import { FieldDescription } from "./field-description-Yya33j8H.js";
|
|
3
|
+
import { Label } from "./label-DG_ojO9g.js";
|
|
4
4
|
import { Select } from "./select-R87VdG5U.js";
|
|
5
|
-
import { ValidationMessage } from "./validation-message-
|
|
5
|
+
import { ValidationMessage } from "./validation-message-J5bvdg8v.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useId } from "react";
|
|
8
8
|
|
|
@@ -50,4 +50,4 @@ const Selectfield = ({ children, dark, label, description, error, style, classNa
|
|
|
50
50
|
|
|
51
51
|
//#endregion
|
|
52
52
|
export { Selectfield };
|
|
53
|
-
//# sourceMappingURL=selectfield-
|
|
53
|
+
//# sourceMappingURL=selectfield-CZ37jU-y.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectfield-
|
|
1
|
+
{"version":3,"file":"selectfield-CZ37jU-y.js","names":[],"sources":["../src/components/selectfield/selectfield.tsx"],"sourcesContent":["import { useId, type ReactNode } from 'react';\n\nimport type { LabelRequiredProps } from '../../types';\nimport { Field, FieldDescription } from '../field';\nimport { Label } from '../label';\nimport { Select, type SelectProps } from '../select';\nimport { ValidationMessage } from '../validation-message';\nimport { MergeRight } from '../../utilities';\n\nexport type SelectfieldProps = MergeRight<\n LabelRequiredProps & SelectProps,\n {\n /** Description */\n description?: ReactNode;\n /** Error message for field */\n error?: ReactNode;\n /** If true, the selectfield will take up the full available width */\n fullwidth?: boolean;\n }\n>;\n\nexport const Selectfield = ({\n children,\n dark,\n label,\n description,\n error,\n style,\n className,\n fullwidth,\n ref,\n id: idProp,\n 'aria-describedby': ariaDescribedByProp,\n ...props\n}: SelectfieldProps) => {\n const generatedId = useId();\n const descriptionId = useId();\n const validationId = useId();\n const id = idProp || generatedId;\n\n const ariaDescribedBy =\n [description ? descriptionId : '', error ? validationId : '', ariaDescribedByProp].join(' ').trim() || undefined;\n return (\n <Field className={className} data-dark={dark} style={style} fullwidth={fullwidth}>\n {label && <Label htmlFor={id}>{label}</Label>}\n {description && <FieldDescription id={descriptionId}>{description}</FieldDescription>}\n <Select\n id={id}\n ref={ref}\n dark={dark}\n aria-invalid={Boolean(error) || undefined}\n aria-describedby={ariaDescribedBy}\n {...props}\n >\n {children}\n </Select>\n {!!error && <ValidationMessage id={validationId}>{error}</ValidationMessage>}\n </Field>\n );\n};\n"],"mappings":";;;;;;;;;AAqBA,MAAa,eAAe,EAC1B,UACA,MACA,OACA,aACA,OACA,OACA,WACA,WACA,KACA,IAAI,QACJ,oBAAoB,oBACpB,GAAG,YACmB;CACtB,MAAM,cAAc,OAAO;CAC3B,MAAM,gBAAgB,OAAO;CAC7B,MAAM,eAAe,OAAO;CAC5B,MAAM,KAAK,UAAU;CAErB,MAAM,kBACJ;EAAC,cAAc,gBAAgB;EAAI,QAAQ,eAAe;EAAI;EAAoB,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI;AACzG,QACE,qBAAC;EAAiB;EAAW,aAAW;EAAa;EAAkB;;GACpE,SAAS,oBAAC;IAAM,SAAS;cAAK;KAAc;GAC5C,eAAe,oBAAC;IAAiB,IAAI;cAAgB;KAA+B;GACrF,oBAAC;IACK;IACC;IACC;IACN,gBAAc,QAAQ,MAAM,IAAI;IAChC,oBAAkB;IAClB,GAAI;IAEH;KACM;GACR,CAAC,CAAC,SAAS,oBAAC;IAAkB,IAAI;cAAe;KAA0B;;GACtE"}
|
|
@@ -4,8 +4,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/skip-link/skip-link.tsx
|
|
6
6
|
const SkipLink = ({ asChild, children, className, dark,...props }) => {
|
|
7
|
-
|
|
8
|
-
return /* @__PURE__ */ jsx(Component, {
|
|
7
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "a", {
|
|
9
8
|
className: clsx("bi-skip-link", className),
|
|
10
9
|
"data-dark": dark,
|
|
11
10
|
...props,
|
|
@@ -15,4 +14,4 @@ const SkipLink = ({ asChild, children, className, dark,...props }) => {
|
|
|
15
14
|
|
|
16
15
|
//#endregion
|
|
17
16
|
export { SkipLink };
|
|
18
|
-
//# sourceMappingURL=skip-link-
|
|
17
|
+
//# sourceMappingURL=skip-link-iWhLptx_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-link-
|
|
1
|
+
{"version":3,"file":"skip-link-iWhLptx_.js","names":[],"sources":["../src/components/skip-link/skip-link.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport { Slot } from '@radix-ui/react-slot';\nimport type { MergeRight } from '../../utilities';\nimport type { AsChildProps, DefaultProps } from '../../types';\nimport type { AnchorHTMLAttributes, Ref } from 'react';\n\nexport type SkipLinkProps = MergeRight<\n DefaultProps & AsChildProps & AnchorHTMLAttributes<HTMLAnchorElement>,\n {\n ref?: Ref<HTMLAnchorElement>;\n }\n>;\n\nexport const SkipLink = ({ asChild, children, className, dark, ...props }: SkipLinkProps) => {\n const Component = asChild ? Slot : 'a';\n return (\n <Component className={clsx('bi-skip-link', className)} data-dark={dark} {...props}>\n {children}\n </Component>\n );\n};\n"],"mappings":";;;;;AAaA,MAAa,YAAY,EAAE,SAAS,UAAU,WAAW,KAAM,GAAG,YAA2B;AAE3F,QACE,oBAFgB,UAAU,OAAO;EAEtB,WAAW,KAAK,gBAAgB,UAAU;EAAE,aAAW;EAAM,GAAI;EACzE;GACS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner-Ch5bEQBR.js","names":[],"sources":["../src/components/spinner/spinner.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport type { HTMLAttributes, Ref } from 'react';\nimport type { MergeRight } from '../../utilities';\nimport type { DefaultProps } from '../../types';\n\nexport type SpinnerProps = MergeRight<\n DefaultProps & HTMLAttributes<HTMLSpanElement>,\n {\n /**\n * The color of the spinner.\n * @default 'inherit'\n */\n color?: 'inherit' | 'black';\n /**\n * The size of the spinner.\n * It sets the font-size as the width and height is `1em`. If not set, the spinner will inherit the font size of its parent.\n */\n size?: 'small' | 'medium' | 'large' | 'xl' | '2xl';\n ref?: Ref<HTMLSpanElement>;\n }\n>;\n\nexport const Spinner = ({ color = 'inherit', size, className, ref, ...props }: SpinnerProps) => {\n return <span className={clsx('bi-spinner', className)} data-size={size} data-color={color} ref={ref} {...props} />;\n};\n"],"mappings":";;;;AAsBA,MAAa,
|
|
1
|
+
{"version":3,"file":"spinner-Ch5bEQBR.js","names":[],"sources":["../src/components/spinner/spinner.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport type { HTMLAttributes, Ref } from 'react';\nimport type { MergeRight } from '../../utilities';\nimport type { DefaultProps } from '../../types';\n\nexport type SpinnerProps = MergeRight<\n DefaultProps & HTMLAttributes<HTMLSpanElement>,\n {\n /**\n * The color of the spinner.\n * @default 'inherit'\n */\n color?: 'inherit' | 'black';\n /**\n * The size of the spinner.\n * It sets the font-size as the width and height is `1em`. If not set, the spinner will inherit the font size of its parent.\n */\n size?: 'small' | 'medium' | 'large' | 'xl' | '2xl';\n ref?: Ref<HTMLSpanElement>;\n }\n>;\n\nexport const Spinner = ({ color = 'inherit', size, className, ref, ...props }: SpinnerProps) => {\n return <span className={clsx('bi-spinner', className)} data-size={size} data-color={color} ref={ref} {...props} />;\n};\n"],"mappings":";;;;AAsBA,MAAa,WAAW,EAAE,QAAQ,WAAW,MAAM,WAAW,IAAK,GAAG,YAA0B;AAC9F,QAAO,oBAAC;EAAK,WAAW,KAAK,cAAc,UAAU;EAAE,aAAW;EAAM,cAAY;EAAY;EAAK,GAAI;GAAS"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime64 from "react/jsx-runtime";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/sticky-header/sticky-header.d.ts
|
|
@@ -13,7 +13,7 @@ type StickyHeaderProps = {
|
|
|
13
13
|
*/
|
|
14
14
|
declare const StickyHeader: ({
|
|
15
15
|
children
|
|
16
|
-
}: StickyHeaderProps) =>
|
|
16
|
+
}: StickyHeaderProps) => react_jsx_runtime64.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { StickyHeader, StickyHeaderProps };
|
|
19
|
-
//# sourceMappingURL=sticky-header-
|
|
19
|
+
//# sourceMappingURL=sticky-header-BMeHtK7e.d.ts.map
|
|
@@ -9,8 +9,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
9
9
|
* Make sure that the children passed to this component appends className and not overrides it.
|
|
10
10
|
*/
|
|
11
11
|
const StickyHeader = ({ children }) => {
|
|
12
|
-
|
|
13
|
-
return /* @__PURE__ */ jsx(Component, {
|
|
12
|
+
return /* @__PURE__ */ jsx(Slot, {
|
|
14
13
|
className: "bi-sticky-header",
|
|
15
14
|
children
|
|
16
15
|
});
|
|
@@ -18,4 +17,4 @@ const StickyHeader = ({ children }) => {
|
|
|
18
17
|
|
|
19
18
|
//#endregion
|
|
20
19
|
export { StickyHeader };
|
|
21
|
-
//# sourceMappingURL=sticky-header-
|
|
20
|
+
//# sourceMappingURL=sticky-header-DOQD4Wye.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-header-
|
|
1
|
+
{"version":3,"file":"sticky-header-DOQD4Wye.js","names":[],"sources":["../src/components/sticky-header/sticky-header.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport type { ReactNode } from 'react';\n\nexport type StickyHeaderProps = {\n children: ReactNode;\n};\n\n/**\n * Make a sticky header that will stay at the top of the viewport when scrolling.\n * It handles different distance to the top based on sub-navbar, navbar and other factors.\n * This element is a Slot which simply adds the correct CSS styles to the children.\n * Make sure that the children passed to this component appends className and not overrides it.\n */\nexport const StickyHeader = ({ children }: StickyHeaderProps) => {\n const Component = Slot;\n return <Component className='bi-sticky-header'>{children}</Component>;\n};\n"],"mappings":";;;;;;;;;;AAaA,MAAa,gBAAgB,EAAE,eAAkC;AAE/D,QAAO,oBADW;EACA,WAAU;EAAoB;GAAqB"}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* exceeds a 5px threshold to prevent sensitivity to minor scroll jitter.
|
|
6
6
|
*/
|
|
7
7
|
var ScrollDirectionTracker = class {
|
|
8
|
-
scrollDirection = null;
|
|
9
|
-
lastScrollY = window.pageYOffset;
|
|
10
|
-
callbacks = /* @__PURE__ */ new Set();
|
|
11
8
|
constructor() {
|
|
9
|
+
this.scrollDirection = null;
|
|
10
|
+
this.lastScrollY = window.pageYOffset;
|
|
11
|
+
this.callbacks = /* @__PURE__ */ new Set();
|
|
12
12
|
this.updateScrollDirection = this.updateScrollDirection.bind(this);
|
|
13
13
|
window.addEventListener("scroll", this.updateScrollDirection);
|
|
14
14
|
}
|
|
@@ -37,11 +37,10 @@ var ScrollDirectionTracker = class {
|
|
|
37
37
|
* Detects when an element is scrolled past and is no longer in the viewport.
|
|
38
38
|
*/
|
|
39
39
|
var ElementAboveViewportTracker = class {
|
|
40
|
-
isAboveViewport = false;
|
|
41
|
-
observer;
|
|
42
|
-
callbacks = /* @__PURE__ */ new Set();
|
|
43
40
|
constructor(element) {
|
|
44
41
|
this.element = element;
|
|
42
|
+
this.isAboveViewport = false;
|
|
43
|
+
this.callbacks = /* @__PURE__ */ new Set();
|
|
45
44
|
this.observer = new IntersectionObserver(([entry]) => {
|
|
46
45
|
const newIsAbove = entry.boundingClientRect.y < 0;
|
|
47
46
|
if (newIsAbove !== this.isAboveViewport) {
|
|
@@ -100,8 +99,7 @@ const initSubNavbar = ({ selector = ".bi-sub-navbar" } = {}) => {
|
|
|
100
99
|
} else navbar.removeAttribute("data-scroll-dir");
|
|
101
100
|
});
|
|
102
101
|
const unsubscribeScroll = scrollTracker.subscribe((direction) => {
|
|
103
|
-
|
|
104
|
-
if (isFixed && direction) navbar.setAttribute("data-scroll-dir", direction);
|
|
102
|
+
if (navbar.getAttribute("data-fixed") === "true" && direction) navbar.setAttribute("data-scroll-dir", direction);
|
|
105
103
|
});
|
|
106
104
|
cleanupFunctions.push(() => {
|
|
107
105
|
unsubscribeViewport();
|
|
@@ -117,4 +115,4 @@ const initSubNavbar = ({ selector = ".bi-sub-navbar" } = {}) => {
|
|
|
117
115
|
|
|
118
116
|
//#endregion
|
|
119
117
|
export { initSubNavbar };
|
|
120
|
-
//# sourceMappingURL=sub-navbar-
|
|
118
|
+
//# sourceMappingURL=sub-navbar-DTTytyEQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-navbar-DTTytyEQ.js","names":["element: HTMLElement","cleanupFunctions: (() => void)[]"],"sources":["../src/vanilla/sub-navbar/index.ts"],"sourcesContent":["/**\n * Detects the vertical scroll direction of the page.\n * Returns 'up' | 'down' | null. The direction is only updated if the scroll distance\n * exceeds a 5px threshold to prevent sensitivity to minor scroll jitter.\n */\nclass ScrollDirectionTracker {\n private scrollDirection: 'up' | 'down' | null = null;\n private lastScrollY = window.pageYOffset;\n private callbacks = new Set<(direction: 'up' | 'down' | null) => void>();\n\n constructor() {\n this.updateScrollDirection = this.updateScrollDirection.bind(this);\n window.addEventListener('scroll', this.updateScrollDirection);\n }\n\n private updateScrollDirection() {\n const scrollY = window.pageYOffset;\n const direction = scrollY > this.lastScrollY ? 'down' : 'up';\n\n if (direction !== this.scrollDirection && (scrollY - this.lastScrollY > 5 || scrollY - this.lastScrollY < -5)) {\n this.scrollDirection = direction;\n this.callbacks.forEach((callback) => callback(this.scrollDirection));\n }\n\n this.lastScrollY = scrollY > 0 ? scrollY : 0;\n }\n\n subscribe(callback: (direction: 'up' | 'down' | null) => void) {\n this.callbacks.add(callback);\n return () => this.callbacks.delete(callback);\n }\n\n destroy() {\n window.removeEventListener('scroll', this.updateScrollDirection);\n this.callbacks.clear();\n }\n\n getCurrentDirection() {\n return this.scrollDirection;\n }\n}\n\n/**\n * Detects when an element is scrolled past and is no longer in the viewport.\n */\nclass ElementAboveViewportTracker {\n private isAboveViewport = false;\n private observer: IntersectionObserver;\n private callbacks = new Set<(isAbove: boolean) => void>();\n\n constructor(private element: HTMLElement) {\n this.observer = new IntersectionObserver(\n ([entry]) => {\n const newIsAbove = entry.boundingClientRect.y < 0;\n if (newIsAbove !== this.isAboveViewport) {\n this.isAboveViewport = newIsAbove;\n this.callbacks.forEach((callback) => callback(this.isAboveViewport));\n }\n },\n { threshold: [0] },\n );\n\n this.observer.observe(this.element);\n }\n\n subscribe(callback: (isAbove: boolean) => void) {\n this.callbacks.add(callback);\n return () => this.callbacks.delete(callback);\n }\n\n destroy() {\n this.observer.disconnect();\n this.callbacks.clear();\n }\n\n getIsAboveViewport() {\n return this.isAboveViewport;\n }\n}\n\nexport type InitSubNavbarOptions = {\n /**\n * Custom selector to find sub-navbars.\n * @default '.bi-sub-navbar'\n */\n selector?: string;\n};\n\n/**\n * Initializes all sub-navbars on the page to handle scroll-based behavior.\n * This includes:\n * - Setting data-fixed attribute when the navbar is scrolled past\n * - Setting data-scroll-dir attribute based on scroll direction when fixed\n *\n * @param options Configuration options\n * @returns Cleanup function to remove all event listeners and observers\n */\nexport const initSubNavbar = ({ selector = '.bi-sub-navbar' }: InitSubNavbarOptions = {}) => {\n const subNavbars = document.querySelectorAll<HTMLElement>(selector);\n\n if (subNavbars.length === 0) {\n console.warn(`No elements found with selector: ${selector}`);\n return () => {};\n }\n\n const scrollTracker = new ScrollDirectionTracker();\n const cleanupFunctions: (() => void)[] = [];\n\n subNavbars.forEach((navbar) => {\n const wrapper = navbar.closest('.bi-sub-navbar--wrapper') as HTMLElement;\n if (!wrapper) {\n console.warn('Sub-navbar must be wrapped in an element with class \"bi-sub-navbar--wrapper\"');\n return;\n }\n\n // Find or create the reference element (empty div) that acts as the scroll trigger\n let referenceElement = wrapper.querySelector<HTMLElement>('div:first-child');\n if (!referenceElement || referenceElement === navbar) {\n referenceElement = document.createElement('div');\n wrapper.insertBefore(referenceElement, navbar);\n }\n\n const viewportTracker = new ElementAboveViewportTracker(referenceElement);\n\n // Subscribe to viewport changes\n const unsubscribeViewport = viewportTracker.subscribe((isAbove) => {\n navbar.setAttribute('data-fixed', String(isAbove));\n\n // Only set scroll direction when fixed\n if (isAbove) {\n const currentDirection = scrollTracker.getCurrentDirection();\n if (currentDirection) {\n navbar.setAttribute('data-scroll-dir', currentDirection);\n }\n } else {\n navbar.removeAttribute('data-scroll-dir');\n }\n });\n\n // Subscribe to scroll direction changes\n const unsubscribeScroll = scrollTracker.subscribe((direction) => {\n const isFixed = navbar.getAttribute('data-fixed') === 'true';\n if (isFixed && direction) {\n navbar.setAttribute('data-scroll-dir', direction);\n }\n });\n\n cleanupFunctions.push(() => {\n unsubscribeViewport();\n unsubscribeScroll();\n viewportTracker.destroy();\n });\n });\n\n // Return cleanup function\n return () => {\n cleanupFunctions.forEach((cleanup) => cleanup());\n scrollTracker.destroy();\n };\n};\n"],"mappings":";;;;;;AAKA,IAAM,yBAAN,MAA6B;CAK3B,cAAc;yBAJkC;qBAC1B,OAAO;mCACT,IAAI,KAAgD;AAGtE,OAAK,wBAAwB,KAAK,sBAAsB,KAAK,KAAK;AAClE,SAAO,iBAAiB,UAAU,KAAK,sBAAsB;;CAG/D,AAAQ,wBAAwB;EAC9B,MAAM,UAAU,OAAO;EACvB,MAAM,YAAY,UAAU,KAAK,cAAc,SAAS;AAExD,MAAI,cAAc,KAAK,oBAAoB,UAAU,KAAK,cAAc,KAAK,UAAU,KAAK,cAAc,KAAK;AAC7G,QAAK,kBAAkB;AACvB,QAAK,UAAU,SAAS,aAAa,SAAS,KAAK,gBAAgB,CAAC;;AAGtE,OAAK,cAAc,UAAU,IAAI,UAAU;;CAG7C,UAAU,UAAqD;AAC7D,OAAK,UAAU,IAAI,SAAS;AAC5B,eAAa,KAAK,UAAU,OAAO,SAAS;;CAG9C,UAAU;AACR,SAAO,oBAAoB,UAAU,KAAK,sBAAsB;AAChE,OAAK,UAAU,OAAO;;CAGxB,sBAAsB;AACpB,SAAO,KAAK;;;;;;AAOhB,IAAM,8BAAN,MAAkC;CAKhC,YAAY,AAAQA,SAAsB;EAAtB;yBAJM;mCAEN,IAAI,KAAiC;AAGvD,OAAK,WAAW,IAAI,sBACjB,CAAC,WAAW;GACX,MAAM,aAAa,MAAM,mBAAmB,IAAI;AAChD,OAAI,eAAe,KAAK,iBAAiB;AACvC,SAAK,kBAAkB;AACvB,SAAK,UAAU,SAAS,aAAa,SAAS,KAAK,gBAAgB,CAAC;;KAGxE,EAAE,WAAW,CAAC,EAAE,EAAE,CACnB;AAED,OAAK,SAAS,QAAQ,KAAK,QAAQ;;CAGrC,UAAU,UAAsC;AAC9C,OAAK,UAAU,IAAI,SAAS;AAC5B,eAAa,KAAK,UAAU,OAAO,SAAS;;CAG9C,UAAU;AACR,OAAK,SAAS,YAAY;AAC1B,OAAK,UAAU,OAAO;;CAGxB,qBAAqB;AACnB,SAAO,KAAK;;;;;;;;;;;;AAqBhB,MAAa,iBAAiB,EAAE,WAAW,qBAA2C,EAAE,KAAK;CAC3F,MAAM,aAAa,SAAS,iBAA8B,SAAS;AAEnE,KAAI,WAAW,WAAW,GAAG;AAC3B,UAAQ,KAAK,oCAAoC,WAAW;AAC5D,eAAa;;CAGf,MAAM,gBAAgB,IAAI,wBAAwB;CAClD,MAAMC,mBAAmC,EAAE;AAE3C,YAAW,SAAS,WAAW;EAC7B,MAAM,UAAU,OAAO,QAAQ,0BAA0B;AACzD,MAAI,CAAC,SAAS;AACZ,WAAQ,KAAK,iFAA+E;AAC5F;;EAIF,IAAI,mBAAmB,QAAQ,cAA2B,kBAAkB;AAC5E,MAAI,CAAC,oBAAoB,qBAAqB,QAAQ;AACpD,sBAAmB,SAAS,cAAc,MAAM;AAChD,WAAQ,aAAa,kBAAkB,OAAO;;EAGhD,MAAM,kBAAkB,IAAI,4BAA4B,iBAAiB;EAGzE,MAAM,sBAAsB,gBAAgB,WAAW,YAAY;AACjE,UAAO,aAAa,cAAc,OAAO,QAAQ,CAAC;AAGlD,OAAI,SAAS;IACX,MAAM,mBAAmB,cAAc,qBAAqB;AAC5D,QAAI,iBACF,QAAO,aAAa,mBAAmB,iBAAiB;SAG1D,QAAO,gBAAgB,kBAAkB;IAE3C;EAGF,MAAM,oBAAoB,cAAc,WAAW,cAAc;AAE/D,OADgB,OAAO,aAAa,aAAa,KAAK,UACvC,UACb,QAAO,aAAa,mBAAmB,UAAU;IAEnD;AAEF,mBAAiB,WAAW;AAC1B,wBAAqB;AACrB,sBAAmB;AACnB,mBAAgB,SAAS;IACzB;GACF;AAGF,cAAa;AACX,mBAAiB,SAAS,YAAY,SAAS,CAAC;AAChD,gBAAc,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sub-navbar-DkxQv0WJ.js","names":[],"sources":["../src/components/navbar/sub-navbar.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport { useRef, type HTMLAttributes, type Ref } from 'react';\nimport type { MergeRight } from '../../utilities';\nimport type { DefaultProps } from '../../types';\nimport { useIsElementAboveViewport, useScrollDirection } from '../../utilities/hooks';\n\nexport type SubNavbarProps = MergeRight<\n DefaultProps & HTMLAttributes<HTMLDivElement>,\n {\n ref?: Ref<HTMLElement>;\n }\n>;\n\nexport const SubNavbar = ({ dark = false, children, className, ref, ...props }: SubNavbarProps) => {\n const elementRef = useRef<HTMLDivElement>(null);\n const fixed = useIsElementAboveViewport(elementRef);\n const scrollDirection = useScrollDirection();\n\n return (\n <div className='bi-sub-navbar--wrapper'>\n <div ref={elementRef} />\n <nav\n className={clsx('bi-sub-navbar', className)}\n data-fixed={fixed}\n data-scroll-dir={fixed ? scrollDirection : undefined}\n data-dark={dark}\n {...props}\n ref={ref}\n >\n {children}\n </nav>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAaA,MAAa,
|
|
1
|
+
{"version":3,"file":"sub-navbar-DkxQv0WJ.js","names":[],"sources":["../src/components/navbar/sub-navbar.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport { useRef, type HTMLAttributes, type Ref } from 'react';\nimport type { MergeRight } from '../../utilities';\nimport type { DefaultProps } from '../../types';\nimport { useIsElementAboveViewport, useScrollDirection } from '../../utilities/hooks';\n\nexport type SubNavbarProps = MergeRight<\n DefaultProps & HTMLAttributes<HTMLDivElement>,\n {\n ref?: Ref<HTMLElement>;\n }\n>;\n\nexport const SubNavbar = ({ dark = false, children, className, ref, ...props }: SubNavbarProps) => {\n const elementRef = useRef<HTMLDivElement>(null);\n const fixed = useIsElementAboveViewport(elementRef);\n const scrollDirection = useScrollDirection();\n\n return (\n <div className='bi-sub-navbar--wrapper'>\n <div ref={elementRef} />\n <nav\n className={clsx('bi-sub-navbar', className)}\n data-fixed={fixed}\n data-scroll-dir={fixed ? scrollDirection : undefined}\n data-dark={dark}\n {...props}\n ref={ref}\n >\n {children}\n </nav>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAaA,MAAa,aAAa,EAAE,OAAO,OAAO,UAAU,WAAW,IAAK,GAAG,YAA4B;CACjG,MAAM,aAAa,OAAuB,KAAK;CAC/C,MAAM,QAAQ,0BAA0B,WAAW;CACnD,MAAM,kBAAkB,oBAAoB;AAE5C,QACE,qBAAC;EAAI,WAAU;aACb,oBAAC,SAAI,KAAK,aAAc,EACxB,oBAAC;GACC,WAAW,KAAK,iBAAiB,UAAU;GAC3C,cAAY;GACZ,mBAAiB,QAAQ,kBAAkB;GAC3C,aAAW;GACX,GAAI;GACC;GAEJ;IACG;GACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from "./button-
|
|
1
|
+
import { Button } from "./button-BzU7DrNe.js";
|
|
2
2
|
import clsx from "clsx/lite";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Trigger } from "@radix-ui/react-tabs";
|
|
@@ -24,4 +24,4 @@ const Tab = ({ className, value, disabled, children, asChild, dark, ref,...props
|
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
26
|
export { Tab };
|
|
27
|
-
//# sourceMappingURL=tab-
|
|
27
|
+
//# sourceMappingURL=tab-BEnC2rri.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-
|
|
1
|
+
{"version":3,"file":"tab-BEnC2rri.js","names":[],"sources":["../src/components/tabs/tab.tsx"],"sourcesContent":["import type { MergeRight } from '../../utilities';\nimport { Trigger } from '@radix-ui/react-tabs';\nimport clsx from 'clsx/lite';\nimport { Button, ButtonProps } from '../button';\n\nexport type TabProps = MergeRight<\n Omit<ButtonProps, 'variant' | 'type'>,\n {\n /** A unique value that associates the trigger with a content. */\n value: string;\n /**\n * When true, prevents the user from interacting with the tab.\n * @default false\n */\n disabled?: boolean;\n }\n>;\n\nexport const Tab = ({ className, value, disabled, children, asChild, dark, ref, ...props }: TabProps) => {\n return (\n <Trigger value={value} disabled={disabled} asChild>\n <Button\n ref={ref}\n variant='text'\n className={clsx('bi-tabs--tab', className)}\n disabled={disabled}\n asChild={asChild}\n dark={dark}\n {...props}\n >\n {children}\n </Button>\n </Trigger>\n );\n};\n"],"mappings":";;;;;;AAkBA,MAAa,OAAO,EAAE,WAAW,OAAO,UAAU,UAAU,SAAS,MAAM,IAAK,GAAG,YAAsB;AACvG,QACE,oBAAC;EAAe;EAAiB;EAAU;YACzC,oBAAC;GACM;GACL,SAAQ;GACR,WAAW,KAAK,gBAAgB,UAAU;GAChC;GACD;GACH;GACN,GAAI;GAEH;IACM;GACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-C70z_5SJ.js","names":[],"sources":["../src/components/tabs/tabs.tsx"],"sourcesContent":["import type { HTMLAttributes, Ref } from 'react';\nimport type { DefaultProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\nimport { Root } from '@radix-ui/react-tabs';\nimport clsx from 'clsx/lite';\n\nexport type TabsProps = MergeRight<\n DefaultProps & Omit<HTMLAttributes<HTMLDivElement>, 'dir'>,\n {\n /**\n * When `automatic`, tabs are activated when receiving focus. When `manual`, tabs are activated when clicked.\n * @default 'automatic'\n */\n activationMode?: 'manual' | 'automatic';\n /**\n * The orientation of the component.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n /** The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs. */\n defaultValue?: string;\n /** The controlled value of the tab to activate. Should be used together with `onChange`. */\n value?: string;\n /** Event handler called when the value changes. */\n onChange?: (value: string) => void;\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n ref?: Ref<HTMLDivElement>;\n }\n>;\n\nexport const Tabs = ({\n activationMode = 'automatic',\n orientation = 'horizontal',\n defaultValue,\n value,\n onChange,\n children,\n className,\n asChild,\n dark,\n ref,\n ...props\n}: TabsProps) => {\n return (\n <Root\n className={clsx('bi-tabs', className)}\n activationMode={activationMode}\n orientation={orientation}\n defaultValue={defaultValue}\n value={value}\n onValueChange={onChange}\n asChild={asChild}\n data-dark={dark}\n ref={ref}\n {...props}\n >\n {children}\n </Root>\n );\n};\n"],"mappings":";;;;;AAkCA,MAAa,
|
|
1
|
+
{"version":3,"file":"tabs-C70z_5SJ.js","names":[],"sources":["../src/components/tabs/tabs.tsx"],"sourcesContent":["import type { HTMLAttributes, Ref } from 'react';\nimport type { DefaultProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\nimport { Root } from '@radix-ui/react-tabs';\nimport clsx from 'clsx/lite';\n\nexport type TabsProps = MergeRight<\n DefaultProps & Omit<HTMLAttributes<HTMLDivElement>, 'dir'>,\n {\n /**\n * When `automatic`, tabs are activated when receiving focus. When `manual`, tabs are activated when clicked.\n * @default 'automatic'\n */\n activationMode?: 'manual' | 'automatic';\n /**\n * The orientation of the component.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n /** The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs. */\n defaultValue?: string;\n /** The controlled value of the tab to activate. Should be used together with `onChange`. */\n value?: string;\n /** Event handler called when the value changes. */\n onChange?: (value: string) => void;\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n ref?: Ref<HTMLDivElement>;\n }\n>;\n\nexport const Tabs = ({\n activationMode = 'automatic',\n orientation = 'horizontal',\n defaultValue,\n value,\n onChange,\n children,\n className,\n asChild,\n dark,\n ref,\n ...props\n}: TabsProps) => {\n return (\n <Root\n className={clsx('bi-tabs', className)}\n activationMode={activationMode}\n orientation={orientation}\n defaultValue={defaultValue}\n value={value}\n onValueChange={onChange}\n asChild={asChild}\n data-dark={dark}\n ref={ref}\n {...props}\n >\n {children}\n </Root>\n );\n};\n"],"mappings":";;;;;AAkCA,MAAa,QAAQ,EACnB,iBAAiB,aACjB,cAAc,cACd,cACA,OACA,UACA,UACA,WACA,SACA,MACA,IACA,GAAG,YACY;AACf,QACE,oBAAC;EACC,WAAW,KAAK,WAAW,UAAU;EACrB;EACH;EACC;EACP;EACP,eAAe;EACN;EACT,aAAW;EACN;EACL,GAAI;EAEH;GACI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-list-npvK06bl.js","names":[],"sources":["../src/components/tabs/tabs-list.tsx"],"sourcesContent":["import type { HTMLAttributes, Ref } from 'react';\nimport type { DefaultProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\nimport { List } from '@radix-ui/react-tabs';\nimport clsx from 'clsx/lite';\n\nexport type TabsListProps = MergeRight<\n DefaultProps & Omit<HTMLAttributes<HTMLDivElement>, 'dir'>,\n {\n /**\n * When `true`, keyboard navigation will loop from last tab to first, and vice versa.\n * @default true\n */\n loop?: boolean;\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n ref?: Ref<HTMLDivElement>;\n }\n>;\n\nexport const TabsList = ({ className, loop = true, children, asChild, dark, ref, ...props }: TabsListProps) => {\n return (\n <List\n className={clsx('bi-tabs--list', className)}\n loop={loop}\n asChild={asChild}\n data-dark={dark}\n ref={ref}\n {...props}\n >\n {children}\n </List>\n );\n};\n"],"mappings":";;;;;AAuBA,MAAa,
|
|
1
|
+
{"version":3,"file":"tabs-list-npvK06bl.js","names":[],"sources":["../src/components/tabs/tabs-list.tsx"],"sourcesContent":["import type { HTMLAttributes, Ref } from 'react';\nimport type { DefaultProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\nimport { List } from '@radix-ui/react-tabs';\nimport clsx from 'clsx/lite';\n\nexport type TabsListProps = MergeRight<\n DefaultProps & Omit<HTMLAttributes<HTMLDivElement>, 'dir'>,\n {\n /**\n * When `true`, keyboard navigation will loop from last tab to first, and vice versa.\n * @default true\n */\n loop?: boolean;\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n ref?: Ref<HTMLDivElement>;\n }\n>;\n\nexport const TabsList = ({ className, loop = true, children, asChild, dark, ref, ...props }: TabsListProps) => {\n return (\n <List\n className={clsx('bi-tabs--list', className)}\n loop={loop}\n asChild={asChild}\n data-dark={dark}\n ref={ref}\n {...props}\n >\n {children}\n </List>\n );\n};\n"],"mappings":";;;;;AAuBA,MAAa,YAAY,EAAE,WAAW,OAAO,MAAM,UAAU,SAAS,MAAM,IAAK,GAAG,YAA2B;AAC7G,QACE,oBAAC;EACC,WAAW,KAAK,iBAAiB,UAAU;EACrC;EACG;EACT,aAAW;EACN;EACL,GAAI;EAEH;GACI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-panel-L8HovooI.js","names":[],"sources":["../src/components/tabs/tabs-panel.tsx"],"sourcesContent":["import type { HTMLAttributes, Ref } from 'react';\nimport type { DefaultProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\nimport { Content } from '@radix-ui/react-tabs';\nimport clsx from 'clsx/lite';\n\nexport type TabsPanelProps = MergeRight<\n DefaultProps & Omit<HTMLAttributes<HTMLDivElement>, 'dir'>,\n {\n /** A unique value that associates the content with a trigger. */\n value: string;\n /** Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. */\n forceMount?: boolean;\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n ref?: Ref<HTMLDivElement>;\n }\n>;\n\nexport const TabsPanel = ({ className, value, forceMount, children, asChild, dark, ref, ...props }: TabsPanelProps) => {\n return (\n <Content\n className={clsx('bi-tabs--panel', className)}\n value={value}\n forceMount={forceMount || undefined}\n asChild={asChild}\n data-dark={dark}\n ref={ref}\n {...props}\n >\n {children}\n </Content>\n );\n};\n"],"mappings":";;;;;AAsBA,MAAa,
|
|
1
|
+
{"version":3,"file":"tabs-panel-L8HovooI.js","names":[],"sources":["../src/components/tabs/tabs-panel.tsx"],"sourcesContent":["import type { HTMLAttributes, Ref } from 'react';\nimport type { DefaultProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\nimport { Content } from '@radix-ui/react-tabs';\nimport clsx from 'clsx/lite';\n\nexport type TabsPanelProps = MergeRight<\n DefaultProps & Omit<HTMLAttributes<HTMLDivElement>, 'dir'>,\n {\n /** A unique value that associates the content with a trigger. */\n value: string;\n /** Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. */\n forceMount?: boolean;\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n ref?: Ref<HTMLDivElement>;\n }\n>;\n\nexport const TabsPanel = ({ className, value, forceMount, children, asChild, dark, ref, ...props }: TabsPanelProps) => {\n return (\n <Content\n className={clsx('bi-tabs--panel', className)}\n value={value}\n forceMount={forceMount || undefined}\n asChild={asChild}\n data-dark={dark}\n ref={ref}\n {...props}\n >\n {children}\n </Content>\n );\n};\n"],"mappings":";;;;;AAsBA,MAAa,aAAa,EAAE,WAAW,OAAO,YAAY,UAAU,SAAS,MAAM,IAAK,GAAG,YAA4B;AACrH,QACE,oBAAC;EACC,WAAW,KAAK,kBAAkB,UAAU;EACrC;EACP,YAAY,cAAc;EACjB;EACT,aAAW;EACN;EACL,GAAI;EAEH;GACO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea-B1fAOfkt.js","names":[],"sources":["../src/components/textarea/textarea.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport type { Ref, TextareaHTMLAttributes } from 'react';\nimport type { DefaultProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\n\nexport type TextareaProps = MergeRight<\n DefaultProps & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'prefix'>,\n {\n /**\n * Size of the textarea.\n * @default 'medium'\n */\n size?: 'medium' | 'large';\n ref?: Ref<HTMLTextAreaElement>;\n }\n>;\n\nexport const Textarea = ({ className, dark, size, ref, ...props }: TextareaProps) => {\n return <textarea className={clsx('bi-input', className)} data-dark={dark} data-size={size} ref={ref} {...props} />;\n};\n"],"mappings":";;;;AAiBA,MAAa,
|
|
1
|
+
{"version":3,"file":"textarea-B1fAOfkt.js","names":[],"sources":["../src/components/textarea/textarea.tsx"],"sourcesContent":["import clsx from 'clsx/lite';\nimport type { Ref, TextareaHTMLAttributes } from 'react';\nimport type { DefaultProps } from '../../types';\nimport type { MergeRight } from '../../utilities';\n\nexport type TextareaProps = MergeRight<\n DefaultProps & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'prefix'>,\n {\n /**\n * Size of the textarea.\n * @default 'medium'\n */\n size?: 'medium' | 'large';\n ref?: Ref<HTMLTextAreaElement>;\n }\n>;\n\nexport const Textarea = ({ className, dark, size, ref, ...props }: TextareaProps) => {\n return <textarea className={clsx('bi-input', className)} data-dark={dark} data-size={size} ref={ref} {...props} />;\n};\n"],"mappings":";;;;AAiBA,MAAa,YAAY,EAAE,WAAW,MAAM,MAAM,IAAK,GAAG,YAA2B;AACnF,QAAO,oBAAC;EAAS,WAAW,KAAK,YAAY,UAAU;EAAE,aAAW;EAAM,aAAW;EAAW;EAAK,GAAI;GAAS"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Field } from "./field-
|
|
2
|
-
import { FieldDescription } from "./field-description-
|
|
3
|
-
import { FieldAffix, FieldAffixes } from "./field-affix-
|
|
1
|
+
import { Field } from "./field-Dul9LBgF.js";
|
|
2
|
+
import { FieldDescription } from "./field-description-Yya33j8H.js";
|
|
3
|
+
import { FieldAffix, FieldAffixes } from "./field-affix-C5w3NK4H.js";
|
|
4
4
|
import { Input } from "./input-Dr7BnTyd.js";
|
|
5
|
-
import { Label } from "./label-
|
|
6
|
-
import { ValidationMessage } from "./validation-message-
|
|
5
|
+
import { Label } from "./label-DG_ojO9g.js";
|
|
6
|
+
import { ValidationMessage } from "./validation-message-J5bvdg8v.js";
|
|
7
7
|
import { Textarea } from "./textarea-B1fAOfkt.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useId } from "react";
|
|
@@ -62,4 +62,4 @@ const Textfield = ({ dark, label, description, error, multiline, prefix, suffix,
|
|
|
62
62
|
|
|
63
63
|
//#endregion
|
|
64
64
|
export { Textfield };
|
|
65
|
-
//# sourceMappingURL=textfield-
|
|
65
|
+
//# sourceMappingURL=textfield-BH0g7AtT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textfield-
|
|
1
|
+
{"version":3,"file":"textfield-BH0g7AtT.js","names":[],"sources":["../src/components/textfield/textfield.tsx"],"sourcesContent":["import { useId, type ReactNode, type Ref } from 'react';\n\nimport type { DefaultProps, LabelRequiredProps } from '../../types';\nimport { Field, FieldAffix, FieldAffixes, FieldDescription } from '../field';\nimport { Input, type InputProps } from '../input';\nimport { Label } from '../label';\nimport { Textarea, type TextareaProps } from '../textarea';\nimport { ValidationMessage } from '../validation-message';\n\ntype InputPropsFiltered = Omit<InputProps, 'prefix' | 'className' | 'style'>;\ntype TextareaPropsFiltered = Omit<TextareaProps, 'prefix' | 'className' | 'style'>;\n\ntype BaseTextfieldProps = LabelRequiredProps &\n DefaultProps & {\n /** Label */\n label?: ReactNode;\n /** Description */\n description?: ReactNode;\n /** Prefix */\n prefix?: string;\n /** Suffix */\n suffix?: string;\n /** Error message for field */\n error?: ReactNode;\n /** `className` for the `Field` element */\n className?: InputProps['className'];\n /** `style` for the `Field` element */\n style?: InputProps['style'];\n /** If true, the selectfield will take up the full available width */\n fullwidth?: boolean;\n };\n\ntype TextfieldTextareaProps = {\n /** Render `Textarea` instead of a `Input`. The `Textarea` has support for multiple rows of input. */\n multiline: true;\n} & TextareaPropsFiltered;\n\ntype TextfieldInputProps = {\n /** Render `Textarea` instead of a `Input`. The `Textarea` has support for multiple rows of input. */\n multiline?: never | false;\n} & InputPropsFiltered;\n\nexport type TextfieldProps = BaseTextfieldProps &\n // We use either Textarea or Input props, depending on the `multiline` prop.\n (TextfieldTextareaProps | TextfieldInputProps) & {\n ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;\n };\n\nexport const Textfield = ({\n dark,\n label,\n description,\n error,\n multiline,\n prefix,\n suffix,\n style,\n className,\n fullwidth,\n ref,\n id: idProp,\n 'aria-describedby': ariaDescribedByProp,\n ...props\n}: TextfieldProps) => {\n const generatedId = useId();\n const descriptionId = useId();\n const validationId = useId();\n const id = idProp || generatedId;\n\n const ariaDescribedBy =\n [description ? descriptionId : '', error ? validationId : '', ariaDescribedByProp].join(' ').trim() || undefined;\n return (\n <Field className={className} data-dark={dark} style={style} fullwidth={fullwidth}>\n {label && <Label htmlFor={id}>{label}</Label>}\n {description && <FieldDescription id={descriptionId}>{description}</FieldDescription>}\n <FieldAffixes>\n {prefix && <FieldAffix>{prefix}</FieldAffix>}\n {multiline ? (\n <Textarea\n id={id}\n ref={ref as Ref<HTMLTextAreaElement>}\n aria-invalid={Boolean(error) || undefined}\n aria-describedby={ariaDescribedBy}\n dark={dark}\n {...(props as TextareaPropsFiltered)}\n />\n ) : (\n <Input\n id={id}\n ref={ref as Ref<HTMLInputElement>}\n aria-invalid={Boolean(error) || undefined}\n aria-describedby={ariaDescribedBy}\n dark={dark}\n {...(props as InputPropsFiltered)}\n />\n )}\n {suffix && <FieldAffix>{suffix}</FieldAffix>}\n </FieldAffixes>\n {!!error && <ValidationMessage id={validationId}>{error}</ValidationMessage>}\n </Field>\n );\n};\n"],"mappings":";;;;;;;;;;;AAgDA,MAAa,aAAa,EACxB,MACA,OACA,aACA,OACA,WACA,QACA,QACA,OACA,WACA,WACA,KACA,IAAI,QACJ,oBAAoB,oBACpB,GAAG,YACiB;CACpB,MAAM,cAAc,OAAO;CAC3B,MAAM,gBAAgB,OAAO;CAC7B,MAAM,eAAe,OAAO;CAC5B,MAAM,KAAK,UAAU;CAErB,MAAM,kBACJ;EAAC,cAAc,gBAAgB;EAAI,QAAQ,eAAe;EAAI;EAAoB,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI;AACzG,QACE,qBAAC;EAAiB;EAAW,aAAW;EAAa;EAAkB;;GACpE,SAAS,oBAAC;IAAM,SAAS;cAAK;KAAc;GAC5C,eAAe,oBAAC;IAAiB,IAAI;cAAgB;KAA+B;GACrF,qBAAC;IACE,UAAU,oBAAC,wBAAY,SAAoB;IAC3C,YACC,oBAAC;KACK;KACC;KACL,gBAAc,QAAQ,MAAM,IAAI;KAChC,oBAAkB;KACZ;KACN,GAAK;MACL,GAEF,oBAAC;KACK;KACC;KACL,gBAAc,QAAQ,MAAM,IAAI;KAChC,oBAAkB;KACZ;KACN,GAAK;MACL;IAEH,UAAU,oBAAC,wBAAY,SAAoB;OAC/B;GACd,CAAC,CAAC,SAAS,oBAAC;IAAkB,IAAI;cAAe;KAA0B;;GACtE"}
|