@televet/kibble-ui 4.0.0-beta.72 → 4.0.0-beta.75
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/chunks/{alert.types-eZV4C-Lo.js → alert.types-BGWEC0_6.js} +2 -2
- package/dist/chunks/{alert.types-eZV4C-Lo.js.map → alert.types-BGWEC0_6.js.map} +1 -1
- package/dist/chunks/{alert.types-8JN84Qgi.js → alert.types-DOgUeMGc.js} +3 -3
- package/dist/chunks/{alert.types-8JN84Qgi.js.map → alert.types-DOgUeMGc.js.map} +1 -1
- package/dist/chunks/{avatar.component-DFECejcq.js → avatar.component-D5UM9jeO.js} +2 -2
- package/dist/chunks/{avatar.component-DFECejcq.js.map → avatar.component-D5UM9jeO.js.map} +1 -1
- package/dist/chunks/{avatar.component-DHEnOmiw.js → avatar.component-Dl3Ir7ii.js} +13 -13
- package/dist/chunks/{avatar.component-DHEnOmiw.js.map → avatar.component-Dl3Ir7ii.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-BivC9ghH.js → avatarGroup.component-C6yuYJJg.js} +2 -2
- package/dist/chunks/{avatarGroup.component-BivC9ghH.js.map → avatarGroup.component-C6yuYJJg.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-CidA0JNq.js → avatarGroup.component-Tha21oeE.js} +2 -2
- package/dist/chunks/{avatarGroup.component-CidA0JNq.js.map → avatarGroup.component-Tha21oeE.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-dEH5U2U9.js → buttonGroup.component-BUBhIFz7.js} +2 -2
- package/dist/chunks/{buttonGroup.component-dEH5U2U9.js.map → buttonGroup.component-BUBhIFz7.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-CbB8oLRV.js → buttonGroup.component-KHqwoRY9.js} +2 -2
- package/dist/chunks/{buttonGroup.component-CbB8oLRV.js.map → buttonGroup.component-KHqwoRY9.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-D32B_18y.js → characterCounter.component-8iXYbORb.js} +2 -2
- package/dist/chunks/{characterCounter.component-D32B_18y.js.map → characterCounter.component-8iXYbORb.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-BnJlAXbZ.js → characterCounter.component-DZF9rvod.js} +2 -2
- package/dist/chunks/{characterCounter.component-BnJlAXbZ.js.map → characterCounter.component-DZF9rvod.js.map} +1 -1
- package/dist/chunks/{checkbox.component-Oc8lxpMw.js → checkbox.component-BH4qxM6n.js} +2 -2
- package/dist/chunks/{checkbox.component-Oc8lxpMw.js.map → checkbox.component-BH4qxM6n.js.map} +1 -1
- package/dist/chunks/{checkbox.component-6ixdtKi3.js → checkbox.component-DdfJseT5.js} +10 -10
- package/dist/chunks/{checkbox.component-6ixdtKi3.js.map → checkbox.component-DdfJseT5.js.map} +1 -1
- package/dist/chunks/{checkbox.records-BG_mi0eO.js → checkbox.records-4j704fMI.js} +18 -18
- package/dist/chunks/{checkbox.records-BG_mi0eO.js.map → checkbox.records-4j704fMI.js.map} +1 -1
- package/dist/chunks/checkbox.records-DI3mqSNf.js +2 -0
- package/dist/chunks/{checkbox.records-B1tMW87O.js.map → checkbox.records-DI3mqSNf.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-c1CQjpqj.js → checkboxGroup.component-B3asWtDR.js} +3 -3
- package/dist/chunks/{checkboxGroup.component-c1CQjpqj.js.map → checkboxGroup.component-B3asWtDR.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-Du63au-w.js → checkboxGroup.component-C56o9wNG.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-Du63au-w.js.map → checkboxGroup.component-C56o9wNG.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-C1PQnKmJ.js → conversationCard.component-C9Dj6SI0.js} +2 -2
- package/dist/chunks/{conversationCard.component-C1PQnKmJ.js.map → conversationCard.component-C9Dj6SI0.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-DvHrB_24.js → conversationCard.component-igPXPHJp.js} +7 -7
- package/dist/chunks/{conversationCard.component-DvHrB_24.js.map → conversationCard.component-igPXPHJp.js.map} +1 -1
- package/dist/chunks/{datePicker.component-CE_sp7uO.js → datePicker.component-Bt2a6xdy.js} +7 -8
- package/dist/chunks/datePicker.component-Bt2a6xdy.js.map +1 -0
- package/dist/chunks/{datePicker.component-B7jzOKQ9.js → datePicker.component-cGmjEzmz.js} +3 -3
- package/dist/chunks/datePicker.component-cGmjEzmz.js.map +1 -0
- package/dist/chunks/{dialog-trigger-B5NK0lr-.js → dialog-trigger-MkOQUjzu.js} +2 -2
- package/dist/chunks/{dialog-trigger-B5NK0lr-.js.map → dialog-trigger-MkOQUjzu.js.map} +1 -1
- package/dist/chunks/{dialog-trigger-BPlPzPU-.js → dialog-trigger-eqGXDXGQ.js} +9 -9
- package/dist/chunks/{dialog-trigger-BPlPzPU-.js.map → dialog-trigger-eqGXDXGQ.js.map} +1 -1
- package/dist/chunks/{heading.component-D4rtbYK8.js → heading.component-CFmI456u.js} +2 -2
- package/dist/chunks/{heading.component-D4rtbYK8.js.map → heading.component-CFmI456u.js.map} +1 -1
- package/dist/chunks/{heading.component-uv536wYF.js → heading.component-DcXXyCga.js} +2 -2
- package/dist/chunks/{heading.component-uv536wYF.js.map → heading.component-DcXXyCga.js.map} +1 -1
- package/dist/chunks/index-BR7peqZO.js +2 -0
- package/dist/chunks/{index-MlhL0PDC.js.map → index-BR7peqZO.js.map} +1 -1
- package/dist/chunks/{index-DUHFrLMI.js → index-Bff1r_rH.js} +15 -15
- package/dist/chunks/{index-DUHFrLMI.js.map → index-Bff1r_rH.js.map} +1 -1
- package/dist/chunks/index-Bz8HDeWA.js +70 -0
- package/dist/chunks/index-Bz8HDeWA.js.map +1 -0
- package/dist/chunks/index-CHIISuTq.js +3 -0
- package/dist/chunks/index-CHIISuTq.js.map +1 -0
- package/dist/chunks/{index-Co91SHhW.js → index-CJLttzPM.js} +3 -3
- package/dist/chunks/{index-Co91SHhW.js.map → index-CJLttzPM.js.map} +1 -1
- package/dist/chunks/index-CS8X6LiC.js +2 -0
- package/dist/chunks/{index-BDnnTdaJ.js.map → index-CS8X6LiC.js.map} +1 -1
- package/dist/chunks/{index-C2kxTsiE.js → index-C_AXAeNS.js} +16 -17
- package/dist/chunks/{index-C2kxTsiE.js.map → index-C_AXAeNS.js.map} +1 -1
- package/dist/chunks/{index-D9DU-5GF.js → index-Cbkb_94C.js} +48 -49
- package/dist/chunks/{index-D9DU-5GF.js.map → index-Cbkb_94C.js.map} +1 -1
- package/dist/chunks/{index-BBZxmcrY.js → index-CtXUprYH.js} +2 -2
- package/dist/chunks/{index-BBZxmcrY.js.map → index-CtXUprYH.js.map} +1 -1
- package/dist/chunks/index-DBk0LkcO.js +2 -0
- package/dist/chunks/{index-CzrXl0uD.js.map → index-DBk0LkcO.js.map} +1 -1
- package/dist/chunks/{index-BYf7SZUC.js → index-DOXzraja.js} +2 -2
- package/dist/chunks/{index-BYf7SZUC.js.map → index-DOXzraja.js.map} +1 -1
- package/dist/chunks/index-DSedXH1s.js +2 -0
- package/dist/chunks/{index-ZaGEDS_0.js.map → index-DSedXH1s.js.map} +1 -1
- package/dist/chunks/{index-CjNAJEk5.js → index-DUY19L6M.js} +105 -106
- package/dist/chunks/{index-CjNAJEk5.js.map → index-DUY19L6M.js.map} +1 -1
- package/dist/chunks/{index-Bjkz87I7.js → index-DVNjUEDJ.js} +14 -14
- package/dist/chunks/{index-Bjkz87I7.js.map → index-DVNjUEDJ.js.map} +1 -1
- package/dist/chunks/index-DbTEJc-K.js +2 -0
- package/dist/chunks/index-DbTEJc-K.js.map +1 -0
- package/dist/chunks/{index-COoMV9Mh.js → index-DowO8Ued.js} +2 -2
- package/dist/chunks/{index-COoMV9Mh.js.map → index-DowO8Ued.js.map} +1 -1
- package/dist/chunks/{index-BNYygzo-.js → index-L197Dry5.js} +17 -18
- package/dist/chunks/{index-BNYygzo-.js.map → index-L197Dry5.js.map} +1 -1
- package/dist/chunks/{index-OFP_PZ3y.js → index-OpolRlgD.js} +7 -7
- package/dist/chunks/{index-OFP_PZ3y.js.map → index-OpolRlgD.js.map} +1 -1
- package/dist/chunks/index-QTIBH1Or.js +2 -0
- package/dist/chunks/{index-CZz7hHWb.js.map → index-QTIBH1Or.js.map} +1 -1
- package/dist/chunks/index-YtNA0Ueo.js +1328 -0
- package/dist/chunks/index-YtNA0Ueo.js.map +1 -0
- package/dist/chunks/{index-Bmqy6-jf.js → index-cSjUS7Xj.js} +43 -44
- package/dist/chunks/{index-Bmqy6-jf.js.map → index-cSjUS7Xj.js.map} +1 -1
- package/dist/chunks/index-iaug4k6v.js +8 -0
- package/dist/chunks/{index-UWtj4ULm.js.map → index-iaug4k6v.js.map} +1 -1
- package/dist/chunks/{menu.component-2IRirCTG.js → menu.component-B2xPZpvP.js} +26 -26
- package/dist/chunks/{menu.component-2IRirCTG.js.map → menu.component-B2xPZpvP.js.map} +1 -1
- package/dist/chunks/menu.component-CLxbEL4l.js +2 -0
- package/dist/chunks/{menu.component-DCtztozy.js.map → menu.component-CLxbEL4l.js.map} +1 -1
- package/dist/chunks/modal.context-DSKLfsJK.js +12 -0
- package/dist/chunks/modal.context-DSKLfsJK.js.map +1 -0
- package/dist/chunks/modal.context-EJ67QNzq.js +2 -0
- package/dist/chunks/modal.context-EJ67QNzq.js.map +1 -0
- package/dist/chunks/{modal.types-Cx0d9C_x.js → modal.types-1DARAnDs.js} +5 -5
- package/dist/chunks/{modal.types-Cx0d9C_x.js.map → modal.types-1DARAnDs.js.map} +1 -1
- package/dist/chunks/modal.types-DefVbuLS.js +2 -0
- package/dist/chunks/{modal.types-DBKm96OL.js.map → modal.types-DefVbuLS.js.map} +1 -1
- package/dist/chunks/{pinInput.types-DG_lLcFk.js → pinInput.types-BELe4fEa.js} +2 -2
- package/dist/chunks/{pinInput.types-DG_lLcFk.js.map → pinInput.types-BELe4fEa.js.map} +1 -1
- package/dist/chunks/{pinInput.types-D0M2Lot4.js → pinInput.types-BeY4Vojg.js} +8 -8
- package/dist/chunks/{pinInput.types-D0M2Lot4.js.map → pinInput.types-BeY4Vojg.js.map} +1 -1
- package/dist/chunks/{popover-80QH8HEJ.js → popover-BSBYgvs4.js} +2 -2
- package/dist/chunks/{popover-80QH8HEJ.js.map → popover-BSBYgvs4.js.map} +1 -1
- package/dist/chunks/{popover-B9rNOU0g.js → popover-DNKVYG-J.js} +26 -26
- package/dist/chunks/{popover-B9rNOU0g.js.map → popover-DNKVYG-J.js.map} +1 -1
- package/dist/chunks/{popover-root-provider-CeLLpesI.js → popover-root-provider-BErev2-N.js} +8 -8
- package/dist/chunks/{popover-root-provider-CeLLpesI.js.map → popover-root-provider-BErev2-N.js.map} +1 -1
- package/dist/chunks/{popover-root-provider-DAMDDAHQ.js → popover-root-provider-C2iwUZJn.js} +2 -2
- package/dist/chunks/{popover-root-provider-DAMDDAHQ.js.map → popover-root-provider-C2iwUZJn.js.map} +1 -1
- package/dist/chunks/popover.component-C3BLog-e.js +2 -0
- package/dist/chunks/popover.component-C3BLog-e.js.map +1 -0
- package/dist/chunks/popover.component-bfBxMlWB.js +387 -0
- package/dist/chunks/popover.component-bfBxMlWB.js.map +1 -0
- package/dist/chunks/{radio.records-CDuz84qP.js → radio.records-4ih1q8nO.js} +21 -21
- package/dist/chunks/{radio.records-CDuz84qP.js.map → radio.records-4ih1q8nO.js.map} +1 -1
- package/dist/chunks/radio.records-j0JOqaJ4.js +2 -0
- package/dist/chunks/{radio.records-C-MuxSPZ.js.map → radio.records-j0JOqaJ4.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-wgmJPLDW.js → radioGroup.component-CLfrzTqO.js} +2 -2
- package/dist/chunks/{radioGroup.component-wgmJPLDW.js.map → radioGroup.component-CLfrzTqO.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-cQRj9o48.js → radioGroup.component-DILcAqYJ.js} +11 -11
- package/dist/chunks/{radioGroup.component-cQRj9o48.js.map → radioGroup.component-DILcAqYJ.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-CUPAiIW_.js → ratingDots.component-DgVeFXok.js} +2 -2
- package/dist/chunks/{ratingDots.component-CUPAiIW_.js.map → ratingDots.component-DgVeFXok.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-ClZHNCmw.js → ratingDots.component-LkQxxBRk.js} +3 -3
- package/dist/chunks/{ratingDots.component-ClZHNCmw.js.map → ratingDots.component-LkQxxBRk.js.map} +1 -1
- package/dist/chunks/{render-strategy-C8hwN3bm.js → render-strategy-CHp7lb6C.js} +2 -2
- package/dist/chunks/{render-strategy-C8hwN3bm.js.map → render-strategy-CHp7lb6C.js.map} +1 -1
- package/dist/chunks/{render-strategy-BmWbSgqh.js → render-strategy-C_zp9LNQ.js} +2 -2
- package/dist/chunks/{render-strategy-BmWbSgqh.js.map → render-strategy-C_zp9LNQ.js.map} +1 -1
- package/dist/chunks/{select.component-B-98Qic5.js → select.component-DtUSRi8T.js} +44 -44
- package/dist/chunks/{select.component-B-98Qic5.js.map → select.component-DtUSRi8T.js.map} +1 -1
- package/dist/chunks/select.component-DyGlQAN1.js +2 -0
- package/dist/chunks/{select.component-CGqMFhui.js.map → select.component-DyGlQAN1.js.map} +1 -1
- package/dist/chunks/{sortableList.component-1gWWNAQS.js → sortableList.component-BYIALi7A.js} +3 -3
- package/dist/chunks/{sortableList.component-1gWWNAQS.js.map → sortableList.component-BYIALi7A.js.map} +1 -1
- package/dist/chunks/{sortableList.component-BLYlOg_f.js → sortableList.component-xb41wpgG.js} +2 -2
- package/dist/chunks/{sortableList.component-BLYlOg_f.js.map → sortableList.component-xb41wpgG.js.map} +1 -1
- package/dist/chunks/{spinner.component-BnWQ5OjN.js → spinner.component-CUOBS0aT.js} +2 -2
- package/dist/chunks/{spinner.component-BnWQ5OjN.js.map → spinner.component-CUOBS0aT.js.map} +1 -1
- package/dist/chunks/{spinner.component-Ebdkd2br.js → spinner.component-Z6B9DyOP.js} +2 -2
- package/dist/chunks/{spinner.component-Ebdkd2br.js.map → spinner.component-Z6B9DyOP.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-B1WPMZAS.js → styledAvatar.types-6kAk8MH3.js} +2 -2
- package/dist/chunks/{styledAvatar.types-B1WPMZAS.js.map → styledAvatar.types-6kAk8MH3.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-C0KWX23C.js → styledAvatar.types-DrZ-wDhH.js} +2 -2
- package/dist/chunks/{styledAvatar.types-C0KWX23C.js.map → styledAvatar.types-DrZ-wDhH.js.map} +1 -1
- package/dist/chunks/{switch.component-D5kgSKKx.js → switch.component-BDRM_BIa.js} +2 -2
- package/dist/chunks/{switch.component-D5kgSKKx.js.map → switch.component-BDRM_BIa.js.map} +1 -1
- package/dist/chunks/{switch.component-Bsn6yqT1.js → switch.component-DFpYXcBq.js} +11 -11
- package/dist/chunks/{switch.component-Bsn6yqT1.js.map → switch.component-DFpYXcBq.js.map} +1 -1
- package/dist/chunks/{tabs.component-SlXJb1rB.js → tabs.component-B1WW0jL6.js} +2 -2
- package/dist/chunks/{tabs.component-SlXJb1rB.js.map → tabs.component-B1WW0jL6.js.map} +1 -1
- package/dist/chunks/{tabs.component-Bi1vanBo.js → tabs.component-BkK4IYtB.js} +47 -47
- package/dist/chunks/{tabs.component-Bi1vanBo.js.map → tabs.component-BkK4IYtB.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-CYmPDQlq.js → tagBlock.component-DDIMgSxQ.js} +5 -5
- package/dist/chunks/{tagBlock.component-CYmPDQlq.js.map → tagBlock.component-DDIMgSxQ.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-CLB4ggMT.js → tagBlock.component-yTKvfpop.js} +2 -2
- package/dist/chunks/{tagBlock.component-CLB4ggMT.js.map → tagBlock.component-yTKvfpop.js.map} +1 -1
- package/dist/chunks/{text.component-BZQWS29V.js → text.component-DQGjLZ3k.js} +2 -2
- package/dist/chunks/{text.component-BZQWS29V.js.map → text.component-DQGjLZ3k.js.map} +1 -1
- package/dist/chunks/{text.component-BZSCPJLf.js → text.component-kSzl3EKT.js} +2 -2
- package/dist/chunks/{text.component-BZSCPJLf.js.map → text.component-kSzl3EKT.js.map} +1 -1
- package/dist/chunks/{textInput.component-B0VClMq5.js → textInput.component-BJ4sM5QZ.js} +2 -2
- package/dist/chunks/{textInput.component-B0VClMq5.js.map → textInput.component-BJ4sM5QZ.js.map} +1 -1
- package/dist/chunks/{textInput.component-kSJAjj78.js → textInput.component-BJglG821.js} +12 -12
- package/dist/chunks/{textInput.component-kSJAjj78.js.map → textInput.component-BJglG821.js.map} +1 -1
- package/dist/chunks/{textarea.component-BubrZCI9.js → textarea.component-Clw_DDNc.js} +7 -7
- package/dist/chunks/{textarea.component-BubrZCI9.js.map → textarea.component-Clw_DDNc.js.map} +1 -1
- package/dist/chunks/{textarea.component-DZ89XNHw.js → textarea.component-uETzOPKq.js} +2 -2
- package/dist/chunks/{textarea.component-DZ89XNHw.js.map → textarea.component-uETzOPKq.js.map} +1 -1
- package/dist/chunks/{theme.provider-2Kdf3RF1.js → theme.provider-BLLaoaPN.js} +1996 -1925
- package/dist/chunks/theme.provider-BLLaoaPN.js.map +1 -0
- package/dist/chunks/theme.provider-Dw3CcP_4.js +26 -0
- package/dist/chunks/theme.provider-Dw3CcP_4.js.map +1 -0
- package/dist/chunks/{timePicker.component-DyoR0UBJ.js → timePicker.component-BCq4ONHX.js} +2 -2
- package/dist/chunks/timePicker.component-BCq4ONHX.js.map +1 -0
- package/dist/chunks/{timePicker.component-hHOzJUi7.js → timePicker.component-Dth5j7XG.js} +19 -20
- package/dist/chunks/timePicker.component-Dth5j7XG.js.map +1 -0
- package/dist/chunks/{timeRange.component-C2anTUsM.js → timeRange.component-D1QCKbW8.js} +2 -2
- package/dist/chunks/{timeRange.component-C2anTUsM.js.map → timeRange.component-D1QCKbW8.js.map} +1 -1
- package/dist/chunks/{timeRange.component-PlO6xxkd.js → timeRange.component-JjgrKlHx.js} +2 -2
- package/dist/chunks/{timeRange.component-PlO6xxkd.js.map → timeRange.component-JjgrKlHx.js.map} +1 -1
- package/dist/chunks/{timestamp.component-T3aszXN_.js → timestamp.component-BNx_9bo5.js} +2 -2
- package/dist/chunks/{timestamp.component-T3aszXN_.js.map → timestamp.component-BNx_9bo5.js.map} +1 -1
- package/dist/chunks/{timestamp.component-C__DC7oq.js → timestamp.component-QlZU9TRD.js} +3 -3
- package/dist/chunks/{timestamp.component-C__DC7oq.js.map → timestamp.component-QlZU9TRD.js.map} +1 -1
- package/dist/chunks/{toaster.records-BGfpUOVt.js → toaster.records-CcwOeMM7.js} +21 -22
- package/dist/chunks/{toaster.records-BGfpUOVt.js.map → toaster.records-CcwOeMM7.js.map} +1 -1
- package/dist/chunks/toaster.records-zJfplz5w.js +2 -0
- package/dist/chunks/{toaster.records-BJo0j1IZ.js.map → toaster.records-zJfplz5w.js.map} +1 -1
- package/dist/chunks/{popover.recipe--gMRcQTS.js → tooltip.component-BpVUgNK_.js} +186 -150
- package/dist/chunks/tooltip.component-BpVUgNK_.js.map +1 -0
- package/dist/chunks/tooltip.component-scJd-lU5.js +2 -0
- package/dist/chunks/tooltip.component-scJd-lU5.js.map +1 -0
- package/dist/chunks/{typography.records-C6G_65b4.js → typography.records-CSy2LmDd.js} +2 -2
- package/dist/chunks/{typography.records-C6G_65b4.js.map → typography.records-CSy2LmDd.js.map} +1 -1
- package/dist/chunks/{typography.records-jnjWfTLS.js → typography.records-H4aA5AOA.js} +2 -2
- package/dist/chunks/{typography.records-jnjWfTLS.js.map → typography.records-H4aA5AOA.js.map} +1 -1
- package/dist/chunks/{use-field-context--wBJQY1R.js → use-field-context-CArmgHPP.js} +2 -2
- package/dist/chunks/{use-field-context--wBJQY1R.js.map → use-field-context-CArmgHPP.js.map} +1 -1
- package/dist/chunks/{use-field-context-B_G7Yziz.js → use-field-context-Cm3grEyV.js} +2 -2
- package/dist/chunks/{use-field-context-B_G7Yziz.js.map → use-field-context-Cm3grEyV.js.map} +1 -1
- package/dist/chunks/{use-locale-context-D-agiW5E.js → use-locale-context-BiiNTYMT.js} +29 -29
- package/dist/chunks/{use-locale-context-D-agiW5E.js.map → use-locale-context-BiiNTYMT.js.map} +1 -1
- package/dist/chunks/{use-locale-context-BdqHZ8L8.js → use-locale-context-D0LByRu9.js} +2 -2
- package/dist/chunks/{use-locale-context-BdqHZ8L8.js.map → use-locale-context-D0LByRu9.js.map} +1 -1
- package/dist/chunks/{withFormControl-_nV7mlmV.js → withFormControl-BtHmtdLR.js} +2 -2
- package/dist/chunks/{withFormControl-_nV7mlmV.js.map → withFormControl-BtHmtdLR.js.map} +1 -1
- package/dist/chunks/{withFormControl-5ywq6Y2v.js → withFormControl-C8n6PnvV.js} +49 -49
- package/dist/chunks/{withFormControl-5ywq6Y2v.js.map → withFormControl-C8n6PnvV.js.map} +1 -1
- package/dist/chunks/{withTruncation-DH07KRFn.js → withTruncation-CQ_XLQwq.js} +2 -2
- package/dist/chunks/{withTruncation-DH07KRFn.js.map → withTruncation-CQ_XLQwq.js.map} +1 -1
- package/dist/chunks/{withTruncation-D4DrwvZ2.js → withTruncation-DCOhuLMb.js} +2 -2
- package/dist/chunks/{withTruncation-D4DrwvZ2.js.map → withTruncation-DCOhuLMb.js.map} +1 -1
- package/dist/cjs/chakra/index.cjs +1 -1
- package/dist/cjs/components/Alert/index.cjs +1 -1
- package/dist/cjs/components/Avatar/index.cjs +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/CharacterCounter/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/index.cjs +1 -1
- package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/Heading/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/Modal/index.cjs +1 -1
- package/dist/cjs/components/PinInput/index.cjs +1 -1
- package/dist/cjs/components/Popover/index.cjs +1 -1
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/RatingDots/index.cjs +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/SortableList/index.cjs +1 -1
- package/dist/cjs/components/Spinner/index.cjs +1 -1
- package/dist/cjs/components/StyledAvatar/index.cjs +1 -1
- package/dist/cjs/components/Switch/index.cjs +1 -1
- package/dist/cjs/components/Tabs/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/Text/index.cjs +1 -1
- package/dist/cjs/components/TextInput/index.cjs +1 -1
- package/dist/cjs/components/Textarea/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/Timestamp/index.cjs +1 -1
- package/dist/cjs/components/Toast/index.cjs +1 -1
- package/dist/cjs/components/Tooltip/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/index.cjs +1 -1
- package/dist/esm/chakra/index.js +66 -66
- package/dist/esm/components/Alert/index.js +1 -1
- package/dist/esm/components/Avatar/index.js +1 -1
- package/dist/esm/components/AvatarGroup/index.js +1 -1
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/CharacterCounter/index.js +1 -1
- package/dist/esm/components/Checkbox/index.js +1 -1
- package/dist/esm/components/CheckboxGroup/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +1 -1
- package/dist/esm/components/Heading/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/Modal/index.js +1 -1
- package/dist/esm/components/PinInput/index.js +1 -1
- package/dist/esm/components/Popover/index.js +1 -1
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/RatingDots/index.js +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/SortableList/index.js +1 -1
- package/dist/esm/components/Spinner/index.js +1 -1
- package/dist/esm/components/StyledAvatar/index.js +1 -1
- package/dist/esm/components/Switch/index.js +1 -1
- package/dist/esm/components/Tabs/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/Text/index.js +1 -1
- package/dist/esm/components/TextInput/index.js +1 -1
- package/dist/esm/components/Textarea/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/Timestamp/index.js +1 -1
- package/dist/esm/components/Toast/index.js +1 -1
- package/dist/esm/components/Tooltip/index.js +1 -1
- package/dist/esm/components/index.js +30 -30
- package/dist/esm/index.js +54 -55
- package/dist/esm/theme/index.js +2 -3
- package/dist/types/components/Avatar/avatar.recipe.d.ts +1 -1
- package/dist/types/components/Button/button.recipe.d.ts +1 -1
- package/dist/types/components/Logo/logo.recipe.d.ts +1 -1
- package/dist/types/components/Modal/modal.recipe.d.ts +1 -1
- package/dist/types/components/Popover/popover.recipe.d.ts +1 -1
- package/dist/types/components/TimePicker/timePicker.recipe.d.ts +1 -1
- package/dist/types/components/Tooltip/tooltip.component.d.ts +4 -2
- package/dist/types/components/Tooltip/tooltip.recipe.d.ts +1 -1
- package/dist/types/theme/index.d.ts +1 -1
- package/dist/types/theme/providers/theme.provider.d.ts +0 -1
- package/dist/types/theme/theme.config.d.ts +0 -1
- package/dist/types/theme/tokens/shadows/shadows.config.d.ts +3 -3
- package/dist/types/theme/tokens/sizes/sizes.config.d.ts +3 -3
- package/dist/types/theme/tokens/spacing/spacing.config.d.ts +3 -3
- package/dist/types/theme/tokens/transitions/transitions.config.d.ts +2 -2
- package/dist/types/theme/tokens/zIndices/zIndices.config.d.ts +3 -3
- package/package.json +1 -1
- package/dist/chunks/checkbox.records-B1tMW87O.js +0 -2
- package/dist/chunks/datePicker.component-B7jzOKQ9.js.map +0 -1
- package/dist/chunks/datePicker.component-CE_sp7uO.js.map +0 -1
- package/dist/chunks/index-BDnnTdaJ.js +0 -2
- package/dist/chunks/index-BGwwyukg.js +0 -2
- package/dist/chunks/index-BGwwyukg.js.map +0 -1
- package/dist/chunks/index-CYk-7wwG.js +0 -1018
- package/dist/chunks/index-CYk-7wwG.js.map +0 -1
- package/dist/chunks/index-CZ42b9rT.js +0 -3
- package/dist/chunks/index-CZ42b9rT.js.map +0 -1
- package/dist/chunks/index-CZz7hHWb.js +0 -2
- package/dist/chunks/index-CzrXl0uD.js +0 -2
- package/dist/chunks/index-MlhL0PDC.js +0 -2
- package/dist/chunks/index-UWtj4ULm.js +0 -8
- package/dist/chunks/index-ZaGEDS_0.js +0 -2
- package/dist/chunks/index-j7W9Hyzx.js +0 -322
- package/dist/chunks/index-j7W9Hyzx.js.map +0 -1
- package/dist/chunks/menu.component-DCtztozy.js +0 -2
- package/dist/chunks/modal.types-DBKm96OL.js +0 -2
- package/dist/chunks/popover.component-D27f6GTu.js +0 -322
- package/dist/chunks/popover.component-D27f6GTu.js.map +0 -1
- package/dist/chunks/popover.component-KGVUAj9L.js +0 -2
- package/dist/chunks/popover.component-KGVUAj9L.js.map +0 -1
- package/dist/chunks/popover.recipe--gMRcQTS.js.map +0 -1
- package/dist/chunks/popover.recipe-DLeyokHo.js +0 -2
- package/dist/chunks/popover.recipe-DLeyokHo.js.map +0 -1
- package/dist/chunks/radio.records-C-MuxSPZ.js +0 -2
- package/dist/chunks/select.component-CGqMFhui.js +0 -2
- package/dist/chunks/theme.provider-2Kdf3RF1.js.map +0 -1
- package/dist/chunks/theme.provider-DpipTk0L.js +0 -48
- package/dist/chunks/theme.provider-DpipTk0L.js.map +0 -1
- package/dist/chunks/timePicker.component-DyoR0UBJ.js.map +0 -1
- package/dist/chunks/timePicker.component-hHOzJUi7.js.map +0 -1
- package/dist/chunks/toaster.records-BJo0j1IZ.js +0 -2
- package/dist/chunks/tooltip.component-G-RF87Zw.js +0 -750
- package/dist/chunks/tooltip.component-G-RF87Zw.js.map +0 -1
- package/dist/chunks/tooltip.component-Vo-2841s.js +0 -2
- package/dist/chunks/tooltip.component-Vo-2841s.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { W as c } from "./text.component-
|
|
2
|
+
import { W as c } from "./text.component-kSzl3EKT.js";
|
|
3
3
|
import { t as n } from "./typography-Cqrokog3.js";
|
|
4
4
|
import { a as d } from "./config-DlTdf-Yt.js";
|
|
5
5
|
import { u as b } from "./use-slot-recipe-DhtQ1j_5.js";
|
|
@@ -176,4 +176,4 @@ const S = ["root", "spinner", "label"], u = {
|
|
|
176
176
|
export {
|
|
177
177
|
V as S
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=spinner.component-
|
|
179
|
+
//# sourceMappingURL=spinner.component-CUOBS0aT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.component-
|
|
1
|
+
{"version":3,"file":"spinner.component-CUOBS0aT.js","sources":["../../src/components/Spinner/spinner.recipe.ts","../../src/components/Spinner/spinner.component.tsx"],"sourcesContent":["import {\n defineSlotRecipe,\n SystemStyleObject,\n} from \"@chakra-ui/react/styled-system\";\nimport { SpinnerSize } from \"./spinner.types\";\nimport { TypographyVariant } from \"shared/types\";\nimport { typographyVariantStyles } from \"../../shared/records/typography\";\n\nconst spinnerSlots = [\"root\", \"spinner\", \"label\"] as const;\ntype SpinnerSlot = (typeof spinnerSlots)[number];\ntype SpinnerSlotStyles = {\n [key in SpinnerSlot]?: SystemStyleObject;\n};\n\nconst spinnerSizeStyles: Record<SpinnerSize, SpinnerSlotStyles> = {\n xs: {\n spinner: {\n h: 3,\n w: 3,\n },\n label: {\n fontSize: \"xs\",\n },\n },\n sm: {\n spinner: {\n h: 4,\n w: 4,\n },\n label: {\n fontSize: \"sm\",\n },\n },\n md: {\n spinner: {\n h: 6,\n w: 6,\n \"--spinner-size\": 6,\n },\n label: {\n fontSize: \"md\",\n },\n },\n lg: {\n spinner: {\n h: 8,\n w: 8,\n },\n label: {\n fontSize: \"lg\",\n },\n },\n xl: {\n spinner: {\n h: 12,\n w: 12,\n },\n label: {\n fontSize: \"xl\",\n },\n },\n};\n\nconst spinnerVariantStyles: Record<TypographyVariant, SpinnerSlotStyles> = {\n accent: {\n spinner: typographyVariantStyles.accent,\n },\n accentSubtle: {\n spinner: typographyVariantStyles.accentSubtle,\n },\n brand: {\n spinner: typographyVariantStyles.brand,\n },\n brandOnContrast: {\n spinner: typographyVariantStyles.brandOnContrast,\n },\n danger: {\n spinner: typographyVariantStyles.danger,\n },\n dangerOnContrast: {\n spinner: typographyVariantStyles.dangerOnContrast,\n },\n default: {\n spinner: typographyVariantStyles.default,\n },\n info: {\n spinner: typographyVariantStyles.info,\n },\n interactive: {\n spinner: typographyVariantStyles.interactive,\n },\n interactiveOnContrast: {\n spinner: typographyVariantStyles.interactiveOnContrast,\n },\n onContrast: {\n spinner: typographyVariantStyles.onContrast,\n },\n placeholder: {\n spinner: typographyVariantStyles.placeholder,\n },\n placeholderOnContrast: {\n spinner: typographyVariantStyles.placeholderOnContrast,\n },\n subtle: {\n spinner: typographyVariantStyles.subtle,\n },\n subtleOnContrast: {\n spinner: typographyVariantStyles.subtleOnContrast,\n },\n success: {\n spinner: typographyVariantStyles.success,\n },\n warning: {\n spinner: typographyVariantStyles.warning,\n },\n};\n\nexport const spinnerRecipe = defineSlotRecipe({\n slots: spinnerSlots,\n base: {\n root: {\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n },\n variants: {\n variant: spinnerVariantStyles,\n size: spinnerSizeStyles,\n fullScreen: {\n true: {\n root: {\n h: \"100%\",\n left: 0,\n top: 0,\n position: \"absolute\",\n w: \"100%\",\n zIndex: \"tooltipExtra\",\n },\n },\n false: {\n root: {\n h: \"max-content\",\n w: \"max-content\",\n },\n },\n },\n },\n defaultVariants: {\n fullScreen: false,\n size: \"md\",\n variant: \"brand\",\n },\n});\n","import React from \"react\";\nimport { Spinner as CSpinner } from \"@chakra-ui/react/spinner\";\nimport { VStack } from \"@chakra-ui/react/stack\";\nimport { SpinnerSize } from \"./spinner.types\";\nimport { Text, TextProps } from \"components/Text/text.component\";\nimport { TypographyVariant } from \"shared/types\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { spinnerRecipe } from \"./spinner.recipe\";\nimport { SemanticBackgroundColorToken } from \"theme/semanticTokens\";\n\nexport interface SpinnerProps {\n backdropColor?: SemanticBackgroundColorToken;\n fullScreen?: boolean;\n label?: string;\n labelProps?: Omit<TextProps, \"chilren\">;\n showLabel?: boolean;\n size?: SpinnerSize;\n variant?: TypographyVariant;\n}\n\nexport const Spinner = ({\n backdropColor = \"background.alpha.pressed\",\n fullScreen = false,\n label = \"Loading...\",\n labelProps,\n showLabel = false,\n size = \"md\",\n variant = \"accent\",\n}: SpinnerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: spinnerRecipe });\n const styles = recipe({ variant, size, fullScreen });\n\n return (\n <VStack\n className=\"Spinner\"\n data-testid=\"kibble-spinner\"\n css={styles.root}\n {...(fullScreen && { bg: backdropColor })}\n >\n <CSpinner css={styles.spinner} />\n {showLabel && (\n <Text\n className=\"Spinner__Label\"\n data-testid=\"kibble-spinner-label\"\n variant=\"subtle\"\n css={styles.label}\n {...labelProps}\n >\n {label}\n </Text>\n )}\n </VStack>\n );\n};\n"],"names":["spinnerSlots","spinnerSizeStyles","spinnerVariantStyles","typographyVariantStyles","spinnerRecipe","defineSlotRecipe","Spinner","backdropColor","fullScreen","label","labelProps","showLabel","size","variant","styles","useSlotRecipe","jsxs","VStack","jsx","CSpinner","Text"],"mappings":";;;;;;;AAQA,MAAMA,IAAe,CAAC,QAAQ,WAAW,OAAO,GAM1CC,IAA4D;AAAA,EAChE,IAAI;AAAA,IACF,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,OAAO;AAAA,MACL,UAAU;AAAA,IAAA;AAAA,EAEd;AAAA,EACA,IAAI;AAAA,IACF,SAAS;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,KAAKH,EAAO;AAAA,MACX,GAAIN,KAAc,EAAE,IAAID,EAAc;AAAA,MAEvC,UAAA;AAAA,QAACW,gBAAAA,EAAAA,IAAAC,GAAA,EAAS,KAAKL,EAAO,QAAS,CAAA;AAAA,QAC9BH,KACCO,gBAAAA,EAAA;AAAA,UAACE;AAAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,eAAY;AAAA,YACZ,SAAQ;AAAA,YACR,KAAKN,EAAO;AAAA,YACX,GAAGJ;AAAA,YAEH,UAAAD;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("./jsx-runtime-BjDatQAs.js"),c=require("./text.component-
|
|
2
|
-
//# sourceMappingURL=spinner.component-
|
|
1
|
+
"use strict";const t=require("./jsx-runtime-BjDatQAs.js"),c=require("./text.component-DQGjLZ3k.js"),n=require("./typography-CtiaGoJG.js"),y=require("./config-BFcXpdZo.js"),S=require("./use-slot-recipe-8liupslO.js"),d=require("./v-stack-DxjgpeJ0.js"),h=require("./spinner-BnpL14kK.js"),u=["root","spinner","label"],g={xs:{spinner:{h:3,w:3},label:{fontSize:"xs"}},sm:{spinner:{h:4,w:4},label:{fontSize:"sm"}},md:{spinner:{h:6,w:6,"--spinner-size":6},label:{fontSize:"md"}},lg:{spinner:{h:8,w:8},label:{fontSize:"lg"}},xl:{spinner:{h:12,w:12},label:{fontSize:"xl"}}},b={accent:{spinner:n.typographyVariantStyles.accent},accentSubtle:{spinner:n.typographyVariantStyles.accentSubtle},brand:{spinner:n.typographyVariantStyles.brand},brandOnContrast:{spinner:n.typographyVariantStyles.brandOnContrast},danger:{spinner:n.typographyVariantStyles.danger},dangerOnContrast:{spinner:n.typographyVariantStyles.dangerOnContrast},default:{spinner:n.typographyVariantStyles.default},info:{spinner:n.typographyVariantStyles.info},interactive:{spinner:n.typographyVariantStyles.interactive},interactiveOnContrast:{spinner:n.typographyVariantStyles.interactiveOnContrast},onContrast:{spinner:n.typographyVariantStyles.onContrast},placeholder:{spinner:n.typographyVariantStyles.placeholder},placeholderOnContrast:{spinner:n.typographyVariantStyles.placeholderOnContrast},subtle:{spinner:n.typographyVariantStyles.subtle},subtleOnContrast:{spinner:n.typographyVariantStyles.subtleOnContrast},success:{spinner:n.typographyVariantStyles.success},warning:{spinner:n.typographyVariantStyles.warning}},x=y.defineSlotRecipe({slots:u,base:{root:{alignItems:"center",justifyContent:"center"}},variants:{variant:b,size:g,fullScreen:{true:{root:{h:"100%",left:0,top:0,position:"absolute",w:"100%",zIndex:"tooltipExtra"}},false:{root:{h:"max-content",w:"max-content"}}}},defaultVariants:{fullScreen:!1,size:"md",variant:"brand"}}),V=({backdropColor:s="background.alpha.pressed",fullScreen:r=!1,label:a="Loading...",labelProps:i,showLabel:p=!1,size:o="md",variant:l="accent"})=>{const e=S.useSlotRecipe({recipe:x})({variant:l,size:o,fullScreen:r});return t.jsxRuntimeExports.jsxs(d.VStack,{className:"Spinner","data-testid":"kibble-spinner",css:e.root,...r&&{bg:s},children:[t.jsxRuntimeExports.jsx(h.Spinner,{css:e.spinner}),p&&t.jsxRuntimeExports.jsx(c.WrappedText,{className:"Spinner__Label","data-testid":"kibble-spinner-label",variant:"subtle",css:e.label,...i,children:a})]})};exports.Spinner=V;
|
|
2
|
+
//# sourceMappingURL=spinner.component-Z6B9DyOP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.component-
|
|
1
|
+
{"version":3,"file":"spinner.component-Z6B9DyOP.js","sources":["../../src/components/Spinner/spinner.recipe.ts","../../src/components/Spinner/spinner.component.tsx"],"sourcesContent":["import {\n defineSlotRecipe,\n SystemStyleObject,\n} from \"@chakra-ui/react/styled-system\";\nimport { SpinnerSize } from \"./spinner.types\";\nimport { TypographyVariant } from \"shared/types\";\nimport { typographyVariantStyles } from \"../../shared/records/typography\";\n\nconst spinnerSlots = [\"root\", \"spinner\", \"label\"] as const;\ntype SpinnerSlot = (typeof spinnerSlots)[number];\ntype SpinnerSlotStyles = {\n [key in SpinnerSlot]?: SystemStyleObject;\n};\n\nconst spinnerSizeStyles: Record<SpinnerSize, SpinnerSlotStyles> = {\n xs: {\n spinner: {\n h: 3,\n w: 3,\n },\n label: {\n fontSize: \"xs\",\n },\n },\n sm: {\n spinner: {\n h: 4,\n w: 4,\n },\n label: {\n fontSize: \"sm\",\n },\n },\n md: {\n spinner: {\n h: 6,\n w: 6,\n \"--spinner-size\": 6,\n },\n label: {\n fontSize: \"md\",\n },\n },\n lg: {\n spinner: {\n h: 8,\n w: 8,\n },\n label: {\n fontSize: \"lg\",\n },\n },\n xl: {\n spinner: {\n h: 12,\n w: 12,\n },\n label: {\n fontSize: \"xl\",\n },\n },\n};\n\nconst spinnerVariantStyles: Record<TypographyVariant, SpinnerSlotStyles> = {\n accent: {\n spinner: typographyVariantStyles.accent,\n },\n accentSubtle: {\n spinner: typographyVariantStyles.accentSubtle,\n },\n brand: {\n spinner: typographyVariantStyles.brand,\n },\n brandOnContrast: {\n spinner: typographyVariantStyles.brandOnContrast,\n },\n danger: {\n spinner: typographyVariantStyles.danger,\n },\n dangerOnContrast: {\n spinner: typographyVariantStyles.dangerOnContrast,\n },\n default: {\n spinner: typographyVariantStyles.default,\n },\n info: {\n spinner: typographyVariantStyles.info,\n },\n interactive: {\n spinner: typographyVariantStyles.interactive,\n },\n interactiveOnContrast: {\n spinner: typographyVariantStyles.interactiveOnContrast,\n },\n onContrast: {\n spinner: typographyVariantStyles.onContrast,\n },\n placeholder: {\n spinner: typographyVariantStyles.placeholder,\n },\n placeholderOnContrast: {\n spinner: typographyVariantStyles.placeholderOnContrast,\n },\n subtle: {\n spinner: typographyVariantStyles.subtle,\n },\n subtleOnContrast: {\n spinner: typographyVariantStyles.subtleOnContrast,\n },\n success: {\n spinner: typographyVariantStyles.success,\n },\n warning: {\n spinner: typographyVariantStyles.warning,\n },\n};\n\nexport const spinnerRecipe = defineSlotRecipe({\n slots: spinnerSlots,\n base: {\n root: {\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n },\n variants: {\n variant: spinnerVariantStyles,\n size: spinnerSizeStyles,\n fullScreen: {\n true: {\n root: {\n h: \"100%\",\n left: 0,\n top: 0,\n position: \"absolute\",\n w: \"100%\",\n zIndex: \"tooltipExtra\",\n },\n },\n false: {\n root: {\n h: \"max-content\",\n w: \"max-content\",\n },\n },\n },\n },\n defaultVariants: {\n fullScreen: false,\n size: \"md\",\n variant: \"brand\",\n },\n});\n","import React from \"react\";\nimport { Spinner as CSpinner } from \"@chakra-ui/react/spinner\";\nimport { VStack } from \"@chakra-ui/react/stack\";\nimport { SpinnerSize } from \"./spinner.types\";\nimport { Text, TextProps } from \"components/Text/text.component\";\nimport { TypographyVariant } from \"shared/types\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { spinnerRecipe } from \"./spinner.recipe\";\nimport { SemanticBackgroundColorToken } from \"theme/semanticTokens\";\n\nexport interface SpinnerProps {\n backdropColor?: SemanticBackgroundColorToken;\n fullScreen?: boolean;\n label?: string;\n labelProps?: Omit<TextProps, \"chilren\">;\n showLabel?: boolean;\n size?: SpinnerSize;\n variant?: TypographyVariant;\n}\n\nexport const Spinner = ({\n backdropColor = \"background.alpha.pressed\",\n fullScreen = false,\n label = \"Loading...\",\n labelProps,\n showLabel = false,\n size = \"md\",\n variant = \"accent\",\n}: SpinnerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: spinnerRecipe });\n const styles = recipe({ variant, size, fullScreen });\n\n return (\n <VStack\n className=\"Spinner\"\n data-testid=\"kibble-spinner\"\n css={styles.root}\n {...(fullScreen && { bg: backdropColor })}\n >\n <CSpinner css={styles.spinner} />\n {showLabel && (\n <Text\n className=\"Spinner__Label\"\n data-testid=\"kibble-spinner-label\"\n variant=\"subtle\"\n css={styles.label}\n {...labelProps}\n >\n {label}\n </Text>\n )}\n </VStack>\n );\n};\n"],"names":["spinnerSlots","spinnerSizeStyles","spinnerVariantStyles","typographyVariantStyles","spinnerRecipe","defineSlotRecipe","Spinner","backdropColor","fullScreen","label","labelProps","showLabel","size","variant","styles","useSlotRecipe","jsxs","VStack","jsx","CSpinner","Text"],"mappings":"6RAQMA,EAAe,CAAC,OAAQ,UAAW,OAAO,EAM1CC,EAA4D,CAChE,GAAI,CACF,QAAS,CACP,EAAG,EACH,EAAG,CACL,EACA,MAAO,CACL,SAAU,IAAA,CAEd,EACA,GAAI,CACF,QAAS,CACP,EAAG,EACH,EAAG,CACL,EACA,MAAO,CACL,SAAU,IAAA,CAEd,EACA,GAAI,CACF,QAAS,CACP,EAAG,EACH,EAAG,EACH,iBAAkB,CACpB,EACA,MAAO,CACL,SAAU,IAAA,CAEd,EACA,GAAI,CACF,QAAS,CACP,EAAG,EACH,EAAG,CACL,EACA,MAAO,CACL,SAAU,IAAA,CAEd,EACA,GAAI,CACF,QAAS,CACP,EAAG,GACH,EAAG,EACL,EACA,MAAO,CACL,SAAU,IAAA,CACZ,CAEJ,EAEMC,EAAqE,CACzE,OAAQ,CACN,QAASC,EAAAA,wBAAwB,MACnC,EACA,aAAc,CACZ,QAASA,EAAAA,wBAAwB,YACnC,EACA,MAAO,CACL,QAASA,EAAAA,wBAAwB,KACnC,EACA,gBAAiB,CACf,QAASA,EAAAA,wBAAwB,eACnC,EACA,OAAQ,CACN,QAASA,EAAAA,wBAAwB,MACnC,EACA,iBAAkB,CAChB,QAASA,EAAAA,wBAAwB,gBACnC,EACA,QAAS,CACP,QAASA,EAAAA,wBAAwB,OACnC,EACA,KAAM,CACJ,QAASA,EAAAA,wBAAwB,IACnC,EACA,YAAa,CACX,QAASA,EAAAA,wBAAwB,WACnC,EACA,sBAAuB,CACrB,QAASA,EAAAA,wBAAwB,qBACnC,EACA,WAAY,CACV,QAASA,EAAAA,wBAAwB,UACnC,EACA,YAAa,CACX,QAASA,EAAAA,wBAAwB,WACnC,EACA,sBAAuB,CACrB,QAASA,EAAAA,wBAAwB,q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1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const c=require("./jsx-runtime-BjDatQAs.js"),p=require("./avatar.component-
|
|
2
|
-
//# sourceMappingURL=styledAvatar.types-
|
|
1
|
+
"use strict";const c=require("./jsx-runtime-BjDatQAs.js"),p=require("./avatar.component-D5UM9jeO.js"),m=({type:l="Client",...e})=>{const{name:o,tooltipProps:t={placement:"top",...e.tooltipProps},onClick:s}=e,n={variant:"outlineYellow",tooltipProps:{...t,label:t?.label||`${o} (Test Client)`}},r={iconName:"cellphone",tooltipProps:{...t,label:t?.label||`Text messages sent from ${o||"unknown number"}`}},i={Automated:{iconName:"robot",backgroundColor:"background.primary",hideBorder:!0,color:"text.contrast",size:"sm",showTooltip:!1,cursor:"default"},Client:{},Clinic:{variant:"outlineAccent",name:o||"Sys"},SMS:r,TestClient:n};return c.jsxRuntimeExports.jsx(p.Avatar,{className:"StyledAvatar","data-testid":`kibble-styled-avatar-${l}`,onClick:a=>{a.stopPropagation(),s&&s(a)},...e,...i[l]})},u=["Client","SMS","TestClient","Automated","Clinic"];exports.StyledAvatar=m;exports.styledAvatarTypes=u;
|
|
2
|
+
//# sourceMappingURL=styledAvatar.types-6kAk8MH3.js.map
|
package/dist/chunks/{styledAvatar.types-B1WPMZAS.js.map → styledAvatar.types-6kAk8MH3.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styledAvatar.types-
|
|
1
|
+
{"version":3,"file":"styledAvatar.types-6kAk8MH3.js","sources":["../../src/components/StyledAvatar/styledAvatar.component.tsx","../../src/components/StyledAvatar/styledAvatar.types.ts"],"sourcesContent":["import React from \"react\";\nimport { Avatar, AvatarProps } from \"components/Avatar/avatar.component\";\nimport { StyledAvatarType } from \"./styledAvatar.types\";\n\nexport interface StyledAvatarProps extends AvatarProps {\n type?: StyledAvatarType;\n}\n\nexport const StyledAvatar = ({\n type = \"Client\",\n ...rest\n}: StyledAvatarProps): React.JSX.Element => {\n const {\n name,\n tooltipProps = { placement: \"top\", ...rest.tooltipProps },\n onClick,\n } = rest;\n\n const testClientStyleProps: Partial<AvatarProps> = {\n variant: \"outlineYellow\",\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `${name} (Test Client)`,\n },\n };\n\n const smsStyleProps: Partial<AvatarProps> = {\n iconName: \"cellphone\",\n tooltipProps: {\n ...tooltipProps,\n label:\n tooltipProps?.label ||\n `Text messages sent from ${name || \"unknown number\"}`,\n },\n };\n\n const automatedStyleProps: Partial<AvatarProps> = {\n iconName: \"robot\",\n backgroundColor: \"background.primary\",\n hideBorder: true,\n color: \"text.contrast\",\n size: \"sm\",\n showTooltip: false,\n cursor: \"default\",\n };\n\n const clinicStyleProps: Partial<AvatarProps> = {\n variant: \"outlineAccent\",\n name: name || \"Sys\",\n };\n\n const styleProps: Record<StyledAvatarType, Partial<AvatarProps>> = {\n Automated: automatedStyleProps,\n Client: {},\n Clinic: clinicStyleProps,\n SMS: smsStyleProps,\n TestClient: testClientStyleProps,\n };\n\n return (\n <Avatar\n className=\"StyledAvatar\"\n data-testid={`kibble-styled-avatar-${type}`}\n onClick={(e): void => {\n e.stopPropagation();\n if (onClick) {\n onClick(e);\n }\n }}\n {...rest}\n {...styleProps[type]}\n />\n );\n};\n","export const styledAvatarTypes = [\n \"Client\",\n \"SMS\",\n \"TestClient\",\n \"Automated\",\n \"Clinic\",\n] as const;\nexport type StyledAvatarType = (typeof styledAvatarTypes)[number];\n"],"names":["StyledAvatar","type","rest","name","tooltipProps","onClick","testClientStyleProps","smsStyleProps","styleProps","jsx","Avatar","e","styledAvatarTypes"],"mappings":"sGAQaA,EAAe,CAAC,CAC3B,KAAAC,EAAO,SACP,GAAGC,CACL,IAA4C,CACpC,KAAA,CACJ,KAAAC,EACA,aAAAC,EAAe,CAAE,UAAW,MAAO,GAAGF,EAAK,YAAa,EACxD,QAAAG,CAAA,EACEH,EAEEI,EAA6C,CACjD,QAAS,gBACT,aAAc,CACZ,GAAGF,EACH,MAAOA,GAAc,OAAS,GAAGD,CAAI,gBAAA,CAEzC,EAEMI,EAAsC,CAC1C,SAAU,YACV,aAAc,CACZ,GAAGH,EACH,MACEA,GAAc,OACd,2BAA2BD,GAAQ,gBAAgB,EAAA,CAEzD,EAiBMK,EAA6D,CACjE,UAhBgD,CAChD,SAAU,QACV,gBAAiB,qBACjB,WAAY,GACZ,MAAO,gBACP,KAAM,KACN,YAAa,GACb,OAAQ,SACV,EASE,OAAQ,CAAC,EACT,OAR6C,CAC7C,QAAS,gBACT,KAAML,GAAQ,KAChB,EAME,IAAKI,EACL,WAAYD,CACd,EAGE,OAAAG,EAAA,kBAAA,IAACC,EAAA,OAAA,CACC,UAAU,eACV,cAAa,wBAAwBT,CAAI,GACzC,QAAUU,GAAY,CACpBA,EAAE,gBAAgB,EACdN,GACFA,EAAQM,CAAC,CAEb,EACC,GAAGT,EACH,GAAGM,EAAWP,CAAI,CAAA,CACrB,CAEJ,ECzEaW,EAAoB,CAC/B,SACA,MACA,aACA,YACA,QACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as c } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { A as p } from "./avatar.component-
|
|
2
|
+
import { A as p } from "./avatar.component-Dl3Ir7ii.js";
|
|
3
3
|
const y = ({
|
|
4
4
|
type: l = "Client",
|
|
5
5
|
...o
|
|
@@ -61,4 +61,4 @@ export {
|
|
|
61
61
|
y as S,
|
|
62
62
|
C as s
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=styledAvatar.types-
|
|
64
|
+
//# sourceMappingURL=styledAvatar.types-DrZ-wDhH.js.map
|
package/dist/chunks/{styledAvatar.types-C0KWX23C.js.map → styledAvatar.types-DrZ-wDhH.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styledAvatar.types-
|
|
1
|
+
{"version":3,"file":"styledAvatar.types-DrZ-wDhH.js","sources":["../../src/components/StyledAvatar/styledAvatar.component.tsx","../../src/components/StyledAvatar/styledAvatar.types.ts"],"sourcesContent":["import React from \"react\";\nimport { Avatar, AvatarProps } from \"components/Avatar/avatar.component\";\nimport { StyledAvatarType } from \"./styledAvatar.types\";\n\nexport interface StyledAvatarProps extends AvatarProps {\n type?: StyledAvatarType;\n}\n\nexport const StyledAvatar = ({\n type = \"Client\",\n ...rest\n}: StyledAvatarProps): React.JSX.Element => {\n const {\n name,\n tooltipProps = { placement: \"top\", ...rest.tooltipProps },\n onClick,\n } = rest;\n\n const testClientStyleProps: Partial<AvatarProps> = {\n variant: \"outlineYellow\",\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `${name} (Test Client)`,\n },\n };\n\n const smsStyleProps: Partial<AvatarProps> = {\n iconName: \"cellphone\",\n tooltipProps: {\n ...tooltipProps,\n label:\n tooltipProps?.label ||\n `Text messages sent from ${name || \"unknown number\"}`,\n },\n };\n\n const automatedStyleProps: Partial<AvatarProps> = {\n iconName: \"robot\",\n backgroundColor: \"background.primary\",\n hideBorder: true,\n color: \"text.contrast\",\n size: \"sm\",\n showTooltip: false,\n cursor: \"default\",\n };\n\n const clinicStyleProps: Partial<AvatarProps> = {\n variant: \"outlineAccent\",\n name: name || \"Sys\",\n };\n\n const styleProps: Record<StyledAvatarType, Partial<AvatarProps>> = {\n Automated: automatedStyleProps,\n Client: {},\n Clinic: clinicStyleProps,\n SMS: smsStyleProps,\n TestClient: testClientStyleProps,\n };\n\n return (\n <Avatar\n className=\"StyledAvatar\"\n data-testid={`kibble-styled-avatar-${type}`}\n onClick={(e): void => {\n e.stopPropagation();\n if (onClick) {\n onClick(e);\n }\n }}\n {...rest}\n {...styleProps[type]}\n />\n );\n};\n","export const styledAvatarTypes = [\n \"Client\",\n \"SMS\",\n \"TestClient\",\n \"Automated\",\n \"Clinic\",\n] as const;\nexport type StyledAvatarType = (typeof styledAvatarTypes)[number];\n"],"names":["StyledAvatar","type","rest","name","tooltipProps","onClick","testClientStyleProps","smsStyleProps","styleProps","jsx","Avatar","e","styledA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";const i=require("./jsx-runtime-BjDatQAs.js"),c=require("react"),y=require("./withFormControl-
|
|
2
|
-
//# sourceMappingURL=switch.component-
|
|
1
|
+
"use strict";const i=require("./jsx-runtime-BjDatQAs.js"),c=require("react"),y=require("./withFormControl-BtHmtdLR.js"),w=require("./attr-BMs6szZx.js"),E=require("./create-slot-recipe-context-IwVIgtBt.js"),m=require("./factory-D6tdBUPG.js"),n=require("./use-locale-context-D0LByRu9.js"),f=require("./use-field-context-CArmgHPP.js"),l=require("./index-CHIISuTq.js"),x=require("./index-DBk0LkcO.js"),q=t=>t&&t.__esModule?t:{default:t},N=q(c),[R,u]=n.createContext({name:"SwitchContext",hookName:"useSwitchContext",providerName:"<SwitchProvider />"}),S=c.forwardRef((t,e)=>{const r=u(),s=l.mergeProps(r.getControlProps(),t);return i.jsxRuntimeExports.jsx(n.ark.span,{...s,ref:e})});S.displayName="SwitchControl";const j=c.forwardRef((t,e)=>{const r=u(),s=l.mergeProps(r.getHiddenInputProps(),t),o=f.useFieldContext();return i.jsxRuntimeExports.jsx(n.ark.input,{"aria-describedby":o?.ariaDescribedby,...s,ref:e})});j.displayName="SwitchHiddenInput";const C=c.forwardRef((t,e)=>{const r=u(),s=l.mergeProps(r.getLabelProps(),t);return i.jsxRuntimeExports.jsx(n.ark.span,{...s,ref:e})});C.displayName="SwitchLabel";const I=t=>{const e=c.useId(),{getRootNode:r}=n.useEnvironmentContext(),{dir:s}=n.useLocaleContext(),o=f.useFieldContext(),a={id:e,ids:{label:o?.ids.label,hiddenInput:o?.ids.control},dir:s,disabled:o?.disabled,readOnly:o?.readOnly,invalid:o?.invalid,required:o?.required,getRootNode:r,...t},d=n.useMachine(x.machine,a);return x.connect(d,n.normalizeProps)},b=c.forwardRef((t,e)=>{const[r,s]=n.createSplitProps()(t,["checked","defaultChecked","disabled","form","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]),o=I(r),a=l.mergeProps(o.getRootProps(),s);return i.jsxRuntimeExports.jsx(R,{value:o,children:i.jsxRuntimeExports.jsx(n.ark.label,{...a,ref:e})})});b.displayName="SwitchRoot";const P=c.forwardRef((t,e)=>{const[{value:r},s]=n.createSplitProps()(t,["value"]),o=l.mergeProps(r.getRootProps(),s);return i.jsxRuntimeExports.jsx(R,{value:r,children:i.jsxRuntimeExports.jsx(n.ark.label,{...o,ref:e})})});P.displayName="SwitchRootProvider";const k=c.forwardRef((t,e)=>{const r=u(),s=l.mergeProps(r.getThumbProps(),t);return i.jsxRuntimeExports.jsx(n.ark.span,{...s,ref:e})});k.displayName="SwitchThumb";const{withProvider:g,withContext:p,useStyles:_}=E.createSlotRecipeContext({key:"switch"});g(P,"root",{forwardAsChild:!0});const A=g(b,"root",{forwardAsChild:!0}),L=p(C,"label",{forwardAsChild:!0}),$=p(k,"thumb",{forwardAsChild:!0}),F=p(S,"control",{forwardAsChild:!0,defaultProps:{children:i.jsxRuntimeExports.jsx($,{})}});c.forwardRef(function(e,r){const s=u(),o=_(),{fallback:a,children:d,...h}=e;return i.jsxRuntimeExports.jsx(m.chakra.span,{ref:r,"data-checked":w.dataAttr(s.checked),...h,css:[o.indicator,e.css],children:s.checked?d:a})});c.forwardRef(function(e,r){const s=u(),{fallback:o,children:a,...d}=e;return i.jsxRuntimeExports.jsx(m.chakra.span,{ref:r,"data-checked":w.dataAttr(s.checked),...d,children:s.checked?a:o})});const T=j,H=y.withFormControl(({children:t,indeterminate:e=!1,onContrast:r,label:s,size:o="md",switchRef:a,...d})=>{const h=c.useMemo(()=>e?r?"indeterminateOnContrast":"indeterminate":r?"onContrast":"default",[e,r]);return i.jsxRuntimeExports.jsxs(A,{className:"Switch","data-testid":"kibble-switch",ref:a,size:o,variant:h,...d,children:[i.jsxRuntimeExports.jsx(T,{className:"Switch_Input","data-testid":"kibble-switch-input"}),i.jsxRuntimeExports.jsx(F,{className:"Switch_Control","data-testid":"kibble-switch-control"}),!!t&&i.jsxRuntimeExports.jsx(L,{children:t})]})}),v=N.default.forwardRef((t,e)=>i.jsxRuntimeExports.jsx(H,{switchRef:e,...t}));v.displayName="Switch";exports.WrappedSwitch=v;
|
|
2
|
+
//# sourceMappingURL=switch.component-BDRM_BIa.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.component-D5kgSKKx.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [styles.indicator, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { ForwardedRef, useMemo } from \"react\";\nimport { Switch as CSwitch } from \"@chakra-ui/react/switch\";\nimport {\n withFormControl,\n WithFormControlProps,\n} from \"hocs/withFormControl/withFormControl\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\n\nexport interface SwitchProps\n extends WithFormControlProps,\n Omit<CSwitch.RootProps, \"label\" | \"onChange\"> {\n indeterminate?: boolean;\n switchRef?: ForwardedRef<HTMLLabelElement>;\n size?: FormControlSize;\n}\n\nconst Switch = withFormControl(\n ({\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n size = \"md\",\n switchRef,\n ...rest\n }: SwitchProps): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? \"indeterminateOnContrast\" : \"indeterminate\";\n } else {\n return onContrast ? \"onContrast\" : \"default\";\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid=\"kibble-switch\"\n ref={switchRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput\n className=\"Switch_Input\"\n data-testid=\"kibble-switch-input\"\n />\n <CSwitch.Control\n className=\"Switch_Control\"\n data-testid=\"kibble-switch-control\"\n />\n {!!children && <CSwitch.Label>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nconst WrappedSwitch = React.forwardRef(\n (props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) => (\n <Switch switchRef={ref} {...props} />\n ),\n);\n\nWrappedSwitch.displayName = \"Switch\";\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","rest","chakra","dataAttr","Switch.HiddenInput","Switch","withFormControl","indeterminate","onContrast","label","size","switchRef","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","React"],"mappings":"wbAGM,CAACA,EAAgBC,CAAgB,EAAIC,gBAAc,CACvD,KAAM,gBACN,SAAU,mBACV,aAAc,oBAChB,CAAC,ECAKC,EAAgBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAC/C,MAAMC,EAAgBN,EAAkB,EAClCO,EAAcC,EAAU,WAACF,EAAc,gBAAe,EAAIF,CAAK,EACrE,OAAuBK,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,IAAAF,EAAK,CAC9D,CAAC,EACDH,EAAc,YAAc,gBCJ5B,MAAMS,EAAoBR,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACnD,MAAMC,EAAgBN,EAAkB,EAClCO,EAAcC,EAAU,WAACF,EAAc,oBAAmB,EAAIF,CAAK,EACnEQ,EAAQC,EAAAA,gBAAiB,EAC/B,OAAuBJ,EAAG,kBAAA,IAACC,MAAI,MAAO,CAAE,mBAAoBE,GAAO,gBAAiB,GAAGL,EAAa,IAAAF,EAAK,CAC3G,CAAC,EACDM,EAAkB,YAAc,oBCPhC,MAAMG,EAAcX,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAC7C,MAAMC,EAAgBN,EAAkB,EAClCO,EAAcC,EAAU,WAACF,EAAc,cAAa,EAAIF,CAAK,EACnE,OAAuBK,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,IAAAF,EAAK,CAC9D,CAAC,EACDS,EAAY,YAAc,cCJ1B,MAAMC,EAAaX,GAAU,CAC3B,MAAMY,EAAKC,EAAAA,MAAO,EACZ,CAAE,YAAAC,CAAa,EAAGC,wBAAuB,EACzC,CAAE,IAAAC,CAAK,EAAGC,mBAAkB,EAC5BT,EAAQC,EAAAA,gBAAiB,EACzBS,EAAe,C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AAA3C,EAAK,eAAgB4C,EAAAA,SAAShB,EAAI,OAAO,EAAG,GAAGc,EAAM,SAAUd,EAAI,QAAUa,EAAWD,EAAU,CAC9I,CAAC,EAED,MAAMlC,EAAoBuC,EC7CpBC,EAASC,EAAA,gBACb,CAAC,CACC,SAAAN,EACA,cAAAO,EAAgB,GAChB,WAAAC,EAEA,MAAAC,EACA,KAAAC,EAAO,KACP,UAAAC,EACA,GAAGV,CAAA,IACiC,CAC9B,MAAAW,EAAmBC,EAAAA,QAAQ,IAC3BN,EACKC,EAAa,0BAA4B,gBAEzCA,EAAa,aAAe,UAEpC,CAACD,EAAeC,CAAU,CAAC,EAG5B,OAAAM,EAAA,kBAAA,KAACC,EAAA,CACC,UAAU,SACV,cAAY,gBACZ,IAAKJ,EACL,KAAAD,EACA,QAASE,EACR,GAAGX,EAEJ,SAAA,CAAAtC,EAAA,kBAAA,IAACqD,EAAA,CACC,UAAU,eACV,cAAY,qBAAA,CACd,EACArD,EAAA,kBAAA,IAACsD,EAAA,CACC,UAAU,iBACV,cAAY,uBAAA,CACd,EACC,CAAC,CAACjB,2BAAakB,EAAA,CAAe,SAAAlB,CAAS,CAAA,CAAA,CAAA,CAC1C,CAAA,CAGN,EAEMmB,EAAgBC,EAAM,QAAA,WAC1B,CAAC9D,EAAoBC,IACnBI,wBAAC0C,GAAO,UAAW9C,EAAM,GAAGD,CAAO,CAAA,CAEvC,EAEA6D,EAAc,YAAc","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
1
|
+
{"version":3,"file":"switch.component-BDRM_BIa.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [styles.indicator, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { ForwardedRef, useMemo } from \"react\";\nimport { Switch as CSwitch } from \"@chakra-ui/react/switch\";\nimport {\n withFormControl,\n WithFormControlProps,\n} from \"hocs/withFormControl/withFormControl\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\n\nexport interface SwitchProps\n extends WithFormControlProps,\n Omit<CSwitch.RootProps, \"label\" | \"onChange\"> {\n indeterminate?: boolean;\n switchRef?: ForwardedRef<HTMLLabelElement>;\n size?: FormControlSize;\n}\n\nconst Switch = withFormControl(\n ({\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n size = \"md\",\n switchRef,\n ...rest\n }: SwitchProps): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? \"indeterminateOnContrast\" : \"indeterminate\";\n } else {\n return onContrast ? \"onContrast\" : \"default\";\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid=\"kibble-switch\"\n ref={switchRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput\n className=\"Switch_Input\"\n data-testid=\"kibble-switch-input\"\n />\n <CSwitch.Control\n className=\"Switch_Control\"\n data-testid=\"kibble-switch-control\"\n />\n {!!children && <CSwitch.Label>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nconst WrappedSwitch = React.forwardRef(\n (props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) => (\n <Switch switchRef={ref} {...props} />\n ),\n);\n\nWrappedSwitch.displayName = \"Switch\";\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","rest","chakra","dataAttr","Switch.HiddenInput","Switch","withFormControl","indeterminate","onContrast","label","size","switchRef","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","React"],"mappings":"wbAGM,CAACA,EAAgBC,CAAgB,EAAIC,gBAAc,CACvD,KAAM,gBACN,SAAU,mBACV,aAAc,oBAChB,CAAC,ECAKC,EAAgBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAC/C,MAAMC,EAAgBN,EAAkB,EAClCO,EAAcC,EAAU,WAACF,EAAc,gBAAe,EAAIF,CAAK,EACrE,OAAuBK,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,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A,KAACC,EAAA,CACC,UAAU,SACV,cAAY,gBACZ,IAAKJ,EACL,KAAAD,EACA,QAASE,EACR,GAAGX,EAEJ,SAAA,CAAAtC,EAAA,kBAAA,IAACqD,EAAA,CACC,UAAU,eACV,cAAY,qBAAA,CACd,EACArD,EAAA,kBAAA,IAACsD,EAAA,CACC,UAAU,iBACV,cAAY,uBAAA,CACd,EACC,CAAC,CAACjB,2BAAakB,EAAA,CAAe,SAAAlB,CAAS,CAAA,CAAA,CAAA,CAC1C,CAAA,CAGN,EAEMmB,EAAgBC,EAAM,QAAA,WAC1B,CAAC9D,EAAoBC,IACnBI,wBAAC0C,GAAO,UAAW9C,EAAM,GAAGD,CAAO,CAAA,CAEvC,EAEA6D,EAAc,YAAc","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { j as c } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import g, { forwardRef as n, useId as R, useMemo as N } from "react";
|
|
3
|
-
import { w as I } from "./withFormControl-
|
|
3
|
+
import { w as I } from "./withFormControl-C8n6PnvV.js";
|
|
4
4
|
import { d as u } from "./attr-sm10PXOd.js";
|
|
5
5
|
import { c as A } from "./create-slot-recipe-context-BJmsuxih.js";
|
|
6
6
|
import { c as w } from "./factory-Ctbv0Ozn.js";
|
|
7
|
-
import { c as L, f as d, i as T, j as _, k as $, n as H, a as S } from "./use-locale-context-
|
|
8
|
-
import { u as f } from "./use-field-context-
|
|
9
|
-
import {
|
|
10
|
-
import { m as O, c as q } from "./index-
|
|
7
|
+
import { c as L, f as d, i as T, j as _, k as $, n as H, a as S } from "./use-locale-context-BiiNTYMT.js";
|
|
8
|
+
import { u as f } from "./use-field-context-Cm3grEyV.js";
|
|
9
|
+
import { a1 as l } from "./index-YtNA0Ueo.js";
|
|
10
|
+
import { m as O, c as q } from "./index-DVNjUEDJ.js";
|
|
11
11
|
const [x, h] = L({
|
|
12
12
|
name: "SwitchContext",
|
|
13
13
|
hookName: "useSwitchContext",
|
|
@@ -115,7 +115,7 @@ n(function(t, e) {
|
|
|
115
115
|
const s = h(), { fallback: r, children: i, ...a } = t;
|
|
116
116
|
return /* @__PURE__ */ c.jsx(w.span, { ref: e, "data-checked": u(s.checked), ...a, children: s.checked ? i : r });
|
|
117
117
|
});
|
|
118
|
-
const V = C,
|
|
118
|
+
const V = C, B = I(
|
|
119
119
|
({
|
|
120
120
|
children: o,
|
|
121
121
|
indeterminate: t = !1,
|
|
@@ -156,11 +156,11 @@ const V = C, Y = I(
|
|
|
156
156
|
}
|
|
157
157
|
);
|
|
158
158
|
}
|
|
159
|
-
),
|
|
160
|
-
(o, t) => /* @__PURE__ */ c.jsx(
|
|
159
|
+
), G = g.forwardRef(
|
|
160
|
+
(o, t) => /* @__PURE__ */ c.jsx(B, { switchRef: t, ...o })
|
|
161
161
|
);
|
|
162
|
-
|
|
162
|
+
G.displayName = "Switch";
|
|
163
163
|
export {
|
|
164
|
-
|
|
164
|
+
G as W
|
|
165
165
|
};
|
|
166
|
-
//# sourceMappingURL=switch.component-
|
|
166
|
+
//# sourceMappingURL=switch.component-DFpYXcBq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.component-Bsn6yqT1.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [styles.indicator, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { ForwardedRef, useMemo } from \"react\";\nimport { Switch as CSwitch } from \"@chakra-ui/react/switch\";\nimport {\n withFormControl,\n WithFormControlProps,\n} from \"hocs/withFormControl/withFormControl\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\n\nexport interface SwitchProps\n extends WithFormControlProps,\n Omit<CSwitch.RootProps, \"label\" | \"onChange\"> {\n indeterminate?: boolean;\n switchRef?: ForwardedRef<HTMLLabelElement>;\n size?: FormControlSize;\n}\n\nconst Switch = withFormControl(\n ({\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n size = \"md\",\n switchRef,\n ...rest\n }: SwitchProps): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? \"indeterminateOnContrast\" : \"indeterminate\";\n } else {\n return onContrast ? \"onContrast\" : \"default\";\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid=\"kibble-switch\"\n ref={switchRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput\n className=\"Switch_Input\"\n data-testid=\"kibble-switch-input\"\n />\n <CSwitch.Control\n className=\"Switch_Control\"\n data-testid=\"kibble-switch-control\"\n />\n {!!children && <CSwitch.Label>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nconst WrappedSwitch = React.forwardRef(\n (props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) => (\n <Switch switchRef={ref} {...props} />\n ),\n);\n\nWrappedSwitch.displayName = \"Switch\";\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","rest","chakra","dataAttr","Switch.HiddenInput","Switch","withFormControl","indeterminate","onContrast","label","size","switchRef","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","React"],"mappings":";;;;;;;;;;AAGA,MAAM,CAACA,GAAgBC,CAAgB,IAAIC,EAAc;AAAA,EACvD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAChB,CAAC,GCAKC,IAAgBC,EAAW,CAACC,GAAOC,MAAQ;AAC/C,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,gBAAe,GAAIF,CAAK;AACrE,SAAuBK,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAF,GAAK;AAC9D,CAAC;AACDH,EAAc,cAAc;ACJ5B,MAAMS,IAAoBR,EAAW,CAACC,GAAOC,MAAQ;AACnD,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,oBAAmB,GAAIF,CAAK,GACnEQ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B,WAAAM,gBAAAA,EAAA;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,KAAKJ;AAAA,QACL,MAAAD;AAAA,QACA,SAASE;AAAA,QACR,GAAGX;AAAA,QAEJ,UAAA;AAAA,UAAAtC,gBAAAA,EAAA;AAAA,YAACqD;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,eAAY;AAAA,YAAA;AAAA,UACd;AAAA,UACArD,gBAAAA,EAAA;AAAA,YAACsD;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,eAAY;AAAA,YAAA;AAAA,UACd;AAAA,UACC,CAAC,CAACjB,2BAAakB,GAAA,EAAe,UAAAlB,EAAS,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1C;AAAA,EAAA;AAGN,GAEMmB,IAAgBC,EAAM;AAAA,EAC1B,CAAC9D,GAAoBC,MACnBI,gBAAAA,MAAC0C,KAAO,WAAW9C,GAAM,GAAGD,EAAO,CAAA;AAEvC;AAEA6D,EAAc,cAAc;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
1
|
+
{"version":3,"file":"switch.component-DFpYXcBq.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [styles.indicator, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { ForwardedRef, useMemo } from \"react\";\nimport { Switch as CSwitch } from \"@chakra-ui/react/switch\";\nimport {\n withFormControl,\n WithFormControlProps,\n} from \"hocs/withFormControl/withFormControl\";\nimport { FormControlSize } from \"hocs/withFormControl/withFormControl.types\";\n\nexport interface SwitchProps\n extends WithFormControlProps,\n Omit<CSwitch.RootProps, \"label\" | \"onChange\"> {\n indeterminate?: boolean;\n switchRef?: ForwardedRef<HTMLLabelElement>;\n size?: FormControlSize;\n}\n\nconst Switch = withFormControl(\n ({\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n size = \"md\",\n switchRef,\n ...rest\n }: SwitchProps): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? \"indeterminateOnContrast\" : \"indeterminate\";\n } else {\n return onContrast ? \"onContrast\" : \"default\";\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid=\"kibble-switch\"\n ref={switchRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput\n className=\"Switch_Input\"\n data-testid=\"kibble-switch-input\"\n />\n <CSwitch.Control\n className=\"Switch_Control\"\n data-testid=\"kibble-switch-control\"\n />\n {!!children && <CSwitch.Label>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nconst WrappedSwitch = React.forwardRef(\n (props: SwitchProps, ref: ForwardedRef<HTMLLabelElement>) => (\n <Switch switchRef={ref} {...props} />\n ),\n);\n\nWrappedSwitch.displayName = \"Switch\";\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","rest","chakra","dataAttr","Switch.HiddenInput","Switch","withFormControl","indeterminate","onContrast","label","size","switchRef","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","React"],"mappings":";;;;;;;;;;AAGA,MAAM,CAACA,GAAgBC,CAAgB,IAAIC,EAAc;AAAA,EACvD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAChB,CAAC,GCAKC,IAAgBC,EAAW,CAACC,GAAOC,MAAQ;AAC/C,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,gBAAe,GAAIF,CAAK;AACrE,SAAuBK,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAF,GAAK;AAC9D,CAAC;AACDH,EAAc,cAAc;ACJ5B,MAAMS,IAAoBR,EAAW,CAACC,GAAOC,MAAQ;AACnD,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,oBAAmB,GAAIF,CAAK,GACnEQ,IAAQC,EAAiB;AAC/B,SAAuBJ,gBAAA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AAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,KAAKJ;AAAA,QACL,MAAAD;AAAA,QACA,SAASE;AAAA,QACR,GAAGX;AAAA,QAEJ,UAAA;AAAA,UAAAtC,gBAAAA,EAAA;AAAA,YAACqD;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,eAAY;AAAA,YAAA;AAAA,UACd;AAAA,UACArD,gBAAAA,EAAA;AAAA,YAACsD;AAAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,eAAY;AAAA,YAAA;AAAA,UACd;AAAA,UACC,CAAC,CAACjB,2BAAakB,GAAA,EAAe,UAAAlB,EAAS,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1C;AAAA,EAAA;AAGN,GAEMmB,IAAgBC,EAAM;AAAA,EAC1B,CAAC9D,GAAoBC,MACnBI,gBAAAA,MAAC0C,KAAO,WAAW9C,GAAM,GAAGD,EAAO,CAAA;AAEvC;AAEA6D,EAAc,cAAc;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const l=require("./jsx-runtime-BjDatQAs.js"),_=require("./icon.component-C0e0UGBw.js"),M=require("./notificationCounter.component-BhZcuBmr.js"),H=require("./heading.component-uv536wYF.js"),X=require("./create-slot-recipe-context-IwVIgtBt.js"),p=require("react"),u=require("./use-locale-context-BdqHZ8L8.js"),x=require("./render-strategy-BmWbSgqh.js"),n=require("./index-CZ42b9rT.js");function K(e,t){const[s,a]=p.useState(e);return p.useEffect(()=>{const o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),s}const[N,A]=u.createContext({name:"TabsContext",hookName:"useTabsContext",providerName:"<TabsProvider />"}),S=p.forwardRef((e,t)=>{const[s,a]=u.createSplitProps()(e,["value"]),o=A(),r=x.useRenderStrategyPropsContext(),i=u.usePresence({...r,present:K(o.value===e.value,0),immediate:!0}),g=n.mergeProps(o.getContentProps(s),i.getPresenceProps(),a);return l.jsxRuntimeExports.jsx(u.PresenceProvider,{value:i,children:i.unmounted?null:l.jsxRuntimeExports.jsx(u.ark.div,{...g,ref:u.composeRefs(i.ref,t)})})});S.displayName="TabContent";const L=p.forwardRef((e,t)=>{const s=A(),a=n.mergeProps(s.getIndicatorProps(),e);return l.jsxRuntimeExports.jsx(u.ark.div,{...a,ref:t})});L.displayName="TabIndicator";const O=p.forwardRef((e,t)=>{const s=A(),a=n.mergeProps(s.getListProps(),e);return l.jsxRuntimeExports.jsx(u.ark.div,{...a,ref:t})});O.displayName="TabList";const k=p.forwardRef((e,t)=>{const[s,a]=u.createSplitProps()(e,["disabled","value"]),o=A(),r=n.mergeProps(o.getTriggerProps(s),a);return l.jsxRuntimeExports.jsx(u.ark.button,{...r,ref:t})});k.displayName="TabTrigger";var G=n.createAnatomy("tabs").parts("root","list","trigger","content","indicator"),m=G.build(),Y=e=>e.ids?.root??`tabs:${e.id}`,R=e=>e.ids?.list??`tabs:${e.id}:list`,I=(e,t)=>e.ids?.content??`tabs:${e.id}:content-${t}`,v=(e,t)=>e.ids?.trigger??`tabs:${e.id}:trigger-${t}`,B=e=>e.ids?.indicator??`tabs:${e.id}:indicator`,z=e=>e.getById(R(e)),J=(e,t)=>e.getById(I(e,t)),V=(e,t)=>e.getById(v(e,t)),w=e=>e.getById(B(e)),y=e=>{const s=`[role=tab][data-ownedby='${CSS.escape(R(e))}']:not([disabled])`;return n.queryAll(z(e),s)},Q=e=>n.first(y(e)),Z=e=>n.last(y(e)),ee=(e,t)=>n.nextById(y(e),v(e,t.value),t.loopFocus),te=(e,t)=>n.prevById(y(e),v(e,t.value),t.loopFocus),$=e=>({left:e?.offsetLeft??0,top:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),ae=(e,t)=>{const s=n.itemById(y(e),v(e,t));return D($(s))},D=e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`});function se(e,t){const{state:s,send:a,context:o,prop:r,scope:i}=e,g=r("translations"),T=s.matches("focused"),P=r("orientation")==="vertical",h=r("orientation")==="horizontal",j=r("composite");function F(c){return{selected:o.get("value")===c.value,focused:o.get("focusedValue")===c.value,disabled:!!c.disabled}}return{value:o.get("value"),focusedValue:o.get("focusedValue"),setValue(c){a({type:"SET_VALUE",value:c})},clearValue(){a({type:"CLEAR_VALUE"})},setIndicatorRect(c){const d=v(i,c);a({type:"SET_INDICATOR_RECT",id:d})},syncTabIndex(){a({type:"SYNC_TAB_INDEX"})},selectNext(c){a({type:"TAB_FOCUS",value:c,src:"selectNext"}),a({type:"ARROW_NEXT",src:"selectNext"})},selectPrev(c){a({type:"TAB_FOCUS",value:c,src:"selectPrev"}),a({type:"ARROW_PREV",src:"selectPrev"})},focus(){const c=o.get("value");c&&V(i,c)?.focus()},getRootProps(){return t.element({...m.root.attrs,id:Y(i),"data-orientation":r("orientation"),"data-focus":n.dataAttr(T),dir:r("dir")})},getListProps(){return t.element({...m.list.attrs,id:R(i),role:"tablist",dir:r("dir"),"data-focus":n.dataAttr(T),"aria-orientation":r("orientation"),"data-orientation":r("orientation"),"aria-label":g?.listLabel,onKeyDown(c){if(c.defaultPrevented||!n.isSelfTarget(c)||n.isComposingEvent(c))return;const d={ArrowDown(){h||a({type:"ARROW_NEXT",key:"ArrowDown"})},ArrowUp(){h||a({type:"ARROW_PREV",key:"ArrowUp"})},ArrowLeft(){P||a({type:"ARROW_PREV",key:"ArrowLeft"})},ArrowRight(){P||a({type:"ARROW_NEXT",key:"ArrowRight"})},Home(){a({type:"HOME"})},End(){a({type:"END"})},Enter(){a({type:"ENTER"})}};let f=n.getEventKey(c,{dir:r("dir"),orientation:r("orientation")});const b=d[f];b&&(c.preventDefault(),b(c))}})},getTriggerState:F,getTriggerProps(c){const{value:d,disabled:f}=c,b=F(c);return t.button({...m.trigger.attrs,role:"tab",type:"button",disabled:f,dir:r("dir"),"data-orientation":r("orientation"),"data-disabled":n.dataAttr(f),"aria-disabled":f,"data-value":d,"aria-selected":b.selected,"data-selected":n.dataAttr(b.selected),"data-focus":n.dataAttr(b.focused),"aria-controls":b.selected?I(i,d):void 0,"data-ownedby":R(i),"data-ssr":n.dataAttr(o.get("ssr")),id:v(i,d),tabIndex:b.selected&&j?0:-1,onFocus(){a({type:"TAB_FOCUS",value:d})},onBlur(C){C.relatedTarget?.getAttribute("role")!=="tab"&&a({type:"TAB_BLUR"})},onClick(C){C.defaultPrevented||f||(n.isSafari()&&C.currentTarget.focus(),a({type:"TAB_CLICK",value:d}))}})},getContentProps(c){const{value:d}=c,f=o.get("value")===d;return t.element({...m.content.attrs,dir:r("dir"),id:I(i,d),tabIndex:j?0:-1,"aria-labelledby":v(i,d),role:"tabpanel","data-ownedby":R(i),"data-selected":n.dataAttr(f),"data-orientation":r("orientation"),hidden:!f})},getIndicatorProps(){const c=o.get("indicatorRect"),d=o.get("indicatorTransition");return t.element({id:B(i),...m.indicator.attrs,dir:r("dir"),"data-orientation":r("orientation"),style:{"--transition-property":"left, right, top, bottom, width, height","--left":c.left,"--top":c.top,"--width":c.width,"--height":c.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:d?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[h?"left":"top"]:h?"var(--left)":"var(--top)"}})}}}var{not:re}=n.createGuards(),oe=n.createMachine({props({props:e}){return{dir:"ltr",orientation:"horizontal",activationMode:"automatic",loopFocus:!0,composite:!0,navigate(t){n.clickIfLink(t.node)},defaultValue:null,...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(s){e("onValueChange")?.({value:s})}})),focusedValue:t(()=>({defaultValue:e("value")||e("defaultValue"),sync:!0,onChange(s){e("onFocusChange")?.({focusedValue:s})}})),ssr:t(()=>({defaultValue:!0})),indicatorTransition:t(()=>({defaultValue:!1})),indicatorRect:t(()=>({defaultValue:{left:"0px",top:"0px",width:"0px",height:"0px"}}))}},watch({context:e,prop:t,track:s,action:a}){s([()=>e.get("value")],()=>{a(["allowIndicatorTransition","syncIndicatorRect","syncTabIndex","navigateIfNeeded"])}),s([()=>t("dir"),()=>t("orientation")],()=>{a(["syncIndicatorRect"])})},on:{SET_VALUE:{actions:["setValue"]},CLEAR_VALUE:{actions:["clearValue"]},SET_INDICATOR_RECT:{actions:["setIndicatorRect"]},SYNC_TAB_INDEX:{actions:["syncTabIndex"]}},entry:["syncIndicatorRect","syncTabIndex","syncSsr"],exit:["cleanupObserver"],states:{idle:{on:{TAB_FOCUS:{target:"focused",actions:["setFocusedValue"]},TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]}}},focused:{on:{TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]},ARROW_PREV:[{guard:"selectOnFocus",actions:["focusPrevTab","selectFocusedTab"]},{actions:["focusPrevTab"]}],ARROW_NEXT:[{guard:"selectOnFocus",actions:["focusNextTab","selectFocusedTab"]},{actions:["focusNextTab"]}],HOME:[{guard:"selectOnFocus",actions:["focusFirstTab","selectFocusedTab"]},{actions:["focusFirstTab"]}],END:[{guard:"selectOnFocus",actions:["focusLastTab","selectFocusedTab"]},{actions:["focusLastTab"]}],ENTER:{guard:re("selectOnFocus"),actions:["selectFocusedTab"]},TAB_FOCUS:{actions:["setFocusedValue"]},TAB_BLUR:{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e("activationMode")==="automatic"},actions:{selectFocusedTab({context:e,prop:t}){n.raf(()=>{const s=e.get("focusedValue");if(!s)return;const o=t("deselectable")&&e.get("value")===s?null:s;e.set("value",o)})},setFocusedValue({context:e,event:t,flush:s}){t.value!=null&&s(()=>{e.set("focusedValue",t.value)})},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t,prop:s}){const a=s("deselectable")&&e.get("value")===e.get("focusedValue");e.set("value",a?null:t.value)},clearValue({context:e}){e.set("value",null)},focusFirstTab({scope:e}){n.raf(()=>{Q(e)?.focus()})},focusLastTab({scope:e}){n.raf(()=>{Z(e)?.focus()})},focusNextTab({context:e,prop:t,scope:s,event:a}){const o=a.value??e.get("focusedValue");if(!o)return;const r=ee(s,{value:o,loopFocus:t("loopFocus")});n.raf(()=>{t("composite")?r?.focus():r?.dataset.value!=null&&e.set("focusedValue",r.dataset.value)})},focusPrevTab({context:e,prop:t,scope:s,event:a}){const o=a.value??e.get("focusedValue");if(!o)return;const r=te(s,{value:o,loopFocus:t("loopFocus")});n.raf(()=>{t("composite")?r?.focus():r?.dataset.value!=null&&e.set("focusedValue",r.dataset.value)})},syncTabIndex({context:e,scope:t}){n.raf(()=>{const s=e.get("value");if(!s)return;const a=J(t,s);if(!a)return;n.getFocusables(a).length>0?a.removeAttribute("tabindex"):a.setAttribute("tabindex","0")})},cleanupObserver({refs:e}){const t=e.get("indicatorCleanup");t&&t()},allowIndicatorTransition({context:e}){e.set("indicatorTransition",!0)},setIndicatorRect({context:e,event:t,scope:s}){const a=t.id??e.get("value");if(!w(s))return;if(!a){e.set("indicatorTransition",!1);return}V(s,a)&&(e.set("indicatorRect",ae(s,a)),n.nextTick(()=>{e.set("indicatorTransition",!1)}))},syncSsr({context:e}){e.set("ssr",!1)},syncIndicatorRect({context:e,refs:t,scope:s}){const a=t.get("indicatorCleanup");a&&a();const o=e.get("value");if(!o){e.set("indicatorTransition",!1);return}const r=V(s,o),i=w(s);if(!r||!i)return;const g=n.trackElementRect([r],{measure(T){return $(T)},onEntry({rects:T}){const[P]=T;e.set("indicatorRect",D(P))}});t.set("indicatorCleanup",g)},navigateIfNeeded({context:e,prop:t,scope:s}){const a=e.get("value");if(!a)return;const o=V(s,a);n.isAnchorElement(o)&&t("navigate")?.({value:a,node:o,href:o.href})}}}});u.createProps()(["activationMode","composite","deselectable","dir","getRootNode","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value","defaultValue"]);u.createProps()(["disabled","value"]);u.createProps()(["value"]);const ne=e=>{const t=p.useId(),{getRootNode:s}=u.useEnvironmentContext(),{dir:a}=u.useLocaleContext(),o={id:t,dir:a,getRootNode:s,...e},r=u.useMachine(oe,o);return se(r,u.normalizeProps)},U=p.forwardRef((e,t)=>{const[s,a]=x.splitRenderStrategyProps(e),[o,r]=u.createSplitProps()(a,["activationMode","composite","defaultValue","deselectable","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]),i=ne(o),g=n.mergeProps(i.getRootProps(),r);return l.jsxRuntimeExports.jsx(N,{value:i,children:l.jsxRuntimeExports.jsx(x.RenderStrategyPropsProvider,{value:s,children:l.jsxRuntimeExports.jsx(u.ark.div,{...g,ref:t})})})});U.displayName="TabsRoot";const q=p.forwardRef((e,t)=>{const[s,a]=x.splitRenderStrategyProps(e),[{value:o},r]=u.createSplitProps()(a,["value"]),i=n.mergeProps(o.getRootProps(),r);return l.jsxRuntimeExports.jsx(N,{value:o,children:l.jsxRuntimeExports.jsx(x.RenderStrategyPropsProvider,{value:s,children:l.jsxRuntimeExports.jsx(u.ark.div,{...i,ref:t})})})});q.displayName="TabsRootProvider";const{withProvider:W,withContext:E}=X.createSlotRecipeContext({key:"tabs"});W(q,"root",{forwardAsChild:!0});const ie=W(U,"root",{forwardAsChild:!0}),ce=E(k,"trigger",{forwardAsChild:!0}),ue=E(S,"content",{forwardAsChild:!0});E("div","contentGroup");const le=E(O,"list",{forwardAsChild:!0});E(L,"indicator",{forwardAsChild:!0});const de={xs:"sm",sm:"md",md:"md",lg:"lg"},ge={xs:"xs",sm:"xs",md:"sm",lg:"md"},fe=({iconName:e,iconPosition:t="left",label:s,notificationCounterProps:a,showNotificationCounter:o,size:r="md",...i})=>l.jsxRuntimeExports.jsxs(ce,{className:"Tab","data-testid":"kibble-tab",...i,children:[!!e&&t==="left"&&l.jsxRuntimeExports.jsx(_.Icon,{className:"Tab__Icon","data-testid":"kibble-tab-icon",name:e,size:r,variant:"default"}),l.jsxRuntimeExports.jsx(H.WrappedHeading,{className:"Tab__Label","data-testid":"kibble-tab-label",size:ge[r],children:s}),!!e&&t==="right"&&l.jsxRuntimeExports.jsx(_.Icon,{className:"Tab__Icon","data-testid":"kibble-tab-icon",name:e,size:r}),o&&l.jsxRuntimeExports.jsx(M.NotificationCounter,{className:"Tab__NotificationCounter","data-testid":"kibble-tab-notification-counter",...a,size:de[r]})]}),pe=({align:e="start",onChange:t,size:s="md",tabs:a,tabsContents:o,...r})=>l.jsxRuntimeExports.jsxs(ie,{className:"Tabs","data-testid":"kibble-tabs",justify:e||r.justify,size:s,onValueChange:({value:i})=>t?.(i),...r,children:[l.jsxRuntimeExports.jsx(le,{className:"Tabs__List","data-testid":"kibble-tabs-list",children:a.map((i,g)=>l.jsxRuntimeExports.jsx(fe,{...i},`tab-${g}`))}),!!o&&o.map((i,g)=>l.jsxRuntimeExports.jsx(ue,{...i},`tabContent-${g}`))]});exports.Tabs=pe;
|
|
2
|
-
//# sourceMappingURL=tabs.component-
|
|
1
|
+
"use strict";const l=require("./jsx-runtime-BjDatQAs.js"),_=require("./icon.component-C0e0UGBw.js"),M=require("./notificationCounter.component-BhZcuBmr.js"),H=require("./heading.component-DcXXyCga.js"),X=require("./create-slot-recipe-context-IwVIgtBt.js"),p=require("react"),u=require("./use-locale-context-D0LByRu9.js"),x=require("./render-strategy-C_zp9LNQ.js"),n=require("./index-CHIISuTq.js");function K(e,t){const[s,a]=p.useState(e);return p.useEffect(()=>{const o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),s}const[N,A]=u.createContext({name:"TabsContext",hookName:"useTabsContext",providerName:"<TabsProvider />"}),S=p.forwardRef((e,t)=>{const[s,a]=u.createSplitProps()(e,["value"]),o=A(),r=x.useRenderStrategyPropsContext(),i=u.usePresence({...r,present:K(o.value===e.value,0),immediate:!0}),g=n.mergeProps(o.getContentProps(s),i.getPresenceProps(),a);return l.jsxRuntimeExports.jsx(u.PresenceProvider,{value:i,children:i.unmounted?null:l.jsxRuntimeExports.jsx(u.ark.div,{...g,ref:u.composeRefs(i.ref,t)})})});S.displayName="TabContent";const L=p.forwardRef((e,t)=>{const s=A(),a=n.mergeProps(s.getIndicatorProps(),e);return l.jsxRuntimeExports.jsx(u.ark.div,{...a,ref:t})});L.displayName="TabIndicator";const O=p.forwardRef((e,t)=>{const s=A(),a=n.mergeProps(s.getListProps(),e);return l.jsxRuntimeExports.jsx(u.ark.div,{...a,ref:t})});O.displayName="TabList";const k=p.forwardRef((e,t)=>{const[s,a]=u.createSplitProps()(e,["disabled","value"]),o=A(),r=n.mergeProps(o.getTriggerProps(s),a);return l.jsxRuntimeExports.jsx(u.ark.button,{...r,ref:t})});k.displayName="TabTrigger";var G=n.createAnatomy("tabs").parts("root","list","trigger","content","indicator"),m=G.build(),Y=e=>e.ids?.root??`tabs:${e.id}`,R=e=>e.ids?.list??`tabs:${e.id}:list`,I=(e,t)=>e.ids?.content??`tabs:${e.id}:content-${t}`,v=(e,t)=>e.ids?.trigger??`tabs:${e.id}:trigger-${t}`,B=e=>e.ids?.indicator??`tabs:${e.id}:indicator`,z=e=>e.getById(R(e)),J=(e,t)=>e.getById(I(e,t)),V=(e,t)=>e.getById(v(e,t)),w=e=>e.getById(B(e)),y=e=>{const s=`[role=tab][data-ownedby='${CSS.escape(R(e))}']:not([disabled])`;return n.queryAll(z(e),s)},Q=e=>n.first(y(e)),Z=e=>n.last(y(e)),ee=(e,t)=>n.nextById(y(e),v(e,t.value),t.loopFocus),te=(e,t)=>n.prevById(y(e),v(e,t.value),t.loopFocus),$=e=>({left:e?.offsetLeft??0,top:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),ae=(e,t)=>{const s=n.itemById(y(e),v(e,t));return D($(s))},D=e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`});function se(e,t){const{state:s,send:a,context:o,prop:r,scope:i}=e,g=r("translations"),T=s.matches("focused"),P=r("orientation")==="vertical",h=r("orientation")==="horizontal",j=r("composite");function F(c){return{selected:o.get("value")===c.value,focused:o.get("focusedValue")===c.value,disabled:!!c.disabled}}return{value:o.get("value"),focusedValue:o.get("focusedValue"),setValue(c){a({type:"SET_VALUE",value:c})},clearValue(){a({type:"CLEAR_VALUE"})},setIndicatorRect(c){const d=v(i,c);a({type:"SET_INDICATOR_RECT",id:d})},syncTabIndex(){a({type:"SYNC_TAB_INDEX"})},selectNext(c){a({type:"TAB_FOCUS",value:c,src:"selectNext"}),a({type:"ARROW_NEXT",src:"selectNext"})},selectPrev(c){a({type:"TAB_FOCUS",value:c,src:"selectPrev"}),a({type:"ARROW_PREV",src:"selectPrev"})},focus(){const c=o.get("value");c&&V(i,c)?.focus()},getRootProps(){return t.element({...m.root.attrs,id:Y(i),"data-orientation":r("orientation"),"data-focus":n.dataAttr(T),dir:r("dir")})},getListProps(){return t.element({...m.list.attrs,id:R(i),role:"tablist",dir:r("dir"),"data-focus":n.dataAttr(T),"aria-orientation":r("orientation"),"data-orientation":r("orientation"),"aria-label":g?.listLabel,onKeyDown(c){if(c.defaultPrevented||!n.isSelfTarget(c)||n.isComposingEvent(c))return;const d={ArrowDown(){h||a({type:"ARROW_NEXT",key:"ArrowDown"})},ArrowUp(){h||a({type:"ARROW_PREV",key:"ArrowUp"})},ArrowLeft(){P||a({type:"ARROW_PREV",key:"ArrowLeft"})},ArrowRight(){P||a({type:"ARROW_NEXT",key:"ArrowRight"})},Home(){a({type:"HOME"})},End(){a({type:"END"})},Enter(){a({type:"ENTER"})}};let f=n.getEventKey(c,{dir:r("dir"),orientation:r("orientation")});const b=d[f];b&&(c.preventDefault(),b(c))}})},getTriggerState:F,getTriggerProps(c){const{value:d,disabled:f}=c,b=F(c);return t.button({...m.trigger.attrs,role:"tab",type:"button",disabled:f,dir:r("dir"),"data-orientation":r("orientation"),"data-disabled":n.dataAttr(f),"aria-disabled":f,"data-value":d,"aria-selected":b.selected,"data-selected":n.dataAttr(b.selected),"data-focus":n.dataAttr(b.focused),"aria-controls":b.selected?I(i,d):void 0,"data-ownedby":R(i),"data-ssr":n.dataAttr(o.get("ssr")),id:v(i,d),tabIndex:b.selected&&j?0:-1,onFocus(){a({type:"TAB_FOCUS",value:d})},onBlur(C){C.relatedTarget?.getAttribute("role")!=="tab"&&a({type:"TAB_BLUR"})},onClick(C){C.defaultPrevented||f||(n.isSafari()&&C.currentTarget.focus(),a({type:"TAB_CLICK",value:d}))}})},getContentProps(c){const{value:d}=c,f=o.get("value")===d;return t.element({...m.content.attrs,dir:r("dir"),id:I(i,d),tabIndex:j?0:-1,"aria-labelledby":v(i,d),role:"tabpanel","data-ownedby":R(i),"data-selected":n.dataAttr(f),"data-orientation":r("orientation"),hidden:!f})},getIndicatorProps(){const c=o.get("indicatorRect"),d=o.get("indicatorTransition");return t.element({id:B(i),...m.indicator.attrs,dir:r("dir"),"data-orientation":r("orientation"),style:{"--transition-property":"left, right, top, bottom, width, height","--left":c.left,"--top":c.top,"--width":c.width,"--height":c.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:d?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[h?"left":"top"]:h?"var(--left)":"var(--top)"}})}}}var{not:re}=n.createGuards(),oe=n.createMachine({props({props:e}){return{dir:"ltr",orientation:"horizontal",activationMode:"automatic",loopFocus:!0,composite:!0,navigate(t){n.clickIfLink(t.node)},defaultValue:null,...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(s){e("onValueChange")?.({value:s})}})),focusedValue:t(()=>({defaultValue:e("value")||e("defaultValue"),sync:!0,onChange(s){e("onFocusChange")?.({focusedValue:s})}})),ssr:t(()=>({defaultValue:!0})),indicatorTransition:t(()=>({defaultValue:!1})),indicatorRect:t(()=>({defaultValue:{left:"0px",top:"0px",width:"0px",height:"0px"}}))}},watch({context:e,prop:t,track:s,action:a}){s([()=>e.get("value")],()=>{a(["allowIndicatorTransition","syncIndicatorRect","syncTabIndex","navigateIfNeeded"])}),s([()=>t("dir"),()=>t("orientation")],()=>{a(["syncIndicatorRect"])})},on:{SET_VALUE:{actions:["setValue"]},CLEAR_VALUE:{actions:["clearValue"]},SET_INDICATOR_RECT:{actions:["setIndicatorRect"]},SYNC_TAB_INDEX:{actions:["syncTabIndex"]}},entry:["syncIndicatorRect","syncTabIndex","syncSsr"],exit:["cleanupObserver"],states:{idle:{on:{TAB_FOCUS:{target:"focused",actions:["setFocusedValue"]},TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]}}},focused:{on:{TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]},ARROW_PREV:[{guard:"selectOnFocus",actions:["focusPrevTab","selectFocusedTab"]},{actions:["focusPrevTab"]}],ARROW_NEXT:[{guard:"selectOnFocus",actions:["focusNextTab","selectFocusedTab"]},{actions:["focusNextTab"]}],HOME:[{guard:"selectOnFocus",actions:["focusFirstTab","selectFocusedTab"]},{actions:["focusFirstTab"]}],END:[{guard:"selectOnFocus",actions:["focusLastTab","selectFocusedTab"]},{actions:["focusLastTab"]}],ENTER:{guard:re("selectOnFocus"),actions:["selectFocusedTab"]},TAB_FOCUS:{actions:["setFocusedValue"]},TAB_BLUR:{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e("activationMode")==="automatic"},actions:{selectFocusedTab({context:e,prop:t}){n.raf(()=>{const s=e.get("focusedValue");if(!s)return;const o=t("deselectable")&&e.get("value")===s?null:s;e.set("value",o)})},setFocusedValue({context:e,event:t,flush:s}){t.value!=null&&s(()=>{e.set("focusedValue",t.value)})},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t,prop:s}){const a=s("deselectable")&&e.get("value")===e.get("focusedValue");e.set("value",a?null:t.value)},clearValue({context:e}){e.set("value",null)},focusFirstTab({scope:e}){n.raf(()=>{Q(e)?.focus()})},focusLastTab({scope:e}){n.raf(()=>{Z(e)?.focus()})},focusNextTab({context:e,prop:t,scope:s,event:a}){const o=a.value??e.get("focusedValue");if(!o)return;const r=ee(s,{value:o,loopFocus:t("loopFocus")});n.raf(()=>{t("composite")?r?.focus():r?.dataset.value!=null&&e.set("focusedValue",r.dataset.value)})},focusPrevTab({context:e,prop:t,scope:s,event:a}){const o=a.value??e.get("focusedValue");if(!o)return;const r=te(s,{value:o,loopFocus:t("loopFocus")});n.raf(()=>{t("composite")?r?.focus():r?.dataset.value!=null&&e.set("focusedValue",r.dataset.value)})},syncTabIndex({context:e,scope:t}){n.raf(()=>{const s=e.get("value");if(!s)return;const a=J(t,s);if(!a)return;n.getFocusables(a).length>0?a.removeAttribute("tabindex"):a.setAttribute("tabindex","0")})},cleanupObserver({refs:e}){const t=e.get("indicatorCleanup");t&&t()},allowIndicatorTransition({context:e}){e.set("indicatorTransition",!0)},setIndicatorRect({context:e,event:t,scope:s}){const a=t.id??e.get("value");if(!w(s))return;if(!a){e.set("indicatorTransition",!1);return}V(s,a)&&(e.set("indicatorRect",ae(s,a)),n.nextTick(()=>{e.set("indicatorTransition",!1)}))},syncSsr({context:e}){e.set("ssr",!1)},syncIndicatorRect({context:e,refs:t,scope:s}){const a=t.get("indicatorCleanup");a&&a();const o=e.get("value");if(!o){e.set("indicatorTransition",!1);return}const r=V(s,o),i=w(s);if(!r||!i)return;const g=n.trackElementRect([r],{measure(T){return $(T)},onEntry({rects:T}){const[P]=T;e.set("indicatorRect",D(P))}});t.set("indicatorCleanup",g)},navigateIfNeeded({context:e,prop:t,scope:s}){const a=e.get("value");if(!a)return;const o=V(s,a);n.isAnchorElement(o)&&t("navigate")?.({value:a,node:o,href:o.href})}}}});u.createProps()(["activationMode","composite","deselectable","dir","getRootNode","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value","defaultValue"]);u.createProps()(["disabled","value"]);u.createProps()(["value"]);const ne=e=>{const t=p.useId(),{getRootNode:s}=u.useEnvironmentContext(),{dir:a}=u.useLocaleContext(),o={id:t,dir:a,getRootNode:s,...e},r=u.useMachine(oe,o);return se(r,u.normalizeProps)},U=p.forwardRef((e,t)=>{const[s,a]=x.splitRenderStrategyProps(e),[o,r]=u.createSplitProps()(a,["activationMode","composite","defaultValue","deselectable","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]),i=ne(o),g=n.mergeProps(i.getRootProps(),r);return l.jsxRuntimeExports.jsx(N,{value:i,children:l.jsxRuntimeExports.jsx(x.RenderStrategyPropsProvider,{value:s,children:l.jsxRuntimeExports.jsx(u.ark.div,{...g,ref:t})})})});U.displayName="TabsRoot";const q=p.forwardRef((e,t)=>{const[s,a]=x.splitRenderStrategyProps(e),[{value:o},r]=u.createSplitProps()(a,["value"]),i=n.mergeProps(o.getRootProps(),r);return l.jsxRuntimeExports.jsx(N,{value:o,children:l.jsxRuntimeExports.jsx(x.RenderStrategyPropsProvider,{value:s,children:l.jsxRuntimeExports.jsx(u.ark.div,{...i,ref:t})})})});q.displayName="TabsRootProvider";const{withProvider:W,withContext:E}=X.createSlotRecipeContext({key:"tabs"});W(q,"root",{forwardAsChild:!0});const ie=W(U,"root",{forwardAsChild:!0}),ce=E(k,"trigger",{forwardAsChild:!0}),ue=E(S,"content",{forwardAsChild:!0});E("div","contentGroup");const le=E(O,"list",{forwardAsChild:!0});E(L,"indicator",{forwardAsChild:!0});const de={xs:"sm",sm:"md",md:"md",lg:"lg"},ge={xs:"xs",sm:"xs",md:"sm",lg:"md"},fe=({iconName:e,iconPosition:t="left",label:s,notificationCounterProps:a,showNotificationCounter:o,size:r="md",...i})=>l.jsxRuntimeExports.jsxs(ce,{className:"Tab","data-testid":"kibble-tab",...i,children:[!!e&&t==="left"&&l.jsxRuntimeExports.jsx(_.Icon,{className:"Tab__Icon","data-testid":"kibble-tab-icon",name:e,size:r,variant:"default"}),l.jsxRuntimeExports.jsx(H.WrappedHeading,{className:"Tab__Label","data-testid":"kibble-tab-label",size:ge[r],children:s}),!!e&&t==="right"&&l.jsxRuntimeExports.jsx(_.Icon,{className:"Tab__Icon","data-testid":"kibble-tab-icon",name:e,size:r}),o&&l.jsxRuntimeExports.jsx(M.NotificationCounter,{className:"Tab__NotificationCounter","data-testid":"kibble-tab-notification-counter",...a,size:de[r]})]}),pe=({align:e="start",onChange:t,size:s="md",tabs:a,tabsContents:o,...r})=>l.jsxRuntimeExports.jsxs(ie,{className:"Tabs","data-testid":"kibble-tabs",justify:e||r.justify,size:s,onValueChange:({value:i})=>t?.(i),...r,children:[l.jsxRuntimeExports.jsx(le,{className:"Tabs__List","data-testid":"kibble-tabs-list",children:a.map((i,g)=>l.jsxRuntimeExports.jsx(fe,{...i},`tab-${g}`))}),!!o&&o.map((i,g)=>l.jsxRuntimeExports.jsx(ue,{...i},`tabContent-${g}`))]});exports.Tabs=pe;
|
|
2
|
+
//# sourceMappingURL=tabs.component-B1WW0jL6.js.map
|