@commercetools/nimbus 0.0.12-rc2 → 0.0.12-rc4
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/accordion-EDJoghXQ.cjs.js +2 -0
- package/dist/chunks/{accordion-Be--VNW6.cjs.js.map → accordion-EDJoghXQ.cjs.js.map} +1 -1
- package/dist/chunks/{accordion-Drl_Y6QC.es.js → accordion-UL4pfC2d.es.js} +24 -24
- package/dist/chunks/{accordion-Drl_Y6QC.es.js.map → accordion-UL4pfC2d.es.js.map} +1 -1
- package/dist/chunks/alert-BhoRNIWA.cjs.js +2 -0
- package/dist/chunks/{alert-DF3J6Yj7.cjs.js.map → alert-BhoRNIWA.cjs.js.map} +1 -1
- package/dist/chunks/{alert-9-Hp2KQ4.es.js → alert-D-ddqYG4.es.js} +25 -26
- package/dist/chunks/{alert-9-Hp2KQ4.es.js.map → alert-D-ddqYG4.es.js.map} +1 -1
- package/dist/chunks/{avatar-DXWmY247.es.js → avatar-Bu12OMzz.es.js} +6 -6
- package/dist/chunks/{avatar-DXWmY247.es.js.map → avatar-Bu12OMzz.es.js.map} +1 -1
- package/dist/chunks/avatar-C2KIWewd.cjs.js +2 -0
- package/dist/chunks/{avatar-DEAravTR.cjs.js.map → avatar-C2KIWewd.cjs.js.map} +1 -1
- package/dist/chunks/avatar.recipe-D3--Rkmb.cjs.js +2 -0
- package/dist/chunks/{avatar.recipe-CQivdbFs.cjs.js.map → avatar.recipe-D3--Rkmb.cjs.js.map} +1 -1
- package/dist/chunks/{avatar.recipe-CxXQlkH6.es.js → avatar.recipe-DfyPWbFZ.es.js} +2 -2
- package/dist/chunks/{avatar.recipe-CxXQlkH6.es.js.map → avatar.recipe-DfyPWbFZ.es.js.map} +1 -1
- package/dist/chunks/{badge-Cg7jASs5.es.js → badge-BJd-Q81M.es.js} +5 -6
- package/dist/chunks/{badge-Cg7jASs5.es.js.map → badge-BJd-Q81M.es.js.map} +1 -1
- package/dist/chunks/badge-CCrBksXu.cjs.js +2 -0
- package/dist/chunks/{badge-BjhZ-byo.cjs.js.map → badge-CCrBksXu.cjs.js.map} +1 -1
- package/dist/chunks/box-CWni3A32.cjs.js +2 -0
- package/dist/chunks/box-CWni3A32.cjs.js.map +1 -0
- package/dist/chunks/box-DuBoAZvq.es.js +12 -0
- package/dist/chunks/box-DuBoAZvq.es.js.map +1 -0
- package/dist/chunks/{button-DNPDogwN.es.js → button-CRUdodZm.es.js} +14 -14
- package/dist/chunks/{button-DNPDogwN.es.js.map → button-CRUdodZm.es.js.map} +1 -1
- package/dist/chunks/button-CU8FW_Pl.cjs.js +2 -0
- package/dist/chunks/{button-BfmWlfwH.cjs.js.map → button-CU8FW_Pl.cjs.js.map} +1 -1
- package/dist/chunks/button.recipe-Cqkj3VMo.cjs.js +2 -0
- package/dist/chunks/{button.recipe-ClPhJ93N.cjs.js.map → button.recipe-Cqkj3VMo.cjs.js.map} +1 -1
- package/dist/chunks/{button.recipe-D9e9Gh9L.es.js → button.recipe-NdTb5f8M.es.js} +2 -2
- package/dist/chunks/{button.recipe-D9e9Gh9L.es.js.map → button.recipe-NdTb5f8M.es.js.map} +1 -1
- package/dist/chunks/calendar-DJKWldpV.cjs.js +2 -0
- package/dist/chunks/{calendar-BgHBd6Dh.cjs.js.map → calendar-DJKWldpV.cjs.js.map} +1 -1
- package/dist/chunks/{calendar-DGKSCKht.es.js → calendar-DzwFtg1t.es.js} +19 -20
- package/dist/chunks/{calendar-DGKSCKht.es.js.map → calendar-DzwFtg1t.es.js.map} +1 -1
- package/dist/chunks/{card-DX8r4prk.es.js → card-BfUdf1Fy.es.js} +23 -24
- package/dist/chunks/{card-DX8r4prk.es.js.map → card-BfUdf1Fy.es.js.map} +1 -1
- package/dist/chunks/card-DeWTV05B.cjs.js +2 -0
- package/dist/chunks/{card-DgvP36g1.cjs.js.map → card-DeWTV05B.cjs.js.map} +1 -1
- package/dist/chunks/checkbox-6nLo9Jy2.cjs.js +2 -0
- package/dist/chunks/{checkbox-BbdENF1i.cjs.js.map → checkbox-6nLo9Jy2.cjs.js.map} +1 -1
- package/dist/chunks/{checkbox-BnfwQBT0.es.js → checkbox-GmYxVrZx.es.js} +32 -32
- package/dist/chunks/{checkbox-BnfwQBT0.es.js.map → checkbox-GmYxVrZx.es.js.map} +1 -1
- package/dist/chunks/code-Dl7u63Zn.es.js +6 -0
- package/dist/chunks/code-Dl7u63Zn.es.js.map +1 -0
- package/dist/chunks/code-q31e3vT2.cjs.js +2 -0
- package/dist/chunks/code-q31e3vT2.cjs.js.map +1 -0
- package/dist/chunks/combobox-DtPDxCo3.cjs.js +2 -0
- package/dist/chunks/{combobox-DIKvq4tw.cjs.js.map → combobox-DtPDxCo3.cjs.js.map} +1 -1
- package/dist/chunks/{combobox-BS6TWlhm.es.js → combobox-gIwba2QG.es.js} +68 -68
- package/dist/chunks/{combobox-BS6TWlhm.es.js.map → combobox-gIwba2QG.es.js.map} +1 -1
- package/dist/chunks/data-table-Cpk3q34E.cjs.js +2 -0
- package/dist/chunks/data-table-Cpk3q34E.cjs.js.map +1 -0
- package/dist/chunks/{data-table-CWSmm1Cq.es.js → data-table-mXLxUWQz.es.js} +1204 -1282
- package/dist/chunks/data-table-mXLxUWQz.es.js.map +1 -0
- package/dist/chunks/date-input-D5unoyMt.es.js +16 -0
- package/dist/chunks/{date-input-BR6daiWa.es.js.map → date-input-D5unoyMt.es.js.map} +1 -1
- package/dist/chunks/date-input-DJ_aFB9i.cjs.js +2 -0
- package/dist/chunks/{date-input-CKu2_a2x.cjs.js.map → date-input-DJ_aFB9i.cjs.js.map} +1 -1
- package/dist/chunks/{date-picker-DqvZ_FI0.es.js → date-picker-CMqAI1lp.es.js} +25 -25
- package/dist/chunks/{date-picker-DqvZ_FI0.es.js.map → date-picker-CMqAI1lp.es.js.map} +1 -1
- package/dist/chunks/date-picker-f3TylaP5.cjs.js +2 -0
- package/dist/chunks/{date-picker-DQ6_2mzc.cjs.js.map → date-picker-f3TylaP5.cjs.js.map} +1 -1
- package/dist/chunks/date-range-picker-CxsPpWyX.cjs.js +2 -0
- package/dist/chunks/{date-range-picker-i33UHqUE.cjs.js.map → date-range-picker-CxsPpWyX.cjs.js.map} +1 -1
- package/dist/chunks/{date-range-picker-Dh-F7d4e.es.js → date-range-picker-Dtji64Q9.es.js} +14 -14
- package/dist/chunks/{date-range-picker-Dh-F7d4e.es.js.map → date-range-picker-Dtji64Q9.es.js.map} +1 -1
- package/dist/chunks/dialog-CVa-E9-A.cjs.js +2 -0
- package/dist/chunks/dialog-CVa-E9-A.cjs.js.map +1 -0
- package/dist/chunks/dialog-DTSuKnyk.es.js +34 -0
- package/dist/chunks/dialog-DTSuKnyk.es.js.map +1 -0
- package/dist/chunks/{divider-Cjs3ESH7.es.js → divider--BAm3ca4.es.js} +7 -8
- package/dist/chunks/{divider-Cjs3ESH7.es.js.map → divider--BAm3ca4.es.js.map} +1 -1
- package/dist/chunks/divider-BuizjeAj.cjs.js +2 -0
- package/dist/chunks/{divider-DU351gdE.cjs.js.map → divider-BuizjeAj.cjs.js.map} +1 -1
- package/dist/chunks/emotion-is-prop-valid.esm-Bb7Ou5_X.cjs.js +2 -0
- package/dist/chunks/emotion-is-prop-valid.esm-Bb7Ou5_X.cjs.js.map +1 -0
- package/dist/chunks/emotion-is-prop-valid.esm-qvxbqhmq.es.js +16 -0
- package/dist/chunks/emotion-is-prop-valid.esm-qvxbqhmq.es.js.map +1 -0
- package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js → extractStyleProps-CZpHKp1I.cjs.js} +2 -2
- package/dist/chunks/{extractStyleProps-BFdEZDYW.cjs.js.map → extractStyleProps-CZpHKp1I.cjs.js.map} +1 -1
- package/dist/chunks/{extractStyleProps-D6vCCKog.es.js → extractStyleProps-vA4cNUoc.es.js} +2 -2
- package/dist/chunks/{extractStyleProps-D6vCCKog.es.js.map → extractStyleProps-vA4cNUoc.es.js.map} +1 -1
- package/dist/chunks/{form-field-hq4IMj9f.es.js → form-field-Dtcfgzyo.es.js} +30 -31
- package/dist/chunks/{form-field-hq4IMj9f.es.js.map → form-field-Dtcfgzyo.es.js.map} +1 -1
- package/dist/chunks/{form-field-SFG0Jvp7.cjs.js → form-field-DxcGAb23.cjs.js} +3 -3
- package/dist/chunks/{form-field-SFG0Jvp7.cjs.js.map → form-field-DxcGAb23.cjs.js.map} +1 -1
- package/dist/chunks/grid-Chuw1xje.cjs.js +2 -0
- package/dist/chunks/{grid-CXpKN2OR.cjs.js.map → grid-Chuw1xje.cjs.js.map} +1 -1
- package/dist/chunks/grid-De8qjf98.es.js +14 -0
- package/dist/chunks/{grid-B3Ggy_FW.es.js.map → grid-De8qjf98.es.js.map} +1 -1
- package/dist/chunks/{icon-BDsjJ4Zi.es.js → icon-BoRbJStV.es.js} +9 -10
- package/dist/chunks/{icon-BDsjJ4Zi.es.js.map → icon-BoRbJStV.es.js.map} +1 -1
- package/dist/chunks/icon-Cny8ZtnX.cjs.js +2 -0
- package/dist/chunks/{icon-DHoLo7_S.cjs.js.map → icon-Cny8ZtnX.cjs.js.map} +1 -1
- package/dist/chunks/{icon-button-EonZGbth.es.js → icon-button-C20Gw8gQ.es.js} +2 -2
- package/dist/chunks/{icon-button-EonZGbth.es.js.map → icon-button-C20Gw8gQ.es.js.map} +1 -1
- package/dist/chunks/{icon-button-D0NyGafI.cjs.js → icon-button-Cc0MkBbk.cjs.js} +2 -2
- package/dist/chunks/{icon-button-D0NyGafI.cjs.js.map → icon-button-Cc0MkBbk.cjs.js.map} +1 -1
- package/dist/chunks/{icon-toggle-button-CcEARpnu.es.js → icon-toggle-button-CgHQMDs3.es.js} +2 -2
- package/dist/chunks/{icon-toggle-button-CcEARpnu.es.js.map → icon-toggle-button-CgHQMDs3.es.js.map} +1 -1
- package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js → icon-toggle-button-D-C99Q0s.cjs.js} +2 -2
- package/dist/chunks/{icon-toggle-button-yeQuEUBY.cjs.js.map → icon-toggle-button-D-C99Q0s.cjs.js.map} +1 -1
- package/dist/chunks/image-CGOYoc2s.cjs.js +2 -0
- package/dist/chunks/{image-bt28epM5.cjs.js.map → image-CGOYoc2s.cjs.js.map} +1 -1
- package/dist/chunks/image-DRigLU80.es.js +8 -0
- package/dist/chunks/{image-MeWmLoV0.es.js.map → image-DRigLU80.es.js.map} +1 -1
- package/dist/chunks/index-C8Yrk__l.cjs.js +4 -0
- package/dist/chunks/{index-sFOzzmTG.cjs.js.map → index-C8Yrk__l.cjs.js.map} +1 -1
- package/dist/chunks/{index-Dvel3Oj5.es.js → index-jAeaCpRm.es.js} +7 -7
- package/dist/chunks/index-jAeaCpRm.es.js.map +1 -0
- package/dist/chunks/kbd-BXN9aXRE.es.js +17 -0
- package/dist/chunks/{kbd-Bc97Bwq3.es.js.map → kbd-BXN9aXRE.es.js.map} +1 -1
- package/dist/chunks/kbd-DFeaXiKY.cjs.js +2 -0
- package/dist/chunks/{kbd-BlZ2RGfa.cjs.js.map → kbd-DFeaXiKY.cjs.js.map} +1 -1
- package/dist/chunks/{kbd.recipe-BTW0MQqx.es.js → kbd.recipe-DXiyvrAP.es.js} +2 -2
- package/dist/chunks/{kbd.recipe-BTW0MQqx.es.js.map → kbd.recipe-DXiyvrAP.es.js.map} +1 -1
- package/dist/chunks/kbd.recipe-DjQgeTG_.cjs.js +2 -0
- package/dist/chunks/{kbd.recipe-9kxAU5ro.cjs.js.map → kbd.recipe-DjQgeTG_.cjs.js.map} +1 -1
- package/dist/chunks/{link-DjzrPyx3.es.js → link-CFK97sc0.es.js} +4 -4
- package/dist/chunks/{link-DjzrPyx3.es.js.map → link-CFK97sc0.es.js.map} +1 -1
- package/dist/chunks/link-DWa1zIUJ.cjs.js +2 -0
- package/dist/chunks/{link-DzUonoQg.cjs.js.map → link-DWa1zIUJ.cjs.js.map} +1 -1
- package/dist/chunks/link.recipe-Co4-fl4U.cjs.js +2 -0
- package/dist/chunks/{link.recipe-BfCxtKjL.cjs.js.map → link.recipe-Co4-fl4U.cjs.js.map} +1 -1
- package/dist/chunks/{link.recipe-BRnFQ5bP.es.js → link.recipe-pXiGIJtI.es.js} +2 -2
- package/dist/chunks/{link.recipe-BRnFQ5bP.es.js.map → link.recipe-pXiGIJtI.es.js.map} +1 -1
- package/dist/chunks/list-DJC9BmoC.cjs.js +2 -0
- package/dist/chunks/list-DJC9BmoC.cjs.js.map +1 -0
- package/dist/chunks/list-Nz5KjWzs.es.js +13 -0
- package/dist/chunks/list-Nz5KjWzs.es.js.map +1 -0
- package/dist/chunks/{loading-spinner-DuBf2cIy.es.js → loading-spinner-CvggCl-H.es.js} +6 -7
- package/dist/chunks/{loading-spinner-DuBf2cIy.es.js.map → loading-spinner-CvggCl-H.es.js.map} +1 -1
- package/dist/chunks/loading-spinner-DdYXuYkg.cjs.js +2 -0
- package/dist/chunks/{loading-spinner-VVQyl725.cjs.js.map → loading-spinner-DdYXuYkg.cjs.js.map} +1 -1
- package/dist/chunks/{menu-CKJfYhIU.es.js → menu-8g9Hn1nm.es.js} +14 -14
- package/dist/chunks/{menu-CKJfYhIU.es.js.map → menu-8g9Hn1nm.es.js.map} +1 -1
- package/dist/chunks/menu-Bm1u-R6o.cjs.js +2 -0
- package/dist/chunks/{menu-CImIQ6uJ.cjs.js.map → menu-Bm1u-R6o.cjs.js.map} +1 -1
- package/dist/chunks/{multiline-text-input-DoHeA-kt.es.js → multiline-text-input-BGnvpB1r.es.js} +12 -14
- package/dist/chunks/{multiline-text-input-DoHeA-kt.es.js.map → multiline-text-input-BGnvpB1r.es.js.map} +1 -1
- package/dist/chunks/multiline-text-input-sXIlwrvT.cjs.js +12 -0
- package/dist/chunks/{multiline-text-input-jdvlKAq1.cjs.js.map → multiline-text-input-sXIlwrvT.cjs.js.map} +1 -1
- package/dist/chunks/{nimbus-provider-DKRUbH11.es.js → nimbus-provider-CybdU89B.es.js} +4 -4
- package/dist/chunks/{nimbus-provider-DKRUbH11.es.js.map → nimbus-provider-CybdU89B.es.js.map} +1 -1
- package/dist/chunks/nimbus-provider-D3DvYEDv.cjs.js +2 -0
- package/dist/chunks/{nimbus-provider-CBZCiFEH.cjs.js.map → nimbus-provider-D3DvYEDv.cjs.js.map} +1 -1
- package/dist/chunks/number-input-CPnA0dO-.cjs.js +2 -0
- package/dist/chunks/{number-input-CnOvkmap.cjs.js.map → number-input-CPnA0dO-.cjs.js.map} +1 -1
- package/dist/chunks/{number-input-BEn83Z9q.es.js → number-input-CzObpfFa.es.js} +11 -11
- package/dist/chunks/{number-input-BEn83Z9q.es.js.map → number-input-CzObpfFa.es.js.map} +1 -1
- package/dist/chunks/{password-input-DSeCpNT-.cjs.js → password-input-BqhrDjyW.cjs.js} +2 -2
- package/dist/chunks/{password-input-DSeCpNT-.cjs.js.map → password-input-BqhrDjyW.cjs.js.map} +1 -1
- package/dist/chunks/{password-input-BGPsQ2R9.es.js → password-input-C_rdTND7.es.js} +5 -5
- package/dist/chunks/{password-input-BGPsQ2R9.es.js.map → password-input-C_rdTND7.es.js.map} +1 -1
- package/dist/chunks/progress-bar-CrS1rODC.cjs.js +2 -0
- package/dist/chunks/{progress-bar-CByPgKbP.cjs.js.map → progress-bar-CrS1rODC.cjs.js.map} +1 -1
- package/dist/chunks/{progress-bar-BsuOolTl.es.js → progress-bar-pPWJ1Sn8.es.js} +19 -19
- package/dist/chunks/{progress-bar-BsuOolTl.es.js.map → progress-bar-pPWJ1Sn8.es.js.map} +1 -1
- package/dist/chunks/radio-input-BTEXrXaF.cjs.js +2 -0
- package/dist/chunks/{radio-input-VMfD6a_K.cjs.js.map → radio-input-BTEXrXaF.cjs.js.map} +1 -1
- package/dist/chunks/{radio-input-CDYvzPq7.es.js → radio-input-OpbQD2zP.es.js} +42 -42
- package/dist/chunks/{radio-input-CDYvzPq7.es.js.map → radio-input-OpbQD2zP.es.js.map} +1 -1
- package/dist/chunks/{range-calendar-DxPBRKpW.es.js → range-calendar-BOP_J_5a.es.js} +21 -22
- package/dist/chunks/{range-calendar-DxPBRKpW.es.js.map → range-calendar-BOP_J_5a.es.js.map} +1 -1
- package/dist/chunks/range-calendar-CFotnBzs.cjs.js +2 -0
- package/dist/chunks/{range-calendar-CnaQY0pH.cjs.js.map → range-calendar-CFotnBzs.cjs.js.map} +1 -1
- package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js → rich-text-input-CItP9BzJ.cjs.js} +2 -2
- package/dist/chunks/{rich-text-input-DmwKaXzi.cjs.js.map → rich-text-input-CItP9BzJ.cjs.js.map} +1 -1
- package/dist/chunks/{rich-text-input-B6OYMXXr.es.js → rich-text-input-CgrxAPHc.es.js} +11 -11
- package/dist/chunks/{rich-text-input-B6OYMXXr.es.js.map → rich-text-input-CgrxAPHc.es.js.map} +1 -1
- package/dist/chunks/{select-X7n0xTYd.es.js → select-CAeD_ZuZ.es.js} +67 -68
- package/dist/chunks/{select-X7n0xTYd.es.js.map → select-CAeD_ZuZ.es.js.map} +1 -1
- package/dist/chunks/select-Coyt1pJN.cjs.js +2 -0
- package/dist/chunks/{select-DT9EbJgb.cjs.js.map → select-Coyt1pJN.cjs.js.map} +1 -1
- package/dist/chunks/simple-grid-Cd2MJxSX.cjs.js +2 -0
- package/dist/chunks/simple-grid-Cd2MJxSX.cjs.js.map +1 -0
- package/dist/chunks/simple-grid-DU5v66TG.es.js +15 -0
- package/dist/chunks/simple-grid-DU5v66TG.es.js.map +1 -0
- package/dist/chunks/{split-button-i2Ezbf3P.cjs.js → split-button-BYrr5vRr.cjs.js} +2 -2
- package/dist/chunks/{split-button-i2Ezbf3P.cjs.js.map → split-button-BYrr5vRr.cjs.js.map} +1 -1
- package/dist/chunks/{split-button-BWXYRDuQ.es.js → split-button-j2bgcP59.es.js} +5 -5
- package/dist/chunks/{split-button-BWXYRDuQ.es.js.map → split-button-j2bgcP59.es.js.map} +1 -1
- package/dist/chunks/stack-CIN13EDn.cjs.js +2 -0
- package/dist/chunks/stack-CIN13EDn.cjs.js.map +1 -0
- package/dist/chunks/stack-CoNreM7B.es.js +11 -0
- package/dist/chunks/stack-CoNreM7B.es.js.map +1 -0
- package/dist/chunks/switch-BgNpbn2e.cjs.js +2 -0
- package/dist/chunks/{switch-kNksAQM3.cjs.js.map → switch-BgNpbn2e.cjs.js.map} +1 -1
- package/dist/chunks/{switch-rkewogOb.es.js → switch-Cid4U3m8.es.js} +8 -8
- package/dist/chunks/{switch-rkewogOb.es.js.map → switch-Cid4U3m8.es.js.map} +1 -1
- package/dist/chunks/tag-group-B3YSTBpb.cjs.js +2 -0
- package/dist/chunks/{tag-group-iRBYcxt6.cjs.js.map → tag-group-B3YSTBpb.cjs.js.map} +1 -1
- package/dist/chunks/{tag-group-DqTm8v26.es.js → tag-group-CeNHz5QQ.es.js} +50 -50
- package/dist/chunks/{tag-group-DqTm8v26.es.js.map → tag-group-CeNHz5QQ.es.js.map} +1 -1
- package/dist/chunks/text-CCW9kDT_.cjs.js +2 -0
- package/dist/chunks/text-CCW9kDT_.cjs.js.map +1 -0
- package/dist/chunks/text-DfQpupDi.es.js +24 -0
- package/dist/chunks/text-DfQpupDi.es.js.map +1 -0
- package/dist/chunks/text-input-C2y4O13I.cjs.js +2 -0
- package/dist/chunks/{text-input-D7SdSWpG.cjs.js.map → text-input-C2y4O13I.cjs.js.map} +1 -1
- package/dist/chunks/text-input-TZXg0lEQ.es.js +18 -0
- package/dist/chunks/{text-input-Dinn4J2V.es.js.map → text-input-TZXg0lEQ.es.js.map} +1 -1
- package/dist/chunks/{time-input-Us0JugnD.es.js → time-input-CI_HoOGU.es.js} +6 -8
- package/dist/chunks/{time-input-Us0JugnD.es.js.map → time-input-CI_HoOGU.es.js.map} +1 -1
- package/dist/chunks/time-input-cHUvGWDc.cjs.js +2 -0
- package/dist/chunks/{time-input-BqTsxXMD.cjs.js.map → time-input-cHUvGWDc.cjs.js.map} +1 -1
- package/dist/chunks/toggle-button-C9ezVsSp.cjs.js +2 -0
- package/dist/chunks/{toggle-button-CsVyAh8N.cjs.js.map → toggle-button-C9ezVsSp.cjs.js.map} +1 -1
- package/dist/chunks/toggle-button-a0gCembi.es.js +29 -0
- package/dist/chunks/{toggle-button-RS4Z6UNN.es.js.map → toggle-button-a0gCembi.es.js.map} +1 -1
- package/dist/chunks/toggle-button-group-DX134q7m.cjs.js +2 -0
- package/dist/chunks/{toggle-button-group-LddoXszz.cjs.js.map → toggle-button-group-DX134q7m.cjs.js.map} +1 -1
- package/dist/chunks/{toggle-button-group-DHMnBWSg.es.js → toggle-button-group-jRdpdYyd.es.js} +14 -15
- package/dist/chunks/{toggle-button-group-DHMnBWSg.es.js.map → toggle-button-group-jRdpdYyd.es.js.map} +1 -1
- package/dist/chunks/{toolbar-DcUEC_uE.cjs.js → toolbar-CLGq6IO7.cjs.js} +2 -2
- package/dist/chunks/{toolbar-DcUEC_uE.cjs.js.map → toolbar-CLGq6IO7.cjs.js.map} +1 -1
- package/dist/chunks/{toolbar-DI1eQG-1.es.js → toolbar-hpBfKrTl.es.js} +3 -3
- package/dist/chunks/{toolbar-DI1eQG-1.es.js.map → toolbar-hpBfKrTl.es.js.map} +1 -1
- package/dist/chunks/{tooltip-CTvNYvui.es.js → tooltip-B1YdruCE.es.js} +4 -4
- package/dist/chunks/{tooltip-CTvNYvui.es.js.map → tooltip-B1YdruCE.es.js.map} +1 -1
- package/dist/chunks/tooltip-g8-hEdZp.cjs.js +2 -0
- package/dist/chunks/{tooltip-CIAEV4_B.cjs.js.map → tooltip-g8-hEdZp.cjs.js.map} +1 -1
- package/dist/chunks/{tooltip.recipe-DsVUEki2.es.js → tooltip.recipe-Cqi_tgR5.es.js} +2 -2
- package/dist/chunks/{tooltip.recipe-DsVUEki2.es.js.map → tooltip.recipe-Cqi_tgR5.es.js.map} +1 -1
- package/dist/chunks/tooltip.recipe-dx7DAJbZ.cjs.js +2 -0
- package/dist/chunks/{tooltip.recipe-VqGdDqQD.cjs.js.map → tooltip.recipe-dx7DAJbZ.cjs.js.map} +1 -1
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.es.js +1 -1
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.es.js +1 -1
- package/dist/components/avatar.cjs +1 -1
- package/dist/components/avatar.es.js +1 -1
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.es.js +1 -1
- package/dist/components/box.cjs +1 -1
- package/dist/components/box.es.js +1 -1
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.es.js +1 -1
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.es.js +1 -1
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.es.js +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.es.js +1 -1
- package/dist/components/code.cjs +1 -1
- package/dist/components/code.es.js +1 -1
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/combobox.es.js +1 -1
- package/dist/components/components.cjs +1 -1
- package/dist/components/components.es.js +60 -60
- package/dist/components/data-table.cjs +1 -1
- package/dist/components/data-table.es.js +1 -1
- package/dist/components/date-input.cjs +1 -1
- package/dist/components/date-input.es.js +1 -1
- package/dist/components/date-picker.cjs +1 -1
- package/dist/components/date-picker.es.js +1 -1
- package/dist/components/date-range-picker.cjs +1 -1
- package/dist/components/date-range-picker.es.js +1 -1
- package/dist/components/dialog.cjs +1 -1
- package/dist/components/dialog.es.js +1 -1
- package/dist/components/divider.cjs +1 -1
- package/dist/components/divider.es.js +1 -1
- package/dist/components/flex.cjs +1 -1
- package/dist/components/flex.es.js +1 -1
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.es.js +1 -1
- package/dist/components/grid.cjs +1 -1
- package/dist/components/grid.es.js +1 -1
- package/dist/components/heading.cjs +1 -1
- package/dist/components/heading.es.js +2 -2
- package/dist/components/icon-button.cjs +1 -1
- package/dist/components/icon-button.es.js +1 -1
- package/dist/components/icon-toggle-button.cjs +1 -1
- package/dist/components/icon-toggle-button.es.js +1 -1
- package/dist/components/icon.cjs +1 -1
- package/dist/components/icon.es.js +1 -1
- package/dist/components/image.cjs +1 -1
- package/dist/components/image.es.js +1 -1
- package/dist/components/kbd.cjs +1 -1
- package/dist/components/kbd.es.js +1 -1
- package/dist/components/link.cjs +1 -1
- package/dist/components/link.es.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.es.js +1 -1
- package/dist/components/loading-spinner.cjs +1 -1
- package/dist/components/loading-spinner.es.js +1 -1
- package/dist/components/multiline-text-input.cjs +1 -1
- package/dist/components/multiline-text-input.es.js +1 -1
- package/dist/components/nimbus-provider.cjs +1 -1
- package/dist/components/nimbus-provider.es.js +1 -1
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.es.js +1 -1
- package/dist/components/password-input.cjs +1 -1
- package/dist/components/password-input.es.js +1 -1
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.cjs.map +1 -1
- package/dist/components/popover.es.js +11 -12
- package/dist/components/popover.es.js.map +1 -1
- package/dist/components/progress-bar.cjs +1 -1
- package/dist/components/progress-bar.es.js +1 -1
- package/dist/components/radio-input.cjs +1 -1
- package/dist/components/radio-input.es.js +1 -1
- package/dist/components/range-calendar.cjs +1 -1
- package/dist/components/range-calendar.es.js +1 -1
- package/dist/components/rich-text-input.cjs +1 -1
- package/dist/components/rich-text-input.es.js +1 -1
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.es.js +1 -1
- package/dist/components/simple-grid.cjs +1 -1
- package/dist/components/simple-grid.es.js +1 -1
- package/dist/components/split-button.cjs +1 -1
- package/dist/components/split-button.es.js +1 -1
- package/dist/components/stack.cjs +1 -1
- package/dist/components/stack.es.js +1 -1
- package/dist/components/switch.cjs +1 -1
- package/dist/components/switch.es.js +1 -1
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.es.js +2 -2
- package/dist/components/tag-group.cjs +1 -1
- package/dist/components/tag-group.es.js +1 -1
- package/dist/components/text-input.cjs +1 -1
- package/dist/components/text-input.es.js +1 -1
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.es.js +1 -1
- package/dist/components/time-input.cjs +1 -1
- package/dist/components/time-input.es.js +1 -1
- package/dist/components/toggle-button-group.cjs +1 -1
- package/dist/components/toggle-button-group.es.js +1 -1
- package/dist/components/toggle-button.cjs +1 -1
- package/dist/components/toggle-button.es.js +1 -1
- package/dist/components/toolbar.cjs +1 -1
- package/dist/components/toolbar.es.js +1 -1
- package/dist/components/tooltip.cjs +1 -1
- package/dist/components/tooltip.es.js +1 -1
- package/dist/components.d.ts +35 -35
- package/dist/data-table.d.ts +35 -35
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +35 -35
- package/dist/index.es.js +54 -54
- package/package.json +1 -1
- package/dist/chunks/accordion-Be--VNW6.cjs.js +0 -2
- package/dist/chunks/alert-DF3J6Yj7.cjs.js +0 -2
- package/dist/chunks/avatar-DEAravTR.cjs.js +0 -2
- package/dist/chunks/avatar.recipe-CQivdbFs.cjs.js +0 -2
- package/dist/chunks/badge-BjhZ-byo.cjs.js +0 -2
- package/dist/chunks/box-BK_2R49p.es.js +0 -13
- package/dist/chunks/box-BK_2R49p.es.js.map +0 -1
- package/dist/chunks/box-BwCVnAwb.cjs.js +0 -2
- package/dist/chunks/box-BwCVnAwb.cjs.js.map +0 -1
- package/dist/chunks/button-BfmWlfwH.cjs.js +0 -2
- package/dist/chunks/button.recipe-ClPhJ93N.cjs.js +0 -2
- package/dist/chunks/calendar-BgHBd6Dh.cjs.js +0 -2
- package/dist/chunks/card-DgvP36g1.cjs.js +0 -2
- package/dist/chunks/checkbox-BbdENF1i.cjs.js +0 -2
- package/dist/chunks/code-C3WbF6Qh.cjs.js +0 -2
- package/dist/chunks/code-C3WbF6Qh.cjs.js.map +0 -1
- package/dist/chunks/code-DM_AtVy-.es.js +0 -8
- package/dist/chunks/code-DM_AtVy-.es.js.map +0 -1
- package/dist/chunks/combobox-DIKvq4tw.cjs.js +0 -2
- package/dist/chunks/config-Mt8_uyhI.cjs.js +0 -2
- package/dist/chunks/config-Mt8_uyhI.cjs.js.map +0 -1
- package/dist/chunks/config-ufbQ08Vi.es.js +0 -6
- package/dist/chunks/config-ufbQ08Vi.es.js.map +0 -1
- package/dist/chunks/create-recipe-context-CrNaylZN.es.js +0 -62
- package/dist/chunks/create-recipe-context-CrNaylZN.es.js.map +0 -1
- package/dist/chunks/create-recipe-context-bXYFTZLs.cjs.js +0 -2
- package/dist/chunks/create-recipe-context-bXYFTZLs.cjs.js.map +0 -1
- package/dist/chunks/create-slot-recipe-context--T0CaFjW.es.js +0 -104
- package/dist/chunks/create-slot-recipe-context--T0CaFjW.es.js.map +0 -1
- package/dist/chunks/create-slot-recipe-context-CimocFDH.cjs.js +0 -2
- package/dist/chunks/create-slot-recipe-context-CimocFDH.cjs.js.map +0 -1
- package/dist/chunks/data-table-CWSmm1Cq.es.js.map +0 -1
- package/dist/chunks/data-table-Cenvhz5D.cjs.js +0 -2
- package/dist/chunks/data-table-Cenvhz5D.cjs.js.map +0 -1
- package/dist/chunks/date-input-BR6daiWa.es.js +0 -17
- package/dist/chunks/date-input-CKu2_a2x.cjs.js +0 -2
- package/dist/chunks/date-picker-DQ6_2mzc.cjs.js +0 -2
- package/dist/chunks/date-range-picker-i33UHqUE.cjs.js +0 -2
- package/dist/chunks/dialog-BQa_NWSr.cjs.js +0 -2
- package/dist/chunks/dialog-BQa_NWSr.cjs.js.map +0 -1
- package/dist/chunks/dialog-D4u5so0e.es.js +0 -1912
- package/dist/chunks/dialog-D4u5so0e.es.js.map +0 -1
- package/dist/chunks/divider-DU351gdE.cjs.js +0 -2
- package/dist/chunks/empty-B5_AO6Pg.cjs.js +0 -2
- package/dist/chunks/empty-B5_AO6Pg.cjs.js.map +0 -1
- package/dist/chunks/empty-D7ZFmvo6.es.js +0 -8
- package/dist/chunks/empty-D7ZFmvo6.es.js.map +0 -1
- package/dist/chunks/factory-CVGqU9CD.cjs.js +0 -3
- package/dist/chunks/factory-CVGqU9CD.cjs.js.map +0 -1
- package/dist/chunks/factory-DmIX2puY.es.js +0 -269
- package/dist/chunks/factory-DmIX2puY.es.js.map +0 -1
- package/dist/chunks/flex-BFC_f5BH.es.js +0 -40
- package/dist/chunks/flex-BFC_f5BH.es.js.map +0 -1
- package/dist/chunks/flex-yqydM5z_.cjs.js +0 -2
- package/dist/chunks/flex-yqydM5z_.cjs.js.map +0 -1
- package/dist/chunks/grid-B3Ggy_FW.es.js +0 -14
- package/dist/chunks/grid-CXpKN2OR.cjs.js +0 -2
- package/dist/chunks/grid-item-CGwfSnm7.cjs.js +0 -2
- package/dist/chunks/grid-item-CGwfSnm7.cjs.js.map +0 -1
- package/dist/chunks/grid-item-DuAynDd1.es.js +0 -78
- package/dist/chunks/grid-item-DuAynDd1.es.js.map +0 -1
- package/dist/chunks/icon-DHoLo7_S.cjs.js +0 -2
- package/dist/chunks/image-B3ISQSVL.cjs.js +0 -2
- package/dist/chunks/image-B3ISQSVL.cjs.js.map +0 -1
- package/dist/chunks/image-CwcCZREa.es.js +0 -22
- package/dist/chunks/image-CwcCZREa.es.js.map +0 -1
- package/dist/chunks/image-MeWmLoV0.es.js +0 -8
- package/dist/chunks/image-bt28epM5.cjs.js +0 -2
- package/dist/chunks/index-46Tt2Ww4.es.js +0 -8
- package/dist/chunks/index-46Tt2Ww4.es.js.map +0 -1
- package/dist/chunks/index-BYEAMD8A.cjs.js +0 -2
- package/dist/chunks/index-BYEAMD8A.cjs.js.map +0 -1
- package/dist/chunks/index-Dvel3Oj5.es.js.map +0 -1
- package/dist/chunks/index-sFOzzmTG.cjs.js +0 -4
- package/dist/chunks/kbd-Bc97Bwq3.es.js +0 -16
- package/dist/chunks/kbd-BlZ2RGfa.cjs.js +0 -2
- package/dist/chunks/kbd.recipe-9kxAU5ro.cjs.js +0 -2
- package/dist/chunks/link-DzUonoQg.cjs.js +0 -2
- package/dist/chunks/link.recipe-BfCxtKjL.cjs.js +0 -2
- package/dist/chunks/list-BTkkDy6B.es.js +0 -23
- package/dist/chunks/list-BTkkDy6B.es.js.map +0 -1
- package/dist/chunks/list-DokC0Ks-.cjs.js +0 -2
- package/dist/chunks/list-DokC0Ks-.cjs.js.map +0 -1
- package/dist/chunks/loading-spinner-VVQyl725.cjs.js +0 -2
- package/dist/chunks/menu-CImIQ6uJ.cjs.js +0 -2
- package/dist/chunks/multiline-text-input-jdvlKAq1.cjs.js +0 -12
- package/dist/chunks/namespace---Td8pR2.es.js +0 -74
- package/dist/chunks/namespace---Td8pR2.es.js.map +0 -1
- package/dist/chunks/namespace-CpLmDcCq.cjs.js +0 -2
- package/dist/chunks/namespace-CpLmDcCq.cjs.js.map +0 -1
- package/dist/chunks/nimbus-provider-CBZCiFEH.cjs.js +0 -2
- package/dist/chunks/number-input-CnOvkmap.cjs.js +0 -2
- package/dist/chunks/progress-bar-CByPgKbP.cjs.js +0 -2
- package/dist/chunks/provider-CHFgwvsP.es.js +0 -989
- package/dist/chunks/provider-CHFgwvsP.es.js.map +0 -1
- package/dist/chunks/provider-DFlBEH6q.cjs.js +0 -16
- package/dist/chunks/provider-DFlBEH6q.cjs.js.map +0 -1
- package/dist/chunks/radio-input-VMfD6a_K.cjs.js +0 -2
- package/dist/chunks/range-calendar-CnaQY0pH.cjs.js +0 -2
- package/dist/chunks/select-DT9EbJgb.cjs.js +0 -2
- package/dist/chunks/simple-grid-B7BgfVAS.cjs.js +0 -2
- package/dist/chunks/simple-grid-B7BgfVAS.cjs.js.map +0 -1
- package/dist/chunks/simple-grid-C6GRMtip.es.js +0 -38
- package/dist/chunks/simple-grid-C6GRMtip.es.js.map +0 -1
- package/dist/chunks/stack-BG0j9HvT.cjs.js +0 -2
- package/dist/chunks/stack-BG0j9HvT.cjs.js.map +0 -1
- package/dist/chunks/stack-QzuqKTKb.es.js +0 -89
- package/dist/chunks/stack-QzuqKTKb.es.js.map +0 -1
- package/dist/chunks/switch-kNksAQM3.cjs.js +0 -2
- package/dist/chunks/tag-group-iRBYcxt6.cjs.js +0 -2
- package/dist/chunks/text-DSjt3Sqv.es.js +0 -26
- package/dist/chunks/text-DSjt3Sqv.es.js.map +0 -1
- package/dist/chunks/text-Dg1sFCuC.cjs.js +0 -2
- package/dist/chunks/text-Dg1sFCuC.cjs.js.map +0 -1
- package/dist/chunks/text-input-D7SdSWpG.cjs.js +0 -2
- package/dist/chunks/text-input-Dinn4J2V.es.js +0 -19
- package/dist/chunks/time-input-BqTsxXMD.cjs.js +0 -2
- package/dist/chunks/toggle-button-CsVyAh8N.cjs.js +0 -2
- package/dist/chunks/toggle-button-RS4Z6UNN.es.js +0 -30
- package/dist/chunks/toggle-button-group-LddoXszz.cjs.js +0 -2
- package/dist/chunks/tooltip-CIAEV4_B.cjs.js +0 -2
- package/dist/chunks/tooltip.recipe-VqGdDqQD.cjs.js +0 -2
- package/dist/chunks/use-recipe-DuU8En0C.es.js +0 -13
- package/dist/chunks/use-recipe-DuU8En0C.es.js.map +0 -1
- package/dist/chunks/use-recipe-pbWWLWIq.cjs.js +0 -2
- package/dist/chunks/use-recipe-pbWWLWIq.cjs.js.map +0 -1
- package/dist/chunks/walk-object-CPVtf-bb.cjs.js +0 -2
- package/dist/chunks/walk-object-CPVtf-bb.cjs.js.map +0 -1
- package/dist/chunks/walk-object-Dpb8i9wi.es.js +0 -27
- package/dist/chunks/walk-object-Dpb8i9wi.es.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.recipe-
|
|
1
|
+
{"version":3,"file":"button.recipe-Cqkj3VMo.cjs.js","sources":["../../src/components/button/button.recipe.ts"],"sourcesContent":["import { defineRecipe } from \"@chakra-ui/react/styled-system\";\n\nexport const buttonRecipe = defineRecipe({\n className: \"nimbus-button\",\n base: {\n borderRadius: \"200\",\n display: \"inline-flex\",\n appearance: \"none\",\n alignItems: \"center\",\n justifyContent: \"center\",\n userSelect: \"none\",\n position: \"relative\",\n whiteSpace: \"nowrap\",\n verticalAlign: \"middle\",\n borderWidth: \"1px\",\n borderColor: \"transparent\",\n cursor: \"button\",\n flexShrink: \"0\",\n outline: \"0\",\n lineHeight: \"1.2\",\n isolation: \"isolate\",\n fontWeight: \"500\",\n transitionProperty: \"common\",\n transitionDuration: \"moderate\",\n focusVisibleRing: \"outside\",\n _disabled: {\n layerStyle: \"disabled\",\n },\n _icon: {\n flexShrink: \"0\",\n },\n },\n variants: {\n size: {\n \"2xs\": {\n h: \"600\",\n minW: \"600\",\n fontSize: \"300\",\n fontWeight: \"500\",\n lineHeight: \"400\",\n px: \"200\",\n gap: \"100\",\n _icon: {\n width: \"400\",\n height: \"400\",\n },\n },\n xs: {\n h: \"800\",\n minW: \"800\",\n fontSize: \"350\",\n fontWeight: \"500\",\n lineHeight: \"400\",\n px: \"300\",\n gap: \"100\",\n _icon: {\n width: \"500\",\n height: \"500\",\n },\n },\n /* sm: {\n h: \"900\",\n minW: \"900\",\n px: \"350\",\n textStyle: \"sm\",\n gap: \"200\",\n _icon: {\n width: \"400\",\n height: \"400\",\n },\n }, */\n md: {\n h: \"1000\",\n minW: \"1000\",\n fontSize: \"400\",\n lineHeight: \"500\",\n px: \"400\",\n gap: \"200\",\n _icon: {\n width: \"600\",\n height: \"600\",\n },\n },\n /* lg: {\n h: \"1100\",\n minW: \"1100\",\n textStyle: \"md\",\n px: \"500\",\n gap: \"300\",\n _icon: {\n width: \"500\",\n height: \"500\",\n },\n }, */\n /* xl: {\n h: \"1200\",\n minW: \"1200\",\n textStyle: \"md\",\n px: \"500\",\n gap: \"250\",\n _icon: {\n width: \"500\",\n height: \"500\",\n },\n }, */\n /* \"2xl\": {\n h: \"1600\",\n minW: \"1600\",\n textStyle: \"lg\",\n px: \"700\",\n gap: \"300\",\n _icon: {\n width: \"600\",\n height: \"600\",\n },\n }, */\n },\n variant: {\n solid: {\n bg: \"colorPalette.9\",\n color: \"colorPalette.contrast\",\n _hover: {\n bg: \"colorPalette.10\",\n },\n _expanded: {\n bg: \"colorPalette.10\",\n },\n },\n subtle: {\n bg: \"colorPalette.3\",\n color: \"colorPalette.11\",\n _hover: {\n bg: \"colorPalette.4\",\n },\n _expanded: {\n bg: \"colorPalette.4\",\n },\n },\n outline: {\n borderWidth: \"1px\",\n borderColor: \"colorPalette.7\",\n color: \"colorPalette.11\",\n transitionProperty: \"background-color, border-color, color\",\n transitionDuration: \"moderate\",\n _hover: {\n bg: \"colorPalette.3\",\n borderColor: \"colorPalette.8\",\n },\n _expanded: {\n bg: \"colorPalette.subtle\",\n },\n },\n ghost: {\n color: \"colorPalette.11\",\n _hover: {\n bg: \"colorPalette.4\",\n },\n _expanded: {\n bg: \"colorPalette.4\",\n },\n },\n link: {\n color: \"colorPalette.11\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n },\n tone: {\n primary: {\n colorPalette: \"primary\",\n },\n critical: {\n colorPalette: \"critical\",\n },\n neutral: {\n colorPalette: \"neutral\",\n },\n info: {\n colorPalette: \"info\",\n },\n },\n },\n defaultVariants: {\n size: \"md\",\n variant: \"subtle\",\n },\n});\n"],"names":["buttonRecipe","defineRecipe"],"mappings":"+DAEaA,EAAeC,EAAAA,aAAa,CACvC,UAAW,gBACX,KAAM,CACJ,aAAc,MACd,QAAS,cACT,WAAY,OACZ,WAAY,SACZ,eAAgB,SAChB,WAAY,OACZ,SAAU,WACV,WAAY,SACZ,cAAe,SACf,YAAa,MACb,YAAa,cACb,OAAQ,SACR,WAAY,IACZ,QAAS,IACT,WAAY,MACZ,UAAW,UACX,WAAY,MACZ,mBAAoB,SACpB,mBAAoB,WACpB,iBAAkB,UAClB,UAAW,CACT,WAAY,UAAA,EAEd,MAAO,CACL,WAAY,GAAA,CACd,EAEF,SAAU,CACR,KAAM,CACJ,MAAO,CACL,EAAG,MACH,KAAM,MACN,SAAU,MACV,WAAY,MACZ,WAAY,MACZ,GAAI,MACJ,IAAK,MACL,MAAO,CACL,MAAO,MACP,OAAQ,KAAA,CACV,EAEF,GAAI,CACF,EAAG,MACH,KAAM,MACN,SAAU,MACV,WAAY,MACZ,WAAY,MACZ,GAAI,MACJ,IAAK,MACL,MAAO,CACL,MAAO,MACP,OAAQ,KAAA,CACV,EAaF,GAAI,CACF,EAAG,OACH,KAAM,OACN,SAAU,MACV,WAAY,MACZ,GAAI,MACJ,IAAK,MACL,MAAO,CACL,MAAO,MACP,OAAQ,KAAA,CACV,CACF,EAmCF,QAAS,CACP,MAAO,CACL,GAAI,iBACJ,MAAO,wBACP,OAAQ,CACN,GAAI,iBAAA,EAEN,UAAW,CACT,GAAI,iBAAA,CACN,EAEF,OAAQ,CACN,GAAI,iBACJ,MAAO,kBACP,OAAQ,CACN,GAAI,gBAAA,EAEN,UAAW,CACT,GAAI,gBAAA,CACN,EAEF,QAAS,CACP,YAAa,MACb,YAAa,iBACb,MAAO,kBACP,mBAAoB,wCACpB,mBAAoB,WACpB,OAAQ,CACN,GAAI,iBACJ,YAAa,gBAAA,EAEf,UAAW,CACT,GAAI,qBAAA,CACN,EAEF,MAAO,CACL,MAAO,kBACP,OAAQ,CACN,GAAI,gBAAA,EAEN,UAAW,CACT,GAAI,gBAAA,CACN,EAEF,KAAM,CACJ,MAAO,kBACP,OAAQ,CACN,eAAgB,WAAA,CAClB,CACF,EAEF,KAAM,CACJ,QAAS,CACP,aAAc,SAAA,EAEhB,SAAU,CACR,aAAc,UAAA,EAEhB,QAAS,CACP,aAAc,SAAA,EAEhB,KAAM,CACJ,aAAc,MAAA,CAChB,CACF,EAEF,gBAAiB,CACf,KAAM,KACN,QAAS,QAAA,CAEb,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineRecipe as e } from "@chakra-ui/react/styled-system";
|
|
2
2
|
const t = /* @__PURE__ */ e({
|
|
3
3
|
className: "nimbus-button",
|
|
4
4
|
base: {
|
|
@@ -188,4 +188,4 @@ const t = /* @__PURE__ */ e({
|
|
|
188
188
|
export {
|
|
189
189
|
t as b
|
|
190
190
|
};
|
|
191
|
-
//# sourceMappingURL=button.recipe-
|
|
191
|
+
//# sourceMappingURL=button.recipe-NdTb5f8M.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.recipe-
|
|
1
|
+
{"version":3,"file":"button.recipe-NdTb5f8M.es.js","sources":["../../src/components/button/button.recipe.ts"],"sourcesContent":["import { defineRecipe } from \"@chakra-ui/react/styled-system\";\n\nexport const buttonRecipe = defineRecipe({\n className: \"nimbus-button\",\n base: {\n borderRadius: \"200\",\n display: \"inline-flex\",\n appearance: \"none\",\n alignItems: \"center\",\n justifyContent: \"center\",\n userSelect: \"none\",\n position: \"relative\",\n whiteSpace: \"nowrap\",\n verticalAlign: \"middle\",\n borderWidth: \"1px\",\n borderColor: \"transparent\",\n cursor: \"button\",\n flexShrink: \"0\",\n outline: \"0\",\n lineHeight: \"1.2\",\n isolation: \"isolate\",\n fontWeight: \"500\",\n transitionProperty: \"common\",\n transitionDuration: \"moderate\",\n focusVisibleRing: \"outside\",\n _disabled: {\n layerStyle: \"disabled\",\n },\n _icon: {\n flexShrink: \"0\",\n },\n },\n variants: {\n size: {\n \"2xs\": {\n h: \"600\",\n minW: \"600\",\n fontSize: \"300\",\n fontWeight: \"500\",\n lineHeight: \"400\",\n px: \"200\",\n gap: \"100\",\n _icon: {\n width: \"400\",\n height: \"400\",\n },\n },\n xs: {\n h: \"800\",\n minW: \"800\",\n fontSize: \"350\",\n fontWeight: \"500\",\n lineHeight: \"400\",\n px: \"300\",\n gap: \"100\",\n _icon: {\n width: \"500\",\n height: \"500\",\n },\n },\n /* sm: {\n h: \"900\",\n minW: \"900\",\n px: \"350\",\n textStyle: \"sm\",\n gap: \"200\",\n _icon: {\n width: \"400\",\n height: \"400\",\n },\n }, */\n md: {\n h: \"1000\",\n minW: \"1000\",\n fontSize: \"400\",\n lineHeight: \"500\",\n px: \"400\",\n gap: \"200\",\n _icon: {\n width: \"600\",\n height: \"600\",\n },\n },\n /* lg: {\n h: \"1100\",\n minW: \"1100\",\n textStyle: \"md\",\n px: \"500\",\n gap: \"300\",\n _icon: {\n width: \"500\",\n height: \"500\",\n },\n }, */\n /* xl: {\n h: \"1200\",\n minW: \"1200\",\n textStyle: \"md\",\n px: \"500\",\n gap: \"250\",\n _icon: {\n width: \"500\",\n height: \"500\",\n },\n }, */\n /* \"2xl\": {\n h: \"1600\",\n minW: \"1600\",\n textStyle: \"lg\",\n px: \"700\",\n gap: \"300\",\n _icon: {\n width: \"600\",\n height: \"600\",\n },\n }, */\n },\n variant: {\n solid: {\n bg: \"colorPalette.9\",\n color: \"colorPalette.contrast\",\n _hover: {\n bg: \"colorPalette.10\",\n },\n _expanded: {\n bg: \"colorPalette.10\",\n },\n },\n subtle: {\n bg: \"colorPalette.3\",\n color: \"colorPalette.11\",\n _hover: {\n bg: \"colorPalette.4\",\n },\n _expanded: {\n bg: \"colorPalette.4\",\n },\n },\n outline: {\n borderWidth: \"1px\",\n borderColor: \"colorPalette.7\",\n color: \"colorPalette.11\",\n transitionProperty: \"background-color, border-color, color\",\n transitionDuration: \"moderate\",\n _hover: {\n bg: \"colorPalette.3\",\n borderColor: \"colorPalette.8\",\n },\n _expanded: {\n bg: \"colorPalette.subtle\",\n },\n },\n ghost: {\n color: \"colorPalette.11\",\n _hover: {\n bg: \"colorPalette.4\",\n },\n _expanded: {\n bg: \"colorPalette.4\",\n },\n },\n link: {\n color: \"colorPalette.11\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n },\n tone: {\n primary: {\n colorPalette: \"primary\",\n },\n critical: {\n colorPalette: \"critical\",\n },\n neutral: {\n colorPalette: \"neutral\",\n },\n info: {\n colorPalette: \"info\",\n },\n },\n },\n defaultVariants: {\n size: \"md\",\n variant: \"subtle\",\n },\n});\n"],"names":["buttonRecipe","defineRecipe"],"mappings":";AAEO,MAAMA,IAAe,gBAAAC,EAAa;AAAA,EACvC,WAAW;AAAA,EACX,MAAM;AAAA,IACJ,cAAc;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,aAAa;AAAA,IACb,aAAa;AAAA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AAO;AAAA,QACL,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,QAAQ;AAAA,UACN,IAAI;AAAA,QAAA;AAAA,QAEN,WAAW;AAAA,UACT,IAAI;AAAA,QAAA;AAAA,MACN;AAAA,MAEF,QAAQ;AAAA,QACN,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,QAAQ;AAAA,UACN,IAAI;AAAA,QAAA;AAAA,QAEN,WAAW;AAAA,UACT,IAAI;AAAA,QAAA;AAAA,MACN;AAAA,MAEF,SAAS;AAAA,QACP,aAAa;AAAA,QACb,aAAa;AAAA,QACb,OAAO;AAAA,QACP,oBAAoB;AAAA,QACpB,oBAAoB;AAAA,QACpB,QAAQ;AAAA,UACN,IAAI;AAAA,UACJ,aAAa;AAAA,QAAA;AAAA,QAEf,WAAW;AAAA,UACT,IAAI;AAAA,QAAA;AAAA,MACN;AAAA,MAEF,OAAO;AAAA,QACL,OAAO;AAAA,QACP,QAAQ;AAAA,UACN,IAAI;AAAA,QAAA;AAAA,QAEN,WAAW;AAAA,UACT,IAAI;AAAA,QAAA;AAAA,MACN;AAAA,MAEF,MAAM;AAAA,QACJ,OAAO;AAAA,QACP,QAAQ;AAAA,UACN,gBAAgB;AAAA,QAAA;AAAA,MAClB;AAAA,IACF;AAAA,IAEF,MAAM;AAAA,MACJ,SAAS;AAAA,QACP,cAAc;AAAA,MAAA;AAAA,MAEhB,UAAU;AAAA,QACR,cAAc;AAAA,MAAA;AAAA,MAEhB,SAAS;AAAA,QACP,cAAc;AAAA,MAAA;AAAA,MAEhB,MAAM;AAAA,QACJ,cAAc;AAAA,MAAA;AAAA,IAChB;AAAA,EACF;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAEb,CAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("./Heading-BaW6t55l.cjs.js"),v=require("@chakra-ui/react/styled-system"),u=require("react"),c=require("./useDateFormatter-CS19Cch2.cjs.js"),m=require("./utils-BHdR5Nww.cjs.js"),S=require("./box-CWni3A32.cjs.js"),w=require("./context-OoV8SSWX.cjs.js"),h=require("./icon-button-Cc0MkBbk.cjs.js"),j=require("./text-CCW9kDT_.cjs.js"),y=require("./stack-CIN13EDn.cjs.js"),q=require("./visually-hidden-Bh-G5QHv.cjs.js"),$=require("@commercetools/nimbus-icons"),P=require("@chakra-ui/react/flex"),R=require("./index-C8Yrk__l.cjs.js"),I=require("./extractStyleProps-CZpHKp1I.cjs.js"),C=require("./Button-BtJHe9xY.cjs.js"),g=require("./Text-BWSfeB9p.cjs.js"),{withProvider:T,withContext:s}=v.createSlotRecipeContext({key:"calendar"}),B=T("div","root"),H=s("div","header"),A=s("div","grids"),F=s("div","monthTitle"),G=s("table","grid"),L=s("thead","gridHeader"),k=s("th","headerCell"),M=s("tbody","gridBody"),N=s("td","bodyCell"),z=()=>{const{locale:d}=w.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),n=m.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$3b805cea1f178355),t=u.useContext(a.$dfd62f934fc76fed$export$9e31dcedda1dadc7),r=n?.visibleDuration?.months||1,o=c.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()),i=r>1;return e.jsx(A,{children:Array.from({length:r},(p,l)=>{const b=t.visibleRange.start.add({months:l}),f=new Intl.DateTimeFormat(d,{month:"long"}).format(b.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()));return e.jsxs(S.Box,{width:r==1?"full":"auto",children:[i&&e.jsx(F,{children:f}),e.jsx(G,{asChild:!0,children:e.jsxs(a.$dfd62f934fc76fed$export$5bd780d491cfc46c,{offset:{months:l},weekdayStyle:"short",children:[e.jsx(L,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$22e2d15eaa4d2377,{children:x=>e.jsx(k,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$ad2135cac3a11b3d,{children:x})})})}),e.jsx(M,{asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$e11f8ba65d857bff,{children:x=>{const D=x.compare(o)===0;return e.jsx(N,{asChild:!0,"data-today":D,children:e.jsx(a.$dfd62f934fc76fed$export$5d847498420df57b,{date:x})})}})})]})})]},f)})})},K=()=>{const t=(m.$64fa3d84918910a7$export$fabf2dc03a41866e(a.$dfd62f934fc76fed$export$3b805cea1f178355)?.visibleDuration?.months||1)>1;return e.jsx(H,{children:e.jsxs(P.Flex,{children:[e.jsxs(y.Stack,{direction:"row",alignItems:"center",children:[e.jsx(q.VisuallyHidden,{children:e.jsx(a.$5cb03073d3f54797$export$a8a3e93435678ff9,{})}),e.jsx(h.IconButton,{slot:t?"previous":"previous-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx($.KeyboardArrowLeft,{})}),e.jsx(j.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:t?"4000":"2000",textAlign:"center","aria-hidden":"true",slot:t?"monthRange":"month"}),e.jsx(h.IconButton,{slot:t?"next":"next-month",size:"xs",variant:"ghost",tone:"primary",children:e.jsx($.KeyboardArrowRight,{})})]}),e.jsx(S.Box,{flexGrow:"1"}),e.jsxs(y.Stack,{direction:"row",alignItems:"center",children:[e.jsx(h.IconButton,{slot:"previous-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx($.KeyboardArrowLeft,{})}),e.jsx(j.Text,{textStyle:"sm",fontWeight:"500",color:"neutral.11",width:"1400",textAlign:"center","aria-hidden":"true",slot:"year"}),e.jsx(h.IconButton,{slot:"next-year",size:"xs",variant:"ghost",tone:"primary",children:e.jsx($.KeyboardArrowRight,{})})]})]})})},V=({children:d})=>{const{locale:n}=w.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),t=u.useContext(C.$d2b4bc8c273e7be6$export$24d547caef80ccd1),r=u.useContext(g.$514c0188e459b4c0$export$9afb8bc826b033ea),o=u.useContext(a.$dfd62f934fc76fed$export$9e31dcedda1dadc7),i={"next-month":{onPress:()=>o.focusNextSection(),"aria-label":"Next month"},"previous-month":{onPress:()=>o.focusPreviousSection(),"aria-label":"Previous month"},"next-year":{onPress:()=>o.focusNextSection(!0),"aria-label":"Next year"},"previous-year":{onPress:()=>o.focusPreviousSection(!0),"aria-label":"Previous year"}},p=new Intl.DateTimeFormat(n,{month:"long"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),l=[new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.start.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),new Intl.DateTimeFormat(n,{month:"long"}).format(o.visibleRange.end.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))].join(" - "),b=new Intl.DateTimeFormat(n,{year:"numeric"}).format(o.focusedDate.toDate(c.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),f={month:{children:p},monthRange:{children:l},year:{children:b}};return e.jsx(m.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[C.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{...t,slots:{...t&&typeof t=="object"&&"slots"in t?t.slots:{},...i}}],[g.$514c0188e459b4c0$export$9afb8bc826b033ea,{...r,slots:{...r&&typeof r=="object"&&"slots"in r?r.slots:{},...f}}]],children:d})},W=d=>{const n=v.useRecipe({recipe:R.calendarSlotRecipe}),[t,r]=n.splitVariantProps(d),[o,i]=I.extractStyleProps(r);return e.jsx(B,{...t,...o,asChild:!0,children:e.jsx(a.$dfd62f934fc76fed$export$e1aef45b828286de,{...i,children:e.jsxs(V,{children:[e.jsx(K,{}),e.jsx(z,{})]})})})};exports.Calendar=W;
|
|
2
|
+
//# sourceMappingURL=calendar-DJKWldpV.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-BgHBd6Dh.cjs.js","sources":["../../src/components/calendar/calendar.slots.tsx","../../src/components/calendar/components/calendar.grids.tsx","../../src/components/calendar/components/calendar.header.tsx","../../src/components/calendar/components/calendar.custom-context.tsx","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport type { CalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"calendar\",\n});\n\nexport interface CalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof calendarSlotRecipe> & CalendarProps<DateValue>\n > {}\nexport const CalendarRootSlot = withProvider<\n HTMLDivElement,\n CalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface CalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarHeaderSlot = withContext<\n HTMLDivElement,\n CalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface CalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarGridsSlot = withContext<\n HTMLDivElement,\n CalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface CalendarMonthTitleSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n CalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface CalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const CalendarGridSlot = withContext<\n HTMLTableElement,\n CalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface CalendarGridHeaderSlotProps extends HTMLChakraProps<\"thead\"> {}\nexport const CalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n CalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface CalendarHeaderCellSlotProps extends HTMLChakraProps<\"th\"> {}\nexport const CalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n CalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface CalendarGridBodySlotProps extends HTMLChakraProps<\"tbody\"> {}\nexport const CalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n CalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface CalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const CalendarCellSlot = withContext<\n HTMLTableCellElement,\n CalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n CalendarContext,\n CalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\n\nimport { Box } from \"@/components\";\n\nimport {\n CalendarCellSlot,\n CalendarGridBodySlot,\n CalendarGridHeaderSlot,\n CalendarGridSlot,\n CalendarGridsSlot,\n CalendarHeaderCellSlot,\n CalendarMonthTitleSlot,\n} from \"../calendar.slots\";\n\nexport const CalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(CalendarContext);\n const calendarState = useContext(CalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <CalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <CalendarMonthTitleSlot>{monthName}</CalendarMonthTitleSlot>\n )}\n <CalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <CalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <CalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </CalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </CalendarGridHeaderSlot>\n <CalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <CalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </CalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </CalendarGridBodySlot>\n </RaCalendarGrid>\n </CalendarGridSlot>\n </Box>\n );\n })}\n </CalendarGridsSlot>\n );\n};\n","import {\n CalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { CalendarHeaderSlot } from \"../calendar.slots\";\n\nexport const CalendarHeader = () => {\n const calendarProps = useSlottedContext(CalendarContext);\n\n // Needed to decide wether to show a single month or a range\n const visibleDurationMonths = calendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <CalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </CalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n CalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const CalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(CalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { CalendarProps } from \"./calendar.types\";\nimport type { DateValue } from \"react-aria\";\n\nimport { Calendar as RaCalendar } from \"react-aria-components\";\n\nimport { CalendarRootSlot } from \"./calendar.slots\";\nimport { CalendarGrids } from \"./components/calendar.grids\";\nimport { CalendarHeader } from \"./components/calendar.header\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { CalendarCustomContext } from \"./components/calendar.custom-context\";\n\n/**\n * # Calendar\n *\n * Calendars display a grid of days in one or more months and allow users to select a single date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/calendar}\n */\nexport const Calendar = (props: CalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: calendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <CalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaCalendar {...otherProps}>\n <CalendarCustomContext>\n <CalendarHeader />\n <CalendarGrids />\n </CalendarCustomContext>\n </RaCalendar>\n </CalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","CalendarRootSlot","CalendarHeaderSlot","CalendarGridsSlot","CalendarMonthTitleSlot","CalendarGridSlot","CalendarGridHeaderSlot","CalendarHeaderCellSlot","CalendarGridBodySlot","CalendarCellSlot","CalendarGrids","locale","useLocale","context","useSlottedContext","CalendarContext","calendarState","useContext","CalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","CalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","CalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","Calendar","props","recipe","useRecipe","calendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaCalendar"],"mappings":"+vBAUM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,UACP,CAAC,EAOYC,EAAmBH,EAG9B,MAAO,MAAM,EAGFI,EAAqBH,EAGhC,MAAO,QAAQ,EAGJI,EAAoBJ,EAG/B,MAAO,OAAO,EAGHK,EAAyBL,EAGpC,MAAO,YAAY,EAGRM,EAAmBN,EAG9B,QAAS,MAAM,EAGJO,EAAyBP,EAGpC,QAAS,YAAY,EAGVQ,EAAyBR,EAGpC,KAAM,YAAY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AE,OAAOK,EAAc,aAAa,IAAI,OAAOM,EAAAA,2CAAkB,CAAC,CAAA,EACnE,KAAK,KAAK,EAENoC,EAAY,IAAI,KAAK,eAAe/C,EAAQ,CAChD,KAAM,SAAA,CACP,EAAE,OAAOK,EAAc,YAAY,OAAOM,EAAAA,0CAAA,CAAkB,CAAC,EAExDqC,EAAY,CAChB,MAAO,CAAE,SAAUH,CAAA,EACnB,WAAY,CAAE,SAAUC,CAAA,EACxB,KAAM,CAAE,SAAUC,CAAA,CAAU,EAG9B,OACElC,EAAAA,IAACoC,EAAAA,0CAAA,CACC,OAAQ,CACN,CACER,EAAAA,0CACA,CACE,GAAGD,EACH,MAAO,CACL,GAAIA,GACJ,OAAOA,GAAkB,UACzB,UAAWA,EACPA,EAAc,MACd,CAAA,EACJ,GAAGI,CAAA,CACL,CACF,EAEF,CACED,EAAAA,0CACA,CACE,GAAGD,EACH,MAAO,CACL,GAAIA,GACJ,OAAOA,GAAgB,UACvB,UAAWA,EACPA,EAAY,MACZ,CAAA,EACJ,GAAGM,CAAA,CACL,CACF,CACF,EAGD,SAAAT,CAAA,CAAA,CAGP,ECtFaW,EAAYC,GAAoC,CAC3D,MAAMC,EAASC,EAAAA,UAAU,CAAE,OAAQC,EAAAA,mBAAoB,EACjD,CAACC,EAAaC,CAAc,EAAIJ,EAAO,kBAAkBD,CAAK,EAC9D,CAACM,EAAYC,CAAU,EAAIC,EAAAA,kBAAkBH,CAAc,EAEjE,OACE3C,EAAAA,IAACvB,EAAA,CAAkB,GAAGiE,EAAc,GAAGE,EAAY,QAAO,GACxD,SAAA5C,EAAAA,IAAC+C,EAAAA,0CAAA,CAAY,GAAGF,EACd,gBAACpB,EAAA,CACC,SAAA,CAAAzB,EAAAA,IAACe,EAAA,EAAe,QACf7B,EAAA,CAAA,CAAc,CAAA,CAAA,CACjB,EACF,EACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"calendar-DJKWldpV.cjs.js","sources":["../../src/components/calendar/calendar.slots.tsx","../../src/components/calendar/components/calendar.grids.tsx","../../src/components/calendar/components/calendar.header.tsx","../../src/components/calendar/components/calendar.custom-context.tsx","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport type { CalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"calendar\",\n});\n\nexport interface CalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof calendarSlotRecipe> & CalendarProps<DateValue>\n > {}\nexport const CalendarRootSlot = withProvider<\n HTMLDivElement,\n CalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface CalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarHeaderSlot = withContext<\n HTMLDivElement,\n CalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface CalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarGridsSlot = withContext<\n HTMLDivElement,\n CalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface CalendarMonthTitleSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n CalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface CalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const CalendarGridSlot = withContext<\n HTMLTableElement,\n CalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface CalendarGridHeaderSlotProps extends HTMLChakraProps<\"thead\"> {}\nexport const CalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n CalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface CalendarHeaderCellSlotProps extends HTMLChakraProps<\"th\"> {}\nexport const CalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n CalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface CalendarGridBodySlotProps extends HTMLChakraProps<\"tbody\"> {}\nexport const CalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n CalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface CalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const CalendarCellSlot = withContext<\n HTMLTableCellElement,\n CalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n CalendarContext,\n CalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\n\nimport { Box } from \"@/components\";\n\nimport {\n CalendarCellSlot,\n CalendarGridBodySlot,\n CalendarGridHeaderSlot,\n CalendarGridSlot,\n CalendarGridsSlot,\n CalendarHeaderCellSlot,\n CalendarMonthTitleSlot,\n} from \"../calendar.slots\";\n\nexport const CalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(CalendarContext);\n const calendarState = useContext(CalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <CalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <CalendarMonthTitleSlot>{monthName}</CalendarMonthTitleSlot>\n )}\n <CalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <CalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <CalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </CalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </CalendarGridHeaderSlot>\n <CalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <CalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </CalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </CalendarGridBodySlot>\n </RaCalendarGrid>\n </CalendarGridSlot>\n </Box>\n );\n })}\n </CalendarGridsSlot>\n );\n};\n","import {\n CalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { CalendarHeaderSlot } from \"../calendar.slots\";\n\nexport const CalendarHeader = () => {\n const calendarProps = useSlottedContext(CalendarContext);\n\n // Needed to decide wether to show a single month or a range\n const visibleDurationMonths = calendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <CalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </CalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n CalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const CalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(CalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { CalendarProps } from \"./calendar.types\";\nimport type { DateValue } from \"react-aria\";\n\nimport { Calendar as RaCalendar } from \"react-aria-components\";\n\nimport { CalendarRootSlot } from \"./calendar.slots\";\nimport { CalendarGrids } from \"./components/calendar.grids\";\nimport { CalendarHeader } from \"./components/calendar.header\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { CalendarCustomContext } from \"./components/calendar.custom-context\";\n\n/**\n * # Calendar\n *\n * Calendars display a grid of days in one or more months and allow users to select a single date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/calendar}\n */\nexport const Calendar = (props: CalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: calendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <CalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaCalendar {...otherProps}>\n <CalendarCustomContext>\n <CalendarHeader />\n <CalendarGrids />\n </CalendarCustomContext>\n </RaCalendar>\n </CalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","CalendarRootSlot","CalendarHeaderSlot","CalendarGridsSlot","CalendarMonthTitleSlot","CalendarGridSlot","CalendarGridHeaderSlot","CalendarHeaderCellSlot","CalendarGridBodySlot","CalendarCellSlot","CalendarGrids","locale","useLocale","context","useSlottedContext","CalendarContext","calendarState","useContext","CalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","CalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","CalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","Calendar","props","recipe","useRecipe","calendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaCalendar"],"mappings":"ssBAUM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,UACP,CAAC,EAOYC,EAAmBH,EAG9B,MAAO,MAAM,EAGFI,EAAqBH,EAGhC,MAAO,QAAQ,EAGJI,EAAoBJ,EAG/B,MAAO,OAAO,EAGHK,EAAyBL,EAGpC,MAAO,YAAY,EAGRM,EAAmBN,EAG9B,QAAS,MAAM,EAGJO,EAAyBP,EAGpC,QAAS,YAAY,EAGVQ,EAA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as d } from "react/jsx-runtime";
|
|
2
2
|
import { $ as S, a as I, b as F, c as G, d as H, e as j, f as w, g as A, h as B } from "./Heading-DEfy_f01.es.js";
|
|
3
|
-
import {
|
|
3
|
+
import { createSlotRecipeContext as L, useRecipe as M } from "@chakra-ui/react/styled-system";
|
|
4
4
|
import { useContext as p } from "react";
|
|
5
|
-
import { $ as
|
|
6
|
-
import { c as D, d as
|
|
7
|
-
import { B as P } from "./box-
|
|
5
|
+
import { $ as N, a as i } from "./useDateFormatter-C7Kxzwro.es.js";
|
|
6
|
+
import { c as D, d as z } from "./utils-BkdW_cdL.es.js";
|
|
7
|
+
import { B as P } from "./box-DuBoAZvq.es.js";
|
|
8
8
|
import { $ as R } from "./context-R4YUlO9Y.es.js";
|
|
9
|
-
import { I as h } from "./icon-button-
|
|
10
|
-
import { T as u } from "./text-
|
|
11
|
-
import { S as x } from "./stack-
|
|
12
|
-
import { V as
|
|
9
|
+
import { I as h } from "./icon-button-C20Gw8gQ.es.js";
|
|
10
|
+
import { T as u } from "./text-DfQpupDi.es.js";
|
|
11
|
+
import { S as x } from "./stack-CoNreM7B.es.js";
|
|
12
|
+
import { V as k } from "./visually-hidden-BluyWhUI.es.js";
|
|
13
13
|
import { KeyboardArrowLeft as y, KeyboardArrowRight as C } from "@commercetools/nimbus-icons";
|
|
14
|
-
import {
|
|
15
|
-
import { h as
|
|
16
|
-
import { e as
|
|
14
|
+
import { Flex as V } from "@chakra-ui/react/flex";
|
|
15
|
+
import { h as K } from "./index-jAeaCpRm.es.js";
|
|
16
|
+
import { e as W } from "./extractStyleProps-vA4cNUoc.es.js";
|
|
17
17
|
import { $ as g } from "./Button-CNBS3n5a.es.js";
|
|
18
18
|
import { $ as v } from "./Text-DOcU1ycg.es.js";
|
|
19
|
-
import { u as W } from "./use-recipe-DuU8En0C.es.js";
|
|
20
19
|
const { withProvider: _, withContext: n } = /* @__PURE__ */ L({
|
|
21
20
|
key: "calendar"
|
|
22
21
|
}), q = /* @__PURE__ */ _("div", "root"), E = /* @__PURE__ */ n("div", "header"), J = /* @__PURE__ */ n("div", "grids"), O = /* @__PURE__ */ n("div", "monthTitle"), Q = /* @__PURE__ */ n("table", "grid"), U = /* @__PURE__ */ n("thead", "gridHeader"), X = /* @__PURE__ */ n("th", "headerCell"), Y = /* @__PURE__ */ n("tbody", "gridBody"), Z = /* @__PURE__ */ n("td", "bodyCell"), ee = () => {
|
|
23
|
-
const { locale: s } = R(), a = D(w), t = p(S), r = a?.visibleDuration?.months || 1, o =
|
|
22
|
+
const { locale: s } = R(), a = D(w), t = p(S), r = a?.visibleDuration?.months || 1, o = N(i()), l = r > 1;
|
|
24
23
|
return /* @__PURE__ */ e(J, { children: Array.from({ length: r }, (b, c) => {
|
|
25
24
|
const $ = t.visibleRange.start.add({
|
|
26
25
|
months: c
|
|
@@ -47,9 +46,9 @@ const { withProvider: _, withContext: n } = /* @__PURE__ */ L({
|
|
|
47
46
|
}) });
|
|
48
47
|
}, te = () => {
|
|
49
48
|
const t = (D(w)?.visibleDuration?.months || 1) > 1;
|
|
50
|
-
return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d(
|
|
49
|
+
return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d(V, { children: [
|
|
51
50
|
/* @__PURE__ */ d(x, { direction: "row", alignItems: "center", children: [
|
|
52
|
-
/* @__PURE__ */ e(
|
|
51
|
+
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(A, {}) }),
|
|
53
52
|
/* @__PURE__ */ e(
|
|
54
53
|
h,
|
|
55
54
|
{
|
|
@@ -147,7 +146,7 @@ const { withProvider: _, withContext: n } = /* @__PURE__ */ L({
|
|
|
147
146
|
year: { children: $ }
|
|
148
147
|
};
|
|
149
148
|
return /* @__PURE__ */ e(
|
|
150
|
-
|
|
149
|
+
z,
|
|
151
150
|
{
|
|
152
151
|
values: [
|
|
153
152
|
[
|
|
@@ -174,14 +173,14 @@ const { withProvider: _, withContext: n } = /* @__PURE__ */ L({
|
|
|
174
173
|
children: s
|
|
175
174
|
}
|
|
176
175
|
);
|
|
177
|
-
},
|
|
178
|
-
const a =
|
|
176
|
+
}, ge = (s) => {
|
|
177
|
+
const a = M({ recipe: K }), [t, r] = a.splitVariantProps(s), [o, l] = W(r);
|
|
179
178
|
return /* @__PURE__ */ e(q, { ...t, ...o, asChild: !0, children: /* @__PURE__ */ e(B, { ...l, children: /* @__PURE__ */ d(oe, { children: [
|
|
180
179
|
/* @__PURE__ */ e(te, {}),
|
|
181
180
|
/* @__PURE__ */ e(ee, {})
|
|
182
181
|
] }) }) });
|
|
183
182
|
};
|
|
184
183
|
export {
|
|
185
|
-
|
|
184
|
+
ge as C
|
|
186
185
|
};
|
|
187
|
-
//# sourceMappingURL=calendar-
|
|
186
|
+
//# sourceMappingURL=calendar-DzwFtg1t.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-DGKSCKht.es.js","sources":["../../src/components/calendar/calendar.slots.tsx","../../src/components/calendar/components/calendar.grids.tsx","../../src/components/calendar/components/calendar.header.tsx","../../src/components/calendar/components/calendar.custom-context.tsx","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport type { CalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"calendar\",\n});\n\nexport interface CalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof calendarSlotRecipe> & CalendarProps<DateValue>\n > {}\nexport const CalendarRootSlot = withProvider<\n HTMLDivElement,\n CalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface CalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarHeaderSlot = withContext<\n HTMLDivElement,\n CalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface CalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarGridsSlot = withContext<\n HTMLDivElement,\n CalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface CalendarMonthTitleSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n CalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface CalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const CalendarGridSlot = withContext<\n HTMLTableElement,\n CalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface CalendarGridHeaderSlotProps extends HTMLChakraProps<\"thead\"> {}\nexport const CalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n CalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface CalendarHeaderCellSlotProps extends HTMLChakraProps<\"th\"> {}\nexport const CalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n CalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface CalendarGridBodySlotProps extends HTMLChakraProps<\"tbody\"> {}\nexport const CalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n CalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface CalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const CalendarCellSlot = withContext<\n HTMLTableCellElement,\n CalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n CalendarContext,\n CalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\n\nimport { Box } from \"@/components\";\n\nimport {\n CalendarCellSlot,\n CalendarGridBodySlot,\n CalendarGridHeaderSlot,\n CalendarGridSlot,\n CalendarGridsSlot,\n CalendarHeaderCellSlot,\n CalendarMonthTitleSlot,\n} from \"../calendar.slots\";\n\nexport const CalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(CalendarContext);\n const calendarState = useContext(CalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <CalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <CalendarMonthTitleSlot>{monthName}</CalendarMonthTitleSlot>\n )}\n <CalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <CalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <CalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </CalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </CalendarGridHeaderSlot>\n <CalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <CalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </CalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </CalendarGridBodySlot>\n </RaCalendarGrid>\n </CalendarGridSlot>\n </Box>\n );\n })}\n </CalendarGridsSlot>\n );\n};\n","import {\n CalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { CalendarHeaderSlot } from \"../calendar.slots\";\n\nexport const CalendarHeader = () => {\n const calendarProps = useSlottedContext(CalendarContext);\n\n // Needed to decide wether to show a single month or a range\n const visibleDurationMonths = calendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <CalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </CalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n CalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const CalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(CalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { CalendarProps } from \"./calendar.types\";\nimport type { DateValue } from \"react-aria\";\n\nimport { Calendar as RaCalendar } from \"react-aria-components\";\n\nimport { CalendarRootSlot } from \"./calendar.slots\";\nimport { CalendarGrids } from \"./components/calendar.grids\";\nimport { CalendarHeader } from \"./components/calendar.header\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { CalendarCustomContext } from \"./components/calendar.custom-context\";\n\n/**\n * # Calendar\n *\n * Calendars display a grid of days in one or more months and allow users to select a single date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/calendar}\n */\nexport const Calendar = (props: CalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: calendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <CalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaCalendar {...otherProps}>\n <CalendarCustomContext>\n <CalendarHeader />\n <CalendarGrids />\n </CalendarCustomContext>\n </RaCalendar>\n </CalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","CalendarRootSlot","CalendarHeaderSlot","CalendarGridsSlot","CalendarMonthTitleSlot","CalendarGridSlot","CalendarGridHeaderSlot","CalendarHeaderCellSlot","CalendarGridBodySlot","CalendarCellSlot","CalendarGrids","locale","useLocale","context","useSlottedContext","CalendarContext","calendarState","useContext","CalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","CalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","CalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","Calendar","props","recipe","useRecipe","calendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAOYC,IAAmB,gBAAAH,EAG9B,OAAO,MAAM,GAGFI,IAAqB,gBAAAH,EAGhC,OAAO,QAAQ,GAGJI,IAAoB,gBAAAJ,EAG/B,OAAO,OAAO,GAGHK,IAAyB,gBAAAL,EAGpC,OAAO,YAAY,GAGRM,IAAmB,gBAAAN,EAG9B,SAAS,MAAM,GAGJO,IAAyB,gBAAAP,EAGpC,SAAS,YAAY,GAGVQ,IAAyB,gBAAAR,EAGpC,MAAM,YAAY,GAGPS,IAAuB,gBAAAT,EAGlC,SAAS,UAAU,GAGRU,IAAmB,gBAAAV,EAG9B,MAAM,UAAU,GC5CLW,KAAgB,MAAM;AACjC,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAUC,EAAkBC,CAAe,GAC3CC,IAAgBC,EAAWC,CAAoB,GAC/CC,IAAqBN,GAAS,iBAAiB,UAAU,GACzDO,IAAYC,EAAMC,GAAkB,GACpCC,IAAkBJ,IAAqB;AAE7C,SACE,gBAAAK,EAACrB,GAAA,EACE,UAAA,MAAM,KAAK,EAAE,QAAQgB,EAAA,GAAsB,CAACM,GAAGC,MAAU;AACxD,UAAMC,IAAWX,EAAc,aAAa,MAAM,IAAI;AAAA,MACpD,QAAQU;AAAA,IAAA,CACT,GACKE,IAAY,IAAI,KAAK,eAAejB,GAA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
{"version":3,"file":"calendar-DzwFtg1t.es.js","sources":["../../src/components/calendar/calendar.slots.tsx","../../src/components/calendar/components/calendar.grids.tsx","../../src/components/calendar/components/calendar.header.tsx","../../src/components/calendar/components/calendar.custom-context.tsx","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport type { CalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"calendar\",\n});\n\nexport interface CalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof calendarSlotRecipe> & CalendarProps<DateValue>\n > {}\nexport const CalendarRootSlot = withProvider<\n HTMLDivElement,\n CalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface CalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarHeaderSlot = withContext<\n HTMLDivElement,\n CalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface CalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarGridsSlot = withContext<\n HTMLDivElement,\n CalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface CalendarMonthTitleSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const CalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n CalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface CalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const CalendarGridSlot = withContext<\n HTMLTableElement,\n CalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface CalendarGridHeaderSlotProps extends HTMLChakraProps<\"thead\"> {}\nexport const CalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n CalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface CalendarHeaderCellSlotProps extends HTMLChakraProps<\"th\"> {}\nexport const CalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n CalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface CalendarGridBodySlotProps extends HTMLChakraProps<\"tbody\"> {}\nexport const CalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n CalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface CalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const CalendarCellSlot = withContext<\n HTMLTableCellElement,\n CalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n CalendarContext,\n CalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\n\nimport { Box } from \"@/components\";\n\nimport {\n CalendarCellSlot,\n CalendarGridBodySlot,\n CalendarGridHeaderSlot,\n CalendarGridSlot,\n CalendarGridsSlot,\n CalendarHeaderCellSlot,\n CalendarMonthTitleSlot,\n} from \"../calendar.slots\";\n\nexport const CalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(CalendarContext);\n const calendarState = useContext(CalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <CalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <CalendarMonthTitleSlot>{monthName}</CalendarMonthTitleSlot>\n )}\n <CalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <CalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <CalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </CalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </CalendarGridHeaderSlot>\n <CalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <CalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </CalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </CalendarGridBodySlot>\n </RaCalendarGrid>\n </CalendarGridSlot>\n </Box>\n );\n })}\n </CalendarGridsSlot>\n );\n};\n","import {\n CalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { CalendarHeaderSlot } from \"../calendar.slots\";\n\nexport const CalendarHeader = () => {\n const calendarProps = useSlottedContext(CalendarContext);\n\n // Needed to decide wether to show a single month or a range\n const visibleDurationMonths = calendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <CalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </CalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n CalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const CalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(CalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { CalendarProps } from \"./calendar.types\";\nimport type { DateValue } from \"react-aria\";\n\nimport { Calendar as RaCalendar } from \"react-aria-components\";\n\nimport { CalendarRootSlot } from \"./calendar.slots\";\nimport { CalendarGrids } from \"./components/calendar.grids\";\nimport { CalendarHeader } from \"./components/calendar.header\";\nimport { calendarSlotRecipe } from \"./calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { CalendarCustomContext } from \"./components/calendar.custom-context\";\n\n/**\n * # Calendar\n *\n * Calendars display a grid of days in one or more months and allow users to select a single date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/calendar}\n */\nexport const Calendar = (props: CalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: calendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <CalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaCalendar {...otherProps}>\n <CalendarCustomContext>\n <CalendarHeader />\n <CalendarGrids />\n </CalendarCustomContext>\n </RaCalendar>\n </CalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","CalendarRootSlot","CalendarHeaderSlot","CalendarGridsSlot","CalendarMonthTitleSlot","CalendarGridSlot","CalendarGridHeaderSlot","CalendarHeaderCellSlot","CalendarGridBodySlot","CalendarCellSlot","CalendarGrids","locale","useLocale","context","useSlottedContext","CalendarContext","calendarState","useContext","CalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","CalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","CalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","Calendar","props","recipe","useRecipe","calendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaCalendar"],"mappings":";;;;;;;;;;;;;;;;;;AAUA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAOYC,IAAmB,gBAAAH,EAG9B,OAAO,MAAM,GAGFI,IAAqB,gBAAAH,EAGhC,OAAO,QAAQ,GAGJI,IAAoB,gBAAAJ,EAG/B,OAAO,O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AA,UACA;AAAA,YACE,GAAGD;AAAA,YACH,OAAO;AAAA,cACL,GAAIA,KACJ,OAAOA,KAAgB,YACvB,WAAWA,IACPA,EAAY,QACZ,CAAA;AAAA,cACJ,GAAGM;AAAA,YAAA;AAAA,UACL;AAAA,QACF;AAAA,MACF;AAAA,MAGD,UAAAT;AAAA,IAAA;AAAA,EAAA;AAGP,GCtFaW,KAAW,CAACC,MAAoC;AAC3D,QAAMC,IAASC,EAAU,EAAE,QAAQC,GAAoB,GACjD,CAACC,GAAaC,CAAc,IAAIJ,EAAO,kBAAkBD,CAAK,GAC9D,CAACM,GAAYC,CAAU,IAAIC,EAAkBH,CAAc;AAEjE,SACE,gBAAA3C,EAACvB,GAAA,EAAkB,GAAGiE,GAAc,GAAGE,GAAY,SAAO,IACxD,UAAA,gBAAA5C,EAAC+C,GAAA,EAAY,GAAGF,GACd,4BAACpB,IAAA,EACC,UAAA;AAAA,IAAA,gBAAAzB,EAACe,IAAA,EAAe;AAAA,sBACf7B,IAAA,CAAA,CAAc;AAAA,EAAA,EAAA,CACjB,GACF,GACF;AAEJ;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as R, useState as l, useMemo as P, useContext as i, useEffect as u } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { S } from "./stack-QzuqKTKb.es.js";
|
|
3
|
+
import { defineSlotRecipe as h, createSlotRecipeContext as H } from "@chakra-ui/react/styled-system";
|
|
4
|
+
import { S } from "./stack-CoNreM7B.es.js";
|
|
6
5
|
import { $ as y } from "./useFocusRing-updnkDQg.es.js";
|
|
7
6
|
import { $ as N } from "./mergeProps-B_9syxhT.es.js";
|
|
8
7
|
const k = /* @__PURE__ */ h({
|
|
@@ -65,20 +64,20 @@ const k = /* @__PURE__ */ h({
|
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
|
-
}), { withProvider: w, withContext:
|
|
67
|
+
}), { withProvider: w, withContext: C } = /* @__PURE__ */ H({
|
|
69
68
|
recipe: k
|
|
70
69
|
}), E = /* @__PURE__ */ w(
|
|
71
70
|
"div",
|
|
72
71
|
"root"
|
|
73
|
-
), V = /* @__PURE__ */
|
|
72
|
+
), V = /* @__PURE__ */ C(
|
|
74
73
|
"div",
|
|
75
74
|
"header"
|
|
76
|
-
), j = /* @__PURE__ */
|
|
75
|
+
), j = /* @__PURE__ */ C(
|
|
77
76
|
"div",
|
|
78
77
|
"content"
|
|
79
78
|
), a = /* @__PURE__ */ R(
|
|
80
79
|
void 0
|
|
81
|
-
),
|
|
80
|
+
), f = ({ children: e, ref: o, ...t }) => {
|
|
82
81
|
const { isFocused: r, isFocusVisible: b, focusProps: x } = y(), [v, d] = l(null), [g, s] = l(null), $ = P(
|
|
83
82
|
() => ({
|
|
84
83
|
setHeader: d,
|
|
@@ -89,7 +88,7 @@ const k = /* @__PURE__ */ h({
|
|
|
89
88
|
return /* @__PURE__ */ n(a.Provider, { value: $, children: /* @__PURE__ */ c(
|
|
90
89
|
E,
|
|
91
90
|
{
|
|
92
|
-
ref:
|
|
91
|
+
ref: o,
|
|
93
92
|
...N(t, x),
|
|
94
93
|
"data-focus": r || void 0,
|
|
95
94
|
"data-focus-visible": b || void 0,
|
|
@@ -99,41 +98,41 @@ const k = /* @__PURE__ */ h({
|
|
|
99
98
|
v,
|
|
100
99
|
g
|
|
101
100
|
] }),
|
|
102
|
-
|
|
101
|
+
e
|
|
103
102
|
]
|
|
104
103
|
}
|
|
105
104
|
) });
|
|
106
105
|
};
|
|
107
|
-
|
|
108
|
-
const
|
|
106
|
+
f.displayName = "Card.Root";
|
|
107
|
+
const m = ({ children: e, ...o }) => {
|
|
109
108
|
const t = i(a);
|
|
110
109
|
return u(() => {
|
|
111
110
|
if (t) {
|
|
112
|
-
const r = /* @__PURE__ */ n(V, { ...
|
|
111
|
+
const r = /* @__PURE__ */ n(V, { ...o, children: e });
|
|
113
112
|
return t.setHeader(r), () => t.setHeader(null);
|
|
114
113
|
}
|
|
115
|
-
}, [
|
|
114
|
+
}, [e, o]), null;
|
|
116
115
|
};
|
|
117
|
-
|
|
118
|
-
const p = ({ children:
|
|
116
|
+
m.displayName = "Card.Header";
|
|
117
|
+
const p = ({ children: e, ...o }) => {
|
|
119
118
|
const t = i(a);
|
|
120
119
|
return u(() => {
|
|
121
120
|
if (t) {
|
|
122
|
-
const r = /* @__PURE__ */ n(j, { ...
|
|
121
|
+
const r = /* @__PURE__ */ n(j, { ...o, children: e });
|
|
123
122
|
return t.setContent(r), () => t.setContent(null);
|
|
124
123
|
}
|
|
125
|
-
}, [
|
|
124
|
+
}, [e, o]), null;
|
|
126
125
|
};
|
|
127
126
|
p.displayName = "Card.Content";
|
|
128
|
-
const
|
|
129
|
-
Root:
|
|
130
|
-
Header:
|
|
127
|
+
const B = {
|
|
128
|
+
Root: f,
|
|
129
|
+
Header: m,
|
|
131
130
|
Content: p
|
|
132
131
|
};
|
|
133
132
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
B as C,
|
|
134
|
+
f as a,
|
|
135
|
+
m as b,
|
|
137
136
|
p as c
|
|
138
137
|
};
|
|
139
|
-
//# sourceMappingURL=card-
|
|
138
|
+
//# sourceMappingURL=card-BfUdf1Fy.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-DX8r4prk.es.js","sources":["../../src/components/card/card.recipe.tsx","../../src/components/card/card.slots.tsx","../../src/components/card/components/card.root.tsx","../../src/components/card/components/card.header.tsx","../../src/components/card/components/card.content.tsx","../../src/components/card/card.tsx"],"sourcesContent":["import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\n/**\n * Recipe configuration for the Card component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const cardRecipe = defineSlotRecipe({\n slots: [\"root\", \"header\", \"content\"],\n\n className: \"nimbus-card\",\n\n base: {\n root: {\n colorPalette: \"slate\",\n display: \"inline-flex\",\n alignItems: \"flex-start\",\n borderRadius: \"300\",\n focusVisibleRing: \"outside\",\n },\n },\n\n variants: {\n cardPadding: {\n sm: {\n root: {\n padding: \"200\",\n },\n },\n md: {\n root: {\n padding: \"400\",\n },\n },\n lg: {\n root: {\n padding: \"600\",\n },\n },\n },\n\n borderStyle: {\n none: {},\n outlined: {\n root: {\n border: \"solid-25\",\n borderColor: \"colorPalette.3\",\n },\n },\n },\n elevation: {\n none: {},\n elevated: {\n root: {\n shadow: \"1\",\n },\n },\n },\n backgroundStyle: {\n default: {\n root: {\n backgroundColor: \"colorPalette.contrast\",\n },\n },\n muted: {\n root: {\n backgroundColor: \"colorPalette.2\",\n },\n },\n },\n },\n});\n","import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { cardRecipe } from \"./card.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface CardRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CardRootProps\n extends HTMLChakraProps<\"div\", CardRecipeProps> {}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CardHeaderProps\n extends HTMLChakraProps<\"div\", CardRecipeProps> {}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CardContentProps\n extends HTMLChakraProps<\"div\", CardRecipeProps> {}\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: cardRecipe,\n});\n\n/**\n * Root component that provides the styling context for the Card component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const CardRoot = withProvider<HTMLDivElement, CardRootProps>(\n \"div\",\n \"root\"\n);\n\nexport const CardHeader = withContext<HTMLDivElement, CardHeaderProps>(\n \"div\",\n \"header\"\n);\nexport const CardContent = withContext<HTMLDivElement, CardContentProps>(\n \"div\",\n \"content\"\n);\n","import { createContext, useMemo, useState, type ReactNode } from \"react\";\nimport { CardRoot as CardRootSlot } from \"../card.slots\";\nimport type { CardProps } from \"../card.types\";\nimport { Stack } from \"../../stack\";\nimport { mergeProps, useFocusRing } from \"react-aria\";\n\ntype CardContextValue = {\n setHeader: (header: React.ReactNode) => void;\n setContent: (content: React.ReactNode) => void;\n};\n\nexport const CardContext = createContext<CardContextValue | undefined>(\n undefined\n);\n\n/**\n * # Card\n *\n * A versatile container component presents self-contained information\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/data-display/card}\n */\nexport const CardRoot = ({ children, ref, ...props }: CardProps) => {\n const { isFocused, isFocusVisible, focusProps } = useFocusRing();\n const [headerNode, setHeader] = useState<ReactNode>(null);\n const [contentNode, setContent] = useState<ReactNode>(null);\n\n // Memoize the context value so we don't cause unnecessary re-renders\n const contextValue = useMemo(\n () => ({\n setHeader,\n setContent,\n }),\n [setHeader, setContent]\n );\n\n return (\n <CardContext.Provider value={contextValue}>\n <CardRootSlot\n ref={ref}\n {...mergeProps(props, focusProps)}\n data-focus={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n tabIndex={0}\n >\n {/* Always render them in this order/layout to protect consumers */}\n <Stack direction=\"column\" gap=\"200\">\n {headerNode}\n {contentNode}\n </Stack>\n\n {/* Render all consumer sub-components, including our own */}\n {children}\n </CardRootSlot>\n </CardContext.Provider>\n );\n};\n\nCardRoot.displayName = \"Card.Root\";\n","import { useContext, useEffect } from \"react\";\nimport {\n CardHeader as CardHeaderSlot,\n type CardHeaderProps,\n} from \"../card.slots\";\nimport { CardContext } from \"./card.root\";\n\nexport const CardHeader = ({ children, ...props }: CardHeaderProps) => {\n const context = useContext(CardContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <CardHeaderSlot {...props}>{children}</CardHeaderSlot>\n );\n // Register it with the parent\n context.setHeader(slotElement);\n\n // On unmount, remove it\n return () => context.setHeader(null);\n }\n }, [children, props]);\n\n return null;\n};\nCardHeader.displayName = \"Card.Header\";\n","import { useContext, useEffect } from \"react\";\nimport {\n CardContent as CardContentSlot,\n type CardContentProps,\n} from \"../card.slots\";\nimport { CardContext } from \"./card.root\";\n\nexport const CardContent = ({ children, ...props }: CardContentProps) => {\n const context = useContext(CardContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <CardContentSlot {...props}>{children}</CardContentSlot>\n );\n // Register it with the parent\n context.setContent(slotElement);\n\n // On unmount, remove it\n return () => context.setContent(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nCardContent.displayName = \"Card.Content\";\n","import { CardRoot } from \"./components/card.root\";\nimport { CardHeader } from \"./components/card.header\";\nimport { CardContent } from \"./components/card.content\";\n\nexport const Card = {\n Root: CardRoot,\n Header: CardHeader,\n Content: CardContent,\n};\n\nexport {\n CardRoot as _CardRoot,\n CardHeader as _CardHeader,\n CardContent as _CardContent,\n};\n"],"names":["cardRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","CardRoot","CardHeader","CardContent","CardContext","createContext","children","ref","props","isFocused","isFocusVisible","focusProps","useFocusRing","headerNode","setHeader","useState","contentNode","setContent","contextValue","useMemo","jsx","jsxs","CardRootSlot","mergeProps","Stack","context","useContext","useEffect","slotElement","CardHeaderSlot","CardContentSlot","Card"],"mappings":";;;;;;;AAMO,MAAMA,IAAa,gBAAAC,EAAiB;AAAA,EACzC,OAAO,CAAC,QAAQ,UAAU,SAAS;AAAA,EAEnC,WAAW;AAAA,EAEX,MAAM;AAAA,IACJ,MAAM;AAAA,MACJ,cAAc;AAAA,MACd,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,kBAAkB;AAAA,IAAA;AAAA,EACpB;AAAA,EAGF,UAAU;AAAA,IACR,aAAa;AAAA,MACX,IAAI;AAAA,QACF,MAAM;AAAA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AUE,CAAK,CAAC,GAEb;AACT;AAEAL,EAAY,cAAc;ACtBnB,MAAM4B,IAAO;AAAA,EAClB,MAAM9B;AAAA,EACN,QAAQC;AAAA,EACR,SAASC;AACX;"}
|
|
1
|
+
{"version":3,"file":"card-BfUdf1Fy.es.js","sources":["../../src/components/card/card.recipe.tsx","../../src/components/card/card.slots.tsx","../../src/components/card/components/card.root.tsx","../../src/components/card/components/card.header.tsx","../../src/components/card/components/card.content.tsx","../../src/components/card/card.tsx"],"sourcesContent":["import { defineSlotRecipe } from \"@chakra-ui/react/styled-system\";\n\n/**\n * Recipe configuration for the Card component.\n * Defines the styling variants and base styles using Chakra UI's recipe system.\n */\nexport const cardRecipe = defineSlotRecipe({\n slots: [\"root\", \"header\", \"content\"],\n\n className: \"nimbus-card\",\n\n base: {\n root: {\n colorPalette: \"slate\",\n display: \"inline-flex\",\n alignItems: \"flex-start\",\n borderRadius: \"300\",\n focusVisibleRing: \"outside\",\n },\n },\n\n variants: {\n cardPadding: {\n sm: {\n root: {\n padding: \"200\",\n },\n },\n md: {\n root: {\n padding: \"400\",\n },\n },\n lg: {\n root: {\n padding: \"600\",\n },\n },\n },\n\n borderStyle: {\n none: {},\n outlined: {\n root: {\n border: \"solid-25\",\n borderColor: \"colorPalette.3\",\n },\n },\n },\n elevation: {\n none: {},\n elevated: {\n root: {\n shadow: \"1\",\n },\n },\n },\n backgroundStyle: {\n default: {\n root: {\n backgroundColor: \"colorPalette.contrast\",\n },\n },\n muted: {\n root: {\n backgroundColor: \"colorPalette.2\",\n },\n },\n },\n },\n});\n","import {\n type HTMLChakraProps,\n type RecipeProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react/styled-system\";\n\nimport { cardRecipe } from \"./card.recipe\";\n\n/**\n * Base recipe props interface that combines Chakra UI's recipe props\n * with the unstyled prop option for the div element.\n */\ninterface CardRecipeProps extends RecipeProps<\"div\">, UnstyledProp {}\n\n/**\n * Root props interface that extends Chakra's HTML props with our recipe props.\n * This creates a complete set of props for the root element, combining\n * HTML attributes, Chakra's styling system, and our custom recipe props.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CardRootProps\n extends HTMLChakraProps<\"div\", CardRecipeProps> {}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CardHeaderProps\n extends HTMLChakraProps<\"div\", CardRecipeProps> {}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CardContentProps\n extends HTMLChakraProps<\"div\", CardRecipeProps> {}\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: cardRecipe,\n});\n\n/**\n * Root component that provides the styling context for the Card component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const CardRoot = withProvider<HTMLDivElement, CardRootProps>(\n \"div\",\n \"root\"\n);\n\nexport const CardHeader = withContext<HTMLDivElement, CardHeaderProps>(\n \"div\",\n \"header\"\n);\nexport const CardContent = withContext<HTMLDivElement, CardContentProps>(\n \"div\",\n \"content\"\n);\n","import { createContext, useMemo, useState, type ReactNode } from \"react\";\nimport { CardRoot as CardRootSlot } from \"../card.slots\";\nimport type { CardProps } from \"../card.types\";\nimport { Stack } from \"../../stack\";\nimport { mergeProps, useFocusRing } from \"react-aria\";\n\ntype CardContextValue = {\n setHeader: (header: React.ReactNode) => void;\n setContent: (content: React.ReactNode) => void;\n};\n\nexport const CardContext = createContext<CardContextValue | undefined>(\n undefined\n);\n\n/**\n * # Card\n *\n * A versatile container component presents self-contained information\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/data-display/card}\n */\nexport const CardRoot = ({ children, ref, ...props }: CardProps) => {\n const { isFocused, isFocusVisible, focusProps } = useFocusRing();\n const [headerNode, setHeader] = useState<ReactNode>(null);\n const [contentNode, setContent] = useState<ReactNode>(null);\n\n // Memoize the context value so we don't cause unnecessary re-renders\n const contextValue = useMemo(\n () => ({\n setHeader,\n setContent,\n }),\n [setHeader, setContent]\n );\n\n return (\n <CardContext.Provider value={contextValue}>\n <CardRootSlot\n ref={ref}\n {...mergeProps(props, focusProps)}\n data-focus={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n tabIndex={0}\n >\n {/* Always render them in this order/layout to protect consumers */}\n <Stack direction=\"column\" gap=\"200\">\n {headerNode}\n {contentNode}\n </Stack>\n\n {/* Render all consumer sub-components, including our own */}\n {children}\n </CardRootSlot>\n </CardContext.Provider>\n );\n};\n\nCardRoot.displayName = \"Card.Root\";\n","import { useContext, useEffect } from \"react\";\nimport {\n CardHeader as CardHeaderSlot,\n type CardHeaderProps,\n} from \"../card.slots\";\nimport { CardContext } from \"./card.root\";\n\nexport const CardHeader = ({ children, ...props }: CardHeaderProps) => {\n const context = useContext(CardContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <CardHeaderSlot {...props}>{children}</CardHeaderSlot>\n );\n // Register it with the parent\n context.setHeader(slotElement);\n\n // On unmount, remove it\n return () => context.setHeader(null);\n }\n }, [children, props]);\n\n return null;\n};\nCardHeader.displayName = \"Card.Header\";\n","import { useContext, useEffect } from \"react\";\nimport {\n CardContent as CardContentSlot,\n type CardContentProps,\n} from \"../card.slots\";\nimport { CardContext } from \"./card.root\";\n\nexport const CardContent = ({ children, ...props }: CardContentProps) => {\n const context = useContext(CardContext);\n\n useEffect(() => {\n if (context) {\n const slotElement = (\n <CardContentSlot {...props}>{children}</CardContentSlot>\n );\n // Register it with the parent\n context.setContent(slotElement);\n\n // On unmount, remove it\n return () => context.setContent(null);\n }\n }, [children, props]);\n\n return null;\n};\n\nCardContent.displayName = \"Card.Content\";\n","import { CardRoot } from \"./components/card.root\";\nimport { CardHeader } from \"./components/card.header\";\nimport { CardContent } from \"./components/card.content\";\n\nexport const Card = {\n Root: CardRoot,\n Header: CardHeader,\n Content: CardContent,\n};\n\nexport {\n CardRoot as _CardRoot,\n CardHeader as _CardHeader,\n CardContent as _CardContent,\n};\n"],"names":["cardRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","CardRoot","CardHeader","CardContent","CardContext","createContext","children","ref","props","isFocused","isFocusVisible","focusProps","useFocusRing","headerNode","setHeader","useState","contentNode","setContent","contextValue","useMemo","jsx","jsxs","CardRootSlot","mergeProps","Stack","context","useContext","useEffect","slotElement","CardHeaderSlot","CardContentSlot","Card"],"mappings":";;;;;;AAMO,MAAMA,IAAa,gBAAAC,EAAiB;AAAA,EACzC,OAAO,CAAC,QAAQ,UAAU,SAAS;AAAA,EAEnC,WAAW;AAAA,EAEX,MAAM;AAAA,IACJ,MAAM;AAAA,MACJ,cAAc;AAAA,MACd,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,kBAAkB;AAAA,IAAA;AAAA,EACpB;AAAA,EAGF,UAAU;AAAA,IACR,aAAa;AAAA,MACX,IAAI;AAAA,QACF,MAAM;AAAA,UACJ,SAAS;AAAA,QAAA;AAAA,MACX;AAAA,MAEF,IAAI;AAAA,QACF,MAAM;AAAA,UACJ,SAAS;AAAA,QAAA;AAAA,MACX;AAAA,MAEF,IAAI;AAAA,QACF,MAAM;AAAA,UACJ,SAAS;AAAA,QAAA;AAAA,MACX;AAAA,IACF;AAAA,IAGF,aAAa;AAAA,MACX,MAAM,CAAA;AAAA,MACN,UAAU;AAAA,QACR,MAAM;AAAA,UACJ,QAAQ;AAAA,UACR,aAAa;AAAA,QAAA;AAAA,MACf;AAAA,IACF;AAAA,IAEF,WAAW;AAAA,MACT,MAAM,CAAA;AAAA,MACN,UAAU;AAAA,QACR,MAAM;AAAA,UACJ,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IACF;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,QACP,MAAM;AAAA,UACJ,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF,OAAO;AAAA,QACL,MAAM;AAAA,UACJ,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAEJ,CAAC,GCtCK,EAAE,cAAAC,GAAc,aAAAC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,EAAgB,GAAGrB,GAAQ,UAAAF,GAAS;AAGvC,aAAAmB,EAAQ,UAAUG,CAAW,GAGtB,MAAMH,EAAQ,UAAU,IAAI;AAAA,IACrC;AAAA,EACF,GAAG,CAACnB,GAAUE,CAAK,CAAC,GAEb;AACT;AACAN,EAAW,cAAc;AClBlB,MAAMC,IAAc,CAAC,EAAE,UAAAG,GAAU,GAAGE,QAA8B;AACvE,QAAMiB,IAAUC,EAAWtB,CAAW;AAEtC,SAAAuB,EAAU,MAAM;AACd,QAAIF,GAAS;AACX,YAAMG,IACJ,gBAAAR,EAACU,GAAA,EAAiB,GAAGtB,GAAQ,UAAAF,GAAS;AAGxC,aAAAmB,EAAQ,WAAWG,CAAW,GAGvB,MAAMH,EAAQ,WAAW,IAAI;AAAA,IACtC;AAAA,EACF,GAAG,CAACnB,GAAUE,CAAK,CAAC,GAEb;AACT;AAEAL,EAAY,cAAc;ACtBnB,MAAM4B,IAAO;AAAA,EAClB,MAAM9B;AAAA,EACN,QAAQC;AAAA,EACR,SAASC;AACX;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),t=require("react"),C=require("@chakra-ui/react/styled-system"),R=require("./stack-CIN13EDn.cjs.js"),p=require("./useFocusRing-CzFer4bD.cjs.js"),P=require("./mergeProps-BA5Cwf5w.cjs.js"),$=C.defineSlotRecipe({slots:["root","header","content"],className:"nimbus-card",base:{root:{colorPalette:"slate",display:"inline-flex",alignItems:"flex-start",borderRadius:"300",focusVisibleRing:"outside"}},variants:{cardPadding:{sm:{root:{padding:"200"}},md:{root:{padding:"400"}},lg:{root:{padding:"600"}}},borderStyle:{none:{},outlined:{root:{border:"solid-25",borderColor:"colorPalette.3"}}},elevation:{none:{},elevated:{root:{shadow:"1"}}},backgroundStyle:{default:{root:{backgroundColor:"colorPalette.contrast"}},muted:{root:{backgroundColor:"colorPalette.2"}}}}}),{withProvider:y,withContext:f}=C.createSlotRecipeContext({recipe:$}),H=y("div","root"),S=f("div","header"),h=f("div","content"),d=t.createContext(void 0),a=({children:o,ref:n,...e})=>{const{isFocused:r,isFocusVisible:x,focusProps:b}=p.$f7dceffc5ad7768b$export$4e328f61c538687f(),[m,l]=t.useState(null),[g,u]=t.useState(null),v=t.useMemo(()=>({setHeader:l,setContent:u}),[l,u]);return s.jsx(d.Provider,{value:v,children:s.jsxs(H,{ref:n,...P.$3ef42575df84b30b$export$9d1611c77c2fe928(e,b),"data-focus":r||void 0,"data-focus-visible":x||void 0,tabIndex:0,children:[s.jsxs(R.Stack,{direction:"column",gap:"200",children:[m,g]}),o]})})};a.displayName="Card.Root";const c=({children:o,...n})=>{const e=t.useContext(d);return t.useEffect(()=>{if(e){const r=s.jsx(S,{...n,children:o});return e.setHeader(r),()=>e.setHeader(null)}},[o,n]),null};c.displayName="Card.Header";const i=({children:o,...n})=>{const e=t.useContext(d);return t.useEffect(()=>{if(e){const r=s.jsx(h,{...n,children:o});return e.setContent(r),()=>e.setContent(null)}},[o,n]),null};i.displayName="Card.Content";const j={Root:a,Header:c,Content:i};exports.Card=j;exports.CardContent=i;exports.CardHeader=c;exports.CardRoot=a;
|
|
2
|
+
//# sourceMappingURL=card-DeWTV05B.cjs.js.map
|