@televet/kibble-ui 5.0.2 → 5.0.4-beta.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/dist/chunks/{alert.types-C_ygg7fh.js → alert.types-BsTOOEB7.js} +3 -3
- package/dist/chunks/{alert.types-C_ygg7fh.js.map → alert.types-BsTOOEB7.js.map} +1 -1
- package/dist/chunks/{alert.types-BKSqs9qY.js → alert.types-Ch8hn5HY.js} +2 -2
- package/dist/chunks/{alert.types-BKSqs9qY.js.map → alert.types-Ch8hn5HY.js.map} +1 -1
- package/dist/chunks/{avatar.component-B1HGlwVW.js → avatar.component-Bi0lMCsC.js} +2 -2
- package/dist/chunks/{avatar.component-B1HGlwVW.js.map → avatar.component-Bi0lMCsC.js.map} +1 -1
- package/dist/chunks/{avatar.component-C-365mx3.js → avatar.component-DUZc5iXT.js} +2 -2
- package/dist/chunks/{avatar.component-C-365mx3.js.map → avatar.component-DUZc5iXT.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-CTBfGiSm.js → avatarGroup.component-BdhUT7n5.js} +2 -2
- package/dist/chunks/{avatarGroup.component-CTBfGiSm.js.map → avatarGroup.component-BdhUT7n5.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-B-ZOhj7i.js → avatarGroup.component-BwrjkSJn.js} +5 -5
- package/dist/chunks/{avatarGroup.component-B-ZOhj7i.js.map → avatarGroup.component-BwrjkSJn.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-DUK2FgFn.js → buttonGroup.component--dqWO06l.js} +2 -2
- package/dist/chunks/{buttonGroup.component-DUK2FgFn.js.map → buttonGroup.component--dqWO06l.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-CowJsbr7.js → buttonGroup.component-D1h4aH2G.js} +2 -2
- package/dist/chunks/{buttonGroup.component-CowJsbr7.js.map → buttonGroup.component-D1h4aH2G.js.map} +1 -1
- package/dist/chunks/{calendar.component-CHIhplfO.js → calendar.component-DxMzZla-.js} +2 -2
- package/dist/chunks/{calendar.component-CHIhplfO.js.map → calendar.component-DxMzZla-.js.map} +1 -1
- package/dist/chunks/{calendar.component-tOoK1NrU.js → calendar.component-w4rJ7mNI.js} +2 -2
- package/dist/chunks/{calendar.component-tOoK1NrU.js.map → calendar.component-w4rJ7mNI.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-CKDigkoD.js → characterCounter.component-BRHLt929.js} +2 -2
- package/dist/chunks/{characterCounter.component-CKDigkoD.js.map → characterCounter.component-BRHLt929.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-Ch3P3GqC.js → characterCounter.component-CoMqt04J.js} +2 -2
- package/dist/chunks/{characterCounter.component-Ch3P3GqC.js.map → characterCounter.component-CoMqt04J.js.map} +1 -1
- package/dist/chunks/{checkbox.component-DE35wBj-.js → checkbox.component-Be_DWrS9.js} +3 -3
- package/dist/chunks/{checkbox.component-DE35wBj-.js.map → checkbox.component-Be_DWrS9.js.map} +1 -1
- package/dist/chunks/{checkbox.component-CiA3Z1zR.js → checkbox.component-DkpiUlzn.js} +2 -2
- package/dist/chunks/{checkbox.component-CiA3Z1zR.js.map → checkbox.component-DkpiUlzn.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-CYwGlktu.js → checkboxGroup.component-BtzzLHHB.js} +3 -3
- package/dist/chunks/{checkboxGroup.component-CYwGlktu.js.map → checkboxGroup.component-BtzzLHHB.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-BGBd-roJ.js → checkboxGroup.component-CtCezYeT.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-BGBd-roJ.js.map → checkboxGroup.component-CtCezYeT.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-BrDGshOG.js → conversationCard.component-8-HSmE3v.js} +2 -2
- package/dist/chunks/{conversationCard.component-BrDGshOG.js.map → conversationCard.component-8-HSmE3v.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-CMdqD3yN.js → conversationCard.component-FMq9PY8T.js} +8 -8
- package/dist/chunks/{conversationCard.component-CMdqD3yN.js.map → conversationCard.component-FMq9PY8T.js.map} +1 -1
- package/dist/chunks/{datePicker.component-eHU7IZgC.js → datePicker.component-C7QZhsm6.js} +5 -5
- package/dist/chunks/{datePicker.component-eHU7IZgC.js.map → datePicker.component-C7QZhsm6.js.map} +1 -1
- package/dist/chunks/{datePicker.component-C6cD1_HR.js → datePicker.component-DVOU1Sss.js} +2 -2
- package/dist/chunks/{datePicker.component-C6cD1_HR.js.map → datePicker.component-DVOU1Sss.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-BWHE-9FA.js → datePicker.provider-CS1aBg9h.js} +270 -270
- package/dist/chunks/{datePicker.provider-BWHE-9FA.js.map → datePicker.provider-CS1aBg9h.js.map} +1 -1
- package/dist/chunks/datePicker.provider-D9GNAT1f.js +15 -0
- package/dist/chunks/{datePicker.provider-DgarjPPd.js.map → datePicker.provider-D9GNAT1f.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-Byjxg2lJ.js → dateTimePicker.component-DJcUN8oo.js} +6 -6
- package/dist/chunks/{dateTimePicker.component-Byjxg2lJ.js.map → dateTimePicker.component-DJcUN8oo.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-REz9iX4S.js → dateTimePicker.component-EkAaKua6.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-REz9iX4S.js.map → dateTimePicker.component-EkAaKua6.js.map} +1 -1
- package/dist/chunks/{heading.component-DMAQO_-m.js → heading.component-DnoZOXdz.js} +2 -2
- package/dist/chunks/{heading.component-DMAQO_-m.js.map → heading.component-DnoZOXdz.js.map} +1 -1
- package/dist/chunks/{heading.component-7ikcgDco.js → heading.component-PFNpLFT7.js} +2 -2
- package/dist/chunks/{heading.component-7ikcgDco.js.map → heading.component-PFNpLFT7.js.map} +1 -1
- package/dist/chunks/{menu.component-DwTen8Uv.js → menu.component-BuTY_3mt.js} +201 -197
- package/dist/chunks/menu.component-BuTY_3mt.js.map +1 -0
- package/dist/chunks/menu.component-D79Ce44I.js +2 -0
- package/dist/chunks/menu.component-D79Ce44I.js.map +1 -0
- package/dist/chunks/{modal.types-B0rK6xJy.js → modal.types-jE-vPShC.js} +2 -2
- package/dist/chunks/{modal.types-B0rK6xJy.js.map → modal.types-jE-vPShC.js.map} +1 -1
- package/dist/chunks/{modal.types-74os4Bqi.js → modal.types-y3cRa0HL.js} +2 -2
- package/dist/chunks/{modal.types-74os4Bqi.js.map → modal.types-y3cRa0HL.js.map} +1 -1
- package/dist/chunks/{notificationCounter.component-BexkISUl.js → notificationCounter.component-BlGSd37B.js} +2 -2
- package/dist/chunks/{notificationCounter.component-BexkISUl.js.map → notificationCounter.component-BlGSd37B.js.map} +1 -1
- package/dist/chunks/{notificationCounter.component-DJpUXeXm.js → notificationCounter.component-CBwi5vXa.js} +2 -2
- package/dist/chunks/{notificationCounter.component-DJpUXeXm.js.map → notificationCounter.component-CBwi5vXa.js.map} +1 -1
- package/dist/chunks/{numberInput.component-RCwUUzmH.js → numberInput.component-DIEvX3XV.js} +2 -2
- package/dist/chunks/{numberInput.component-RCwUUzmH.js.map → numberInput.component-DIEvX3XV.js.map} +1 -1
- package/dist/chunks/{numberInput.component-DIABzNV6.js → numberInput.component-DTvSbkyF.js} +2 -2
- package/dist/chunks/{numberInput.component-DIABzNV6.js.map → numberInput.component-DTvSbkyF.js.map} +1 -1
- package/dist/chunks/{pinInput.types-CcaAN6P2.js → pinInput.types-B6LSv8Kj.js} +2 -2
- package/dist/chunks/{pinInput.types-CcaAN6P2.js.map → pinInput.types-B6LSv8Kj.js.map} +1 -1
- package/dist/chunks/{pinInput.types-BCzsoF9r.js → pinInput.types-CM5wUaXi.js} +2 -2
- package/dist/chunks/{pinInput.types-BCzsoF9r.js.map → pinInput.types-CM5wUaXi.js.map} +1 -1
- package/dist/chunks/{popover.component-DEOUdSu3.js → popover.component-BsiKfJR7.js} +5 -5
- package/dist/chunks/{popover.component-DEOUdSu3.js.map → popover.component-BsiKfJR7.js.map} +1 -1
- package/dist/chunks/{popover.component-BBp_5m8e.js → popover.component-C0nG3J1J.js} +2 -2
- package/dist/chunks/{popover.component-BBp_5m8e.js.map → popover.component-C0nG3J1J.js.map} +1 -1
- package/dist/chunks/{popover.recipe-B9bkpDfc.js → popover.recipe-BAl0q_IZ.js} +8 -8
- package/dist/chunks/popover.recipe-BAl0q_IZ.js.map +1 -0
- package/dist/chunks/popover.recipe-NDvOfG9X.js +2 -0
- package/dist/chunks/popover.recipe-NDvOfG9X.js.map +1 -0
- package/dist/chunks/{radioGroup.types-DJ68ERdO.js → radioGroup.types-C-JQsOXh.js} +4 -4
- package/dist/chunks/{radioGroup.types-DJ68ERdO.js.map → radioGroup.types-C-JQsOXh.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-C7A8mLMz.js → radioGroup.types-sigpU7JZ.js} +2 -2
- package/dist/chunks/{radioGroup.types-C7A8mLMz.js.map → radioGroup.types-sigpU7JZ.js.map} +1 -1
- package/dist/chunks/{rating.component-BsuGbcxP.js → rating.component-23y0uvWf.js} +2 -2
- package/dist/chunks/{rating.component-BsuGbcxP.js.map → rating.component-23y0uvWf.js.map} +1 -1
- package/dist/chunks/{rating.component-ChzcvUl6.js → rating.component-Btdd7tMX.js} +2 -2
- package/dist/chunks/{rating.component-ChzcvUl6.js.map → rating.component-Btdd7tMX.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-D9WQGVcj.js → ratingDots.component-CEribcPM.js} +3 -3
- package/dist/chunks/{ratingDots.component-D9WQGVcj.js.map → ratingDots.component-CEribcPM.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-CVjSZ9JJ.js → ratingDots.component-dfb3E9CK.js} +2 -2
- package/dist/chunks/{ratingDots.component-CVjSZ9JJ.js.map → ratingDots.component-dfb3E9CK.js.map} +1 -1
- package/dist/chunks/{select.component-B4mAPqzN.js → select.component-BwgvV_Lm.js} +5 -5
- package/dist/chunks/{select.component-B4mAPqzN.js.map → select.component-BwgvV_Lm.js.map} +1 -1
- package/dist/chunks/{select.component-CCNxMGvb.js → select.component-D4XUEDi4.js} +2 -2
- package/dist/chunks/{select.component-CCNxMGvb.js.map → select.component-D4XUEDi4.js.map} +1 -1
- package/dist/chunks/{sortableList.component-BlwtnxVj.js → sortableList.component-2yX2pXs7.js} +2 -2
- package/dist/chunks/{sortableList.component-BlwtnxVj.js.map → sortableList.component-2yX2pXs7.js.map} +1 -1
- package/dist/chunks/{sortableList.component-XfURY7C2.js → sortableList.component-B2XQoMq7.js} +2 -2
- package/dist/chunks/{sortableList.component-XfURY7C2.js.map → sortableList.component-B2XQoMq7.js.map} +1 -1
- package/dist/chunks/{spinner.component-B3dkvoO9.js → spinner.component-D3s81AJH.js} +2 -2
- package/dist/chunks/{spinner.component-B3dkvoO9.js.map → spinner.component-D3s81AJH.js.map} +1 -1
- package/dist/chunks/{spinner.component-DuW1_IWM.js → spinner.component-Dq6u4vVL.js} +2 -2
- package/dist/chunks/{spinner.component-DuW1_IWM.js.map → spinner.component-Dq6u4vVL.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-cR6PNPxA.js → styledAvatar.types-C9Oi9C2U.js} +2 -2
- package/dist/chunks/{styledAvatar.types-cR6PNPxA.js.map → styledAvatar.types-C9Oi9C2U.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-CcP-Vl9c.js → styledAvatar.types-CUweBJqA.js} +2 -2
- package/dist/chunks/{styledAvatar.types-CcP-Vl9c.js.map → styledAvatar.types-CUweBJqA.js.map} +1 -1
- package/dist/chunks/{switch.component-CgzCLoTB.js → switch.component-gcLbjvkh.js} +2 -2
- package/dist/chunks/{switch.component-CgzCLoTB.js.map → switch.component-gcLbjvkh.js.map} +1 -1
- package/dist/chunks/{switch.component-CpV7mnhR.js → switch.component-y47DAbCX.js} +2 -2
- package/dist/chunks/{switch.component-CpV7mnhR.js.map → switch.component-y47DAbCX.js.map} +1 -1
- package/dist/chunks/{tab.types-DwPEP_5N.js → tab.types-BWtosyjE.js} +2 -2
- package/dist/chunks/{tab.types-DwPEP_5N.js.map → tab.types-BWtosyjE.js.map} +1 -1
- package/dist/chunks/{tab.types-DaJfFBvr.js → tab.types-CO64KNxl.js} +3 -3
- package/dist/chunks/{tab.types-DaJfFBvr.js.map → tab.types-CO64KNxl.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-Cor6eakc.js → tagBlock.component-CUti4nJM.js} +5 -5
- package/dist/chunks/{tagBlock.component-Cor6eakc.js.map → tagBlock.component-CUti4nJM.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-BGEvRu81.js → tagBlock.component-DExd13J1.js} +2 -2
- package/dist/chunks/{tagBlock.component-BGEvRu81.js.map → tagBlock.component-DExd13J1.js.map} +1 -1
- package/dist/chunks/{text.component-CeioUl0G.js → text.component-BDDz5KQP.js} +2 -2
- package/dist/chunks/{text.component-CeioUl0G.js.map → text.component-BDDz5KQP.js.map} +1 -1
- package/dist/chunks/{text.component-CdTyTFds.js → text.component-IjomJyJY.js} +2 -2
- package/dist/chunks/{text.component-CdTyTFds.js.map → text.component-IjomJyJY.js.map} +1 -1
- package/dist/chunks/{textInput.component-C1vwy6pL.js → textInput.component-CWbv8giH.js} +2 -2
- package/dist/chunks/{textInput.component-C1vwy6pL.js.map → textInput.component-CWbv8giH.js.map} +1 -1
- package/dist/chunks/{textInput.component-BC0Hi8R_.js → textInput.component-DAOVnBI-.js} +3 -3
- package/dist/chunks/{textInput.component-BC0Hi8R_.js.map → textInput.component-DAOVnBI-.js.map} +1 -1
- package/dist/chunks/{textarea.component-D15hA9Jb.js → textarea.component-CMszSf5r.js} +2 -2
- package/dist/chunks/{textarea.component-D15hA9Jb.js.map → textarea.component-CMszSf5r.js.map} +1 -1
- package/dist/chunks/{textarea.component-axjxiv82.js → textarea.component-DVk49EJX.js} +3 -3
- package/dist/chunks/{textarea.component-axjxiv82.js.map → textarea.component-DVk49EJX.js.map} +1 -1
- package/dist/chunks/{theme.provider-DFwAy7tr.js → theme.provider-BbKLlnGi.js} +2 -2
- package/dist/chunks/{theme.provider-DFwAy7tr.js.map → theme.provider-BbKLlnGi.js.map} +1 -1
- package/dist/chunks/{theme.provider-BD7qyu-B.js → theme.provider-Biof0UdB.js} +3 -3
- package/dist/chunks/{theme.provider-BD7qyu-B.js.map → theme.provider-Biof0UdB.js.map} +1 -1
- package/dist/chunks/{timePicker.component-Cz2XxVL6.js → timePicker.component-B750WQHA.js} +2 -2
- package/dist/chunks/{timePicker.component-Cz2XxVL6.js.map → timePicker.component-B750WQHA.js.map} +1 -1
- package/dist/chunks/{timePicker.component-u34pHrzr.js → timePicker.component-BOvQHyHv.js} +3 -3
- package/dist/chunks/{timePicker.component-u34pHrzr.js.map → timePicker.component-BOvQHyHv.js.map} +1 -1
- package/dist/chunks/{timeRange.component-tU_nCTmS.js → timeRange.component-C0f7pM9p.js} +2 -2
- package/dist/chunks/{timeRange.component-tU_nCTmS.js.map → timeRange.component-C0f7pM9p.js.map} +1 -1
- package/dist/chunks/{timeRange.component-BiA1VWQ8.js → timeRange.component-CdHkxVXb.js} +2 -2
- package/dist/chunks/{timeRange.component-BiA1VWQ8.js.map → timeRange.component-CdHkxVXb.js.map} +1 -1
- package/dist/chunks/{timestamp.component-DYZHgaas.js → timestamp.component-BfmZPfy5.js} +2 -2
- package/dist/chunks/{timestamp.component-DYZHgaas.js.map → timestamp.component-BfmZPfy5.js.map} +1 -1
- package/dist/chunks/{timestamp.component-DBmc7D23.js → timestamp.component-IfjfMFXl.js} +3 -3
- package/dist/chunks/{timestamp.component-DBmc7D23.js.map → timestamp.component-IfjfMFXl.js.map} +1 -1
- package/dist/chunks/tooltip.component-DBw-hAPU.js +2 -0
- package/dist/chunks/{tooltip.component-BkFDi5yK.js.map → tooltip.component-DBw-hAPU.js.map} +1 -1
- package/dist/chunks/{tooltip.component-C_NS-AoH.js → tooltip.component-DFsQNG1q.js} +62 -58
- package/dist/chunks/{tooltip.component-C_NS-AoH.js.map → tooltip.component-DFsQNG1q.js.map} +1 -1
- package/dist/chunks/{withFormControl-DePFf9SY.js → withFormControl-B4TNaDf4.js} +2 -2
- package/dist/chunks/{withFormControl-DePFf9SY.js.map → withFormControl-B4TNaDf4.js.map} +1 -1
- package/dist/chunks/{withFormControl-wZA87Sd4.js → withFormControl-CIZOpk9n.js} +2 -2
- package/dist/chunks/{withFormControl-wZA87Sd4.js.map → withFormControl-CIZOpk9n.js.map} +1 -1
- package/dist/chunks/{withTruncation-DTCfQ2yk.js → withTruncation-CqDQUSVU.js} +2 -2
- package/dist/chunks/{withTruncation-DTCfQ2yk.js.map → withTruncation-CqDQUSVU.js.map} +1 -1
- package/dist/chunks/{withTruncation-DE3FFPE7.js → withTruncation-pzYbtqYw.js} +2 -2
- package/dist/chunks/{withTruncation-DE3FFPE7.js.map → withTruncation-pzYbtqYw.js.map} +1 -1
- package/dist/cjs/components/Alert/index.cjs +1 -1
- package/dist/cjs/components/Avatar/index.cjs +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/Calendar/index.cjs +1 -1
- package/dist/cjs/components/CharacterCounter/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/index.cjs +1 -1
- package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/DateTimePicker/index.cjs +1 -1
- package/dist/cjs/components/Heading/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/Modal/index.cjs +1 -1
- package/dist/cjs/components/NotificationCounter/index.cjs +1 -1
- package/dist/cjs/components/NumberInput/index.cjs +1 -1
- package/dist/cjs/components/PinInput/index.cjs +1 -1
- package/dist/cjs/components/Popover/index.cjs +1 -1
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/Rating/index.cjs +1 -1
- package/dist/cjs/components/RatingDots/index.cjs +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/SortableList/index.cjs +1 -1
- package/dist/cjs/components/Spinner/index.cjs +1 -1
- package/dist/cjs/components/StyledAvatar/index.cjs +1 -1
- package/dist/cjs/components/Switch/index.cjs +1 -1
- package/dist/cjs/components/Tabs/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/Text/index.cjs +1 -1
- package/dist/cjs/components/TextInput/index.cjs +1 -1
- package/dist/cjs/components/Textarea/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/Timestamp/index.cjs +1 -1
- package/dist/cjs/components/Tooltip/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/theme/index.cjs +1 -1
- package/dist/esm/components/Alert/index.js +1 -1
- package/dist/esm/components/Avatar/index.js +1 -1
- package/dist/esm/components/AvatarGroup/index.js +1 -1
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/Calendar/index.js +1 -1
- package/dist/esm/components/CharacterCounter/index.js +1 -1
- package/dist/esm/components/Checkbox/index.js +1 -1
- package/dist/esm/components/CheckboxGroup/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +2 -2
- package/dist/esm/components/DateTimePicker/index.js +1 -1
- package/dist/esm/components/Heading/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/Modal/index.js +1 -1
- package/dist/esm/components/NotificationCounter/index.js +1 -1
- package/dist/esm/components/NumberInput/index.js +1 -1
- package/dist/esm/components/PinInput/index.js +1 -1
- package/dist/esm/components/Popover/index.js +1 -1
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/Rating/index.js +1 -1
- package/dist/esm/components/RatingDots/index.js +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/SortableList/index.js +1 -1
- package/dist/esm/components/Spinner/index.js +1 -1
- package/dist/esm/components/StyledAvatar/index.js +1 -1
- package/dist/esm/components/Switch/index.js +1 -1
- package/dist/esm/components/Tabs/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/Text/index.js +1 -1
- package/dist/esm/components/TextInput/index.js +1 -1
- package/dist/esm/components/Textarea/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/Timestamp/index.js +1 -1
- package/dist/esm/components/Tooltip/index.js +1 -1
- package/dist/esm/components/index.js +36 -36
- package/dist/esm/index.js +37 -37
- package/dist/esm/theme/index.js +1 -1
- package/dist/types/components/Tooltip/tooltip.component.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/datePicker.provider-DgarjPPd.js +0 -15
- package/dist/chunks/menu.component-D4-4xRDj.js +0 -2
- package/dist/chunks/menu.component-D4-4xRDj.js.map +0 -1
- package/dist/chunks/menu.component-DwTen8Uv.js.map +0 -1
- package/dist/chunks/popover.recipe-B9bkpDfc.js.map +0 -1
- package/dist/chunks/popover.recipe-Czy8Aeft.js +0 -2
- package/dist/chunks/popover.recipe-Czy8Aeft.js.map +0 -1
- package/dist/chunks/tooltip.component-BkFDi5yK.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { W as f } from "./text.component-
|
|
2
|
+
import { W as f } from "./text.component-IjomJyJY.js";
|
|
3
3
|
import { t as n } from "./typography-Cqrokog3.js";
|
|
4
4
|
import { d as m } from "./config-Djkl1N81.js";
|
|
5
5
|
import { u as b } from "./create-slot-recipe-context-D_FXDJGp.js";
|
|
@@ -184,4 +184,4 @@ const x = ["root", "spinner", "label"], h = {
|
|
|
184
184
|
export {
|
|
185
185
|
k as S
|
|
186
186
|
};
|
|
187
|
-
//# sourceMappingURL=spinner.component-
|
|
187
|
+
//# sourceMappingURL=spinner.component-D3s81AJH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.component-
|
|
1
|
+
{"version":3,"file":"spinner.component-D3s81AJH.js","sources":["../../src/components/Spinner/spinner.recipe.ts","../../src/components/Spinner/spinner.component.tsx"],"sourcesContent":["import { defineSlotRecipe, SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { SpinnerSize } from './spinner.types';\nimport { TypographyVariant } from 'shared/types';\nimport { typographyVariantStyles } from '../../shared/records/typography';\n\nconst spinnerSlots = ['root', 'spinner', 'label'] as const;\ntype SpinnerSlot = (typeof spinnerSlots)[number];\ntype SpinnerSlotStyles = {\n [key in SpinnerSlot]?: SystemStyleObject;\n};\n\nconst spinnerSizeStyles: Record<SpinnerSize, SpinnerSlotStyles> = {\n xs: {\n spinner: {\n h: 2,\n w: 2,\n },\n label: {\n fontSize: 'xs',\n },\n },\n sm: {\n spinner: {\n h: 4,\n w: 4,\n },\n label: {\n fontSize: 'sm',\n },\n },\n md: {\n spinner: {\n h: 6,\n w: 6,\n '--spinner-size': 6,\n },\n label: {\n fontSize: 'md',\n },\n },\n lg: {\n spinner: {\n h: 8,\n w: 8,\n },\n label: {\n fontSize: 'lg',\n },\n },\n xl: {\n spinner: {\n h: 12,\n w: 12,\n },\n label: {\n fontSize: 'xl',\n },\n },\n};\n\nconst spinnerVariantStyles: Record<TypographyVariant, SpinnerSlotStyles> = {\n accent: {\n spinner: typographyVariantStyles.accent,\n },\n accentSubtle: {\n spinner: typographyVariantStyles.accentSubtle,\n },\n brand: {\n spinner: typographyVariantStyles.brand,\n },\n brandOnContrast: {\n spinner: typographyVariantStyles.brandOnContrast,\n },\n danger: {\n spinner: typographyVariantStyles.danger,\n },\n dangerOnContrast: {\n spinner: typographyVariantStyles.dangerOnContrast,\n },\n default: {\n spinner: typographyVariantStyles.default,\n },\n info: {\n spinner: typographyVariantStyles.info,\n },\n interactive: {\n spinner: typographyVariantStyles.interactive,\n },\n interactiveOnContrast: {\n spinner: typographyVariantStyles.interactiveOnContrast,\n },\n onContrast: {\n spinner: typographyVariantStyles.onContrast,\n },\n placeholder: {\n spinner: typographyVariantStyles.placeholder,\n },\n placeholderOnContrast: {\n spinner: typographyVariantStyles.placeholderOnContrast,\n },\n subtle: {\n spinner: typographyVariantStyles.subtle,\n },\n subtleOnContrast: {\n spinner: typographyVariantStyles.subtleOnContrast,\n },\n success: {\n spinner: typographyVariantStyles.success,\n },\n warning: {\n spinner: typographyVariantStyles.warning,\n },\n};\n\nexport const spinnerRecipe = defineSlotRecipe({\n slots: spinnerSlots,\n base: {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n },\n variants: {\n variant: spinnerVariantStyles,\n size: spinnerSizeStyles,\n fullScreen: {\n true: {\n root: {\n h: '100%',\n left: 0,\n top: 0,\n position: 'absolute',\n w: '100%',\n zIndex: 'tooltipExtra',\n },\n },\n false: {\n root: {\n h: 'max-content',\n w: 'max-content',\n },\n },\n },\n centered: {\n true: {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n w: '100%',\n },\n },\n false: {\n root: {\n alignItems: 'flex-start',\n justifyContent: 'flex-start',\n },\n },\n },\n },\n defaultVariants: {\n fullScreen: false,\n size: 'md',\n variant: 'brand',\n },\n});\n","import React from 'react';\nimport { Spinner as CSpinner } from '@chakra-ui/react/spinner';\nimport { VStack } from '@chakra-ui/react/stack';\nimport { SpinnerSize } from './spinner.types';\nimport { Text, TextProps } from 'components/Text/text.component';\nimport { TypographyVariant } from 'shared/types';\nimport { useSlotRecipe } from '@chakra-ui/react';\nimport { spinnerRecipe } from './spinner.recipe';\nimport { SemanticBackgroundColorToken } from 'theme/semanticTokens';\n\nexport interface SpinnerProps {\n /**\n * The background color for the full size spinner.\n * @default background.alpha.pressed\n */\n backdropColor?: SemanticBackgroundColorToken;\n /**\n * Whether the spinner should cover the entire screen.\n * @default false\n */\n fullScreen?: boolean;\n /** Optional label to display below the spinner. */\n label?: string;\n /** Props to customize the label of the spinner. See `Text` for more information. */\n labelProps?: Omit<TextProps, 'chilren'>;\n /** The size of the spinner. */\n size?: SpinnerSize;\n /**\n * The color variant of the spinner.\n * @default brand\n */\n variant?: TypographyVariant;\n /** The color of the spinner. If this value is provided, the variant prop will be ignored. */\n color?: string;\n /**\n * Data test id for the spinner.\n * @default kibble-spinner\n */\n 'data-testid'?: string;\n /**\n * Whether the spinner should be centered in the container.\n * @default true\n */\n centered?: boolean;\n}\n\nexport const Spinner = ({\n backdropColor = 'background.alpha.pressed',\n fullScreen = false,\n label,\n labelProps,\n size = 'md',\n variant = 'accent',\n color,\n centered = true,\n ['data-testid']: dataTestId = 'kibble-spinner',\n}: SpinnerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: spinnerRecipe });\n const styles = recipe({ variant, size, fullScreen, centered });\n\n return (\n <VStack className=\"Spinner\" data-testid={dataTestId} css={styles.root} {...(fullScreen && { bg: backdropColor })}>\n <CSpinner css={styles.spinner} color={color} />\n {label && (\n <Text\n className=\"Spinner__Label\"\n data-testid={`${dataTestId}-label`}\n variant=\"subtle\"\n css={styles.label}\n {...labelProps}\n >\n {label}\n </Text>\n )}\n </VStack>\n );\n};\n"],"names":["spinnerSlots","spinnerSizeStyles","spinnerVariantStyles","typographyVariantStyles","spinnerRecipe","defineSlotRecipe","Spinner","backdropColor","fullScreen","label","labelProps","size","variant","color","centered","dataTestId","styles","useSlotRecipe","jsxs","VStack","jsx","CSpinner","Text"],"mappings":";;;;;;;AAKA,MAAMA,IAAe,CAAC,QAAQ,WAAW,OAAO,GAM1CC,IAA4D;AAAA,EAChE,IAAI;AAAA,IACF,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,OAAO;AAAA,MACL,UAAU;AAAA,IAAA;AAAA,EAEd;AAAA,EACA,IAAI;AAAA,IACF,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,OAAO;AAAA,MACL,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Aa;AAChC,MAAuC;AAErC,QAAMC,IADSC,EAAc,EAAE,QAAQb,GAAe,EAChC,EAAE,SAAAQ,GAAS,MAAAD,GAAM,YAAAH,GAAY,UAAAM,GAAU;AAE7D,SACGI,gBAAAA,EAAAA,KAAAC,GAAA,EAAO,WAAU,WAAU,eAAaJ,GAAY,KAAKC,EAAO,MAAO,GAAIR,KAAc,EAAE,IAAID,EAC9F,GAAA,UAAA;AAAA,IAAAa,gBAAAA,EAAA,IAACC,GAAS,EAAA,KAAKL,EAAO,SAAS,OAAAH,GAAc;AAAA,IAC5CJ,KACCW,gBAAAA,EAAA;AAAA,MAACE;AAAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,eAAa,GAAGP,CAAU;AAAA,QAC1B,SAAQ;AAAA,QACR,KAAKC,EAAO;AAAA,QACX,GAAGN;AAAA,QAEH,UAAAD;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),S=require("./text.component-
|
|
2
|
-
//# sourceMappingURL=spinner.component-
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),S=require("./text.component-BDDz5KQP.js"),t=require("./typography-CtiaGoJG.js"),u=require("./config-jChwZPSv.js"),d=require("./create-slot-recipe-context-HXE1VazG.js"),g=require("./v-stack-Bz-79Toq.js"),h=require("./spinner-CBTcw_Tk.js"),b=["root","spinner","label"],f={xs:{spinner:{h:2,w:2},label:{fontSize:"xs"}},sm:{spinner:{h:4,w:4},label:{fontSize:"sm"}},md:{spinner:{h:6,w:6,"--spinner-size":6},label:{fontSize:"md"}},lg:{spinner:{h:8,w:8},label:{fontSize:"lg"}},xl:{spinner:{h:12,w:12},label:{fontSize:"xl"}}},x={accent:{spinner:t.typographyVariantStyles.accent},accentSubtle:{spinner:t.typographyVariantStyles.accentSubtle},brand:{spinner:t.typographyVariantStyles.brand},brandOnContrast:{spinner:t.typographyVariantStyles.brandOnContrast},danger:{spinner:t.typographyVariantStyles.danger},dangerOnContrast:{spinner:t.typographyVariantStyles.dangerOnContrast},default:{spinner:t.typographyVariantStyles.default},info:{spinner:t.typographyVariantStyles.info},interactive:{spinner:t.typographyVariantStyles.interactive},interactiveOnContrast:{spinner:t.typographyVariantStyles.interactiveOnContrast},onContrast:{spinner:t.typographyVariantStyles.onContrast},placeholder:{spinner:t.typographyVariantStyles.placeholder},placeholderOnContrast:{spinner:t.typographyVariantStyles.placeholderOnContrast},subtle:{spinner:t.typographyVariantStyles.subtle},subtleOnContrast:{spinner:t.typographyVariantStyles.subtleOnContrast},success:{spinner:t.typographyVariantStyles.success},warning:{spinner:t.typographyVariantStyles.warning}},V=u.defineSlotRecipe({slots:b,base:{root:{alignItems:"center",justifyContent:"center"}},variants:{variant:x,size:f,fullScreen:{true:{root:{h:"100%",left:0,top:0,position:"absolute",w:"100%",zIndex:"tooltipExtra"}},false:{root:{h:"max-content",w:"max-content"}}},centered:{true:{root:{alignItems:"center",justifyContent:"center",w:"100%"}},false:{root:{alignItems:"flex-start",justifyContent:"flex-start"}}}},defaultVariants:{fullScreen:!1,size:"md",variant:"brand"}}),m=({backdropColor:i="background.alpha.pressed",fullScreen:r=!1,label:s,labelProps:o,size:p="md",variant:l="accent",color:c,centered:y=!0,["data-testid"]:a="kibble-spinner"})=>{const e=d.useSlotRecipe({recipe:V})({variant:l,size:p,fullScreen:r,centered:y});return n.jsxRuntimeExports.jsxs(g.VStack,{className:"Spinner","data-testid":a,css:e.root,...r&&{bg:i},children:[n.jsxRuntimeExports.jsx(h.Spinner,{css:e.spinner,color:c}),s&&n.jsxRuntimeExports.jsx(S.WrappedText,{className:"Spinner__Label","data-testid":`${a}-label`,variant:"subtle",css:e.label,...o,children:s})]})};exports.Spinner=m;
|
|
2
|
+
//# sourceMappingURL=spinner.component-Dq6u4vVL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.component-
|
|
1
|
+
{"version":3,"file":"spinner.component-Dq6u4vVL.js","sources":["../../src/components/Spinner/spinner.recipe.ts","../../src/components/Spinner/spinner.component.tsx"],"sourcesContent":["import { defineSlotRecipe, SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { SpinnerSize } from './spinner.types';\nimport { TypographyVariant } from 'shared/types';\nimport { typographyVariantStyles } from '../../shared/records/typography';\n\nconst spinnerSlots = ['root', 'spinner', 'label'] as const;\ntype SpinnerSlot = (typeof spinnerSlots)[number];\ntype SpinnerSlotStyles = {\n [key in SpinnerSlot]?: SystemStyleObject;\n};\n\nconst spinnerSizeStyles: Record<SpinnerSize, SpinnerSlotStyles> = {\n xs: {\n spinner: {\n h: 2,\n w: 2,\n },\n label: {\n fontSize: 'xs',\n },\n },\n sm: {\n spinner: {\n h: 4,\n w: 4,\n },\n label: {\n fontSize: 'sm',\n },\n },\n md: {\n spinner: {\n h: 6,\n w: 6,\n '--spinner-size': 6,\n },\n label: {\n fontSize: 'md',\n },\n },\n lg: {\n spinner: {\n h: 8,\n w: 8,\n },\n label: {\n fontSize: 'lg',\n },\n },\n xl: {\n spinner: {\n h: 12,\n w: 12,\n },\n label: {\n fontSize: 'xl',\n },\n },\n};\n\nconst spinnerVariantStyles: Record<TypographyVariant, SpinnerSlotStyles> = {\n accent: {\n spinner: typographyVariantStyles.accent,\n },\n accentSubtle: {\n spinner: typographyVariantStyles.accentSubtle,\n },\n brand: {\n spinner: typographyVariantStyles.brand,\n },\n brandOnContrast: {\n spinner: typographyVariantStyles.brandOnContrast,\n },\n danger: {\n spinner: typographyVariantStyles.danger,\n },\n dangerOnContrast: {\n spinner: typographyVariantStyles.dangerOnContrast,\n },\n default: {\n spinner: typographyVariantStyles.default,\n },\n info: {\n spinner: typographyVariantStyles.info,\n },\n interactive: {\n spinner: typographyVariantStyles.interactive,\n },\n interactiveOnContrast: {\n spinner: typographyVariantStyles.interactiveOnContrast,\n },\n onContrast: {\n spinner: typographyVariantStyles.onContrast,\n },\n placeholder: {\n spinner: typographyVariantStyles.placeholder,\n },\n placeholderOnContrast: {\n spinner: typographyVariantStyles.placeholderOnContrast,\n },\n subtle: {\n spinner: typographyVariantStyles.subtle,\n },\n subtleOnContrast: {\n spinner: typographyVariantStyles.subtleOnContrast,\n },\n success: {\n spinner: typographyVariantStyles.success,\n },\n warning: {\n spinner: typographyVariantStyles.warning,\n },\n};\n\nexport const spinnerRecipe = defineSlotRecipe({\n slots: spinnerSlots,\n base: {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n },\n variants: {\n variant: spinnerVariantStyles,\n size: spinnerSizeStyles,\n fullScreen: {\n true: {\n root: {\n h: '100%',\n left: 0,\n top: 0,\n position: 'absolute',\n w: '100%',\n zIndex: 'tooltipExtra',\n },\n },\n false: {\n root: {\n h: 'max-content',\n w: 'max-content',\n },\n },\n },\n centered: {\n true: {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n w: '100%',\n },\n },\n false: {\n root: {\n alignItems: 'flex-start',\n justifyContent: 'flex-start',\n },\n },\n },\n },\n defaultVariants: {\n fullScreen: false,\n size: 'md',\n variant: 'brand',\n },\n});\n","import React from 'react';\nimport { Spinner as CSpinner } from '@chakra-ui/react/spinner';\nimport { VStack } from '@chakra-ui/react/stack';\nimport { SpinnerSize } from './spinner.types';\nimport { Text, TextProps } from 'components/Text/text.component';\nimport { TypographyVariant } from 'shared/types';\nimport { useSlotRecipe } from '@chakra-ui/react';\nimport { spinnerRecipe } from './spinner.recipe';\nimport { SemanticBackgroundColorToken } from 'theme/semanticTokens';\n\nexport interface SpinnerProps {\n /**\n * The background color for the full size spinner.\n * @default background.alpha.pressed\n */\n backdropColor?: SemanticBackgroundColorToken;\n /**\n * Whether the spinner should cover the entire screen.\n * @default false\n */\n fullScreen?: boolean;\n /** Optional label to display below the spinner. */\n label?: string;\n /** Props to customize the label of the spinner. See `Text` for more information. */\n labelProps?: Omit<TextProps, 'chilren'>;\n /** The size of the spinner. */\n size?: SpinnerSize;\n /**\n * The color variant of the spinner.\n * @default brand\n */\n variant?: TypographyVariant;\n /** The color of the spinner. If this value is provided, the variant prop will be ignored. */\n color?: string;\n /**\n * Data test id for the spinner.\n * @default kibble-spinner\n */\n 'data-testid'?: string;\n /**\n * Whether the spinner should be centered in the container.\n * @default true\n */\n centered?: boolean;\n}\n\nexport const Spinner = ({\n backdropColor = 'background.alpha.pressed',\n fullScreen = false,\n label,\n labelProps,\n size = 'md',\n variant = 'accent',\n color,\n centered = true,\n ['data-testid']: dataTestId = 'kibble-spinner',\n}: SpinnerProps): React.JSX.Element => {\n const recipe = useSlotRecipe({ recipe: spinnerRecipe });\n const styles = recipe({ variant, size, fullScreen, centered });\n\n return (\n <VStack className=\"Spinner\" data-testid={dataTestId} css={styles.root} {...(fullScreen && { bg: backdropColor })}>\n <CSpinner css={styles.spinner} color={color} />\n {label && (\n <Text\n className=\"Spinner__Label\"\n data-testid={`${dataTestId}-label`}\n variant=\"subtle\"\n css={styles.label}\n {...labelProps}\n >\n {label}\n </Text>\n )}\n </VStack>\n );\n};\n"],"names":["spinnerSlots","spinnerSizeStyles","spinnerVariantStyles","typographyVariantStyles","spinnerRecipe","defineSlotRecipe","Spinner","backdropColor","fullScreen","label","labelProps","size","variant","color","centered","dataTestId","styles","useSlotRecipe","jsxs","VStack","jsx","CSpinner","Text"],"mappings":"wSAKMA,EAAe,CAAC,OAAQ,UAAW,OAAO,EAM1CC,EAA4D,CAChE,GAAI,CACF,QAAS,CACP,EAAG,EACH,EAAG,CACL,EACA,MAAO,CACL,SAAU,IAAA,CAEd,EACA,GAAI,CACF,QAAS,CACP,EAAG,EACH,EAAG,CACL,EACA,MAAO,CACL,SAAU,IAAA,CAEd,EACA,GAAI,CACF,QAAS,CACP,EAAG,EACH,EAAG,EACH,iBAAkB,CACpB,EACA,MAAO,CACL,SAAU,IAAA,CAEd,EACA,GAAI,CACF,QAAS,CACP,EAAG,EACH,EAAG,CACL,EACA,MAAO,CACL,SAAU,IAAA,CAEd,EACA,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,SACZ,eAAgB,SAChB,EAAG,MAAA,CAEP,EACA,MAAO,CACL,KAAM,CACJ,WAAY,aACZ,eAAgB,YAAA,CAClB,CACF,CAEJ,EACA,gBAAiB,CACf,WAAY,GACZ,KAAM,KACN,QAAS,OAAA,CAEb,CAAC,ECtHYK,EAAU,CAAC,CACtB,cAAAC,EAAgB,2BAChB,WAAAC,EAAa,GACb,MAAAC,EACA,WAAAC,EACA,KAAAC,EAAO,KACP,QAAAC,EAAU,SACV,MAAAC,EACA,SAAAC,EAAW,GACX,CAAC,eAAgBC,EAAa,gBAChC,IAAuC,CAErC,MAAMC,EADSC,EAAA,cAAc,CAAE,OAAQb,EAAe,EAChC,CAAE,QAAAQ,EAAS,KAAAD,EAAM,WAAAH,EAAY,SAAAM,EAAU,EAE7D,OACGI,EAAAA,kBAAAA,KAAAC,EAAAA,OAAA,CAAO,UAAU,UAAU,cAAaJ,EAAY,IAAKC,EAAO,KAAO,GAAIR,GAAc,CAAE,GAAID,CAC9F,EAAA,SAAA,CAAAa,EAAA,kBAAA,IAACC,EAAS,QAAA,CAAA,IAAKL,EAAO,QAAS,MAAAH,EAAc,EAC5CJ,GACCW,EAAA,kBAAA,IAACE,EAAA,YAAA,CACC,UAAU,iBACV,cAAa,GAAGP,CAAU,SAC1B,QAAQ,SACR,IAAKC,EAAO,MACX,GAAGN,EAEH,SAAAD,CAAA,CAAA,CACH,EAEJ,CAEJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as p } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import m from "react";
|
|
3
|
-
import { A as d } from "./avatar.component-
|
|
3
|
+
import { A as d } from "./avatar.component-DUZc5iXT.js";
|
|
4
4
|
const g = m.memo(
|
|
5
5
|
({
|
|
6
6
|
type: a = "Client",
|
|
@@ -66,4 +66,4 @@ export {
|
|
|
66
66
|
g as S,
|
|
67
67
|
k as s
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=styledAvatar.types-
|
|
69
|
+
//# sourceMappingURL=styledAvatar.types-C9Oi9C2U.js.map
|
package/dist/chunks/{styledAvatar.types-cR6PNPxA.js.map → styledAvatar.types-C9Oi9C2U.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styledAvatar.types-
|
|
1
|
+
{"version":3,"file":"styledAvatar.types-C9Oi9C2U.js","sources":["../../src/components/StyledAvatar/styledAvatar.component.tsx","../../src/components/StyledAvatar/styledAvatar.types.ts"],"sourcesContent":["import React from 'react';\nimport { Avatar, AvatarProps } from 'components/Avatar/avatar.component';\nimport { StyledAvatarType } from './styledAvatar.types';\n\nexport interface StyledAvatarProps extends AvatarProps {\n /**\n * Defines the style of the `Avatar`.\n * @default Client\n */\n type?: StyledAvatarType;\n /**\n * Data test id for the styled avatar.\n * @default kibble-styled-avatar\n */\n 'data-testid'?: string;\n}\n\nexport const StyledAvatar = React.memo(\n ({\n type = 'Client',\n ['data-testid']: dataTestId = 'kibble-styled-avatar',\n ...rest\n }: StyledAvatarProps): React.JSX.Element => {\n const { name, tooltipProps = { placement: 'top', ...rest.tooltipProps }, onClick } = rest;\n\n const testClientStyleProps: Partial<AvatarProps> = {\n variant: 'outlineYellow',\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `${name} (Test Client)`,\n },\n };\n\n const smsStyleProps: Partial<AvatarProps> = {\n iconName: 'cellphone',\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `Text messages sent from ${name || 'unknown number'}`,\n },\n };\n\n const automatedStyleProps: Partial<AvatarProps> = {\n iconName: 'robot',\n backgroundColor: 'background.primary',\n hideBorder: true,\n color: 'text.contrast',\n size: 'sm',\n showTooltip: false,\n cursor: 'default',\n };\n\n const clinicStyleProps: Partial<AvatarProps> = {\n variant: 'outlineAccent',\n name: name || 'Sys',\n };\n\n const petStyleProps: Partial<AvatarProps> = {\n hideBorder: true,\n iconName: 'paw',\n backgroundColor: 'background.contrast.mostSubtle',\n badgeProps: {\n iconName: 'cancel',\n bg: 'background.danger',\n status: 'error',\n position: 'top-end',\n },\n };\n\n const styleProps: Record<StyledAvatarType, Partial<AvatarProps>> = {\n Automated: automatedStyleProps,\n Client: {},\n Clinic: clinicStyleProps,\n SMS: smsStyleProps,\n TestClient: testClientStyleProps,\n Pet: petStyleProps,\n };\n\n return (\n <Avatar\n className=\"StyledAvatar\"\n data-testid={`${dataTestId}-${type}`}\n onClick={(e): void => {\n e.stopPropagation();\n if (onClick) {\n onClick(e);\n }\n }}\n {...styleProps[type]}\n {...rest}\n />\n );\n },\n);\n","export const styledAvatarTypes = ['Client', 'SMS', 'TestClient', 'Automated', 'Clinic', 'Pet'] as const;\nexport type StyledAvatarType = (typeof styledAvatarTypes)[number];\n"],"names":["StyledAvatar","React","type","dataTestId","rest","name","tooltipProps","onClick","testClientStyleProps","smsStyleProps","styleProps","jsx","Avatar","e","styledAvatarTypes"],"mappings":";;;AAiBO,MAAMA,IAAeC,EAAM;AAAA,EAChC,CAAC;AAAA,IACC,MAAAC,IAAO;AAAA,IACP,CAAC,gBAAgBC,IAAa;AAAA,IAC9B,GAAGC;AAAA,EAAA,MACuC;AACpC,UAAA,EAAE,MAAAC,GAAM,cAAAC,IAAe,EAAE,WAAW,OAAO,GAAGF,EAAK,aAAA,GAAgB,SAAAG,EAAA,IAAYH,GAE/EI,IAA6C;AAAA,MACjD,SAAS;AAAA,MACT,cAAc;AAAA,QACZ,GAAGF;AAAA,QACH,OAAOA,GAAc,SAAS,GAAGD,CAAI;AAAA,MAAA;AAAA,IAEzC,GAEMI,IAAsC;AAAA,MAC1C,UAAU;AAAA,MACV,cAAc;AAAA,QACZ,GAAGH;AAAA,QACH,OAAOA,GAAc,SAAS,2BAA2BD,KAAQ,gBAAgB;AAAA,MAAA;AAAA,IAErF,GA6BMK,IAA6D;AAAA,MACjE,WA5BgD;AAAA,QAChD,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,YAAY;AAAA,QACZ,OAAO;AAAA,QACP,MAAM;AAAA,QACN,aAAa;AAAA,QACb,QAAQ;AAAA,MACV;AAAA,MAqBE,QAAQ,CAAC;AAAA,MACT,QApB6C;AAAA,QAC7C,SAAS;AAAA,QACT,MAAML,KAAQ;AAAA,MAChB;AAAA,MAkBE,KAAKI;AAAA,MACL,YAAYD;AAAA,MACZ,KAlB0C;AAAA,QAC1C,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,iBAAiB;AAAA,QACjB,YAAY;AAAA,UACV,UAAU;AAAA,UACV,IAAI;AAAA,UACJ,QAAQ;AAAA,UACR,UAAU;AAAA,QAAA;AAAA,MAEd;AAAA,IASA;AAGE,WAAAG,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,eAAa,GAAGT,CAAU,IAAID,CAAI;AAAA,QAClC,SAAS,CAACW,MAAY;AACpB,UAAAA,EAAE,gBAAgB,GACdN,KACFA,EAAQM,CAAC;AAAA,QAEb;AAAA,QACC,GAAGH,EAAWR,CAAI;AAAA,QAClB,GAAGE;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN,GC5FaU,IAAoB,CAAC,UAAU,OAAO,cAAc,aAAa,UAAU,KAAK;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const p=require("./jsx-runtime-BjDatQAs.js"),d=require("react"),u=require("./avatar.component-
|
|
2
|
-
//# sourceMappingURL=styledAvatar.types-
|
|
1
|
+
"use strict";const p=require("./jsx-runtime-BjDatQAs.js"),d=require("react"),u=require("./avatar.component-Bi0lMCsC.js"),m=t=>t&&t.__esModule?t:{default:t},y=m(d),P=y.default.memo(({type:t="Client",["data-testid"]:l="kibble-styled-avatar",...o})=>{const{name:a,tooltipProps:e={placement:"top",...o.tooltipProps},onClick:s}=o,r={variant:"outlineYellow",tooltipProps:{...e,label:e?.label||`${a} (Test Client)`}},i={iconName:"cellphone",tooltipProps:{...e,label:e?.label||`Text messages sent from ${a||"unknown number"}`}},c={Automated:{iconName:"robot",backgroundColor:"background.primary",hideBorder:!0,color:"text.contrast",size:"sm",showTooltip:!1,cursor:"default"},Client:{},Clinic:{variant:"outlineAccent",name:a||"Sys"},SMS:i,TestClient:r,Pet:{hideBorder:!0,iconName:"paw",backgroundColor:"background.contrast.mostSubtle",badgeProps:{iconName:"cancel",bg:"background.danger",status:"error",position:"top-end"}}};return p.jsxRuntimeExports.jsx(u.Avatar,{className:"StyledAvatar","data-testid":`${l}-${t}`,onClick:n=>{n.stopPropagation(),s&&s(n)},...c[t],...o})}),S=["Client","SMS","TestClient","Automated","Clinic","Pet"];exports.StyledAvatar=P;exports.styledAvatarTypes=S;
|
|
2
|
+
//# sourceMappingURL=styledAvatar.types-CUweBJqA.js.map
|
package/dist/chunks/{styledAvatar.types-CcP-Vl9c.js.map → styledAvatar.types-CUweBJqA.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styledAvatar.types-
|
|
1
|
+
{"version":3,"file":"styledAvatar.types-CUweBJqA.js","sources":["../../src/components/StyledAvatar/styledAvatar.component.tsx","../../src/components/StyledAvatar/styledAvatar.types.ts"],"sourcesContent":["import React from 'react';\nimport { Avatar, AvatarProps } from 'components/Avatar/avatar.component';\nimport { StyledAvatarType } from './styledAvatar.types';\n\nexport interface StyledAvatarProps extends AvatarProps {\n /**\n * Defines the style of the `Avatar`.\n * @default Client\n */\n type?: StyledAvatarType;\n /**\n * Data test id for the styled avatar.\n * @default kibble-styled-avatar\n */\n 'data-testid'?: string;\n}\n\nexport const StyledAvatar = React.memo(\n ({\n type = 'Client',\n ['data-testid']: dataTestId = 'kibble-styled-avatar',\n ...rest\n }: StyledAvatarProps): React.JSX.Element => {\n const { name, tooltipProps = { placement: 'top', ...rest.tooltipProps }, onClick } = rest;\n\n const testClientStyleProps: Partial<AvatarProps> = {\n variant: 'outlineYellow',\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `${name} (Test Client)`,\n },\n };\n\n const smsStyleProps: Partial<AvatarProps> = {\n iconName: 'cellphone',\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `Text messages sent from ${name || 'unknown number'}`,\n },\n };\n\n const automatedStyleProps: Partial<AvatarProps> = {\n iconName: 'robot',\n backgroundColor: 'background.primary',\n hideBorder: true,\n color: 'text.contrast',\n size: 'sm',\n showTooltip: false,\n cursor: 'default',\n };\n\n const clinicStyleProps: Partial<AvatarProps> = {\n variant: 'outlineAccent',\n name: name || 'Sys',\n };\n\n const petStyleProps: Partial<AvatarProps> = {\n hideBorder: true,\n iconName: 'paw',\n backgroundColor: 'background.contrast.mostSubtle',\n badgeProps: {\n iconName: 'cancel',\n bg: 'background.danger',\n status: 'error',\n position: 'top-end',\n },\n };\n\n const styleProps: Record<StyledAvatarType, Partial<AvatarProps>> = {\n Automated: automatedStyleProps,\n Client: {},\n Clinic: clinicStyleProps,\n SMS: smsStyleProps,\n TestClient: testClientStyleProps,\n Pet: petStyleProps,\n };\n\n return (\n <Avatar\n className=\"StyledAvatar\"\n data-testid={`${dataTestId}-${type}`}\n onClick={(e): void => {\n e.stopPropagation();\n if (onClick) {\n onClick(e);\n }\n }}\n {...styleProps[type]}\n {...rest}\n />\n );\n },\n);\n","export const styledAvatarTypes = ['Client', 'SMS', 'TestClient', 'Automated', 'Clinic', 'Pet'] as const;\nexport type StyledAvatarType = (typeof styledAvatarTypes)[number];\n"],"names":["StyledAvatar","React","type","dataTestId","rest","name","tooltipProps","onClick","testClientStyleProps","smsStyleProps","styleProps","jsx","Avatar","e","styledAvatarTypes"],"mappings":"mKAiBaA,EAAeC,EAAM,QAAA,KAChC,CAAC,CACC,KAAAC,EAAO,SACP,CAAC,eAAgBC,EAAa,uBAC9B,GAAGC,CAAA,IACuC,CACpC,KAAA,CAAE,KAAAC,EAAM,aAAAC,EAAe,CAAE,UAAW,MAAO,GAAGF,EAAK,YAAA,EAAgB,QAAAG,CAAA,EAAYH,EAE/EI,EAA6C,CACjD,QAAS,gBACT,aAAc,CACZ,GAAGF,EACH,MAAOA,GAAc,OAAS,GAAGD,CAAI,gBAAA,CAEzC,EAEMI,EAAsC,CAC1C,SAAU,YACV,aAAc,CACZ,GAAGH,EACH,MAAOA,GAAc,OAAS,2BAA2BD,GAAQ,gBAAgB,EAAA,CAErF,EA6BMK,EAA6D,CACjE,UA5BgD,CAChD,SAAU,QACV,gBAAiB,qBACjB,WAAY,GACZ,MAAO,gBACP,KAAM,KACN,YAAa,GACb,OAAQ,SACV,EAqBE,OAAQ,CAAC,EACT,OApB6C,CAC7C,QAAS,gBACT,KAAML,GAAQ,KAChB,EAkBE,IAAKI,EACL,WAAYD,EACZ,IAlB0C,CAC1C,WAAY,GACZ,SAAU,MACV,gBAAiB,iCACjB,WAAY,CACV,SAAU,SACV,GAAI,oBACJ,OAAQ,QACR,SAAU,SAAA,CAEd,CASA,EAGE,OAAAG,EAAA,kBAAA,IAACC,EAAA,OAAA,CACC,UAAU,eACV,cAAa,GAAGT,CAAU,IAAID,CAAI,GAClC,QAAUW,GAAY,CACpBA,EAAE,gBAAgB,EACdN,GACFA,EAAQM,CAAC,CAEb,EACC,GAAGH,EAAWR,CAAI,EAClB,GAAGE,CAAA,CACN,CAAA,CAGN,EC5FaU,EAAoB,CAAC,SAAU,MAAO,aAAc,YAAa,SAAU,KAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),c=require("react"),N=require("./withFormControl-
|
|
2
|
-
//# sourceMappingURL=switch.component-
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),c=require("react"),N=require("./withFormControl-CIZOpk9n.js"),w=require("./attr-BMs6szZx.js"),$=require("./create-slot-recipe-context-HXE1VazG.js"),f=require("./factory-a2SJjEvR.js"),i=require("./use-locale-context-ym21RUxU.js"),S=require("./use-field-context-Cm29IQ7H.js"),u=require("./index-CQURjLlA.js"),m=require("./index-DLe40do7.js"),_=t=>t&&t.__esModule?t:{default:t},A=_(c),[R,h]=i.createContext({name:"SwitchContext",hookName:"useSwitchContext",providerName:"<SwitchProvider />"}),C=c.forwardRef((t,r)=>{const e=h(),s=u.mergeProps(e.getControlProps(),t);return n.jsxRuntimeExports.jsx(i.ark.span,{...s,ref:r})});C.displayName="SwitchControl";const j=c.forwardRef((t,r)=>{const e=h(),s=u.mergeProps(e.getHiddenInputProps(),t),o=S.useFieldContext();return n.jsxRuntimeExports.jsx(i.ark.input,{"aria-describedby":o?.ariaDescribedby,...s,ref:r})});j.displayName="SwitchHiddenInput";const P=c.forwardRef((t,r)=>{const e=h(),s=u.mergeProps(e.getLabelProps(),t);return n.jsxRuntimeExports.jsx(i.ark.span,{...s,ref:r})});P.displayName="SwitchLabel";const I=t=>{const r=c.useId(),{getRootNode:e}=i.useEnvironmentContext(),{dir:s}=i.useLocaleContext(),o=S.useFieldContext(),a={id:r,ids:{label:o?.ids.label,hiddenInput:o?.ids.control},dir:s,disabled:o?.disabled,readOnly:o?.readOnly,invalid:o?.invalid,required:o?.required,getRootNode:e,...t},d=i.useMachine(m.machine,a);return m.connect(d,i.normalizeProps)},b=c.forwardRef((t,r)=>{const[e,s]=i.createSplitProps()(t,["checked","defaultChecked","disabled","form","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]),o=I(e),a=u.mergeProps(o.getRootProps(),s);return n.jsxRuntimeExports.jsx(R,{value:o,children:n.jsxRuntimeExports.jsx(i.ark.label,{...a,ref:r})})});b.displayName="SwitchRoot";const k=c.forwardRef((t,r)=>{const[{value:e},s]=i.createSplitProps()(t,["value"]),o=u.mergeProps(e.getRootProps(),s);return n.jsxRuntimeExports.jsx(R,{value:e,children:n.jsxRuntimeExports.jsx(i.ark.label,{...o,ref:r})})});k.displayName="SwitchRootProvider";const g=c.forwardRef((t,r)=>{const e=h(),s=u.mergeProps(e.getThumbProps(),t);return n.jsxRuntimeExports.jsx(i.ark.span,{...s,ref:r})});g.displayName="SwitchThumb";const{withProvider:v,withContext:x,useStyles:L}=$.createSlotRecipeContext({key:"switch"});v(k,"root",{forwardAsChild:!0});const F=v(b,"root",{forwardAsChild:!0}),H=x(P,"label",{forwardAsChild:!0}),O=x(g,"thumb",{forwardAsChild:!0}),M=x(C,"control",{forwardAsChild:!0,defaultProps:{children:n.jsxRuntimeExports.jsx(O,{})}});c.forwardRef(function(r,e){const s=h(),o=L(),{fallback:a,children:d,unstyled:l,...p}=r;return n.jsxRuntimeExports.jsx(f.chakra.span,{ref:e,"data-checked":w.dataAttr(s.checked),...p,css:[l?void 0:o.indicator,r.css],children:s.checked?d:a})});c.forwardRef(function(r,e){const s=h(),{fallback:o,children:a,...d}=r;return n.jsxRuntimeExports.jsx(f.chakra.span,{ref:e,"data-checked":w.dataAttr(s.checked),...d,children:s.checked?a:o})});const D=j,y=A.default.forwardRef(({children:t,indeterminate:r=!1,onContrast:e,label:s,rootRef:o,size:a="md",switchRef:d,["data-testid"]:l="kibble-switch",...p},E)=>{const q=c.useMemo(()=>r?e?"indeterminateOnContrast":"indeterminate":e?"onContrast":"default",[r,e]);return n.jsxRuntimeExports.jsxs(F,{className:"Switch","data-testid":l,ref:o,size:a,variant:q,...p,children:[n.jsxRuntimeExports.jsx(D,{className:"Switch_Input","data-testid":`${l}-input`,ref:d||E}),n.jsxRuntimeExports.jsx(M,{className:"Switch_Control","data-testid":`${l}-control`}),!!t&&n.jsxRuntimeExports.jsx(H,{"data-testid":`${l}-label`,children:t})]})});y.displayName="Switch";const T=N.withFormControl(y);exports.WrappedSwitch=T;
|
|
2
|
+
//# sourceMappingURL=switch.component-gcLbjvkh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.component-CgzCLoTB.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, unstyled, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [!unstyled ? styles.indicator : void 0, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { useMemo } from 'react';\nimport { Switch as CSwitch } from '@chakra-ui/react/switch';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport interface SwitchProps extends WithFormControlProps, Omit<CSwitch.RootProps, 'label' | 'onChange'> {\n /**\n * If true, the switch will be indeterminate. This only affects the switch visually and does not modify the checked property.\n * @default false\n */\n indeterminate?: boolean;\n /** Ref to the switch component. */\n rootRef?: React.Ref<HTMLLabelElement | null>;\n /**\n * Size of the switch.\n * @default md\n */\n size?: FormControlSize;\n /** Ref to the hiddeninput element. */\n switchRef?: React.Ref<HTMLInputElement | null>;\n /**\n * Data test id for the switch.\n * @default kibble-switch\n */\n 'data-testid'?: string;\n}\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n rootRef,\n size = 'md',\n switchRef,\n ['data-testid']: dataTestId = 'kibble-switch',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? 'indeterminateOnContrast' : 'indeterminate';\n } else {\n return onContrast ? 'onContrast' : 'default';\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid={dataTestId}\n ref={rootRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput className=\"Switch_Input\" data-testid={`${dataTestId}-input`} ref={switchRef || ref} />\n <CSwitch.Control className=\"Switch_Control\" data-testid={`${dataTestId}-control`} />\n {!!children && <CSwitch.Label data-testid={`${dataTestId}-label`}>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\nconst WrappedSwitch = withFormControl<SwitchProps>(Switch);\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","unstyled","rest","chakra","dataAttr","Switch.HiddenInput","Switch","React","indeterminate","onContrast","label","rootRef","size","switchRef","dataTestId","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","withFormControl"],"mappings":"wbAGM,CAACA,EAAgBC,CAAgB,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EAAoBwC,EClCpBC,EAASC,EAAM,QAAA,WACnB,CACE,CACE,SAAAP,EACA,cAAAQ,EAAgB,GAChB,WAAAC,EAEA,MAAAC,EACA,QAAAC,EACA,KAAAC,EAAO,KACP,UAAAC,EACA,CAAC,eAAgBC,EAAa,gBAC9B,GAAGZ,GAEL3C,IACsB,CAChB,MAAAwD,EAAmBC,EAAAA,QAAQ,IAC3BR,EACKC,EAAa,0BAA4B,gBAEzCA,EAAa,aAAe,UAEpC,CAACD,EAAeC,CAAU,CAAC,EAG5B,OAAAQ,EAAA,kBAAA,KAACC,EAAA,CACC,UAAU,SACV,cAAaJ,EACb,IAAKH,EACL,KAAAC,EACA,QAASG,EACR,GAAGb,EAEJ,SAAA,CAACvC,EAAAA,kBAAAA,IAAAwD,EAAA,CAAoB,UAAU,eAAe,cAAa,GAAGL,CAAU,SAAU,IAAKD,GAAatD,CAAK,CAAA,EACzGI,wBAACyD,EAAA,CAAgB,UAAU,iBAAiB,cAAa,GAAGN,CAAU,WAAY,EACjF,CAAC,CAACd,GAAarC,EAAA,kBAAA,IAAA0D,EAAA,CAAc,cAAa,GAAGP,CAAU,SAAW,SAAAd,CAAS,CAAA,CAAA,CAAA,CAC9E,CAAA,CAGN,EAEAM,EAAO,YAAc,SACf,MAAAgB,EAAgBC,kBAA6BjB,CAAM","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
1
|
+
{"version":3,"file":"switch.component-gcLbjvkh.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, unstyled, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [!unstyled ? styles.indicator : void 0, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { useMemo } from 'react';\nimport { Switch as CSwitch } from '@chakra-ui/react/switch';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport interface SwitchProps extends WithFormControlProps, Omit<CSwitch.RootProps, 'label' | 'onChange'> {\n /**\n * If true, the switch will be indeterminate. This only affects the switch visually and does not modify the checked property.\n * @default false\n */\n indeterminate?: boolean;\n /** Ref to the switch component. */\n rootRef?: React.Ref<HTMLLabelElement | null>;\n /**\n * Size of the switch.\n * @default md\n */\n size?: FormControlSize;\n /** Ref to the hiddeninput element. */\n switchRef?: React.Ref<HTMLInputElement | null>;\n /**\n * Data test id for the switch.\n * @default kibble-switch\n */\n 'data-testid'?: string;\n}\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n rootRef,\n size = 'md',\n switchRef,\n ['data-testid']: dataTestId = 'kibble-switch',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? 'indeterminateOnContrast' : 'indeterminate';\n } else {\n return onContrast ? 'onContrast' : 'default';\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid={dataTestId}\n ref={rootRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput className=\"Switch_Input\" data-testid={`${dataTestId}-input`} ref={switchRef || ref} />\n <CSwitch.Control className=\"Switch_Control\" data-testid={`${dataTestId}-control`} />\n {!!children && <CSwitch.Label data-testid={`${dataTestId}-label`}>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\nconst WrappedSwitch = withFormControl<SwitchProps>(Switch);\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","unstyled","rest","chakra","dataAttr","Switch.HiddenInput","Switch","React","indeterminate","onContrast","label","rootRef","size","switchRef","dataTestId","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","withFormControl"],"mappings":"wbAGM,CAACA,EAAgBC,CAAgB,EAAIC,gBAAc,CACvD,KAAM,gBACN,SAAU,mBACV,aAAc,oBAChB,CAAC,ECAKC,EAAgBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAC/C,MAAMC,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AC,EAAO,KACP,UAAAC,EACA,CAAC,eAAgBC,EAAa,gBAC9B,GAAGZ,GAEL3C,IACsB,CAChB,MAAAwD,EAAmBC,EAAAA,QAAQ,IAC3BR,EACKC,EAAa,0BAA4B,gBAEzCA,EAAa,aAAe,UAEpC,CAACD,EAAeC,CAAU,CAAC,EAG5B,OAAAQ,EAAA,kBAAA,KAACC,EAAA,CACC,UAAU,SACV,cAAaJ,EACb,IAAKH,EACL,KAAAC,EACA,QAASG,EACR,GAAGb,EAEJ,SAAA,CAACvC,EAAAA,kBAAAA,IAAAwD,EAAA,CAAoB,UAAU,eAAe,cAAa,GAAGL,CAAU,SAAU,IAAKD,GAAatD,CAAK,CAAA,EACzGI,wBAACyD,EAAA,CAAgB,UAAU,iBAAiB,cAAa,GAAGN,CAAU,WAAY,EACjF,CAAC,CAACd,GAAarC,EAAA,kBAAA,IAAA0D,EAAA,CAAc,cAAa,GAAGP,CAAU,SAAW,SAAAd,CAAS,CAAA,CAAA,CAAA,CAC9E,CAAA,CAGN,EAEAM,EAAO,YAAc,SACf,MAAAgB,EAAgBC,kBAA6BjB,CAAM","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as c } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import A, { forwardRef as n, useId as I, useMemo as L } from "react";
|
|
3
|
-
import { w as _ } from "./withFormControl-
|
|
3
|
+
import { w as _ } from "./withFormControl-B4TNaDf4.js";
|
|
4
4
|
import { d as w } from "./attr-sm10PXOd.js";
|
|
5
5
|
import { c as H } from "./create-slot-recipe-context-D_FXDJGp.js";
|
|
6
6
|
import { c as S } from "./factory-BQshv7_b.js";
|
|
@@ -152,4 +152,4 @@ const ct = _(N);
|
|
|
152
152
|
export {
|
|
153
153
|
ct as W
|
|
154
154
|
};
|
|
155
|
-
//# sourceMappingURL=switch.component-
|
|
155
|
+
//# sourceMappingURL=switch.component-y47DAbCX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.component-CpV7mnhR.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, unstyled, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [!unstyled ? styles.indicator : void 0, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { useMemo } from 'react';\nimport { Switch as CSwitch } from '@chakra-ui/react/switch';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport interface SwitchProps extends WithFormControlProps, Omit<CSwitch.RootProps, 'label' | 'onChange'> {\n /**\n * If true, the switch will be indeterminate. This only affects the switch visually and does not modify the checked property.\n * @default false\n */\n indeterminate?: boolean;\n /** Ref to the switch component. */\n rootRef?: React.Ref<HTMLLabelElement | null>;\n /**\n * Size of the switch.\n * @default md\n */\n size?: FormControlSize;\n /** Ref to the hiddeninput element. */\n switchRef?: React.Ref<HTMLInputElement | null>;\n /**\n * Data test id for the switch.\n * @default kibble-switch\n */\n 'data-testid'?: string;\n}\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n rootRef,\n size = 'md',\n switchRef,\n ['data-testid']: dataTestId = 'kibble-switch',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? 'indeterminateOnContrast' : 'indeterminate';\n } else {\n return onContrast ? 'onContrast' : 'default';\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid={dataTestId}\n ref={rootRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput className=\"Switch_Input\" data-testid={`${dataTestId}-input`} ref={switchRef || ref} />\n <CSwitch.Control className=\"Switch_Control\" data-testid={`${dataTestId}-control`} />\n {!!children && <CSwitch.Label data-testid={`${dataTestId}-label`}>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\nconst WrappedSwitch = withFormControl<SwitchProps>(Switch);\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","unstyled","rest","chakra","dataAttr","Switch.HiddenInput","Switch","React","indeterminate","onContrast","label","rootRef","size","switchRef","dataTestId","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","withFormControl"],"mappings":";;;;;;;;;;AAGA,MAAM,CAACA,GAAgBC,CAAgB,IAAIC,EAAc;AAAA,EACvD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAChB,CAAC,GCAKC,IAAgBC,EAAW,CAACC,GAAOC,MAAQ;AAC/C,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,gBAAe,GAAIF,CAAK;AACrE,SAAuBK,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAF,GAAK;AAC9D,CAAC;AACDH,EAAc,cAAc;ACJ5B,MAAMS,IAAoBR,EAAW,CAACC,GAAOC,MAAQ;AACnD,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,oBAAmB,GAAIF,CAAK,GACnEQ,IAAQC,EAAiB;AAC/B,SAAuBJ,gBAAAA,EAAG,IAACC,EAAI,OAAO,EAAE,oBAAoBE,GAAO,iBAAiB,GAAGL,GAAa,KAAAF,GAAK;AAC3G,CAAC;AACDM,EAAkB,cAAc;ACPhC,MAAMG,IAAcX,EAAW,CAACC,GAAOC,MAAQ;AAC7C,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,cAAa,GAAIF,CAAK;AACnE,SAAuBK,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAF,GAAK;AAC9D,CAAC;AACDS,EAAY,cAAc;ACJ1B,MAAMC,IAAY,CAACX,MAAU;AAC3B,QAAMY,IAAKC,EAAO,GACZ,EAAE,aAAAC,EAAa,IAAGC,EAAuB,GACzC,EAAE,KAA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AA,IAAA0D,GAAA,EAAc,eAAa,GAAGP,CAAU,UAAW,UAAAd,EAAS,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC9E;AAAA,EAAA;AAGN;AAEAM,EAAO,cAAc;AACf,MAAAgB,KAAgBC,EAA6BjB,CAAM;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
1
|
+
{"version":3,"file":"switch.component-y47DAbCX.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, unstyled, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [!unstyled ? styles.indicator : void 0, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { useMemo } from 'react';\nimport { Switch as CSwitch } from '@chakra-ui/react/switch';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport interface SwitchProps extends WithFormControlProps, Omit<CSwitch.RootProps, 'label' | 'onChange'> {\n /**\n * If true, the switch will be indeterminate. This only affects the switch visually and does not modify the checked property.\n * @default false\n */\n indeterminate?: boolean;\n /** Ref to the switch component. */\n rootRef?: React.Ref<HTMLLabelElement | null>;\n /**\n * Size of the switch.\n * @default md\n */\n size?: FormControlSize;\n /** Ref to the hiddeninput element. */\n switchRef?: React.Ref<HTMLInputElement | null>;\n /**\n * Data test id for the switch.\n * @default kibble-switch\n */\n 'data-testid'?: string;\n}\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n rootRef,\n size = 'md',\n switchRef,\n ['data-testid']: dataTestId = 'kibble-switch',\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? 'indeterminateOnContrast' : 'indeterminate';\n } else {\n return onContrast ? 'onContrast' : 'default';\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid={dataTestId}\n ref={rootRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput className=\"Switch_Input\" data-testid={`${dataTestId}-input`} ref={switchRef || ref} />\n <CSwitch.Control className=\"Switch_Control\" data-testid={`${dataTestId}-control`} />\n {!!children && <CSwitch.Label data-testid={`${dataTestId}-label`}>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\nconst WrappedSwitch = withFormControl<SwitchProps>(Switch);\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","unstyled","rest","chakra","dataAttr","Switch.HiddenInput","Switch","React","indeterminate","onContrast","label","rootRef","size","switchRef","dataTestId","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","withFormControl"],"mappings":";;;;;;;;;;AAGA,MAAM,CAACA,GAAgBC,CAAgB,IAAIC,EAAc;AAAA,EACvD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAChB,CAAC,GCAKC,IAAgBC,EAAW,CAACC,GAAOC,MAAQ;AAC/C,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,gBAAe,GAAIF,CAAK;AACrE,SAAuBK,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAF,GAAK;AAC9D,CAAC;AACDH,EAAc,cAAc;ACJ5B,MAAMS,IAAoBR,EAAW,CAACC,GAAOC,MAAQ;AACnD,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,oBAAmB,GAAIF,CAAK,GACnEQ,IAAQC,EAAiB;AAC/B,SAAuBJ,gBAAAA,EAAG,IAACC,EAAI,OAAO,EAAE,oBAAoBE,GAAO,iBAAiB,GAAGL,GAAa,KAAAF,GAAK;AAC3G,CAAC;AACDM,EAAkB,cAAc;ACPhC,MAAMG,IAAcX,EAAW,CAACC,GAAOC,MAAQ;AAC7C,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,cAAa,GAAIF,CAAK;AACnE,SAAuBK,gBAAAA,E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wD,GAAA,EAAoB,WAAU,gBAAe,eAAa,GAAGL,CAAU,UAAU,KAAKD,KAAatD,EAAK,CAAA;AAAA,UACzGI,gBAAAA,MAACyD,GAAA,EAAgB,WAAU,kBAAiB,eAAa,GAAGN,CAAU,YAAY;AAAA,UACjF,CAAC,CAACd,KAAarC,gBAAAA,EAAA,IAAA0D,GAAA,EAAc,eAAa,GAAGP,CAAU,UAAW,UAAAd,EAAS,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC9E;AAAA,EAAA;AAGN;AAEAM,EAAO,cAAc;AACf,MAAAgB,KAAgBC,EAA6BjB,CAAM;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const u=require("./jsx-runtime-BjDatQAs.js"),w=require("./icon.component-B1hr5lLa.js"),H=require("./notificationCounter.component-DJpUXeXm.js"),X=require("./heading.component-DMAQO_-m.js"),K=require("./create-slot-recipe-context-HXE1VazG.js"),b=require("react"),l=require("./use-locale-context-ym21RUxU.js"),y=require("./render-strategy-kPh1pd2U.js"),n=require("./index-CQURjLlA.js"),F=require("./index-Ts8g8jZd.js");function z(e,t){const[r,a]=b.useState(e);return b.useEffect(()=>{const o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const[N,A]=l.createContext({name:"TabsContext",hookName:"useTabsContext",providerName:"<TabsProvider />"}),L=b.forwardRef((e,t)=>{const[r,a]=l.createSplitProps()(e,["value"]),o=A(),s=y.useRenderStrategyPropsContext(),i=F.usePresence({...s,present:z(o.value===e.value,0),immediate:!0}),d=n.mergeProps(o.getContentProps(r),i.getPresenceProps(),a);return u.jsxRuntimeExports.jsx(F.PresenceProvider,{value:i,children:i.unmounted?null:u.jsxRuntimeExports.jsx(l.ark.div,{...d,ref:l.composeRefs(i.ref,t)})})});L.displayName="TabContent";const O=b.forwardRef((e,t)=>{const r=A(),a=n.mergeProps(r.getIndicatorProps(),e);return u.jsxRuntimeExports.jsx(l.ark.div,{...a,ref:t})});O.displayName="TabIndicator";const $=b.forwardRef((e,t)=>{const r=A(),a=n.mergeProps(r.getListProps(),e);return u.jsxRuntimeExports.jsx(l.ark.div,{...a,ref:t})});$.displayName="TabList";const B=b.forwardRef((e,t)=>{const[r,a]=l.createSplitProps()(e,["disabled","value"]),o=A(),s=n.mergeProps(o.getTriggerProps(r),a);return u.jsxRuntimeExports.jsx(l.ark.button,{...s,ref:t})});B.displayName="TabTrigger";var Y=n.createAnatomy("tabs").parts("root","list","trigger","content","indicator"),R=Y.build(),G=e=>e.ids?.root??`tabs:${e.id}`,x=e=>e.ids?.list??`tabs:${e.id}:list`,I=(e,t)=>e.ids?.content??`tabs:${e.id}:content-${t}`,m=(e,t)=>e.ids?.trigger??`tabs:${e.id}:trigger-${t}`,k=e=>e.ids?.indicator??`tabs:${e.id}:indicator`,J=e=>e.getById(x(e)),Q=(e,t)=>e.getById(I(e,t)),V=(e,t)=>e.getById(m(e,t)),S=e=>e.getById(k(e)),P=e=>{const r=`[role=tab][data-ownedby='${CSS.escape(x(e))}']:not([disabled])`;return n.queryAll(J(e),r)},Z=e=>n.first(P(e)),ee=e=>n.last(P(e)),te=(e,t)=>n.nextById(P(e),m(e,t.value),t.loopFocus),ae=(e,t)=>n.prevById(P(e),m(e,t.value),t.loopFocus),D=e=>({left:e?.offsetLeft??0,top:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),re=(e,t)=>{const r=n.itemById(P(e),m(e,t));return U(D(r))},U=e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`});function se(e,t){const{state:r,send:a,context:o,prop:s,scope:i}=e,d=s("translations"),f=r.matches("focused"),h=s("orientation")==="vertical",C=s("orientation")==="horizontal",j=s("composite");function _(c){return{selected:o.get("value")===c.value,focused:o.get("focusedValue")===c.value,disabled:!!c.disabled}}return{value:o.get("value"),focusedValue:o.get("focusedValue"),setValue(c){a({type:"SET_VALUE",value:c})},clearValue(){a({type:"CLEAR_VALUE"})},setIndicatorRect(c){const g=m(i,c);a({type:"SET_INDICATOR_RECT",id:g})},syncTabIndex(){a({type:"SYNC_TAB_INDEX"})},selectNext(c){a({type:"TAB_FOCUS",value:c,src:"selectNext"}),a({type:"ARROW_NEXT",src:"selectNext"})},selectPrev(c){a({type:"TAB_FOCUS",value:c,src:"selectPrev"}),a({type:"ARROW_PREV",src:"selectPrev"})},focus(){const c=o.get("value");c&&V(i,c)?.focus()},getRootProps(){return t.element({...R.root.attrs,id:G(i),"data-orientation":s("orientation"),"data-focus":n.dataAttr(f),dir:s("dir")})},getListProps(){return t.element({...R.list.attrs,id:x(i),role:"tablist",dir:s("dir"),"data-focus":n.dataAttr(f),"aria-orientation":s("orientation"),"data-orientation":s("orientation"),"aria-label":d?.listLabel,onKeyDown(c){if(c.defaultPrevented||!n.isSelfTarget(c)||n.isComposingEvent(c))return;const g={ArrowDown(){C||a({type:"ARROW_NEXT",key:"ArrowDown"})},ArrowUp(){C||a({type:"ARROW_PREV",key:"ArrowUp"})},ArrowLeft(){h||a({type:"ARROW_PREV",key:"ArrowLeft"})},ArrowRight(){h||a({type:"ARROW_NEXT",key:"ArrowRight"})},Home(){a({type:"HOME"})},End(){a({type:"END"})}};let p=n.getEventKey(c,{dir:s("dir"),orientation:s("orientation")});const v=g[p];if(v){c.preventDefault(),v(c);return}}})},getTriggerState:_,getTriggerProps(c){const{value:g,disabled:p}=c,v=_(c);return t.button({...R.trigger.attrs,role:"tab",type:"button",disabled:p,dir:s("dir"),"data-orientation":s("orientation"),"data-disabled":n.dataAttr(p),"aria-disabled":p,"data-value":g,"aria-selected":v.selected,"data-selected":n.dataAttr(v.selected),"data-focus":n.dataAttr(v.focused),"aria-controls":v.selected?I(i,g):void 0,"data-ownedby":x(i),"data-ssr":n.dataAttr(o.get("ssr")),id:m(i,g),tabIndex:v.selected&&j?0:-1,onFocus(){a({type:"TAB_FOCUS",value:g})},onBlur(T){T.relatedTarget?.getAttribute("role")!=="tab"&&a({type:"TAB_BLUR"})},onClick(T){T.defaultPrevented||n.isOpeningInNewTab(T)||p||(n.isSafari()&&T.currentTarget.focus(),a({type:"TAB_CLICK",value:g}))}})},getContentProps(c){const{value:g}=c,p=o.get("value")===g;return t.element({...R.content.attrs,dir:s("dir"),id:I(i,g),tabIndex:j?0:-1,"aria-labelledby":m(i,g),role:"tabpanel","data-ownedby":x(i),"data-selected":n.dataAttr(p),"data-orientation":s("orientation"),hidden:!p})},getIndicatorProps(){const c=o.get("indicatorRect"),g=o.get("indicatorTransition");return t.element({id:k(i),...R.indicator.attrs,dir:s("dir"),"data-orientation":s("orientation"),style:{"--transition-property":"left, right, top, bottom, width, height","--left":c.left,"--top":c.top,"--width":c.width,"--height":c.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:g?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[C?"left":"top"]:C?"var(--left)":"var(--top)"}})}}}var{createMachine:oe}=n.setup(),ne=oe({props({props:e}){return{dir:"ltr",orientation:"horizontal",activationMode:"automatic",loopFocus:!0,composite:!0,navigate(t){n.clickIfLink(t.node)},defaultValue:null,...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(r){e("onValueChange")?.({value:r})}})),focusedValue:t(()=>({defaultValue:e("value")||e("defaultValue"),sync:!0,onChange(r){e("onFocusChange")?.({focusedValue:r})}})),ssr:t(()=>({defaultValue:!0})),indicatorTransition:t(()=>({defaultValue:!1})),indicatorRect:t(()=>({defaultValue:{left:"0px",top:"0px",width:"0px",height:"0px"}}))}},watch({context:e,prop:t,track:r,action:a}){r([()=>e.get("value")],()=>{a(["allowIndicatorTransition","syncIndicatorRect","syncTabIndex","navigateIfNeeded"])}),r([()=>t("dir"),()=>t("orientation")],()=>{a(["syncIndicatorRect"])})},on:{SET_VALUE:{actions:["setValue"]},CLEAR_VALUE:{actions:["clearValue"]},SET_INDICATOR_RECT:{actions:["setIndicatorRect"]},SYNC_TAB_INDEX:{actions:["syncTabIndex"]}},entry:["syncIndicatorRect","syncTabIndex","syncSsr"],exit:["cleanupObserver"],states:{idle:{on:{TAB_FOCUS:{target:"focused",actions:["setFocusedValue"]},TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]}}},focused:{on:{TAB_CLICK:{actions:["setFocusedValue","setValue"]},ARROW_PREV:[{guard:"selectOnFocus",actions:["focusPrevTab","selectFocusedTab"]},{actions:["focusPrevTab"]}],ARROW_NEXT:[{guard:"selectOnFocus",actions:["focusNextTab","selectFocusedTab"]},{actions:["focusNextTab"]}],HOME:[{guard:"selectOnFocus",actions:["focusFirstTab","selectFocusedTab"]},{actions:["focusFirstTab"]}],END:[{guard:"selectOnFocus",actions:["focusLastTab","selectFocusedTab"]},{actions:["focusLastTab"]}],TAB_FOCUS:{actions:["setFocusedValue"]},TAB_BLUR:{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e("activationMode")==="automatic"},actions:{selectFocusedTab({context:e,prop:t}){n.raf(()=>{const r=e.get("focusedValue");if(!r)return;const o=t("deselectable")&&e.get("value")===r?null:r;e.set("value",o)})},setFocusedValue({context:e,event:t,flush:r}){t.value!=null&&r(()=>{e.set("focusedValue",t.value)})},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t,prop:r}){const a=r("deselectable")&&e.get("value")===e.get("focusedValue");e.set("value",a?null:t.value)},clearValue({context:e}){e.set("value",null)},focusFirstTab({scope:e}){n.raf(()=>{Z(e)?.focus()})},focusLastTab({scope:e}){n.raf(()=>{ee(e)?.focus()})},focusNextTab({context:e,prop:t,scope:r,event:a}){const o=a.value??e.get("focusedValue");if(!o)return;const s=te(r,{value:o,loopFocus:t("loopFocus")});n.raf(()=>{t("composite")?s?.focus():s?.dataset.value!=null&&e.set("focusedValue",s.dataset.value)})},focusPrevTab({context:e,prop:t,scope:r,event:a}){const o=a.value??e.get("focusedValue");if(!o)return;const s=ae(r,{value:o,loopFocus:t("loopFocus")});n.raf(()=>{t("composite")?s?.focus():s?.dataset.value!=null&&e.set("focusedValue",s.dataset.value)})},syncTabIndex({context:e,scope:t}){n.raf(()=>{const r=e.get("value");if(!r)return;const a=Q(t,r);if(!a)return;n.getFocusables(a).length>0?a.removeAttribute("tabindex"):a.setAttribute("tabindex","0")})},cleanupObserver({refs:e}){const t=e.get("indicatorCleanup");t&&t()},allowIndicatorTransition({context:e}){e.set("indicatorTransition",!0)},setIndicatorRect({context:e,event:t,scope:r}){const a=t.id??e.get("value");if(!S(r))return;if(!a){e.set("indicatorTransition",!1);return}V(r,a)&&(e.set("indicatorRect",re(r,a)),n.nextTick(()=>{e.set("indicatorTransition",!1)}))},syncSsr({context:e}){e.set("ssr",!1)},syncIndicatorRect({context:e,refs:t,scope:r}){const a=t.get("indicatorCleanup");a&&a();const o=e.get("value");if(!o){e.set("indicatorTransition",!1);return}const s=V(r,o),i=S(r);if(!s||!i)return;const d=n.trackElementRect([s],{measure(f){return D(f)},onEntry({rects:f}){const[h]=f;e.set("indicatorRect",U(h))}});t.set("indicatorCleanup",d)},navigateIfNeeded({context:e,prop:t,scope:r}){const a=e.get("value");if(!a)return;const o=V(r,a);n.isAnchorElement(o)&&t("navigate")?.({value:a,node:o,href:o.href})}}}});l.createProps()(["activationMode","composite","deselectable","dir","getRootNode","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value","defaultValue"]);l.createProps()(["disabled","value"]);l.createProps()(["value"]);const ie=e=>{const t=b.useId(),{getRootNode:r}=l.useEnvironmentContext(),{dir:a}=l.useLocaleContext(),o={id:t,dir:a,getRootNode:r,...e},s=l.useMachine(ne,o);return se(s,l.normalizeProps)},q=b.forwardRef((e,t)=>{const[r,a]=y.splitRenderStrategyProps(e),[o,s]=l.createSplitProps()(a,["activationMode","composite","defaultValue","deselectable","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]),i=ie(o),d=n.mergeProps(i.getRootProps(),s);return u.jsxRuntimeExports.jsx(N,{value:i,children:u.jsxRuntimeExports.jsx(y.RenderStrategyPropsProvider,{value:r,children:u.jsxRuntimeExports.jsx(l.ark.div,{...d,ref:t})})})});q.displayName="TabsRoot";const W=b.forwardRef((e,t)=>{const[r,a]=y.splitRenderStrategyProps(e),[{value:o},s]=l.createSplitProps()(a,["value"]),i=n.mergeProps(o.getRootProps(),s);return u.jsxRuntimeExports.jsx(N,{value:o,children:u.jsxRuntimeExports.jsx(y.RenderStrategyPropsProvider,{value:r,children:u.jsxRuntimeExports.jsx(l.ark.div,{...i,ref:t})})})});W.displayName="TabsRootProvider";const{withProvider:M,withContext:E}=K.createSlotRecipeContext({key:"tabs"});M(W,"root",{forwardAsChild:!0});const ce=M(q,"root",{forwardAsChild:!0}),ue=E(B,"trigger",{forwardAsChild:!0}),le=E(L,"content",{forwardAsChild:!0});E("div","contentGroup");const de=E($,"list",{forwardAsChild:!0});E(O,"indicator",{forwardAsChild:!0});const ge={xs:"sm",sm:"md",md:"md",lg:"lg"},fe={xs:"xs",sm:"xs",md:"sm",lg:"md"},pe=({iconName:e,iconPosition:t="left",label:r,notificationCounterProps:a,showNotificationCounter:o,size:s="md",["data-testid"]:i="kibble-tab",...d})=>u.jsxRuntimeExports.jsxs(ue,{className:"Tab","data-testid":i,...d,children:[!!e&&t==="left"&&u.jsxRuntimeExports.jsx(w.Icon,{className:"Tab__Icon","data-testid":`${i}-icon-left`,name:e,size:s,variant:"default"}),u.jsxRuntimeExports.jsx(X.WrappedHeading,{className:"Tab__Label","data-testid":`${i}-label`,size:fe[s],children:r}),!!e&&t==="right"&&u.jsxRuntimeExports.jsx(w.Icon,{className:"Tab__Icon","data-testid":`${i}-icon-right`,name:e,size:s}),o&&u.jsxRuntimeExports.jsx(H.NotificationCounter,{className:"Tab__NotificationCounter","data-testid":`${i}-notification-counter`,...a,size:ge[s]})]}),be=({align:e="start",onChange:t,size:r="md",tabs:a,tabsContent:o,["data-testid"]:s="kibble-tabs",...i})=>u.jsxRuntimeExports.jsxs(ce,{className:"Tabs","data-testid":s,justify:e||i.justify,size:r,onValueChange:({value:d})=>t?.(d),...i,children:[u.jsxRuntimeExports.jsx(de,{className:"Tabs__List","data-testid":`${s}-trigger-list`,children:a.map((d,f)=>u.jsxRuntimeExports.jsx(pe,{...d,"data-testid":`${s}-trigger-${d.value}`,size:r},`tab-${f}`))}),!!o&&o.map((d,f)=>u.jsxRuntimeExports.jsx(le,{"data-testid":`${s}-content-${a[f].value}`,...d},`${s}-tabContent-${f}`))]}),ve=["xs","sm","md","lg"],me=["left","right"];exports.Tabs=be;exports.tabIconPositions=me;exports.tabSizes=ve;
|
|
2
|
-
//# sourceMappingURL=tab.types-
|
|
1
|
+
"use strict";const u=require("./jsx-runtime-BjDatQAs.js"),w=require("./icon.component-B1hr5lLa.js"),H=require("./notificationCounter.component-CBwi5vXa.js"),X=require("./heading.component-DnoZOXdz.js"),K=require("./create-slot-recipe-context-HXE1VazG.js"),b=require("react"),l=require("./use-locale-context-ym21RUxU.js"),y=require("./render-strategy-kPh1pd2U.js"),n=require("./index-CQURjLlA.js"),F=require("./index-Ts8g8jZd.js");function z(e,t){const[r,a]=b.useState(e);return b.useEffect(()=>{const o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const[N,A]=l.createContext({name:"TabsContext",hookName:"useTabsContext",providerName:"<TabsProvider />"}),L=b.forwardRef((e,t)=>{const[r,a]=l.createSplitProps()(e,["value"]),o=A(),s=y.useRenderStrategyPropsContext(),i=F.usePresence({...s,present:z(o.value===e.value,0),immediate:!0}),d=n.mergeProps(o.getContentProps(r),i.getPresenceProps(),a);return u.jsxRuntimeExports.jsx(F.PresenceProvider,{value:i,children:i.unmounted?null:u.jsxRuntimeExports.jsx(l.ark.div,{...d,ref:l.composeRefs(i.ref,t)})})});L.displayName="TabContent";const O=b.forwardRef((e,t)=>{const r=A(),a=n.mergeProps(r.getIndicatorProps(),e);return u.jsxRuntimeExports.jsx(l.ark.div,{...a,ref:t})});O.displayName="TabIndicator";const $=b.forwardRef((e,t)=>{const r=A(),a=n.mergeProps(r.getListProps(),e);return u.jsxRuntimeExports.jsx(l.ark.div,{...a,ref:t})});$.displayName="TabList";const B=b.forwardRef((e,t)=>{const[r,a]=l.createSplitProps()(e,["disabled","value"]),o=A(),s=n.mergeProps(o.getTriggerProps(r),a);return u.jsxRuntimeExports.jsx(l.ark.button,{...s,ref:t})});B.displayName="TabTrigger";var Y=n.createAnatomy("tabs").parts("root","list","trigger","content","indicator"),R=Y.build(),G=e=>e.ids?.root??`tabs:${e.id}`,x=e=>e.ids?.list??`tabs:${e.id}:list`,I=(e,t)=>e.ids?.content??`tabs:${e.id}:content-${t}`,m=(e,t)=>e.ids?.trigger??`tabs:${e.id}:trigger-${t}`,k=e=>e.ids?.indicator??`tabs:${e.id}:indicator`,J=e=>e.getById(x(e)),Q=(e,t)=>e.getById(I(e,t)),V=(e,t)=>e.getById(m(e,t)),S=e=>e.getById(k(e)),P=e=>{const r=`[role=tab][data-ownedby='${CSS.escape(x(e))}']:not([disabled])`;return n.queryAll(J(e),r)},Z=e=>n.first(P(e)),ee=e=>n.last(P(e)),te=(e,t)=>n.nextById(P(e),m(e,t.value),t.loopFocus),ae=(e,t)=>n.prevById(P(e),m(e,t.value),t.loopFocus),D=e=>({left:e?.offsetLeft??0,top:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),re=(e,t)=>{const r=n.itemById(P(e),m(e,t));return U(D(r))},U=e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`});function se(e,t){const{state:r,send:a,context:o,prop:s,scope:i}=e,d=s("translations"),f=r.matches("focused"),h=s("orientation")==="vertical",C=s("orientation")==="horizontal",j=s("composite");function _(c){return{selected:o.get("value")===c.value,focused:o.get("focusedValue")===c.value,disabled:!!c.disabled}}return{value:o.get("value"),focusedValue:o.get("focusedValue"),setValue(c){a({type:"SET_VALUE",value:c})},clearValue(){a({type:"CLEAR_VALUE"})},setIndicatorRect(c){const g=m(i,c);a({type:"SET_INDICATOR_RECT",id:g})},syncTabIndex(){a({type:"SYNC_TAB_INDEX"})},selectNext(c){a({type:"TAB_FOCUS",value:c,src:"selectNext"}),a({type:"ARROW_NEXT",src:"selectNext"})},selectPrev(c){a({type:"TAB_FOCUS",value:c,src:"selectPrev"}),a({type:"ARROW_PREV",src:"selectPrev"})},focus(){const c=o.get("value");c&&V(i,c)?.focus()},getRootProps(){return t.element({...R.root.attrs,id:G(i),"data-orientation":s("orientation"),"data-focus":n.dataAttr(f),dir:s("dir")})},getListProps(){return t.element({...R.list.attrs,id:x(i),role:"tablist",dir:s("dir"),"data-focus":n.dataAttr(f),"aria-orientation":s("orientation"),"data-orientation":s("orientation"),"aria-label":d?.listLabel,onKeyDown(c){if(c.defaultPrevented||!n.isSelfTarget(c)||n.isComposingEvent(c))return;const g={ArrowDown(){C||a({type:"ARROW_NEXT",key:"ArrowDown"})},ArrowUp(){C||a({type:"ARROW_PREV",key:"ArrowUp"})},ArrowLeft(){h||a({type:"ARROW_PREV",key:"ArrowLeft"})},ArrowRight(){h||a({type:"ARROW_NEXT",key:"ArrowRight"})},Home(){a({type:"HOME"})},End(){a({type:"END"})}};let p=n.getEventKey(c,{dir:s("dir"),orientation:s("orientation")});const v=g[p];if(v){c.preventDefault(),v(c);return}}})},getTriggerState:_,getTriggerProps(c){const{value:g,disabled:p}=c,v=_(c);return t.button({...R.trigger.attrs,role:"tab",type:"button",disabled:p,dir:s("dir"),"data-orientation":s("orientation"),"data-disabled":n.dataAttr(p),"aria-disabled":p,"data-value":g,"aria-selected":v.selected,"data-selected":n.dataAttr(v.selected),"data-focus":n.dataAttr(v.focused),"aria-controls":v.selected?I(i,g):void 0,"data-ownedby":x(i),"data-ssr":n.dataAttr(o.get("ssr")),id:m(i,g),tabIndex:v.selected&&j?0:-1,onFocus(){a({type:"TAB_FOCUS",value:g})},onBlur(T){T.relatedTarget?.getAttribute("role")!=="tab"&&a({type:"TAB_BLUR"})},onClick(T){T.defaultPrevented||n.isOpeningInNewTab(T)||p||(n.isSafari()&&T.currentTarget.focus(),a({type:"TAB_CLICK",value:g}))}})},getContentProps(c){const{value:g}=c,p=o.get("value")===g;return t.element({...R.content.attrs,dir:s("dir"),id:I(i,g),tabIndex:j?0:-1,"aria-labelledby":m(i,g),role:"tabpanel","data-ownedby":x(i),"data-selected":n.dataAttr(p),"data-orientation":s("orientation"),hidden:!p})},getIndicatorProps(){const c=o.get("indicatorRect"),g=o.get("indicatorTransition");return t.element({id:k(i),...R.indicator.attrs,dir:s("dir"),"data-orientation":s("orientation"),style:{"--transition-property":"left, right, top, bottom, width, height","--left":c.left,"--top":c.top,"--width":c.width,"--height":c.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:g?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[C?"left":"top"]:C?"var(--left)":"var(--top)"}})}}}var{createMachine:oe}=n.setup(),ne=oe({props({props:e}){return{dir:"ltr",orientation:"horizontal",activationMode:"automatic",loopFocus:!0,composite:!0,navigate(t){n.clickIfLink(t.node)},defaultValue:null,...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(r){e("onValueChange")?.({value:r})}})),focusedValue:t(()=>({defaultValue:e("value")||e("defaultValue"),sync:!0,onChange(r){e("onFocusChange")?.({focusedValue:r})}})),ssr:t(()=>({defaultValue:!0})),indicatorTransition:t(()=>({defaultValue:!1})),indicatorRect:t(()=>({defaultValue:{left:"0px",top:"0px",width:"0px",height:"0px"}}))}},watch({context:e,prop:t,track:r,action:a}){r([()=>e.get("value")],()=>{a(["allowIndicatorTransition","syncIndicatorRect","syncTabIndex","navigateIfNeeded"])}),r([()=>t("dir"),()=>t("orientation")],()=>{a(["syncIndicatorRect"])})},on:{SET_VALUE:{actions:["setValue"]},CLEAR_VALUE:{actions:["clearValue"]},SET_INDICATOR_RECT:{actions:["setIndicatorRect"]},SYNC_TAB_INDEX:{actions:["syncTabIndex"]}},entry:["syncIndicatorRect","syncTabIndex","syncSsr"],exit:["cleanupObserver"],states:{idle:{on:{TAB_FOCUS:{target:"focused",actions:["setFocusedValue"]},TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]}}},focused:{on:{TAB_CLICK:{actions:["setFocusedValue","setValue"]},ARROW_PREV:[{guard:"selectOnFocus",actions:["focusPrevTab","selectFocusedTab"]},{actions:["focusPrevTab"]}],ARROW_NEXT:[{guard:"selectOnFocus",actions:["focusNextTab","selectFocusedTab"]},{actions:["focusNextTab"]}],HOME:[{guard:"selectOnFocus",actions:["focusFirstTab","selectFocusedTab"]},{actions:["focusFirstTab"]}],END:[{guard:"selectOnFocus",actions:["focusLastTab","selectFocusedTab"]},{actions:["focusLastTab"]}],TAB_FOCUS:{actions:["setFocusedValue"]},TAB_BLUR:{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e("activationMode")==="automatic"},actions:{selectFocusedTab({context:e,prop:t}){n.raf(()=>{const r=e.get("focusedValue");if(!r)return;const o=t("deselectable")&&e.get("value")===r?null:r;e.set("value",o)})},setFocusedValue({context:e,event:t,flush:r}){t.value!=null&&r(()=>{e.set("focusedValue",t.value)})},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t,prop:r}){const a=r("deselectable")&&e.get("value")===e.get("focusedValue");e.set("value",a?null:t.value)},clearValue({context:e}){e.set("value",null)},focusFirstTab({scope:e}){n.raf(()=>{Z(e)?.focus()})},focusLastTab({scope:e}){n.raf(()=>{ee(e)?.focus()})},focusNextTab({context:e,prop:t,scope:r,event:a}){const o=a.value??e.get("focusedValue");if(!o)return;const s=te(r,{value:o,loopFocus:t("loopFocus")});n.raf(()=>{t("composite")?s?.focus():s?.dataset.value!=null&&e.set("focusedValue",s.dataset.value)})},focusPrevTab({context:e,prop:t,scope:r,event:a}){const o=a.value??e.get("focusedValue");if(!o)return;const s=ae(r,{value:o,loopFocus:t("loopFocus")});n.raf(()=>{t("composite")?s?.focus():s?.dataset.value!=null&&e.set("focusedValue",s.dataset.value)})},syncTabIndex({context:e,scope:t}){n.raf(()=>{const r=e.get("value");if(!r)return;const a=Q(t,r);if(!a)return;n.getFocusables(a).length>0?a.removeAttribute("tabindex"):a.setAttribute("tabindex","0")})},cleanupObserver({refs:e}){const t=e.get("indicatorCleanup");t&&t()},allowIndicatorTransition({context:e}){e.set("indicatorTransition",!0)},setIndicatorRect({context:e,event:t,scope:r}){const a=t.id??e.get("value");if(!S(r))return;if(!a){e.set("indicatorTransition",!1);return}V(r,a)&&(e.set("indicatorRect",re(r,a)),n.nextTick(()=>{e.set("indicatorTransition",!1)}))},syncSsr({context:e}){e.set("ssr",!1)},syncIndicatorRect({context:e,refs:t,scope:r}){const a=t.get("indicatorCleanup");a&&a();const o=e.get("value");if(!o){e.set("indicatorTransition",!1);return}const s=V(r,o),i=S(r);if(!s||!i)return;const d=n.trackElementRect([s],{measure(f){return D(f)},onEntry({rects:f}){const[h]=f;e.set("indicatorRect",U(h))}});t.set("indicatorCleanup",d)},navigateIfNeeded({context:e,prop:t,scope:r}){const a=e.get("value");if(!a)return;const o=V(r,a);n.isAnchorElement(o)&&t("navigate")?.({value:a,node:o,href:o.href})}}}});l.createProps()(["activationMode","composite","deselectable","dir","getRootNode","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value","defaultValue"]);l.createProps()(["disabled","value"]);l.createProps()(["value"]);const ie=e=>{const t=b.useId(),{getRootNode:r}=l.useEnvironmentContext(),{dir:a}=l.useLocaleContext(),o={id:t,dir:a,getRootNode:r,...e},s=l.useMachine(ne,o);return se(s,l.normalizeProps)},q=b.forwardRef((e,t)=>{const[r,a]=y.splitRenderStrategyProps(e),[o,s]=l.createSplitProps()(a,["activationMode","composite","defaultValue","deselectable","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]),i=ie(o),d=n.mergeProps(i.getRootProps(),s);return u.jsxRuntimeExports.jsx(N,{value:i,children:u.jsxRuntimeExports.jsx(y.RenderStrategyPropsProvider,{value:r,children:u.jsxRuntimeExports.jsx(l.ark.div,{...d,ref:t})})})});q.displayName="TabsRoot";const W=b.forwardRef((e,t)=>{const[r,a]=y.splitRenderStrategyProps(e),[{value:o},s]=l.createSplitProps()(a,["value"]),i=n.mergeProps(o.getRootProps(),s);return u.jsxRuntimeExports.jsx(N,{value:o,children:u.jsxRuntimeExports.jsx(y.RenderStrategyPropsProvider,{value:r,children:u.jsxRuntimeExports.jsx(l.ark.div,{...i,ref:t})})})});W.displayName="TabsRootProvider";const{withProvider:M,withContext:E}=K.createSlotRecipeContext({key:"tabs"});M(W,"root",{forwardAsChild:!0});const ce=M(q,"root",{forwardAsChild:!0}),ue=E(B,"trigger",{forwardAsChild:!0}),le=E(L,"content",{forwardAsChild:!0});E("div","contentGroup");const de=E($,"list",{forwardAsChild:!0});E(O,"indicator",{forwardAsChild:!0});const ge={xs:"sm",sm:"md",md:"md",lg:"lg"},fe={xs:"xs",sm:"xs",md:"sm",lg:"md"},pe=({iconName:e,iconPosition:t="left",label:r,notificationCounterProps:a,showNotificationCounter:o,size:s="md",["data-testid"]:i="kibble-tab",...d})=>u.jsxRuntimeExports.jsxs(ue,{className:"Tab","data-testid":i,...d,children:[!!e&&t==="left"&&u.jsxRuntimeExports.jsx(w.Icon,{className:"Tab__Icon","data-testid":`${i}-icon-left`,name:e,size:s,variant:"default"}),u.jsxRuntimeExports.jsx(X.WrappedHeading,{className:"Tab__Label","data-testid":`${i}-label`,size:fe[s],children:r}),!!e&&t==="right"&&u.jsxRuntimeExports.jsx(w.Icon,{className:"Tab__Icon","data-testid":`${i}-icon-right`,name:e,size:s}),o&&u.jsxRuntimeExports.jsx(H.NotificationCounter,{className:"Tab__NotificationCounter","data-testid":`${i}-notification-counter`,...a,size:ge[s]})]}),be=({align:e="start",onChange:t,size:r="md",tabs:a,tabsContent:o,["data-testid"]:s="kibble-tabs",...i})=>u.jsxRuntimeExports.jsxs(ce,{className:"Tabs","data-testid":s,justify:e||i.justify,size:r,onValueChange:({value:d})=>t?.(d),...i,children:[u.jsxRuntimeExports.jsx(de,{className:"Tabs__List","data-testid":`${s}-trigger-list`,children:a.map((d,f)=>u.jsxRuntimeExports.jsx(pe,{...d,"data-testid":`${s}-trigger-${d.value}`,size:r},`tab-${f}`))}),!!o&&o.map((d,f)=>u.jsxRuntimeExports.jsx(le,{"data-testid":`${s}-content-${a[f].value}`,...d},`${s}-tabContent-${f}`))]}),ve=["xs","sm","md","lg"],me=["left","right"];exports.Tabs=be;exports.tabIconPositions=me;exports.tabSizes=ve;
|
|
2
|
+
//# sourceMappingURL=tab.types-BWtosyjE.js.map
|