@cerberus-design/react 0.19.0 → 0.19.1
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/build/legacy/components/theme/index.cjs +1 -4
- package/build/legacy/components/theme/index.cjs.map +1 -1
- package/build/legacy/components/theme/theme.cjs +1 -4
- package/build/legacy/components/theme/theme.cjs.map +1 -1
- package/build/legacy/index.cjs +1 -1
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/system/factory.cjs +1 -6
- package/build/legacy/system/factory.cjs.map +1 -1
- package/build/legacy/system/index.cjs +1 -1
- package/build/legacy/system/index.cjs.map +1 -1
- package/build/modern/{chunk-ZLHQYCL3.js → chunk-2MU6WE52.js} +3 -3
- package/build/modern/{chunk-V3LIZS3V.js → chunk-2OWVBM5W.js} +2 -2
- package/build/modern/{chunk-QZ5BIUMH.js → chunk-2Q4KTP6D.js} +6 -6
- package/build/modern/{chunk-YJR4NLDB.js → chunk-2T2S226G.js} +2 -2
- package/build/modern/{chunk-WRKDPEIM.js → chunk-2UFNNWLA.js} +5 -5
- package/build/modern/{chunk-4NW7Q2VS.js → chunk-3Z4TSR6V.js} +2 -2
- package/build/modern/{chunk-F45WBSRP.js → chunk-4DJ6KC4K.js} +6 -6
- package/build/modern/{chunk-WC75SKFH.js → chunk-4Q62OI72.js} +2 -2
- package/build/modern/{chunk-SFQIENJB.js → chunk-4WSCG2CM.js} +3 -3
- package/build/modern/{chunk-EPIO6H3A.js → chunk-5XU3LUPC.js} +2 -2
- package/build/modern/{chunk-HHY26N7O.js → chunk-6BNGJMNL.js} +3 -3
- package/build/modern/{chunk-7F4AOCTU.js → chunk-6TIG456O.js} +2 -2
- package/build/modern/{chunk-LWOV3N62.js → chunk-7WX2RQT6.js} +3 -3
- package/build/modern/{chunk-X627G6B3.js → chunk-A57LVJJF.js} +2 -2
- package/build/modern/{chunk-JQNVN6R6.js → chunk-A655GBYQ.js} +4 -4
- package/build/modern/{chunk-EALORWDQ.js → chunk-ACK44GEO.js} +6 -6
- package/build/modern/{chunk-FRT3VY4M.js → chunk-AJ5TWPXM.js} +3 -3
- package/build/modern/{chunk-4TQO7LCB.js → chunk-ALJYABJX.js} +2 -2
- package/build/modern/{chunk-L654KDXH.js → chunk-AZ5LB6IS.js} +2 -2
- package/build/modern/{chunk-NAPG6OWJ.js → chunk-BDXVYV32.js} +2 -2
- package/build/modern/{chunk-MW2BVQ5A.js → chunk-BK5BIPCG.js} +2 -2
- package/build/modern/{chunk-OCK4XVNE.js → chunk-BOATN5PB.js} +2 -2
- package/build/modern/{chunk-WN2WTSWG.js → chunk-BW64QBCK.js} +2 -2
- package/build/modern/{chunk-RJGEKVHZ.js → chunk-BWZXR2WZ.js} +2 -2
- package/build/modern/{chunk-6QWS7HII.js → chunk-CIIFJ2SA.js} +2 -2
- package/build/modern/{chunk-E2AW2N7Q.js → chunk-CLGDJ4GM.js} +2 -2
- package/build/modern/{chunk-KRTXDJ4S.js → chunk-CMQZN2GZ.js} +2 -2
- package/build/modern/{chunk-GZXW3JIW.js → chunk-COIQJKC3.js} +2 -2
- package/build/modern/{chunk-VKL3CMI3.js → chunk-D47GTCQZ.js} +2 -2
- package/build/modern/{chunk-4FRIJ5VV.js → chunk-DC3NTCCW.js} +2 -2
- package/build/modern/{chunk-3WTLKTIL.js → chunk-E4DXMJ3C.js} +2 -2
- package/build/modern/{chunk-BFV463NP.js → chunk-FMNYWD5T.js} +2 -2
- package/build/modern/{chunk-TCACYLCL.js → chunk-GHM4I5BN.js} +3 -3
- package/build/modern/{chunk-UWNLOY27.js → chunk-GIIPOOSM.js} +2 -2
- package/build/modern/{chunk-P3EIOH5D.js → chunk-HJ67FKQ6.js} +2 -2
- package/build/modern/{chunk-L3V6I7YH.js → chunk-HPWLIE64.js} +2 -2
- package/build/modern/{chunk-JVWOAPWY.js → chunk-IOK2RQK6.js} +4 -4
- package/build/modern/{chunk-AAWEAXIA.js → chunk-IU5YJTKN.js} +2 -2
- package/build/modern/{chunk-DUCW5X4Y.js → chunk-J3XTP6VP.js} +2 -2
- package/build/modern/{chunk-MBZHMWPR.js → chunk-JG5V3AK4.js} +2 -2
- package/build/modern/{chunk-CKLLERV7.js → chunk-JSK6OD6J.js} +2 -2
- package/build/modern/{chunk-KJYL3RJ2.js → chunk-KLZPY4YX.js} +2 -2
- package/build/modern/{chunk-HBS3B3SE.js → chunk-KM3G4YFF.js} +2 -2
- package/build/modern/{chunk-CIKCQHPC.js → chunk-KSYZMMXN.js} +3 -3
- package/build/modern/{chunk-KTTGGO72.js → chunk-KYYKBLP2.js} +2 -2
- package/build/modern/{chunk-OQN4HVLQ.js → chunk-L2G4XKLT.js} +2 -2
- package/build/modern/{chunk-NZBKI6AF.js → chunk-LRIYLZSL.js} +3 -3
- package/build/modern/{chunk-TQB6U3JH.js → chunk-LW62VSVZ.js} +2 -2
- package/build/modern/{chunk-APDQJ7MW.js → chunk-M4NNRVTU.js} +2 -2
- package/build/modern/{chunk-JPWFSCTC.js → chunk-MG2YW4IP.js} +2 -2
- package/build/modern/{chunk-NZZS2A53.js → chunk-MXW63O5N.js} +2 -2
- package/build/modern/{chunk-DUFKXBQT.js → chunk-N2DZNGUS.js} +2 -2
- package/build/modern/{chunk-24FZWSGV.js → chunk-NH2RSI7N.js} +2 -2
- package/build/modern/{chunk-QHV4IK52.js → chunk-NPZJTTTS.js} +5 -5
- package/build/modern/{chunk-5CG7URT6.js → chunk-OFACU2SY.js} +2 -2
- package/build/modern/{chunk-WJHG3ZFR.js → chunk-OMM4CPZU.js} +2 -2
- package/build/modern/{chunk-QULAH262.js → chunk-OVDJPTML.js} +3 -3
- package/build/modern/{chunk-P4GJKPNL.js → chunk-OVYHM5DH.js} +2 -2
- package/build/modern/{chunk-VQ3NO6IC.js → chunk-P6WEDKIB.js} +2 -2
- package/build/modern/{chunk-DWKGFNTK.js → chunk-PQ5DEKSH.js} +2 -2
- package/build/modern/{chunk-B4X5H2QZ.js → chunk-QM4DC6QF.js} +2 -2
- package/build/modern/{chunk-6W6QY3XG.js → chunk-QOTRCNC7.js} +2 -2
- package/build/modern/{chunk-56YCKMC2.js → chunk-RDFAC3XX.js} +2 -2
- package/build/modern/{chunk-3XA6Y4S4.js → chunk-RFANIL5H.js} +2 -2
- package/build/modern/{chunk-ULKVI2EH.js → chunk-RGLJDMIO.js} +3 -3
- package/build/modern/{chunk-MS7LB3BL.js → chunk-RXAHVNN2.js} +2 -2
- package/build/modern/{chunk-26VVDQAY.js → chunk-S7ALRSVU.js} +2 -2
- package/build/modern/{chunk-7PTAPZOO.js → chunk-SFAJKI45.js} +2 -2
- package/build/modern/{chunk-TXV55LWL.js → chunk-SGFITMUF.js} +2 -2
- package/build/modern/{chunk-JFWPJXFF.js → chunk-SQIB5EOA.js} +2 -2
- package/build/modern/{chunk-RIBBTTT4.js → chunk-TF2DXEUF.js} +2 -2
- package/build/modern/{chunk-BF2IDJMZ.js → chunk-THMNM4CZ.js} +2 -2
- package/build/modern/{chunk-JLMHKTPI.js → chunk-U6ECBUYN.js} +2 -2
- package/build/modern/{chunk-WC5DERNW.js → chunk-UCP3GQOJ.js} +3 -13
- package/build/modern/chunk-UCP3GQOJ.js.map +1 -0
- package/build/modern/{chunk-GPGFQNJ6.js → chunk-UHXKG2ZP.js} +2 -2
- package/build/modern/{chunk-TGCKJHEE.js → chunk-UKAVYSJ5.js} +3 -3
- package/build/modern/{chunk-VOVGPV7G.js → chunk-UXU2CVPI.js} +2 -2
- package/build/modern/{chunk-VB5XZZKE.js → chunk-VIUQS3VG.js} +2 -2
- package/build/modern/{chunk-KUR42DQQ.js → chunk-VXG4AEMZ.js} +2 -2
- package/build/modern/{chunk-6LH6MOXD.js → chunk-VZXYGBU6.js} +2 -2
- package/build/modern/{chunk-OKU736EK.js → chunk-WGSUBJNI.js} +2 -2
- package/build/modern/{chunk-TVSVKDWV.js → chunk-WKAI4OK3.js} +2 -2
- package/build/modern/{chunk-SQRFRBDB.js → chunk-WO6MF3XM.js} +2 -2
- package/build/modern/{chunk-BCN2E47W.js → chunk-Y67NIX2N.js} +3 -3
- package/build/modern/{chunk-NE6TEVH2.js → chunk-YCVNE3CA.js} +2 -2
- package/build/modern/{chunk-X7JS25IL.js → chunk-YI3P5QG4.js} +2 -2
- package/build/modern/{chunk-KUTKPR3G.js → chunk-YQNOAJM7.js} +2 -2
- package/build/modern/{chunk-T5TX5YHC.js → chunk-YTKY3AHF.js} +2 -2
- package/build/modern/{chunk-4LBGIGNJ.js → chunk-YUEVV2DE.js} +2 -2
- package/build/modern/{chunk-G4CDF7LY.js → chunk-YVYOOJ3X.js} +2 -2
- package/build/modern/{chunk-Q2MJ7JRM.js → chunk-YZFXHGMG.js} +2 -2
- package/build/modern/chunk-ZGPHSKEB.js +18 -0
- package/build/modern/chunk-ZGPHSKEB.js.map +1 -0
- package/build/modern/{chunk-XNER5INS.js → chunk-ZO3GSLWZ.js} +2 -2
- package/build/modern/{chunk-DJCPF4JA.js → chunk-ZPMGW4U7.js} +2 -2
- package/build/modern/{chunk-KOVD3FG7.js → chunk-ZZSHEW4N.js} +2 -2
- package/build/modern/components/accordion/index.js +6 -5
- package/build/modern/components/accordion/item-group.js +6 -5
- package/build/modern/components/accordion/item-indicator.js +5 -4
- package/build/modern/components/accordion/parts.js +4 -3
- package/build/modern/components/accordion/primitives.js +3 -2
- package/build/modern/components/admonition/admonition.js +9 -8
- package/build/modern/components/admonition/index.js +9 -8
- package/build/modern/components/admonition/match-avatar.js +6 -5
- package/build/modern/components/admonition/parts.js +4 -3
- package/build/modern/components/admonition/primitives.js +3 -2
- package/build/modern/components/avatar/avatar.js +5 -4
- package/build/modern/components/avatar/index.js +5 -4
- package/build/modern/components/avatar/parts.js +4 -3
- package/build/modern/components/avatar/primitives.js +3 -2
- package/build/modern/components/button/button.js +4 -3
- package/build/modern/components/button/index.js +5 -4
- package/build/modern/components/button/parts.js +5 -4
- package/build/modern/components/button/primitives.js +3 -2
- package/build/modern/components/checkbox/checkbox-icon.js +5 -4
- package/build/modern/components/checkbox/checkbox.js +6 -5
- package/build/modern/components/checkbox/index.js +6 -5
- package/build/modern/components/checkbox/parts.js +4 -3
- package/build/modern/components/checkbox/primitives.js +3 -2
- package/build/modern/components/circular-progress/circular-progress.js +4 -3
- package/build/modern/components/circular-progress/index.js +4 -3
- package/build/modern/components/circular-progress/primitives.js +3 -2
- package/build/modern/components/combobox/combobox.js +5 -4
- package/build/modern/components/combobox/index.js +9 -8
- package/build/modern/components/combobox/item-group.js +5 -4
- package/build/modern/components/combobox/item.js +5 -4
- package/build/modern/components/combobox/parts.js +4 -3
- package/build/modern/components/combobox/primitives.js +3 -2
- package/build/modern/components/combobox/use-stateful-collection.js +4 -3
- package/build/modern/components/cta-dialog/index.js +15 -14
- package/build/modern/components/cta-dialog/provider.js +15 -14
- package/build/modern/components/cta-dialog/trigger-item.js +5 -4
- package/build/modern/components/date-picker/calendar.js +14 -13
- package/build/modern/components/date-picker/content.js +5 -4
- package/build/modern/components/date-picker/date-picker.js +5 -4
- package/build/modern/components/date-picker/day-view.js +10 -9
- package/build/modern/components/date-picker/index.js +18 -17
- package/build/modern/components/date-picker/input.js +8 -7
- package/build/modern/components/date-picker/month-view.js +10 -9
- package/build/modern/components/date-picker/parts.js +4 -3
- package/build/modern/components/date-picker/primitives.js +3 -2
- package/build/modern/components/date-picker/range-input.js +8 -7
- package/build/modern/components/date-picker/trigger.js +7 -6
- package/build/modern/components/date-picker/view-control-group.js +9 -8
- package/build/modern/components/date-picker/year-view.js +10 -9
- package/build/modern/components/deprecated/Label.js +7 -6
- package/build/modern/components/dialog/close-icon-trigger.js +6 -5
- package/build/modern/components/dialog/dialog.js +4 -3
- package/build/modern/components/dialog/index.js +8 -7
- package/build/modern/components/dialog/parts.js +4 -3
- package/build/modern/components/dialog/primitives.js +3 -2
- package/build/modern/components/field/field.js +5 -4
- package/build/modern/components/field/helper-text.js +4 -3
- package/build/modern/components/field/index.js +6 -5
- package/build/modern/components/field/input.js +3 -2
- package/build/modern/components/field/parts.js +4 -3
- package/build/modern/components/field/primitives.js +3 -2
- package/build/modern/components/fieldset/fieldset.js +5 -4
- package/build/modern/components/fieldset/index.js +5 -4
- package/build/modern/components/fieldset/parts.js +4 -3
- package/build/modern/components/fieldset/primitives.js +3 -2
- package/build/modern/components/file-upload/file-status.js +14 -13
- package/build/modern/components/file-upload/file-uploader.js +6 -5
- package/build/modern/components/file-upload/index.js +15 -14
- package/build/modern/components/icon-button/button.js +4 -3
- package/build/modern/components/icon-button/index.js +4 -3
- package/build/modern/components/icon-button/primitives.js +3 -2
- package/build/modern/components/menu/index.js +4 -3
- package/build/modern/components/menu/menu.js +4 -3
- package/build/modern/components/menu/primitives.js +3 -2
- package/build/modern/components/notifications/center.js +8 -7
- package/build/modern/components/notifications/close-trigger.js +5 -4
- package/build/modern/components/notifications/index.js +8 -7
- package/build/modern/components/notifications/parts.js +4 -3
- package/build/modern/components/notifications/primitives.js +3 -2
- package/build/modern/components/progress/index.js +4 -3
- package/build/modern/components/progress/primitives.js +3 -2
- package/build/modern/components/progress/progress-bar.js +4 -3
- package/build/modern/components/radio/index.js +7 -6
- package/build/modern/components/radio/parts.js +4 -3
- package/build/modern/components/radio/primitives.js +3 -2
- package/build/modern/components/radio/radio.js +4 -3
- package/build/modern/components/rating/index.js +5 -4
- package/build/modern/components/rating/parts.js +4 -3
- package/build/modern/components/rating/primitives.js +3 -2
- package/build/modern/components/rating/rating.js +5 -4
- package/build/modern/components/select/index.js +7 -6
- package/build/modern/components/select/option-group.js +4 -3
- package/build/modern/components/select/option.js +5 -4
- package/build/modern/components/select/parts.js +4 -3
- package/build/modern/components/select/primitives.js +3 -2
- package/build/modern/components/select/select.js +5 -4
- package/build/modern/components/switch/index.js +5 -4
- package/build/modern/components/switch/parts.js +4 -3
- package/build/modern/components/switch/primitives.js +3 -2
- package/build/modern/components/switch/switch.js +5 -4
- package/build/modern/components/table/index.js +5 -4
- package/build/modern/components/table/parts.js +4 -3
- package/build/modern/components/table/primitives.js +3 -2
- package/build/modern/components/table/table.js +4 -3
- package/build/modern/components/tabs/index.js +5 -4
- package/build/modern/components/tabs/parts.js +4 -3
- package/build/modern/components/tabs/primitives.js +3 -2
- package/build/modern/components/tabs/tabs.js +5 -4
- package/build/modern/components/tag/index.js +5 -4
- package/build/modern/components/tag/tag.js +5 -4
- package/build/modern/components/theme/index.js +3 -2
- package/build/modern/components/theme/theme.js +3 -2
- package/build/modern/components/toggle/index.js +4 -3
- package/build/modern/components/toggle/parts.js +4 -3
- package/build/modern/components/toggle/primitives.js +3 -2
- package/build/modern/components/tooltip/index.js +5 -4
- package/build/modern/components/tooltip/parts.js +4 -3
- package/build/modern/components/tooltip/primitives.js +3 -2
- package/build/modern/components/tooltip/tooltip.js +5 -4
- package/build/modern/context/confirm-modal.js +14 -13
- package/build/modern/context/field.js +3 -2
- package/build/modern/context/field.js.map +1 -1
- package/build/modern/context/prompt-modal.js +18 -17
- package/build/modern/index.js +127 -126
- package/build/modern/index.js.map +1 -1
- package/build/modern/system/factory.js +1 -2
- package/build/modern/system/index.js +2 -1
- package/package.json +2 -2
- package/src/system/factory.ts +2 -2
- package/build/modern/chunk-WC5DERNW.js.map +0 -1
- /package/build/modern/{chunk-ZLHQYCL3.js.map → chunk-2MU6WE52.js.map} +0 -0
- /package/build/modern/{chunk-V3LIZS3V.js.map → chunk-2OWVBM5W.js.map} +0 -0
- /package/build/modern/{chunk-QZ5BIUMH.js.map → chunk-2Q4KTP6D.js.map} +0 -0
- /package/build/modern/{chunk-YJR4NLDB.js.map → chunk-2T2S226G.js.map} +0 -0
- /package/build/modern/{chunk-WRKDPEIM.js.map → chunk-2UFNNWLA.js.map} +0 -0
- /package/build/modern/{chunk-4NW7Q2VS.js.map → chunk-3Z4TSR6V.js.map} +0 -0
- /package/build/modern/{chunk-F45WBSRP.js.map → chunk-4DJ6KC4K.js.map} +0 -0
- /package/build/modern/{chunk-WC75SKFH.js.map → chunk-4Q62OI72.js.map} +0 -0
- /package/build/modern/{chunk-SFQIENJB.js.map → chunk-4WSCG2CM.js.map} +0 -0
- /package/build/modern/{chunk-EPIO6H3A.js.map → chunk-5XU3LUPC.js.map} +0 -0
- /package/build/modern/{chunk-HHY26N7O.js.map → chunk-6BNGJMNL.js.map} +0 -0
- /package/build/modern/{chunk-7F4AOCTU.js.map → chunk-6TIG456O.js.map} +0 -0
- /package/build/modern/{chunk-LWOV3N62.js.map → chunk-7WX2RQT6.js.map} +0 -0
- /package/build/modern/{chunk-X627G6B3.js.map → chunk-A57LVJJF.js.map} +0 -0
- /package/build/modern/{chunk-JQNVN6R6.js.map → chunk-A655GBYQ.js.map} +0 -0
- /package/build/modern/{chunk-EALORWDQ.js.map → chunk-ACK44GEO.js.map} +0 -0
- /package/build/modern/{chunk-FRT3VY4M.js.map → chunk-AJ5TWPXM.js.map} +0 -0
- /package/build/modern/{chunk-4TQO7LCB.js.map → chunk-ALJYABJX.js.map} +0 -0
- /package/build/modern/{chunk-L654KDXH.js.map → chunk-AZ5LB6IS.js.map} +0 -0
- /package/build/modern/{chunk-NAPG6OWJ.js.map → chunk-BDXVYV32.js.map} +0 -0
- /package/build/modern/{chunk-MW2BVQ5A.js.map → chunk-BK5BIPCG.js.map} +0 -0
- /package/build/modern/{chunk-OCK4XVNE.js.map → chunk-BOATN5PB.js.map} +0 -0
- /package/build/modern/{chunk-WN2WTSWG.js.map → chunk-BW64QBCK.js.map} +0 -0
- /package/build/modern/{chunk-RJGEKVHZ.js.map → chunk-BWZXR2WZ.js.map} +0 -0
- /package/build/modern/{chunk-6QWS7HII.js.map → chunk-CIIFJ2SA.js.map} +0 -0
- /package/build/modern/{chunk-E2AW2N7Q.js.map → chunk-CLGDJ4GM.js.map} +0 -0
- /package/build/modern/{chunk-KRTXDJ4S.js.map → chunk-CMQZN2GZ.js.map} +0 -0
- /package/build/modern/{chunk-GZXW3JIW.js.map → chunk-COIQJKC3.js.map} +0 -0
- /package/build/modern/{chunk-VKL3CMI3.js.map → chunk-D47GTCQZ.js.map} +0 -0
- /package/build/modern/{chunk-4FRIJ5VV.js.map → chunk-DC3NTCCW.js.map} +0 -0
- /package/build/modern/{chunk-3WTLKTIL.js.map → chunk-E4DXMJ3C.js.map} +0 -0
- /package/build/modern/{chunk-BFV463NP.js.map → chunk-FMNYWD5T.js.map} +0 -0
- /package/build/modern/{chunk-TCACYLCL.js.map → chunk-GHM4I5BN.js.map} +0 -0
- /package/build/modern/{chunk-UWNLOY27.js.map → chunk-GIIPOOSM.js.map} +0 -0
- /package/build/modern/{chunk-P3EIOH5D.js.map → chunk-HJ67FKQ6.js.map} +0 -0
- /package/build/modern/{chunk-L3V6I7YH.js.map → chunk-HPWLIE64.js.map} +0 -0
- /package/build/modern/{chunk-JVWOAPWY.js.map → chunk-IOK2RQK6.js.map} +0 -0
- /package/build/modern/{chunk-AAWEAXIA.js.map → chunk-IU5YJTKN.js.map} +0 -0
- /package/build/modern/{chunk-DUCW5X4Y.js.map → chunk-J3XTP6VP.js.map} +0 -0
- /package/build/modern/{chunk-MBZHMWPR.js.map → chunk-JG5V3AK4.js.map} +0 -0
- /package/build/modern/{chunk-CKLLERV7.js.map → chunk-JSK6OD6J.js.map} +0 -0
- /package/build/modern/{chunk-KJYL3RJ2.js.map → chunk-KLZPY4YX.js.map} +0 -0
- /package/build/modern/{chunk-HBS3B3SE.js.map → chunk-KM3G4YFF.js.map} +0 -0
- /package/build/modern/{chunk-CIKCQHPC.js.map → chunk-KSYZMMXN.js.map} +0 -0
- /package/build/modern/{chunk-KTTGGO72.js.map → chunk-KYYKBLP2.js.map} +0 -0
- /package/build/modern/{chunk-OQN4HVLQ.js.map → chunk-L2G4XKLT.js.map} +0 -0
- /package/build/modern/{chunk-NZBKI6AF.js.map → chunk-LRIYLZSL.js.map} +0 -0
- /package/build/modern/{chunk-TQB6U3JH.js.map → chunk-LW62VSVZ.js.map} +0 -0
- /package/build/modern/{chunk-APDQJ7MW.js.map → chunk-M4NNRVTU.js.map} +0 -0
- /package/build/modern/{chunk-JPWFSCTC.js.map → chunk-MG2YW4IP.js.map} +0 -0
- /package/build/modern/{chunk-NZZS2A53.js.map → chunk-MXW63O5N.js.map} +0 -0
- /package/build/modern/{chunk-DUFKXBQT.js.map → chunk-N2DZNGUS.js.map} +0 -0
- /package/build/modern/{chunk-24FZWSGV.js.map → chunk-NH2RSI7N.js.map} +0 -0
- /package/build/modern/{chunk-QHV4IK52.js.map → chunk-NPZJTTTS.js.map} +0 -0
- /package/build/modern/{chunk-5CG7URT6.js.map → chunk-OFACU2SY.js.map} +0 -0
- /package/build/modern/{chunk-WJHG3ZFR.js.map → chunk-OMM4CPZU.js.map} +0 -0
- /package/build/modern/{chunk-QULAH262.js.map → chunk-OVDJPTML.js.map} +0 -0
- /package/build/modern/{chunk-P4GJKPNL.js.map → chunk-OVYHM5DH.js.map} +0 -0
- /package/build/modern/{chunk-VQ3NO6IC.js.map → chunk-P6WEDKIB.js.map} +0 -0
- /package/build/modern/{chunk-DWKGFNTK.js.map → chunk-PQ5DEKSH.js.map} +0 -0
- /package/build/modern/{chunk-B4X5H2QZ.js.map → chunk-QM4DC6QF.js.map} +0 -0
- /package/build/modern/{chunk-6W6QY3XG.js.map → chunk-QOTRCNC7.js.map} +0 -0
- /package/build/modern/{chunk-56YCKMC2.js.map → chunk-RDFAC3XX.js.map} +0 -0
- /package/build/modern/{chunk-3XA6Y4S4.js.map → chunk-RFANIL5H.js.map} +0 -0
- /package/build/modern/{chunk-ULKVI2EH.js.map → chunk-RGLJDMIO.js.map} +0 -0
- /package/build/modern/{chunk-MS7LB3BL.js.map → chunk-RXAHVNN2.js.map} +0 -0
- /package/build/modern/{chunk-26VVDQAY.js.map → chunk-S7ALRSVU.js.map} +0 -0
- /package/build/modern/{chunk-7PTAPZOO.js.map → chunk-SFAJKI45.js.map} +0 -0
- /package/build/modern/{chunk-TXV55LWL.js.map → chunk-SGFITMUF.js.map} +0 -0
- /package/build/modern/{chunk-JFWPJXFF.js.map → chunk-SQIB5EOA.js.map} +0 -0
- /package/build/modern/{chunk-RIBBTTT4.js.map → chunk-TF2DXEUF.js.map} +0 -0
- /package/build/modern/{chunk-BF2IDJMZ.js.map → chunk-THMNM4CZ.js.map} +0 -0
- /package/build/modern/{chunk-JLMHKTPI.js.map → chunk-U6ECBUYN.js.map} +0 -0
- /package/build/modern/{chunk-GPGFQNJ6.js.map → chunk-UHXKG2ZP.js.map} +0 -0
- /package/build/modern/{chunk-TGCKJHEE.js.map → chunk-UKAVYSJ5.js.map} +0 -0
- /package/build/modern/{chunk-VOVGPV7G.js.map → chunk-UXU2CVPI.js.map} +0 -0
- /package/build/modern/{chunk-VB5XZZKE.js.map → chunk-VIUQS3VG.js.map} +0 -0
- /package/build/modern/{chunk-KUR42DQQ.js.map → chunk-VXG4AEMZ.js.map} +0 -0
- /package/build/modern/{chunk-6LH6MOXD.js.map → chunk-VZXYGBU6.js.map} +0 -0
- /package/build/modern/{chunk-OKU736EK.js.map → chunk-WGSUBJNI.js.map} +0 -0
- /package/build/modern/{chunk-TVSVKDWV.js.map → chunk-WKAI4OK3.js.map} +0 -0
- /package/build/modern/{chunk-SQRFRBDB.js.map → chunk-WO6MF3XM.js.map} +0 -0
- /package/build/modern/{chunk-BCN2E47W.js.map → chunk-Y67NIX2N.js.map} +0 -0
- /package/build/modern/{chunk-NE6TEVH2.js.map → chunk-YCVNE3CA.js.map} +0 -0
- /package/build/modern/{chunk-X7JS25IL.js.map → chunk-YI3P5QG4.js.map} +0 -0
- /package/build/modern/{chunk-KUTKPR3G.js.map → chunk-YQNOAJM7.js.map} +0 -0
- /package/build/modern/{chunk-T5TX5YHC.js.map → chunk-YTKY3AHF.js.map} +0 -0
- /package/build/modern/{chunk-4LBGIGNJ.js.map → chunk-YUEVV2DE.js.map} +0 -0
- /package/build/modern/{chunk-G4CDF7LY.js.map → chunk-YVYOOJ3X.js.map} +0 -0
- /package/build/modern/{chunk-Q2MJ7JRM.js.map → chunk-YZFXHGMG.js.map} +0 -0
- /package/build/modern/{chunk-XNER5INS.js.map → chunk-ZO3GSLWZ.js.map} +0 -0
- /package/build/modern/{chunk-DJCPF4JA.js.map → chunk-ZPMGW4U7.js.map} +0 -0
- /package/build/modern/{chunk-KOVD3FG7.js.map → chunk-ZZSHEW4N.js.map} +0 -0
|
@@ -134,7 +134,7 @@ var CerberusPrimitive = class {
|
|
|
134
134
|
// src/system/factory.ts
|
|
135
135
|
var import_factory = require("@ark-ui/react/factory");
|
|
136
136
|
function cerberusFactory(component, defaultProps) {
|
|
137
|
-
const { withNoRecipe } =
|
|
137
|
+
const { withNoRecipe } = new CerberusPrimitive();
|
|
138
138
|
const arkComponent = import_factory.ark[component];
|
|
139
139
|
if (arkComponent) {
|
|
140
140
|
return withNoRecipe(arkComponent, { defaultProps: defaultProps ?? {} });
|
|
@@ -157,9 +157,6 @@ var cerberusFactoryProxy = new Proxy(cerberusFactory, {
|
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
// src/system/index.ts
|
|
160
|
-
function createCerberusPrimitive(recipe) {
|
|
161
|
-
return new CerberusPrimitive(recipe);
|
|
162
|
-
}
|
|
163
160
|
var cerberus = cerberusFactoryProxy;
|
|
164
161
|
|
|
165
162
|
// src/components/theme/theme.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/theme/index.ts","../../../../src/system/primitive-factory.tsx","../../../../src/system/factory.ts","../../../../src/system/index.ts","../../../../src/components/theme/theme.tsx"],"sourcesContent":["export * from './theme'\n","import { css, cx } from 'styled-system/css'\nimport type { RecipeVariantRecord } from 'styled-system/types'\nimport {\n type ComponentType,\n type HTMLAttributes,\n type PropsWithChildren,\n} from 'react'\nimport type { WithCss } from '../types'\nimport type {\n CerberusPrimitiveEl,\n CerberusPrimitiveRecipe,\n CerberusRecipe,\n CerberusSlotRecipe,\n WithRecipeOptions,\n} from './types'\n\n/**\n * This module contains a factory for creating Cerberus primitives.\n * @module @cerberus/core/system/factory\n */\n\nexport class CerberusPrimitive {\n recipe: CerberusPrimitiveRecipe | null\n\n constructor(recipe?: CerberusPrimitiveRecipe) {\n this.recipe = recipe ?? null\n }\n\n private hasStyles(styles: string | undefined): Record<string, unknown> {\n if (styles) {\n return {\n className: styles,\n }\n }\n return {}\n }\n\n private validateComponent<P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n ) {\n if (typeof Component !== 'function' && typeof Component !== 'object') {\n throw new Error('Expected a React component as the first argument.')\n }\n }\n\n /**\n * Creates a Cerberus component with bare features and no recipe.\n * @param Component - The React component to enhance with Cerberus features.\n * @returns A new React component that applies Cerberus features to the\n * original component.\n * @example\n * ```typescript\n * const { withNoRecipe } = createCerberusPrimitive(button)\n * const Button = withNoRecipe(RawButton)\n * ```\n */\n withNoRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n options?: WithRecipeOptions,\n ): CerberusPrimitiveEl<P> => {\n const { defaultProps } = options || {}\n\n this.validateComponent(Component)\n\n const CerbComponent = (props: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = props\n const styles = this.hasStyles(cx(className, css(customCss)))\n return <Component {...defaultProps} {...styles} {...(nativeProps as P)} />\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n\n /**\n * Creates a Cerberus component with the given recipe.\n * @param Component - The React component to enhance with the recipe.\n * @param options - Options for the recipe.\n * @returns A new React component that applies the recipe to the original\n * component.\n */\n withRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n options?: WithRecipeOptions,\n ): CerberusPrimitiveEl<P & WithRecipeOptions['defaultProps']> => {\n const { defaultProps } = options || {}\n const recipe = this.recipe as CerberusRecipe\n\n this.validateComponent(Component)\n\n const CerbComponent = (internalProps: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = internalProps\n\n const [variantOptions] = recipe.splitVariantProps(nativeProps)\n const recipeStyles = recipe(variantOptions)\n\n return (\n <Component\n {...defaultProps}\n {...(nativeProps as P)}\n className={cx(className, recipeStyles, css(customCss))}\n />\n )\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n\n /**\n * Creates a Cerberus component with a slot recipe applied.\n * @param Component - The React component to enhance with Cerberus features.\n * @param recipe - The slot recipe to apply to the component.\n * @returns A new React component that applies Cerberus features and the\n * specified slot recipe to the original component.\n * @example\n * ```typescript\n * const { withSlotRecipe } = createCerberusPrimitive(field)\n * const Field = withSlotRecipe(RawField, field)\n * ```\n */\n withSlotRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n slot: keyof RecipeVariantRecord,\n options?: WithRecipeOptions,\n ) => {\n const { defaultProps } = options || {}\n const recipe = this.recipe as CerberusSlotRecipe<typeof slot>\n\n this.validateComponent(Component)\n\n const CerbComponent = (internalProps: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = internalProps\n\n const [variantOptions] = recipe.splitVariantProps(nativeProps)\n const styles = recipe(variantOptions)\n const slotStyles = styles[slot as keyof typeof styles]\n\n return (\n <Component\n {...defaultProps}\n {...(nativeProps as P)}\n className={cx(className, slotStyles, css(customCss))}\n />\n )\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n}\n","import { ark } from '@ark-ui/react/factory'\nimport { createCerberusPrimitive } from './index'\nimport type { ComponentType } from 'react'\n\nfunction cerberusFactory<T extends Record<string, unknown>>(\n component: keyof typeof ark,\n defaultProps?: T,\n) {\n const { withNoRecipe } = createCerberusPrimitive()\n const arkComponent = ark[component] as ComponentType\n\n if (arkComponent) {\n return withNoRecipe(arkComponent, { defaultProps: defaultProps ?? {} })\n }\n\n throw new Error(\n `Component \"${String(component)}\" is not a valid Cerberus component. Please check the component name.`,\n )\n}\n\nconst cache = new Map()\n\n// Create a proxy that handles both function calls and property access\nexport const cerberusFactoryProxy = new Proxy(cerberusFactory, {\n apply(target, thisArg, argArray) {\n // Handle function calls like cerberus('button')\n // @ts-expect-error: Ignore type error for dynamic property access\n return target.apply(thisArg, argArray)\n },\n get(_target, el: keyof typeof ark) {\n // Handle property access like cerberus.button\n if (!cache.has(el)) {\n cache.set(el, cerberusFactory(el))\n }\n return cache.get(el) as ReturnType<typeof cerberusFactory>\n },\n})\n","import { CerberusPrimitive } from './primitive-factory'\nimport type { CerberusFactory, CerberusPrimitiveRecipe } from './types'\nimport { cerberusFactoryProxy } from './factory'\n\n/**\n * This module contains the user interface for creating Cerberus primitives.\n * @module @cerberus/core/system/create-cerb-primitive\n */\n\n/**\n * A factory function that creates a Cerberus primitive instance with the given\n * recipe.\n * @param recipe\n * @returns An object with three methods: `withNoRecipe`, `withRecipe`, and `withSlotRecipe` that\n * apply the recipes and special Cerberus helpers like `css`.\n *\n * @example\n * ```tsx\n * const { withRecipe } = createCerberusPrimitive(myCustomRecipe);\n * export const Button = withRecipe(MyCustomButton)\n * ```\n */\nexport function createCerberusPrimitive<T extends CerberusPrimitiveRecipe>(\n recipe?: T,\n) {\n return new CerberusPrimitive(recipe)\n}\n\n/**\n * A utility function to access Cerberus components by their name.\n * @param component - The name of the Cerberus component to access.\n * @returns The Cerberus component corresponding to the provided name.\n * @throws An error if the component name is not valid.\n *\n * @example\n * ```tsx\n * import { cerberus } from '@cerberus/react'\n * const Button = cerberus('button')\n *\n * <Button css={{ color: 'blue' }} asChild>\n * <Link href=\"/some-page\">Click me</Link>\n * </Button>\n * ```\n */\nexport const cerberus = cerberusFactoryProxy as CerberusFactory\n\nexport * from './types'\n","import type { PropsWithChildren } from 'react'\nimport type { ColorModes, CustomThemes } from '../../context/theme'\nimport { cerberus, type CerberusPrimitiveProps } from '../../system'\n\nexport interface ThemeProps<T extends string> {\n /**\n * The color mode to apply to the theme.\n * @default 'light'\n */\n mode?: ColorModes\n /**\n * The theme to apply to the component.\n * @default 'cerberus'\n */\n theme?: CustomThemes<T>\n}\n\nexport function Theme<T extends string>(\n props: PropsWithChildren<CerberusPrimitiveProps<ThemeProps<T>>>,\n) {\n const { mode, theme, ...nativeProps } = props\n const colorMode = mode || 'light'\n const themeName = theme || 'cerberus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AQ,oBAAI,IAAI;AAGf,IAAM,uBAAuB,IAAI,MAAM,iBAAiB;AAAA,EAC7D,MAAM,QAAQ,SAAS,UAAU;AAG/B,WAAO,OAAO,MAAM,SAAS,QAAQ;AAAA,EACvC;AAAA,EACA,IAAI,SAAS,IAAsB;AAEjC,QAAI,CAAC,MAAM,IAAI,EAAE,GAAG;AAClB,YAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;AAAA,IACnC;AACA,WAAO,MAAM,IAAI,EAAE;AAAA,EACrB;AACF,CAAC;;;ACdM,SAAS,wBACd,QACA;AACA,SAAO,IAAI,kBAAkB,MAAM;AACrC;AAkBO,IAAM,WAAW;;;ACnBpB,IAAAA,sBAAA;AARG,SAAS,MACd,OACA;AACA,QAAM,EAAE,MAAM,OAAO,GAAG,YAAY,IAAI;AACxC,QAAM,YAAY,QAAQ;AAC1B,QAAM,YAAY,SAAS;AAE3B,SACE;AAAA,IAAC,SAAS;AAAA,IAAT;AAAA,MACE,GAAG;AAAA,MACJ,oBAAkB;AAAA,MAClB,mBAAiB;AAAA,MAEhB,gBAAM;AAAA;AAAA,EACT;AAEJ;","names":["import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/theme/index.ts","../../../../src/system/primitive-factory.tsx","../../../../src/system/factory.ts","../../../../src/system/index.ts","../../../../src/components/theme/theme.tsx"],"sourcesContent":["export * from './theme'\n","import { css, cx } from 'styled-system/css'\nimport type { RecipeVariantRecord } from 'styled-system/types'\nimport {\n type ComponentType,\n type HTMLAttributes,\n type PropsWithChildren,\n} from 'react'\nimport type { WithCss } from '../types'\nimport type {\n CerberusPrimitiveEl,\n CerberusPrimitiveRecipe,\n CerberusRecipe,\n CerberusSlotRecipe,\n WithRecipeOptions,\n} from './types'\n\n/**\n * This module contains a factory for creating Cerberus primitives.\n * @module @cerberus/core/system/factory\n */\n\nexport class CerberusPrimitive {\n recipe: CerberusPrimitiveRecipe | null\n\n constructor(recipe?: CerberusPrimitiveRecipe) {\n this.recipe = recipe ?? null\n }\n\n private hasStyles(styles: string | undefined): Record<string, unknown> {\n if (styles) {\n return {\n className: styles,\n }\n }\n return {}\n }\n\n private validateComponent<P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n ) {\n if (typeof Component !== 'function' && typeof Component !== 'object') {\n throw new Error('Expected a React component as the first argument.')\n }\n }\n\n /**\n * Creates a Cerberus component with bare features and no recipe.\n * @param Component - The React component to enhance with Cerberus features.\n * @returns A new React component that applies Cerberus features to the\n * original component.\n * @example\n * ```typescript\n * const { withNoRecipe } = createCerberusPrimitive(button)\n * const Button = withNoRecipe(RawButton)\n * ```\n */\n withNoRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n options?: WithRecipeOptions,\n ): CerberusPrimitiveEl<P> => {\n const { defaultProps } = options || {}\n\n this.validateComponent(Component)\n\n const CerbComponent = (props: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = props\n const styles = this.hasStyles(cx(className, css(customCss)))\n return <Component {...defaultProps} {...styles} {...(nativeProps as P)} />\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n\n /**\n * Creates a Cerberus component with the given recipe.\n * @param Component - The React component to enhance with the recipe.\n * @param options - Options for the recipe.\n * @returns A new React component that applies the recipe to the original\n * component.\n */\n withRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n options?: WithRecipeOptions,\n ): CerberusPrimitiveEl<P & WithRecipeOptions['defaultProps']> => {\n const { defaultProps } = options || {}\n const recipe = this.recipe as CerberusRecipe\n\n this.validateComponent(Component)\n\n const CerbComponent = (internalProps: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = internalProps\n\n const [variantOptions] = recipe.splitVariantProps(nativeProps)\n const recipeStyles = recipe(variantOptions)\n\n return (\n <Component\n {...defaultProps}\n {...(nativeProps as P)}\n className={cx(className, recipeStyles, css(customCss))}\n />\n )\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n\n /**\n * Creates a Cerberus component with a slot recipe applied.\n * @param Component - The React component to enhance with Cerberus features.\n * @param recipe - The slot recipe to apply to the component.\n * @returns A new React component that applies Cerberus features and the\n * specified slot recipe to the original component.\n * @example\n * ```typescript\n * const { withSlotRecipe } = createCerberusPrimitive(field)\n * const Field = withSlotRecipe(RawField, field)\n * ```\n */\n withSlotRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n slot: keyof RecipeVariantRecord,\n options?: WithRecipeOptions,\n ) => {\n const { defaultProps } = options || {}\n const recipe = this.recipe as CerberusSlotRecipe<typeof slot>\n\n this.validateComponent(Component)\n\n const CerbComponent = (internalProps: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = internalProps\n\n const [variantOptions] = recipe.splitVariantProps(nativeProps)\n const styles = recipe(variantOptions)\n const slotStyles = styles[slot as keyof typeof styles]\n\n return (\n <Component\n {...defaultProps}\n {...(nativeProps as P)}\n className={cx(className, slotStyles, css(customCss))}\n />\n )\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n}\n","import { ark } from '@ark-ui/react/factory'\nimport type { ComponentType } from 'react'\nimport { CerberusPrimitive } from './primitive-factory'\n\nfunction cerberusFactory<T extends Record<string, unknown>>(\n component: keyof typeof ark,\n defaultProps?: T,\n) {\n const { withNoRecipe } = new CerberusPrimitive()\n const arkComponent = ark[component] as ComponentType\n\n if (arkComponent) {\n return withNoRecipe(arkComponent, { defaultProps: defaultProps ?? {} })\n }\n\n throw new Error(\n `Component \"${String(component)}\" is not a valid Cerberus component. Please check the component name.`,\n )\n}\n\nconst cache = new Map()\n\n// Create a proxy that handles both function calls and property access\nexport const cerberusFactoryProxy = new Proxy(cerberusFactory, {\n apply(target, thisArg, argArray) {\n // Handle function calls like cerberus('button')\n // @ts-expect-error: Ignore type error for dynamic property access\n return target.apply(thisArg, argArray)\n },\n get(_target, el: keyof typeof ark) {\n // Handle property access like cerberus.button\n if (!cache.has(el)) {\n cache.set(el, cerberusFactory(el))\n }\n return cache.get(el) as ReturnType<typeof cerberusFactory>\n },\n})\n","import { CerberusPrimitive } from './primitive-factory'\nimport type { CerberusFactory, CerberusPrimitiveRecipe } from './types'\nimport { cerberusFactoryProxy } from './factory'\n\n/**\n * This module contains the user interface for creating Cerberus primitives.\n * @module @cerberus/core/system/create-cerb-primitive\n */\n\n/**\n * A factory function that creates a Cerberus primitive instance with the given\n * recipe.\n * @param recipe\n * @returns An object with three methods: `withNoRecipe`, `withRecipe`, and `withSlotRecipe` that\n * apply the recipes and special Cerberus helpers like `css`.\n *\n * @example\n * ```tsx\n * const { withRecipe } = createCerberusPrimitive(myCustomRecipe);\n * export const Button = withRecipe(MyCustomButton)\n * ```\n */\nexport function createCerberusPrimitive<T extends CerberusPrimitiveRecipe>(\n recipe?: T,\n) {\n return new CerberusPrimitive(recipe)\n}\n\n/**\n * A utility function to access Cerberus components by their name.\n * @param component - The name of the Cerberus component to access.\n * @returns The Cerberus component corresponding to the provided name.\n * @throws An error if the component name is not valid.\n *\n * @example\n * ```tsx\n * import { cerberus } from '@cerberus/react'\n * const Button = cerberus('button')\n *\n * <Button css={{ color: 'blue' }} asChild>\n * <Link href=\"/some-page\">Click me</Link>\n * </Button>\n * ```\n */\nexport const cerberus = cerberusFactoryProxy as CerberusFactory\n\nexport * from './types'\n","import type { PropsWithChildren } from 'react'\nimport type { ColorModes, CustomThemes } from '../../context/theme'\nimport { cerberus, type CerberusPrimitiveProps } from '../../system'\n\nexport interface ThemeProps<T extends string> {\n /**\n * The color mode to apply to the theme.\n * @default 'light'\n */\n mode?: ColorModes\n /**\n * The theme to apply to the component.\n * @default 'cerberus'\n */\n theme?: CustomThemes<T>\n}\n\nexport function Theme<T extends string>(\n props: PropsWithChildren<CerberusPrimitiveProps<ThemeProps<T>>>,\n) {\n const { mode, theme, ...nativeProps } = props\n const colorMode = mode || 'light'\n const themeName = theme || 'cerberus'\n\n return (\n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,oBAAI,IAAI;AAGf,IAAM,uBAAuB,IAAI,MAAM,iBAAiB;AAAA,EAC7D,MAAM,QAAQ,SAAS,UAAU;AAG/B,WAAO,OAAO,MAAM,SAAS,QAAQ;AAAA,EACvC;AAAA,EACA,IAAI,SAAS,IAAsB;AAEjC,QAAI,CAAC,MAAM,IAAI,EAAE,GAAG;AAClB,YAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;AAAA,IACnC;AACA,WAAO,MAAM,IAAI,EAAE;AAAA,EACrB;AACF,CAAC;;;ACQM,IAAM,WAAW;;;ACnBpB,IAAAA,sBAAA;AARG,SAAS,MACd,OACA;AACA,QAAM,EAAE,MAAM,OAAO,GAAG,YAAY,IAAI;AACxC,QAAM,YAAY,QAAQ;AAC1B,QAAM,YAAY,SAAS;AAE3B,SACE;AAAA,IAAC,SAAS;AAAA,IAAT;AAAA,MACE,GAAG;AAAA,MACJ,oBAAkB;AAAA,MAClB,mBAAiB;AAAA,MAEhB,gBAAM;AAAA;AAAA,EACT;AAEJ;","names":["import_jsx_runtime"]}
|
|
@@ -134,7 +134,7 @@ var CerberusPrimitive = class {
|
|
|
134
134
|
// src/system/factory.ts
|
|
135
135
|
var import_factory = require("@ark-ui/react/factory");
|
|
136
136
|
function cerberusFactory(component, defaultProps) {
|
|
137
|
-
const { withNoRecipe } =
|
|
137
|
+
const { withNoRecipe } = new CerberusPrimitive();
|
|
138
138
|
const arkComponent = import_factory.ark[component];
|
|
139
139
|
if (arkComponent) {
|
|
140
140
|
return withNoRecipe(arkComponent, { defaultProps: defaultProps ?? {} });
|
|
@@ -157,9 +157,6 @@ var cerberusFactoryProxy = new Proxy(cerberusFactory, {
|
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
// src/system/index.ts
|
|
160
|
-
function createCerberusPrimitive(recipe) {
|
|
161
|
-
return new CerberusPrimitive(recipe);
|
|
162
|
-
}
|
|
163
160
|
var cerberus = cerberusFactoryProxy;
|
|
164
161
|
|
|
165
162
|
// src/components/theme/theme.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/theme/theme.tsx","../../../../src/system/primitive-factory.tsx","../../../../src/system/factory.ts","../../../../src/system/index.ts"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport type { ColorModes, CustomThemes } from '../../context/theme'\nimport { cerberus, type CerberusPrimitiveProps } from '../../system'\n\nexport interface ThemeProps<T extends string> {\n /**\n * The color mode to apply to the theme.\n * @default 'light'\n */\n mode?: ColorModes\n /**\n * The theme to apply to the component.\n * @default 'cerberus'\n */\n theme?: CustomThemes<T>\n}\n\nexport function Theme<T extends string>(\n props: PropsWithChildren<CerberusPrimitiveProps<ThemeProps<T>>>,\n) {\n const { mode, theme, ...nativeProps } = props\n const colorMode = mode || 'light'\n const themeName = theme || 'cerberus'\n\n return (\n <cerberus.div\n {...nativeProps}\n data-panda-theme={themeName}\n data-color-mode={colorMode}\n >\n {props.children}\n </cerberus.div>\n )\n}\n","import { css, cx } from 'styled-system/css'\nimport type { RecipeVariantRecord } from 'styled-system/types'\nimport {\n type ComponentType,\n type HTMLAttributes,\n type PropsWithChildren,\n} from 'react'\nimport type { WithCss } from '../types'\nimport type {\n CerberusPrimitiveEl,\n CerberusPrimitiveRecipe,\n CerberusRecipe,\n CerberusSlotRecipe,\n WithRecipeOptions,\n} from './types'\n\n/**\n * This module contains a factory for creating Cerberus primitives.\n * @module @cerberus/core/system/factory\n */\n\nexport class CerberusPrimitive {\n recipe: CerberusPrimitiveRecipe | null\n\n constructor(recipe?: CerberusPrimitiveRecipe) {\n this.recipe = recipe ?? null\n }\n\n private hasStyles(styles: string | undefined): Record<string, unknown> {\n if (styles) {\n return {\n className: styles,\n }\n }\n return {}\n }\n\n private validateComponent<P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n ) {\n if (typeof Component !== 'function' && typeof Component !== 'object') {\n throw new Error('Expected a React component as the first argument.')\n }\n }\n\n /**\n * Creates a Cerberus component with bare features and no recipe.\n * @param Component - The React component to enhance with Cerberus features.\n * @returns A new React component that applies Cerberus features to the\n * original component.\n * @example\n * ```typescript\n * const { withNoRecipe } = createCerberusPrimitive(button)\n * const Button = withNoRecipe(RawButton)\n * ```\n */\n withNoRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n options?: WithRecipeOptions,\n ): CerberusPrimitiveEl<P> => {\n const { defaultProps } = options || {}\n\n this.validateComponent(Component)\n\n const CerbComponent = (props: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = props\n const styles = this.hasStyles(cx(className, css(customCss)))\n return <Component {...defaultProps} {...styles} {...(nativeProps as P)} />\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n\n /**\n * Creates a Cerberus component with the given recipe.\n * @param Component - The React component to enhance with the recipe.\n * @param options - Options for the recipe.\n * @returns A new React component that applies the recipe to the original\n * component.\n */\n withRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n options?: WithRecipeOptions,\n ): CerberusPrimitiveEl<P & WithRecipeOptions['defaultProps']> => {\n const { defaultProps } = options || {}\n const recipe = this.recipe as CerberusRecipe\n\n this.validateComponent(Component)\n\n const CerbComponent = (internalProps: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = internalProps\n\n const [variantOptions] = recipe.splitVariantProps(nativeProps)\n const recipeStyles = recipe(variantOptions)\n\n return (\n <Component\n {...defaultProps}\n {...(nativeProps as P)}\n className={cx(className, recipeStyles, css(customCss))}\n />\n )\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n\n /**\n * Creates a Cerberus component with a slot recipe applied.\n * @param Component - The React component to enhance with Cerberus features.\n * @param recipe - The slot recipe to apply to the component.\n * @returns A new React component that applies Cerberus features and the\n * specified slot recipe to the original component.\n * @example\n * ```typescript\n * const { withSlotRecipe } = createCerberusPrimitive(field)\n * const Field = withSlotRecipe(RawField, field)\n * ```\n */\n withSlotRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n slot: keyof RecipeVariantRecord,\n options?: WithRecipeOptions,\n ) => {\n const { defaultProps } = options || {}\n const recipe = this.recipe as CerberusSlotRecipe<typeof slot>\n\n this.validateComponent(Component)\n\n const CerbComponent = (internalProps: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = internalProps\n\n const [variantOptions] = recipe.splitVariantProps(nativeProps)\n const styles = recipe(variantOptions)\n const slotStyles = styles[slot as keyof typeof styles]\n\n return (\n <Component\n {...defaultProps}\n {...(nativeProps as P)}\n className={cx(className, slotStyles, css(customCss))}\n />\n )\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n}\n","import { ark } from '@ark-ui/react/factory'\nimport { createCerberusPrimitive } from './index'\nimport type { ComponentType } from 'react'\n\nfunction cerberusFactory<T extends Record<string, unknown>>(\n component: keyof typeof ark,\n defaultProps?: T,\n) {\n const { withNoRecipe } = createCerberusPrimitive()\n const arkComponent = ark[component] as ComponentType\n\n if (arkComponent) {\n return withNoRecipe(arkComponent, { defaultProps: defaultProps ?? {} })\n }\n\n throw new Error(\n `Component \"${String(component)}\" is not a valid Cerberus component. Please check the component name.`,\n )\n}\n\nconst cache = new Map()\n\n// Create a proxy that handles both function calls and property access\nexport const cerberusFactoryProxy = new Proxy(cerberusFactory, {\n apply(target, thisArg, argArray) {\n // Handle function calls like cerberus('button')\n // @ts-expect-error: Ignore type error for dynamic property access\n return target.apply(thisArg, argArray)\n },\n get(_target, el: keyof typeof ark) {\n // Handle property access like cerberus.button\n if (!cache.has(el)) {\n cache.set(el, cerberusFactory(el))\n }\n return cache.get(el) as ReturnType<typeof cerberusFactory>\n },\n})\n","import { CerberusPrimitive } from './primitive-factory'\nimport type { CerberusFactory, CerberusPrimitiveRecipe } from './types'\nimport { cerberusFactoryProxy } from './factory'\n\n/**\n * This module contains the user interface for creating Cerberus primitives.\n * @module @cerberus/core/system/create-cerb-primitive\n */\n\n/**\n * A factory function that creates a Cerberus primitive instance with the given\n * recipe.\n * @param recipe\n * @returns An object with three methods: `withNoRecipe`, `withRecipe`, and `withSlotRecipe` that\n * apply the recipes and special Cerberus helpers like `css`.\n *\n * @example\n * ```tsx\n * const { withRecipe } = createCerberusPrimitive(myCustomRecipe);\n * export const Button = withRecipe(MyCustomButton)\n * ```\n */\nexport function createCerberusPrimitive<T extends CerberusPrimitiveRecipe>(\n recipe?: T,\n) {\n return new CerberusPrimitive(recipe)\n}\n\n/**\n * A utility function to access Cerberus components by their name.\n * @param component - The name of the Cerberus component to access.\n * @returns The Cerberus component corresponding to the provided name.\n * @throws An error if the component name is not valid.\n *\n * @example\n * ```tsx\n * import { cerberus } from '@cerberus/react'\n * const Button = cerberus('button')\n *\n * <Button css={{ color: 'blue' }} asChild>\n * <Link href=\"/some-page\">Click me</Link>\n * </Button>\n * ```\n */\nexport const cerberus = cerberusFactoryProxy as CerberusFactory\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAwB;AAmEX;AA9CN,IAAM,oBAAN,MAAwB;AAAA,EAG7B,YAAY,QAAkC;AAF9C;AAkCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe,CACb,WACA,YAC2B;AAC3B,YAAM,EAAE,aAAa,IAAI,WAAW,CAAC;AAErC,WAAK,kBAAkB,SAAS;AAEhC,YAAM,gBAAgB,CAAC,UAA0C;AAC/D,cAAM,EAAE,KAAK,WAAW,WAAW,GAAG,YAAY,IAAI;AACtD,cAAM,SAAS,KAAK,cAAU,eAAG,eAAW,gBAAI,SAAS,CAAC,CAAC;AAC3D,eAAO,4CAAC,aAAW,GAAG,cAAe,GAAG,QAAS,GAAI,aAAmB;AAAA,MAC1E;AAEA,oBAAc,cAAc,UAAU,eAAe,UAAU;AAC/D,aAAO;AAAA,IACT;AASA;AAAA;AAAA;AAAA;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":3,"sources":["../../../../src/components/theme/theme.tsx","../../../../src/system/primitive-factory.tsx","../../../../src/system/factory.ts","../../../../src/system/index.ts"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport type { ColorModes, CustomThemes } from '../../context/theme'\nimport { cerberus, type CerberusPrimitiveProps } from '../../system'\n\nexport interface ThemeProps<T extends string> {\n /**\n * The color mode to apply to the theme.\n * @default 'light'\n */\n mode?: ColorModes\n /**\n * The theme to apply to the component.\n * @default 'cerberus'\n */\n theme?: CustomThemes<T>\n}\n\nexport function Theme<T extends string>(\n props: PropsWithChildren<CerberusPrimitiveProps<ThemeProps<T>>>,\n) {\n const { mode, theme, ...nativeProps } = props\n const colorMode = mode || 'light'\n const themeName = theme || 'cerberus'\n\n return (\n <cerberus.div\n {...nativeProps}\n data-panda-theme={themeName}\n data-color-mode={colorMode}\n >\n {props.children}\n </cerberus.div>\n )\n}\n","import { css, cx } from 'styled-system/css'\nimport type { RecipeVariantRecord } from 'styled-system/types'\nimport {\n type ComponentType,\n type HTMLAttributes,\n type PropsWithChildren,\n} from 'react'\nimport type { WithCss } from '../types'\nimport type {\n CerberusPrimitiveEl,\n CerberusPrimitiveRecipe,\n CerberusRecipe,\n CerberusSlotRecipe,\n WithRecipeOptions,\n} from './types'\n\n/**\n * This module contains a factory for creating Cerberus primitives.\n * @module @cerberus/core/system/factory\n */\n\nexport class CerberusPrimitive {\n recipe: CerberusPrimitiveRecipe | null\n\n constructor(recipe?: CerberusPrimitiveRecipe) {\n this.recipe = recipe ?? null\n }\n\n private hasStyles(styles: string | undefined): Record<string, unknown> {\n if (styles) {\n return {\n className: styles,\n }\n }\n return {}\n }\n\n private validateComponent<P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n ) {\n if (typeof Component !== 'function' && typeof Component !== 'object') {\n throw new Error('Expected a React component as the first argument.')\n }\n }\n\n /**\n * Creates a Cerberus component with bare features and no recipe.\n * @param Component - The React component to enhance with Cerberus features.\n * @returns A new React component that applies Cerberus features to the\n * original component.\n * @example\n * ```typescript\n * const { withNoRecipe } = createCerberusPrimitive(button)\n * const Button = withNoRecipe(RawButton)\n * ```\n */\n withNoRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n options?: WithRecipeOptions,\n ): CerberusPrimitiveEl<P> => {\n const { defaultProps } = options || {}\n\n this.validateComponent(Component)\n\n const CerbComponent = (props: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = props\n const styles = this.hasStyles(cx(className, css(customCss)))\n return <Component {...defaultProps} {...styles} {...(nativeProps as P)} />\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n\n /**\n * Creates a Cerberus component with the given recipe.\n * @param Component - The React component to enhance with the recipe.\n * @param options - Options for the recipe.\n * @returns A new React component that applies the recipe to the original\n * component.\n */\n withRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n options?: WithRecipeOptions,\n ): CerberusPrimitiveEl<P & WithRecipeOptions['defaultProps']> => {\n const { defaultProps } = options || {}\n const recipe = this.recipe as CerberusRecipe\n\n this.validateComponent(Component)\n\n const CerbComponent = (internalProps: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = internalProps\n\n const [variantOptions] = recipe.splitVariantProps(nativeProps)\n const recipeStyles = recipe(variantOptions)\n\n return (\n <Component\n {...defaultProps}\n {...(nativeProps as P)}\n className={cx(className, recipeStyles, css(customCss))}\n />\n )\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n\n /**\n * Creates a Cerberus component with a slot recipe applied.\n * @param Component - The React component to enhance with Cerberus features.\n * @param recipe - The slot recipe to apply to the component.\n * @returns A new React component that applies Cerberus features and the\n * specified slot recipe to the original component.\n * @example\n * ```typescript\n * const { withSlotRecipe } = createCerberusPrimitive(field)\n * const Field = withSlotRecipe(RawField, field)\n * ```\n */\n withSlotRecipe = <P extends HTMLAttributes<unknown>>(\n Component: ComponentType<P>,\n slot: keyof RecipeVariantRecord,\n options?: WithRecipeOptions,\n ) => {\n const { defaultProps } = options || {}\n const recipe = this.recipe as CerberusSlotRecipe<typeof slot>\n\n this.validateComponent(Component)\n\n const CerbComponent = (internalProps: PropsWithChildren<P> & WithCss) => {\n const { css: customCss, className, ...nativeProps } = internalProps\n\n const [variantOptions] = recipe.splitVariantProps(nativeProps)\n const styles = recipe(variantOptions)\n const slotStyles = styles[slot as keyof typeof styles]\n\n return (\n <Component\n {...defaultProps}\n {...(nativeProps as P)}\n className={cx(className, slotStyles, css(customCss))}\n />\n )\n }\n\n CerbComponent.displayName = Component.displayName || Component.name\n return CerbComponent\n }\n}\n","import { ark } from '@ark-ui/react/factory'\nimport type { ComponentType } from 'react'\nimport { CerberusPrimitive } from './primitive-factory'\n\nfunction cerberusFactory<T extends Record<string, unknown>>(\n component: keyof typeof ark,\n defaultProps?: T,\n) {\n const { withNoRecipe } = new CerberusPrimitive()\n const arkComponent = ark[component] as ComponentType\n\n if (arkComponent) {\n return withNoRecipe(arkComponent, { defaultProps: defaultProps ?? {} })\n }\n\n throw new Error(\n `Component \"${String(component)}\" is not a valid Cerberus component. Please check the component name.`,\n )\n}\n\nconst cache = new Map()\n\n// Create a proxy that handles both function calls and property access\nexport const cerberusFactoryProxy = new Proxy(cerberusFactory, {\n apply(target, thisArg, argArray) {\n // Handle function calls like cerberus('button')\n // @ts-expect-error: Ignore type error for dynamic property access\n return target.apply(thisArg, argArray)\n },\n get(_target, el: keyof typeof ark) {\n // Handle property access like cerberus.button\n if (!cache.has(el)) {\n cache.set(el, cerberusFactory(el))\n }\n return cache.get(el) as ReturnType<typeof cerberusFactory>\n },\n})\n","import { CerberusPrimitive } from './primitive-factory'\nimport type { CerberusFactory, CerberusPrimitiveRecipe } from './types'\nimport { cerberusFactoryProxy } from './factory'\n\n/**\n * This module contains the user interface for creating Cerberus primitives.\n * @module @cerberus/core/system/create-cerb-primitive\n */\n\n/**\n * A factory function that creates a Cerberus primitive instance with the given\n * recipe.\n * @param recipe\n * @returns An object with three methods: `withNoRecipe`, `withRecipe`, and `withSlotRecipe` that\n * apply the recipes and special Cerberus helpers like `css`.\n *\n * @example\n * ```tsx\n * const { withRecipe } = createCerberusPrimitive(myCustomRecipe);\n * export const Button = withRecipe(MyCustomButton)\n * ```\n */\nexport function createCerberusPrimitive<T extends CerberusPrimitiveRecipe>(\n recipe?: T,\n) {\n return new CerberusPrimitive(recipe)\n}\n\n/**\n * A utility function to access Cerberus components by their name.\n * @param component - The name of the Cerberus component to access.\n * @returns The Cerberus component corresponding to the provided name.\n * @throws An error if the component name is not valid.\n *\n * @example\n * ```tsx\n * import { cerberus } from '@cerberus/react'\n * const Button = cerberus('button')\n *\n * <Button css={{ color: 'blue' }} asChild>\n * <Link href=\"/some-page\">Click me</Link>\n * </Button>\n * ```\n */\nexport const cerberus = cerberusFactoryProxy as CerberusFactory\n\nexport * from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAwB;AAmEX;AA9CN,IAAM,oBAAN,MAAwB;AAAA,EAG7B,YAAY,QAAkC;AAF9C;AAkCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe,CACb,WACA,YAC2B;AAC3B,YAAM,EAAE,aAAa,IAAI,WAAW,CAAC;AAErC,WAAK,kBAAkB,SAAS;AAEhC,YAAM,gBAAgB,CAAC,UAA0C;AAC/D,cAAM,EAAE,KAAK,WAAW,WAAW,GAAG,YAAY,IAAI;AACtD,cAAM,SAAS,KAAK,cAAU,eAAG,eAAW,gBAAI,SAAS,CAAC,CAAC;AAC3D,eAAO,4CAAC,aAAW,GAAG,cAAe,GAAG,QAAS,GAAI,aAAmB;AAAA,MAC1E;AAEA,oBAAc,cAAc,UAAU,eAAe,UAAU;AAC/D,aAAO;AAAA,IACT;AASA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sCAAa,CACX,WACA,Y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;AACA,WAAO,CAAC;AAAA,EACV;AAAA,EAEQ,kBACN,WACA;AACA,QAAI,OAAO,cAAc,cAAc,OAAO,cAAc,UAAU;AACpE,YAAM,IAAI,MAAM,mDAAmD;AAAA,IACrE;AAAA,EACF;AA2GF;;;ACtJA,qBAAoB;AAIpB,SAAS,gBACP,WACA,cACA;AACA,QAAM,EAAE,aAAa,IAAI,IAAI,kBAAkB;AAC/C,QAAM,eAAe,mBAAI,SAAS;AAElC,MAAI,cAAc;AAChB,WAAO,aAAa,cAAc,EAAE,cAAc,gBAAgB,CAAC,EAAE,CAAC;AAAA,EACxE;AAEA,QAAM,IAAI;AAAA,IACR,cAAc,OAAO,SAAS,CAAC;AAAA,EACjC;AACF;AAEA,IAAM,QAAQ,oBAAI,IAAI;AAGf,IAAM,uBAAuB,IAAI,MAAM,iBAAiB;AAAA,EAC7D,MAAM,QAAQ,SAAS,UAAU;AAG/B,WAAO,OAAO,MAAM,SAAS,QAAQ;AAAA,EACvC;AAAA,EACA,IAAI,SAAS,IAAsB;AAEjC,QAAI,CAAC,MAAM,IAAI,EAAE,GAAG;AAClB,YAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;AAAA,IACnC;AACA,WAAO,MAAM,IAAI,EAAE;AAAA,EACrB;AACF,CAAC;;;ACQM,IAAM,WAAW;;;AHnBpB,IAAAA,sBAAA;AARG,SAAS,MACd,OACA;AACA,QAAM,EAAE,MAAM,OAAO,GAAG,YAAY,IAAI;AACxC,QAAM,YAAY,QAAQ;AAC1B,QAAM,YAAY,SAAS;AAE3B,SACE;AAAA,IAAC,SAAS;AAAA,IAAT;AAAA,MACE,GAAG;AAAA,MACJ,oBAAkB;AAAA,MAClB,mBAAiB;AAAA,MAEhB,gBAAM;AAAA;AAAA,EACT;AAEJ;","names":["import_jsx_runtime"]}
|
package/build/legacy/index.cjs
CHANGED
|
@@ -522,7 +522,7 @@ var CerberusPrimitive = class {
|
|
|
522
522
|
// src/system/factory.ts
|
|
523
523
|
var import_factory = require("@ark-ui/react/factory");
|
|
524
524
|
function cerberusFactory(component, defaultProps) {
|
|
525
|
-
const { withNoRecipe: withNoRecipe10 } =
|
|
525
|
+
const { withNoRecipe: withNoRecipe10 } = new CerberusPrimitive();
|
|
526
526
|
const arkComponent = import_factory.ark[component];
|
|
527
527
|
if (arkComponent) {
|
|
528
528
|
return withNoRecipe10(arkComponent, { defaultProps: defaultProps ?? {} });
|