@televet/kibble-ui 4.0.0-beta.103 → 4.0.0-beta.105
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-B-bS7qjd.js → alert.types-BGRyfYMy.js} +3 -3
- package/dist/chunks/{alert.types-B-bS7qjd.js.map → alert.types-BGRyfYMy.js.map} +1 -1
- package/dist/chunks/{alert.types-CIc4IRMS.js → alert.types-BVJZGZh-.js} +2 -2
- package/dist/chunks/{alert.types-CIc4IRMS.js.map → alert.types-BVJZGZh-.js.map} +1 -1
- package/dist/chunks/{avatar.component-B63kpE9P.js → avatar.component-77NanIaH.js} +2 -2
- package/dist/chunks/{avatar.component-B63kpE9P.js.map → avatar.component-77NanIaH.js.map} +1 -1
- package/dist/chunks/{avatar.component-DhVRhVUB.js → avatar.component-Dv96XFOF.js} +2 -2
- package/dist/chunks/{avatar.component-DhVRhVUB.js.map → avatar.component-Dv96XFOF.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-Bv-7rU7a.js → avatarGroup.component-CfSBCJKG.js} +2 -2
- package/dist/chunks/{avatarGroup.component-Bv-7rU7a.js.map → avatarGroup.component-CfSBCJKG.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-S6IBJiRl.js → avatarGroup.component-dNR80_Br.js} +2 -2
- package/dist/chunks/{avatarGroup.component-S6IBJiRl.js.map → avatarGroup.component-dNR80_Br.js.map} +1 -1
- package/dist/chunks/{button.component-DOAhnxbj.js → button.component-Br9jCpBx.js} +2 -2
- package/dist/chunks/{button.component-DOAhnxbj.js.map → button.component-Br9jCpBx.js.map} +1 -1
- package/dist/chunks/{button.component-CY55RWpS.js → button.component-CsJxgblU.js} +2 -2
- package/dist/chunks/{button.component-CY55RWpS.js.map → button.component-CsJxgblU.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-C7pKCvcQ.js → buttonGroup.component-BTvvN-mr.js} +3 -3
- package/dist/chunks/{buttonGroup.component-C7pKCvcQ.js.map → buttonGroup.component-BTvvN-mr.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-Bxg_xRWP.js → buttonGroup.component-Bnd3WutZ.js} +2 -2
- package/dist/chunks/{buttonGroup.component-Bxg_xRWP.js.map → buttonGroup.component-Bnd3WutZ.js.map} +1 -1
- package/dist/chunks/{checkbox.component-DvG5FhBs.js → checkbox.component-CyWf-jhq.js} +2 -2
- package/dist/chunks/{checkbox.component-DvG5FhBs.js.map → checkbox.component-CyWf-jhq.js.map} +1 -1
- package/dist/chunks/{checkbox.component-BbjXZ9Nf.js → checkbox.component-DCO3f8IY.js} +2 -2
- package/dist/chunks/{checkbox.component-BbjXZ9Nf.js.map → checkbox.component-DCO3f8IY.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-ClGERT8x.js → checkboxGroup.component-Cu6qUJOk.js} +3 -3
- package/dist/chunks/{checkboxGroup.component-ClGERT8x.js.map → checkboxGroup.component-Cu6qUJOk.js.map} +1 -1
- package/dist/chunks/{checkboxGroup.component-tnjabq8J.js → checkboxGroup.component-Dwn2XO_5.js} +2 -2
- package/dist/chunks/{checkboxGroup.component-tnjabq8J.js.map → checkboxGroup.component-Dwn2XO_5.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-DXiIGFwM.js → conversationCard.component-ZJ5eqIWf.js} +2 -2
- package/dist/chunks/{conversationCard.component-DXiIGFwM.js.map → conversationCard.component-ZJ5eqIWf.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-FisFG9p8.js → conversationCard.component-aCCQmc5q.js} +5 -5
- package/dist/chunks/{conversationCard.component-FisFG9p8.js.map → conversationCard.component-aCCQmc5q.js.map} +1 -1
- package/dist/chunks/{datePicker.component-D8yWK-mP.js → datePicker.component-B51FbP6R.js} +5 -5
- package/dist/chunks/{datePicker.component-D8yWK-mP.js.map → datePicker.component-B51FbP6R.js.map} +1 -1
- package/dist/chunks/{datePicker.component-BVgI3zPN.js → datePicker.component-C7O_F_ZN.js} +2 -2
- package/dist/chunks/{datePicker.component-BVgI3zPN.js.map → datePicker.component-C7O_F_ZN.js.map} +1 -1
- package/dist/chunks/icon.component-B6R8-DRk.js +2 -0
- package/dist/chunks/icon.component-B6R8-DRk.js.map +1 -0
- package/dist/chunks/{icon.component-DszmCnE4.js → icon.component-S_qFWBRf.js} +7 -7
- package/dist/chunks/icon.component-S_qFWBRf.js.map +1 -0
- package/dist/chunks/{link.component-COw7fL8Z.js → link.component--UJiv0xU.js} +2 -2
- package/dist/chunks/{link.component-COw7fL8Z.js.map → link.component--UJiv0xU.js.map} +1 -1
- package/dist/chunks/{link.component-BeuHEk8s.js → link.component-BCY_f6zw.js} +2 -2
- package/dist/chunks/{link.component-BeuHEk8s.js.map → link.component-BCY_f6zw.js.map} +1 -1
- package/dist/chunks/{menu.component-ChULT3Gr.js → menu.component-DSFy9WEh.js} +5 -5
- package/dist/chunks/{menu.component-ChULT3Gr.js.map → menu.component-DSFy9WEh.js.map} +1 -1
- package/dist/chunks/{menu.component-XFe_M_SC.js → menu.component-MeUyoUF9.js} +2 -2
- package/dist/chunks/{menu.component-XFe_M_SC.js.map → menu.component-MeUyoUF9.js.map} +1 -1
- package/dist/chunks/{modal.types-C1izw_Yq.js → modal.types-CTQpaACU.js} +2 -2
- package/dist/chunks/{modal.types-C1izw_Yq.js.map → modal.types-CTQpaACU.js.map} +1 -1
- package/dist/chunks/{modal.types-DEGvHRn9.js → modal.types-KqIduO4D.js} +2 -2
- package/dist/chunks/{modal.types-DEGvHRn9.js.map → modal.types-KqIduO4D.js.map} +1 -1
- package/dist/chunks/{pinInput.types-BHMFqLSM.js → pinInput.types-CnU27QDl.js} +2 -2
- package/dist/chunks/{pinInput.types-BHMFqLSM.js.map → pinInput.types-CnU27QDl.js.map} +1 -1
- package/dist/chunks/{pinInput.types-DwCLcdqD.js → pinInput.types-DbRKvqia.js} +2 -2
- package/dist/chunks/{pinInput.types-DwCLcdqD.js.map → pinInput.types-DbRKvqia.js.map} +1 -1
- package/dist/chunks/{popover.component-DT3QQWyX.js → popover.component-5a-hEW2o.js} +2 -2
- package/dist/chunks/{popover.component-DT3QQWyX.js.map → popover.component-5a-hEW2o.js.map} +1 -1
- package/dist/chunks/{popover.component-BWj15KxJ.js → popover.component-B1NHpxuL.js} +2 -2
- package/dist/chunks/{popover.component-BWj15KxJ.js.map → popover.component-B1NHpxuL.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-egpalXS-.js → radioGroup.component-BiLIdd0l.js} +2 -2
- package/dist/chunks/{radioGroup.component-egpalXS-.js.map → radioGroup.component-BiLIdd0l.js.map} +1 -1
- package/dist/chunks/{radioGroup.component-BUolfqWr.js → radioGroup.component-CeIyZmZs.js} +3 -3
- package/dist/chunks/{radioGroup.component-BUolfqWr.js.map → radioGroup.component-CeIyZmZs.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-BY26etxR.js → ratingDots.component-BAtcU4JC.js} +2 -2
- package/dist/chunks/{ratingDots.component-BY26etxR.js.map → ratingDots.component-BAtcU4JC.js.map} +1 -1
- package/dist/chunks/{ratingDots.component-CrBOfyId.js → ratingDots.component-bcnQi8kP.js} +2 -2
- package/dist/chunks/{ratingDots.component-CrBOfyId.js.map → ratingDots.component-bcnQi8kP.js.map} +1 -1
- package/dist/chunks/{select.component-CQjAhCI2.js → select.component-29vEA8EQ.js} +2 -2
- package/dist/chunks/{select.component-CQjAhCI2.js.map → select.component-29vEA8EQ.js.map} +1 -1
- package/dist/chunks/{select.component-D9bWpKVf.js → select.component-8Rapwb67.js} +5 -5
- package/dist/chunks/{select.component-D9bWpKVf.js.map → select.component-8Rapwb67.js.map} +1 -1
- package/dist/chunks/{sortableList.component-BWs5CrE2.js → sortableList.component-CPYA3KKy.js} +2 -2
- package/dist/chunks/{sortableList.component-BWs5CrE2.js.map → sortableList.component-CPYA3KKy.js.map} +1 -1
- package/dist/chunks/{sortableList.component-w4xLMCLj.js → sortableList.component-ygB3YKGn.js} +2 -2
- package/dist/chunks/{sortableList.component-w4xLMCLj.js.map → sortableList.component-ygB3YKGn.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-B0IAGnAx.js → styledAvatar.types-9huVpPvU.js} +2 -2
- package/dist/chunks/{styledAvatar.types-B0IAGnAx.js.map → styledAvatar.types-9huVpPvU.js.map} +1 -1
- package/dist/chunks/{styledAvatar.types-CVyai83h.js → styledAvatar.types-BlkNvQyA.js} +2 -2
- package/dist/chunks/{styledAvatar.types-CVyai83h.js.map → styledAvatar.types-BlkNvQyA.js.map} +1 -1
- package/dist/chunks/{swatch.types-DbgA3RWc.js → swatch.types-CtRInwzo.js} +3 -3
- package/dist/chunks/{swatch.types-DbgA3RWc.js.map → swatch.types-CtRInwzo.js.map} +1 -1
- package/dist/chunks/{swatch.types-DiX-4lpJ.js → swatch.types-qncm_zG6.js} +2 -2
- package/dist/chunks/{swatch.types-DiX-4lpJ.js.map → swatch.types-qncm_zG6.js.map} +1 -1
- package/dist/chunks/{switch.component-lN5wISru.js → switch.component-BBep786n.js} +2 -2
- package/dist/chunks/{switch.component-lN5wISru.js.map → switch.component-BBep786n.js.map} +1 -1
- package/dist/chunks/{switch.component-DMj4TPl8.js → switch.component-DghHmo1Q.js} +2 -2
- package/dist/chunks/{switch.component-DMj4TPl8.js.map → switch.component-DghHmo1Q.js.map} +1 -1
- package/dist/chunks/{tabs.component-Dk9EUbWt.js → tabs.component-CjU_OQuN.js} +2 -2
- package/dist/chunks/{tabs.component-Dk9EUbWt.js.map → tabs.component-CjU_OQuN.js.map} +1 -1
- package/dist/chunks/{tabs.component-z7J2Yp6h.js → tabs.component-Cnvn_Y5x.js} +2 -2
- package/dist/chunks/{tabs.component-z7J2Yp6h.js.map → tabs.component-Cnvn_Y5x.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-BIT-AVii.js → tagBlock.component-B6jDh_wi.js} +2 -2
- package/dist/chunks/{tagBlock.component-BIT-AVii.js.map → tagBlock.component-B6jDh_wi.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-BhgGstLU.js → tagBlock.component-c3i2tk5Y.js} +3 -3
- package/dist/chunks/{tagBlock.component-BhgGstLU.js.map → tagBlock.component-c3i2tk5Y.js.map} +1 -1
- package/dist/chunks/{textInput.component-Dv4puTkb.js → textInput.component-DcGfaX6z.js} +3 -3
- package/dist/chunks/{textInput.component-Dv4puTkb.js.map → textInput.component-DcGfaX6z.js.map} +1 -1
- package/dist/chunks/{textInput.component-D9iVzBPO.js → textInput.component-Dg0NjMGd.js} +2 -2
- package/dist/chunks/{textInput.component-D9iVzBPO.js.map → textInput.component-Dg0NjMGd.js.map} +1 -1
- package/dist/chunks/{textarea.component-BXDGsp_X.js → textarea.component-8QwVGgBC.js} +2 -2
- package/dist/chunks/{textarea.component-BXDGsp_X.js.map → textarea.component-8QwVGgBC.js.map} +1 -1
- package/dist/chunks/{textarea.component-BBZ01Uwu.js → textarea.component-DQAMtD62.js} +2 -2
- package/dist/chunks/{textarea.component-BBZ01Uwu.js.map → textarea.component-DQAMtD62.js.map} +1 -1
- package/dist/chunks/{theme.provider-LbddeKMu.js → theme.provider-B913rIrq.js} +2 -2
- package/dist/chunks/{theme.provider-LbddeKMu.js.map → theme.provider-B913rIrq.js.map} +1 -1
- package/dist/chunks/{theme.provider-wWr4H_XJ.js → theme.provider-Dp0Cf3UC.js} +4 -4
- package/dist/chunks/{theme.provider-wWr4H_XJ.js.map → theme.provider-Dp0Cf3UC.js.map} +1 -1
- package/dist/chunks/{timePicker.component-DLhuGlNp.js → timePicker.component-CbfNMKHg.js} +2 -2
- package/dist/chunks/{timePicker.component-DLhuGlNp.js.map → timePicker.component-CbfNMKHg.js.map} +1 -1
- package/dist/chunks/{timePicker.component-BTj7DA_7.js → timePicker.component-CqCqsj0-.js} +4 -4
- package/dist/chunks/{timePicker.component-BTj7DA_7.js.map → timePicker.component-CqCqsj0-.js.map} +1 -1
- package/dist/chunks/{timeRange.component-Cbo_KMo2.js → timeRange.component-CL5z9FRa.js} +2 -2
- package/dist/chunks/{timeRange.component-Cbo_KMo2.js.map → timeRange.component-CL5z9FRa.js.map} +1 -1
- package/dist/chunks/{timeRange.component-CMuPVdvd.js → timeRange.component-DUI4EL7X.js} +2 -2
- package/dist/chunks/{timeRange.component-CMuPVdvd.js.map → timeRange.component-DUI4EL7X.js.map} +1 -1
- package/dist/chunks/{withFormControl-DS2sMs8A.js → withFormControl-CdasHiz1.js} +2 -2
- package/dist/chunks/{withFormControl-DS2sMs8A.js.map → withFormControl-CdasHiz1.js.map} +1 -1
- package/dist/chunks/{withFormControl-DJ6OVImD.js → withFormControl-ClG2Nbcf.js} +2 -2
- package/dist/chunks/{withFormControl-DJ6OVImD.js.map → withFormControl-ClG2Nbcf.js.map} +1 -1
- package/dist/cjs/components/Alert/index.cjs +1 -1
- package/dist/cjs/components/Avatar/index.cjs +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/Button/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/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/Icon/index.cjs +1 -1
- package/dist/cjs/components/Link/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/StyledAvatar/index.cjs +1 -1
- package/dist/cjs/components/Swatch/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/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/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/Button/index.js +1 -1
- package/dist/esm/components/ButtonGroup/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/Icon/index.js +1 -1
- package/dist/esm/components/Link/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/StyledAvatar/index.js +1 -1
- package/dist/esm/components/Swatch/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/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/index.js +28 -28
- package/dist/esm/index.js +29 -29
- package/dist/esm/theme/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/icon.component-DszmCnE4.js.map +0 -1
- package/dist/chunks/icon.component-aJ690VpJ.js +0 -2
- package/dist/chunks/icon.component-aJ690VpJ.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const c=require("./jsx-runtime-BjDatQAs.js"),p=require("./avatar.component-
|
|
2
|
-
//# sourceMappingURL=styledAvatar.types-
|
|
1
|
+
"use strict";const c=require("./jsx-runtime-BjDatQAs.js"),p=require("./avatar.component-Dv96XFOF.js"),m=({type:l="Client",...e})=>{const{name:o,tooltipProps:t={placement:"top",...e.tooltipProps},onClick:s}=e,n={variant:"outlineYellow",tooltipProps:{...t,label:t?.label||`${o} (Test Client)`}},r={iconName:"cellphone",tooltipProps:{...t,label:t?.label||`Text messages sent from ${o||"unknown number"}`}},i={Automated:{iconName:"robot",backgroundColor:"background.primary",hideBorder:!0,color:"text.contrast",size:"sm",showTooltip:!1,cursor:"default"},Client:{},Clinic:{variant:"outlineAccent",name:o||"Sys"},SMS:r,TestClient:n};return c.jsxRuntimeExports.jsx(p.Avatar,{className:"StyledAvatar","data-testid":`kibble-styled-avatar-${l}`,onClick:a=>{a.stopPropagation(),s&&s(a)},...e,...i[l]})},u=["Client","SMS","TestClient","Automated","Clinic"];exports.StyledAvatar=m;exports.styledAvatarTypes=u;
|
|
2
|
+
//# sourceMappingURL=styledAvatar.types-9huVpPvU.js.map
|
package/dist/chunks/{styledAvatar.types-B0IAGnAx.js.map → styledAvatar.types-9huVpPvU.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styledAvatar.types-
|
|
1
|
+
{"version":3,"file":"styledAvatar.types-9huVpPvU.js","sources":["../../src/components/StyledAvatar/styledAvatar.component.tsx","../../src/components/StyledAvatar/styledAvatar.types.ts"],"sourcesContent":["import React from 'react';\nimport { Avatar, AvatarProps } from 'components/Avatar/avatar.component';\nimport { StyledAvatarType } from './styledAvatar.types';\n\nexport interface StyledAvatarProps extends AvatarProps {\n type?: StyledAvatarType;\n}\n\nexport const StyledAvatar = ({ type = 'Client', ...rest }: StyledAvatarProps): React.JSX.Element => {\n const { name, tooltipProps = { placement: 'top', ...rest.tooltipProps }, onClick } = rest;\n\n const testClientStyleProps: Partial<AvatarProps> = {\n variant: 'outlineYellow',\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `${name} (Test Client)`,\n },\n };\n\n const smsStyleProps: Partial<AvatarProps> = {\n iconName: 'cellphone',\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `Text messages sent from ${name || 'unknown number'}`,\n },\n };\n\n const automatedStyleProps: Partial<AvatarProps> = {\n iconName: 'robot',\n backgroundColor: 'background.primary',\n hideBorder: true,\n color: 'text.contrast',\n size: 'sm',\n showTooltip: false,\n cursor: 'default',\n };\n\n const clinicStyleProps: Partial<AvatarProps> = {\n variant: 'outlineAccent',\n name: name || 'Sys',\n };\n\n const styleProps: Record<StyledAvatarType, Partial<AvatarProps>> = {\n Automated: automatedStyleProps,\n Client: {},\n Clinic: clinicStyleProps,\n SMS: smsStyleProps,\n TestClient: testClientStyleProps,\n };\n\n return (\n <Avatar\n className=\"StyledAvatar\"\n data-testid={`kibble-styled-avatar-${type}`}\n onClick={(e): void => {\n e.stopPropagation();\n if (onClick) {\n onClick(e);\n }\n }}\n {...rest}\n {...styleProps[type]}\n />\n );\n};\n","export const styledAvatarTypes = ['Client', 'SMS', 'TestClient', 'Automated', 'Clinic'] as const;\nexport type StyledAvatarType = (typeof styledAvatarTypes)[number];\n"],"names":["StyledAvatar","type","rest","name","tooltipProps","onClick","testClientStyleProps","smsStyleProps","styleProps","jsx","Avatar","e","styledAvatarTypes"],"mappings":"sGAQaA,EAAe,CAAC,CAAE,KAAAC,EAAO,SAAU,GAAGC,KAAiD,CAC5F,KAAA,CAAE,KAAAC,EAAM,aAAAC,EAAe,CAAE,UAAW,MAAO,GAAGF,EAAK,YAAA,EAAgB,QAAAG,CAAA,EAAYH,EAE/EI,EAA6C,CACjD,QAAS,gBACT,aAAc,CACZ,GAAGF,EACH,MAAOA,GAAc,OAAS,GAAGD,CAAI,gBAAA,CAEzC,EAEMI,EAAsC,CAC1C,SAAU,YACV,aAAc,CACZ,GAAGH,EACH,MAAOA,GAAc,OAAS,2BAA2BD,GAAQ,gBAAgB,EAAA,CAErF,EAiBMK,EAA6D,CACjE,UAhBgD,CAChD,SAAU,QACV,gBAAiB,qBACjB,WAAY,GACZ,MAAO,gBACP,KAAM,KACN,YAAa,GACb,OAAQ,SACV,EASE,OAAQ,CAAC,EACT,OAR6C,CAC7C,QAAS,gBACT,KAAML,GAAQ,KAChB,EAME,IAAKI,EACL,WAAYD,CACd,EAGE,OAAAG,EAAA,kBAAA,IAACC,EAAA,OAAA,CACC,UAAU,eACV,cAAa,wBAAwBT,CAAI,GACzC,QAAUU,GAAY,CACpBA,EAAE,gBAAgB,EACdN,GACFA,EAAQM,CAAC,CAEb,EACC,GAAGT,EACH,GAAGM,EAAWP,CAAI,CAAA,CACrB,CAEJ,EChEaW,EAAoB,CAAC,SAAU,MAAO,aAAc,YAAa,QAAQ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as c } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { A as p } from "./avatar.component-
|
|
2
|
+
import { A as p } from "./avatar.component-77NanIaH.js";
|
|
3
3
|
const y = ({ type: l = "Client", ...o }) => {
|
|
4
4
|
const { name: e, tooltipProps: t = { placement: "top", ...o.tooltipProps }, onClick: s } = o, n = {
|
|
5
5
|
variant: "outlineYellow",
|
|
@@ -48,4 +48,4 @@ export {
|
|
|
48
48
|
y as S,
|
|
49
49
|
C as s
|
|
50
50
|
};
|
|
51
|
-
//# sourceMappingURL=styledAvatar.types-
|
|
51
|
+
//# sourceMappingURL=styledAvatar.types-BlkNvQyA.js.map
|
package/dist/chunks/{styledAvatar.types-CVyai83h.js.map → styledAvatar.types-BlkNvQyA.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styledAvatar.types-
|
|
1
|
+
{"version":3,"file":"styledAvatar.types-BlkNvQyA.js","sources":["../../src/components/StyledAvatar/styledAvatar.component.tsx","../../src/components/StyledAvatar/styledAvatar.types.ts"],"sourcesContent":["import React from 'react';\nimport { Avatar, AvatarProps } from 'components/Avatar/avatar.component';\nimport { StyledAvatarType } from './styledAvatar.types';\n\nexport interface StyledAvatarProps extends AvatarProps {\n type?: StyledAvatarType;\n}\n\nexport const StyledAvatar = ({ type = 'Client', ...rest }: StyledAvatarProps): React.JSX.Element => {\n const { name, tooltipProps = { placement: 'top', ...rest.tooltipProps }, onClick } = rest;\n\n const testClientStyleProps: Partial<AvatarProps> = {\n variant: 'outlineYellow',\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `${name} (Test Client)`,\n },\n };\n\n const smsStyleProps: Partial<AvatarProps> = {\n iconName: 'cellphone',\n tooltipProps: {\n ...tooltipProps,\n label: tooltipProps?.label || `Text messages sent from ${name || 'unknown number'}`,\n },\n };\n\n const automatedStyleProps: Partial<AvatarProps> = {\n iconName: 'robot',\n backgroundColor: 'background.primary',\n hideBorder: true,\n color: 'text.contrast',\n size: 'sm',\n showTooltip: false,\n cursor: 'default',\n };\n\n const clinicStyleProps: Partial<AvatarProps> = {\n variant: 'outlineAccent',\n name: name || 'Sys',\n };\n\n const styleProps: Record<StyledAvatarType, Partial<AvatarProps>> = {\n Automated: automatedStyleProps,\n Client: {},\n Clinic: clinicStyleProps,\n SMS: smsStyleProps,\n TestClient: testClientStyleProps,\n };\n\n return (\n <Avatar\n className=\"StyledAvatar\"\n data-testid={`kibble-styled-avatar-${type}`}\n onClick={(e): void => {\n e.stopPropagation();\n if (onClick) {\n onClick(e);\n }\n }}\n {...rest}\n {...styleProps[type]}\n />\n );\n};\n","export const styledAvatarTypes = ['Client', 'SMS', 'TestClient', 'Automated', 'Clinic'] as const;\nexport type StyledAvatarType = (typeof styledAvatarTypes)[number];\n"],"names":["StyledAvatar","type","rest","name","tooltipProps","onClick","testClientStyleProps","smsStyleProps","styleProps","jsx","Avatar","e","sty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
|
borderRadius: "xs",
|
|
8
|
-
height: "
|
|
9
|
-
width: "
|
|
8
|
+
height: "12px",
|
|
9
|
+
width: "12px"
|
|
10
10
|
},
|
|
11
11
|
sm: {
|
|
12
12
|
borderRadius: "3px",
|
|
@@ -64,4 +64,4 @@ export {
|
|
|
64
64
|
g as S,
|
|
65
65
|
f as s
|
|
66
66
|
};
|
|
67
|
-
//# sourceMappingURL=swatch.types-
|
|
67
|
+
//# sourceMappingURL=swatch.types-CtRInwzo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swatch.types-
|
|
1
|
+
{"version":3,"file":"swatch.types-CtRInwzo.js","sources":["../../src/components/Swatch/swatch.recipe.ts","../../src/components/Swatch/swatch.component.tsx","../../src/components/Swatch/swatch.types.ts"],"sourcesContent":["import { defineRecipe, SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { SwatchSize } from './swatch.types';\n\nconst swatchSizeStyles: Record<SwatchSize, SystemStyleObject> = {\n xs: {\n borderRadius: 'xs',\n height: '12px',\n width: '12px',\n },\n sm: {\n borderRadius: '3px',\n height: '16px',\n width: '16px',\n },\n md: {\n borderRadius: '4px',\n height: '20px',\n width: '20px',\n },\n lg: {\n borderRadius: '5px',\n height: '24px',\n width: '24px',\n },\n xl: {\n borderRadius: 'sm',\n height: '32px',\n width: '32px',\n },\n};\n\nexport const swatchRecipe = defineRecipe({\n base: {\n display: 'inline-block',\n border: '1px',\n },\n variants: {\n size: swatchSizeStyles,\n },\n defaultVariants: {\n size: 'md',\n },\n});\n","import React from 'react';\nimport { Box, BoxProps } from '@chakra-ui/react/box';\nimport { SwatchSize } from './swatch.types';\nimport { useRecipe } from '@chakra-ui/react/styled-system';\nimport { swatchRecipe } from './swatch.recipe';\n\nexport interface BaseSwatchProps {\n size?: SwatchSize;\n}\n\nexport type SwatchProps = BaseSwatchProps & Omit<BoxProps, 'children'>;\n\nexport const Swatch = ({\n size = 'md',\n color,\n backgroundColor,\n bgColor,\n borderColor,\n ...rest\n}: SwatchProps): React.JSX.Element => {\n const recipe = useRecipe({ recipe: swatchRecipe });\n const styles = recipe({ size });\n const _swatchColor = bgColor || backgroundColor || color || 'transparent';\n\n return (\n <Box\n className=\"Swatch\"\n data-testid=\"kibble-swatch\"\n css={styles}\n bg={_swatchColor}\n borderColor={borderColor || _swatchColor}\n {...rest}\n />\n );\n};\n","export const swatchSizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const;\nexport type SwatchSize = (typeof swatchSizes)[number];\n"],"names":["swatchSizeStyles","swatchRecipe","defineRecipe","Swatch","size","color","backgroundColor","bgColor","borderColor","rest","styles","useRecipe","_swatchColor","jsx","Box","swatchSizes"],"mappings":";;;;AAGA,MAAMA,IAA0D;AAAA,EAC9D,IAAI;AAAA,IACF,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,IAAI;AAAA,IACF,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,IAAI;AAAA,IACF,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,IAAI;AAAA,IACF,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,IAAI;AAAA,IACF,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA;AAEX,GAEaC,IAAeC,EAAa;AAAA,EACvC,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,MAAMF;AAAA,EACR;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV,CAAC,GC9BYG,IAAS,CAAC;AAAA,EACrB,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAGC;AACL,MAAsC;AAEpC,QAAMC,IADSC,EAAU,EAAE,QAAQV,GAAc,EAC3B,EAAE,MAAAG,GAAM,GACxBQ,IAAeL,KAAWD,KAAmBD,KAAS;AAG1D,SAAAQ,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,KAAKJ;AAAA,MACL,IAAIE;AAAA,MACJ,aAAaJ,KAAeI;AAAA,MAC3B,GAAGH;AAAA,IAAA;AAAA,EACN;AAEJ,GClCaM,IAAc,CAAC,MAAM,MAAM,MAAM,MAAM,IAAI;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const d=require("./jsx-runtime-BjDatQAs.js"),x=require("./config-BFcXpdZo.js"),h=require("./use-recipe-DaPWl_pL.js"),p=require("./box-Baq7UBls.js"),n={xs:{borderRadius:"xs",height:"
|
|
2
|
-
//# sourceMappingURL=swatch.types-
|
|
1
|
+
"use strict";const d=require("./jsx-runtime-BjDatQAs.js"),x=require("./config-BFcXpdZo.js"),h=require("./use-recipe-DaPWl_pL.js"),p=require("./box-Baq7UBls.js"),n={xs:{borderRadius:"xs",height:"12px",width:"12px"},sm:{borderRadius:"3px",height:"16px",width:"16px"},md:{borderRadius:"4px",height:"20px",width:"20px"},lg:{borderRadius:"5px",height:"24px",width:"24px"},xl:{borderRadius:"sm",height:"32px",width:"32px"}},u=x.defineRecipe({base:{display:"inline-block",border:"1px"},variants:{size:n},defaultVariants:{size:"md"}}),l=({size:s="md",color:t,backgroundColor:i,bgColor:r,borderColor:c,...a})=>{const o=h.useRecipe({recipe:u})({size:s}),e=r||i||t||"transparent";return d.jsxRuntimeExports.jsx(p.Box,{className:"Swatch","data-testid":"kibble-swatch",css:o,bg:e,borderColor:c||e,...a})},w=["xs","sm","md","lg","xl"];exports.Swatch=l;exports.swatchSizes=w;
|
|
2
|
+
//# sourceMappingURL=swatch.types-qncm_zG6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swatch.types-
|
|
1
|
+
{"version":3,"file":"swatch.types-qncm_zG6.js","sources":["../../src/components/Swatch/swatch.recipe.ts","../../src/components/Swatch/swatch.component.tsx","../../src/components/Swatch/swatch.types.ts"],"sourcesContent":["import { defineRecipe, SystemStyleObject } from '@chakra-ui/react/styled-system';\nimport { SwatchSize } from './swatch.types';\n\nconst swatchSizeStyles: Record<SwatchSize, SystemStyleObject> = {\n xs: {\n borderRadius: 'xs',\n height: '12px',\n width: '12px',\n },\n sm: {\n borderRadius: '3px',\n height: '16px',\n width: '16px',\n },\n md: {\n borderRadius: '4px',\n height: '20px',\n width: '20px',\n },\n lg: {\n borderRadius: '5px',\n height: '24px',\n width: '24px',\n },\n xl: {\n borderRadius: 'sm',\n height: '32px',\n width: '32px',\n },\n};\n\nexport const swatchRecipe = defineRecipe({\n base: {\n display: 'inline-block',\n border: '1px',\n },\n variants: {\n size: swatchSizeStyles,\n },\n defaultVariants: {\n size: 'md',\n },\n});\n","import React from 'react';\nimport { Box, BoxProps } from '@chakra-ui/react/box';\nimport { SwatchSize } from './swatch.types';\nimport { useRecipe } from '@chakra-ui/react/styled-system';\nimport { swatchRecipe } from './swatch.recipe';\n\nexport interface BaseSwatchProps {\n size?: SwatchSize;\n}\n\nexport type SwatchProps = BaseSwatchProps & Omit<BoxProps, 'children'>;\n\nexport const Swatch = ({\n size = 'md',\n color,\n backgroundColor,\n bgColor,\n borderColor,\n ...rest\n}: SwatchProps): React.JSX.Element => {\n const recipe = useRecipe({ recipe: swatchRecipe });\n const styles = recipe({ size });\n const _swatchColor = bgColor || backgroundColor || color || 'transparent';\n\n return (\n <Box\n className=\"Swatch\"\n data-testid=\"kibble-swatch\"\n css={styles}\n bg={_swatchColor}\n borderColor={borderColor || _swatchColor}\n {...rest}\n />\n );\n};\n","export const swatchSizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const;\nexport type SwatchSize = (typeof swatchSizes)[number];\n"],"names":["swatchSizeStyles","swatchRecipe","defineRecipe","Swatch","size","color","backgroundColor","bgColor","borderColor","rest","styles","useRecipe","_swatchColor","jsx","Box","swatchSizes"],"mappings":"iKAGMA,EAA0D,CAC9D,GAAI,CACF,aAAc,KACd,OAAQ,OACR,MAAO,MACT,EACA,GAAI,CACF,aAAc,MACd,OAAQ,OACR,MAAO,MACT,EACA,GAAI,CACF,aAAc,MACd,OAAQ,OACR,MAAO,MACT,EACA,GAAI,CACF,aAAc,MACd,OAAQ,OACR,MAAO,MACT,EACA,GAAI,CACF,aAAc,KACd,OAAQ,OACR,MAAO,MAAA,CAEX,EAEaC,EAAeC,EAAAA,aAAa,CACvC,KAAM,CACJ,QAAS,eACT,OAAQ,KACV,EACA,SAAU,CACR,KAAMF,CACR,EACA,gBAAiB,CACf,KAAM,IAAA,CAEV,CAAC,EC9BYG,EAAS,CAAC,CACrB,KAAAC,EAAO,KACP,MAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,YAAAC,EACA,GAAGC,CACL,IAAsC,CAEpC,MAAMC,EADSC,EAAA,UAAU,CAAE,OAAQV,EAAc,EAC3B,CAAE,KAAAG,EAAM,EACxBQ,EAAeL,GAAWD,GAAmBD,GAAS,cAG1D,OAAAQ,EAAA,kBAAA,IAACC,EAAA,IAAA,CACC,UAAU,SACV,cAAY,gBACZ,IAAKJ,EACL,GAAIE,EACJ,YAAaJ,GAAeI,EAC3B,GAAGH,CAAA,CACN,CAEJ,EClCaM,EAAc,CAAC,KAAM,KAAM,KAAM,KAAM,IAAI"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as c } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import I, { forwardRef as n, useId as A, useMemo as L } from "react";
|
|
3
|
-
import { w as T } from "./withFormControl-
|
|
3
|
+
import { w as T } from "./withFormControl-CdasHiz1.js";
|
|
4
4
|
import { d as u } from "./attr-sm10PXOd.js";
|
|
5
5
|
import { c as _ } from "./create-slot-recipe-context-BJmsuxih.js";
|
|
6
6
|
import { c as w } from "./factory-Ctbv0Ozn.js";
|
|
@@ -151,4 +151,4 @@ const rt = T(g);
|
|
|
151
151
|
export {
|
|
152
152
|
rt as W
|
|
153
153
|
};
|
|
154
|
-
//# sourceMappingURL=switch.component-
|
|
154
|
+
//# sourceMappingURL=switch.component-BBep786n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.component-lN5wISru.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [styles.indicator, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { ForwardedRef, useMemo } from 'react';\nimport { Switch as CSwitch } from '@chakra-ui/react/switch';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport interface SwitchProps extends WithFormControlProps, Omit<CSwitch.RootProps, 'label' | 'onChange'> {\n indeterminate?: boolean;\n rootRef?: ForwardedRef<HTMLLabelElement>;\n size?: FormControlSize;\n switchRef?: React.RefObject<HTMLInputElement | null>;\n}\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n rootRef,\n size = 'md',\n switchRef,\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? 'indeterminateOnContrast' : 'indeterminate';\n } else {\n return onContrast ? 'onContrast' : 'default';\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid=\"kibble-switch\"\n ref={rootRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput className=\"Switch_Input\" data-testid=\"kibble-switch-input\" ref={switchRef || ref} />\n <CSwitch.Control className=\"Switch_Control\" data-testid=\"kibble-switch-control\" />\n {!!children && <CSwitch.Label>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\nconst WrappedSwitch = withFormControl<SwitchProps>(Switch);\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","rest","chakra","dataAttr","Switch.HiddenInput","Switch","React","indeterminate","onContrast","label","rootRef","size","switchRef","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","withFormControl"],"mappings":";;;;;;;;;;AAGA,MAAM,CAACA,GAAgBC,CAAgB,IAAIC,EAAc;AAAA,EACvD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAChB,CAAC,GCAKC,IAAgBC,EAAW,CAACC,GAAOC,MAAQ;AAC/C,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,gBAAe,GAAIF,CAAK;AACrE,SAAuBK,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAF,GAAK;AAC9D,CAAC;AACDH,EAAc,cAAc;ACJ5B,MAAMS,IAAoBR,EAAW,CAACC,GAAOC,MAAQ;AACnD,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,oBAAmB,GAAIF,CAAK,GACnEQ,IAAQC,EAAiB;AAC/B,SAAuBJ,gBAAAA,EAAG,IAACC,EAAI,OAAO,EAAE,oBAAoBE,GAAO,iBAAiB,GAAGL,GAAa,KAAAF,GAAK;AAC3G,CAAC;AACDM,EAAkB,cAAc;ACPhC,MAAMG,IAAcX,EAAW,CAACC,GAAOC,MAAQ;AAC7C,QAAMC,IAAgBN,EAAkB,GAClCO,IAAcC,EAAWF,EAAc,cAAa,GAAIF,CAAK;AACnE,SAAuBK,gBAAAA,EAAAA,IAAIC,EAAI,MAAM,EAAE,GAAGH,GAAa,KAAAF,GAAK;AAC9D,CAAC;AACDS,EAAY,cAAc;ACJ1B,MAAMC,IAAY,CAACX,MAAU;AAC3B,QAAMY,IAAKC,EAAO,GACZ,EAAE,aAAAC,EAAa,IAAGC,EAAuB,GACzC,EAAE,KAAAC,EAAK,IAAGC,EAAkB,GAC5BT,IAAQC,EAAiB,GACzBS,IAAe;AAAA,IACnB,IAAAN;AAAA,IACA,KAA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n.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [styles.indicator, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { ForwardedRef, useMemo } from 'react';\nimport { Switch as CSwitch } from '@chakra-ui/react/switch';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport interface SwitchProps extends WithFormControlProps, Omit<CSwitch.RootProps, 'label' | 'onChange'> {\n indeterminate?: boolean;\n rootRef?: ForwardedRef<HTMLLabelElement>;\n size?: FormControlSize;\n switchRef?: React.RefObject<HTMLInputElement | null>;\n}\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n rootRef,\n size = 'md',\n switchRef,\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? 'indeterminateOnContrast' : 'indeterminate';\n } else {\n return onContrast ? 'onContrast' : 'default';\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid=\"kibble-switch\"\n ref={rootRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput className=\"Switch_Input\" data-testid=\"kibble-switch-input\" ref={switchRef || ref} />\n <CSwitch.Control className=\"Switch_Control\" data-testid=\"kibble-switch-control\" />\n {!!children && <CSwitch.Label>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\nconst WrappedSwitch = withFormControl<SwitchProps>(Switch);\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","rest","chakra","dataAttr","Switch.HiddenInput","Switch","React","indeterminate","onContrast","label","rootRef","size","switchRef","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","withFormControl"],"mappings":";;;;;;;;;;AAGA,MAAM,CAACA,GAAgBC,CAAgB,IAAIC,EAAc;AAAA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4C,EAAShB,EAAI,OAAO,GAAG,GAAGc,GAAM,UAAUd,EAAI,UAAUa,IAAWD,GAAU;AAC9I,CAAC;AAED,MAAMlC,IAAoBuC,GCjDpBC,IAASC,EAAM;AAAA,EACnB,CACE;AAAA,IACE,UAAAN;AAAA,IACA,eAAAO,IAAgB;AAAA,IAChB,YAAAC;AAAA;AAAA,IAEA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,GAAGX;AAAA,KAEL1C,MACsB;AAChB,UAAAsD,IAAmBC,EAAQ,MAC3BP,IACKC,IAAa,4BAA4B,kBAEzCA,IAAa,eAAe,WAEpC,CAACD,GAAeC,CAAU,CAAC;AAG5B,WAAAO,gBAAAA,EAAA;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,eAAY;AAAA,QACZ,KAAKN;AAAA,QACL,MAAAC;AAAA,QACA,SAASE;AAAA,QACR,GAAGZ;AAAA,QAEJ,UAAA;AAAA,UAACtC,gBAAAA,MAAAsD,GAAA,EAAoB,WAAU,gBAAe,eAAY,uBAAsB,KAAKL,KAAarD,GAAK;AAAA,gCACtG2D,GAAA,EAAgB,WAAU,kBAAiB,eAAY,yBAAwB;AAAA,UAC/E,CAAC,CAAClB,2BAAamB,GAAA,EAAe,UAAAnB,EAAS,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1C;AAAA,EAAA;AAGN;AAEAK,EAAO,cAAc;AACf,MAAAe,KAAgBC,EAA6BhB,CAAM;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),c=require("react"),q=require("./withFormControl-
|
|
2
|
-
//# sourceMappingURL=switch.component-
|
|
1
|
+
"use strict";const n=require("./jsx-runtime-BjDatQAs.js"),c=require("react"),q=require("./withFormControl-ClG2Nbcf.js"),w=require("./attr-BMs6szZx.js"),N=require("./create-slot-recipe-context-IwVIgtBt.js"),m=require("./factory-D6tdBUPG.js"),i=require("./use-locale-context-D0LByRu9.js"),f=require("./use-field-context-CArmgHPP.js"),l=require("./index-CHIISuTq.js"),x=require("./index-DBk0LkcO.js"),I=t=>t&&t.__esModule?t:{default:t},_=I(c),[S,u]=i.createContext({name:"SwitchContext",hookName:"useSwitchContext",providerName:"<SwitchProvider />"}),R=c.forwardRef((t,r)=>{const e=u(),s=l.mergeProps(e.getControlProps(),t);return n.jsxRuntimeExports.jsx(i.ark.span,{...s,ref:r})});R.displayName="SwitchControl";const C=c.forwardRef((t,r)=>{const e=u(),s=l.mergeProps(e.getHiddenInputProps(),t),o=f.useFieldContext();return n.jsxRuntimeExports.jsx(i.ark.input,{"aria-describedby":o?.ariaDescribedby,...s,ref:r})});C.displayName="SwitchHiddenInput";const b=c.forwardRef((t,r)=>{const e=u(),s=l.mergeProps(e.getLabelProps(),t);return n.jsxRuntimeExports.jsx(i.ark.span,{...s,ref:r})});b.displayName="SwitchLabel";const A=t=>{const r=c.useId(),{getRootNode:e}=i.useEnvironmentContext(),{dir:s}=i.useLocaleContext(),o=f.useFieldContext(),a={id:r,ids:{label:o?.ids.label,hiddenInput:o?.ids.control},dir:s,disabled:o?.disabled,readOnly:o?.readOnly,invalid:o?.invalid,required:o?.required,getRootNode:e,...t},d=i.useMachine(x.machine,a);return x.connect(d,i.normalizeProps)},j=c.forwardRef((t,r)=>{const[e,s]=i.createSplitProps()(t,["checked","defaultChecked","disabled","form","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]),o=A(e),a=l.mergeProps(o.getRootProps(),s);return n.jsxRuntimeExports.jsx(S,{value:o,children:n.jsxRuntimeExports.jsx(i.ark.label,{...a,ref:r})})});j.displayName="SwitchRoot";const P=c.forwardRef((t,r)=>{const[{value:e},s]=i.createSplitProps()(t,["value"]),o=l.mergeProps(e.getRootProps(),s);return n.jsxRuntimeExports.jsx(S,{value:e,children:n.jsxRuntimeExports.jsx(i.ark.label,{...o,ref:r})})});P.displayName="SwitchRootProvider";const k=c.forwardRef((t,r)=>{const e=u(),s=l.mergeProps(e.getThumbProps(),t);return n.jsxRuntimeExports.jsx(i.ark.span,{...s,ref:r})});k.displayName="SwitchThumb";const{withProvider:g,withContext:p,useStyles:L}=N.createSlotRecipeContext({key:"switch"});g(P,"root",{forwardAsChild:!0});const $=g(j,"root",{forwardAsChild:!0}),F=p(b,"label",{forwardAsChild:!0}),T=p(k,"thumb",{forwardAsChild:!0}),H=p(R,"control",{forwardAsChild:!0,defaultProps:{children:n.jsxRuntimeExports.jsx(T,{})}});c.forwardRef(function(r,e){const s=u(),o=L(),{fallback:a,children:d,...h}=r;return n.jsxRuntimeExports.jsx(m.chakra.span,{ref:e,"data-checked":w.dataAttr(s.checked),...h,css:[o.indicator,r.css],children:s.checked?d:a})});c.forwardRef(function(r,e){const s=u(),{fallback:o,children:a,...d}=r;return n.jsxRuntimeExports.jsx(m.chakra.span,{ref:e,"data-checked":w.dataAttr(s.checked),...d,children:s.checked?a:o})});const O=C,v=_.default.forwardRef(({children:t,indeterminate:r=!1,onContrast:e,label:s,rootRef:o,size:a="md",switchRef:d,...h},y)=>{const E=c.useMemo(()=>r?e?"indeterminateOnContrast":"indeterminate":e?"onContrast":"default",[r,e]);return n.jsxRuntimeExports.jsxs($,{className:"Switch","data-testid":"kibble-switch",ref:o,size:a,variant:E,...h,children:[n.jsxRuntimeExports.jsx(O,{className:"Switch_Input","data-testid":"kibble-switch-input",ref:d||y}),n.jsxRuntimeExports.jsx(H,{className:"Switch_Control","data-testid":"kibble-switch-control"}),!!t&&n.jsxRuntimeExports.jsx(F,{children:t})]})});v.displayName="Switch";const M=q.withFormControl(v);exports.WrappedSwitch=M;
|
|
2
|
+
//# sourceMappingURL=switch.component-DghHmo1Q.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.component-DMj4TPl8.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [styles.indicator, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { ForwardedRef, useMemo } from 'react';\nimport { Switch as CSwitch } from '@chakra-ui/react/switch';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport interface SwitchProps extends WithFormControlProps, Omit<CSwitch.RootProps, 'label' | 'onChange'> {\n indeterminate?: boolean;\n rootRef?: ForwardedRef<HTMLLabelElement>;\n size?: FormControlSize;\n switchRef?: React.RefObject<HTMLInputElement | null>;\n}\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n rootRef,\n size = 'md',\n switchRef,\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? 'indeterminateOnContrast' : 'indeterminate';\n } else {\n return onContrast ? 'onContrast' : 'default';\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid=\"kibble-switch\"\n ref={rootRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput className=\"Switch_Input\" data-testid=\"kibble-switch-input\" ref={switchRef || ref} />\n <CSwitch.Control className=\"Switch_Control\" data-testid=\"kibble-switch-control\" />\n {!!children && <CSwitch.Label>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\nconst WrappedSwitch = withFormControl<SwitchProps>(Switch);\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","rest","chakra","dataAttr","Switch.HiddenInput","Switch","React","indeterminate","onContrast","label","rootRef","size","switchRef","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","withFormControl"],"mappings":"wbAGM,CAACA,EAAgBC,CAAgB,EAAIC,gBAAc,CACvD,KAAM,gBACN,SAAU,mBACV,aAAc,oBAChB,CAAC,ECAKC,EAAgBC,EAA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AAC,EACA,KAAAC,EAAO,KACP,UAAAC,EACA,GAAGX,GAEL1C,IACsB,CAChB,MAAAsD,EAAmBC,EAAAA,QAAQ,IAC3BP,EACKC,EAAa,0BAA4B,gBAEzCA,EAAa,aAAe,UAEpC,CAACD,EAAeC,CAAU,CAAC,EAG5B,OAAAO,EAAA,kBAAA,KAACC,EAAA,CACC,UAAU,SACV,cAAY,gBACZ,IAAKN,EACL,KAAAC,EACA,QAASE,EACR,GAAGZ,EAEJ,SAAA,CAACtC,wBAAAsD,EAAA,CAAoB,UAAU,eAAe,cAAY,sBAAsB,IAAKL,GAAarD,EAAK,0BACtG2D,EAAA,CAAgB,UAAU,iBAAiB,cAAY,wBAAwB,EAC/E,CAAC,CAAClB,2BAAamB,EAAA,CAAe,SAAAnB,CAAS,CAAA,CAAA,CAAA,CAC1C,CAAA,CAGN,EAEAK,EAAO,YAAc,SACf,MAAAe,EAAgBC,kBAA6BhB,CAAM","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
1
|
+
{"version":3,"file":"switch.component-DghHmo1Q.js","sources":["../../node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-control.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-label.js","../../node_modules/@ark-ui/react/dist/components/switch/use-switch.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js","../../node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js","../../node_modules/@chakra-ui/react/dist/esm/components/switch/switch.js","../../src/components/Switch/switch.component.tsx"],"sourcesContent":["'use client';\nimport { createContext } from '../../utils/create-context.js';\n\nconst [SwitchProvider, useSwitchContext] = createContext({\n name: \"SwitchContext\",\n hookName: \"useSwitchContext\",\n providerName: \"<SwitchProvider />\"\n});\n\nexport { SwitchProvider, useSwitchContext };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchControl = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getControlProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchControl.displayName = \"SwitchControl\";\n\nexport { SwitchControl };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useFieldContext } from '../field/use-field-context.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchHiddenInput = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getHiddenInputProps(), props);\n const field = useFieldContext();\n return /* @__PURE__ */ jsx(ark.input, { \"aria-describedby\": field?.ariaDescribedby, ...mergedProps, ref });\n});\nSwitchHiddenInput.displayName = \"SwitchHiddenInput\";\n\nexport { SwitchHiddenInput };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchLabel = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getLabelProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchLabel.displayName = \"SwitchLabel\";\n\nexport { SwitchLabel };\n","'use client';\nimport { useMachine, normalizeProps } from '@zag-js/react';\nimport * as zagSwitch from '@zag-js/switch';\nimport { useId } from 'react';\nimport { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';\nimport { useLocaleContext } from '../../providers/locale/use-locale-context.js';\nimport { useFieldContext } from '../field/use-field-context.js';\n\nconst useSwitch = (props) => {\n const id = useId();\n const { getRootNode } = useEnvironmentContext();\n const { dir } = useLocaleContext();\n const field = useFieldContext();\n const machineProps = {\n id,\n ids: {\n label: field?.ids.label,\n hiddenInput: field?.ids.control\n },\n dir,\n disabled: field?.disabled,\n readOnly: field?.readOnly,\n invalid: field?.invalid,\n required: field?.required,\n getRootNode,\n ...props\n };\n const service = useMachine(zagSwitch.machine, machineProps);\n return zagSwitch.connect(service, normalizeProps);\n};\n\nexport { useSwitch };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { useSwitch } from './use-switch.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRoot = forwardRef((props, ref) => {\n const [switchProps, localProps] = createSplitProps()(props, [\n \"checked\",\n \"defaultChecked\",\n \"disabled\",\n \"form\",\n \"id\",\n \"ids\",\n \"invalid\",\n \"label\",\n \"name\",\n \"onCheckedChange\",\n \"readOnly\",\n \"required\",\n \"value\"\n ]);\n const switchContext = useSwitch(switchProps);\n const mergedProps = mergeProps(switchContext.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: switchContext, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRoot.displayName = \"SwitchRoot\";\n\nexport { SwitchRoot };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { createSplitProps } from '../../utils/create-split-props.js';\nimport { ark } from '../factory.js';\nimport { SwitchProvider } from './use-switch-context.js';\n\nconst SwitchRootProvider = forwardRef((props, ref) => {\n const [{ value: api }, localProps] = createSplitProps()(props, [\"value\"]);\n const mergedProps = mergeProps(api.getRootProps(), localProps);\n return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref }) });\n});\nSwitchRootProvider.displayName = \"SwitchRootProvider\";\n\nexport { SwitchRootProvider };\n","'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport { mergeProps } from '@zag-js/react';\nimport { forwardRef } from 'react';\nimport { ark } from '../factory.js';\nimport { useSwitchContext } from './use-switch-context.js';\n\nconst SwitchThumb = forwardRef((props, ref) => {\n const switchContext = useSwitchContext();\n const mergedProps = mergeProps(switchContext.getThumbProps(), props);\n return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });\n});\nSwitchThumb.displayName = \"SwitchThumb\";\n\nexport { SwitchThumb };\n","\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { Switch, useSwitchContext } from '@ark-ui/react/switch';\nimport { forwardRef } from 'react';\nimport { dataAttr } from '../../utils/attr.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\n\nconst {\n withProvider,\n withContext,\n useStyles: useSwitchStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"switch\" });\nconst SwitchRootProvider = withProvider(Switch.RootProvider, \"root\", { forwardAsChild: true });\nconst SwitchRoot = withProvider(\n Switch.Root,\n \"root\",\n { forwardAsChild: true }\n);\nconst SwitchPropsProvider = PropsProvider;\nconst SwitchLabel = withContext(\n Switch.Label,\n \"label\",\n { forwardAsChild: true }\n);\nconst SwitchThumb = withContext(\n Switch.Thumb,\n \"thumb\",\n { forwardAsChild: true }\n);\nconst SwitchControl = withContext(\n Switch.Control,\n \"control\",\n {\n forwardAsChild: true,\n defaultProps: { children: /* @__PURE__ */ jsx(SwitchThumb, {}) }\n }\n);\nconst SwitchIndicator = forwardRef(function SwitchIndicator2(props, ref) {\n const api = useSwitchContext();\n const styles = useSwitchStyles();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(\n chakra.span,\n {\n ref,\n \"data-checked\": dataAttr(api.checked),\n ...rest,\n css: [styles.indicator, props.css],\n children: api.checked ? children : fallback\n }\n );\n});\nconst SwitchThumbIndicator = forwardRef(function SwitchThumbIndicator2(props, ref) {\n const api = useSwitchContext();\n const { fallback, children, ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, \"data-checked\": dataAttr(api.checked), ...rest, children: api.checked ? children : fallback });\n});\nconst SwitchContext = Switch.Context;\nconst SwitchHiddenInput = Switch.HiddenInput;\n\nexport { SwitchContext, SwitchControl, SwitchHiddenInput, SwitchIndicator, SwitchLabel, SwitchPropsProvider, SwitchRoot, SwitchRootProvider, SwitchThumb, SwitchThumbIndicator, useSwitchStyles };\n","import React, { ForwardedRef, useMemo } from 'react';\nimport { Switch as CSwitch } from '@chakra-ui/react/switch';\nimport { withFormControl, WithFormControlProps } from 'hocs/withFormControl/withFormControl';\nimport { FormControlSize } from 'hocs/withFormControl/withFormControl.types';\n\nexport interface SwitchProps extends WithFormControlProps, Omit<CSwitch.RootProps, 'label' | 'onChange'> {\n indeterminate?: boolean;\n rootRef?: ForwardedRef<HTMLLabelElement>;\n size?: FormControlSize;\n switchRef?: React.RefObject<HTMLInputElement | null>;\n}\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n (\n {\n children,\n indeterminate = false,\n onContrast,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n label,\n rootRef,\n size = 'md',\n switchRef,\n ...rest\n },\n ref,\n ): React.JSX.Element => {\n const _computedVariant = useMemo(() => {\n if (indeterminate) {\n return onContrast ? 'indeterminateOnContrast' : 'indeterminate';\n } else {\n return onContrast ? 'onContrast' : 'default';\n }\n }, [indeterminate, onContrast]);\n\n return (\n <CSwitch.Root\n className=\"Switch\"\n data-testid=\"kibble-switch\"\n ref={rootRef}\n size={size}\n variant={_computedVariant}\n {...rest}\n >\n <CSwitch.HiddenInput className=\"Switch_Input\" data-testid=\"kibble-switch-input\" ref={switchRef || ref} />\n <CSwitch.Control className=\"Switch_Control\" data-testid=\"kibble-switch-control\" />\n {!!children && <CSwitch.Label>{children}</CSwitch.Label>}\n </CSwitch.Root>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\nconst WrappedSwitch = withFormControl<SwitchProps>(Switch);\n\nexport { WrappedSwitch as Switch };\n"],"names":["SwitchProvider","useSwitchContext","createContext","SwitchControl","forwardRef","props","ref","switchContext","mergedProps","mergeProps","jsx","ark","SwitchHiddenInput","field","useFieldContext","SwitchLabel","useSwitch","id","useId","getRootNode","useEnvironmentContext","dir","useLocaleContext","machineProps","service","useMachine","zagSwitch.machine","zagSwitch.connect","normalizeProps","SwitchRoot","switchProps","localProps","createSplitProps","SwitchRootProvider","api","SwitchThumb","withProvider","withContext","useSwitchStyles","createSlotRecipeContext","Switch.RootProvider","Switch.Root","Switch.Label","Switch.Thumb","Switch.Control","styles","fallback","children","rest","chakra","dataAttr","Switch.HiddenInput","Switch","React","indeterminate","onContrast","label","rootRef","size","switchRef","_computedVariant","useMemo","jsxs","CSwitch.Root","CSwitch.HiddenInput","CSwitch.Control","CSwitch.Label","WrappedSwitch","withFormControl"],"mappings":"wbAGM,CAACA,EAAgBC,CAAgB,EAAIC,gBAAc,CACvD,KAAM,gBACN,SAAU,mBACV,aAAc,oBAChB,CAAC,ECAKC,EAAgBC,EAAU,WAAC,CAACC,EAAOC,IAAQ,CAC/C,MAAMC,EAAgBN,EAAkB,EAClCO,EAAcC,EAAU,WAACF,EAAc,gBAAe,EAAIF,CAAK,EACrE,OAAuBK,EAAAA,kBAAAA,IAAIC,EAAAA,IAAI,KAAM,CAAE,GAAGH,EAAa,IAAAF,EAAK,CAC9D,CAAC,EACDH,EAAc,YAAc,gBCJ5B,MAAMS,EAAoBR,EAAU,WAAC,CAACC,EAAOC,IAAQ,CACnD,MAAMC,EAAgBN,EAAkB,EAClCO,EAAcC,EAAU,WAACF,EAAc,oBAAmB,EAAIF,CAAK,EACnEQ,EAAQC,EAAAA,gBAAiB,EAC/B,OAAuBJ,EAAG,kBAAA,IAACC,MAAI,MAAO,CAAE,mBAAoBE,GAAO,gBAAiB,GAAGL,EAAa,IAAAF,EAAK,CAC3G,CAAC,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CAGN,EAEAK,EAAO,YAAc,SACf,MAAAe,EAAgBC,kBAA6BhB,CAAM","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as c } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { I as S } from "./icon.component-
|
|
2
|
+
import { I as S } from "./icon.component-S_qFWBRf.js";
|
|
3
3
|
import { N as G } from "./notificationCounter.component-BzhAKrKR.js";
|
|
4
4
|
import { W as Y } from "./heading.component-CSbfsm3W.js";
|
|
5
5
|
import { c as J } from "./create-slot-recipe-context-BJmsuxih.js";
|
|
@@ -611,4 +611,4 @@ const Ke = {
|
|
|
611
611
|
export {
|
|
612
612
|
rt as T
|
|
613
613
|
};
|
|
614
|
-
//# sourceMappingURL=tabs.component-
|
|
614
|
+
//# sourceMappingURL=tabs.component-CjU_OQuN.js.map
|