@televet/kibble-ui 4.0.0-beta.79 → 4.0.0-beta.80
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-D-3T1zMb.js → alert.types-Bxrz2UAB.js} +3 -3
- package/dist/chunks/{alert.types-D-3T1zMb.js.map → alert.types-Bxrz2UAB.js.map} +1 -1
- package/dist/chunks/{alert.types-Fkq1_E-3.js → alert.types-Dl6ivTll.js} +2 -2
- package/dist/chunks/{alert.types-Fkq1_E-3.js.map → alert.types-Dl6ivTll.js.map} +1 -1
- package/dist/chunks/avatar.component-BdkTgslj.js +2 -0
- package/dist/chunks/{avatar.component-C9kUiMY7.js.map → avatar.component-BdkTgslj.js.map} +1 -1
- package/dist/chunks/{avatar.component-DFefIlUE.js → avatar.component-DPu-22kf.js} +2 -2
- package/dist/chunks/{avatar.component-DFefIlUE.js.map → avatar.component-DPu-22kf.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-D4H3sKfb.js → avatarGroup.component-BW26RkqL.js} +2 -2
- package/dist/chunks/{avatarGroup.component-D4H3sKfb.js.map → avatarGroup.component-BW26RkqL.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-B8p1xC3D.js → avatarGroup.component-DHhW8fL3.js} +2 -2
- package/dist/chunks/{avatarGroup.component-B8p1xC3D.js.map → avatarGroup.component-DHhW8fL3.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-CMMVHI4v.js → buttonGroup.component-B3nqpiRU.js} +2 -2
- package/dist/chunks/{buttonGroup.component-CMMVHI4v.js.map → buttonGroup.component-B3nqpiRU.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-BgsjtghM.js → buttonGroup.component-Q7Ul0yrS.js} +2 -2
- package/dist/chunks/{buttonGroup.component-BgsjtghM.js.map → buttonGroup.component-Q7Ul0yrS.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-VT8m1K12.js → characterCounter.component-CNo6Xau3.js} +2 -2
- package/dist/chunks/{characterCounter.component-VT8m1K12.js.map → characterCounter.component-CNo6Xau3.js.map} +1 -1
- package/dist/chunks/{characterCounter.component-Da1W5Crn.js → characterCounter.component-D1qCNVkb.js} +2 -2
- package/dist/chunks/{characterCounter.component-Da1W5Crn.js.map → characterCounter.component-D1qCNVkb.js.map} +1 -1
- package/dist/chunks/{checkbox.component-AcTeAzVW.js → checkbox.component-CxnOW6Sj.js} +2 -2
- package/dist/chunks/{checkbox.component-AcTeAzVW.js.map → checkbox.component-CxnOW6Sj.js.map} +1 -1
- package/dist/chunks/{checkbox.component-CMFZJnuD.js → checkbox.component-GElI75y2.js} +3 -3
- package/dist/chunks/{checkbox.component-CMFZJnuD.js.map → checkbox.component-GElI75y2.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-BYyZqfgM.js → checkboxGroup.component-CvEAkFlp.js} +3 -3
- package/dist/chunks/{checkboxGroup.component-BYyZqfgM.js.map → checkboxGroup.component-CvEAkFlp.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-BWBTWbaC.js → checkboxGroup.component-Dc39GJV4.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-BWBTWbaC.js.map → checkboxGroup.component-Dc39GJV4.js.map} +1 -1
- package/dist/chunks/conversationCard.component-CHm8X5MK.js +2 -0
- package/dist/chunks/{conversationCard.component-PtZYdnE-.js.map → conversationCard.component-CHm8X5MK.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-wm7Lpbwc.js → conversationCard.component-DnIpQo_a.js} +16 -15
- package/dist/chunks/{conversationCard.component-wm7Lpbwc.js.map → conversationCard.component-DnIpQo_a.js.map} +1 -1
- package/dist/chunks/{datePicker.component-Q4Q7FQwl.js → datePicker.component-52I2TBMS.js} +3 -3
- package/dist/chunks/{datePicker.component-Q4Q7FQwl.js.map → datePicker.component-52I2TBMS.js.map} +1 -1
- package/dist/chunks/{datePicker.component-M71Njnos.js → datePicker.component-BRCI3x7q.js} +4 -4
- package/dist/chunks/{datePicker.component-M71Njnos.js.map → datePicker.component-BRCI3x7q.js.map} +1 -1
- package/dist/chunks/{heading.component-CLeuZRZ3.js → heading.component-C7W_ipcL.js} +2 -2
- package/dist/chunks/{heading.component-CLeuZRZ3.js.map → heading.component-C7W_ipcL.js.map} +1 -1
- package/dist/chunks/{heading.component-C6IbSCCN.js → heading.component-dGH5sXSB.js} +2 -2
- package/dist/chunks/{heading.component-C6IbSCCN.js.map → heading.component-dGH5sXSB.js.map} +1 -1
- package/dist/chunks/{menu.component-BPD9FdbN.js → menu.component-BGGElaYy.js} +2 -2
- package/dist/chunks/{menu.component-BPD9FdbN.js.map → menu.component-BGGElaYy.js.map} +1 -1
- package/dist/chunks/{menu.component-CKdbf8cV.js → menu.component-CFYFhp7-.js} +5 -5
- package/dist/chunks/{menu.component-CKdbf8cV.js.map → menu.component-CFYFhp7-.js.map} +1 -1
- package/dist/chunks/{modal.types-XJffAUHT.js → modal.types-Bpoq1pcb.js} +2 -2
- package/dist/chunks/{modal.types-XJffAUHT.js.map → modal.types-Bpoq1pcb.js.map} +1 -1
- package/dist/chunks/{modal.types-CPdmvcA8.js → modal.types-CUUJVRPN.js} +2 -2
- package/dist/chunks/{modal.types-CPdmvcA8.js.map → modal.types-CUUJVRPN.js.map} +1 -1
- package/dist/chunks/{pinInput.types-DXmtwsDe.js → pinInput.types-DX8ognpo.js} +2 -2
- package/dist/chunks/{pinInput.types-DXmtwsDe.js.map → pinInput.types-DX8ognpo.js.map} +1 -1
- package/dist/chunks/{pinInput.types-BgecOsie.js → pinInput.types-OnwTDVZV.js} +2 -2
- package/dist/chunks/{pinInput.types-BgecOsie.js.map → pinInput.types-OnwTDVZV.js.map} +1 -1
- package/dist/chunks/popover.component-B1TLfpqD.js +2 -0
- package/dist/chunks/{popover.component-XAG_EQKh.js.map → popover.component-B1TLfpqD.js.map} +1 -1
- package/dist/chunks/{popover.component-Dj2hVIcn.js → popover.component-CDGsZ6d_.js} +16 -15
- package/dist/chunks/{popover.component-Dj2hVIcn.js.map → popover.component-CDGsZ6d_.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-CTqkID3v.js → radioGroup.component-C8_NKfl7.js} +2 -2
- package/dist/chunks/{radioGroup.component-CTqkID3v.js.map → radioGroup.component-C8_NKfl7.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-CiVzjo7r.js → radioGroup.component-yIs1Q3VP.js} +4 -4
- package/dist/chunks/{radioGroup.component-CiVzjo7r.js.map → radioGroup.component-yIs1Q3VP.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-B3T-LOsU.js → ratingDots.component-CnCN-czr.js} +3 -3
- package/dist/chunks/{ratingDots.component-B3T-LOsU.js.map → ratingDots.component-CnCN-czr.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-CZQqP6kr.js → ratingDots.component-Dr2p3X9o.js} +2 -2
- package/dist/chunks/{ratingDots.component-CZQqP6kr.js.map → ratingDots.component-Dr2p3X9o.js.map} +1 -1
- package/dist/chunks/{select.component-B-Z8HCfk.js → select.component-DtvSUpfM.js} +5 -5
- package/dist/chunks/{select.component-B-Z8HCfk.js.map → select.component-DtvSUpfM.js.map} +1 -1
- package/dist/chunks/{select.component-83JVgqUh.js → select.component-l3N_dfXw.js} +2 -2
- package/dist/chunks/{select.component-83JVgqUh.js.map → select.component-l3N_dfXw.js.map} +1 -1
- package/dist/chunks/{sortableList.component-DmIXsqZ6.js → sortableList.component-CNysbmV6.js} +2 -2
- package/dist/chunks/{sortableList.component-DmIXsqZ6.js.map → sortableList.component-CNysbmV6.js.map} +1 -1
- package/dist/chunks/{sortableList.component-BezOn6lC.js → sortableList.component-fhJaRd25.js} +3 -3
- package/dist/chunks/{sortableList.component-BezOn6lC.js.map → sortableList.component-fhJaRd25.js.map} +1 -1
- package/dist/chunks/{spinner.component-B8JvK7UJ.js → spinner.component-BJ6rOgt8.js} +2 -2
- package/dist/chunks/{spinner.component-B8JvK7UJ.js.map → spinner.component-BJ6rOgt8.js.map} +1 -1
- package/dist/chunks/{spinner.component-CcGk0iRF.js → spinner.component-oz9gjaVV.js} +2 -2
- package/dist/chunks/{spinner.component-CcGk0iRF.js.map → spinner.component-oz9gjaVV.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-DM3CCeK2.js → styledAvatar.types-BvW6YJrl.js} +2 -2
- package/dist/chunks/{styledAvatar.types-DM3CCeK2.js.map → styledAvatar.types-BvW6YJrl.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-B1L3B7Vt.js → styledAvatar.types-SAw52UC4.js} +2 -2
- package/dist/chunks/{styledAvatar.types-B1L3B7Vt.js.map → styledAvatar.types-SAw52UC4.js.map} +1 -1
- package/dist/chunks/{switch.component-DR2z1VIi.js → switch.component-C1hrMzRm.js} +2 -2
- package/dist/chunks/{switch.component-DR2z1VIi.js.map → switch.component-C1hrMzRm.js.map} +1 -1
- package/dist/chunks/{switch.component-kymnT_3-.js → switch.component-DFQ_b2At.js} +2 -2
- package/dist/chunks/{switch.component-kymnT_3-.js.map → switch.component-DFQ_b2At.js.map} +1 -1
- package/dist/chunks/{tabs.component-CXuIBpFN.js → tabs.component-CI6YyzcT.js} +2 -2
- package/dist/chunks/{tabs.component-CXuIBpFN.js.map → tabs.component-CI6YyzcT.js.map} +1 -1
- package/dist/chunks/{tabs.component-Dsp-LFv8.js → tabs.component-CmBdxZ28.js} +2 -2
- package/dist/chunks/{tabs.component-Dsp-LFv8.js.map → tabs.component-CmBdxZ28.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-Cz_t--RO.js → tagBlock.component-33yx8LBM.js} +5 -5
- package/dist/chunks/{tagBlock.component-Cz_t--RO.js.map → tagBlock.component-33yx8LBM.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-BUeL684f.js → tagBlock.component-p44L1Jc9.js} +2 -2
- package/dist/chunks/{tagBlock.component-BUeL684f.js.map → tagBlock.component-p44L1Jc9.js.map} +1 -1
- package/dist/chunks/text.component-Ck6rZy2v.js +12 -0
- package/dist/chunks/text.component-Ck6rZy2v.js.map +1 -0
- package/dist/chunks/text.component-H5f43IC6.js +2 -0
- package/dist/chunks/text.component-H5f43IC6.js.map +1 -0
- package/dist/chunks/{textInput.component-BNINW1_e.js → textInput.component-CUKklyGx.js} +3 -3
- package/dist/chunks/{textInput.component-BNINW1_e.js.map → textInput.component-CUKklyGx.js.map} +1 -1
- package/dist/chunks/{textInput.component-DgiFzty4.js → textInput.component-Cla6KfBZ.js} +2 -2
- package/dist/chunks/{textInput.component-DgiFzty4.js.map → textInput.component-Cla6KfBZ.js.map} +1 -1
- package/dist/chunks/{textarea.component-Bp58Lx18.js → textarea.component-BcL2jK0X.js} +3 -3
- package/dist/chunks/{textarea.component-Bp58Lx18.js.map → textarea.component-BcL2jK0X.js.map} +1 -1
- package/dist/chunks/{textarea.component-C34ZB5P0.js → textarea.component-XYJZDZmM.js} +2 -2
- package/dist/chunks/{textarea.component-C34ZB5P0.js.map → textarea.component-XYJZDZmM.js.map} +1 -1
- package/dist/chunks/{theme.provider-DBYGq_4U.js → theme.provider-FIFC-_Wf.js} +5 -4
- package/dist/chunks/{theme.provider-DBYGq_4U.js.map → theme.provider-FIFC-_Wf.js.map} +1 -1
- package/dist/chunks/{theme.provider-AWSLFuJr.js → theme.provider-oCz4Rrwj.js} +4 -4
- package/dist/chunks/{theme.provider-AWSLFuJr.js.map → theme.provider-oCz4Rrwj.js.map} +1 -1
- package/dist/chunks/{timePicker.component-D-qQvgQh.js → timePicker.component-CMouXVow.js} +3 -3
- package/dist/chunks/{timePicker.component-D-qQvgQh.js.map → timePicker.component-CMouXVow.js.map} +1 -1
- package/dist/chunks/{timePicker.component-BdTpeepb.js → timePicker.component-ClmXeH3U.js} +2 -2
- package/dist/chunks/{timePicker.component-BdTpeepb.js.map → timePicker.component-ClmXeH3U.js.map} +1 -1
- package/dist/chunks/{timeRange.component-pjEMSbFI.js → timeRange.component-DKkwvibd.js} +2 -2
- package/dist/chunks/{timeRange.component-pjEMSbFI.js.map → timeRange.component-DKkwvibd.js.map} +1 -1
- package/dist/chunks/{timeRange.component-Cz0RyPsh.js → timeRange.component-nrPWV1NY.js} +2 -2
- package/dist/chunks/{timeRange.component-Cz0RyPsh.js.map → timeRange.component-nrPWV1NY.js.map} +1 -1
- package/dist/chunks/timestamp.component-CNzJfora.js +2 -0
- package/dist/chunks/{timestamp.component-AfZBeSJ0.js.map → timestamp.component-CNzJfora.js.map} +1 -1
- package/dist/chunks/timestamp.component-Dtn5KtVA.js +54 -0
- package/dist/chunks/{timestamp.component-DupRVSWm.js.map → timestamp.component-Dtn5KtVA.js.map} +1 -1
- package/dist/chunks/{withTruncation-CIxtQTOw.js → tooltip.component-BdlSO_v_.js} +128 -217
- package/dist/chunks/tooltip.component-BdlSO_v_.js.map +1 -0
- package/dist/chunks/tooltip.component-Dq7F5JIs.js +2 -0
- package/dist/chunks/tooltip.component-Dq7F5JIs.js.map +1 -0
- package/dist/chunks/{withFormControl-CZAP4VgX.js → withFormControl-C8knrDok.js} +2 -2
- package/dist/chunks/{withFormControl-CZAP4VgX.js.map → withFormControl-C8knrDok.js.map} +1 -1
- package/dist/chunks/{withFormControl-8TClG0uv.js → withFormControl-CwPfUb2g.js} +2 -2
- package/dist/chunks/{withFormControl-8TClG0uv.js.map → withFormControl-CwPfUb2g.js.map} +1 -1
- package/dist/chunks/withTruncation-C_btJ8Nx.js +2 -0
- package/dist/chunks/withTruncation-C_btJ8Nx.js.map +1 -0
- package/dist/chunks/withTruncation-D6letsku.js +67 -0
- package/dist/chunks/withTruncation-D6letsku.js.map +1 -0
- package/dist/cjs/components/Alert/index.cjs +1 -1
- package/dist/cjs/components/Avatar/index.cjs +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/CharacterCounter/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/index.cjs +1 -1
- package/dist/cjs/components/CheckboxGroup/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/Heading/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/Modal/index.cjs +1 -1
- package/dist/cjs/components/PinInput/index.cjs +1 -1
- package/dist/cjs/components/Popover/index.cjs +1 -1
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/RatingDots/index.cjs +1 -1
- package/dist/cjs/components/Select/index.cjs +1 -1
- package/dist/cjs/components/SortableList/index.cjs +1 -1
- package/dist/cjs/components/Spinner/index.cjs +1 -1
- package/dist/cjs/components/StyledAvatar/index.cjs +1 -1
- package/dist/cjs/components/Switch/index.cjs +1 -1
- package/dist/cjs/components/Tabs/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/Text/index.cjs +1 -1
- package/dist/cjs/components/TextInput/index.cjs +1 -1
- package/dist/cjs/components/Textarea/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/Timestamp/index.cjs +1 -1
- package/dist/cjs/components/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/CharacterCounter/index.js +1 -1
- package/dist/esm/components/Checkbox/index.js +1 -1
- package/dist/esm/components/CheckboxGroup/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +1 -1
- package/dist/esm/components/Heading/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/Modal/index.js +1 -1
- package/dist/esm/components/PinInput/index.js +1 -1
- package/dist/esm/components/Popover/index.js +1 -1
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/RatingDots/index.js +1 -1
- package/dist/esm/components/Select/index.js +1 -1
- package/dist/esm/components/SortableList/index.js +1 -1
- package/dist/esm/components/Spinner/index.js +1 -1
- package/dist/esm/components/StyledAvatar/index.js +1 -1
- package/dist/esm/components/Switch/index.js +1 -1
- package/dist/esm/components/Tabs/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/Text/index.js +1 -1
- package/dist/esm/components/TextInput/index.js +1 -1
- package/dist/esm/components/Textarea/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/Timestamp/index.js +1 -1
- package/dist/esm/components/Tooltip/index.js +1 -1
- package/dist/esm/components/index.js +39 -38
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/index.js +58 -57
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/theme/index.js +1 -1
- package/dist/types/components/Avatar/avatar.recipe.d.ts +1 -1
- package/dist/types/components/Button/button.recipe.d.ts +1 -1
- package/dist/types/components/Logo/logo.recipe.d.ts +1 -1
- package/dist/types/components/Modal/modal.recipe.d.ts +1 -1
- package/dist/types/components/PinInput/pinInput.recipe.d.ts +1 -1
- package/dist/types/components/Spinner/spinner.recipe.d.ts +1 -1
- package/dist/types/components/TimePicker/timePicker.recipe.d.ts +1 -1
- package/dist/types/components/Tooltip/tooltip.recipe.d.ts +1 -1
- package/dist/types/theme/tokens/shadows/shadows.config.d.ts +3 -3
- package/dist/types/theme/tokens/sizes/sizes.config.d.ts +3 -3
- package/dist/types/theme/tokens/spacing/spacing.config.d.ts +3 -3
- package/dist/types/theme/tokens/transitions/transitions.config.d.ts +2 -2
- package/dist/types/theme/tokens/zIndices/zIndices.config.d.ts +3 -3
- package/package.json +1 -1
- package/dist/chunks/avatar.component-C9kUiMY7.js +0 -2
- package/dist/chunks/conversationCard.component-PtZYdnE-.js +0 -2
- package/dist/chunks/popover.component-XAG_EQKh.js +0 -2
- package/dist/chunks/timestamp.component-AfZBeSJ0.js +0 -2
- package/dist/chunks/timestamp.component-DupRVSWm.js +0 -53
- package/dist/chunks/withTruncation-CIxtQTOw.js.map +0 -1
- package/dist/chunks/withTruncation-DfW-AFRe.js +0 -2
- package/dist/chunks/withTruncation-DfW-AFRe.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const i=require("./jsx-runtime-BjDatQAs.js"),p=require("react"),s=require("./use-locale-context-D0LByRu9.js"),V=require("./create-slot-recipe-context-IwVIgtBt.js"),c=require("./index-CHIISuTq.js"),[T,u]=s.createContext({name:"HoverCardContext",hookName:"useHoverCardContext",providerName:"<HoverCardProvider />"}),f=p.forwardRef((e,t)=>{const r=u(),o=c.mergeProps(r.getArrowProps(),e);return i.jsxRuntimeExports.jsx(s.ark.div,{...o,ref:t})});f.displayName="HoverCardArrow";const h=p.forwardRef((e,t)=>{const r=u(),o=c.mergeProps(r.getArrowTipProps(),e);return i.jsxRuntimeExports.jsx(s.ark.div,{...o,ref:t})});h.displayName="HoverCardArrowTip";const y=p.forwardRef((e,t)=>{const r=u(),o=s.usePresenceContext(),n=c.mergeProps(r.getContentProps(),o.getPresenceProps(),e);return o.unmounted?null:i.jsxRuntimeExports.jsx(s.ark.div,{...n,ref:s.composeRefs(o.ref,t)})});y.displayName="HoverCardContent";const $=e=>e.children(u()),N=p.forwardRef((e,t)=>{const r=u(),o=c.mergeProps(r.getPositionerProps(),e);return s.usePresenceContext().unmounted?null:i.jsxRuntimeExports.jsx(s.ark.div,{...o,ref:t})});N.displayName="HoverCardPositioner";var w=c.createAnatomy("hoverCard").parts("arrow","arrowTip","trigger","positioner","content"),P=w.build(),L=e=>e.ids?.trigger??`hover-card:${e.id}:trigger`,j=e=>e.ids?.content??`hover-card:${e.id}:content`,H=e=>e.ids?.positioner??`hover-card:${e.id}:popper`,F=e=>e.ids?.arrow??`hover-card:${e.id}:arrow`,m=e=>e.getById(L(e)),B=e=>e.getById(j(e)),R=e=>e.getById(H(e));function q(e,t){const{state:r,send:o,prop:n,context:d,scope:l}=e,g=r.hasTag("open"),C=s.getPlacementStyles({...n("positioning"),placement:d.get("currentPlacement")});return{open:g,setOpen(a){r.hasTag("open")!==a&&o({type:a?"OPEN":"CLOSE"})},reposition(a={}){o({type:"POSITIONING.SET",options:a})},getArrowProps(){return t.element({id:F(l),...P.arrow.attrs,dir:n("dir"),style:C.arrow})},getArrowTipProps(){return t.element({...P.arrowTip.attrs,dir:n("dir"),style:C.arrowTip})},getTriggerProps(){return t.element({...P.trigger.attrs,dir:n("dir"),"data-placement":d.get("currentPlacement"),id:L(l),"data-state":g?"open":"closed",onPointerEnter(a){a.pointerType!=="touch"&&o({type:"POINTER_ENTER",src:"trigger"})},onPointerLeave(a){a.pointerType!=="touch"&&o({type:"POINTER_LEAVE",src:"trigger"})},onFocus(){o({type:"TRIGGER_FOCUS"})},onBlur(){o({type:"TRIGGER_BLUR"})}})},getPositionerProps(){return t.element({id:H(l),...P.positioner.attrs,dir:n("dir"),style:C.floating})},getContentProps(){return t.element({...P.content.attrs,dir:n("dir"),id:j(l),hidden:!g,tabIndex:-1,"data-state":g?"open":"closed","data-placement":d.get("currentPlacement"),onPointerEnter(a){a.pointerType!=="touch"&&o({type:"POINTER_ENTER",src:"content"})},onPointerLeave(a){a.pointerType!=="touch"&&o({type:"POINTER_LEAVE",src:"content"})}})}}}var{not:E,and:x}=c.createGuards(),U=c.createMachine({props({props:e}){return{openDelay:700,closeDelay:300,...e,positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({prop:e,bindable:t}){return{open:t(()=>({defaultValue:e("defaultOpen"),value:e("open"),onChange(r){e("onOpenChange")?.({open:r})}})),currentPlacement:t(()=>({defaultValue:void 0})),isPointer:t(()=>({defaultValue:!1}))}},watch({track:e,context:t,action:r}){e([()=>t.get("open")],()=>{r(["toggleVisibility"])})},states:{closed:{tags:["closed"],entry:["clearIsPointer"],on:{"CONTROLLED.OPEN":{target:"open"},POINTER_ENTER:{target:"opening",actions:["setIsPointer"]},TRIGGER_FOCUS:{target:"opening"},OPEN:{target:"opening"}}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{OPEN_DELAY:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},POINTER_LEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:x("isOpenControlled",E("isPointer")),actions:["invokeOnClose","toggleVisibility"]},{guard:E("isPointer"),target:"closed",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}]}},open:{tags:["open"],effects:["trackDismissableElement","trackPositioning"],on:{"CONTROLLED.CLOSE":{target:"closed"},POINTER_ENTER:{actions:["setIsPointer"]},POINTER_LEAVE:{target:"closing"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:x("isOpenControlled",E("isPointer")),actions:["invokeOnClose"]},{guard:E("isPointer"),target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}},closing:{tags:["open"],effects:["trackPositioning","waitForCloseDelay"],on:{CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"CONTROLLED.CLOSE":{target:"closed"},"CONTROLLED.OPEN":{target:"open"},POINTER_ENTER:{target:"open",actions:["setIsPointer"]}}}},implementations:{guards:{isPointer:({context:e})=>!!e.get("isPointer"),isOpenControlled:({prop:e})=>e("open")!=null},effects:{waitForOpenDelay({send:e,prop:t}){const r=setTimeout(()=>{e({type:"OPEN_DELAY"})},t("openDelay"));return()=>clearTimeout(r)},waitForCloseDelay({send:e,prop:t}){const r=setTimeout(()=>{e({type:"CLOSE_DELAY"})},t("closeDelay"));return()=>clearTimeout(r)},trackPositioning({context:e,prop:t,scope:r}){e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const o=()=>R(r);return s.getPlacement(m(r),o,{...t("positioning"),defer:!0,onComplete(n){e.set("currentPlacement",n.placement)}})},trackDismissableElement({send:e,scope:t,prop:r}){const o=()=>B(t);return c.trackDismissableElement(o,{defer:!0,exclude:[m(t)],onDismiss(){e({type:"CLOSE",src:"interact-outside"})},onInteractOutside:r("onInteractOutside"),onPointerDownOutside:r("onPointerDownOutside"),onFocusOutside(n){n.preventDefault(),r("onFocusOutside")?.(n)}})}},actions:{invokeOnClose({prop:e}){e("onOpenChange")?.({open:!1})},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:!0})},setIsPointer({context:e}){e.set("isPointer",!0)},clearIsPointer({context:e}){e.set("isPointer",!1)},reposition({context:e,prop:t,scope:r,event:o}){const n=()=>R(r);s.getPlacement(m(r),n,{...t("positioning"),...o.options,defer:!0,listeners:!1,onComplete(d){e.set("currentPlacement",d.placement)}})},toggleVisibility({prop:e,event:t,send:r}){queueMicrotask(()=>{r({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})})}}}});s.createProps()(["closeDelay","dir","getRootNode","id","ids","onOpenChange","defaultOpen","open","openDelay","positioning","onInteractOutside","onPointerDownOutside","onFocusOutside"]);const Y=e=>{const t=p.useId(),{getRootNode:r}=s.useEnvironmentContext(),{dir:o}=s.useLocaleContext(),n={id:t,dir:o,getRootNode:r,...e},d=s.useMachine(U,n);return q(d,s.normalizeProps)},M=e=>{const[t,{children:r,...o}]=s.splitPresenceProps(e),n=Y(o),d=s.usePresence(c.mergeProps({present:n.open},t));return i.jsxRuntimeExports.jsx(T,{value:n,children:i.jsxRuntimeExports.jsx(s.PresenceProvider,{value:d,children:r})})},J=e=>{const[t,{value:r,children:o}]=s.splitPresenceProps(e),n=s.usePresence(c.mergeProps({present:r.open},t));return i.jsxRuntimeExports.jsx(T,{value:r,children:i.jsxRuntimeExports.jsx(s.PresenceProvider,{value:n,children:o})})},I=p.forwardRef((e,t)=>{const r=u(),o=c.mergeProps(r.getTriggerProps(),e);return i.jsxRuntimeExports.jsx(s.ark.button,{...o,ref:t})});I.displayName="HoverCardTrigger";const{withRootProvider:k,withContext:v,PropsProvider:K}=V.createSlotRecipeContext({key:"hoverCard"}),Q=k(J),D=k(M),W=K,A=v(I,"trigger",{forwardAsChild:!0}),_=v(N,"positioner",{forwardAsChild:!0}),S=v(y,"content",{forwardAsChild:!0}),O=v(h,"arrowTip",{forwardAsChild:!0}),b=v(f,"arrow",{forwardAsChild:!0,defaultProps:{children:i.jsxRuntimeExports.jsx(O,{})}}),X=$,G=p.forwardRef((e,t)=>{const{children:r,disabled:o=!1,openDelay:n=350,placement:d="top",positioning:l,portalled:g=!0,label:C,...a}=e;return r?o?r:i.jsxRuntimeExports.jsxs(D,{positioning:{...l,placement:l?.placement||d},openDelay:n,...a,children:[i.jsxRuntimeExports.jsx(A,{asChild:!0,className:"Tooltip__Trigger","data-testid":"kibble-tooltip-trigger",children:r}),i.jsxRuntimeExports.jsx(s.Portal,{disabled:!g,children:i.jsxRuntimeExports.jsx(_,{className:"Tooltip","data-testid":"kibble-tooltip",children:i.jsxRuntimeExports.jsxs(S,{className:"Tooltip__Content","data-testid":"kibble-tooltip-content",ref:t,children:[i.jsxRuntimeExports.jsx(b,{className:"Tooltip__Arrow","data-testid":"kibble-tooltip-arrow",children:i.jsxRuntimeExports.jsx(O,{})}),C]})})})]}):i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{})});G.displayName="Tooltip";exports.HoverCardArrow=b;exports.HoverCardArrowTip=O;exports.HoverCardContent=S;exports.HoverCardContext=X;exports.HoverCardPositioner=_;exports.HoverCardPropsProvider=W;exports.HoverCardRoot=D;exports.HoverCardRootProvider=Q;exports.HoverCardTrigger=A;exports.Tooltip=G;exports.anatomy=w;exports.useHoverCardContext=u;
|
|
2
|
+
//# sourceMappingURL=tooltip.component-Dq7F5JIs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.component-Dq7F5JIs.js","sources":["../../node_modules/@ark-ui/react/dist/components/hover-card/use-hover-card-context.js","../../node_modules/@ark-ui/react/dist/components/hover-card/hover-card-arrow.js","../../node_modules/@ark-ui/react/dist/components/hover-card/hover-card-arrow-tip.js","../../node_modules/@ark-ui/react/dist/components/hover-card/hover-card-content.js","../../node_modules/@ark-ui/react/dist/components/hover-card/hover-card-context.js","../../node_modules/@ark-ui/react/dist/components/hover-card/hover-card-positioner.js","../../node_modules/@zag-js/hover-card/dist/index.mjs","../../node_modules/@ark-ui/react/dist/components/hover-card/use-hover-card.js","../../node_modules/@ark-ui/react/dist/components/hover-card/hover-card-root.js","../../node_modules/@ark-ui/react/dist/components/hover-card/hover-card-root-provider.js","../../node_modules/@ark-ui/react/dist/components/hover-card/hover-card-trigger.js","../../node_modules/@chakra-ui/react/dist/esm/components/hover-card/hover-card.js","../../src/components/Tooltip/tooltip.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [HoverCardProvider, useHoverCardContext] = createContext({\n name: \"HoverCardContext\",\n hookName: \"useHoverCardContext\",\n providerName: \"<HoverCardProvider />\"\n});\n\nexport { HoverCardProvider, useHoverCardContext };\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 { useHoverCardContext } from './use-hover-card-context.js';\n\nconst HoverCardArrow = forwardRef((props, ref) => {\n const hoverCard = useHoverCardContext();\n const mergedProps = mergeProps(hoverCard.getArrowProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nHoverCardArrow.displayName = \"HoverCardArrow\";\n\nexport { HoverCardArrow };\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 { useHoverCardContext } from './use-hover-card-context.js';\n\nconst HoverCardArrowTip = forwardRef((props, ref) => {\n const hoverCard = useHoverCardContext();\n const mergedProps = mergeProps(hoverCard.getArrowTipProps(), props);\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nHoverCardArrowTip.displayName = \"HoverCardArrowTip\";\n\nexport { HoverCardArrowTip };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { ark } from '../factory.js';\nimport { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useHoverCardContext } from './use-hover-card-context.js';\n\nconst HoverCardContent = forwardRef((props, ref) => {\n const hoverCard = useHoverCardContext();\n const presence = usePresenceContext();\n const mergedProps = mergeProps(hoverCard.getContentProps(), presence.getPresenceProps(), props);\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) });\n});\nHoverCardContent.displayName = \"HoverCardContent\";\n\nexport { HoverCardContent };\n","'use client';\nimport { useHoverCardContext } from './use-hover-card-context.js';\n\nconst HoverCardContext = (props) => props.children(useHoverCardContext());\n\nexport { HoverCardContext };\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 { usePresenceContext } from '../presence/use-presence-context.js';\nimport { useHoverCardContext } from './use-hover-card-context.js';\n\nconst HoverCardPositioner = forwardRef((props, ref) => {\n const hoverCard = useHoverCardContext();\n const mergedProps = mergeProps(hoverCard.getPositionerProps(), props);\n const presence = usePresenceContext();\n if (presence.unmounted) {\n return null;\n }\n return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });\n});\nHoverCardPositioner.displayName = \"HoverCardPositioner\";\n\nexport { HoverCardPositioner };\n","import { createAnatomy } from '@zag-js/anatomy';\nimport { getPlacement, getPlacementStyles } from '@zag-js/popper';\nimport { createGuards, createMachine } from '@zag-js/core';\nimport { trackDismissableElement } from '@zag-js/dismissable';\nimport { createProps } from '@zag-js/types';\nimport { createSplitProps } from '@zag-js/utils';\n\n// src/hover-card.anatomy.ts\nvar anatomy = createAnatomy(\"hoverCard\").parts(\"arrow\", \"arrowTip\", \"trigger\", \"positioner\", \"content\");\nvar parts = anatomy.build();\n\n// src/hover-card.dom.ts\nvar getTriggerId = (ctx) => ctx.ids?.trigger ?? `hover-card:${ctx.id}:trigger`;\nvar getContentId = (ctx) => ctx.ids?.content ?? `hover-card:${ctx.id}:content`;\nvar getPositionerId = (ctx) => ctx.ids?.positioner ?? `hover-card:${ctx.id}:popper`;\nvar getArrowId = (ctx) => ctx.ids?.arrow ?? `hover-card:${ctx.id}:arrow`;\nvar getTriggerEl = (ctx) => ctx.getById(getTriggerId(ctx));\nvar getContentEl = (ctx) => ctx.getById(getContentId(ctx));\nvar getPositionerEl = (ctx) => ctx.getById(getPositionerId(ctx));\n\n// src/hover-card.connect.ts\nfunction connect(service, normalize) {\n const { state, send, prop, context, scope } = service;\n const open = state.hasTag(\"open\");\n const popperStyles = getPlacementStyles({\n ...prop(\"positioning\"),\n placement: context.get(\"currentPlacement\")\n });\n return {\n open,\n setOpen(nextOpen) {\n const open2 = state.hasTag(\"open\");\n if (open2 === nextOpen) return;\n send({ type: nextOpen ? \"OPEN\" : \"CLOSE\" });\n },\n reposition(options = {}) {\n send({ type: \"POSITIONING.SET\", options });\n },\n getArrowProps() {\n return normalize.element({\n id: getArrowId(scope),\n ...parts.arrow.attrs,\n dir: prop(\"dir\"),\n style: popperStyles.arrow\n });\n },\n getArrowTipProps() {\n return normalize.element({\n ...parts.arrowTip.attrs,\n dir: prop(\"dir\"),\n style: popperStyles.arrowTip\n });\n },\n getTriggerProps() {\n return normalize.element({\n ...parts.trigger.attrs,\n dir: prop(\"dir\"),\n \"data-placement\": context.get(\"currentPlacement\"),\n id: getTriggerId(scope),\n \"data-state\": open ? \"open\" : \"closed\",\n onPointerEnter(event) {\n if (event.pointerType === \"touch\") return;\n send({ type: \"POINTER_ENTER\", src: \"trigger\" });\n },\n onPointerLeave(event) {\n if (event.pointerType === \"touch\") return;\n send({ type: \"POINTER_LEAVE\", src: \"trigger\" });\n },\n onFocus() {\n send({ type: \"TRIGGER_FOCUS\" });\n },\n onBlur() {\n send({ type: \"TRIGGER_BLUR\" });\n }\n });\n },\n getPositionerProps() {\n return normalize.element({\n id: getPositionerId(scope),\n ...parts.positioner.attrs,\n dir: prop(\"dir\"),\n style: popperStyles.floating\n });\n },\n getContentProps() {\n return normalize.element({\n ...parts.content.attrs,\n dir: prop(\"dir\"),\n id: getContentId(scope),\n hidden: !open,\n tabIndex: -1,\n \"data-state\": open ? \"open\" : \"closed\",\n \"data-placement\": context.get(\"currentPlacement\"),\n onPointerEnter(event) {\n if (event.pointerType === \"touch\") return;\n send({ type: \"POINTER_ENTER\", src: \"content\" });\n },\n onPointerLeave(event) {\n if (event.pointerType === \"touch\") return;\n send({ type: \"POINTER_LEAVE\", src: \"content\" });\n }\n });\n }\n };\n}\nvar { not, and } = createGuards();\nvar machine = createMachine({\n props({ props: props2 }) {\n return {\n openDelay: 700,\n closeDelay: 300,\n ...props2,\n positioning: {\n placement: \"bottom\",\n ...props2.positioning\n }\n };\n },\n initialState({ prop }) {\n const open = prop(\"open\") || prop(\"defaultOpen\");\n return open ? \"open\" : \"closed\";\n },\n context({ prop, bindable }) {\n return {\n open: bindable(() => ({\n defaultValue: prop(\"defaultOpen\"),\n value: prop(\"open\"),\n onChange(value) {\n prop(\"onOpenChange\")?.({ open: value });\n }\n })),\n currentPlacement: bindable(() => ({\n defaultValue: void 0\n })),\n isPointer: bindable(() => ({\n defaultValue: false\n }))\n };\n },\n watch({ track, context, action }) {\n track([() => context.get(\"open\")], () => {\n action([\"toggleVisibility\"]);\n });\n },\n states: {\n closed: {\n tags: [\"closed\"],\n entry: [\"clearIsPointer\"],\n on: {\n \"CONTROLLED.OPEN\": {\n target: \"open\"\n },\n POINTER_ENTER: {\n target: \"opening\",\n actions: [\"setIsPointer\"]\n },\n TRIGGER_FOCUS: {\n target: \"opening\"\n },\n OPEN: {\n target: \"opening\"\n }\n }\n },\n opening: {\n tags: [\"closed\"],\n effects: [\"waitForOpenDelay\"],\n on: {\n OPEN_DELAY: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnOpen\"]\n },\n {\n target: \"open\",\n actions: [\"invokeOnOpen\"]\n }\n ],\n \"CONTROLLED.OPEN\": {\n target: \"open\"\n },\n \"CONTROLLED.CLOSE\": {\n target: \"closed\"\n },\n POINTER_LEAVE: [\n {\n guard: \"isOpenControlled\",\n // We trigger toggleVisibility manually since the `ctx.open` has not changed yet (at this point)\n actions: [\"invokeOnClose\", \"toggleVisibility\"]\n },\n {\n target: \"closed\",\n actions: [\"invokeOnClose\"]\n }\n ],\n TRIGGER_BLUR: [\n {\n guard: and(\"isOpenControlled\", not(\"isPointer\")),\n // We trigger toggleVisibility manually since the `ctx.open` has not changed yet (at this point)\n actions: [\"invokeOnClose\", \"toggleVisibility\"]\n },\n {\n guard: not(\"isPointer\"),\n target: \"closed\",\n actions: [\"invokeOnClose\"]\n }\n ],\n CLOSE: [\n {\n guard: \"isOpenControlled\",\n // We trigger toggleVisibility manually since the `ctx.open` has not changed yet (at this point)\n actions: [\"invokeOnClose\", \"toggleVisibility\"]\n },\n {\n target: \"closed\",\n actions: [\"invokeOnClose\"]\n }\n ]\n }\n },\n open: {\n tags: [\"open\"],\n effects: [\"trackDismissableElement\", \"trackPositioning\"],\n on: {\n \"CONTROLLED.CLOSE\": {\n target: \"closed\"\n },\n POINTER_ENTER: {\n actions: [\"setIsPointer\"]\n },\n POINTER_LEAVE: {\n target: \"closing\"\n },\n CLOSE: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"closed\",\n actions: [\"invokeOnClose\"]\n }\n ],\n TRIGGER_BLUR: [\n {\n guard: and(\"isOpenControlled\", not(\"isPointer\")),\n actions: [\"invokeOnClose\"]\n },\n {\n guard: not(\"isPointer\"),\n target: \"closed\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"POSITIONING.SET\": {\n actions: [\"reposition\"]\n }\n }\n },\n closing: {\n tags: [\"open\"],\n effects: [\"trackPositioning\", \"waitForCloseDelay\"],\n on: {\n CLOSE_DELAY: [\n {\n guard: \"isOpenControlled\",\n actions: [\"invokeOnClose\"]\n },\n {\n target: \"closed\",\n actions: [\"invokeOnClose\"]\n }\n ],\n \"CONTROLLED.CLOSE\": {\n target: \"closed\"\n },\n \"CONTROLLED.OPEN\": {\n target: \"open\"\n },\n POINTER_ENTER: {\n target: \"open\",\n // no need to invokeOnOpen here because it's still open (but about to close)\n actions: [\"setIsPointer\"]\n }\n }\n }\n },\n implementations: {\n guards: {\n isPointer: ({ context }) => !!context.get(\"isPointer\"),\n isOpenControlled: ({ prop }) => prop(\"open\") != null\n },\n effects: {\n waitForOpenDelay({ send, prop }) {\n const id = setTimeout(() => {\n send({ type: \"OPEN_DELAY\" });\n }, prop(\"openDelay\"));\n return () => clearTimeout(id);\n },\n waitForCloseDelay({ send, prop }) {\n const id = setTimeout(() => {\n send({ type: \"CLOSE_DELAY\" });\n }, prop(\"closeDelay\"));\n return () => clearTimeout(id);\n },\n trackPositioning({ context, prop, scope }) {\n if (!context.get(\"currentPlacement\")) {\n context.set(\"currentPlacement\", prop(\"positioning\").placement);\n }\n const getPositionerEl2 = () => getPositionerEl(scope);\n return getPlacement(getTriggerEl(scope), getPositionerEl2, {\n ...prop(\"positioning\"),\n defer: true,\n onComplete(data) {\n context.set(\"currentPlacement\", data.placement);\n }\n });\n },\n trackDismissableElement({ send, scope, prop }) {\n const getContentEl2 = () => getContentEl(scope);\n return trackDismissableElement(getContentEl2, {\n defer: true,\n exclude: [getTriggerEl(scope)],\n onDismiss() {\n send({ type: \"CLOSE\", src: \"interact-outside\" });\n },\n onInteractOutside: prop(\"onInteractOutside\"),\n onPointerDownOutside: prop(\"onPointerDownOutside\"),\n onFocusOutside(event) {\n event.preventDefault();\n prop(\"onFocusOutside\")?.(event);\n }\n });\n }\n },\n actions: {\n invokeOnClose({ prop }) {\n prop(\"onOpenChange\")?.({ open: false });\n },\n invokeOnOpen({ prop }) {\n prop(\"onOpenChange\")?.({ open: true });\n },\n setIsPointer({ context }) {\n context.set(\"isPointer\", true);\n },\n clearIsPointer({ context }) {\n context.set(\"isPointer\", false);\n },\n reposition({ context, prop, scope, event }) {\n const getPositionerEl2 = () => getPositionerEl(scope);\n getPlacement(getTriggerEl(scope), getPositionerEl2, {\n ...prop(\"positioning\"),\n ...event.options,\n defer: true,\n listeners: false,\n onComplete(data) {\n context.set(\"currentPlacement\", data.placement);\n }\n });\n },\n toggleVisibility({ prop, event, send }) {\n queueMicrotask(() => {\n send({ type: prop(\"open\") ? \"CONTROLLED.OPEN\" : \"CONTROLLED.CLOSE\", previousEvent: event });\n });\n }\n }\n }\n});\nvar props = createProps()([\n \"closeDelay\",\n \"dir\",\n \"getRootNode\",\n \"id\",\n \"ids\",\n \"onOpenChange\",\n \"defaultOpen\",\n \"open\",\n \"openDelay\",\n \"positioning\",\n \"onInteractOutside\",\n \"onPointerDownOutside\",\n \"onFocusOutside\"\n]);\nvar splitProps = createSplitProps(props);\n\nexport { anatomy, connect, machine, props, splitProps };\n","'use client';\nimport * as hoverCard from '@zag-js/hover-card';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\n\nconst useHoverCard = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const machineProps = {\n id,\n dir,\n getRootNode,\n ...props\n };\n const service = useMachine(hoverCard.machine, machineProps);\n return hoverCard.connect(service, normalizeProps);\n};\n\nexport { useHoverCard };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { useHoverCard } from './use-hover-card.js';\nimport { HoverCardProvider } from './use-hover-card-context.js';\n\nconst HoverCardRoot = (props) => {\n const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);\n const hoverCard = useHoverCard(localProps);\n const presence = usePresence(mergeProps({ present: hoverCard.open }, presenceProps));\n return /* @__PURE__ */ jsx(HoverCardProvider, { value: hoverCard, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children }) });\n};\n\nexport { HoverCardRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { splitPresenceProps } from '../presence/split-presence-props.js';\nimport { usePresence } from '../presence/use-presence.js';\nimport { PresenceProvider } from '../presence/use-presence-context.js';\nimport { HoverCardProvider } from './use-hover-card-context.js';\n\nconst HoverCardRootProvider = (props) => {\n const [presenceProps, { value: hoverCard, children }] = splitPresenceProps(props);\n const presence = usePresence(mergeProps({ present: hoverCard.open }, presenceProps));\n return /* @__PURE__ */ jsx(HoverCardProvider, { value: hoverCard, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children }) });\n};\n\nexport { HoverCardRootProvider };\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 { useHoverCardContext } from './use-hover-card-context.js';\n\nconst HoverCardTrigger = forwardRef((props, ref) => {\n const hoverCard = useHoverCardContext();\n const mergedProps = mergeProps(hoverCard.getTriggerProps(), props);\n return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });\n});\nHoverCardTrigger.displayName = \"HoverCardTrigger\";\n\nexport { HoverCardTrigger };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { HoverCard } from '@ark-ui/react/hover-card';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\n\nconst {\n withRootProvider,\n withContext,\n useStyles: useHoverCardStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"hoverCard\" });\nconst HoverCardRootProvider = withRootProvider(HoverCard.RootProvider);\nconst HoverCardRoot = withRootProvider(\n HoverCard.Root\n);\nconst HoverCardPropsProvider = PropsProvider;\nconst HoverCardTrigger = withContext(HoverCard.Trigger, \"trigger\", { forwardAsChild: true });\nconst HoverCardPositioner = withContext(HoverCard.Positioner, \"positioner\", { forwardAsChild: true });\nconst HoverCardContent = withContext(HoverCard.Content, \"content\", { forwardAsChild: true });\nconst HoverCardArrowTip = withContext(HoverCard.ArrowTip, \"arrowTip\", { forwardAsChild: true });\nconst HoverCardArrow = withContext(\n HoverCard.Arrow,\n \"arrow\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(HoverCardArrowTip, {}) }\n }\n);\nconst HoverCardContext = HoverCard.Context;\n\nexport { HoverCardArrow, HoverCardArrowTip, HoverCardContent, HoverCardContext, HoverCardPositioner, HoverCardPropsProvider, HoverCardRoot, HoverCardRootProvider, HoverCardTrigger, useHoverCardStyles };\n","import React, { forwardRef } from \"react\";\nimport { Portal } from \"@chakra-ui/react/portal\";\nimport { HoverCard } from \"@chakra-ui/react/hover-card\";\nimport { Placement } from \"shared/types/placement\";\n// import { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\n// import { tooltipRecipe } from \"./tooltip.recipe\";\n// import { Text } from \"components/Text/text.component\";\n\nexport interface TooltipProps extends Omit<HoverCard.RootProps, \"children\"> {\n children?: React.ReactNode;\n disabled?: boolean;\n label: string;\n placement?: Placement;\n portalled?: boolean;\n}\n\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(\n (props, ref): React.ReactNode => {\n const {\n children,\n disabled = false,\n openDelay = 350,\n placement = \"top\",\n positioning,\n portalled = true,\n label,\n ...rest\n } = props;\n // const recipe = useSlotRecipe({ recipe: tooltipRecipe });\n // const styles = recipe();\n\n if (!children) return <></>;\n if (disabled) return children;\n\n return (\n <HoverCard.Root\n positioning={{\n ...positioning,\n placement: positioning?.placement || placement,\n }}\n openDelay={openDelay}\n {...rest}\n >\n <HoverCard.Trigger\n asChild\n className=\"Tooltip__Trigger\"\n data-testid=\"kibble-tooltip-trigger\"\n // css={styles.trigger}\n >\n {children}\n </HoverCard.Trigger>\n <Portal disabled={!portalled}>\n <HoverCard.Positioner\n className=\"Tooltip\"\n data-testid=\"kibble-tooltip\"\n >\n <HoverCard.Content\n className=\"Tooltip__Content\"\n data-testid=\"kibble-tooltip-content\"\n ref={ref}\n // css={styles.content}\n >\n <HoverCard.Arrow\n className=\"Tooltip__Arrow\"\n data-testid=\"kibble-tooltip-arrow\"\n // css={styles.arrow}\n >\n <HoverCard.ArrowTip\n //css={styles.arrowTip}\n />\n </HoverCard.Arrow>\n {/* <Text truncated={false} variant=\"onContrast\" size=\"sm\"> */}\n {label}\n {/* </Text> */}\n </HoverCard.Content>\n </HoverCard.Positioner>\n </Portal>\n </HoverCard.Root>\n );\n }\n);\n\nTooltip.displayName = \"Tooltip\";\n"],"names":["HoverCardProvider","useHoverCardContext","createContext","HoverCardArrow","forwardRef","props","ref","hoverCard","mergedProps","mergeProps","jsx","ark","HoverCardArrowTip","HoverCardContent","presence","usePresenceContext","composeRefs","HoverCardContext","HoverCardPositioner","anatomy","createAnatomy","parts","getTriggerId","ctx","getContentId","getPositionerId","getArrowId","getTriggerEl","getContentEl","getPositionerEl","connect","service","normalize","state","send","prop","context","scope","open","popperStyles","getPlacementStyles","nextOpen","options","event","not","and","createGuards","machine","createMachine","props2","bindable","value","track","action","id","getPositionerEl2","getPlacement","data","getContentEl2","trackDismissableElement","createProps","useHoverCard","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","useMachine","hoverCard.machine","hoverCard.connect","normalizeProps","HoverCardRoot","presenceProps","children","localProps","splitPresenceProps","usePresence","PresenceProvider","HoverCardRootProvider","HoverCardTrigger","withRootProvider","withContext","PropsProvider","createSlotRecipeContext","HoverCard.RootProvider","HoverCard.Root","HoverCardPropsProvider","HoverCard.Trigger","HoverCard.Positioner","HoverCard.Content","HoverCard.ArrowTip","HoverCard.Arrow","HoverCard.Context","Tooltip","disabled","openDelay","placement","positioning","portalled","label","rest","jsxs","Portal","Fragment"],"mappings":"kNAGM,CAACA,EAAmBC,CAAmB,EAAIC,gBAAc,CAC7D,KAAM,mBACN,SAAU,sBACV,aAAc,uBAChB,CAAC,ECAKC,EAAiBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAChD,MAAMC,EAAYN,EAAqB,EACjCO,EAAcC,EAAU,WAACF,EAAU,cAAa,EAAIF,CAAK,EAC/D,OAAuBK,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,IAAK,CAAE,GAAGH,EAAa,IAAAF,EAAK,CAC7D,CAAC,EACDH,EAAe,YAAc,iBCL7B,MAAMS,EAAoBR,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACnD,MAAMC,EAAYN,EAAqB,EACjCO,EAAcC,EAAU,WAACF,EAAU,iBAAgB,EAAIF,CAAK,EAClE,OAAuBK,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,IAAK,CAAE,GAAGH,EAAa,IAAAF,EAAK,CAC7D,CAAC,EACDM,EAAkB,YAAc,oBCHhC,MAAMC,EAAmBT,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAClD,MAAMC,EAAYN,EAAqB,EACjCa,EAAWC,EAAAA,mBAAoB,EAC/BP,EAAcC,EAAU,WAACF,EAAU,gBAAiB,EAAEO,EAAS,iBAAkB,EAAET,CAAK,EAC9F,OAAIS,EAAS,UACJ,KAEcJ,wBAAIC,EAAAA,IAAI,IAAK,CAAE,GAAGH,EAAa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,EAAA,kBAAA,IAAC8E,EAAA,CACC,QAAO,GACP,UAAU,mBACV,cAAY,yBAGX,SAAAd,CAAA,CACH,EACChE,EAAA,kBAAA,IAAA6F,EAAA,OAAA,CAAO,SAAU,CAACJ,EACjB,SAAAzF,EAAA,kBAAA,IAAC+E,EAAA,CACC,UAAU,UACV,cAAY,iBAEZ,SAAAa,EAAA,kBAAA,KAACZ,EAAA,CACC,UAAU,mBACV,cAAY,yBACZ,IAAApF,EAGA,SAAA,CAAAI,EAAA,kBAAA,IAACkF,EAAA,CACC,UAAU,iBACV,cAAY,uBAGZ,SAAAlF,EAAA,kBAAA,IAACiF,EAAA,CAAA,CAAA,CAED,CACF,EAECS,CAAA,CAAA,CAAA,CAEH,CAAA,CAEJ,CAAA,CAAA,CAAA,CACF,EA9CsB1F,wBAAA8F,EAAAA,kBAAAA,SAAA,CAAA,CAAA,CA8CtB,CAGN,EAEAV,EAAQ,YAAc","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),Z=require("./
|
|
2
|
-
//# sourceMappingURL=withFormControl-
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),Z=require("./text.component-H5f43IC6.js"),h=require("./typography.records-CSy2LmDd.js"),G=require("./icon.component-C0e0UGBw.js"),k=require("./flex-D14H6HbP.js"),o=require("react"),w=require("./factory-D6tdBUPG.js"),J=require("./create-slot-recipe-context-IwVIgtBt.js"),K=require("./create-recipe-context-sESms8Eo.js"),P=require("./use-field-context-CArmgHPP.js"),F=require("./use-locale-context-D0LByRu9.js"),l=require("./index-CHIISuTq.js");function Q(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const t=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,t.get?t:{enumerable:!0,get:()=>e[s]})}}return r.default=e,Object.freeze(r)}const U=Q(o),H=o.forwardRef((e,r)=>{const s=P.useFieldContext(),t=l.mergeProps(s.getErrorTextProps(),e);return s?.invalid?n.jsxRuntimeExports.jsx(F.ark.span,{...t,ref:r}):null});H.displayName="FieldErrorText";const L=o.forwardRef((e,r)=>{const s=P.useFieldContext(),t=l.mergeProps(s?.getHelperTextProps(),e);return n.jsxRuntimeExports.jsx(F.ark.span,{...t,ref:r})});L.displayName="FieldHelperText";const O=o.forwardRef((e,r)=>{const s=P.useFieldContext(),t=l.mergeProps(s?.getLabelProps(),e);return n.jsxRuntimeExports.jsx(F.ark.label,{...t,ref:r})});O.displayName="FieldLabel";const V=typeof window<"u"?o.useLayoutEffect:o.useEffect,[pe,X]=F.createContext({name:"FieldsetContext",hookName:"useFieldsetContext",providerName:"<FieldsetProvider />",strict:!1}),Y=(e={})=>{const r=X(),{ids:s,disabled:t=!!r?.disabled,invalid:a=!1,readOnly:i=!1,required:d=!1}=e,[x,p]=o.useState(!1),[y,b]=o.useState(!1),c=e.id??o.useId(),C=o.useRef(null),m=s?.control??`field::${c}`,f=s?.errorText??`field::${c}::error-text`,u=s?.helperText??`field::${c}::helper-text`,E=s?.label??`field::${c}::label`;V(()=>{const j=C.current;if(!j)return;const q=l.getWindow(j),A=q.document,S=()=>{p(!!A.getElementById(f)),b(!!A.getElementById(u))};S();const M=new q.MutationObserver(S);return M.observe(j,{childList:!0,subtree:!0}),()=>M.disconnect()},[f,u]);const R=o.useMemo(()=>{const j=[];return x&&a&&j.push(f),y&&j.push(u),j.join(" ")||void 0},[a,f,u,x,y]),N=o.useMemo(()=>()=>({...h.parts.root.attrs,id:m,ref:C,role:"group","data-disabled":l.dataAttr(t),"data-invalid":l.dataAttr(a),"data-readonly":l.dataAttr(i)}),[t,a,i,m]),v=o.useMemo(()=>()=>({...h.parts.label.attrs,id:E,"data-disabled":l.dataAttr(t),"data-invalid":l.dataAttr(a),"data-readonly":l.dataAttr(i),htmlFor:c}),[t,a,i,c,E]),g=o.useMemo(()=>()=>({"aria-describedby":R,"aria-invalid":l.ariaAttr(a),"data-invalid":l.dataAttr(a),"data-required":l.dataAttr(d),"data-readonly":l.dataAttr(i),id:c,required:d,disabled:t,readOnly:i}),[R,a,d,i,c,t]),T=o.useMemo(()=>()=>({...g(),...h.parts.input.attrs}),[g]),I=o.useMemo(()=>()=>({...g(),...h.parts.textarea.attrs}),[g]),z=o.useMemo(()=>()=>({...g(),...h.parts.select.attrs}),[g]),B=o.useMemo(()=>()=>({id:u,...h.parts.helperText.attrs,"data-disabled":l.dataAttr(t)}),[t,u]),D=o.useMemo(()=>()=>({id:f,...h.parts.errorText.attrs,"aria-live":"polite"}),[f]),W=o.useMemo(()=>()=>({"aria-hidden":!0,...h.parts.requiredIndicator.attrs}),[]);return{ariaDescribedby:R,ids:{root:m,control:c,label:E,errorText:f,helperText:u},refs:{rootRef:C},disabled:t,invalid:a,readOnly:i,required:d,getLabelProps:v,getRootProps:N,getInputProps:T,getTextareaProps:I,getSelectProps:z,getHelperTextProps:B,getErrorTextProps:D,getRequiredIndicatorProps:W}},$=o.forwardRef((e,r)=>{const[s,t]=F.createSplitProps()(e,["id","ids","disabled","invalid","readOnly","required"]),a=Y(s),i=l.mergeProps(a.getRootProps(),t);return n.jsxRuntimeExports.jsx(P.FieldProvider,{value:a,children:n.jsxRuntimeExports.jsx(F.ark.div,{...i,ref:F.composeRefs(r,a.refs.rootRef)})})});$.displayName="FieldRoot";const{useRecipeResult:ee}=K.createRecipeContext({key:"icon"}),te=U.forwardRef(function(r,s){const{styles:t,className:a,props:i}=ee({asChild:!r.as,...r});return n.jsxRuntimeExports.jsx(w.chakra.svg,{ref:s,focusable:!1,"aria-hidden":"true",...i,css:[t,r.css],className:w.cx(a,r.className)})});function re(e){const{viewBox:r="0 0 24 24",d:s,displayName:t,defaultProps:a={}}=e,i=o.Children.toArray(e.path),d=o.forwardRef((x,p)=>n.jsxRuntimeExports.jsx(te,{ref:p,asChild:!1,viewBox:r,...a,...x,children:i.length?i:n.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:s})}));return d.displayName=t,d}const{withProvider:se,withContext:_,useStyles:oe,useClassNames:ae}=J.createSlotRecipeContext({key:"field"}),ne=se($,"root",{forwardAsChild:!0}),ie=_(O,"label",{forwardAsChild:!0}),le=_(L,"helperText",{forwardAsChild:!0}),de=_(H,"errorText",{forwardAsChild:!0});re({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"});const ce=o.forwardRef(function(r,s){const{fallback:t,children:a="*",...i}=r,d=P.useFieldContext(),x=ae(),p=oe();return d?.required?n.jsxRuntimeExports.jsx(w.chakra.span,{ref:s,"aria-hidden":"true",...i,className:w.cx(x.requiredIndicator,r.className),css:[p.requiredIndicator,r.css],children:a}):t}),ue={sm:10,md:12,lg:14},xe=e=>{const r=({disabled:s=!1,errorText:t="Field is invalid",formControlStyle:a,fullWidth:i=!0,helperText:d,inlineField:x=!1,invalid:p=!1,invalidIconColor:y="danger",label:b,labelPosition:c="start",labelStyle:C,onContrast:m=!1,readOnly:f=!1,required:u=!1,showOptionalElement:E=!1,size:R="md",useInvalidIcon:N=!1,useInvalidText:v=!0,...g})=>{const T=n.jsxRuntimeExports.jsxs(ie,{className:"FormControl__Label",color:m?"text.contrast":"text",fontSize:h.fontSizes[R],...C,onClick:I=>{I.stopPropagation()},children:[b,n.jsxRuntimeExports.jsx(ce,{className:"FormControl__RequiredIndicator",color:m?"text.danger.contrast":"text.danger",...!u&&{fallback:E?n.jsxRuntimeExports.jsxs(Z.WrappedText,{variant:m?"subtleOnContrast":"subtle",fontSize:ue[R],children:[" ","(Optional)"]}):n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}})]});return n.jsxRuntimeExports.jsxs(ne,{className:"FormControl group",disabled:s,invalid:p,readOnly:f,required:u,width:i?"100%":"auto",...a,children:[n.jsxRuntimeExports.jsxs(k.Flex,{className:"FormControl__Container",flexDirection:x?"row":"column",w:x?"max-content":"100%",gap:2,children:[b&&c==="start"&&T,n.jsxRuntimeExports.jsxs(k.Flex,{className:"FormControl__Content",alignItems:"center",gap:2,w:x?"max-content":"100%",children:[n.jsxRuntimeExports.jsx(e,{disabled:s,invalid:p,onContrast:m,readOnly:f,required:u,size:R,...g}),N&&p&&n.jsxRuntimeExports.jsx(G.Icon,{className:"FormControl__InvalidIcon",name:"warningSign",variant:y,size:R})]}),b&&c==="end"&&T]}),v&&p&&n.jsxRuntimeExports.jsx(de,{className:"FormControl__ErrorText",fontSize:"xs",color:m?"text.danger.contrast":"text.danger",children:t}),d&&n.jsxRuntimeExports.jsx(le,{className:"FormControl__HelperText",fontSize:"xs",color:m?"text.subtle.contrast":"text.subtle",children:d})]})};return r.displayName=`withFormControl(${e.displayName||e.name}`,r};exports.withFormControl=xe;
|
|
2
|
+
//# sourceMappingURL=withFormControl-C8knrDok.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withFormControl-CZAP4VgX.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'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 './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\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 './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\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 './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const id = props.id ?? useId();\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const win = getWindow(rootNode);\n const doc = win.document;\n const checkTextElements = () => {\n setHasErrorText(!!doc.getElementById(errorTextId));\n setHasHelperText(!!doc.getElementById(helperTextId));\n };\n checkTextElements();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from \"./withFormControl.types\";\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from \"react\";\nimport { Field } from \"@chakra-ui/react/field\";\nimport {\n FormControlLabelPosition,\n FormControlSize,\n} from \"./withFormControl.types\";\nimport { SystemStyleObject } from \"@chakra-ui/react/styled-system\";\nimport { TypographyVariant } from \"shared/types/typography\";\nimport { Text } from \"components/Text/text.component\";\nimport { optionalTextSizeMap } from \"./withFormControl.records\";\nimport { fontSizes } from \"theme/tokens/typography/typography.records\";\nimport { Flex } from \"@chakra-ui/react/flex\";\nimport { Icon } from \"components/Icon/icon.component\";\n\nexport interface WithFormControlProps {\n disabled?: boolean;\n errorText?: string;\n formControlStyle?: SystemStyleObject;\n fullWidth?: boolean;\n helperText?: string;\n inlineField?: boolean;\n invalid?: boolean;\n invalidIconColor?: TypographyVariant;\n label?: string | React.ReactNode;\n labelPosition?: FormControlLabelPosition;\n labelStyle?: SystemStyleObject;\n onContrast?: boolean;\n readOnly?: boolean;\n required?: boolean;\n showOptionalElement?: boolean;\n size?: FormControlSize;\n useInvalidIcon?: boolean;\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = \"Field is invalid\",\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = \"danger\",\n label,\n labelPosition = \"start\",\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = \"md\",\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? \"text.contrast\" : \"text\"}\n fontSize={fontSizes[size]}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {label}\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n variant={onContrast ? \"subtleOnContrast\" : \"subtle\"}\n fontSize={optionalTextSizeMap[size]}\n >\n {\" \"}\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? \"100%\" : \"auto\"}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? \"row\" : \"column\"}\n w={inlineField ? \"max-content\" : \"100%\"}\n gap={2}\n >\n {label && labelPosition === \"start\" && labelComponent}\n <Flex\n className=\"FormControl__Content\"\n alignItems=\"center\"\n gap={2}\n w={inlineField ? \"max-content\" : \"100%\"}\n >\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon\n className=\"FormControl__InvalidIcon\"\n name=\"warningSign\"\n variant={invalidIconColor}\n size={size}\n />\n )}\n </Flex>\n {label && labelPosition === \"end\" && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.subtle.contrast\" : \"text.subtle\"}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","id","useId","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","win","getWindow","doc","checkTextElements","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":"2yBAOMA,EAAiBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAChD,MAAMC,EAAQC,EAAAA,gBAAiB,EACzBC,EAAcC,EAAU,WAACH,EAAM,kBAAiB,EAAIF,CAAK,EAC/D,OAAIE,GAAO,QACcI,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,IAAAH,EAAK,EAEvD,IACT,CAAC,EACDH,EAAe,YAAc,iBCR7B,MAAMU,EAAkBT,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACjD,MAAMC,EA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AAK,EACL,EAAGjB,EAAc,cAAgB,OAEjC,SAAA,CAAAjG,EAAA,kBAAA,IAAC2F,EAAA,CACC,SAAA9E,EACA,QAAAC,EACA,WAAAwF,EACA,SAAAvF,EACA,SAAAC,EACA,KAAAwF,EACC,GAAI9G,CAAA,CACP,EACC+G,GAAkB3F,GACjBd,EAAA,kBAAA,IAAC2D,EAAA,KAAA,CACC,UAAU,2BACV,KAAK,cACL,QAASuC,EACT,KAAAM,CAAA,CAAA,CACF,CAAA,CAEJ,EACCL,GAASC,IAAkB,OAASO,CAAA,CAAA,CACvC,EACCD,GAAkB5F,GACjBd,EAAA,kBAAA,IAACmF,GAAA,CACC,UAAU,yBACV,SAAS,KACT,MAAOmB,EAAa,uBAAyB,cAE5C,SAAAT,CAAA,CACH,EAEDG,GACChG,EAAA,kBAAA,IAACkF,GAAA,CACC,UAAU,0BACV,SAAS,KACT,MAAOoB,EAAa,uBAAyB,cAE5C,SAAAN,CAAA,CAAA,CACH,CAAA,CAEJ,CAEJ,EACA,OAAAJ,EAAgB,YAAc,mBAAmBD,EAAU,aAAeA,EAAU,IAAI,GAEjFC,CACT","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
|
1
|
+
{"version":3,"file":"withFormControl-C8knrDok.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'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 './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\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 './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\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 './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const id = props.id ?? useId();\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const win = getWindow(rootNode);\n const doc = win.document;\n const checkTextElements = () => {\n setHasErrorText(!!doc.getElementById(errorTextId));\n setHasHelperText(!!doc.getElementById(helperTextId));\n };\n checkTextElements();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from \"./withFormControl.types\";\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from \"react\";\nimport { Field } from \"@chakra-ui/react/field\";\nimport {\n FormControlLabelPosition,\n FormControlSize,\n} from \"./withFormControl.types\";\nimport { SystemStyleObject } from \"@chakra-ui/react/styled-system\";\nimport { TypographyVariant } from \"shared/types/typography\";\nimport { Text } from \"components/Text/text.component\";\nimport { optionalTextSizeMap } from \"./withFormControl.records\";\nimport { fontSizes } from \"theme/tokens/typography/typography.records\";\nimport { Flex } from \"@chakra-ui/react/flex\";\nimport { Icon } from \"components/Icon/icon.component\";\n\nexport interface WithFormControlProps {\n disabled?: boolean;\n errorText?: string;\n formControlStyle?: SystemStyleObject;\n fullWidth?: boolean;\n helperText?: string;\n inlineField?: boolean;\n invalid?: boolean;\n invalidIconColor?: TypographyVariant;\n label?: string | React.ReactNode;\n labelPosition?: FormControlLabelPosition;\n labelStyle?: SystemStyleObject;\n onContrast?: boolean;\n readOnly?: boolean;\n required?: boolean;\n showOptionalElement?: boolean;\n size?: FormControlSize;\n useInvalidIcon?: boolean;\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = \"Field is invalid\",\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = \"danger\",\n label,\n labelPosition = \"start\",\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = \"md\",\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? \"text.contrast\" : \"text\"}\n fontSize={fontSizes[size]}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {label}\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n variant={onContrast ? \"subtleOnContrast\" : \"subtle\"}\n fontSize={optionalTextSizeMap[size]}\n >\n {\" \"}\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? \"100%\" : \"auto\"}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? \"row\" : \"column\"}\n w={inlineField ? \"max-content\" : \"100%\"}\n gap={2}\n >\n {label && labelPosition === \"start\" && labelComponent}\n <Flex\n className=\"FormControl__Content\"\n alignItems=\"center\"\n gap={2}\n w={inlineField ? \"max-content\" : \"100%\"}\n >\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon\n className=\"FormControl__InvalidIcon\"\n name=\"warningSign\"\n variant={invalidIconColor}\n size={size}\n />\n )}\n </Flex>\n {label && labelPosition === \"end\" && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.subtle.contrast\" : \"text.subtle\"}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","id","useId","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","win","getWindow","doc","checkTextElements","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":"2yBAOMA,EAAiBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAChD,MAAMC,EAAQC,EAAAA,gBAAiB,EACzBC,EAAcC,EAAU,WAACH,EAAM,kBAAiB,EAAIF,CAAK,EAC/D,OAAIE,GAAO,QACcI,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,IAAAH,EAAK,EAEvD,IACT,CAAC,EACDH,EAAe,YAAc,iBCR7B,MAAMU,EAAkBT,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACjD,MAAMC,EAAQC,EAAAA,gBAAiB,EACzBC,EAAcC,EAAU,WAACH,GAAO,mBAAkB,EAAIF,CAAK,EACjE,OAAuBM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AA9E,EACA,QAAAC,EACA,WAAAwF,EACA,SAAAvF,EACA,SAAAC,EACA,KAAAwF,EACC,GAAI9G,CAAA,CACP,EACC+G,GAAkB3F,GACjBd,EAAA,kBAAA,IAAC2D,EAAA,KAAA,CACC,UAAU,2BACV,KAAK,cACL,QAASuC,EACT,KAAAM,CAAA,CAAA,CACF,CAAA,CAEJ,EACCL,GAASC,IAAkB,OAASO,CAAA,CAAA,CACvC,EACCD,GAAkB5F,GACjBd,EAAA,kBAAA,IAACmF,GAAA,CACC,UAAU,yBACV,SAAS,KACT,MAAOmB,EAAa,uBAAyB,cAE5C,SAAAT,CAAA,CACH,EAEDG,GACChG,EAAA,kBAAA,IAACkF,GAAA,CACC,UAAU,0BACV,SAAS,KACT,MAAOoB,EAAa,uBAAyB,cAE5C,SAAAN,CAAA,CAAA,CACH,CAAA,CAEJ,CAEJ,EACA,OAAAJ,EAAgB,YAAc,mBAAmBD,EAAU,aAAeA,EAAU,IAAI,GAEjFC,CACT","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as o } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { W as Q } from "./
|
|
2
|
+
import { W as Q } from "./text.component-Ck6rZy2v.js";
|
|
3
3
|
import { p as g, f as U } from "./typography.records-H4aA5AOA.js";
|
|
4
4
|
import { I as V } from "./icon.component-DGNCL1Yc.js";
|
|
5
5
|
import { F as q } from "./flex-smlF8uQG.js";
|
|
@@ -373,4 +373,4 @@ const ve = T(function(t, r) {
|
|
|
373
373
|
export {
|
|
374
374
|
Be as w
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=withFormControl-
|
|
376
|
+
//# sourceMappingURL=withFormControl-CwPfUb2g.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withFormControl-8TClG0uv.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'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 './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\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 './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\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 './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const id = props.id ?? useId();\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const win = getWindow(rootNode);\n const doc = win.document;\n const checkTextElements = () => {\n setHasErrorText(!!doc.getElementById(errorTextId));\n setHasHelperText(!!doc.getElementById(helperTextId));\n };\n checkTextElements();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from \"./withFormControl.types\";\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from \"react\";\nimport { Field } from \"@chakra-ui/react/field\";\nimport {\n FormControlLabelPosition,\n FormControlSize,\n} from \"./withFormControl.types\";\nimport { SystemStyleObject } from \"@chakra-ui/react/styled-system\";\nimport { TypographyVariant } from \"shared/types/typography\";\nimport { Text } from \"components/Text/text.component\";\nimport { optionalTextSizeMap } from \"./withFormControl.records\";\nimport { fontSizes } from \"theme/tokens/typography/typography.records\";\nimport { Flex } from \"@chakra-ui/react/flex\";\nimport { Icon } from \"components/Icon/icon.component\";\n\nexport interface WithFormControlProps {\n disabled?: boolean;\n errorText?: string;\n formControlStyle?: SystemStyleObject;\n fullWidth?: boolean;\n helperText?: string;\n inlineField?: boolean;\n invalid?: boolean;\n invalidIconColor?: TypographyVariant;\n label?: string | React.ReactNode;\n labelPosition?: FormControlLabelPosition;\n labelStyle?: SystemStyleObject;\n onContrast?: boolean;\n readOnly?: boolean;\n required?: boolean;\n showOptionalElement?: boolean;\n size?: FormControlSize;\n useInvalidIcon?: boolean;\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = \"Field is invalid\",\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = \"danger\",\n label,\n labelPosition = \"start\",\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = \"md\",\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? \"text.contrast\" : \"text\"}\n fontSize={fontSizes[size]}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {label}\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n variant={onContrast ? \"subtleOnContrast\" : \"subtle\"}\n fontSize={optionalTextSizeMap[size]}\n >\n {\" \"}\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? \"100%\" : \"auto\"}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? \"row\" : \"column\"}\n w={inlineField ? \"max-content\" : \"100%\"}\n gap={2}\n >\n {label && labelPosition === \"start\" && labelComponent}\n <Flex\n className=\"FormControl__Content\"\n alignItems=\"center\"\n gap={2}\n w={inlineField ? \"max-content\" : \"100%\"}\n >\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon\n className=\"FormControl__InvalidIcon\"\n name=\"warningSign\"\n variant={invalidIconColor}\n size={size}\n />\n )}\n </Flex>\n {label && labelPosition === \"end\" && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.subtle.contrast\" : \"text.subtle\"}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","id","useId","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","win","getWindow","doc","checkTextElements","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":";;;;;;;;;;;;;AAOA,MAAMA,IAAiBC,EAAW,CAACC,GAAOC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","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
|
1
|
+
{"version":3,"file":"withFormControl-CwPfUb2g.js","sources":["../../node_modules/@ark-ui/react/dist/components/field/field-error-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-helper-text.js","../../node_modules/@ark-ui/react/dist/components/field/field-label.js","../../node_modules/@ark-ui/react/dist/utils/use-safe-layout-effect.js","../../node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js","../../node_modules/@ark-ui/react/dist/components/field/use-field.js","../../node_modules/@ark-ui/react/dist/components/field/field-root.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/icon/create-icon.js","../../node_modules/@chakra-ui/react/dist/esm/components/field/field.js","../../src/hocs/withFormControl/withFormControl.records.ts","../../src/hocs/withFormControl/withFormControl.tsx"],"sourcesContent":["'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 './use-field-context.js';\n\nconst FieldErrorText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field.getErrorTextProps(), props);\n if (field?.invalid) {\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n }\n return null;\n});\nFieldErrorText.displayName = \"FieldErrorText\";\n\nexport { FieldErrorText };\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 './use-field-context.js';\n\nconst FieldHelperText = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getHelperTextProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nFieldHelperText.displayName = \"FieldHelperText\";\n\nexport { FieldHelperText };\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 './use-field-context.js';\n\nconst FieldLabel = forwardRef((props, ref) => {\n const field = useFieldContext();\n const mergedProps = mergeProps(field?.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });\n});\nFieldLabel.displayName = \"FieldLabel\";\n\nexport { FieldLabel };\n","'use client';\nimport { useLayoutEffect, useEffect } from 'react';\n\nconst useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useSafeLayoutEffect };\n","'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [FieldsetProvider, useFieldsetContext] = createContext({\n name: \"FieldsetContext\",\n hookName: \"useFieldsetContext\",\n providerName: \"<FieldsetProvider />\",\n strict: false\n});\n\nexport { FieldsetProvider, useFieldsetContext };\n","'use client';\nimport { getWindow, dataAttr, ariaAttr } from '@zag-js/dom-query';\nimport { useState, useId, useRef, useMemo } from 'react';\nimport { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';\nimport { useFieldsetContext } from '../fieldset/use-fieldset-context.js';\nimport { parts } from './field.anatomy.js';\n\nconst useField = (props = {}) => {\n const fieldset = useFieldsetContext();\n const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;\n const [hasErrorText, setHasErrorText] = useState(false);\n const [hasHelperText, setHasHelperText] = useState(false);\n const id = props.id ?? useId();\n const rootRef = useRef(null);\n const rootId = ids?.control ?? `field::${id}`;\n const errorTextId = ids?.errorText ?? `field::${id}::error-text`;\n const helperTextId = ids?.helperText ?? `field::${id}::helper-text`;\n const labelId = ids?.label ?? `field::${id}::label`;\n useSafeLayoutEffect(() => {\n const rootNode = rootRef.current;\n if (!rootNode) return;\n const win = getWindow(rootNode);\n const doc = win.document;\n const checkTextElements = () => {\n setHasErrorText(!!doc.getElementById(errorTextId));\n setHasHelperText(!!doc.getElementById(helperTextId));\n };\n checkTextElements();\n const observer = new win.MutationObserver(checkTextElements);\n observer.observe(rootNode, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, [errorTextId, helperTextId]);\n const labelIds = useMemo(() => {\n const ids2 = [];\n if (hasErrorText && invalid) ids2.push(errorTextId);\n if (hasHelperText) ids2.push(helperTextId);\n return ids2.join(\" \") || void 0;\n }, [invalid, errorTextId, helperTextId, hasErrorText, hasHelperText]);\n const getRootProps = useMemo(\n () => () => ({\n ...parts.root.attrs,\n id: rootId,\n ref: rootRef,\n role: \"group\",\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly)\n }),\n [disabled, invalid, readOnly, rootId]\n );\n const getLabelProps = useMemo(\n () => () => ({\n ...parts.label.attrs,\n id: labelId,\n \"data-disabled\": dataAttr(disabled),\n \"data-invalid\": dataAttr(invalid),\n \"data-readonly\": dataAttr(readOnly),\n htmlFor: id\n }),\n [disabled, invalid, readOnly, id, labelId]\n );\n const getControlProps = useMemo(\n () => () => ({\n \"aria-describedby\": labelIds,\n \"aria-invalid\": ariaAttr(invalid),\n \"data-invalid\": dataAttr(invalid),\n \"data-required\": dataAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n id,\n required,\n disabled,\n readOnly\n }),\n [labelIds, invalid, required, readOnly, id, disabled]\n );\n const getInputProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.input.attrs\n }),\n [getControlProps]\n );\n const getTextareaProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.textarea.attrs\n }),\n [getControlProps]\n );\n const getSelectProps = useMemo(\n () => () => ({\n ...getControlProps(),\n ...parts.select.attrs\n }),\n [getControlProps]\n );\n const getHelperTextProps = useMemo(\n () => () => ({\n id: helperTextId,\n ...parts.helperText.attrs,\n \"data-disabled\": dataAttr(disabled)\n }),\n [disabled, helperTextId]\n );\n const getErrorTextProps = useMemo(\n () => () => ({\n id: errorTextId,\n ...parts.errorText.attrs,\n \"aria-live\": \"polite\"\n }),\n [errorTextId]\n );\n const getRequiredIndicatorProps = useMemo(\n () => () => ({\n \"aria-hidden\": true,\n ...parts.requiredIndicator.attrs\n }),\n []\n );\n return {\n ariaDescribedby: labelIds,\n ids: {\n root: rootId,\n control: id,\n label: labelId,\n errorText: errorTextId,\n helperText: helperTextId\n },\n refs: {\n rootRef\n },\n disabled,\n invalid,\n readOnly,\n required,\n getLabelProps,\n getRootProps,\n getInputProps,\n getTextareaProps,\n getSelectProps,\n getHelperTextProps,\n getErrorTextProps,\n getRequiredIndicatorProps\n };\n};\n\nexport { useField };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { composeRefs } from '../../utils/compose-refs.js';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useField } from './use-field.js';\nimport { FieldProvider } from './use-field-context.js';\n\nconst FieldRoot = forwardRef((props, ref) => {\n const [useFieldProps, localProps] = createSplitProps()(props, [\n \"id\",\n \"ids\",\n \"disabled\",\n \"invalid\",\n \"readOnly\",\n \"required\"\n ]);\n const field = useField(useFieldProps);\n const mergedProps = mergeProps(field.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(FieldProvider, { value: field, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(ref, field.refs.rootRef) }) });\n});\nFieldRoot.displayName = \"FieldRoot\";\n\nexport { FieldRoot };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createRecipeContext } from '../../styled-system/create-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst { useRecipeResult, PropsProvider } = createRecipeContext({ key: \"icon\" });\nconst Icon = React.forwardRef(\n function Icon2(props, ref) {\n const {\n styles,\n className,\n props: otherProps\n } = useRecipeResult({ asChild: !props.as, ...props });\n return /* @__PURE__ */ jsx(\n chakra.svg,\n {\n ref,\n focusable: false,\n \"aria-hidden\": \"true\",\n ...otherProps,\n css: [styles, props.css],\n className: cx(className, props.className)\n }\n );\n }\n);\nconst IconPropsProvider = PropsProvider;\n\nexport { Icon, IconPropsProvider };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Children, forwardRef } from 'react';\nimport { Icon } from './icon.js';\n\nfunction createIcon(options) {\n const {\n viewBox = \"0 0 24 24\",\n d: pathDefinition,\n displayName,\n defaultProps = {}\n } = options;\n const path = Children.toArray(options.path);\n const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(\n Icon,\n {\n ref,\n asChild: false,\n viewBox,\n ...defaultProps,\n ...props,\n children: path.length ? path : /* @__PURE__ */ jsx(\"path\", { fill: \"currentColor\", d: pathDefinition })\n }\n ));\n Comp.displayName = displayName;\n return Comp;\n}\n\nexport { createIcon };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Field, useFieldContext } from '@ark-ui/react/field';\nimport { forwardRef } from 'react';\nimport { cx } from '../../utils/cx.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { createIcon } from '../icon/create-icon.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useFieldStyles,\n useClassNames,\n PropsProvider\n} = createSlotRecipeContext({ key: \"field\" });\nconst FieldRoot = withProvider(\n Field.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst FieldPropsProvider = PropsProvider;\nconst FieldLabel = withContext(\n Field.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst FieldHelperText = withContext(Field.HelperText, \"helperText\", { forwardAsChild: true });\nconst FieldErrorText = withContext(\n Field.ErrorText,\n \"errorText\",\n { forwardAsChild: true }\n);\nconst FieldErrorIcon = createIcon({\n d: \"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z\"\n});\nconst FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref) {\n const { fallback, children = \"*\", ...restProps } = props;\n const field = useFieldContext();\n const classNames = useClassNames();\n const styles = useFieldStyles();\n if (!field?.required) {\n return fallback;\n }\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"aria-hidden\": \"true\",\n ...restProps,\n className: cx(classNames.requiredIndicator, props.className),\n css: [styles.requiredIndicator, props.css],\n children\n }\n );\n});\n\nexport { FieldErrorIcon, FieldErrorText, FieldHelperText, FieldLabel, FieldPropsProvider, FieldRequiredIndicator, FieldRoot, useFieldStyles };\n","import { FormControlSize } from \"./withFormControl.types\";\n\nexport const optionalTextSizeMap: Record<FormControlSize, number> = {\n sm: 10,\n md: 12,\n lg: 14,\n};\n","import React from \"react\";\nimport { Field } from \"@chakra-ui/react/field\";\nimport {\n FormControlLabelPosition,\n FormControlSize,\n} from \"./withFormControl.types\";\nimport { SystemStyleObject } from \"@chakra-ui/react/styled-system\";\nimport { TypographyVariant } from \"shared/types/typography\";\nimport { Text } from \"components/Text/text.component\";\nimport { optionalTextSizeMap } from \"./withFormControl.records\";\nimport { fontSizes } from \"theme/tokens/typography/typography.records\";\nimport { Flex } from \"@chakra-ui/react/flex\";\nimport { Icon } from \"components/Icon/icon.component\";\n\nexport interface WithFormControlProps {\n disabled?: boolean;\n errorText?: string;\n formControlStyle?: SystemStyleObject;\n fullWidth?: boolean;\n helperText?: string;\n inlineField?: boolean;\n invalid?: boolean;\n invalidIconColor?: TypographyVariant;\n label?: string | React.ReactNode;\n labelPosition?: FormControlLabelPosition;\n labelStyle?: SystemStyleObject;\n onContrast?: boolean;\n readOnly?: boolean;\n required?: boolean;\n showOptionalElement?: boolean;\n size?: FormControlSize;\n useInvalidIcon?: boolean;\n useInvalidText?: boolean;\n}\n\nexport const withFormControl = <P extends WithFormControlProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> => {\n const WithFormControl = ({\n disabled = false,\n errorText = \"Field is invalid\",\n formControlStyle,\n fullWidth = true,\n helperText,\n inlineField = false,\n invalid = false,\n invalidIconColor = \"danger\",\n label,\n labelPosition = \"start\",\n labelStyle,\n onContrast = false,\n readOnly = false,\n required = false,\n showOptionalElement = false,\n size = \"md\",\n useInvalidIcon = false,\n useInvalidText = true,\n ...props\n }: WithFormControlProps): React.JSX.Element => {\n const labelComponent = (\n <Field.Label\n className=\"FormControl__Label\"\n color={onContrast ? \"text.contrast\" : \"text\"}\n fontSize={fontSizes[size]}\n {...labelStyle}\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {label}\n <Field.RequiredIndicator\n className=\"FormControl__RequiredIndicator\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n {...(!required && {\n fallback: showOptionalElement ? (\n <Text\n variant={onContrast ? \"subtleOnContrast\" : \"subtle\"}\n fontSize={optionalTextSizeMap[size]}\n >\n {\" \"}\n (Optional)\n </Text>\n ) : (\n <></>\n ),\n })}\n />\n </Field.Label>\n );\n\n return (\n <Field.Root\n className=\"FormControl group\"\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n required={required}\n width={fullWidth ? \"100%\" : \"auto\"}\n {...formControlStyle}\n >\n <Flex\n className=\"FormControl__Container\"\n flexDirection={inlineField ? \"row\" : \"column\"}\n w={inlineField ? \"max-content\" : \"100%\"}\n gap={2}\n >\n {label && labelPosition === \"start\" && labelComponent}\n <Flex\n className=\"FormControl__Content\"\n alignItems=\"center\"\n gap={2}\n w={inlineField ? \"max-content\" : \"100%\"}\n >\n <Component\n disabled={disabled}\n invalid={invalid}\n onContrast={onContrast}\n readOnly={readOnly}\n required={required}\n size={size}\n {...(props as P)}\n />\n {useInvalidIcon && invalid && (\n <Icon\n className=\"FormControl__InvalidIcon\"\n name=\"warningSign\"\n variant={invalidIconColor}\n size={size}\n />\n )}\n </Flex>\n {label && labelPosition === \"end\" && labelComponent}\n </Flex>\n {useInvalidText && invalid && (\n <Field.ErrorText\n className=\"FormControl__ErrorText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.danger.contrast\" : \"text.danger\"}\n >\n {errorText}\n </Field.ErrorText>\n )}\n {helperText && (\n <Field.HelperText\n className=\"FormControl__HelperText\"\n fontSize=\"xs\"\n color={onContrast ? \"text.subtle.contrast\" : \"text.subtle\"}\n >\n {helperText}\n </Field.HelperText>\n )}\n </Field.Root>\n );\n };\n WithFormControl.displayName = `withFormControl(${Component.displayName || Component.name}`;\n\n return WithFormControl;\n};\n"],"names":["FieldErrorText","forwardRef","props","ref","field","useFieldContext","mergedProps","mergeProps","jsx","ark","FieldHelperText","FieldLabel","useSafeLayoutEffect","useLayoutEffect","useEffect","FieldsetProvider","useFieldsetContext","createContext","useField","fieldset","ids","disabled","invalid","readOnly","required","hasErrorText","setHasErrorText","useState","hasHelperText","setHasHelperText","id","useId","rootRef","useRef","rootId","errorTextId","helperTextId","labelId","rootNode","win","getWindow","doc","checkTextElements","observer","labelIds","useMemo","ids2","getRootProps","parts","dataAttr","getLabelProps","getControlProps","ariaAttr","getInputProps","getTextareaProps","getSelectProps","getHelperTextProps","getErrorTextProps","getRequiredIndicatorProps","FieldRoot","useFieldProps","localProps","createSplitProps","FieldProvider","composeRefs","useRecipeResult","createRecipeContext","Icon","React","styles","className","otherProps","chakra","cx","createIcon","options","viewBox","pathDefinition","displayName","defaultProps","path","Children","Comp","withProvider","withContext","useFieldStyles","useClassNames","createSlotRecipeContext","Field.Root","Field.Label","Field.HelperText","Field.ErrorText","FieldRequiredIndicator","fallback","children","restProps","classNames","optionalTextSizeMap","withFormControl","Component","WithFormControl","errorText","formControlStyle","fullWidth","helperText","inlineField","invalidIconColor","label","labelPosition","labelStyle","onContrast","showOptionalElement","size","useInvalidIcon","useInvalidText","labelComponent","jsxs","fontSizes","e","Field.RequiredIndicator","Text","Fragment","Flex"],"mappings":";;;;;;;;;;;;;AAOA,MAAMA,IAAiBC,EAAW,CAACC,GAAOC,MAAQ;AAChD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,EAAM,kBAAiB,GAAIF,CAAK;AAC/D,SAAIE,GAAO,UACcI,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK,IAEvD;AACT,CAAC;AACDH,EAAe,cAAc;ACR7B,MAAMU,IAAkBT,EAAW,CAACC,GAAOC,MAAQ;AACjD,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,mBAAkB,GAAIF,CAAK;AACjE,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC9D,CAAC;AACDO,EAAgB,cAAc;ACL9B,MAAMC,IAAaV,EAAW,CAACC,GAAOC,MAAQ;AAC5C,QAAMC,IAAQC,EAAiB,GACzBC,IAAcC,EAAWH,GAAO,cAAa,GAAIF,CAAK;AAC5D,SAAuBM,gBAAAA,EAAAA,IAAIC,EAAI,OAAO,EAAE,GAAGH,GAAa,KAAAH,GAAK;AAC/D,CAAC;AACDQ,EAAW,cAAc;ACTzB,MAAMC,KAAsB,OAAO,SAAW,MAAcC,IAAkBC,ICAxE,CAACC,IAAkBC,EAAkB,IAAIC,GAAc;AAAA,EAC3D,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAAA,EACd,QAAQ;AACV,CAAC,GCDKC,KAAW,CAAChB,IAAQ,OAAO;AAC/B,QAAMiB,IAAWH,GAAoB,GAC/B,EAAE,KAAAI,GAAK,UAAAC,IAAW,EAAQF,GAAU,UAAW,SAAAG,IAAU,IAAO,UAAAC,IAAW,IAAO,UAAAC,IAAW,GAAO,IAAGtB,GACvG,CAACuB,GAAcC,CAA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N;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAEJ;AAAA,EAEJ;AACA,SAAAJ,EAAgB,cAAc,mBAAmBD,EAAU,eAAeA,EAAU,IAAI,IAEjFC;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const i=require("./jsx-runtime-BjDatQAs.js"),e=require("react"),p=require("./tooltip.component-Dq7F5JIs.js"),w=require("./box-Baq7UBls.js"),h=s=>{const l=e.memo(s);function x({truncated:o=!1,noOfLines:f=1,children:c,tooltipProps:d,...m}){const[b,T]=e.useState(!1),t=e.useRef(null),r=e.useRef(null),u=e.useCallback(()=>{if(t.current){const n=t.current?.children[0].scrollHeight||0,a=t.current?.offsetHeight||0;T(n>a)}},[]);return e.useEffect(()=>{if(o&&t.current){let n;const a=()=>{window.clearTimeout(n),n=window.setTimeout(u,100)};return r.current=new ResizeObserver(()=>{a()}),r.current.observe(t.current),u(),()=>{window.clearTimeout(n),r.current&&r.current.disconnect()}}},[o,u]),o?i.jsxRuntimeExports.jsx(p.Tooltip,{...d,label:d?.label||c?.toLocaleString()||"",disabled:!b,"data-testid":"kibble-truncated-text-tooltip",children:i.jsxRuntimeExports.jsx(w.Box,{ref:t,display:"inline-block",position:"relative",className:"TruncatedText__Wrapper","data-testid":"kibble-truncated-text-wrapper",children:i.jsxRuntimeExports.jsx(l,{className:"TruncatedText__TextContent","data-testid":"kibble-truncated-text-content",lineClamp:f,...m,children:c})})}):i.jsxRuntimeExports.jsx(l,{...m,children:c})}return x.displayName=`withTruncation(${s.displayName||s.name}`,e.memo(x)};exports.withTruncation=h;
|
|
2
|
+
//# sourceMappingURL=withTruncation-C_btJ8Nx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withTruncation-C_btJ8Nx.js","sources":["../../src/hocs/withTruncation.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n memo,\n} from \"react\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { Tooltip, TooltipProps } from \"components/Tooltip\";\n\nexport interface WithTruncationProps {\n truncated?: boolean;\n noOfLines?: number;\n tooltipProps?: Omit<TooltipProps, \"disabled\">;\n children?: ReactNode | string;\n}\n\nexport const withTruncation = <P extends WithTruncationProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> => {\n const MemoizedComponent = memo(Component);\n\n function WithTruncation({\n truncated = false,\n noOfLines = 1,\n children,\n tooltipProps,\n ...rest\n }: WithTruncationProps): React.JSX.Element {\n const [isTextOverFlowing, setIsTextOverFlowing] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkOverflow = useCallback(() => {\n if (containerRef.current) {\n const textScrollHeight =\n containerRef.current?.children[0].scrollHeight || 0;\n const containerOffsetHeight = containerRef.current?.offsetHeight || 0;\n setIsTextOverFlowing(textScrollHeight > containerOffsetHeight);\n }\n }, []);\n\n useEffect(() => {\n if (truncated && containerRef.current) {\n let timeoutId: number;\n\n const debouncedCheck = (): void => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(checkOverflow, 100);\n };\n\n resizeObserverRef.current = new ResizeObserver(() => {\n debouncedCheck();\n });\n\n resizeObserverRef.current.observe(containerRef.current);\n checkOverflow(); // Initial check\n\n return (): void => {\n window.clearTimeout(timeoutId);\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n };\n }\n }, [truncated, checkOverflow]);\n\n if (!truncated) {\n return <MemoizedComponent {...(rest as P)}>{children}</MemoizedComponent>;\n }\n\n return (\n <Tooltip\n {...tooltipProps}\n label={tooltipProps?.label || children?.toLocaleString() || \"\"}\n disabled={!isTextOverFlowing}\n data-testid=\"kibble-truncated-text-tooltip\"\n >\n <Box\n ref={containerRef}\n display=\"inline-block\"\n position=\"relative\"\n className=\"TruncatedText__Wrapper\"\n data-testid=\"kibble-truncated-text-wrapper\"\n >\n <MemoizedComponent\n className=\"TruncatedText__TextContent\"\n data-testid=\"kibble-truncated-text-content\"\n lineClamp={noOfLines}\n {...(rest as P)}\n >\n {children}\n </MemoizedComponent>\n </Box>\n </Tooltip>\n );\n }\n\n WithTruncation.displayName = `withTruncation(${Component.displayName || Component.name}`;\n\n return memo(WithTruncation);\n};\n"],"names":["withTruncation","Component","MemoizedComponent","memo","WithTruncation","truncated","noOfLines","children","tooltipProps","rest","isTextOverFlowing","setIsTextOverFlowing","useState","containerRef","useRef","resizeObserverRef","checkOverflow","useCallback","textScrollHeight","containerOffsetHeight","useEffect","timeoutId","debouncedCheck","jsx","Tooltip","Box"],"mappings":"yJAkBaA,EACXC,GACgB,CACV,MAAAC,EAAoBC,OAAKF,CAAS,EAExC,SAASG,EAAe,CACtB,UAAAC,EAAY,GACZ,UAAAC,EAAY,EACZ,SAAAC,EACA,aAAAC,EACA,GAAGC,CAAA,EACsC,CACzC,KAAM,CAACC,EAAmBC,CAAoB,EAAIC,EAAAA,SAAkB,EAAK,EACnEC,EAAeC,SAAuB,IAAI,EAC1CC,EAAoBD,SAA8B,IAAI,EAEtDE,EAAgBC,EAAAA,YAAY,IAAM,CACtC,GAAIJ,EAAa,QAAS,CACxB,MAAMK,EACJL,EAAa,SAAS,SAAS,CAAC,EAAE,cAAgB,EAC9CM,EAAwBN,EAAa,SAAS,cAAgB,EACpEF,EAAqBO,EAAmBC,CAAqB,CAAA,CAEjE,EAAG,EAAE,EA2BL,OAzBAC,EAAAA,UAAU,IAAM,CACV,GAAAf,GAAaQ,EAAa,QAAS,CACjC,IAAAQ,EAEJ,MAAMC,EAAiB,IAAY,CACjC,OAAO,aAAaD,CAAS,EACjBA,EAAA,OAAO,WAAWL,EAAe,GAAG,CAClD,EAEkB,OAAAD,EAAA,QAAU,IAAI,eAAe,IAAM,CACpCO,EAAA,CAAA,CAChB,EAEiBP,EAAA,QAAQ,QAAQF,EAAa,OAAO,EACxCG,EAAA,EAEP,IAAY,CACjB,OAAO,aAAaK,CAAS,EACzBN,EAAkB,SACpBA,EAAkB,QAAQ,WAAW,CAEzC,CAAA,CACF,EACC,CAACV,EAAWW,CAAa,CAAC,EAExBX,EAKHkB,EAAA,kBAAA,IAACC,EAAA,QAAA,CACE,GAAGhB,EACJ,MAAOA,GAAc,OAASD,GAAU,eAAoB,GAAA,GAC5D,SAAU,CAACG,EACX,cAAY,gCAEZ,SAAAa,EAAA,kBAAA,IAACE,EAAA,IAAA,CACC,IAAKZ,EACL,QAAQ,eACR,SAAS,WACT,UAAU,yBACV,cAAY,gCAEZ,SAAAU,EAAA,kBAAA,IAACrB,EAAA,CACC,UAAU,6BACV,cAAY,gCACZ,UAAWI,EACV,GAAIG,EAEJ,SAAAF,CAAA,CAAA,CACH,CAAA,CACF,CACF,EA1BQgB,EAAA,kBAAA,IAAArB,EAAA,CAAmB,GAAIO,EAAa,SAAAF,CAAS,CAAA,CA0BrD,CAIJ,OAAAH,EAAe,YAAc,kBAAkBH,EAAU,aAAeA,EAAU,IAAI,GAE/EE,EAAAA,KAAKC,CAAc,CAC5B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { j as n } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import { memo as m, useState as w, useRef as x, useCallback as h, useEffect as g } from "react";
|
|
3
|
+
import { T as k } from "./tooltip.component-BdlSO_v_.js";
|
|
4
|
+
import { B as v } from "./box-Ck9I7FYv.js";
|
|
5
|
+
const N = (i) => {
|
|
6
|
+
const l = m(i);
|
|
7
|
+
function u({
|
|
8
|
+
truncated: o = !1,
|
|
9
|
+
noOfLines: b = 1,
|
|
10
|
+
children: s,
|
|
11
|
+
tooltipProps: d,
|
|
12
|
+
...f
|
|
13
|
+
}) {
|
|
14
|
+
const [T, p] = w(!1), e = x(null), r = x(null), c = h(() => {
|
|
15
|
+
if (e.current) {
|
|
16
|
+
const t = e.current?.children[0].scrollHeight || 0, a = e.current?.offsetHeight || 0;
|
|
17
|
+
p(t > a);
|
|
18
|
+
}
|
|
19
|
+
}, []);
|
|
20
|
+
return g(() => {
|
|
21
|
+
if (o && e.current) {
|
|
22
|
+
let t;
|
|
23
|
+
const a = () => {
|
|
24
|
+
window.clearTimeout(t), t = window.setTimeout(c, 100);
|
|
25
|
+
};
|
|
26
|
+
return r.current = new ResizeObserver(() => {
|
|
27
|
+
a();
|
|
28
|
+
}), r.current.observe(e.current), c(), () => {
|
|
29
|
+
window.clearTimeout(t), r.current && r.current.disconnect();
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}, [o, c]), o ? /* @__PURE__ */ n.jsx(
|
|
33
|
+
k,
|
|
34
|
+
{
|
|
35
|
+
...d,
|
|
36
|
+
label: d?.label || s?.toLocaleString() || "",
|
|
37
|
+
disabled: !T,
|
|
38
|
+
"data-testid": "kibble-truncated-text-tooltip",
|
|
39
|
+
children: /* @__PURE__ */ n.jsx(
|
|
40
|
+
v,
|
|
41
|
+
{
|
|
42
|
+
ref: e,
|
|
43
|
+
display: "inline-block",
|
|
44
|
+
position: "relative",
|
|
45
|
+
className: "TruncatedText__Wrapper",
|
|
46
|
+
"data-testid": "kibble-truncated-text-wrapper",
|
|
47
|
+
children: /* @__PURE__ */ n.jsx(
|
|
48
|
+
l,
|
|
49
|
+
{
|
|
50
|
+
className: "TruncatedText__TextContent",
|
|
51
|
+
"data-testid": "kibble-truncated-text-content",
|
|
52
|
+
lineClamp: b,
|
|
53
|
+
...f,
|
|
54
|
+
children: s
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
) : /* @__PURE__ */ n.jsx(l, { ...f, children: s });
|
|
61
|
+
}
|
|
62
|
+
return u.displayName = `withTruncation(${i.displayName || i.name}`, m(u);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
N as w
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=withTruncation-D6letsku.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withTruncation-D6letsku.js","sources":["../../src/hocs/withTruncation.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n memo,\n} from \"react\";\nimport { Box } from \"@chakra-ui/react/box\";\nimport { Tooltip, TooltipProps } from \"components/Tooltip\";\n\nexport interface WithTruncationProps {\n truncated?: boolean;\n noOfLines?: number;\n tooltipProps?: Omit<TooltipProps, \"disabled\">;\n children?: ReactNode | string;\n}\n\nexport const withTruncation = <P extends WithTruncationProps>(\n Component: React.ComponentType<P>,\n): React.FC<P> => {\n const MemoizedComponent = memo(Component);\n\n function WithTruncation({\n truncated = false,\n noOfLines = 1,\n children,\n tooltipProps,\n ...rest\n }: WithTruncationProps): React.JSX.Element {\n const [isTextOverFlowing, setIsTextOverFlowing] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n\n const checkOverflow = useCallback(() => {\n if (containerRef.current) {\n const textScrollHeight =\n containerRef.current?.children[0].scrollHeight || 0;\n const containerOffsetHeight = containerRef.current?.offsetHeight || 0;\n setIsTextOverFlowing(textScrollHeight > containerOffsetHeight);\n }\n }, []);\n\n useEffect(() => {\n if (truncated && containerRef.current) {\n let timeoutId: number;\n\n const debouncedCheck = (): void => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(checkOverflow, 100);\n };\n\n resizeObserverRef.current = new ResizeObserver(() => {\n debouncedCheck();\n });\n\n resizeObserverRef.current.observe(containerRef.current);\n checkOverflow(); // Initial check\n\n return (): void => {\n window.clearTimeout(timeoutId);\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n };\n }\n }, [truncated, checkOverflow]);\n\n if (!truncated) {\n return <MemoizedComponent {...(rest as P)}>{children}</MemoizedComponent>;\n }\n\n return (\n <Tooltip\n {...tooltipProps}\n label={tooltipProps?.label || children?.toLocaleString() || \"\"}\n disabled={!isTextOverFlowing}\n data-testid=\"kibble-truncated-text-tooltip\"\n >\n <Box\n ref={containerRef}\n display=\"inline-block\"\n position=\"relative\"\n className=\"TruncatedText__Wrapper\"\n data-testid=\"kibble-truncated-text-wrapper\"\n >\n <MemoizedComponent\n className=\"TruncatedText__TextContent\"\n data-testid=\"kibble-truncated-text-content\"\n lineClamp={noOfLines}\n {...(rest as P)}\n >\n {children}\n </MemoizedComponent>\n </Box>\n </Tooltip>\n );\n }\n\n WithTruncation.displayName = `withTruncation(${Component.displayName || Component.name}`;\n\n return memo(WithTruncation);\n};\n"],"names":["withTruncation","Component","MemoizedComponent","memo","WithTruncation","truncated","noOfLines","children","tooltipProps","rest","isTextOverFlowing","setIsTextOverFlowing","useState","containerRef","useRef","resizeObserverRef","checkOverflow","useCallback","textScrollHeight","containerOffsetHeight","useEffect","timeoutId","debouncedCheck","jsx","Tooltip","Box"],"mappings":";;;;AAkBa,MAAAA,IAAiB,CAC5BC,MACgB;AACV,QAAAC,IAAoBC,EAAKF,CAAS;AAExC,WAASG,EAAe;AAAA,IACtB,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GACsC;AACzC,UAAM,CAACC,GAAmBC,CAAoB,IAAIC,EAAkB,EAAK,GACnEC,IAAeC,EAAuB,IAAI,GAC1CC,IAAoBD,EAA8B,IAAI,GAEtDE,IAAgBC,EAAY,MAAM;AACtC,UAAIJ,EAAa,SAAS;AACxB,cAAMK,IACJL,EAAa,SAAS,SAAS,CAAC,EAAE,gBAAgB,GAC9CM,IAAwBN,EAAa,SAAS,gBAAgB;AACpE,QAAAF,EAAqBO,IAAmBC,CAAqB;AAAA,MAAA;AAAA,IAEjE,GAAG,EAAE;AA2BL,WAzBAC,EAAU,MAAM;AACV,UAAAf,KAAaQ,EAAa,SAAS;AACjC,YAAAQ;AAEJ,cAAMC,IAAiB,MAAY;AACjC,iBAAO,aAAaD,CAAS,GACjBA,IAAA,OAAO,WAAWL,GAAe,GAAG;AAAA,QAClD;AAEkB,eAAAD,EAAA,UAAU,IAAI,eAAe,MAAM;AACpC,UAAAO,EAAA;AAAA,QAAA,CAChB,GAEiBP,EAAA,QAAQ,QAAQF,EAAa,OAAO,GACxCG,EAAA,GAEP,MAAY;AACjB,iBAAO,aAAaK,CAAS,GACzBN,EAAkB,WACpBA,EAAkB,QAAQ,WAAW;AAAA,QAEzC;AAAA,MAAA;AAAA,IACF,GACC,CAACV,GAAWW,CAAa,CAAC,GAExBX,IAKHkB,gBAAAA,EAAA;AAAA,MAACC;AAAA,MAAA;AAAA,QACE,GAAGhB;AAAA,QACJ,OAAOA,GAAc,SAASD,GAAU,eAAoB,KAAA;AAAA,QAC5D,UAAU,CAACG;AAAA,QACX,eAAY;AAAA,QAEZ,UAAAa,gBAAAA,EAAA;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,KAAKZ;AAAA,YACL,SAAQ;AAAA,YACR,UAAS;AAAA,YACT,WAAU;AAAA,YACV,eAAY;AAAA,YAEZ,UAAAU,gBAAAA,EAAA;AAAA,cAACrB;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,eAAY;AAAA,gBACZ,WAAWI;AAAA,gBACV,GAAIG;AAAA,gBAEJ,UAAAF;AAAA,cAAA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MACF;AAAA,IACF,IA1BQgB,gBAAAA,EAAA,IAAArB,GAAA,EAAmB,GAAIO,GAAa,UAAAF,EAAS,CAAA;AAAA,EA0BrD;AAIJ,SAAAH,EAAe,cAAc,kBAAkBH,EAAU,eAAeA,EAAU,IAAI,IAE/EE,EAAKC,CAAc;AAC5B;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/alert.types-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/alert.types-Dl6ivTll.js");exports.Alert=t.Alert;exports.alertButtonPositions=t.alertButtonPositions;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/avatar.component-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../chunks/avatar.component-BdkTgslj.js"),a=require("../../../chunks/avatar.types-Bmt5Uhfb.js");exports.Avatar=t.Avatar;exports.avatarSizes=a.avatarSizes;exports.avatarVariants=a.avatarVariants;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../chunks/avatarGroup.component-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../chunks/avatarGroup.component-BW26RkqL.js");exports.AvatarGroup=r.AvatarGroup;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|