@bi-digital/react 0.2.22 → 0.2.23
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-footer-CmqpWEov.d.ts → alert-footer-Cqr42-cW.d.ts} +116 -85
- package/dist/{checkbox-CxA8UXr6.js → checkbox-ZR1Z2PCF.js} +2 -2
- package/dist/checkbox-ZR1Z2PCF.js.map +1 -0
- package/dist/{checkbox-subsection-CGXgII6v.js → checkbox-subsection-BPe5aj-W.js} +1 -1
- package/dist/{checkbox-subsection-CGXgII6v.js.map → checkbox-subsection-BPe5aj-W.js.map} +1 -1
- package/dist/{chip-CRcC9TkL.js → chip-b9xUiF7_.js} +1 -1
- package/dist/{chip-CRcC9TkL.js.map → chip-b9xUiF7_.js.map} +1 -1
- package/dist/components/alert/alert-footer.d.ts +16 -15
- package/dist/components/alert/alert.d.ts +16 -15
- package/dist/components/alert/index.d.ts +16 -15
- package/dist/components/avatar/avatar.d.ts +16 -15
- package/dist/components/avatar/index.d.ts +16 -15
- package/dist/components/badge/badge.d.ts +16 -15
- package/dist/components/badge/index.d.ts +16 -15
- package/dist/components/button/button.d.ts +16 -15
- package/dist/components/button/index.d.ts +16 -15
- package/dist/components/card/card-action.d.ts +16 -15
- package/dist/components/card/card-actions.d.ts +16 -15
- package/dist/components/card/card-content.d.ts +16 -15
- package/dist/components/card/card-date.d.ts +16 -15
- package/dist/components/card/card-header.d.ts +16 -15
- package/dist/components/card/card-media.d.ts +16 -15
- package/dist/components/card/card.d.ts +16 -15
- package/dist/components/card/index.d.ts +16 -15
- package/dist/components/checkbox/checkbox-subsection.d.ts +16 -15
- package/dist/components/checkbox/checkbox-subsection.js +1 -1
- package/dist/components/checkbox/checkbox.d.ts +16 -15
- package/dist/components/checkbox/checkbox.js +2 -6
- package/dist/components/checkbox/index.d.ts +16 -15
- package/dist/components/checkbox/index.js +4 -8
- package/dist/components/chip/chip.d.ts +16 -15
- package/dist/components/chip/chip.js +1 -1
- package/dist/components/chip/index.d.ts +16 -15
- package/dist/components/chip/index.js +2 -2
- package/dist/components/dialog/dialog-close-button.d.ts +16 -15
- package/dist/components/dialog/dialog-close-button.js +1 -1
- package/dist/components/dialog/dialog-content.d.ts +16 -15
- package/dist/components/dialog/dialog-content.js +1 -1
- package/dist/components/dialog/dialog-footer.d.ts +16 -15
- package/dist/components/dialog/dialog-footer.js +1 -1
- package/dist/components/dialog/dialog-header.d.ts +16 -15
- package/dist/components/dialog/dialog-header.js +1 -1
- package/dist/components/dialog/dialog-trigger-context.d.ts +1 -1
- package/dist/components/dialog/dialog-trigger-context.js +1 -1
- package/dist/components/dialog/dialog-trigger.d.ts +16 -15
- package/dist/components/dialog/dialog-trigger.js +2 -2
- package/dist/components/dialog/dialog.d.ts +16 -15
- package/dist/components/dialog/dialog.js +3 -7
- package/dist/components/dialog/index.d.ts +16 -15
- package/dist/components/dialog/index.js +9 -13
- package/dist/components/drawer/drawer-close-button.d.ts +16 -15
- package/dist/components/drawer/drawer-close-button.js +10 -14
- package/dist/components/drawer/drawer-content.d.ts +16 -15
- package/dist/components/drawer/drawer-content.js +10 -14
- package/dist/components/drawer/drawer-footer.d.ts +16 -15
- package/dist/components/drawer/drawer-footer.js +10 -14
- package/dist/components/drawer/drawer-header.d.ts +16 -15
- package/dist/components/drawer/drawer-header.js +10 -14
- package/dist/components/drawer/drawer-trigger-context.d.ts +1 -1
- package/dist/components/drawer/drawer-trigger-context.js +10 -14
- package/dist/components/drawer/drawer-trigger.d.ts +16 -15
- package/dist/components/drawer/drawer-trigger.js +10 -14
- package/dist/components/drawer/drawer.d.ts +16 -15
- package/dist/components/drawer/drawer.js +10 -14
- package/dist/components/drawer/index.d.ts +16 -15
- package/dist/components/drawer/index.js +17 -21
- package/dist/components/dropdown/dropdown-button.d.ts +16 -15
- package/dist/components/dropdown/dropdown-button.js +1 -1
- package/dist/components/dropdown/dropdown-item.d.ts +1 -1
- package/dist/components/dropdown/dropdown-item.js +1 -1
- package/dist/components/dropdown/dropdown-list.d.ts +1 -1
- package/dist/components/dropdown/dropdown-list.js +1 -1
- package/dist/components/dropdown/dropdown-trigger-context.d.ts +17 -1
- package/dist/components/dropdown/dropdown-trigger-context.js +6 -10
- package/dist/components/dropdown/dropdown-trigger.d.ts +16 -15
- package/dist/components/dropdown/dropdown-trigger.js +6 -10
- package/dist/components/dropdown/dropdown.d.ts +16 -15
- package/dist/components/dropdown/dropdown.js +6 -10
- package/dist/components/dropdown/index.d.ts +16 -15
- package/dist/components/dropdown/index.js +12 -16
- package/dist/components/field/field-affix.d.ts +16 -15
- package/dist/components/field/field-description.d.ts +16 -15
- package/dist/components/field/field.d.ts +16 -15
- package/dist/components/field/index.d.ts +16 -15
- package/dist/components/fieldset/fieldset-description.d.ts +16 -15
- package/dist/components/fieldset/fieldset-description.js +1 -1
- package/dist/components/fieldset/fieldset-legend.d.ts +16 -15
- package/dist/components/fieldset/fieldset-legend.js +1 -1
- package/dist/components/fieldset/fieldset.d.ts +16 -15
- package/dist/components/fieldset/fieldset.js +1 -1
- package/dist/components/fieldset/index.d.ts +16 -15
- package/dist/components/fieldset/index.js +4 -4
- package/dist/components/filter-group/filter-group.d.ts +16 -15
- package/dist/components/filter-group/filter-group.js +1 -1
- package/dist/components/filter-group/index.d.ts +16 -15
- package/dist/components/filter-group/index.js +2 -2
- package/dist/components/footer/footer-links.d.ts +1 -1
- package/dist/components/footer/footer-links.js +1 -1
- package/dist/components/footer/footer.d.ts +16 -15
- package/dist/components/footer/footer.js +1 -1
- package/dist/components/footer/index.d.ts +16 -15
- package/dist/components/footer/index.js +3 -3
- package/dist/components/index.d.ts +16 -15
- package/dist/components/index.js +84 -83
- package/dist/components/input/index.d.ts +16 -15
- package/dist/components/input/input.d.ts +16 -15
- package/dist/components/label/index.d.ts +16 -15
- package/dist/components/label/label.d.ts +16 -15
- package/dist/components/link/index.d.ts +16 -15
- package/dist/components/link/index.js +2 -2
- package/dist/components/link/link.d.ts +16 -15
- package/dist/components/link/link.js +1 -1
- package/dist/components/logo/index.d.ts +16 -15
- package/dist/components/logo/index.js +2 -2
- package/dist/components/logo/logo.d.ts +16 -15
- package/dist/components/logo/logo.js +1 -1
- package/dist/components/navbar/index.d.ts +16 -15
- package/dist/components/navbar/index.js +12 -7
- package/dist/components/navbar/navbar.d.ts +16 -15
- package/dist/components/navbar/navbar.js +3 -3
- package/dist/components/navbar/sub-navbar.d.ts +16 -15
- package/dist/components/navbar/sub-navbar.js +8 -3
- package/dist/components/pagination/index.d.ts +16 -15
- package/dist/components/pagination/index.js +4 -4
- package/dist/components/pagination/pagination-button.d.ts +16 -15
- package/dist/components/pagination/pagination-button.js +1 -1
- package/dist/components/pagination/pagination-item.d.ts +1 -1
- package/dist/components/pagination/pagination-item.js +1 -1
- package/dist/components/pagination/pagination.d.ts +16 -15
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/popover/index.d.ts +16 -15
- package/dist/components/popover/index.js +5 -9
- package/dist/components/popover/popover-trigger-context.d.ts +1 -1
- package/dist/components/popover/popover-trigger-context.js +1 -1
- package/dist/components/popover/popover-trigger.d.ts +16 -15
- package/dist/components/popover/popover-trigger.js +2 -2
- package/dist/components/popover/popover.d.ts +16 -15
- package/dist/components/popover/popover.js +3 -7
- package/dist/components/radio/index.d.ts +16 -15
- package/dist/components/radio/index.js +2 -2
- package/dist/components/radio/radio.d.ts +16 -15
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/search/index.d.ts +16 -15
- package/dist/components/search/index.js +2 -2
- package/dist/components/search/search.d.ts +16 -15
- package/dist/components/search/search.js +1 -1
- package/dist/components/select/index.d.ts +16 -15
- package/dist/components/select/index.js +4 -4
- package/dist/components/select/select-optgroup.d.ts +16 -15
- package/dist/components/select/select-optgroup.js +1 -1
- package/dist/components/select/select-option.d.ts +16 -15
- package/dist/components/select/select-option.js +1 -1
- package/dist/components/select/select.d.ts +16 -15
- package/dist/components/select/select.js +1 -1
- package/dist/components/skip-link/index.d.ts +16 -15
- package/dist/components/skip-link/index.js +2 -2
- package/dist/components/skip-link/skip-link.d.ts +16 -15
- package/dist/components/skip-link/skip-link.js +1 -1
- package/dist/components/spinner/index.d.ts +16 -15
- package/dist/components/spinner/spinner.d.ts +16 -15
- package/dist/components/sticky-header/index.d.ts +1 -1
- package/dist/components/sticky-header/index.js +2 -2
- 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 +16 -15
- package/dist/components/tabs/index.js +5 -5
- package/dist/components/tabs/tab.d.ts +16 -15
- package/dist/components/tabs/tab.js +1 -1
- package/dist/components/tabs/tabs-list.d.ts +16 -15
- package/dist/components/tabs/tabs-list.js +1 -1
- package/dist/components/tabs/tabs-panel.d.ts +16 -15
- package/dist/components/tabs/tabs-panel.js +1 -1
- package/dist/components/tabs/tabs.d.ts +16 -15
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/textarea/index.d.ts +16 -15
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/textarea/textarea.d.ts +16 -15
- package/dist/components/textarea/textarea.js +1 -1
- package/dist/components/textfield/index.d.ts +16 -15
- package/dist/components/textfield/index.js +6 -6
- package/dist/components/textfield/textfield.d.ts +16 -15
- package/dist/components/textfield/textfield.js +5 -5
- package/dist/components/validation-message/index.d.ts +16 -15
- package/dist/components/validation-message/index.js +2 -2
- package/dist/components/validation-message/validation-message.d.ts +16 -15
- package/dist/components/validation-message/validation-message.js +1 -1
- package/dist/{dialog-WgEtFqJD.js → dialog-DzGRZgbP.js} +3 -3
- package/dist/dialog-DzGRZgbP.js.map +1 -0
- package/dist/{dialog-close-button-8n-DBvH4.js → dialog-close-button-B4zf0hvt.js} +1 -1
- package/dist/{dialog-close-button-8n-DBvH4.js.map → dialog-close-button-B4zf0hvt.js.map} +1 -1
- package/dist/{dialog-content-CU346luZ.js → dialog-content-R35XpbSj.js} +1 -1
- package/dist/{dialog-content-CU346luZ.js.map → dialog-content-R35XpbSj.js.map} +1 -1
- package/dist/{dialog-footer-BPCalxtL.js → dialog-footer-AoiCz_Uj.js} +1 -1
- package/dist/{dialog-footer-BPCalxtL.js.map → dialog-footer-AoiCz_Uj.js.map} +1 -1
- package/dist/{dialog-header-DsLpGnOf.js → dialog-header-Bbq9DcHX.js} +1 -1
- package/dist/{dialog-header-DsLpGnOf.js.map → dialog-header-Bbq9DcHX.js.map} +1 -1
- package/dist/{dialog-trigger-Q9Y5EG0H.js → dialog-trigger-DinHpkua.js} +2 -2
- package/dist/{dialog-trigger-Q9Y5EG0H.js.map → dialog-trigger-DinHpkua.js.map} +1 -1
- package/dist/{dialog-trigger-context-B41wR-bM.js → dialog-trigger-context-51mA5fz3.js} +1 -1
- package/dist/{dialog-trigger-context-B41wR-bM.js.map → dialog-trigger-context-51mA5fz3.js.map} +1 -1
- package/dist/{dialog-trigger-context-CedfUYNj.d.ts → dialog-trigger-context-DwmhJNzA.d.ts} +5 -5
- package/dist/{drawer-B8xyMitJ.js → drawer-CZ05Lizo.js} +2 -2
- package/dist/{drawer-B8xyMitJ.js.map → drawer-CZ05Lizo.js.map} +1 -1
- package/dist/{drawer-close-button-CqDqQGHP.js → drawer-close-button-DigcuqLc.js} +2 -2
- package/dist/{drawer-close-button-CqDqQGHP.js.map → drawer-close-button-DigcuqLc.js.map} +1 -1
- package/dist/{drawer-content-Dp__eciN.js → drawer-content-CFc-rxBo.js} +2 -2
- package/dist/{drawer-content-Dp__eciN.js.map → drawer-content-CFc-rxBo.js.map} +1 -1
- package/dist/{drawer-footer-qYHvZEl_.js → drawer-footer-CfHjfvEg.js} +2 -2
- package/dist/{drawer-footer-qYHvZEl_.js.map → drawer-footer-CfHjfvEg.js.map} +1 -1
- package/dist/{drawer-header-fQaZQuIY.js → drawer-header-DK4XoaaW.js} +2 -2
- package/dist/{drawer-header-fQaZQuIY.js.map → drawer-header-DK4XoaaW.js.map} +1 -1
- package/dist/{drawer-trigger-BvjTEl5N.js → drawer-trigger-Do9Htx5M.js} +2 -2
- package/dist/{drawer-trigger-BvjTEl5N.js.map → drawer-trigger-Do9Htx5M.js.map} +1 -1
- package/dist/{drawer-trigger-context-DHYdt3sB.js → drawer-trigger-context-BUWPPdas.js} +2 -2
- package/dist/{drawer-trigger-context-DHYdt3sB.js.map → drawer-trigger-context-BUWPPdas.js.map} +1 -1
- package/dist/{drawer-trigger-context-V67j5GyK.d.ts → drawer-trigger-context-BoS9ZcVF.d.ts} +3 -3
- package/dist/dropdown-A1PW0OoQ.js +19 -0
- package/dist/{dropdown-D-dX5PAl.js.map → dropdown-A1PW0OoQ.js.map} +1 -1
- package/dist/{dropdown-D54kcMt_.js → dropdown-b7acNLZb.js} +2 -2
- package/dist/{dropdown-D54kcMt_.js.map → dropdown-b7acNLZb.js.map} +1 -1
- package/dist/{dropdown-button-CKPaLMBh.js → dropdown-button-FQqIwqdp.js} +1 -1
- package/dist/{dropdown-button-CKPaLMBh.js.map → dropdown-button-FQqIwqdp.js.map} +1 -1
- package/dist/{dropdown-item-CnQfwJGB.d.ts → dropdown-item-CKKjumy3.d.ts} +3 -3
- package/dist/{dropdown-item-BnnEFIq3.js → dropdown-item-DQQXQC4J.js} +1 -1
- package/dist/{dropdown-item-BnnEFIq3.js.map → dropdown-item-DQQXQC4J.js.map} +1 -1
- package/dist/{dropdown-list-BWW85rXi.js → dropdown-list-DB1mST67.js} +1 -1
- package/dist/{dropdown-list-BWW85rXi.js.map → dropdown-list-DB1mST67.js.map} +1 -1
- package/dist/{dropdown-list-DK4FJAqB.d.ts → dropdown-list-vVhxG14z.d.ts} +3 -3
- package/dist/{dropdown-trigger-DfHyg_D7.js → dropdown-trigger-Fwrigwtg.js} +2 -2
- package/dist/{dropdown-trigger-DfHyg_D7.js.map → dropdown-trigger-Fwrigwtg.js.map} +1 -1
- package/dist/{dropdown-trigger-context-BpYBk_xf.js → dropdown-trigger-context-BCcyoZEx.js} +6 -3
- package/dist/dropdown-trigger-context-BCcyoZEx.js.map +1 -0
- package/dist/{fieldset-DGB7cvdz.js → fieldset-Bpu4CRKG.js} +1 -1
- package/dist/{fieldset-DGB7cvdz.js.map → fieldset-Bpu4CRKG.js.map} +1 -1
- package/dist/{fieldset-description-oNKwCGnW.js → fieldset-description-DiHvcLh-.js} +1 -1
- package/dist/{fieldset-description-oNKwCGnW.js.map → fieldset-description-DiHvcLh-.js.map} +1 -1
- package/dist/{fieldset-legend-Dseni7XM.js → fieldset-legend-CR4srn2-.js} +1 -1
- package/dist/{fieldset-legend-Dseni7XM.js.map → fieldset-legend-CR4srn2-.js.map} +1 -1
- package/dist/{filter-group-BKO5sgGt.js → filter-group-DMSPaCQt.js} +1 -1
- package/dist/{filter-group-BKO5sgGt.js.map → filter-group-DMSPaCQt.js.map} +1 -1
- package/dist/{footer-CXKRhzUT.js → footer-CU7LdbPO.js} +1 -1
- package/dist/{footer-CXKRhzUT.js.map → footer-CU7LdbPO.js.map} +1 -1
- package/dist/{footer-links-Dz1UwVuf.js → footer-links-BIUrxu38.js} +1 -1
- package/dist/{footer-links-Dz1UwVuf.js.map → footer-links-BIUrxu38.js.map} +1 -1
- package/dist/{footer-links-C9v9gcuW.d.ts → footer-links-Drm2LFnw.d.ts} +3 -3
- package/dist/index-CjnsNUdv.d.ts +23 -0
- package/dist/{index-B-0iSMVN.d.ts → index-DV9bEW_1.d.ts} +14 -3
- package/dist/{index-CXV3nvLQ.d.ts → index-SaA0V19q.d.ts} +14 -3
- package/dist/{link-BdmxFMOF.js → link-BqDeZAJF.js} +1 -1
- package/dist/{link-BdmxFMOF.js.map → link-BqDeZAJF.js.map} +1 -1
- package/dist/{logo-cfY7Ilvc.js → logo-QKrYvRFP.js} +1 -1
- package/dist/{logo-cfY7Ilvc.js.map → logo-QKrYvRFP.js.map} +1 -1
- package/dist/main.d.ts +17 -16
- package/dist/main.js +86 -85
- package/dist/{navbar-DJJMercW.js → navbar-Dxv7GQO0.js} +2 -2
- package/dist/{navbar-DJJMercW.js.map → navbar-Dxv7GQO0.js.map} +1 -1
- package/dist/{pagination-DxXjiIgC.js → pagination-DH6vZYMO.js} +1 -1
- package/dist/{pagination-DxXjiIgC.js.map → pagination-DH6vZYMO.js.map} +1 -1
- package/dist/{pagination-button-CjEZPPC8.js → pagination-button-CMSNwkeT.js} +1 -1
- package/dist/{pagination-button-CjEZPPC8.js.map → pagination-button-CMSNwkeT.js.map} +1 -1
- package/dist/{pagination-item-DXnI0BWj.js → pagination-item-DzskmZxf.js} +1 -1
- package/dist/{pagination-item-DXnI0BWj.js.map → pagination-item-DzskmZxf.js.map} +1 -1
- package/dist/{pagination-item-CEfdaSuS.d.ts → pagination-item-mKQyvHV9.d.ts} +3 -3
- package/dist/{popover-CGvBn3q9.js → popover-DmA4qMtu.js} +7 -7
- package/dist/popover-DmA4qMtu.js.map +1 -0
- package/dist/{popover-COi7S9pJ.js → popover-MUiGENkr.js} +8 -3
- package/dist/popover-MUiGENkr.js.map +1 -0
- package/dist/{popover-trigger-BLnIukvY.js → popover-trigger-Chi8uvRM.js} +2 -2
- package/dist/{popover-trigger-BLnIukvY.js.map → popover-trigger-Chi8uvRM.js.map} +1 -1
- package/dist/{popover-trigger-context-CGJlUS_N.js → popover-trigger-context-Cre9Mczn.js} +9 -3
- package/dist/popover-trigger-context-Cre9Mczn.js.map +1 -0
- package/dist/{popover-trigger-context-CQKQbCmr.d.ts → popover-trigger-context-D6z-_uL5.d.ts} +18 -6
- package/dist/{radio-Cn3PqpMt.js → radio-DAC5mhl3.js} +1 -1
- package/dist/{radio-Cn3PqpMt.js.map → radio-DAC5mhl3.js.map} +1 -1
- package/dist/{search-CdV5su_L.js → search-DRgmqncD.js} +1 -1
- package/dist/{search-CdV5su_L.js.map → search-DRgmqncD.js.map} +1 -1
- package/dist/{select-DCZV6wZu.js → select-R87VdG5U.js} +1 -1
- package/dist/{select-DCZV6wZu.js.map → select-R87VdG5U.js.map} +1 -1
- package/dist/{select-optgroup-BUaB9Yz-.js → select-optgroup-jowSQvbc.js} +1 -1
- package/dist/{select-optgroup-BUaB9Yz-.js.map → select-optgroup-jowSQvbc.js.map} +1 -1
- package/dist/{select-option-BByWq34J.js → select-option-WAhhr82L.js} +1 -1
- package/dist/{select-option-BByWq34J.js.map → select-option-WAhhr82L.js.map} +1 -1
- package/dist/{skip-link-DwuiIAvE.js → skip-link-CTmIHesZ.js} +1 -1
- package/dist/{skip-link-DwuiIAvE.js.map → skip-link-CTmIHesZ.js.map} +1 -1
- package/dist/{sticky-header-DxtaS2U0.d.ts → sticky-header-CPHxBupp.d.ts} +3 -3
- package/dist/{sticky-header-DWAJUj20.js → sticky-header-Dki5mPis.js} +1 -1
- package/dist/{sticky-header-DWAJUj20.js.map → sticky-header-Dki5mPis.js.map} +1 -1
- package/dist/{sub-navbar-DEudSxfj.js → sub-navbar-DkxQv0WJ.js} +4 -4
- package/dist/sub-navbar-DkxQv0WJ.js.map +1 -0
- package/dist/sub-navbar-qSNpTABT.js +120 -0
- package/dist/sub-navbar-qSNpTABT.js.map +1 -0
- package/dist/{tab-9qkzsjIT.js → tab-78y6QR5H.js} +1 -1
- package/dist/{tab-9qkzsjIT.js.map → tab-78y6QR5H.js.map} +1 -1
- package/dist/{tabs-CpaYfphj.js → tabs-UA0wAjuH.js} +1 -1
- package/dist/{tabs-CpaYfphj.js.map → tabs-UA0wAjuH.js.map} +1 -1
- package/dist/{tabs-list-UDrgmCSx.js → tabs-list-BykXXSuq.js} +1 -1
- package/dist/{tabs-list-UDrgmCSx.js.map → tabs-list-BykXXSuq.js.map} +1 -1
- package/dist/{tabs-panel-DeVzvQQw.js → tabs-panel-B8knWcZY.js} +1 -1
- package/dist/{tabs-panel-DeVzvQQw.js.map → tabs-panel-B8knWcZY.js.map} +1 -1
- package/dist/{textarea-C580HmQX.js → textarea-DUqVsdL4.js} +1 -1
- package/dist/{textarea-C580HmQX.js.map → textarea-DUqVsdL4.js.map} +1 -1
- package/dist/{textfield-CdqVq5R0.js → textfield-Di-19dz-.js} +3 -3
- package/dist/{textfield-CdqVq5R0.js.map → textfield-Di-19dz-.js.map} +1 -1
- package/dist/{types-Mj1poXVf.d.ts → types-BiKqUD4X.d.ts} +1 -1
- package/dist/{types-DC-FPmDA.d.ts → types-BiXTaZLc.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{useCheckboxGroup-rTVawmvi.js → useCheckboxGroup-BDH3ewt8.js} +1 -1
- package/dist/{useCheckboxGroup-rTVawmvi.js.map → useCheckboxGroup-BDH3ewt8.js.map} +1 -1
- package/dist/{useCheckboxGroup-DRhqch1m.d.ts → useCheckboxGroup-DyHY-wHm.d.ts} +1 -1
- package/dist/useIsElementAboveViewport-V1lc14eB.d.ts +8 -0
- package/dist/{useElementScrolledPastObserver-DjzJ4Mn-.js → useIsElementAboveViewport-lmdnXDdc.js} +6 -6
- package/dist/useIsElementAboveViewport-lmdnXDdc.js.map +1 -0
- package/dist/{useIsomorphicLayoutEffect-BMdz-mee.d.ts → useIsomorphicLayoutEffect-BtM0-_Y8.d.ts} +1 -1
- package/dist/{useIsomorphicLayoutEffect-B5btmYlF.js → useIsomorphicLayoutEffect-odKYwQAV.js} +1 -1
- package/dist/{useIsomorphicLayoutEffect-B5btmYlF.js.map → useIsomorphicLayoutEffect-odKYwQAV.js.map} +1 -1
- package/dist/useMediaQuery-B2wgHq1a.d.ts +32 -0
- package/dist/useMediaQuery-ICPWsO_p.js +44 -0
- package/dist/useMediaQuery-ICPWsO_p.js.map +1 -0
- package/dist/{useMergeRefs-CcJMoo46.js → useMergeRefs-DC710CHX.js} +1 -1
- package/dist/{useMergeRefs-CcJMoo46.js.map → useMergeRefs-DC710CHX.js.map} +1 -1
- package/dist/{usePagination-DNqO-ob2.js → usePagination-DQR72JNE.js} +1 -1
- package/dist/{usePagination-DNqO-ob2.js.map → usePagination-DQR72JNE.js.map} +1 -1
- package/dist/{useScrollDirection-BLgp51hx.js → useScrollDirection-C2EmQi0U.js} +1 -1
- package/dist/{useScrollDirection-BLgp51hx.js.map → useScrollDirection-C2EmQi0U.js.map} +1 -1
- package/dist/useScrollDirection-CDsglrZR.d.ts +11 -0
- package/dist/utilities/hooks/index.d.ts +17 -16
- package/dist/utilities/hooks/index.js +8 -6
- package/dist/utilities/hooks/useCheckboxGroup/useCheckboxGroup.d.ts +1 -1
- package/dist/utilities/hooks/useCheckboxGroup/useCheckboxGroup.js +1 -1
- package/dist/utilities/hooks/useIsElementAboveViewport/useIsElementAboveViewport.d.ts +2 -0
- package/dist/utilities/hooks/useIsElementAboveViewport/useIsElementAboveViewport.js +3 -0
- package/dist/utilities/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +1 -1
- package/dist/utilities/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
- package/dist/utilities/hooks/useMediaQuery/useMediaQuery.d.ts +2 -0
- package/dist/utilities/hooks/useMediaQuery/useMediaQuery.js +4 -0
- package/dist/utilities/hooks/useMergeRefs/useMergeRefs.d.ts +11 -2
- package/dist/utilities/hooks/useMergeRefs/useMergeRefs.js +1 -1
- package/dist/utilities/hooks/usePagination/usePagination.d.ts +16 -15
- package/dist/utilities/hooks/usePagination/usePagination.js +1 -1
- package/dist/utilities/hooks/useScrollDirection/useScrollDirection.d.ts +2 -11
- package/dist/utilities/hooks/useScrollDirection/useScrollDirection.js +1 -1
- package/dist/utilities/index.d.ts +17 -16
- package/dist/utilities/index.js +9 -7
- package/dist/utilities/types.d.ts +1 -1
- package/dist/{validation-message-6AQTIup_.js → validation-message-C3CmzFMz.js} +1 -1
- package/dist/{validation-message-6AQTIup_.js.map → validation-message-C3CmzFMz.js.map} +1 -1
- package/dist/vanilla/dropdown/index.d.ts +1 -1
- package/dist/vanilla/dropdown/index.js +2 -2
- package/dist/vanilla/index.d.ts +4 -3
- package/dist/vanilla/index.js +4 -3
- package/dist/vanilla/popover/index.d.ts +1 -1
- package/dist/vanilla/popover/index.js +1 -1
- package/dist/vanilla/sub-navbar/index.d.ts +2 -0
- package/dist/vanilla/sub-navbar/index.js +3 -0
- package/package.json +4 -4
- package/dist/checkbox-CxA8UXr6.js.map +0 -1
- package/dist/dialog-WgEtFqJD.js.map +0 -1
- package/dist/dropdown-D-dX5PAl.js +0 -15
- package/dist/dropdown-trigger-context-BpYBk_xf.js.map +0 -1
- package/dist/dropdown-trigger-context-C51vPffs.d.ts +0 -29
- package/dist/popover-CGvBn3q9.js.map +0 -1
- package/dist/popover-COi7S9pJ.js.map +0 -1
- package/dist/popover-trigger-context-CGJlUS_N.js.map +0 -1
- package/dist/sub-navbar-DEudSxfj.js.map +0 -1
- package/dist/useElementScrolledPastObserver-DjzJ4Mn-.js.map +0 -1
- package/dist/useMergeRefs-iCenhgmf.d.ts +0 -11
- package/dist/utilities/hooks/useElementScrolledPastObserver/useElementScrolledPastObserver.d.ts +0 -8
- package/dist/utilities/hooks/useElementScrolledPastObserver/useElementScrolledPastObserver.js +0 -3
- /package/dist/{checkbox-DdQn64cR.js → checkbox-BNKPLC2A.js} +0 -0
- /package/dist/{chip-6KumidQL.js → chip-CotWEWjj.js} +0 -0
- /package/dist/{components-CUDHzsYh.js → components-BKbhmG9u.js} +0 -0
- /package/dist/{dialog-B6bZOPYF.js → dialog-CCde3DPt.js} +0 -0
- /package/dist/{drawer-sfOVHFWA.js → drawer-Cc670B_f.js} +0 -0
- /package/dist/{dropdown-DR0Lif3r.js → dropdown-BecLkiCE.js} +0 -0
- /package/dist/{fieldset-Ds2WiAnj.js → fieldset-D5HSCHPA.js} +0 -0
- /package/dist/{filter-group-MjaWbeZO.js → filter-group-C-q_L0lS.js} +0 -0
- /package/dist/{footer-Cq6w0v2j.js → footer-BThmhXy7.js} +0 -0
- /package/dist/{hooks-BmaG9QJW.js → hooks-A8EMc2jd.js} +0 -0
- /package/dist/{link-CKJeUW0o.js → link-oWcjwJYP.js} +0 -0
- /package/dist/{logo-CIDSfhf9.js → logo-Dx-VZMJu.js} +0 -0
- /package/dist/{navbar-BuFLsqCZ.js → navbar-CgY7xCrh.js} +0 -0
- /package/dist/{pagination-DUyQRuUE.js → pagination-DP8yM-lj.js} +0 -0
- /package/dist/{popover-C4QdJkKG.js → popover-Ch_2ehYy.js} +0 -0
- /package/dist/{radio-Uyx2D7dl.js → radio-CqUVAF9T.js} +0 -0
- /package/dist/{search-VYIc3wFh.js → search-DPfMkuMX.js} +0 -0
- /package/dist/{select-D1X9tdeH.js → select-COon86Fr.js} +0 -0
- /package/dist/{skip-link-CGmg3TAi.js → skip-link-Cl5tUnjp.js} +0 -0
- /package/dist/{sticky-header-CII-Yy5M.js → sticky-header-B1bz37dV.js} +0 -0
- /package/dist/{tabs-CYBqn2Kj.js → tabs-Gam5A0Jd.js} +0 -0
- /package/dist/{textarea-D37K5D86.js → textarea-SnVkE05Y.js} +0 -0
- /package/dist/{textfield-CWoUw1b2.js → textfield-vutZ4Ch8.js} +0 -0
- /package/dist/{utilities-JoKvbhOy.js → utilities-CScrp2iY.js} +0 -0
- /package/dist/{validation-message-B4lI2a0K.js → validation-message-CtPYa33u.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-
|
|
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,SAAS,CAAC,EAAE,WAAW,MAAM,WAAW,aAAa,MAAM,IAAK,GAAG,OAAoB,KAAK;AACvG,wBACE,IAAC;EACC,WAAW,KAAK,YAAY,UAAU;EACtC,aAAW;EACX,aAAW;EACN;EACL,WAAW,CAAC,UAAU;AACpB,OAAI,MAAM,QAAQ,MAAO;AACzB,OAAI,MAAM,SAAU,OAAM,gBAAgB;AAC1C,eAAY,MAAM;EACnB;EACD,aAAa,CAAC,UAAU;AACtB,OAAI,MAAM,SAAU,OAAM,gBAAgB;AAC1C,iBAAc,MAAM;EACrB;EACD,GAAI;GACJ;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-optgroup-
|
|
1
|
+
{"version":3,"file":"select-optgroup-jowSQvbc.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,iBAAiB,CAAC,EAAE,SAAS,IAAK,GAAG,OAA4B,KAAK;CACjF,MAAM,YAAY,UAAU,OAAO;AACnC,wBAAO,IAAC;EAAU,GAAI;EAAY;GAAO;AAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-option-
|
|
1
|
+
{"version":3,"file":"select-option-WAhhr82L.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,eAAe,CAAC,EAAE,SAAS,IAAK,GAAG,OAA0B,KAAK;CAC7E,MAAM,YAAY,UAAU,OAAO;AACnC,wBAAO,IAAC;EAAU,GAAI;EAAY;GAAO;AAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-link-
|
|
1
|
+
{"version":3,"file":"skip-link-CTmIHesZ.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,WAAW,CAAC,EAAE,SAAS,UAAU,WAAW,KAAM,GAAG,OAAsB,KAAK;CAC3F,MAAM,YAAY,UAAU,OAAO;AACnC,wBACE,IAAC;EAAU,WAAW,KAAK,gBAAgB,UAAU;EAAE,aAAW;EAAM,GAAI;EACzE;GACS;AAEf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime66 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_runtime66.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { StickyHeader, StickyHeaderProps };
|
|
19
|
-
//# sourceMappingURL=sticky-header-
|
|
19
|
+
//# sourceMappingURL=sticky-header-CPHxBupp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-header-
|
|
1
|
+
{"version":3,"file":"sticky-header-Dki5mPis.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,eAAe,CAAC,EAAE,UAA6B,KAAK;CAC/D,MAAM,YAAY;AAClB,wBAAO,IAAC;EAAU,WAAU;EAAoB;GAAqB;AACtE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useScrollDirection } from "./useScrollDirection-
|
|
1
|
+
import { useIsElementAboveViewport } from "./useIsElementAboveViewport-lmdnXDdc.js";
|
|
2
|
+
import { useScrollDirection } from "./useScrollDirection-C2EmQi0U.js";
|
|
3
3
|
import clsx from "clsx/lite";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useRef } from "react";
|
|
@@ -7,7 +7,7 @@ import { useRef } from "react";
|
|
|
7
7
|
//#region src/components/navbar/sub-navbar.tsx
|
|
8
8
|
const SubNavbar = ({ dark = false, children, className, ref,...props }) => {
|
|
9
9
|
const elementRef = useRef(null);
|
|
10
|
-
const fixed =
|
|
10
|
+
const fixed = useIsElementAboveViewport(elementRef);
|
|
11
11
|
const scrollDirection = useScrollDirection();
|
|
12
12
|
return /* @__PURE__ */ jsxs("div", {
|
|
13
13
|
className: "bi-sub-navbar--wrapper",
|
|
@@ -25,4 +25,4 @@ const SubNavbar = ({ dark = false, children, className, ref,...props }) => {
|
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
27
|
export { SubNavbar };
|
|
28
|
-
//# sourceMappingURL=sub-navbar-
|
|
28
|
+
//# sourceMappingURL=sub-navbar-DkxQv0WJ.js.map
|
|
@@ -0,0 +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,YAAY,CAAC,EAAE,OAAO,OAAO,UAAU,WAAW,IAAK,GAAG,OAAuB,KAAK;CACjG,MAAM,aAAa,OAAuB,KAAK;CAC/C,MAAM,QAAQ,0BAA0B,WAAW;CACnD,MAAM,kBAAkB,oBAAoB;AAE5C,wBACE,KAAC;EAAI,WAAU;6BACb,IAAC,SAAI,KAAK,aAAc,kBACxB,IAAC;GACC,WAAW,KAAK,iBAAiB,UAAU;GAC3C,cAAY;GACZ,mBAAiB,QAAQ;GACzB,aAAW;GACX,GAAI;GACC;GAEJ;IACG;GACF;AAET"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//#region src/vanilla/sub-navbar/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* Detects the vertical scroll direction of the page.
|
|
4
|
+
* Returns 'up' | 'down' | null. The direction is only updated if the scroll distance
|
|
5
|
+
* exceeds a 5px threshold to prevent sensitivity to minor scroll jitter.
|
|
6
|
+
*/
|
|
7
|
+
var ScrollDirectionTracker = class {
|
|
8
|
+
scrollDirection = null;
|
|
9
|
+
lastScrollY = window.pageYOffset;
|
|
10
|
+
callbacks = /* @__PURE__ */ new Set();
|
|
11
|
+
constructor() {
|
|
12
|
+
this.updateScrollDirection = this.updateScrollDirection.bind(this);
|
|
13
|
+
window.addEventListener("scroll", this.updateScrollDirection);
|
|
14
|
+
}
|
|
15
|
+
updateScrollDirection() {
|
|
16
|
+
const scrollY = window.pageYOffset;
|
|
17
|
+
const direction = scrollY > this.lastScrollY ? "down" : "up";
|
|
18
|
+
if (direction !== this.scrollDirection && (scrollY - this.lastScrollY > 5 || scrollY - this.lastScrollY < -5)) {
|
|
19
|
+
this.scrollDirection = direction;
|
|
20
|
+
this.callbacks.forEach((callback) => callback(this.scrollDirection));
|
|
21
|
+
}
|
|
22
|
+
this.lastScrollY = scrollY > 0 ? scrollY : 0;
|
|
23
|
+
}
|
|
24
|
+
subscribe(callback) {
|
|
25
|
+
this.callbacks.add(callback);
|
|
26
|
+
return () => this.callbacks.delete(callback);
|
|
27
|
+
}
|
|
28
|
+
destroy() {
|
|
29
|
+
window.removeEventListener("scroll", this.updateScrollDirection);
|
|
30
|
+
this.callbacks.clear();
|
|
31
|
+
}
|
|
32
|
+
getCurrentDirection() {
|
|
33
|
+
return this.scrollDirection;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Detects when an element is scrolled past and is no longer in the viewport.
|
|
38
|
+
*/
|
|
39
|
+
var ElementAboveViewportTracker = class {
|
|
40
|
+
isAboveViewport = false;
|
|
41
|
+
observer;
|
|
42
|
+
callbacks = /* @__PURE__ */ new Set();
|
|
43
|
+
constructor(element) {
|
|
44
|
+
this.element = element;
|
|
45
|
+
this.observer = new IntersectionObserver(([entry]) => {
|
|
46
|
+
const newIsAbove = entry.boundingClientRect.y < 0;
|
|
47
|
+
if (newIsAbove !== this.isAboveViewport) {
|
|
48
|
+
this.isAboveViewport = newIsAbove;
|
|
49
|
+
this.callbacks.forEach((callback) => callback(this.isAboveViewport));
|
|
50
|
+
}
|
|
51
|
+
}, { threshold: [0] });
|
|
52
|
+
this.observer.observe(this.element);
|
|
53
|
+
}
|
|
54
|
+
subscribe(callback) {
|
|
55
|
+
this.callbacks.add(callback);
|
|
56
|
+
return () => this.callbacks.delete(callback);
|
|
57
|
+
}
|
|
58
|
+
destroy() {
|
|
59
|
+
this.observer.disconnect();
|
|
60
|
+
this.callbacks.clear();
|
|
61
|
+
}
|
|
62
|
+
getIsAboveViewport() {
|
|
63
|
+
return this.isAboveViewport;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Initializes all sub-navbars on the page to handle scroll-based behavior.
|
|
68
|
+
* This includes:
|
|
69
|
+
* - Setting data-fixed attribute when the navbar is scrolled past
|
|
70
|
+
* - Setting data-scroll-dir attribute based on scroll direction when fixed
|
|
71
|
+
*
|
|
72
|
+
* @param options Configuration options
|
|
73
|
+
* @returns Cleanup function to remove all event listeners and observers
|
|
74
|
+
*/
|
|
75
|
+
const initSubNavbar = ({ selector = ".bi-sub-navbar" } = {}) => {
|
|
76
|
+
const subNavbars = document.querySelectorAll(selector);
|
|
77
|
+
if (subNavbars.length === 0) {
|
|
78
|
+
console.warn(`No elements found with selector: ${selector}`);
|
|
79
|
+
return () => {};
|
|
80
|
+
}
|
|
81
|
+
const scrollTracker = new ScrollDirectionTracker();
|
|
82
|
+
const cleanupFunctions = [];
|
|
83
|
+
subNavbars.forEach((navbar) => {
|
|
84
|
+
const wrapper = navbar.closest(".bi-sub-navbar--wrapper");
|
|
85
|
+
if (!wrapper) {
|
|
86
|
+
console.warn("Sub-navbar must be wrapped in an element with class \"bi-sub-navbar--wrapper\"");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
let referenceElement = wrapper.querySelector("div:first-child");
|
|
90
|
+
if (!referenceElement || referenceElement === navbar) {
|
|
91
|
+
referenceElement = document.createElement("div");
|
|
92
|
+
wrapper.insertBefore(referenceElement, navbar);
|
|
93
|
+
}
|
|
94
|
+
const viewportTracker = new ElementAboveViewportTracker(referenceElement);
|
|
95
|
+
const unsubscribeViewport = viewportTracker.subscribe((isAbove) => {
|
|
96
|
+
navbar.setAttribute("data-fixed", String(isAbove));
|
|
97
|
+
if (isAbove) {
|
|
98
|
+
const currentDirection = scrollTracker.getCurrentDirection();
|
|
99
|
+
if (currentDirection) navbar.setAttribute("data-scroll-dir", currentDirection);
|
|
100
|
+
} else navbar.removeAttribute("data-scroll-dir");
|
|
101
|
+
});
|
|
102
|
+
const unsubscribeScroll = scrollTracker.subscribe((direction) => {
|
|
103
|
+
const isFixed = navbar.getAttribute("data-fixed") === "true";
|
|
104
|
+
if (isFixed && direction) navbar.setAttribute("data-scroll-dir", direction);
|
|
105
|
+
});
|
|
106
|
+
cleanupFunctions.push(() => {
|
|
107
|
+
unsubscribeViewport();
|
|
108
|
+
unsubscribeScroll();
|
|
109
|
+
viewportTracker.destroy();
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
return () => {
|
|
113
|
+
cleanupFunctions.forEach((cleanup) => cleanup());
|
|
114
|
+
scrollTracker.destroy();
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
//#endregion
|
|
119
|
+
export { initSubNavbar };
|
|
120
|
+
//# sourceMappingURL=sub-navbar-qSNpTABT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sub-navbar-qSNpTABT.js","names":["callback: (direction: 'up' | 'down' | null) => void","element: HTMLElement","callback: (isAbove: boolean) => void","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;CAC3B,AAAQ,kBAAwC;CAChD,AAAQ,cAAc,OAAO;CAC7B,AAAQ,4BAAY,IAAI;CAExB,cAAc;AACZ,OAAK,wBAAwB,KAAK,sBAAsB,KAAK,KAAK;AAClE,SAAO,iBAAiB,UAAU,KAAK,sBAAsB;CAC9D;CAED,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,QAAQ,CAAC,aAAa,SAAS,KAAK,gBAAgB,CAAC;EACrE;AAED,OAAK,cAAc,UAAU,IAAI,UAAU;CAC5C;CAED,UAAUA,UAAqD;AAC7D,OAAK,UAAU,IAAI,SAAS;AAC5B,SAAO,MAAM,KAAK,UAAU,OAAO,SAAS;CAC7C;CAED,UAAU;AACR,SAAO,oBAAoB,UAAU,KAAK,sBAAsB;AAChE,OAAK,UAAU,OAAO;CACvB;CAED,sBAAsB;AACpB,SAAO,KAAK;CACb;AACF;;;;AAKD,IAAM,8BAAN,MAAkC;CAChC,AAAQ,kBAAkB;CAC1B,AAAQ;CACR,AAAQ,4BAAY,IAAI;CAExB,YAAoBC,SAAsB;EAAtB;AAClB,OAAK,WAAW,IAAI,qBAClB,CAAC,CAAC,MAAM,KAAK;GACX,MAAM,aAAa,MAAM,mBAAmB,IAAI;AAChD,OAAI,eAAe,KAAK,iBAAiB;AACvC,SAAK,kBAAkB;AACvB,SAAK,UAAU,QAAQ,CAAC,aAAa,SAAS,KAAK,gBAAgB,CAAC;GACrE;EACF,GACD,EAAE,WAAW,CAAC,CAAE,EAAE;AAGpB,OAAK,SAAS,QAAQ,KAAK,QAAQ;CACpC;CAED,UAAUC,UAAsC;AAC9C,OAAK,UAAU,IAAI,SAAS;AAC5B,SAAO,MAAM,KAAK,UAAU,OAAO,SAAS;CAC7C;CAED,UAAU;AACR,OAAK,SAAS,YAAY;AAC1B,OAAK,UAAU,OAAO;CACvB;CAED,qBAAqB;AACnB,SAAO,KAAK;CACb;AACF;;;;;;;;;;AAmBD,MAAa,gBAAgB,CAAC,EAAE,WAAW,kBAAwC,GAAG,CAAE,MAAK;CAC3F,MAAM,aAAa,SAAS,iBAA8B,SAAS;AAEnE,KAAI,WAAW,WAAW,GAAG;AAC3B,UAAQ,MAAM,mCAAmC,SAAS,EAAE;AAC5D,SAAO,MAAM,CAAE;CAChB;CAED,MAAM,gBAAgB,IAAI;CAC1B,MAAMC,mBAAmC,CAAE;AAE3C,YAAW,QAAQ,CAAC,WAAW;EAC7B,MAAM,UAAU,OAAO,QAAQ,0BAA0B;AACzD,OAAK,SAAS;AACZ,WAAQ,KAAK,iFAA+E;AAC5F;EACD;EAGD,IAAI,mBAAmB,QAAQ,cAA2B,kBAAkB;AAC5E,OAAK,oBAAoB,qBAAqB,QAAQ;AACpD,sBAAmB,SAAS,cAAc,MAAM;AAChD,WAAQ,aAAa,kBAAkB,OAAO;EAC/C;EAED,MAAM,kBAAkB,IAAI,4BAA4B;EAGxD,MAAM,sBAAsB,gBAAgB,UAAU,CAAC,YAAY;AACjE,UAAO,aAAa,cAAc,OAAO,QAAQ,CAAC;AAGlD,OAAI,SAAS;IACX,MAAM,mBAAmB,cAAc,qBAAqB;AAC5D,QAAI,iBACF,QAAO,aAAa,mBAAmB,iBAAiB;GAE3D,MACC,QAAO,gBAAgB,kBAAkB;EAE5C,EAAC;EAGF,MAAM,oBAAoB,cAAc,UAAU,CAAC,cAAc;GAC/D,MAAM,UAAU,OAAO,aAAa,aAAa,KAAK;AACtD,OAAI,WAAW,UACb,QAAO,aAAa,mBAAmB,UAAU;EAEpD,EAAC;AAEF,mBAAiB,KAAK,MAAM;AAC1B,wBAAqB;AACrB,sBAAmB;AACnB,mBAAgB,SAAS;EAC1B,EAAC;CACH,EAAC;AAGF,QAAO,MAAM;AACX,mBAAiB,QAAQ,CAAC,YAAY,SAAS,CAAC;AAChD,gBAAc,SAAS;CACxB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-
|
|
1
|
+
{"version":3,"file":"tab-78y6QR5H.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,MAAM,CAAC,EAAE,WAAW,OAAO,UAAU,UAAU,SAAS,MAAM,IAAK,GAAG,OAAiB,KAAK;AACvG,wBACE,IAAC;EAAe;EAAiB;EAAU;4BACzC,IAAC;GACM;GACL,SAAQ;GACR,WAAW,KAAK,gBAAgB,UAAU;GAChC;GACD;GACH;GACN,GAAI;GAEH;IACM;GACD;AAEb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-
|
|
1
|
+
{"version":3,"file":"tabs-UA0wAjuH.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,OAAO,CAAC,EACnB,iBAAiB,aACjB,cAAc,cACd,cACA,OACA,UACA,UACA,WACA,SACA,MACA,IACA,GAAG,OACO,KAAK;AACf,wBACE,IAAC;EACC,WAAW,KAAK,WAAW,UAAU;EACrB;EACH;EACC;EACP;EACP,eAAe;EACN;EACT,aAAW;EACN;EACL,GAAI;EAEH;GACI;AAEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-list-
|
|
1
|
+
{"version":3,"file":"tabs-list-BykXXSuq.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,WAAW,CAAC,EAAE,WAAW,OAAO,MAAM,UAAU,SAAS,MAAM,IAAK,GAAG,OAAsB,KAAK;AAC7G,wBACE,IAAC;EACC,WAAW,KAAK,iBAAiB,UAAU;EACrC;EACG;EACT,aAAW;EACN;EACL,GAAI;EAEH;GACI;AAEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-panel-
|
|
1
|
+
{"version":3,"file":"tabs-panel-B8knWcZY.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,YAAY,CAAC,EAAE,WAAW,OAAO,YAAY,UAAU,SAAS,MAAM,IAAK,GAAG,OAAuB,KAAK;AACrH,wBACE,IAAC;EACC,WAAW,KAAK,kBAAkB,UAAU;EACrC;EACP,YAAY;EACH;EACT,aAAW;EACN;EACL,GAAI;EAEH;GACO;AAEb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea-
|
|
1
|
+
{"version":3,"file":"textarea-DUqVsdL4.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,WAAW,CAAC,EAAE,WAAW,MAAM,MAAM,IAAK,GAAG,OAAsB,KAAK;AACnF,wBAAO,IAAC;EAAS,WAAW,KAAK,YAAY,UAAU;EAAE,aAAW;EAAM,aAAW;EAAW;EAAK,GAAI;GAAS;AACnH"}
|
|
@@ -3,8 +3,8 @@ import { FieldDescription } from "./field-description-Dhm1VA08.js";
|
|
|
3
3
|
import { FieldAffix, FieldAffixes } from "./field-affix-npc6m7XL.js";
|
|
4
4
|
import { Input } from "./input-Dr7BnTyd.js";
|
|
5
5
|
import { Label } from "./label-DUzvAx-T.js";
|
|
6
|
-
import { Textarea } from "./textarea-
|
|
7
|
-
import { ValidationMessage } from "./validation-message-
|
|
6
|
+
import { Textarea } from "./textarea-DUqVsdL4.js";
|
|
7
|
+
import { ValidationMessage } from "./validation-message-C3CmzFMz.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useId } from "react";
|
|
10
10
|
|
|
@@ -61,4 +61,4 @@ const Textfield = ({ dark, label, description, error, multiline, prefix, suffix,
|
|
|
61
61
|
|
|
62
62
|
//#endregion
|
|
63
63
|
export { Textfield };
|
|
64
|
-
//# sourceMappingURL=textfield-
|
|
64
|
+
//# sourceMappingURL=textfield-Di-19dz-.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textfield-
|
|
1
|
+
{"version":3,"file":"textfield-Di-19dz-.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 };\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 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}>\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":";;;;;;;;;;;AA8CA,MAAa,YAAY,CAAC,EACxB,MACA,OACA,aACA,OACA,WACA,QACA,QACA,OACA,WACA,KACA,IAAI,QACJ,oBAAoB,oBACpB,GAAG,OACY,KAAK;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;CAAoB,EAAC,KAAK,IAAI,CAAC,MAAM;AACrG,wBACE,KAAC;EAAiB;EAAW,aAAW;EAAa;;GAClD,yBAAS,IAAC;IAAM,SAAS;cAAK;KAAc;GAC5C,+BAAe,IAAC;IAAiB,IAAI;cAAgB;KAA+B;mBACrF,KAAC;IACE,0BAAU,IAAC,wBAAY,SAAoB;IAC3C,4BACC,IAAC;KACK;KACC;KACL,gBAAc,QAAQ,MAAM;KAC5B,oBAAkB;KACZ;KACN,GAAK;MACL,mBAEF,IAAC;KACK;KACC;KACL,gBAAc,QAAQ,MAAM;KAC5B,oBAAkB;KACZ;KACN,GAAK;MACL;IAEH,0BAAU,IAAC,wBAAY,SAAoB;OAC/B;KACZ,yBAAS,IAAC;IAAkB,IAAI;cAAe;KAA0B;;GACtE;AAEX"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AsChildProps, DefaultProps, LabelRequiredProps } from "./types-
|
|
1
|
+
import { AsChildProps, DefaultProps, LabelRequiredProps } from "./types-BiKqUD4X.js";
|
|
2
2
|
export { AsChildProps, DefaultProps, LabelRequiredProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckboxGroup-
|
|
1
|
+
{"version":3,"file":"useCheckboxGroup-BDH3ewt8.js","names":["e: ChangeEvent<HTMLInputElement>"],"sources":["../src/utilities/hooks/useCheckboxGroup/useCheckboxGroup.tsx"],"sourcesContent":["import type { ChangeEvent } from 'react';\n\nexport type UseCheckboxGroupOptions = {\n options: boolean[];\n updateOptions: (checked: boolean) => void;\n};\n\nexport type UseCheckboxGroupReturn = {\n /** Spread this on the \"parent\" checkbox */\n checkboxGroupProps: {\n checked: boolean;\n indeterminate: boolean;\n onChange: (e: ChangeEvent<HTMLInputElement>) => void;\n };\n};\n\nexport const useCheckboxGroup = ({ options, updateOptions }: UseCheckboxGroupOptions): UseCheckboxGroupReturn => {\n const checked = options.every((option) => option);\n const indeterminate = options.some((option) => option) && !checked;\n\n const onChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newChecked = e.target.indeterminate ? true : e.target.checked;\n updateOptions(newChecked);\n };\n\n return {\n checkboxGroupProps: {\n checked,\n indeterminate,\n onChange,\n },\n };\n};\n"],"mappings":";AAgBA,MAAa,mBAAmB,CAAC,EAAE,SAAS,eAAwC,KAA6B;CAC/G,MAAM,UAAU,QAAQ,MAAM,CAAC,WAAW,OAAO;CACjD,MAAM,gBAAgB,QAAQ,KAAK,CAAC,WAAW,OAAO,KAAK;CAE3D,MAAM,WAAW,CAACA,MAAqC;EACrD,MAAM,aAAa,EAAE,OAAO,gBAAgB,OAAO,EAAE,OAAO;AAC5D,gBAAc,WAAW;CAC1B;AAED,QAAO,EACL,oBAAoB;EAClB;EACA;EACA;CACD,EACF;AACF"}
|
|
@@ -19,4 +19,4 @@ declare const useCheckboxGroup: ({
|
|
|
19
19
|
}: UseCheckboxGroupOptions) => UseCheckboxGroupReturn;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { UseCheckboxGroupOptions, UseCheckboxGroupReturn, useCheckboxGroup };
|
|
22
|
-
//# sourceMappingURL=useCheckboxGroup-
|
|
22
|
+
//# sourceMappingURL=useCheckboxGroup-DyHY-wHm.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/utilities/hooks/useIsElementAboveViewport/useIsElementAboveViewport.d.ts
|
|
4
|
+
/** Detects when an element's is scrolled past and is no longer in the viewport. */
|
|
5
|
+
declare const useIsElementAboveViewport: (elementRef: RefObject<HTMLElement | null>) => boolean;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { useIsElementAboveViewport };
|
|
8
|
+
//# sourceMappingURL=useIsElementAboveViewport-V1lc14eB.d.ts.map
|
package/dist/{useElementScrolledPastObserver-DjzJ4Mn-.js → useIsElementAboveViewport-lmdnXDdc.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
|
|
3
|
-
//#region src/utilities/hooks/
|
|
3
|
+
//#region src/utilities/hooks/useIsElementAboveViewport/useIsElementAboveViewport.tsx
|
|
4
4
|
/** Detects when an element's is scrolled past and is no longer in the viewport. */
|
|
5
|
-
const
|
|
6
|
-
const [
|
|
5
|
+
const useIsElementAboveViewport = (elementRef) => {
|
|
6
|
+
const [isAboveViewport, setIsPast] = useState(false);
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
const observer = new IntersectionObserver(([entry]) => setIsPast(entry.boundingClientRect.y < 0), { threshold: [0] });
|
|
9
9
|
const currentRef = elementRef.current;
|
|
@@ -12,9 +12,9 @@ const useElementScrolledPastObserver = (elementRef) => {
|
|
|
12
12
|
if (currentRef) observer.unobserve(currentRef);
|
|
13
13
|
};
|
|
14
14
|
}, [elementRef]);
|
|
15
|
-
return
|
|
15
|
+
return isAboveViewport;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
|
-
export {
|
|
20
|
-
//# sourceMappingURL=
|
|
19
|
+
export { useIsElementAboveViewport };
|
|
20
|
+
//# sourceMappingURL=useIsElementAboveViewport-lmdnXDdc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsElementAboveViewport-lmdnXDdc.js","names":["elementRef: RefObject<HTMLElement | null>"],"sources":["../src/utilities/hooks/useIsElementAboveViewport/useIsElementAboveViewport.tsx"],"sourcesContent":["import { useEffect, useState, type RefObject } from 'react';\n\n/** Detects when an element's is scrolled past and is no longer in the viewport. */\nexport const useIsElementAboveViewport = (elementRef: RefObject<HTMLElement | null>): boolean => {\n const [isAboveViewport, setIsPast] = useState(false);\n\n useEffect(() => {\n const observer = new IntersectionObserver(([entry]) => setIsPast(entry.boundingClientRect.y < 0), {\n threshold: [0],\n });\n const currentRef = elementRef.current;\n if (currentRef) observer.observe(currentRef);\n return () => {\n if (currentRef) observer.unobserve(currentRef);\n };\n }, [elementRef]);\n return isAboveViewport;\n};\n"],"mappings":";;;;AAGA,MAAa,4BAA4B,CAACA,eAAuD;CAC/F,MAAM,CAAC,iBAAiB,UAAU,GAAG,SAAS,MAAM;AAEpD,WAAU,MAAM;EACd,MAAM,WAAW,IAAI,qBAAqB,CAAC,CAAC,MAAM,KAAK,UAAU,MAAM,mBAAmB,IAAI,EAAE,EAAE,EAChG,WAAW,CAAC,CAAE,EACf;EACD,MAAM,aAAa,WAAW;AAC9B,MAAI,WAAY,UAAS,QAAQ,WAAW;AAC5C,SAAO,MAAM;AACX,OAAI,WAAY,UAAS,UAAU,WAAW;EAC/C;CACF,GAAE,CAAC,UAAW,EAAC;AAChB,QAAO;AACR"}
|
package/dist/{useIsomorphicLayoutEffect-BMdz-mee.d.ts → useIsomorphicLayoutEffect-BtM0-_Y8.d.ts}
RENAMED
|
@@ -4,4 +4,4 @@ import { useLayoutEffect } from "react";
|
|
|
4
4
|
declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { useIsomorphicLayoutEffect };
|
|
7
|
-
//# sourceMappingURL=useIsomorphicLayoutEffect-
|
|
7
|
+
//# sourceMappingURL=useIsomorphicLayoutEffect-BtM0-_Y8.d.ts.map
|
package/dist/{useIsomorphicLayoutEffect-B5btmYlF.js.map → useIsomorphicLayoutEffect-odKYwQAV.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsomorphicLayoutEffect-
|
|
1
|
+
{"version":3,"file":"useIsomorphicLayoutEffect-odKYwQAV.js","names":[],"sources":["../src/utilities/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.ts"],"sourcesContent":["// https://usehooks-ts.com/react-hook/use-isomorphic-layout-effect\n\nimport { useEffect, useLayoutEffect } from 'react';\n\nexport const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n"],"mappings":";;;AAIA,MAAa,mCAAmC,WAAW,cAAc,kBAAkB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/utilities/hooks/useMediaQuery/useMediaQuery.d.ts
|
|
2
|
+
/** Hook options. */
|
|
3
|
+
type UseMediaQueryOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* The default value to return if the hook is being run on the server.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
defaultValue?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* If `true` (default), the hook will initialize reading the media query. In SSR, you should set it to `false`, returning `options.defaultValue` or `false` initially.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
initializeWithValue?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Custom hook that tracks the state of a media query using the [`Match Media API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).
|
|
17
|
+
* @param {string} query - The media query to track.
|
|
18
|
+
* @param {?UseMediaQueryOptions} [options] - The options for customizing the behavior of the hook (optional).
|
|
19
|
+
* @returns {boolean} The current state of the media query (true if the query matches, false otherwise).
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const isSmallScreen = useMediaQuery('(max-width: 600px)');
|
|
23
|
+
* // Use `isSmallScreen` to conditionally apply styles or logic based on the screen size.
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function useMediaQuery(query: string, {
|
|
27
|
+
defaultValue,
|
|
28
|
+
initializeWithValue
|
|
29
|
+
}?: UseMediaQueryOptions): boolean;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { UseMediaQueryOptions, useMediaQuery };
|
|
32
|
+
//# sourceMappingURL=useMediaQuery-B2wgHq1a.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect-odKYwQAV.js";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/utilities/hooks/useMediaQuery/useMediaQuery.tsx
|
|
5
|
+
const IS_SERVER = typeof window === "undefined";
|
|
6
|
+
/**
|
|
7
|
+
* Custom hook that tracks the state of a media query using the [`Match Media API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).
|
|
8
|
+
* @param {string} query - The media query to track.
|
|
9
|
+
* @param {?UseMediaQueryOptions} [options] - The options for customizing the behavior of the hook (optional).
|
|
10
|
+
* @returns {boolean} The current state of the media query (true if the query matches, false otherwise).
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const isSmallScreen = useMediaQuery('(max-width: 600px)');
|
|
14
|
+
* // Use `isSmallScreen` to conditionally apply styles or logic based on the screen size.
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
function useMediaQuery(query, { defaultValue = false, initializeWithValue = true } = {}) {
|
|
18
|
+
const getMatches = (query$1) => {
|
|
19
|
+
if (IS_SERVER) return defaultValue;
|
|
20
|
+
return window.matchMedia(query$1).matches;
|
|
21
|
+
};
|
|
22
|
+
const [matches, setMatches] = useState(() => {
|
|
23
|
+
if (initializeWithValue) return getMatches(query);
|
|
24
|
+
return defaultValue;
|
|
25
|
+
});
|
|
26
|
+
function handleChange() {
|
|
27
|
+
setMatches(getMatches(query));
|
|
28
|
+
}
|
|
29
|
+
useIsomorphicLayoutEffect(() => {
|
|
30
|
+
const matchMedia = window.matchMedia(query);
|
|
31
|
+
handleChange();
|
|
32
|
+
if (matchMedia.addListener) matchMedia.addListener(handleChange);
|
|
33
|
+
else matchMedia.addEventListener("change", handleChange);
|
|
34
|
+
return () => {
|
|
35
|
+
if (matchMedia.removeListener) matchMedia.removeListener(handleChange);
|
|
36
|
+
else matchMedia.removeEventListener("change", handleChange);
|
|
37
|
+
};
|
|
38
|
+
}, [query]);
|
|
39
|
+
return matches;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { useMediaQuery };
|
|
44
|
+
//# sourceMappingURL=useMediaQuery-ICPWsO_p.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMediaQuery-ICPWsO_p.js","names":["query: string","query"],"sources":["../src/utilities/hooks/useMediaQuery/useMediaQuery.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';\n\n/** Hook options. */\nexport type UseMediaQueryOptions = {\n /**\n * The default value to return if the hook is being run on the server.\n * @default false\n */\n defaultValue?: boolean;\n /**\n * If `true` (default), the hook will initialize reading the media query. In SSR, you should set it to `false`, returning `options.defaultValue` or `false` initially.\n * @default true\n */\n initializeWithValue?: boolean;\n};\n\nconst IS_SERVER = typeof window === 'undefined';\n\n/**\n * Custom hook that tracks the state of a media query using the [`Match Media API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).\n * @param {string} query - The media query to track.\n * @param {?UseMediaQueryOptions} [options] - The options for customizing the behavior of the hook (optional).\n * @returns {boolean} The current state of the media query (true if the query matches, false otherwise).\n * @example\n * ```tsx\n * const isSmallScreen = useMediaQuery('(max-width: 600px)');\n * // Use `isSmallScreen` to conditionally apply styles or logic based on the screen size.\n * ```\n */\nexport function useMediaQuery(\n query: string,\n { defaultValue = false, initializeWithValue = true }: UseMediaQueryOptions = {},\n): boolean {\n const getMatches = (query: string): boolean => {\n if (IS_SERVER) {\n return defaultValue;\n }\n return window.matchMedia(query).matches;\n };\n\n const [matches, setMatches] = useState<boolean>(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n\n // Handles the change event of the media query.\n function handleChange() {\n setMatches(getMatches(query));\n }\n\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n\n // Triggered at the first client-side load and if query changes\n handleChange();\n\n // Use deprecated `addListener` and `removeListener` to support Safari < 14\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener('change', handleChange);\n }\n\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener('change', handleChange);\n }\n };\n }, [query]);\n\n return matches;\n}\n"],"mappings":";;;;AAkBA,MAAM,mBAAmB,WAAW;;;;;;;;;;;;AAapC,SAAgB,cACdA,OACA,EAAE,eAAe,OAAO,sBAAsB,MAA4B,GAAG,CAAE,GACtE;CACT,MAAM,aAAa,CAACA,YAA2B;AAC7C,MAAI,UACF,QAAO;AAET,SAAO,OAAO,WAAWC,QAAM,CAAC;CACjC;CAED,MAAM,CAAC,SAAS,WAAW,GAAG,SAAkB,MAAM;AACpD,MAAI,oBACF,QAAO,WAAW,MAAM;AAE1B,SAAO;CACR,EAAC;CAGF,SAAS,eAAe;AACtB,aAAW,WAAW,MAAM,CAAC;CAC9B;AAED,2BAA0B,MAAM;EAC9B,MAAM,aAAa,OAAO,WAAW,MAAM;AAG3C,gBAAc;AAGd,MAAI,WAAW,YACb,YAAW,YAAY,aAAa;MAEpC,YAAW,iBAAiB,UAAU,aAAa;AAGrD,SAAO,MAAM;AACX,OAAI,WAAW,eACb,YAAW,eAAe,aAAa;OAEvC,YAAW,oBAAoB,UAAU,aAAa;EAEzD;CACF,GAAE,CAAC,KAAM,EAAC;AAEX,QAAO;AACR"}
|