@lax-wp/design-system 0.13.33-beta.4 → 0.13.33-beta.5

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("../../../_virtual/index.cjs.js"),O=require("react"),T=require("framer-motion"),oe=require("antd"),ce=require("react-i18next"),f=require("../../data-display/typography/Typography.cjs.js"),b=require("../../../constants/toggle.cjs.js"),R=require("@mui/icons-material"),de=require("../../icons/AIExtractedIndicator.cjs.js"),ue=require("../../icons/AIStarIcon.cjs.js"),me=require("../../data-display/label/Label.cjs.js"),S=require("../../tooltip/Tooltip.cjs.js"),fe=require("../../icons/HelpIcon.cjs.js"),pe=require("../shared/InputLabel.cjs.js"),o=require("../../../utils/confidenceScoreUtils.cjs.js"),xe=(t,r,s,p="medium")=>{const i={small:"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5",medium:"w-10 h-[1.375rem] after:h-[1.125rem] after:w-[1.125rem] after:top-0.5 after:left-0.5",large:"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5"},x={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return a("p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]",i[p],x[p],{"peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500":t,"after:bg-white dark:after:bg-black-500":!t,"text-white dark:text-black-900":r,"cursor-not-allowed opacity-70":s})},ge=({size:t=18,fill:r="#016DCF"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:r})}),he=({size:t=18,fill:r="#101828"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:r})}),M=O.forwardRef(({isGTN:t=!1,isChecked:r,id:s,onChange:p,label:i,required:x,isRequiredConditional:P=!1,hideStatus:G=!1,labelDirection:v=b.TOGGLE_LABEL_DIRECTION.TOP,statusText:y,withIcon:E=!1,tags:z,isAiExtracted:H=!1,confidenceScore:j,confidenceType:c="high",confidenceTooltip:k,sourceMeta:$=[],onConfidenceScoreClick:V,tooltip:C="",className:W="",disabled:Y,isDisabled:U=!1,icon:g,stopClickPropagation:J=!0,gtnName:K,variant:be="primary",labelClassName:w,isLiveField:Q=!1,message:d,messageType:u="default",wrapperClassName:X,helpText:m,labelExtra:Z,size:l="medium",renderGTNAddButton:q,onAddGTNToDocument:_,inputEmphasis:N="default"},ee)=>{const{t:re}=ce.useTranslation(),ae=N==="modified",te=N==="deleted",le=N==="success",I=Y??U,h=!!I,F=typeof I=="string"?I:void 0,se=v===b.TOGGLE_LABEL_DIRECTION.TOP,ie=v===b.TOGGLE_LABEL_DIRECTION.LEFT,A=v===b.TOGGLE_LABEL_DIRECTION.RIGHT,[L,B]=O.useState(!1),D=()=>{_&&_({key:K,value:r?"Yes":"No"})},ne=()=>u==="error"?"text-red-500 dark:text-red-400":u==="success"?"text-green-500 dark:text-green-400":u==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return e.jsxs("div",{className:a("flex gap-0.5",L&&t?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",X),onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),onClick:n=>{J&&n.stopPropagation()},children:[t&&!L?e.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,e.jsxs("div",{className:a("w-full flex flex-col",ae&&"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] px-2 py-1.5",te&&"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] px-2 py-1.5",le&&"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] px-2 py-1.5"),children:[se&&i&&e.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[e.jsxs("h1",{className:a("mb-1 min-w-0 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",w),children:[e.jsx(pe.InputLabel,{label:i||"",required:x||!1,isRequiredConditional:P||!1}),Q&&e.jsx(R.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),H&&!o.shouldShowConfidenceScore(j)&&e.jsx(de.AIExtractedIndicator,{}),e.jsx(me.Label,{labels:z||[]}),C&&e.jsx(S,{placement:"top",title:C,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(fe.HelpIcon,{})})}),Z]}),e.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[o.shouldShowConfidenceScore(j)&&c?e.jsx(S,{placement:"top-end",title:k??"",hideTooltip:k==null,className:"cursor-pointer",children:e.jsxs("div",{className:a("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",o.getConfidenceScoreBadgeClass(c)),onClick:()=>V?.($),children:[e.jsx(ue.AIStarIcon,{size:12,fill:o.getConfidenceScoreBadgeColor(c),fillSecondary:o.getConfidenceScoreBadgeFill(c)}),e.jsxs("span",{className:a("text-xs font-medium leading-4",o.getConfidenceScoreBadgeTextColor(c)),children:[j,"%"]})]})}):null,t&&L?q?q(D):e.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:D,type:"button",children:e.jsx(oe.Tooltip,{placement:"top",title:re("Add to document"),children:e.jsx(R.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]}),m&&e.jsx(f.Typography,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:m}),e.jsxs("div",{className:"flex",children:[ie&&e.jsx(f.Typography,{size:"small",variant:"medium",className:a("mr-2 text-neutral-700 dark:text-black-200",w),appearance:"custom",children:i}),e.jsxs("label",{className:a("relative inline-flex items-center",A||y?"":"w-min",h?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:n=>n.stopPropagation(),children:[e.jsx("input",{ref:ee,type:"checkbox",id:s,onChange:n=>!h&&p(n.target.checked),value:"",disabled:h,checked:r,className:a("sr-only peer w-full",W),"aria-required":x,"aria-invalid":d&&u==="error"?"true":"false","aria-describedby":d||m?`${s}-description`:void 0}),e.jsx("div",{className:xe(r,E,h,l),children:E?e.jsx("div",{className:"flex items-center justify-center h-full w-full",children:e.jsx("div",{className:a("z-10 transition-all transform",l==="small"&&(r?"translate-x-2":"-translate-x-1.5"),l==="medium"&&(r?"translate-x-2":"-translate-x-2"),l==="large"&&(r?"translate-x-2.5":"-translate-x-2.5")),children:r?g?.checkedIcon?g.checkedIcon:e.jsx(ge,{size:18,fill:"#016DCF"}):g?.uncheckedIcon?g.uncheckedIcon:e.jsx(he,{size:18,fill:"#101828"})})}):null}),F&&e.jsx(S,{placement:"top",title:F,className:"-ml-2",children:e.jsx("span",{className:a("absolute inset-y-0 left-0",l==="small"&&"w-7",l==="medium"&&"w-9",l==="large"&&"w-11")})}),A&&e.jsx(f.Typography,{size:"small",variant:"medium",className:a("ml-2 text-neutral-700 dark:text-black-300",w),appearance:"custom",children:i}),G?null:e.jsx(f.Typography,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:y||(r?"Yes":"No")})]})]}),e.jsx(T.AnimatePresence,{children:d&&e.jsx(T.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${s}-description`,role:u==="error"?"alert":void 0,children:e.jsx(f.Typography,{className:a("mt-1",ne()),appearance:"custom",size:"extra-small",variant:"medium",children:d})})}),m&&!d&&e.jsx("div",{id:`${s}-description`,className:"sr-only",children:m})]})]})});M.displayName="Toggle";exports.Toggle=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../../_virtual/index.cjs.js"),O=require("react"),T=require("framer-motion"),ne=require("antd"),ce=require("react-i18next"),p=require("../../data-display/typography/Typography.cjs.js"),b=require("../../../constants/toggle.cjs.js"),R=require("@mui/icons-material"),de=require("../../icons/AIExtractedIndicator.cjs.js"),ue=require("../../icons/AIStarIcon.cjs.js"),me=require("../../data-display/label/Label.cjs.js"),C=require("../../tooltip/Tooltip.cjs.js"),pe=require("../../icons/HelpIcon.cjs.js"),fe=require("../shared/InputLabel.cjs.js"),n=require("../../../utils/confidenceScoreUtils.cjs.js"),xe=(t,a,s,f="medium")=>{const i={small:"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5",medium:"w-10 h-[1.375rem] after:h-[1.125rem] after:w-[1.125rem] after:top-0.5 after:left-0.5",large:"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5"},x={small:"peer-checked:after:translate-x-3",medium:"peer-checked:after:translate-x-full",large:"peer-checked:after:translate-x-5"};return r("p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]",i[f],x[f],{"peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500":t,"after:bg-white dark:after:bg-black-500":!t,"text-white dark:text-black-900":a,"cursor-not-allowed opacity-70":s})},ge=({size:t=18,fill:a="#016DCF"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:a})}),he=({size:t=18,fill:a="#101828"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:e.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:a})}),M=O.forwardRef(({isGTN:t=!1,isChecked:a,id:s,onChange:f,label:i,required:x,isRequiredConditional:P=!1,hideStatus:G=!1,labelDirection:v=b.TOGGLE_LABEL_DIRECTION.TOP,statusText:y,withIcon:S=!1,tags:z,isAiExtracted:H=!1,confidenceScore:j,confidenceType:c="high",confidenceTooltip:k,sourceMeta:$=[],onConfidenceScoreClick:V,tooltip:E="",className:W="",disabled:Y,isDisabled:U=!1,icon:g,stopClickPropagation:J=!0,gtnName:K,variant:be="primary",labelClassName:w,isLiveField:Q=!1,message:d,messageType:u="default",wrapperClassName:X,helpText:m,labelExtra:Z,size:l="medium",renderGTNAddButton:q,onAddGTNToDocument:_,inputEmphasis:N="default"},ee)=>{const{t:re}=ce.useTranslation(),te=N==="modified",ae=N==="deleted",le=N==="success",I=Y??U,h=!!I,F=typeof I=="string"?I:void 0,se=v===b.TOGGLE_LABEL_DIRECTION.TOP,ie=v===b.TOGGLE_LABEL_DIRECTION.LEFT,A=v===b.TOGGLE_LABEL_DIRECTION.RIGHT,[L,B]=O.useState(!1),D=()=>{_&&_({key:K,value:a?"Yes":"No"})},oe=()=>u==="error"?"text-red-500 dark:text-red-400":u==="success"?"text-green-500 dark:text-green-400":u==="info"?"text-primary-500 dark:text-primary-400":"text-neutral-500 dark:text-neutral-400";return e.jsxs("div",{className:r("flex gap-0.5",L&&t?"border rounded-lg border-primary-100 bg-primary-50 p-1":"",X),onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),onClick:o=>{J&&o.stopPropagation()},children:[t&&!L?e.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5"}):null,e.jsxs("div",{className:r("w-full flex flex-col",te&&"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] px-2 py-1.5",ae&&"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] px-2 py-1.5",le&&"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] px-2 py-1.5"),children:[se&&i&&e.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[e.jsxs("h1",{className:r("mb-1 min-w-0 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",w),children:[e.jsx(fe.InputLabel,{label:i||"",required:x||!1,isRequiredConditional:P||!1}),Q&&e.jsx(R.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),H&&!n.shouldShowConfidenceScore(j)&&e.jsx(de.AIExtractedIndicator,{}),e.jsx(me.Label,{labels:z||[]}),E&&e.jsx(C,{placement:"top",title:E,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(pe.HelpIcon,{})})}),Z]}),e.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[n.shouldShowConfidenceScore(j)&&c?e.jsx(C,{placement:"top-end",title:k??"",hideTooltip:k==null,className:"cursor-pointer",children:e.jsxs("div",{className:r("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",n.getConfidenceScoreBadgeClass(c)),onClick:()=>V?.($),children:[e.jsx(ue.AIStarIcon,{size:12,fill:n.getConfidenceScoreBadgeColor(c),fillSecondary:n.getConfidenceScoreBadgeFill(c)}),e.jsxs("span",{className:r("text-xs font-medium leading-4",n.getConfidenceScoreBadgeTextColor(c)),children:[j,"%"]})]})}):null,t&&L?q?q(D):e.jsx("button",{id:"btn-toggle-add-to-document",className:"cursor-pointer",onClick:D,type:"button",children:e.jsx(ne.Tooltip,{placement:"top",title:re("Add to document"),children:e.jsx(R.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]}),m&&e.jsx(p.Typography,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:m}),e.jsxs("div",{className:"flex",children:[ie&&e.jsx(p.Typography,{size:"small",variant:"medium",className:r("mr-2 text-neutral-700 dark:text-black-200",w),appearance:"custom",children:i}),e.jsxs("label",{className:r("relative inline-flex items-center",A||y?"":"w-min",h?"cursor-not-allowed opacity-50":"cursor-pointer"),onClick:o=>o.stopPropagation(),children:[e.jsx("input",{ref:ee,type:"checkbox",id:s,onChange:o=>!h&&f(o.target.checked),value:"",disabled:h,checked:a,className:r("sr-only peer w-full",W),"aria-required":x,"aria-invalid":d&&u==="error"?"true":"false","aria-describedby":d||m?`${s}-description`:void 0}),e.jsx("div",{className:xe(a,S,h,l),children:S?e.jsx("div",{className:r("pointer-events-none absolute top-0.5 left-0.5 z-10 flex items-center justify-center transition-transform",l==="small"&&"h-3 w-3",l==="medium"&&"h-[1.125rem] w-[1.125rem]",l==="large"&&"h-5 w-5",a&&"translate-x-full"),children:a?g?.checkedIcon?g.checkedIcon:e.jsx(ge,{size:18,fill:"#016DCF"}):g?.uncheckedIcon?g.uncheckedIcon:e.jsx(he,{size:18,fill:"#101828"})}):null}),F&&e.jsx(C,{placement:"top",title:F,className:"-ml-2",children:e.jsx("span",{className:r("absolute inset-y-0 left-0",l==="small"&&"w-7",l==="medium"&&"w-9",l==="large"&&"w-11")})}),A&&e.jsx(p.Typography,{size:"small",variant:"medium",className:r("ml-2 text-neutral-700 dark:text-black-300",w),appearance:"custom",children:i}),G?null:e.jsx(p.Typography,{size:"small",variant:"medium",className:"ml-2 text-neutral-900 dark:text-black-100",appearance:"custom",children:y||(a?"Yes":"No")})]})]}),e.jsx(T.AnimatePresence,{children:d&&e.jsx(T.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},id:`${s}-description`,role:u==="error"?"alert":void 0,children:e.jsx(p.Typography,{className:r("mt-1",oe()),appearance:"custom",size:"extra-small",variant:"medium",children:d})})}),m&&!d&&e.jsx("div",{id:`${s}-description`,className:"sr-only",children:m})]})]})});M.displayName="Toggle";exports.Toggle=M;
2
2
  //# sourceMappingURL=Toggle.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toggle.cjs.js","sources":["../../../../src/components/forms/toggle/Toggle.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, type ReactNode, useState } from \"react\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { TOGGLE_LABEL_DIRECTION } from \"../../../constants/toggle\";\nimport type { TToggleDirection } from \"../../../constants/toggle\";\nimport { BoltOutlined, NoteAddOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { Label, type LabelType } from \"../../data-display/label/Label\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\n\n// Re-export LabelType from Label component for external use\nexport type { LabelType };\n\n/** Visual emphasis for the toggle container (background + border) */\nexport type ToggleEmphasis = \"default\" | \"modified\" | \"deleted\" | \"success\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Props for the Toggle component\n */\nexport interface ToggleProps {\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** Unique identifier for the toggle */\n id?: string;\n /** Whether the toggle is checked */\n isChecked: boolean;\n /** Callback function called when toggle state changes */\n onChange: (val: boolean) => void;\n /** Label text or element to display */\n label?: ReactNode;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Whether to hide the status text (Yes/No) */\n hideStatus?: boolean;\n /** Label direction relative to toggle */\n labelDirection?: TToggleDirection;\n /** Custom status text instead of Yes/No */\n statusText?: string;\n /** Whether to show icons in the toggle */\n withIcon?: boolean;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Tooltip text to display */\n tooltip?: string;\n /** Additional CSS classes for the toggle input */\n className?: string;\n /** Whether the toggle is disabled. Pass a string to disable with a tooltip message. */\n disabled?: boolean | string;\n /**\n * @deprecated Use `disabled` instead.\n */\n isDisabled?: boolean | string;\n /** Custom icons for checked/unchecked states */\n icon?: {\n checkedIcon: ReactNode;\n uncheckedIcon: ReactNode;\n };\n /** Whether to stop click propagation */\n stopClickPropagation?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Visual variant for the toggle */\n variant?: 'primary' | 'secondary';\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Message to display below the toggle */\n message?: string;\n /** Type of message to display */\n messageType?: \"success\" | \"error\" | \"info\" | \"default\";\n /** Additional CSS classes for the wrapper container */\n wrapperClassName?: string;\n /** Help text to display below the label */\n helpText?: string;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Size variant for the toggle */\n size?: \"small\" | \"medium\" | \"large\";\n /** Custom render function for GTN add to document button */\n renderGTNAddButton?: (onClick: () => void) => ReactNode;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Container surface style: `'modified'` — Warning-50/Warning-200; `'deleted'` — Error-50/Error-200; `'success'` — Success-50/Success-200 */\n inputEmphasis?: ToggleEmphasis;\n}\n\n/**\n * Get toggle class names based on state and options\n */\nconst getToggleClassNames = (\n isChecked: boolean,\n withIcon: boolean,\n isDisabled: boolean,\n size: \"small\" | \"medium\" | \"large\" = \"medium\"\n): string => {\n const sizeClasses = {\n small: \"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5\",\n medium: \"w-10 h-[1.375rem] after:h-[1.125rem] after:w-[1.125rem] after:top-0.5 after:left-0.5\",\n large: \"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5\",\n };\n\n const translateClasses = {\n small: \"peer-checked:after:translate-x-3\",\n medium: \"peer-checked:after:translate-x-full\",\n large: \"peer-checked:after:translate-x-5\",\n };\n\n return cn(\n \"p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]\",\n sizeClasses[size],\n translateClasses[size],\n {\n 'peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500':\n isChecked,\n 'after:bg-white dark:after:bg-black-500': !isChecked,\n 'text-white dark:text-black-900': withIcon,\n 'cursor-not-allowed opacity-70': isDisabled,\n }\n );\n};\n\n/**\n * Default Check icon component\n */\nconst CheckIcon = ({ size = 18, fill = '#016DCF' }: { size?: number; fill?: string }) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z\"\n fill={fill}\n />\n </svg>\n);\n\n/**\n * Default Close icon component\n */\nconst CloseIcon = ({ size = 18, fill = '#101828' }: { size?: number; fill?: string }) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"\n fill={fill}\n />\n </svg>\n);\n\n/**\n * A highly customizable toggle component with label, validation, and styling support.\n * Features multiple sizes, variants, icon support, GTN integration, and comprehensive prop support.\n *\n * @example\n * ```tsx\n * <Toggle\n * id=\"notifications\"\n * label=\"Enable Notifications\"\n * isChecked={notificationsEnabled}\n * onChange={(checked) => setNotificationsEnabled(checked)}\n * required\n * />\n * ```\n */\nexport const Toggle = forwardRef<HTMLInputElement, ToggleProps>(\n (\n {\n isGTN = false,\n isChecked,\n id,\n onChange,\n label,\n required,\n isRequiredConditional = false,\n hideStatus = false,\n labelDirection = TOGGLE_LABEL_DIRECTION.TOP,\n statusText,\n withIcon = false,\n tags,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n tooltip = '',\n className = '',\n disabled,\n isDisabled = false,\n icon,\n stopClickPropagation = true,\n gtnName: _gtnName,\n variant: _variant = 'primary',\n labelClassName,\n isLiveField = false,\n message,\n messageType = \"default\",\n wrapperClassName,\n helpText,\n labelExtra,\n size = \"medium\",\n renderGTNAddButton,\n onAddGTNToDocument,\n inputEmphasis = \"default\",\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\";\n const emphasisDeletedSkin = inputEmphasis === \"deleted\";\n const emphasisSuccessSkin = inputEmphasis === \"success\";\n const resolvedDisabled = disabled ?? isDisabled;\n const isDisabledBool = !!resolvedDisabled;\n const disabledTooltip = typeof resolvedDisabled === 'string' ? resolvedDisabled : undefined;\n const isLabelDirectionTop = labelDirection === TOGGLE_LABEL_DIRECTION.TOP;\n const isLabelDirectionLeft = labelDirection === TOGGLE_LABEL_DIRECTION.LEFT;\n const isLabelDirectionRight = labelDirection === TOGGLE_LABEL_DIRECTION.RIGHT;\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: _gtnName,\n value: isChecked ? 'Yes' : 'No',\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const getMessageTypographyClass = (): string => {\n if (messageType === \"error\") return \"text-red-500 dark:text-red-400\";\n if (messageType === \"success\")\n return \"text-green-500 dark:text-green-400\";\n if (messageType === \"info\") return \"text-primary-500 dark:text-primary-400\";\n return \"text-neutral-500 dark:text-neutral-400\";\n };\n\n const _defaultRenderLabels = (labels?: (string | LabelType)[]) => {\n if (!labels || labels.length === 0) return null;\n return (\n <span className=\"inline-flex gap-1 ml-1\">\n {labels.map((tag, index) => {\n const label = typeof tag === 'string' ? tag : tag.label;\n const color = typeof tag === 'string' ? undefined : tag.color;\n return (\n <span\n key={index}\n className=\"px-1.5 py-0.5 text-xs rounded bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300\"\n style={color ? { backgroundColor: color } : undefined}\n >\n {label}\n </span>\n );\n })}\n </span>\n );\n };\n\n return (\n <div\n className={cn(\n 'flex gap-0.5',\n isHovered && isGTN ? 'border rounded-lg border-primary-100 bg-primary-50 p-1' : '',\n wrapperClassName\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n onClick={(e) => {\n if (stopClickPropagation) e.stopPropagation();\n }}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5\" />\n ) : null}\n <div className={cn(\n \"w-full flex flex-col\",\n emphasisModifiedSkin && \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] px-2 py-1.5\",\n emphasisDeletedSkin && \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] px-2 py-1.5\",\n emphasisSuccessSkin && \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] px-2 py-1.5\",\n )}>\n {isLabelDirectionTop && label && (\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <h1\n className={cn(\n 'mb-1 min-w-0 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap',\n labelClassName\n )}\n >\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && <BoltOutlined sx={{ fontSize: 16, color: 'var(--color-primary-600)', rotate: '15deg' }} />}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags || []} />\n {tooltip && (\n <Tooltip placement='top' title={tooltip}>\n <div className='cursor-pointer'>\n <HelpIcon />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </h1>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement='top-end'\n title={confidenceTooltip ?? ''}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className='cursor-pointer'\n >\n <div\n className={cn(\n 'inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5',\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn('text-xs font-medium leading-4', getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered ? (\n renderGTNAddButton ? (\n renderGTNAddButton(handleAddGTNToDocument)\n ) : (\n <button\n id=\"btn-toggle-add-to-document\"\n className=\"cursor-pointer\"\n onClick={handleAddGTNToDocument}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined className=\"text-primary-600\" sx={{ fontSize: 16 }} />\n </AntTooltip>\n </button>\n )\n ) : null}\n </div>\n </div>\n )}\n\n {/* Help text */}\n {helpText && (\n <Typography\n className=\"mb-2 text-neutral-600 dark:text-neutral-400\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"regular\"\n >\n {helpText}\n </Typography>\n )}\n\n <div className=\"flex\">\n {isLabelDirectionLeft && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={cn('mr-2 text-neutral-700 dark:text-black-200', labelClassName)}\n appearance=\"custom\"\n >\n {label}\n </Typography>\n )}\n\n <label\n className={cn(\n 'relative inline-flex items-center',\n isLabelDirectionRight || statusText ? '' : 'w-min',\n !isDisabledBool ? 'cursor-pointer' : 'cursor-not-allowed opacity-50'\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <input\n ref={ref}\n type=\"checkbox\"\n id={id}\n onChange={(e) => !isDisabledBool && onChange(e.target.checked)}\n value=\"\"\n disabled={isDisabledBool}\n checked={isChecked}\n className={cn('sr-only peer w-full', className)}\n aria-required={required}\n aria-invalid={\n message && messageType === \"error\" ? \"true\" : \"false\"\n }\n aria-describedby={\n message || helpText ? `${id}-description` : undefined\n }\n />\n <div className={getToggleClassNames(isChecked, withIcon, isDisabledBool, size)}>\n {withIcon ? (\n <div className=\"flex items-center justify-center h-full w-full\">\n <div\n className={cn(\n \"z-10 transition-all transform\",\n size === \"small\" &&\n (isChecked\n ? \"translate-x-2\"\n : \"-translate-x-1.5\"),\n size === \"medium\" &&\n (isChecked\n ? \"translate-x-2\"\n : \"-translate-x-2\"),\n size === \"large\" &&\n (isChecked\n ? \"translate-x-2.5\"\n : \"-translate-x-2.5\")\n )}\n >\n {isChecked ? (\n icon?.checkedIcon ? (\n icon.checkedIcon\n ) : (\n <CheckIcon size={18} fill=\"#016DCF\" />\n )\n ) : icon?.uncheckedIcon ? (\n icon.uncheckedIcon\n ) : (\n <CloseIcon size={18} fill=\"#101828\" />\n )}\n </div>\n </div>\n ) : null}\n </div>\n {disabledTooltip && (\n <Tooltip placement=\"top\" title={disabledTooltip} className=\"-ml-2\">\n <span className={cn(\n 'absolute inset-y-0 left-0',\n size === 'small' && 'w-7',\n size === 'medium' && 'w-9',\n size === 'large' && 'w-11',\n )} />\n </Tooltip>\n )}\n\n {isLabelDirectionRight && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={cn('ml-2 text-neutral-700 dark:text-black-300', labelClassName)}\n appearance=\"custom\"\n >\n {label}\n </Typography>\n )}\n\n {hideStatus ? null : (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"ml-2 text-neutral-900 dark:text-black-100\"\n appearance=\"custom\"\n >\n {statusText ? statusText : isChecked ? 'Yes' : 'No'}\n </Typography>\n )}\n </label>\n </div>\n\n {/* Message */}\n <AnimatePresence>\n {message && (\n <motion.div\n initial={{ opacity: 0, y: -10 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -10 }}\n transition={{ duration: 0.2 }}\n id={`${id}-description`}\n role={messageType === \"error\" ? \"alert\" : undefined}\n >\n <Typography\n className={cn(\"mt-1\", getMessageTypographyClass())}\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {message}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n\n {/* Help text description for accessibility */}\n {helpText && !message && (\n <div id={`${id}-description`} className=\"sr-only\">\n {helpText}\n </div>\n )}\n </div>\n </div>\n );\n }\n);\n\nToggle.displayName = \"Toggle\";\n"],"names":["getToggleClassNames","isChecked","withIcon","isDisabled","size","sizeClasses","translateClasses","cn","CheckIcon","fill","jsx","CloseIcon","Toggle","forwardRef","isGTN","id","onChange","label","required","isRequiredConditional","hideStatus","labelDirection","TOGGLE_LABEL_DIRECTION","statusText","tags","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","tooltip","className","disabled","icon","stopClickPropagation","_gtnName","_variant","labelClassName","isLiveField","message","messageType","wrapperClassName","helpText","labelExtra","renderGTNAddButton","onAddGTNToDocument","inputEmphasis","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","resolvedDisabled","isDisabledBool","disabledTooltip","isLabelDirectionTop","isLabelDirectionLeft","isLabelDirectionRight","isHovered","setIsHovered","useState","handleAddGTNToDocument","getMessageTypographyClass","jsxs","e","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","Typography","AnimatePresence","motion"],"mappings":"stBA+IMA,GAAsB,CAC1BC,EACAC,EACAC,EACAC,EAAqC,WAC1B,CACX,MAAMC,EAAc,CAClB,MAAO,2DACP,OAAQ,uFACR,MAAO,2DAAA,EAGHC,EAAmB,CACvB,MAAO,mCACP,OAAQ,sCACR,MAAO,kCAAA,EAGT,OAAOC,EACL,ggBACAF,EAAYD,CAAI,EAChBE,EAAiBF,CAAI,EACrB,CACE,4IACEH,EACF,yCAA0C,CAACA,EAC3C,iCAAkCC,EAClC,gCAAiCC,CAAA,CACnC,CAEJ,EAKMK,GAAY,CAAC,CAAE,KAAAJ,EAAO,GAAI,KAAAK,EAAO,SAAA,IACrCC,EAAAA,IAAC,MAAA,CAAI,MAAON,EAAM,OAAQA,EAAM,QAAQ,YAAY,KAAK,OACvD,SAAAM,EAAAA,IAAC,OAAA,CACC,EAAE,4DACF,KAAAD,CAAA,CACF,EACF,EAMIE,GAAY,CAAC,CAAE,KAAAP,EAAO,GAAI,KAAAK,EAAO,SAAA,IACrCC,EAAAA,IAAC,MAAA,CAAI,MAAON,EAAM,OAAQA,EAAM,QAAQ,YAAY,KAAK,OACvD,SAAAM,EAAAA,IAAC,OAAA,CACC,EAAE,gHACF,KAAAD,CAAA,CACF,EACF,EAkBWG,EAASC,EAAAA,WACpB,CACE,CACE,MAAAC,EAAQ,GACR,UAAAb,EACA,GAAAc,EACA,SAAAC,EACA,MAAAC,EACA,SAAAC,EACA,sBAAAC,EAAwB,GACxB,WAAAC,EAAa,GACb,eAAAC,EAAiBC,EAAAA,uBAAuB,IACxC,WAAAC,EACA,SAAArB,EAAW,GACX,KAAAsB,EACA,cAAAC,EAAgB,GAChB,gBAAAC,EACA,eAAAC,EAAiB,OACjB,kBAAAC,EACA,WAAAC,EAAa,CAAA,EACb,uBAAAC,EACA,QAAAC,EAAU,GACV,UAAAC,EAAY,GACZ,SAAAC,EACA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IAAgB,QAAU,QAAU,OAE1C,SAAA/B,EAAAA,IAACuE,EAAAA,WAAA,CACC,UAAW1E,EAAG,OAAQyD,IAA2B,EACjD,WAAW,SACX,KAAK,cACL,QAAQ,SAEP,SAAAxB,CAAA,CAAA,CACH,CAAA,EAGN,EAGCG,GAAY,CAACH,GACZ9B,EAAAA,IAAC,MAAA,CAAI,GAAI,GAAGK,CAAE,eAAgB,UAAU,UACrC,SAAA4B,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,CAAA,CAAA,CAGN,CACF,EAEA/B,EAAO,YAAc"}
1
+ {"version":3,"file":"Toggle.cjs.js","sources":["../../../../src/components/forms/toggle/Toggle.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, type ReactNode, useState } from \"react\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { TOGGLE_LABEL_DIRECTION } from \"../../../constants/toggle\";\nimport type { TToggleDirection } from \"../../../constants/toggle\";\nimport { BoltOutlined, NoteAddOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { Label, type LabelType } from \"../../data-display/label/Label\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\n\n// Re-export LabelType from Label component for external use\nexport type { LabelType };\n\n/** Visual emphasis for the toggle container (background + border) */\nexport type ToggleEmphasis = \"default\" | \"modified\" | \"deleted\" | \"success\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Props for the Toggle component\n */\nexport interface ToggleProps {\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** Unique identifier for the toggle */\n id?: string;\n /** Whether the toggle is checked */\n isChecked: boolean;\n /** Callback function called when toggle state changes */\n onChange: (val: boolean) => void;\n /** Label text or element to display */\n label?: ReactNode;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Whether to hide the status text (Yes/No) */\n hideStatus?: boolean;\n /** Label direction relative to toggle */\n labelDirection?: TToggleDirection;\n /** Custom status text instead of Yes/No */\n statusText?: string;\n /** Whether to show icons in the toggle */\n withIcon?: boolean;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Tooltip text to display */\n tooltip?: string;\n /** Additional CSS classes for the toggle input */\n className?: string;\n /** Whether the toggle is disabled. Pass a string to disable with a tooltip message. */\n disabled?: boolean | string;\n /**\n * @deprecated Use `disabled` instead.\n */\n isDisabled?: boolean | string;\n /** Custom icons for checked/unchecked states */\n icon?: {\n checkedIcon: ReactNode;\n uncheckedIcon: ReactNode;\n };\n /** Whether to stop click propagation */\n stopClickPropagation?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Visual variant for the toggle */\n variant?: 'primary' | 'secondary';\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Message to display below the toggle */\n message?: string;\n /** Type of message to display */\n messageType?: \"success\" | \"error\" | \"info\" | \"default\";\n /** Additional CSS classes for the wrapper container */\n wrapperClassName?: string;\n /** Help text to display below the label */\n helpText?: string;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Size variant for the toggle */\n size?: \"small\" | \"medium\" | \"large\";\n /** Custom render function for GTN add to document button */\n renderGTNAddButton?: (onClick: () => void) => ReactNode;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Container surface style: `'modified'` — Warning-50/Warning-200; `'deleted'` — Error-50/Error-200; `'success'` — Success-50/Success-200 */\n inputEmphasis?: ToggleEmphasis;\n}\n\n/**\n * Get toggle class names based on state and options\n */\nconst getToggleClassNames = (\n isChecked: boolean,\n withIcon: boolean,\n isDisabled: boolean,\n size: \"small\" | \"medium\" | \"large\" = \"medium\"\n): string => {\n const sizeClasses = {\n small: \"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5\",\n medium: \"w-10 h-[1.375rem] after:h-[1.125rem] after:w-[1.125rem] after:top-0.5 after:left-0.5\",\n large: \"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5\",\n };\n\n const translateClasses = {\n small: \"peer-checked:after:translate-x-3\",\n medium: \"peer-checked:after:translate-x-full\",\n large: \"peer-checked:after:translate-x-5\",\n };\n\n return cn(\n \"p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]\",\n sizeClasses[size],\n translateClasses[size],\n {\n 'peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500':\n isChecked,\n 'after:bg-white dark:after:bg-black-500': !isChecked,\n 'text-white dark:text-black-900': withIcon,\n 'cursor-not-allowed opacity-70': isDisabled,\n }\n );\n};\n\n/**\n * Default Check icon component\n */\nconst CheckIcon = ({ size = 18, fill = '#016DCF' }: { size?: number; fill?: string }) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z\"\n fill={fill}\n />\n </svg>\n);\n\n/**\n * Default Close icon component\n */\nconst CloseIcon = ({ size = 18, fill = '#101828' }: { size?: number; fill?: string }) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"\n fill={fill}\n />\n </svg>\n);\n\n/**\n * A highly customizable toggle component with label, validation, and styling support.\n * Features multiple sizes, variants, icon support, GTN integration, and comprehensive prop support.\n *\n * @example\n * ```tsx\n * <Toggle\n * id=\"notifications\"\n * label=\"Enable Notifications\"\n * isChecked={notificationsEnabled}\n * onChange={(checked) => setNotificationsEnabled(checked)}\n * required\n * />\n * ```\n */\nexport const Toggle = forwardRef<HTMLInputElement, ToggleProps>(\n (\n {\n isGTN = false,\n isChecked,\n id,\n onChange,\n label,\n required,\n isRequiredConditional = false,\n hideStatus = false,\n labelDirection = TOGGLE_LABEL_DIRECTION.TOP,\n statusText,\n withIcon = false,\n tags,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n tooltip = '',\n className = '',\n disabled,\n isDisabled = false,\n icon,\n stopClickPropagation = true,\n gtnName: _gtnName,\n variant: _variant = 'primary',\n labelClassName,\n isLiveField = false,\n message,\n messageType = \"default\",\n wrapperClassName,\n helpText,\n labelExtra,\n size = \"medium\",\n renderGTNAddButton,\n onAddGTNToDocument,\n inputEmphasis = \"default\",\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\";\n const emphasisDeletedSkin = inputEmphasis === \"deleted\";\n const emphasisSuccessSkin = inputEmphasis === \"success\";\n const resolvedDisabled = disabled ?? isDisabled;\n const isDisabledBool = !!resolvedDisabled;\n const disabledTooltip = typeof resolvedDisabled === 'string' ? resolvedDisabled : undefined;\n const isLabelDirectionTop = labelDirection === TOGGLE_LABEL_DIRECTION.TOP;\n const isLabelDirectionLeft = labelDirection === TOGGLE_LABEL_DIRECTION.LEFT;\n const isLabelDirectionRight = labelDirection === TOGGLE_LABEL_DIRECTION.RIGHT;\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: _gtnName,\n value: isChecked ? 'Yes' : 'No',\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const getMessageTypographyClass = (): string => {\n if (messageType === \"error\") return \"text-red-500 dark:text-red-400\";\n if (messageType === \"success\")\n return \"text-green-500 dark:text-green-400\";\n if (messageType === \"info\") return \"text-primary-500 dark:text-primary-400\";\n return \"text-neutral-500 dark:text-neutral-400\";\n };\n\n const _defaultRenderLabels = (labels?: (string | LabelType)[]) => {\n if (!labels || labels.length === 0) return null;\n return (\n <span className=\"inline-flex gap-1 ml-1\">\n {labels.map((tag, index) => {\n const label = typeof tag === 'string' ? tag : tag.label;\n const color = typeof tag === 'string' ? undefined : tag.color;\n return (\n <span\n key={index}\n className=\"px-1.5 py-0.5 text-xs rounded bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300\"\n style={color ? { backgroundColor: color } : undefined}\n >\n {label}\n </span>\n );\n })}\n </span>\n );\n };\n\n return (\n <div\n className={cn(\n 'flex gap-0.5',\n isHovered && isGTN ? 'border rounded-lg border-primary-100 bg-primary-50 p-1' : '',\n wrapperClassName\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n onClick={(e) => {\n if (stopClickPropagation) e.stopPropagation();\n }}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5\" />\n ) : null}\n <div className={cn(\n \"w-full flex flex-col\",\n emphasisModifiedSkin && \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] px-2 py-1.5\",\n emphasisDeletedSkin && \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] px-2 py-1.5\",\n emphasisSuccessSkin && \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] px-2 py-1.5\",\n )}>\n {isLabelDirectionTop && label && (\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <h1\n className={cn(\n 'mb-1 min-w-0 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap',\n labelClassName\n )}\n >\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && <BoltOutlined sx={{ fontSize: 16, color: 'var(--color-primary-600)', rotate: '15deg' }} />}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags || []} />\n {tooltip && (\n <Tooltip placement='top' title={tooltip}>\n <div className='cursor-pointer'>\n <HelpIcon />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </h1>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement='top-end'\n title={confidenceTooltip ?? ''}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className='cursor-pointer'\n >\n <div\n className={cn(\n 'inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5',\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn('text-xs font-medium leading-4', getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered ? (\n renderGTNAddButton ? (\n renderGTNAddButton(handleAddGTNToDocument)\n ) : (\n <button\n id=\"btn-toggle-add-to-document\"\n className=\"cursor-pointer\"\n onClick={handleAddGTNToDocument}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined className=\"text-primary-600\" sx={{ fontSize: 16 }} />\n </AntTooltip>\n </button>\n )\n ) : null}\n </div>\n </div>\n )}\n\n {/* Help text */}\n {helpText && (\n <Typography\n className=\"mb-2 text-neutral-600 dark:text-neutral-400\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"regular\"\n >\n {helpText}\n </Typography>\n )}\n\n <div className=\"flex\">\n {isLabelDirectionLeft && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={cn('mr-2 text-neutral-700 dark:text-black-200', labelClassName)}\n appearance=\"custom\"\n >\n {label}\n </Typography>\n )}\n\n <label\n className={cn(\n 'relative inline-flex items-center',\n isLabelDirectionRight || statusText ? '' : 'w-min',\n !isDisabledBool ? 'cursor-pointer' : 'cursor-not-allowed opacity-50'\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <input\n ref={ref}\n type=\"checkbox\"\n id={id}\n onChange={(e) => !isDisabledBool && onChange(e.target.checked)}\n value=\"\"\n disabled={isDisabledBool}\n checked={isChecked}\n className={cn('sr-only peer w-full', className)}\n aria-required={required}\n aria-invalid={\n message && messageType === \"error\" ? \"true\" : \"false\"\n }\n aria-describedby={\n message || helpText ? `${id}-description` : undefined\n }\n />\n <div className={getToggleClassNames(isChecked, withIcon, isDisabledBool, size)}>\n {withIcon ? (\n // Overlay the icon on the sliding knob using the knob's exact\n // geometry (same top/left, same size, same full-width slide) so\n // it stays perfectly centered in the circle for every size/state.\n <div\n className={cn(\n \"pointer-events-none absolute top-0.5 left-0.5 z-10 flex items-center justify-center transition-transform\",\n size === \"small\" && \"h-3 w-3\",\n size === \"medium\" && \"h-[1.125rem] w-[1.125rem]\",\n size === \"large\" && \"h-5 w-5\",\n isChecked && \"translate-x-full\"\n )}\n >\n {isChecked ? (\n icon?.checkedIcon ? (\n icon.checkedIcon\n ) : (\n <CheckIcon size={18} fill=\"#016DCF\" />\n )\n ) : icon?.uncheckedIcon ? (\n icon.uncheckedIcon\n ) : (\n <CloseIcon size={18} fill=\"#101828\" />\n )}\n </div>\n ) : null}\n </div>\n {disabledTooltip && (\n <Tooltip placement=\"top\" title={disabledTooltip} className=\"-ml-2\">\n <span className={cn(\n 'absolute inset-y-0 left-0',\n size === 'small' && 'w-7',\n size === 'medium' && 'w-9',\n size === 'large' && 'w-11',\n )} />\n </Tooltip>\n )}\n\n {isLabelDirectionRight && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={cn('ml-2 text-neutral-700 dark:text-black-300', labelClassName)}\n appearance=\"custom\"\n >\n {label}\n </Typography>\n )}\n\n {hideStatus ? null : (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"ml-2 text-neutral-900 dark:text-black-100\"\n appearance=\"custom\"\n >\n {statusText ? statusText : isChecked ? 'Yes' : 'No'}\n </Typography>\n )}\n </label>\n </div>\n\n {/* Message */}\n <AnimatePresence>\n {message && (\n <motion.div\n initial={{ opacity: 0, y: -10 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -10 }}\n transition={{ duration: 0.2 }}\n id={`${id}-description`}\n role={messageType === \"error\" ? \"alert\" : undefined}\n >\n <Typography\n className={cn(\"mt-1\", getMessageTypographyClass())}\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {message}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n\n {/* Help text description for accessibility */}\n {helpText && !message && (\n <div id={`${id}-description`} className=\"sr-only\">\n {helpText}\n </div>\n )}\n </div>\n </div>\n );\n }\n);\n\nToggle.displayName = \"Toggle\";\n"],"names":["getToggleClassNames","isChecked","withIcon","isDisabled","size","sizeClasses","translateClasses","cn","CheckIcon","fill","jsx","CloseIcon","Toggle","forwardRef","isGTN","id","onChange","label","required","isRequiredConditional","hideStatus","labelDirection","TOGGLE_LABEL_DIRECTION","statusText","tags","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","tooltip","className","disabled","icon","stopClickPropagation","_gtnName","_variant","labelClassName","isLiveField","message","messageType","wrapperClassName","helpText","labelExtra","renderGTNAddButton","onAddGTNToDocument","inputEmphasis","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","resolvedDisabled","isDisabledBool","disabledTooltip","isLabelDirectionTop","isLabelDirectionLeft","isLabelDirectionRight","isHovered","setIsHovered","useState","handleAddGTNToDocument","getMessageTypographyClass","jsxs","e","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","Typography","AnimatePresence","motion"],"mappings":"stBA+IMA,GAAsB,CAC1BC,EACAC,EACAC,EACAC,EAAqC,WAC1B,CACX,MAAMC,EAAc,CAClB,MAAO,2DACP,OAAQ,uFACR,MAAO,2DAAA,EAGHC,EAAmB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AA,CAAA,CAEJ,CAAA,CAAA,CAAA,CAGN,CACF,EAEA/B,EAAO,YAAc"}
@@ -1,20 +1,20 @@
1
1
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import a from "../../../_virtual/index.es.js";
2
+ import r from "../../../_virtual/index.es.js";
3
3
  import { forwardRef as ie, useState as oe } from "react";
4
4
  import { AnimatePresence as ne, motion as se } from "framer-motion";
5
5
  import { Tooltip as ce } from "antd";
6
6
  import { useTranslation as de } from "react-i18next";
7
7
  import { Typography as p } from "../../data-display/typography/Typography.es.js";
8
- import { TOGGLE_LABEL_DIRECTION as b } from "../../../constants/toggle.es.js";
8
+ import { TOGGLE_LABEL_DIRECTION as x } from "../../../constants/toggle.es.js";
9
9
  import { BoltOutlined as me, NoteAddOutlined as fe } from "@mui/icons-material";
10
10
  import { AIExtractedIndicator as pe } from "../../icons/AIExtractedIndicator.es.js";
11
11
  import { AIStarIcon as ue } from "../../icons/AIStarIcon.es.js";
12
12
  import { Label as ge } from "../../data-display/label/Label.es.js";
13
13
  import L from "../../tooltip/Tooltip.es.js";
14
14
  import { HelpIcon as he } from "../../icons/HelpIcon.es.js";
15
- import { InputLabel as xe } from "../shared/InputLabel.es.js";
16
- import { shouldShowConfidenceScore as O, getConfidenceScoreBadgeFill as be, getConfidenceScoreBadgeColor as ve, getConfidenceScoreBadgeTextColor as ke, getConfidenceScoreBadgeClass as ye } from "../../../utils/confidenceScoreUtils.es.js";
17
- const we = (t, r, o, u = "medium") => {
15
+ import { InputLabel as be } from "../shared/InputLabel.es.js";
16
+ import { shouldShowConfidenceScore as O, getConfidenceScoreBadgeFill as xe, getConfidenceScoreBadgeColor as ve, getConfidenceScoreBadgeTextColor as ke, getConfidenceScoreBadgeClass as ye } from "../../../utils/confidenceScoreUtils.es.js";
17
+ const we = (t, a, o, u = "medium") => {
18
18
  const n = {
19
19
  small: "w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5",
20
20
  medium: "w-10 h-[1.375rem] after:h-[1.125rem] after:w-[1.125rem] after:top-0.5 after:left-0.5",
@@ -24,40 +24,40 @@ const we = (t, r, o, u = "medium") => {
24
24
  medium: "peer-checked:after:translate-x-full",
25
25
  large: "peer-checked:after:translate-x-5"
26
26
  };
27
- return a(
27
+ return r(
28
28
  "p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]",
29
29
  n[u],
30
30
  g[u],
31
31
  {
32
32
  "peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500": t,
33
33
  "after:bg-white dark:after:bg-black-500": !t,
34
- "text-white dark:text-black-900": r,
34
+ "text-white dark:text-black-900": a,
35
35
  "cursor-not-allowed opacity-70": o
36
36
  }
37
37
  );
38
- }, Ne = ({ size: t = 18, fill: r = "#016DCF" }) => /* @__PURE__ */ e("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ e(
38
+ }, Ne = ({ size: t = 18, fill: a = "#016DCF" }) => /* @__PURE__ */ e("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ e(
39
39
  "path",
40
40
  {
41
41
  d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",
42
- fill: r
42
+ fill: a
43
43
  }
44
- ) }), Fe = ({ size: t = 18, fill: r = "#101828" }) => /* @__PURE__ */ e("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ e(
44
+ ) }), Ce = ({ size: t = 18, fill: a = "#101828" }) => /* @__PURE__ */ e("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ e(
45
45
  "path",
46
46
  {
47
47
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",
48
- fill: r
48
+ fill: a
49
49
  }
50
- ) }), Ce = ie(
50
+ ) }), Fe = ie(
51
51
  ({
52
52
  isGTN: t = !1,
53
- isChecked: r,
53
+ isChecked: a,
54
54
  id: o,
55
55
  onChange: u,
56
56
  label: n,
57
57
  required: g,
58
58
  isRequiredConditional: z = !1,
59
59
  hideStatus: R = !1,
60
- labelDirection: v = b.TOP,
60
+ labelDirection: v = x.TOP,
61
61
  statusText: k,
62
62
  withIcon: S = !1,
63
63
  tags: j,
@@ -85,18 +85,18 @@ const we = (t, r, o, u = "medium") => {
85
85
  size: i = "medium",
86
86
  renderGTNAddButton: B,
87
87
  onAddGTNToDocument: D,
88
- inputEmphasis: F = "default"
88
+ inputEmphasis: C = "default"
89
89
  }, U) => {
90
- const { t: X } = de(), Z = F === "modified", ee = F === "deleted", re = F === "success", C = W ?? Y, x = !!C, E = typeof C == "string" ? C : void 0, ae = v === b.TOP, te = v === b.LEFT, A = v === b.RIGHT, [I, P] = oe(!1), M = () => {
90
+ const { t: X } = de(), Z = C === "modified", ee = C === "deleted", re = C === "success", F = W ?? Y, b = !!F, E = typeof F == "string" ? F : void 0, te = v === x.TOP, ae = v === x.LEFT, A = v === x.RIGHT, [I, P] = oe(!1), M = () => {
91
91
  D && D({
92
92
  key: J,
93
- value: r ? "Yes" : "No"
93
+ value: a ? "Yes" : "No"
94
94
  });
95
95
  }, le = () => m === "error" ? "text-red-500 dark:text-red-400" : m === "success" ? "text-green-500 dark:text-green-400" : m === "info" ? "text-primary-500 dark:text-primary-400" : "text-neutral-500 dark:text-neutral-400";
96
96
  return /* @__PURE__ */ l(
97
97
  "div",
98
98
  {
99
- className: a(
99
+ className: r(
100
100
  "flex gap-0.5",
101
101
  I && t ? "border rounded-lg border-primary-100 bg-primary-50 p-1" : "",
102
102
  Q
@@ -108,22 +108,22 @@ const we = (t, r, o, u = "medium") => {
108
108
  },
109
109
  children: [
110
110
  t && !I ? /* @__PURE__ */ e("div", { className: "w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5" }) : null,
111
- /* @__PURE__ */ l("div", { className: a(
111
+ /* @__PURE__ */ l("div", { className: r(
112
112
  "w-full flex flex-col",
113
113
  Z && "rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] px-2 py-1.5",
114
114
  ee && "rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] px-2 py-1.5",
115
115
  re && "rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] px-2 py-1.5"
116
116
  ), children: [
117
- ae && n && /* @__PURE__ */ l("div", { className: "grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1", children: [
117
+ te && n && /* @__PURE__ */ l("div", { className: "grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1", children: [
118
118
  /* @__PURE__ */ l(
119
119
  "h1",
120
120
  {
121
- className: a(
121
+ className: r(
122
122
  "mb-1 min-w-0 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap",
123
123
  N
124
124
  ),
125
125
  children: [
126
- /* @__PURE__ */ e(xe, { label: n || "", required: g || !1, isRequiredConditional: z || !1 }),
126
+ /* @__PURE__ */ e(be, { label: n || "", required: g || !1, isRequiredConditional: z || !1 }),
127
127
  K && /* @__PURE__ */ e(me, { sx: { fontSize: 16, color: "var(--color-primary-600)", rotate: "15deg" } }),
128
128
  H && !O(y) && /* @__PURE__ */ e(pe, {}),
129
129
  /* @__PURE__ */ e(ge, { labels: j || [] }),
@@ -143,7 +143,7 @@ const we = (t, r, o, u = "medium") => {
143
143
  children: /* @__PURE__ */ l(
144
144
  "div",
145
145
  {
146
- className: a(
146
+ className: r(
147
147
  "inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",
148
148
  ye(c)
149
149
  ),
@@ -154,10 +154,10 @@ const we = (t, r, o, u = "medium") => {
154
154
  {
155
155
  size: 12,
156
156
  fill: ve(c),
157
- fillSecondary: be(c)
157
+ fillSecondary: xe(c)
158
158
  }
159
159
  ),
160
- /* @__PURE__ */ l("span", { className: a("text-xs font-medium leading-4", ke(c)), children: [
160
+ /* @__PURE__ */ l("span", { className: r("text-xs font-medium leading-4", ke(c)), children: [
161
161
  y,
162
162
  "%"
163
163
  ] })
@@ -189,12 +189,12 @@ const we = (t, r, o, u = "medium") => {
189
189
  }
190
190
  ),
191
191
  /* @__PURE__ */ l("div", { className: "flex", children: [
192
- te && /* @__PURE__ */ e(
192
+ ae && /* @__PURE__ */ e(
193
193
  p,
194
194
  {
195
195
  size: "small",
196
196
  variant: "medium",
197
- className: a("mr-2 text-neutral-700 dark:text-black-200", N),
197
+ className: r("mr-2 text-neutral-700 dark:text-black-200", N),
198
198
  appearance: "custom",
199
199
  children: n
200
200
  }
@@ -202,10 +202,10 @@ const we = (t, r, o, u = "medium") => {
202
202
  /* @__PURE__ */ l(
203
203
  "label",
204
204
  {
205
- className: a(
205
+ className: r(
206
206
  "relative inline-flex items-center",
207
207
  A || k ? "" : "w-min",
208
- x ? "cursor-not-allowed opacity-50" : "cursor-pointer"
208
+ b ? "cursor-not-allowed opacity-50" : "cursor-pointer"
209
209
  ),
210
210
  onClick: (s) => s.stopPropagation(),
211
211
  children: [
@@ -215,29 +215,35 @@ const we = (t, r, o, u = "medium") => {
215
215
  ref: U,
216
216
  type: "checkbox",
217
217
  id: o,
218
- onChange: (s) => !x && u(s.target.checked),
218
+ onChange: (s) => !b && u(s.target.checked),
219
219
  value: "",
220
- disabled: x,
221
- checked: r,
222
- className: a("sr-only peer w-full", V),
220
+ disabled: b,
221
+ checked: a,
222
+ className: r("sr-only peer w-full", V),
223
223
  "aria-required": g,
224
224
  "aria-invalid": d && m === "error" ? "true" : "false",
225
225
  "aria-describedby": d || f ? `${o}-description` : void 0
226
226
  }
227
227
  ),
228
- /* @__PURE__ */ e("div", { className: we(r, S, x, i), children: S ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-full w-full", children: /* @__PURE__ */ e(
229
- "div",
230
- {
231
- className: a(
232
- "z-10 transition-all transform",
233
- i === "small" && (r ? "translate-x-2" : "-translate-x-1.5"),
234
- i === "medium" && (r ? "translate-x-2" : "-translate-x-2"),
235
- i === "large" && (r ? "translate-x-2.5" : "-translate-x-2.5")
236
- ),
237
- children: r ? h?.checkedIcon ? h.checkedIcon : /* @__PURE__ */ e(Ne, { size: 18, fill: "#016DCF" }) : h?.uncheckedIcon ? h.uncheckedIcon : /* @__PURE__ */ e(Fe, { size: 18, fill: "#101828" })
238
- }
239
- ) }) : null }),
240
- E && /* @__PURE__ */ e(L, { placement: "top", title: E, className: "-ml-2", children: /* @__PURE__ */ e("span", { className: a(
228
+ /* @__PURE__ */ e("div", { className: we(a, S, b, i), children: S ? (
229
+ // Overlay the icon on the sliding knob using the knob's exact
230
+ // geometry (same top/left, same size, same full-width slide) so
231
+ // it stays perfectly centered in the circle for every size/state.
232
+ /* @__PURE__ */ e(
233
+ "div",
234
+ {
235
+ className: r(
236
+ "pointer-events-none absolute top-0.5 left-0.5 z-10 flex items-center justify-center transition-transform",
237
+ i === "small" && "h-3 w-3",
238
+ i === "medium" && "h-[1.125rem] w-[1.125rem]",
239
+ i === "large" && "h-5 w-5",
240
+ a && "translate-x-full"
241
+ ),
242
+ children: a ? h?.checkedIcon ? h.checkedIcon : /* @__PURE__ */ e(Ne, { size: 18, fill: "#016DCF" }) : h?.uncheckedIcon ? h.uncheckedIcon : /* @__PURE__ */ e(Ce, { size: 18, fill: "#101828" })
243
+ }
244
+ )
245
+ ) : null }),
246
+ E && /* @__PURE__ */ e(L, { placement: "top", title: E, className: "-ml-2", children: /* @__PURE__ */ e("span", { className: r(
241
247
  "absolute inset-y-0 left-0",
242
248
  i === "small" && "w-7",
243
249
  i === "medium" && "w-9",
@@ -248,7 +254,7 @@ const we = (t, r, o, u = "medium") => {
248
254
  {
249
255
  size: "small",
250
256
  variant: "medium",
251
- className: a("ml-2 text-neutral-700 dark:text-black-300", N),
257
+ className: r("ml-2 text-neutral-700 dark:text-black-300", N),
252
258
  appearance: "custom",
253
259
  children: n
254
260
  }
@@ -260,7 +266,7 @@ const we = (t, r, o, u = "medium") => {
260
266
  variant: "medium",
261
267
  className: "ml-2 text-neutral-900 dark:text-black-100",
262
268
  appearance: "custom",
263
- children: k || (r ? "Yes" : "No")
269
+ children: k || (a ? "Yes" : "No")
264
270
  }
265
271
  )
266
272
  ]
@@ -279,7 +285,7 @@ const we = (t, r, o, u = "medium") => {
279
285
  children: /* @__PURE__ */ e(
280
286
  p,
281
287
  {
282
- className: a("mt-1", le()),
288
+ className: r("mt-1", le()),
283
289
  appearance: "custom",
284
290
  size: "extra-small",
285
291
  variant: "medium",
@@ -295,8 +301,8 @@ const we = (t, r, o, u = "medium") => {
295
301
  );
296
302
  }
297
303
  );
298
- Ce.displayName = "Toggle";
304
+ Fe.displayName = "Toggle";
299
305
  export {
300
- Ce as Toggle
306
+ Fe as Toggle
301
307
  };
302
308
  //# sourceMappingURL=Toggle.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toggle.es.js","sources":["../../../../src/components/forms/toggle/Toggle.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, type ReactNode, useState } from \"react\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { TOGGLE_LABEL_DIRECTION } from \"../../../constants/toggle\";\nimport type { TToggleDirection } from \"../../../constants/toggle\";\nimport { BoltOutlined, NoteAddOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { Label, type LabelType } from \"../../data-display/label/Label\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\n\n// Re-export LabelType from Label component for external use\nexport type { LabelType };\n\n/** Visual emphasis for the toggle container (background + border) */\nexport type ToggleEmphasis = \"default\" | \"modified\" | \"deleted\" | \"success\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Props for the Toggle component\n */\nexport interface ToggleProps {\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** Unique identifier for the toggle */\n id?: string;\n /** Whether the toggle is checked */\n isChecked: boolean;\n /** Callback function called when toggle state changes */\n onChange: (val: boolean) => void;\n /** Label text or element to display */\n label?: ReactNode;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Whether to hide the status text (Yes/No) */\n hideStatus?: boolean;\n /** Label direction relative to toggle */\n labelDirection?: TToggleDirection;\n /** Custom status text instead of Yes/No */\n statusText?: string;\n /** Whether to show icons in the toggle */\n withIcon?: boolean;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Tooltip text to display */\n tooltip?: string;\n /** Additional CSS classes for the toggle input */\n className?: string;\n /** Whether the toggle is disabled. Pass a string to disable with a tooltip message. */\n disabled?: boolean | string;\n /**\n * @deprecated Use `disabled` instead.\n */\n isDisabled?: boolean | string;\n /** Custom icons for checked/unchecked states */\n icon?: {\n checkedIcon: ReactNode;\n uncheckedIcon: ReactNode;\n };\n /** Whether to stop click propagation */\n stopClickPropagation?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Visual variant for the toggle */\n variant?: 'primary' | 'secondary';\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Message to display below the toggle */\n message?: string;\n /** Type of message to display */\n messageType?: \"success\" | \"error\" | \"info\" | \"default\";\n /** Additional CSS classes for the wrapper container */\n wrapperClassName?: string;\n /** Help text to display below the label */\n helpText?: string;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Size variant for the toggle */\n size?: \"small\" | \"medium\" | \"large\";\n /** Custom render function for GTN add to document button */\n renderGTNAddButton?: (onClick: () => void) => ReactNode;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Container surface style: `'modified'` — Warning-50/Warning-200; `'deleted'` — Error-50/Error-200; `'success'` — Success-50/Success-200 */\n inputEmphasis?: ToggleEmphasis;\n}\n\n/**\n * Get toggle class names based on state and options\n */\nconst getToggleClassNames = (\n isChecked: boolean,\n withIcon: boolean,\n isDisabled: boolean,\n size: \"small\" | \"medium\" | \"large\" = \"medium\"\n): string => {\n const sizeClasses = {\n small: \"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5\",\n medium: \"w-10 h-[1.375rem] after:h-[1.125rem] after:w-[1.125rem] after:top-0.5 after:left-0.5\",\n large: \"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5\",\n };\n\n const translateClasses = {\n small: \"peer-checked:after:translate-x-3\",\n medium: \"peer-checked:after:translate-x-full\",\n large: \"peer-checked:after:translate-x-5\",\n };\n\n return cn(\n \"p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]\",\n sizeClasses[size],\n translateClasses[size],\n {\n 'peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500':\n isChecked,\n 'after:bg-white dark:after:bg-black-500': !isChecked,\n 'text-white dark:text-black-900': withIcon,\n 'cursor-not-allowed opacity-70': isDisabled,\n }\n );\n};\n\n/**\n * Default Check icon component\n */\nconst CheckIcon = ({ size = 18, fill = '#016DCF' }: { size?: number; fill?: string }) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z\"\n fill={fill}\n />\n </svg>\n);\n\n/**\n * Default Close icon component\n */\nconst CloseIcon = ({ size = 18, fill = '#101828' }: { size?: number; fill?: string }) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"\n fill={fill}\n />\n </svg>\n);\n\n/**\n * A highly customizable toggle component with label, validation, and styling support.\n * Features multiple sizes, variants, icon support, GTN integration, and comprehensive prop support.\n *\n * @example\n * ```tsx\n * <Toggle\n * id=\"notifications\"\n * label=\"Enable Notifications\"\n * isChecked={notificationsEnabled}\n * onChange={(checked) => setNotificationsEnabled(checked)}\n * required\n * />\n * ```\n */\nexport const Toggle = forwardRef<HTMLInputElement, ToggleProps>(\n (\n {\n isGTN = false,\n isChecked,\n id,\n onChange,\n label,\n required,\n isRequiredConditional = false,\n hideStatus = false,\n labelDirection = TOGGLE_LABEL_DIRECTION.TOP,\n statusText,\n withIcon = false,\n tags,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n tooltip = '',\n className = '',\n disabled,\n isDisabled = false,\n icon,\n stopClickPropagation = true,\n gtnName: _gtnName,\n variant: _variant = 'primary',\n labelClassName,\n isLiveField = false,\n message,\n messageType = \"default\",\n wrapperClassName,\n helpText,\n labelExtra,\n size = \"medium\",\n renderGTNAddButton,\n onAddGTNToDocument,\n inputEmphasis = \"default\",\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\";\n const emphasisDeletedSkin = inputEmphasis === \"deleted\";\n const emphasisSuccessSkin = inputEmphasis === \"success\";\n const resolvedDisabled = disabled ?? isDisabled;\n const isDisabledBool = !!resolvedDisabled;\n const disabledTooltip = typeof resolvedDisabled === 'string' ? resolvedDisabled : undefined;\n const isLabelDirectionTop = labelDirection === TOGGLE_LABEL_DIRECTION.TOP;\n const isLabelDirectionLeft = labelDirection === TOGGLE_LABEL_DIRECTION.LEFT;\n const isLabelDirectionRight = labelDirection === TOGGLE_LABEL_DIRECTION.RIGHT;\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: _gtnName,\n value: isChecked ? 'Yes' : 'No',\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const getMessageTypographyClass = (): string => {\n if (messageType === \"error\") return \"text-red-500 dark:text-red-400\";\n if (messageType === \"success\")\n return \"text-green-500 dark:text-green-400\";\n if (messageType === \"info\") return \"text-primary-500 dark:text-primary-400\";\n return \"text-neutral-500 dark:text-neutral-400\";\n };\n\n const _defaultRenderLabels = (labels?: (string | LabelType)[]) => {\n if (!labels || labels.length === 0) return null;\n return (\n <span className=\"inline-flex gap-1 ml-1\">\n {labels.map((tag, index) => {\n const label = typeof tag === 'string' ? tag : tag.label;\n const color = typeof tag === 'string' ? undefined : tag.color;\n return (\n <span\n key={index}\n className=\"px-1.5 py-0.5 text-xs rounded bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300\"\n style={color ? { backgroundColor: color } : undefined}\n >\n {label}\n </span>\n );\n })}\n </span>\n );\n };\n\n return (\n <div\n className={cn(\n 'flex gap-0.5',\n isHovered && isGTN ? 'border rounded-lg border-primary-100 bg-primary-50 p-1' : '',\n wrapperClassName\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n onClick={(e) => {\n if (stopClickPropagation) e.stopPropagation();\n }}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5\" />\n ) : null}\n <div className={cn(\n \"w-full flex flex-col\",\n emphasisModifiedSkin && \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] px-2 py-1.5\",\n emphasisDeletedSkin && \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] px-2 py-1.5\",\n emphasisSuccessSkin && \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] px-2 py-1.5\",\n )}>\n {isLabelDirectionTop && label && (\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <h1\n className={cn(\n 'mb-1 min-w-0 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap',\n labelClassName\n )}\n >\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && <BoltOutlined sx={{ fontSize: 16, color: 'var(--color-primary-600)', rotate: '15deg' }} />}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags || []} />\n {tooltip && (\n <Tooltip placement='top' title={tooltip}>\n <div className='cursor-pointer'>\n <HelpIcon />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </h1>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement='top-end'\n title={confidenceTooltip ?? ''}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className='cursor-pointer'\n >\n <div\n className={cn(\n 'inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5',\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn('text-xs font-medium leading-4', getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered ? (\n renderGTNAddButton ? (\n renderGTNAddButton(handleAddGTNToDocument)\n ) : (\n <button\n id=\"btn-toggle-add-to-document\"\n className=\"cursor-pointer\"\n onClick={handleAddGTNToDocument}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined className=\"text-primary-600\" sx={{ fontSize: 16 }} />\n </AntTooltip>\n </button>\n )\n ) : null}\n </div>\n </div>\n )}\n\n {/* Help text */}\n {helpText && (\n <Typography\n className=\"mb-2 text-neutral-600 dark:text-neutral-400\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"regular\"\n >\n {helpText}\n </Typography>\n )}\n\n <div className=\"flex\">\n {isLabelDirectionLeft && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={cn('mr-2 text-neutral-700 dark:text-black-200', labelClassName)}\n appearance=\"custom\"\n >\n {label}\n </Typography>\n )}\n\n <label\n className={cn(\n 'relative inline-flex items-center',\n isLabelDirectionRight || statusText ? '' : 'w-min',\n !isDisabledBool ? 'cursor-pointer' : 'cursor-not-allowed opacity-50'\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <input\n ref={ref}\n type=\"checkbox\"\n id={id}\n onChange={(e) => !isDisabledBool && onChange(e.target.checked)}\n value=\"\"\n disabled={isDisabledBool}\n checked={isChecked}\n className={cn('sr-only peer w-full', className)}\n aria-required={required}\n aria-invalid={\n message && messageType === \"error\" ? \"true\" : \"false\"\n }\n aria-describedby={\n message || helpText ? `${id}-description` : undefined\n }\n />\n <div className={getToggleClassNames(isChecked, withIcon, isDisabledBool, size)}>\n {withIcon ? (\n <div className=\"flex items-center justify-center h-full w-full\">\n <div\n className={cn(\n \"z-10 transition-all transform\",\n size === \"small\" &&\n (isChecked\n ? \"translate-x-2\"\n : \"-translate-x-1.5\"),\n size === \"medium\" &&\n (isChecked\n ? \"translate-x-2\"\n : \"-translate-x-2\"),\n size === \"large\" &&\n (isChecked\n ? \"translate-x-2.5\"\n : \"-translate-x-2.5\")\n )}\n >\n {isChecked ? (\n icon?.checkedIcon ? (\n icon.checkedIcon\n ) : (\n <CheckIcon size={18} fill=\"#016DCF\" />\n )\n ) : icon?.uncheckedIcon ? (\n icon.uncheckedIcon\n ) : (\n <CloseIcon size={18} fill=\"#101828\" />\n )}\n </div>\n </div>\n ) : null}\n </div>\n {disabledTooltip && (\n <Tooltip placement=\"top\" title={disabledTooltip} className=\"-ml-2\">\n <span className={cn(\n 'absolute inset-y-0 left-0',\n size === 'small' && 'w-7',\n size === 'medium' && 'w-9',\n size === 'large' && 'w-11',\n )} />\n </Tooltip>\n )}\n\n {isLabelDirectionRight && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={cn('ml-2 text-neutral-700 dark:text-black-300', labelClassName)}\n appearance=\"custom\"\n >\n {label}\n </Typography>\n )}\n\n {hideStatus ? null : (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"ml-2 text-neutral-900 dark:text-black-100\"\n appearance=\"custom\"\n >\n {statusText ? statusText : isChecked ? 'Yes' : 'No'}\n </Typography>\n )}\n </label>\n </div>\n\n {/* Message */}\n <AnimatePresence>\n {message && (\n <motion.div\n initial={{ opacity: 0, y: -10 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -10 }}\n transition={{ duration: 0.2 }}\n id={`${id}-description`}\n role={messageType === \"error\" ? \"alert\" : undefined}\n >\n <Typography\n className={cn(\"mt-1\", getMessageTypographyClass())}\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {message}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n\n {/* Help text description for accessibility */}\n {helpText && !message && (\n <div id={`${id}-description`} className=\"sr-only\">\n {helpText}\n </div>\n )}\n </div>\n </div>\n );\n }\n);\n\nToggle.displayName = \"Toggle\";\n"],"names":["getToggleClassNames","isChecked","withIcon","isDisabled","size","sizeClasses","translateClasses","cn","CheckIcon","fill","jsx","CloseIcon","Toggle","forwardRef","isGTN","id","onChange","label","required","isRequiredConditional","hideStatus","labelDirection","TOGGLE_LABEL_DIRECTION","statusText","tags","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","tooltip","className","disabled","icon","stopClickPropagation","_gtnName","_variant","labelClassName","isLiveField","message","messageType","wrapperClassName","helpText","labelExtra","renderGTNAddButton","onAddGTNToDocument","inputEmphasis","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","resolvedDisabled","isDisabledBool","disabledTooltip","isLabelDirectionTop","isLabelDirectionLeft","isLabelDirectionRight","isHovered","setIsHovered","useState","handleAddGTNToDocument","getMessageTypographyClass","jsxs","e","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","Typography","AnimatePresence","motion"],"mappings":";;;;;;;;;;;;;;;;AA+IA,MAAMA,KAAsB,CAC1BC,GACAC,GACAC,GACAC,IAAqC,aAC1B;AACX,QAAMC,IAAc;AAAA,IAClB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA,GAGHC,IAAmB;AAAA,IACvB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA;AAGT,SAAOC;AAAA,IACL;AAAA,IACAF,EAAYD,CAAI;AAAA,IAChBE,EAAiBF,CAAI;AAAA,IACrB;AAAA,MACE,6IACEH;AAAA,MACF,0CAA0C,CAACA;AAAA,MAC3C,kCAAkCC;AAAA,MAClC,iCAAiCC;AAAA,IAAA;AAAA,EACnC;AAEJ,GAKMK,KAAY,CAAC,EAAE,MAAAJ,IAAO,IAAI,MAAAK,IAAO,UAAA,MACrC,gBAAAC,EAAC,OAAA,EAAI,OAAON,GAAM,QAAQA,GAAM,SAAQ,aAAY,MAAK,QACvD,UAAA,gBAAAM;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,GAAE;AAAA,IACF,MAAAD;AAAA,EAAA;AACF,GACF,GAMIE,KAAY,CAAC,EAAE,MAAAP,IAAO,IAAI,MAAAK,IAAO,UAAA,MACrC,gBAAAC,EAAC,OAAA,EAAI,OAAON,GAAM,QAAQA,GAAM,SAAQ,aAAY,MAAK,QACvD,UAAA,gBAAAM;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,GAAE;AAA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AAA,oBAIJG,IAAa,OACZ,gBAAAV;AAAA,sBAACuE;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,SAAQ;AAAA,wBACR,WAAU;AAAA,wBACV,YAAW;AAAA,wBAEV,UAAA1D,MAA0BtB,IAAY,QAAQ;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACjD;AAAA,gBAAA;AAAA,cAAA;AAAA,YAEJ,GACF;AAAA,YAGA,gBAAAS,EAACwE,MACE,UAAA1C,KACC,gBAAA9B;AAAA,cAACyE,GAAO;AAAA,cAAP;AAAA,gBACC,SAAS,EAAE,SAAS,GAAG,GAAG,IAAA;AAAA,gBAC1B,SAAS,EAAE,SAAS,GAAG,GAAG,EAAA;AAAA,gBAC1B,MAAM,EAAE,SAAS,GAAG,GAAG,IAAA;AAAA,gBACvB,YAAY,EAAE,UAAU,IAAA;AAAA,gBACxB,IAAI,GAAGpE,CAAE;AAAA,gBACT,MAAM0B,MAAgB,UAAU,UAAU;AAAA,gBAE1C,UAAA,gBAAA/B;AAAA,kBAACuE;AAAA,kBAAA;AAAA,oBACC,WAAW1E,EAAG,QAAQyD,IAA2B;AAAA,oBACjD,YAAW;AAAA,oBACX,MAAK;AAAA,oBACL,SAAQ;AAAA,oBAEP,UAAAxB;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA,GAGN;AAAA,YAGCG,KAAY,CAACH,KACZ,gBAAA9B,EAAC,OAAA,EAAI,IAAI,GAAGK,CAAE,gBAAgB,WAAU,WACrC,UAAA4B,EAAA,CACH;AAAA,UAAA,EAAA,CAEJ;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA/B,GAAO,cAAc;"}
1
+ {"version":3,"file":"Toggle.es.js","sources":["../../../../src/components/forms/toggle/Toggle.tsx"],"sourcesContent":["import cn from \"classnames\";\nimport { forwardRef, type ReactNode, useState } from \"react\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { TOGGLE_LABEL_DIRECTION } from \"../../../constants/toggle\";\nimport type { TToggleDirection } from \"../../../constants/toggle\";\nimport { BoltOutlined, NoteAddOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { Label, type LabelType } from \"../../data-display/label/Label\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\n\n// Re-export LabelType from Label component for external use\nexport type { LabelType };\n\n/** Visual emphasis for the toggle container (background + border) */\nexport type ToggleEmphasis = \"default\" | \"modified\" | \"deleted\" | \"success\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Props for the Toggle component\n */\nexport interface ToggleProps {\n /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** Unique identifier for the toggle */\n id?: string;\n /** Whether the toggle is checked */\n isChecked: boolean;\n /** Callback function called when toggle state changes */\n onChange: (val: boolean) => void;\n /** Label text or element to display */\n label?: ReactNode;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Whether to hide the status text (Yes/No) */\n hideStatus?: boolean;\n /** Label direction relative to toggle */\n labelDirection?: TToggleDirection;\n /** Custom status text instead of Yes/No */\n statusText?: string;\n /** Whether to show icons in the toggle */\n withIcon?: boolean;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Tooltip text to display */\n tooltip?: string;\n /** Additional CSS classes for the toggle input */\n className?: string;\n /** Whether the toggle is disabled. Pass a string to disable with a tooltip message. */\n disabled?: boolean | string;\n /**\n * @deprecated Use `disabled` instead.\n */\n isDisabled?: boolean | string;\n /** Custom icons for checked/unchecked states */\n icon?: {\n checkedIcon: ReactNode;\n uncheckedIcon: ReactNode;\n };\n /** Whether to stop click propagation */\n stopClickPropagation?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Visual variant for the toggle */\n variant?: 'primary' | 'secondary';\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Message to display below the toggle */\n message?: string;\n /** Type of message to display */\n messageType?: \"success\" | \"error\" | \"info\" | \"default\";\n /** Additional CSS classes for the wrapper container */\n wrapperClassName?: string;\n /** Help text to display below the label */\n helpText?: string;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Size variant for the toggle */\n size?: \"small\" | \"medium\" | \"large\";\n /** Custom render function for GTN add to document button */\n renderGTNAddButton?: (onClick: () => void) => ReactNode;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Container surface style: `'modified'` — Warning-50/Warning-200; `'deleted'` — Error-50/Error-200; `'success'` — Success-50/Success-200 */\n inputEmphasis?: ToggleEmphasis;\n}\n\n/**\n * Get toggle class names based on state and options\n */\nconst getToggleClassNames = (\n isChecked: boolean,\n withIcon: boolean,\n isDisabled: boolean,\n size: \"small\" | \"medium\" | \"large\" = \"medium\"\n): string => {\n const sizeClasses = {\n small: \"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5\",\n medium: \"w-10 h-[1.375rem] after:h-[1.125rem] after:w-[1.125rem] after:top-0.5 after:left-0.5\",\n large: \"w-11 h-6 after:h-5 after:w-5 after:top-0.5 after:left-0.5\",\n };\n\n const translateClasses = {\n small: \"peer-checked:after:translate-x-3\",\n medium: \"peer-checked:after:translate-x-full\",\n large: \"peer-checked:after:translate-x-5\",\n };\n\n return cn(\n \"p-0.5 rounded-full peer after:content-[''] after:absolute after:rounded-full after:transition-all bg-gray-200 dark:bg-black-400 peer-focus-visible:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-primary-400 dark:peer-focus-visible:ring-offset-black-900 peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-100)] dark:peer-focus-visible:shadow-[0_0_0_3px_var(--color-primary-950)]\",\n sizeClasses[size],\n translateClasses[size],\n {\n 'peer-checked:bg-primary-600 dark:peer-checked:bg-primary-700 peer-checked:after:translate-x-full after:bg-white dark:after:bg-primary-500':\n isChecked,\n 'after:bg-white dark:after:bg-black-500': !isChecked,\n 'text-white dark:text-black-900': withIcon,\n 'cursor-not-allowed opacity-70': isDisabled,\n }\n );\n};\n\n/**\n * Default Check icon component\n */\nconst CheckIcon = ({ size = 18, fill = '#016DCF' }: { size?: number; fill?: string }) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z\"\n fill={fill}\n />\n </svg>\n);\n\n/**\n * Default Close icon component\n */\nconst CloseIcon = ({ size = 18, fill = '#101828' }: { size?: number; fill?: string }) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"\n fill={fill}\n />\n </svg>\n);\n\n/**\n * A highly customizable toggle component with label, validation, and styling support.\n * Features multiple sizes, variants, icon support, GTN integration, and comprehensive prop support.\n *\n * @example\n * ```tsx\n * <Toggle\n * id=\"notifications\"\n * label=\"Enable Notifications\"\n * isChecked={notificationsEnabled}\n * onChange={(checked) => setNotificationsEnabled(checked)}\n * required\n * />\n * ```\n */\nexport const Toggle = forwardRef<HTMLInputElement, ToggleProps>(\n (\n {\n isGTN = false,\n isChecked,\n id,\n onChange,\n label,\n required,\n isRequiredConditional = false,\n hideStatus = false,\n labelDirection = TOGGLE_LABEL_DIRECTION.TOP,\n statusText,\n withIcon = false,\n tags,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n tooltip = '',\n className = '',\n disabled,\n isDisabled = false,\n icon,\n stopClickPropagation = true,\n gtnName: _gtnName,\n variant: _variant = 'primary',\n labelClassName,\n isLiveField = false,\n message,\n messageType = \"default\",\n wrapperClassName,\n helpText,\n labelExtra,\n size = \"medium\",\n renderGTNAddButton,\n onAddGTNToDocument,\n inputEmphasis = \"default\",\n },\n ref\n ) => {\n const { t } = useTranslation();\n const emphasisModifiedSkin = inputEmphasis === \"modified\";\n const emphasisDeletedSkin = inputEmphasis === \"deleted\";\n const emphasisSuccessSkin = inputEmphasis === \"success\";\n const resolvedDisabled = disabled ?? isDisabled;\n const isDisabledBool = !!resolvedDisabled;\n const disabledTooltip = typeof resolvedDisabled === 'string' ? resolvedDisabled : undefined;\n const isLabelDirectionTop = labelDirection === TOGGLE_LABEL_DIRECTION.TOP;\n const isLabelDirectionLeft = labelDirection === TOGGLE_LABEL_DIRECTION.LEFT;\n const isLabelDirectionRight = labelDirection === TOGGLE_LABEL_DIRECTION.RIGHT;\n const [isHovered, setIsHovered] = useState(false);\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: _gtnName,\n value: isChecked ? 'Yes' : 'No',\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const getMessageTypographyClass = (): string => {\n if (messageType === \"error\") return \"text-red-500 dark:text-red-400\";\n if (messageType === \"success\")\n return \"text-green-500 dark:text-green-400\";\n if (messageType === \"info\") return \"text-primary-500 dark:text-primary-400\";\n return \"text-neutral-500 dark:text-neutral-400\";\n };\n\n const _defaultRenderLabels = (labels?: (string | LabelType)[]) => {\n if (!labels || labels.length === 0) return null;\n return (\n <span className=\"inline-flex gap-1 ml-1\">\n {labels.map((tag, index) => {\n const label = typeof tag === 'string' ? tag : tag.label;\n const color = typeof tag === 'string' ? undefined : tag.color;\n return (\n <span\n key={index}\n className=\"px-1.5 py-0.5 text-xs rounded bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300\"\n style={color ? { backgroundColor: color } : undefined}\n >\n {label}\n </span>\n );\n })}\n </span>\n );\n };\n\n return (\n <div\n className={cn(\n 'flex gap-0.5',\n isHovered && isGTN ? 'border rounded-lg border-primary-100 bg-primary-50 p-1' : '',\n wrapperClassName\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n onClick={(e) => {\n if (stopClickPropagation) e.stopPropagation();\n }}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-pulse mt-1.5\" />\n ) : null}\n <div className={cn(\n \"w-full flex flex-col\",\n emphasisModifiedSkin && \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] px-2 py-1.5\",\n emphasisDeletedSkin && \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] px-2 py-1.5\",\n emphasisSuccessSkin && \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] px-2 py-1.5\",\n )}>\n {isLabelDirectionTop && label && (\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <h1\n className={cn(\n 'mb-1 min-w-0 font-inter text-neutral-600 font-medium text-xs flex items-center gap-0.5 flex-wrap',\n labelClassName\n )}\n >\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && <BoltOutlined sx={{ fontSize: 16, color: 'var(--color-primary-600)', rotate: '15deg' }} />}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags || []} />\n {tooltip && (\n <Tooltip placement='top' title={tooltip}>\n <div className='cursor-pointer'>\n <HelpIcon />\n </div>\n </Tooltip>\n )}\n {labelExtra}\n </h1>\n <div className=\"flex items-center gap-1 justify-self-end\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement='top-end'\n title={confidenceTooltip ?? ''}\n hideTooltip={confidenceTooltip === undefined || confidenceTooltip === null}\n className='cursor-pointer'\n >\n <div\n className={cn(\n 'inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5',\n getConfidenceScoreBadgeClass(confidenceType)\n )}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n <span className={cn('text-xs font-medium leading-4', getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHovered ? (\n renderGTNAddButton ? (\n renderGTNAddButton(handleAddGTNToDocument)\n ) : (\n <button\n id=\"btn-toggle-add-to-document\"\n className=\"cursor-pointer\"\n onClick={handleAddGTNToDocument}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined className=\"text-primary-600\" sx={{ fontSize: 16 }} />\n </AntTooltip>\n </button>\n )\n ) : null}\n </div>\n </div>\n )}\n\n {/* Help text */}\n {helpText && (\n <Typography\n className=\"mb-2 text-neutral-600 dark:text-neutral-400\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"regular\"\n >\n {helpText}\n </Typography>\n )}\n\n <div className=\"flex\">\n {isLabelDirectionLeft && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={cn('mr-2 text-neutral-700 dark:text-black-200', labelClassName)}\n appearance=\"custom\"\n >\n {label}\n </Typography>\n )}\n\n <label\n className={cn(\n 'relative inline-flex items-center',\n isLabelDirectionRight || statusText ? '' : 'w-min',\n !isDisabledBool ? 'cursor-pointer' : 'cursor-not-allowed opacity-50'\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <input\n ref={ref}\n type=\"checkbox\"\n id={id}\n onChange={(e) => !isDisabledBool && onChange(e.target.checked)}\n value=\"\"\n disabled={isDisabledBool}\n checked={isChecked}\n className={cn('sr-only peer w-full', className)}\n aria-required={required}\n aria-invalid={\n message && messageType === \"error\" ? \"true\" : \"false\"\n }\n aria-describedby={\n message || helpText ? `${id}-description` : undefined\n }\n />\n <div className={getToggleClassNames(isChecked, withIcon, isDisabledBool, size)}>\n {withIcon ? (\n // Overlay the icon on the sliding knob using the knob's exact\n // geometry (same top/left, same size, same full-width slide) so\n // it stays perfectly centered in the circle for every size/state.\n <div\n className={cn(\n \"pointer-events-none absolute top-0.5 left-0.5 z-10 flex items-center justify-center transition-transform\",\n size === \"small\" && \"h-3 w-3\",\n size === \"medium\" && \"h-[1.125rem] w-[1.125rem]\",\n size === \"large\" && \"h-5 w-5\",\n isChecked && \"translate-x-full\"\n )}\n >\n {isChecked ? (\n icon?.checkedIcon ? (\n icon.checkedIcon\n ) : (\n <CheckIcon size={18} fill=\"#016DCF\" />\n )\n ) : icon?.uncheckedIcon ? (\n icon.uncheckedIcon\n ) : (\n <CloseIcon size={18} fill=\"#101828\" />\n )}\n </div>\n ) : null}\n </div>\n {disabledTooltip && (\n <Tooltip placement=\"top\" title={disabledTooltip} className=\"-ml-2\">\n <span className={cn(\n 'absolute inset-y-0 left-0',\n size === 'small' && 'w-7',\n size === 'medium' && 'w-9',\n size === 'large' && 'w-11',\n )} />\n </Tooltip>\n )}\n\n {isLabelDirectionRight && (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className={cn('ml-2 text-neutral-700 dark:text-black-300', labelClassName)}\n appearance=\"custom\"\n >\n {label}\n </Typography>\n )}\n\n {hideStatus ? null : (\n <Typography\n size=\"small\"\n variant=\"medium\"\n className=\"ml-2 text-neutral-900 dark:text-black-100\"\n appearance=\"custom\"\n >\n {statusText ? statusText : isChecked ? 'Yes' : 'No'}\n </Typography>\n )}\n </label>\n </div>\n\n {/* Message */}\n <AnimatePresence>\n {message && (\n <motion.div\n initial={{ opacity: 0, y: -10 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -10 }}\n transition={{ duration: 0.2 }}\n id={`${id}-description`}\n role={messageType === \"error\" ? \"alert\" : undefined}\n >\n <Typography\n className={cn(\"mt-1\", getMessageTypographyClass())}\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {message}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n\n {/* Help text description for accessibility */}\n {helpText && !message && (\n <div id={`${id}-description`} className=\"sr-only\">\n {helpText}\n </div>\n )}\n </div>\n </div>\n );\n }\n);\n\nToggle.displayName = \"Toggle\";\n"],"names":["getToggleClassNames","isChecked","withIcon","isDisabled","size","sizeClasses","translateClasses","cn","CheckIcon","fill","jsx","CloseIcon","Toggle","forwardRef","isGTN","id","onChange","label","required","isRequiredConditional","hideStatus","labelDirection","TOGGLE_LABEL_DIRECTION","statusText","tags","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","tooltip","className","disabled","icon","stopClickPropagation","_gtnName","_variant","labelClassName","isLiveField","message","messageType","wrapperClassName","helpText","labelExtra","renderGTNAddButton","onAddGTNToDocument","inputEmphasis","ref","t","useTranslation","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","resolvedDisabled","isDisabledBool","disabledTooltip","isLabelDirectionTop","isLabelDirectionLeft","isLabelDirectionRight","isHovered","setIsHovered","useState","handleAddGTNToDocument","getMessageTypographyClass","jsxs","e","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","AntTooltip","NoteAddOutlined","Typography","AnimatePresence","motion"],"mappings":";;;;;;;;;;;;;;;;AA+IA,MAAMA,KAAsB,CAC1BC,GACAC,GACAC,GACAC,IAAqC,aAC1B;AACX,QAAMC,IAAc;AAAA,IAClB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA,GAGHC,IAAmB;AAAA,IACvB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EAAA;AAGT,SAAOC;AAAA,IACL;AAAA,IACAF,EAAYD,CAAI;AAAA,IAChBE,EAAiBF,CAAI;AAAA,IACrB;AAAA,MACE,6IACEH;AAAA,MACF,0CAA0C,CAACA;AAAA,MAC3C,kCAAkCC;AAAA,MAClC,iCAAiCC;AAAA,IAAA;AAAA,EACnC;AAEJ,GAKMK,KAAY,CAAC,EAAE,MAAAJ,IAAO,IAAI,MAAAK,IAAO,UAAA,MACrC,gBAAAC,EAAC,OAAA,EAAI,OAAON,GAAM,QAAQA,GAAM,SAAQ,aAAY,MAAK,QACvD,UAAA,gBAAAM;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,GAAE;AAAA,IAC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GN;AACF;AAEA/B,GAAO,cAAc;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lax-wp/design-system",
3
3
  "private": false,
4
- "version": "0.13.33-beta.4",
4
+ "version": "0.13.33-beta.5",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",