@lax-wp/design-system 0.16.3 → 0.16.4

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.
Files changed (29) hide show
  1. package/dist/components/data-display/infinite-table/CellContextMenuPortal.cjs.js +1 -1
  2. package/dist/components/data-display/infinite-table/CellContextMenuPortal.cjs.js.map +1 -1
  3. package/dist/components/data-display/infinite-table/CellContextMenuPortal.es.js +1 -1
  4. package/dist/components/data-display/infinite-table/CellContextMenuPortal.es.js.map +1 -1
  5. package/dist/components/data-display/infinite-table/head/cell/index.cjs.js +1 -1
  6. package/dist/components/data-display/infinite-table/head/cell/index.cjs.js.map +1 -1
  7. package/dist/components/data-display/infinite-table/head/cell/index.es.js +1 -1
  8. package/dist/components/data-display/infinite-table/head/cell/index.es.js.map +1 -1
  9. package/dist/components/data-display/label/Label.cjs.js +1 -1
  10. package/dist/components/data-display/label/Label.cjs.js.map +1 -1
  11. package/dist/components/data-display/label/Label.es.js +2 -2
  12. package/dist/components/data-display/label/Label.es.js.map +1 -1
  13. package/dist/components/forms/base-input-field/BaseInputField.cjs.js +2 -2
  14. package/dist/components/forms/base-input-field/BaseInputField.cjs.js.map +1 -1
  15. package/dist/components/forms/base-input-field/BaseInputField.es.js +19 -19
  16. package/dist/components/forms/base-input-field/BaseInputField.es.js.map +1 -1
  17. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js +1 -1
  18. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js.map +1 -1
  19. package/dist/components/forms/currency-input/CurrencyInputField.es.js +13 -13
  20. package/dist/components/forms/currency-input/CurrencyInputField.es.js.map +1 -1
  21. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js +1 -1
  22. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js.map +1 -1
  23. package/dist/components/forms/percentage-input/PercentageInputField.es.js +46 -46
  24. package/dist/components/forms/percentage-input/PercentageInputField.es.js.map +1 -1
  25. package/dist/components/forms/text-area-field/TextAreaField.cjs.js +1 -1
  26. package/dist/components/forms/text-area-field/TextAreaField.cjs.js.map +1 -1
  27. package/dist/components/forms/text-area-field/TextAreaField.es.js +38 -39
  28. package/dist/components/forms/text-area-field/TextAreaField.es.js.map +1 -1
  29. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TextAreaField.cjs.js","sources":["../../../../src/components/forms/text-area-field/TextAreaField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useState } from \"react\";\nimport type { RefObject } from \"react\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\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 * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the TextAreaField component\n */\nexport interface TextAreaFieldProps\n extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"onChange\" | \"maxLength\"> {\n /** The label text to display above the textarea */\n label?: string;\n /** Placeholder text for the textarea */\n placeholder: string;\n /** Current value of the textarea */\n value?: string | any;\n /** Callback function called when the textarea value changes */\n onChange: (value: string) => void;\n /** Number of visible text lines for the textarea (alias for rows) */\n row?: number;\n /** Error message to display below the textarea */\n errorMessage?: string;\n /** Default value for the textarea */\n defaultValue?: string;\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 the textarea is disabled */\n disabled?: boolean;\n /** Additional CSS classes for the textarea element */\n className?: string;\n /** Ref object for the textarea element */\n inputRef?: RefObject<HTMLTextAreaElement>;\n /** Maximum character length allowed */\n maxLength?: number | null;\n /** Tooltip text to display */\n tooltip?: string;\n /** Whether to preserve original case in the label */\n originalCase?: 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?: React.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 /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to remove border styling */\n noBorder?: boolean;\n /** Unique identifier for the textarea */\n id?: string;\n /** Custom inline styles for the textarea */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when the textarea loses focus */\n onBlur?: () => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A customizable textarea field component with label, validation, GTN integration,\n * risk analysis support, and styling support. Features dark mode support,\n * accessibility enhancements, and character count display.\n *\n * @example\n * ```tsx\n * <TextAreaField\n * label=\"Description\"\n * placeholder=\"Enter a description...\"\n * value={description}\n * onChange={(value) => setDescription(value)}\n * required\n * />\n *\n * <TextAreaField\n * label=\"Comments\"\n * placeholder=\"Enter comments...\"\n * value={comments}\n * onChange={(value) => setComments(value)}\n * maxLength={500}\n * isGTN\n * gtnName=\"comments_field\"\n * onAddGTNToDocument={(kv) => handleAddToDocument(kv)}\n * />\n * ```\n */\nexport const TextAreaField = forwardRef<HTMLDivElement, TextAreaFieldProps>(\n (\n {\n label,\n placeholder,\n value,\n onChange,\n row = 4,\n errorMessage,\n defaultValue,\n required,\n isRequiredConditional = false,\n tags = [],\n disabled,\n className,\n inputRef,\n maxLength = undefined,\n tooltip = \"\",\n originalCase = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = \"\",\n noBorder = false,\n id,\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n onAddGTNToDocument,\n labelExtra,\n inputEmphasis = \"default\",\n ...textareaProps\n },\n ref\n ) => {\n const { t } = useTranslation();\n const [isHovered, setIsHovered] = useState(false);\n const showRiskSkin = Boolean(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !showRiskSkin;\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !showRiskSkin;\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !showRiskSkin;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n const form = (e.target as HTMLTextAreaElement).closest(\"form\");\n if (form) {\n const submitButton = form.querySelector<HTMLButtonElement>('button[type=\"submit\"]');\n if (submitButton) {\n submitButton.click();\n } else {\n form.requestSubmit();\n }\n }\n }\n textareaProps.onKeyDown?.(e);\n };\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: value || \"\",\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n return (\n <div\n ref={ref}\n id={id}\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\")}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags || []} />\n {tooltip && (\n <AntTooltip placement=\"top\" title={tooltip}>\n <div\n className=\"cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n }\n }}\n >\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </AntTooltip>\n )}\n {labelExtra}\n </div>\n\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 <button\n id=\"btn-textarea-field-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\n className=\"text-primary-600\"\n sx={{ fontSize: 16 }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <textarea\n {...textareaProps}\n onKeyDown={handleKeyDown}\n onBlur={onBlur}\n onChange={(e) => onChange(e.target.value)}\n defaultValue={defaultValue}\n value={value}\n required={required}\n className={cn(\n \"border rounded-lg focus:outline-none focus:ring-0 block w-full py-2.5 px-3 font-inter font-medium text-sm disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400\",\n {\n \"border-red-300\": errorMessage,\n \"border-gray-300 dark:border-black-700\": !errorMessage && !emphasisModifiedSkin && !emphasisDeletedSkin && !emphasisSuccessSkin && !showRiskSkin,\n \"text-neutral-400 dark:text-neutral-500\": disabled && !emphasisDeletedSkin && !emphasisSuccessSkin,\n \"text-neutral-900 dark:text-neutral-50\": !disabled && !emphasisDeletedSkin && !emphasisSuccessSkin,\n \"border-none\": noBorder,\n \"focus:border-none\": noBorder,\n \"placeholder:text-neutral-400 dark:placeholder:text-black-300\": true,\n \"focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)] bg-white dark:bg-black-600\": !emphasisModifiedSkin && !emphasisDeletedSkin && !emphasisSuccessSkin && !showRiskSkin && !errorMessage,\n },\n emphasisDeletedSkin && \"border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\",\n emphasisModifiedSkin && \"border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\",\n emphasisSuccessSkin && \"border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\",\n className,\n showRiskSkin && `!bg-${riskDetails!.color}-50 border-${riskDetails!.color}-300`\n )}\n style={\n showRiskSkin && riskDetails\n ? {\n backgroundColor: riskDetails.hexBgColor || undefined,\n borderColor: riskDetails.hexBorderColor || undefined,\n ...inputStyle,\n }\n : inputStyle\n }\n rows={row}\n placeholder={placeholder}\n disabled={disabled}\n maxLength={maxLength || undefined}\n id={id}\n ref={inputRef}\n onClick={(e) => e.stopPropagation()}\n autoComplete=\"off\"\n />\n {maxLength ? (\n <Typography\n className=\"mt-0.5 text-right text-neutral-900 dark:text-white\"\n appearance=\"custom\"\n size=\"extra-small\"\n >\n <span\n className={`${\n value?.length >= maxLength\n ? \"text-error-500\"\n : value?.length > maxLength - Math.min(50, maxLength / 5)\n ? \"text-warning-500 dark:text-warning-300\"\n : \"\"\n }`}\n >\n {value?.length || 0}{\" \"}\n </span>\n / {maxLength}\n </Typography>\n ) : null}\n\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n\n {isHovered && isRiskAnalysisOpen && riskDetails && RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nTextAreaField.displayName = \"TextAreaField\";\n\n"],"names":["TextAreaField","forwardRef","label","placeholder","value","onChange","row","errorMessage","defaultValue","required","isRequiredConditional","tags","disabled","className","inputRef","maxLength","tooltip","originalCase","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","noBorder","id","inputStyle","labelClassName","isLiveField","onBlur","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","onAddGTNToDocument","labelExtra","inputEmphasis","textareaProps","ref","t","useTranslation","isHovered","setIsHovered","useState","showRiskSkin","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","handleKeyDown","e","form","submitButton","handleAddGTNToDocument","jsxs","cn","jsx","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","AntTooltip","HelpIcon","Tooltip","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","NoteAddOutlined","Typography"],"mappings":"6oBA6KaA,EAAgBC,EAAAA,WAC3B,CACE,CACE,MAAAC,EACA,YAAAC,EACA,MAAAC,EACA,SAAAC,EACA,IAAAC,EAAM,EACN,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,sBAAAC,EAAwB,GACxB,KAAAC,EAAO,CAAA,EACP,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,UAAAC,EAAY,OACZ,QAAAC,EAAU,GACV,aAAAC,EAAe,GACf,cAAAC,EAAgB,GAChB,gBAAAC,EACA,eAAAC,EAAiB,OACjB,kBAAAC,EACA,WAAAC,EAAa,CAAA,EACb,uBAAAC,EACA,MAAAC,EAAQ,GACR,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,GAAAC,EACA,WAAAC,EACA,eAAAC,EACA,YAAAC,EAAc,GACd,OAAAC,EACA,YAAAC,EACA,mBAAAC,EAAqB,GACrB,gBAAAC,EACA,mBAAAC,EACA,WAA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AEdnC,EACCuC,EAAAA,KAACiB,EAAAA,WAAA,CACC,UAAU,qDACV,WAAW,SACX,KAAK,cAEL,SAAA,CAAAjB,EAAAA,KAAC,OAAA,CACC,UAAW,GACTlD,GAAO,QAAUW,EACb,iBACAX,GAAO,OAASW,EAAY,KAAK,IAAI,GAAIA,EAAY,CAAC,EACtD,yCACA,EACN,GAEC,SAAA,CAAAX,GAAO,QAAU,EAAG,GAAA,CAAA,CAAA,EAChB,KACJW,CAAA,CAAA,CAAA,EAEH,KAEHR,GACCiD,EAAAA,IAACe,EAAAA,WAAA,CACC,UAAU,sBACV,WAAW,SACX,KAAK,cACL,QAAQ,SAEP,SAAAhE,CAAA,CAAA,CACH,EAEJ,EAECmC,GAAaT,GAAsBD,GAAeE,GACjDsB,EAAAA,IAAC,MAAA,CACC,KAAK,UACL,SAAU,EACV,UAAU,oFACV,QAAUN,GAAMA,EAAE,gBAAA,EAClB,YAAcA,GAAMA,EAAE,eAAA,EACtB,UAAYA,GAAM,CACZA,EAAE,MAAQ,UACZP,EAAa,EAAK,CAEtB,EAEA,SAAAa,EAAAA,IAACtB,GAAgB,YAAAF,CAAA,CAA0B,CAAA,CAAA,CAC7C,CAAA,CAAA,CAIR,CACF,EAEAhC,EAAc,YAAc"}
1
+ {"version":3,"file":"TextAreaField.cjs.js","sources":["../../../../src/components/forms/text-area-field/TextAreaField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useState } from \"react\";\nimport type { RefObject } from \"react\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\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 * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the TextAreaField component\n */\nexport interface TextAreaFieldProps\n extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"onChange\" | \"maxLength\"> {\n /** The label text to display above the textarea */\n label?: string;\n /** Placeholder text for the textarea */\n placeholder: string;\n /** Current value of the textarea */\n value?: string | any;\n /** Callback function called when the textarea value changes */\n onChange: (value: string) => void;\n /** Number of visible text lines for the textarea (alias for rows) */\n row?: number;\n /** Error message to display below the textarea */\n errorMessage?: string;\n /** Default value for the textarea */\n defaultValue?: string;\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 the textarea is disabled */\n disabled?: boolean;\n /** Additional CSS classes for the textarea element */\n className?: string;\n /** Ref object for the textarea element */\n inputRef?: RefObject<HTMLTextAreaElement>;\n /** Maximum character length allowed */\n maxLength?: number | null;\n /** Tooltip text to display */\n tooltip?: string;\n /** Whether to preserve original case in the label */\n originalCase?: 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?: React.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 /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to remove border styling */\n noBorder?: boolean;\n /** Unique identifier for the textarea */\n id?: string;\n /** Custom inline styles for the textarea */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when the textarea loses focus */\n onBlur?: () => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A customizable textarea field component with label, validation, GTN integration,\n * risk analysis support, and styling support. Features dark mode support,\n * accessibility enhancements, and character count display.\n *\n * @example\n * ```tsx\n * <TextAreaField\n * label=\"Description\"\n * placeholder=\"Enter a description...\"\n * value={description}\n * onChange={(value) => setDescription(value)}\n * required\n * />\n *\n * <TextAreaField\n * label=\"Comments\"\n * placeholder=\"Enter comments...\"\n * value={comments}\n * onChange={(value) => setComments(value)}\n * maxLength={500}\n * isGTN\n * gtnName=\"comments_field\"\n * onAddGTNToDocument={(kv) => handleAddToDocument(kv)}\n * />\n * ```\n */\nexport const TextAreaField = forwardRef<HTMLDivElement, TextAreaFieldProps>(\n (\n {\n label,\n placeholder,\n value,\n onChange,\n row = 4,\n errorMessage,\n defaultValue,\n required,\n isRequiredConditional = false,\n tags = [],\n disabled,\n className,\n inputRef,\n maxLength = undefined,\n tooltip = \"\",\n originalCase = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = \"\",\n noBorder = false,\n id,\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n onAddGTNToDocument,\n labelExtra,\n inputEmphasis = \"default\",\n ...textareaProps\n },\n ref\n ) => {\n const { t } = useTranslation();\n const [isHovered, setIsHovered] = useState(false);\n const showRiskSkin = Boolean(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !showRiskSkin;\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !showRiskSkin;\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !showRiskSkin;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n const form = (e.target as HTMLTextAreaElement).closest(\"form\");\n if (form) {\n const submitButton = form.querySelector<HTMLButtonElement>('button[type=\"submit\"]');\n if (submitButton) {\n submitButton.click();\n } else {\n form.requestSubmit();\n }\n }\n }\n textareaProps.onKeyDown?.(e);\n };\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: value || \"\",\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n return (\n <div\n ref={ref}\n id={id}\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\")}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags || []} />\n {tooltip && (\n <AntTooltip placement=\"top\" title={tooltip}>\n <div\n className=\"cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n }\n }}\n >\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </AntTooltip>\n )}\n {labelExtra}\n </div>\n\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 <button\n id=\"btn-textarea-field-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\n className=\"text-primary-600\"\n sx={{ fontSize: 16 }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <textarea\n {...textareaProps}\n onKeyDown={handleKeyDown}\n onBlur={onBlur}\n onChange={(e) => onChange(e.target.value)}\n defaultValue={defaultValue}\n value={value}\n required={required}\n className={cn(\n \"border rounded-lg focus:outline-none focus:ring-0 block w-full py-2.5 px-3 font-inter font-medium text-sm disabled:bg-neutral-50 dark:disabled:!bg-black-800\",\n {\n \"border-red-300\": errorMessage,\n \"border-gray-300 dark:border-black-700\": !errorMessage && !emphasisModifiedSkin && !emphasisDeletedSkin && !emphasisSuccessSkin && !showRiskSkin,\n \"text-neutral-400 dark:text-neutral-500\": disabled && !emphasisDeletedSkin && !emphasisSuccessSkin,\n \"text-neutral-900 dark:text-neutral-50\": !disabled && !emphasisDeletedSkin && !emphasisSuccessSkin,\n \"border-none\": noBorder,\n \"focus:border-none\": noBorder,\n \"focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)] bg-white dark:bg-black-600\": !emphasisModifiedSkin && !emphasisDeletedSkin && !emphasisSuccessSkin && !showRiskSkin && !errorMessage,\n },\n emphasisDeletedSkin && \"border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\",\n emphasisModifiedSkin && \"border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\",\n emphasisSuccessSkin && \"border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\",\n className,\n showRiskSkin && `!bg-${riskDetails!.color}-50 border-${riskDetails!.color}-300`\n )}\n style={\n showRiskSkin && riskDetails\n ? {\n backgroundColor: riskDetails.hexBgColor || undefined,\n borderColor: riskDetails.hexBorderColor || undefined,\n ...inputStyle,\n }\n : inputStyle\n }\n rows={row}\n placeholder={placeholder}\n disabled={disabled}\n maxLength={maxLength || undefined}\n id={id}\n ref={inputRef}\n onClick={(e) => e.stopPropagation()}\n autoComplete=\"off\"\n />\n {maxLength ? (\n <Typography\n className=\"mt-0.5 text-right text-neutral-900 dark:text-white\"\n appearance=\"custom\"\n size=\"extra-small\"\n >\n <span\n className={`${\n value?.length >= maxLength\n ? \"text-error-500\"\n : value?.length > maxLength - Math.min(50, maxLength / 5)\n ? \"text-warning-500 dark:text-warning-300\"\n : \"\"\n }`}\n >\n {value?.length || 0}{\" \"}\n </span>\n / {maxLength}\n </Typography>\n ) : null}\n\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n\n {isHovered && isRiskAnalysisOpen && riskDetails && RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nTextAreaField.displayName = \"TextAreaField\";\n\n"],"names":["TextAreaField","forwardRef","label","placeholder","value","onChange","row","errorMessage","defaultValue","required","isRequiredConditional","tags","disabled","className","inputRef","maxLength","tooltip","originalCase","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","noBorder","id","inputStyle","labelClassName","isLiveField","onBlur","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","onAddGTNToDocument","labelExtra","inputEmphasis","textareaProps","ref","t","useTranslation","isHovered","setIsHovered","useState","showRiskSkin","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","handleKeyDown","e","form","submitButton","handleAddGTNToDocument","jsxs","cn","jsx","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","AntTooltip","HelpIcon","Tooltip","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","NoteAddOutlined","Typography"],"mappings":"6oBA6KaA,EAAgBC,EAAAA,WAC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CAAA,CAA0B,CAAA,CAAA,CAC7C,CAAA,CAAA,CAIR,CACF,EAEAhC,EAAc,YAAc"}
@@ -1,14 +1,14 @@
1
1
  import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
2
  import m from "../../../_virtual/index.es.js";
3
- import { forwardRef as oe, useState as ae } from "react";
3
+ import { forwardRef as oe, useState as te } from "react";
4
4
  import { Tooltip as D } from "antd";
5
- import { useTranslation as te } from "react-i18next";
5
+ import { useTranslation as ae } from "react-i18next";
6
6
  import { Typography as I } from "../../data-display/typography/Typography.es.js";
7
7
  import { HelpIcon as le } from "../../icons/HelpIcon.es.js";
8
- import { Label as de } from "../../data-display/label/Label.es.js";
9
- import { BoltOutlined as ne, NoteAddOutlined as ie } from "@mui/icons-material";
10
- import { AIExtractedIndicator as ce } from "../../icons/AIExtractedIndicator.es.js";
11
- import { AIStarIcon as se } from "../../icons/AIStarIcon.es.js";
8
+ import { Label as ne } from "../../data-display/label/Label.es.js";
9
+ import { BoltOutlined as de, NoteAddOutlined as ie } from "@mui/icons-material";
10
+ import { AIExtractedIndicator as se } from "../../icons/AIExtractedIndicator.es.js";
11
+ import { AIStarIcon as ce } from "../../icons/AIStarIcon.es.js";
12
12
  import { InputLabel as me } from "../shared/InputLabel.es.js";
13
13
  import ue from "../../tooltip/Tooltip.es.js";
14
14
  import { shouldShowConfidenceScore as z, getConfidenceScoreBadgeFill as fe, getConfidenceScoreBadgeColor as be, getConfidenceScoreBadgeTextColor as pe, getConfidenceScoreBadgeClass as xe } from "../../../utils/confidenceScoreUtils.es.js";
@@ -16,10 +16,10 @@ const ge = oe(
16
16
  ({
17
17
  label: K,
18
18
  placeholder: W,
19
- value: n,
19
+ value: d,
20
20
  onChange: $,
21
21
  row: j = 4,
22
- errorMessage: a,
22
+ errorMessage: t,
23
23
  defaultValue: q,
24
24
  required: k,
25
25
  isRequiredConditional: H = !1,
@@ -27,7 +27,7 @@ const ge = oe(
27
27
  disabled: f,
28
28
  className: V,
29
29
  inputRef: O,
30
- maxLength: d = void 0,
30
+ maxLength: n = void 0,
31
31
  tooltip: y = "",
32
32
  originalCase: R = !1,
33
33
  isAiExtracted: J = !1,
@@ -44,7 +44,7 @@ const ge = oe(
44
44
  labelClassName: X,
45
45
  isLiveField: Y = !1,
46
46
  onBlur: Z,
47
- riskDetails: t,
47
+ riskDetails: a,
48
48
  isRiskAnalysisOpen: S = !1,
49
49
  RiskDetailsCard: _,
50
50
  onAddGTNToDocument: N,
@@ -52,7 +52,7 @@ const ge = oe(
52
52
  inputEmphasis: g = "default",
53
53
  ...B
54
54
  }, G) => {
55
- const { t: M } = te(), [u, h] = ae(!1), l = !!(S && t?.color), v = g === "modified" && !a && !l, c = g === "deleted" && !a && !l, s = g === "success" && !a && !l, ee = (e) => {
55
+ const { t: M } = ae(), [u, h] = te(!1), l = !!(S && a?.color), v = g === "modified" && !t && !l, s = g === "deleted" && !t && !l, c = g === "success" && !t && !l, ee = (e) => {
56
56
  if (e.key === "Enter" && !e.shiftKey) {
57
57
  e.preventDefault();
58
58
  const F = e.target.closest("form");
@@ -65,7 +65,7 @@ const ge = oe(
65
65
  }, re = () => {
66
66
  N && N({
67
67
  key: U,
68
- value: n || ""
68
+ value: d || ""
69
69
  });
70
70
  };
71
71
  return /* @__PURE__ */ o(
@@ -91,7 +91,7 @@ const ge = oe(
91
91
  /* @__PURE__ */ o("div", { className: "inline-flex min-w-0 items-center gap-1 flex-wrap", children: [
92
92
  /* @__PURE__ */ r(me, { label: K || "", required: k || !1, isRequiredConditional: H || !1 }),
93
93
  Y && /* @__PURE__ */ r(
94
- ne,
94
+ de,
95
95
  {
96
96
  sx: {
97
97
  fontSize: 16,
@@ -100,8 +100,8 @@ const ge = oe(
100
100
  }
101
101
  }
102
102
  ),
103
- J && !z(b) && /* @__PURE__ */ r(ce, {}),
104
- /* @__PURE__ */ r(de, { labels: P || [] }),
103
+ J && !z(b) && /* @__PURE__ */ r(se, {}),
104
+ /* @__PURE__ */ r(ne, { labels: P || [] }),
105
105
  y && /* @__PURE__ */ r(D, { placement: "top", title: y, children: /* @__PURE__ */ r(
106
106
  "div",
107
107
  {
@@ -134,7 +134,7 @@ const ge = oe(
134
134
  onClick: () => T?.(Q),
135
135
  children: [
136
136
  /* @__PURE__ */ r(
137
- se,
137
+ ce,
138
138
  {
139
139
  size: 12,
140
140
  fill: be(i),
@@ -178,42 +178,41 @@ const ge = oe(
178
178
  onBlur: Z,
179
179
  onChange: (e) => $(e.target.value),
180
180
  defaultValue: q,
181
- value: n,
181
+ value: d,
182
182
  required: k,
183
183
  className: m(
184
- "border rounded-lg focus:outline-none focus:ring-0 block w-full py-2.5 px-3 font-inter font-medium text-sm disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400",
184
+ "border rounded-lg focus:outline-none focus:ring-0 block w-full py-2.5 px-3 font-inter font-medium text-sm disabled:bg-neutral-50 dark:disabled:!bg-black-800",
185
185
  {
186
- "border-red-300": a,
187
- "border-gray-300 dark:border-black-700": !a && !v && !c && !s && !l,
188
- "text-neutral-400 dark:text-neutral-500": f && !c && !s,
189
- "text-neutral-900 dark:text-neutral-50": !f && !c && !s,
186
+ "border-red-300": t,
187
+ "border-gray-300 dark:border-black-700": !t && !v && !s && !c && !l,
188
+ "text-neutral-400 dark:text-neutral-500": f && !s && !c,
189
+ "text-neutral-900 dark:text-neutral-50": !f && !s && !c,
190
190
  "border-none": w,
191
191
  "focus:border-none": w,
192
- "placeholder:text-neutral-400 dark:placeholder:text-black-300": !0,
193
- "focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)] bg-white dark:bg-black-600": !v && !c && !s && !l && !a
192
+ "focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)] bg-white dark:bg-black-600": !v && !s && !c && !l && !t
194
193
  },
195
- c && "border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]",
194
+ s && "border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]",
196
195
  v && "border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]",
197
- s && "border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]",
196
+ c && "border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]",
198
197
  V,
199
- l && `!bg-${t.color}-50 border-${t.color}-300`
198
+ l && `!bg-${a.color}-50 border-${a.color}-300`
200
199
  ),
201
- style: l && t ? {
202
- backgroundColor: t.hexBgColor || void 0,
203
- borderColor: t.hexBorderColor || void 0,
200
+ style: l && a ? {
201
+ backgroundColor: a.hexBgColor || void 0,
202
+ borderColor: a.hexBorderColor || void 0,
204
203
  ...E
205
204
  } : E,
206
205
  rows: j,
207
206
  placeholder: W,
208
207
  disabled: f,
209
- maxLength: d || void 0,
208
+ maxLength: n || void 0,
210
209
  id: C,
211
210
  ref: O,
212
211
  onClick: (e) => e.stopPropagation(),
213
212
  autoComplete: "off"
214
213
  }
215
214
  ),
216
- d ? /* @__PURE__ */ o(
215
+ n ? /* @__PURE__ */ o(
217
216
  I,
218
217
  {
219
218
  className: "mt-0.5 text-right text-neutral-900 dark:text-white",
@@ -223,30 +222,30 @@ const ge = oe(
223
222
  /* @__PURE__ */ o(
224
223
  "span",
225
224
  {
226
- className: `${n?.length >= d ? "text-error-500" : n?.length > d - Math.min(50, d / 5) ? "text-warning-500 dark:text-warning-300" : ""}`,
225
+ className: `${d?.length >= n ? "text-error-500" : d?.length > n - Math.min(50, n / 5) ? "text-warning-500 dark:text-warning-300" : ""}`,
227
226
  children: [
228
- n?.length || 0,
227
+ d?.length || 0,
229
228
  " "
230
229
  ]
231
230
  }
232
231
  ),
233
232
  "/ ",
234
- d
233
+ n
235
234
  ]
236
235
  }
237
236
  ) : null,
238
- a && /* @__PURE__ */ r(
237
+ t && /* @__PURE__ */ r(
239
238
  I,
240
239
  {
241
240
  className: "text-error-500 mt-1",
242
241
  appearance: "custom",
243
242
  size: "extra-small",
244
243
  variant: "medium",
245
- children: a
244
+ children: t
246
245
  }
247
246
  )
248
247
  ] }),
249
- u && S && t && _ && /* @__PURE__ */ r(
248
+ u && S && a && _ && /* @__PURE__ */ r(
250
249
  "div",
251
250
  {
252
251
  role: "tooltip",
@@ -257,7 +256,7 @@ const ge = oe(
257
256
  onKeyDown: (e) => {
258
257
  e.key === "Escape" && h(!1);
259
258
  },
260
- children: /* @__PURE__ */ r(_, { riskDetails: t })
259
+ children: /* @__PURE__ */ r(_, { riskDetails: a })
261
260
  }
262
261
  )
263
262
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"TextAreaField.es.js","sources":["../../../../src/components/forms/text-area-field/TextAreaField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useState } from \"react\";\nimport type { RefObject } from \"react\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\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 * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the TextAreaField component\n */\nexport interface TextAreaFieldProps\n extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"onChange\" | \"maxLength\"> {\n /** The label text to display above the textarea */\n label?: string;\n /** Placeholder text for the textarea */\n placeholder: string;\n /** Current value of the textarea */\n value?: string | any;\n /** Callback function called when the textarea value changes */\n onChange: (value: string) => void;\n /** Number of visible text lines for the textarea (alias for rows) */\n row?: number;\n /** Error message to display below the textarea */\n errorMessage?: string;\n /** Default value for the textarea */\n defaultValue?: string;\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 the textarea is disabled */\n disabled?: boolean;\n /** Additional CSS classes for the textarea element */\n className?: string;\n /** Ref object for the textarea element */\n inputRef?: RefObject<HTMLTextAreaElement>;\n /** Maximum character length allowed */\n maxLength?: number | null;\n /** Tooltip text to display */\n tooltip?: string;\n /** Whether to preserve original case in the label */\n originalCase?: 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?: React.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 /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to remove border styling */\n noBorder?: boolean;\n /** Unique identifier for the textarea */\n id?: string;\n /** Custom inline styles for the textarea */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when the textarea loses focus */\n onBlur?: () => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A customizable textarea field component with label, validation, GTN integration,\n * risk analysis support, and styling support. Features dark mode support,\n * accessibility enhancements, and character count display.\n *\n * @example\n * ```tsx\n * <TextAreaField\n * label=\"Description\"\n * placeholder=\"Enter a description...\"\n * value={description}\n * onChange={(value) => setDescription(value)}\n * required\n * />\n *\n * <TextAreaField\n * label=\"Comments\"\n * placeholder=\"Enter comments...\"\n * value={comments}\n * onChange={(value) => setComments(value)}\n * maxLength={500}\n * isGTN\n * gtnName=\"comments_field\"\n * onAddGTNToDocument={(kv) => handleAddToDocument(kv)}\n * />\n * ```\n */\nexport const TextAreaField = forwardRef<HTMLDivElement, TextAreaFieldProps>(\n (\n {\n label,\n placeholder,\n value,\n onChange,\n row = 4,\n errorMessage,\n defaultValue,\n required,\n isRequiredConditional = false,\n tags = [],\n disabled,\n className,\n inputRef,\n maxLength = undefined,\n tooltip = \"\",\n originalCase = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = \"\",\n noBorder = false,\n id,\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n onAddGTNToDocument,\n labelExtra,\n inputEmphasis = \"default\",\n ...textareaProps\n },\n ref\n ) => {\n const { t } = useTranslation();\n const [isHovered, setIsHovered] = useState(false);\n const showRiskSkin = Boolean(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !showRiskSkin;\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !showRiskSkin;\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !showRiskSkin;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n const form = (e.target as HTMLTextAreaElement).closest(\"form\");\n if (form) {\n const submitButton = form.querySelector<HTMLButtonElement>('button[type=\"submit\"]');\n if (submitButton) {\n submitButton.click();\n } else {\n form.requestSubmit();\n }\n }\n }\n textareaProps.onKeyDown?.(e);\n };\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: value || \"\",\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n return (\n <div\n ref={ref}\n id={id}\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\")}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags || []} />\n {tooltip && (\n <AntTooltip placement=\"top\" title={tooltip}>\n <div\n className=\"cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n }\n }}\n >\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </AntTooltip>\n )}\n {labelExtra}\n </div>\n\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 <button\n id=\"btn-textarea-field-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\n className=\"text-primary-600\"\n sx={{ fontSize: 16 }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <textarea\n {...textareaProps}\n onKeyDown={handleKeyDown}\n onBlur={onBlur}\n onChange={(e) => onChange(e.target.value)}\n defaultValue={defaultValue}\n value={value}\n required={required}\n className={cn(\n \"border rounded-lg focus:outline-none focus:ring-0 block w-full py-2.5 px-3 font-inter font-medium text-sm disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400\",\n {\n \"border-red-300\": errorMessage,\n \"border-gray-300 dark:border-black-700\": !errorMessage && !emphasisModifiedSkin && !emphasisDeletedSkin && !emphasisSuccessSkin && !showRiskSkin,\n \"text-neutral-400 dark:text-neutral-500\": disabled && !emphasisDeletedSkin && !emphasisSuccessSkin,\n \"text-neutral-900 dark:text-neutral-50\": !disabled && !emphasisDeletedSkin && !emphasisSuccessSkin,\n \"border-none\": noBorder,\n \"focus:border-none\": noBorder,\n \"placeholder:text-neutral-400 dark:placeholder:text-black-300\": true,\n \"focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)] bg-white dark:bg-black-600\": !emphasisModifiedSkin && !emphasisDeletedSkin && !emphasisSuccessSkin && !showRiskSkin && !errorMessage,\n },\n emphasisDeletedSkin && \"border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\",\n emphasisModifiedSkin && \"border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\",\n emphasisSuccessSkin && \"border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\",\n className,\n showRiskSkin && `!bg-${riskDetails!.color}-50 border-${riskDetails!.color}-300`\n )}\n style={\n showRiskSkin && riskDetails\n ? {\n backgroundColor: riskDetails.hexBgColor || undefined,\n borderColor: riskDetails.hexBorderColor || undefined,\n ...inputStyle,\n }\n : inputStyle\n }\n rows={row}\n placeholder={placeholder}\n disabled={disabled}\n maxLength={maxLength || undefined}\n id={id}\n ref={inputRef}\n onClick={(e) => e.stopPropagation()}\n autoComplete=\"off\"\n />\n {maxLength ? (\n <Typography\n className=\"mt-0.5 text-right text-neutral-900 dark:text-white\"\n appearance=\"custom\"\n size=\"extra-small\"\n >\n <span\n className={`${\n value?.length >= maxLength\n ? \"text-error-500\"\n : value?.length > maxLength - Math.min(50, maxLength / 5)\n ? \"text-warning-500 dark:text-warning-300\"\n : \"\"\n }`}\n >\n {value?.length || 0}{\" \"}\n </span>\n / {maxLength}\n </Typography>\n ) : null}\n\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n\n {isHovered && isRiskAnalysisOpen && riskDetails && RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nTextAreaField.displayName = \"TextAreaField\";\n\n"],"names":["TextAreaField","forwardRef","label","placeholder","value","onChange","row","errorMessage","defaultValue","required","isRequiredConditional","tags","disabled","className","inputRef","maxLength","tooltip","originalCase","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","noBorder","id","inputStyle","labelClassName","isLiveField","onBlur","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","onAddGTNToDocument","labelExtra","inputEmphasis","textareaProps","ref","t","useTranslation","isHovered","setIsHovered","useState","showRiskSkin","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","handleKeyDown","form","submitButton","handleAddGTNToDocument","jsxs","cn","jsx","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","AntTooltip","HelpIcon","Tooltip","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","NoteAddOutlined","Typography"],"mappings":";;;;;;;;;;;;;;AA6KO,MAAMA,KAAgBC;AAAA,EAC3B,CACE;AAAA,IACE,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,uBAAAC,IAAwB;AAAA,IACxB,MAAAC,IAAO,CAAA;AAAA,IACP,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU;AAAA,IACV,cAAAC,IAAe;AAAA,IACf,eAAAC,IAAgB;AAAA,IAChB,iBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,mBAAAC;AAAA,IACA,YAAAC,IAAa,CAAA;AAAA,IACb,wBAAAC;AAAA,IACA,OAAAC,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A;AAAA,YAAA;AAAA,YAEdC,IACC,gBAAAsC;AAAA,cAACiB;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,YAAW;AAAA,gBACX,MAAK;AAAA,gBAEL,UAAA;AAAA,kBAAA,gBAAAjB;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,WAAW,GACTjD,GAAO,UAAUW,IACb,mBACAX,GAAO,SAASW,IAAY,KAAK,IAAI,IAAIA,IAAY,CAAC,IACtD,2CACA,EACN;AAAA,sBAEC,UAAA;AAAA,wBAAAX,GAAO,UAAU;AAAA,wBAAG;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAChB;AAAA,kBACJW;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA,IAEH;AAAA,YAEHR,KACC,gBAAAgD;AAAA,cAACe;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,YAAW;AAAA,gBACX,MAAK;AAAA,gBACL,SAAQ;AAAA,gBAEP,UAAA/D;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,GAEJ;AAAA,UAECmC,KAAaT,KAAsBD,KAAeE,KACjD,gBAAAqB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,WAAU;AAAA,cACV,SAAS,CAAC,MAAM,EAAE,gBAAA;AAAA,cAClB,aAAa,CAAC,MAAM,EAAE,eAAA;AAAA,cACtB,WAAW,CAAC,MAAM;AAChB,gBAAI,EAAE,QAAQ,YACZZ,EAAa,EAAK;AAAA,cAEtB;AAAA,cAEA,UAAA,gBAAAY,EAACrB,KAAgB,aAAAF,EAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAhC,GAAc,cAAc;"}
1
+ {"version":3,"file":"TextAreaField.es.js","sources":["../../../../src/components/forms/text-area-field/TextAreaField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { forwardRef, useState } from \"react\";\nimport type { RefObject } from \"react\";\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { useTranslation } from 'react-i18next';\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\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 * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props - generic to allow consumer-specific risk types\n */\nexport interface RiskDetailsCardProps<T = any> {\n riskDetails: T;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the TextAreaField component\n */\nexport interface TextAreaFieldProps\n extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"onChange\" | \"maxLength\"> {\n /** The label text to display above the textarea */\n label?: string;\n /** Placeholder text for the textarea */\n placeholder: string;\n /** Current value of the textarea */\n value?: string | any;\n /** Callback function called when the textarea value changes */\n onChange: (value: string) => void;\n /** Number of visible text lines for the textarea (alias for rows) */\n row?: number;\n /** Error message to display below the textarea */\n errorMessage?: string;\n /** Default value for the textarea */\n defaultValue?: string;\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 the textarea is disabled */\n disabled?: boolean;\n /** Additional CSS classes for the textarea element */\n className?: string;\n /** Ref object for the textarea element */\n inputRef?: RefObject<HTMLTextAreaElement>;\n /** Maximum character length allowed */\n maxLength?: number | null;\n /** Tooltip text to display */\n tooltip?: string;\n /** Whether to preserve original case in the label */\n originalCase?: 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?: React.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 /** Whether this is a GTN (Global Term Name) field */\n isGTN?: boolean;\n /** GTN field name for document integration */\n gtnName?: any;\n /** Whether to remove border styling */\n noBorder?: boolean;\n /** Unique identifier for the textarea */\n id?: string;\n /** Custom inline styles for the textarea */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function called when the textarea loses focus */\n onBlur?: () => void;\n /** Risk details data */\n riskDetails?: RiskDetails;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component */\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input surface style: `'modified'` — Warning colors; `'deleted'` — Error colors, text #475467; `'success'` — Success colors, text #101828. */\n inputEmphasis?: \"default\" | \"modified\" | \"deleted\" | \"success\";\n}\n\n/**\n * A customizable textarea field component with label, validation, GTN integration,\n * risk analysis support, and styling support. Features dark mode support,\n * accessibility enhancements, and character count display.\n *\n * @example\n * ```tsx\n * <TextAreaField\n * label=\"Description\"\n * placeholder=\"Enter a description...\"\n * value={description}\n * onChange={(value) => setDescription(value)}\n * required\n * />\n *\n * <TextAreaField\n * label=\"Comments\"\n * placeholder=\"Enter comments...\"\n * value={comments}\n * onChange={(value) => setComments(value)}\n * maxLength={500}\n * isGTN\n * gtnName=\"comments_field\"\n * onAddGTNToDocument={(kv) => handleAddToDocument(kv)}\n * />\n * ```\n */\nexport const TextAreaField = forwardRef<HTMLDivElement, TextAreaFieldProps>(\n (\n {\n label,\n placeholder,\n value,\n onChange,\n row = 4,\n errorMessage,\n defaultValue,\n required,\n isRequiredConditional = false,\n tags = [],\n disabled,\n className,\n inputRef,\n maxLength = undefined,\n tooltip = \"\",\n originalCase = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName = \"\",\n noBorder = false,\n id,\n inputStyle,\n labelClassName,\n isLiveField = false,\n onBlur,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n onAddGTNToDocument,\n labelExtra,\n inputEmphasis = \"default\",\n ...textareaProps\n },\n ref\n ) => {\n const { t } = useTranslation();\n const [isHovered, setIsHovered] = useState(false);\n const showRiskSkin = Boolean(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !showRiskSkin;\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !showRiskSkin;\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !showRiskSkin;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n const form = (e.target as HTMLTextAreaElement).closest(\"form\");\n if (form) {\n const submitButton = form.querySelector<HTMLButtonElement>('button[type=\"submit\"]');\n if (submitButton) {\n submitButton.click();\n } else {\n form.requestSubmit();\n }\n }\n }\n textareaProps.onKeyDown?.(e);\n };\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value: value || \"\",\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n return (\n <div\n ref={ref}\n id={id}\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"w-full flex flex-col\")}>\n <label\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${\n !originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"\"}`}\n >\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1\">\n <div className=\"inline-flex min-w-0 items-center gap-1 flex-wrap\">\n <InputLabel label={label || \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n {isLiveField && (\n <BoltOutlined\n sx={{\n fontSize: 16,\n color: \"var(--color-primary-600)\",\n rotate: \"15deg\",\n }}\n />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags || []} />\n {tooltip && (\n <AntTooltip placement=\"top\" title={tooltip}>\n <div\n className=\"cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n }\n }}\n >\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </AntTooltip>\n )}\n {labelExtra}\n </div>\n\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 <button\n id=\"btn-textarea-field-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\n className=\"text-primary-600\"\n sx={{ fontSize: 16 }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n <textarea\n {...textareaProps}\n onKeyDown={handleKeyDown}\n onBlur={onBlur}\n onChange={(e) => onChange(e.target.value)}\n defaultValue={defaultValue}\n value={value}\n required={required}\n className={cn(\n \"border rounded-lg focus:outline-none focus:ring-0 block w-full py-2.5 px-3 font-inter font-medium text-sm disabled:bg-neutral-50 dark:disabled:!bg-black-800\",\n {\n \"border-red-300\": errorMessage,\n \"border-gray-300 dark:border-black-700\": !errorMessage && !emphasisModifiedSkin && !emphasisDeletedSkin && !emphasisSuccessSkin && !showRiskSkin,\n \"text-neutral-400 dark:text-neutral-500\": disabled && !emphasisDeletedSkin && !emphasisSuccessSkin,\n \"text-neutral-900 dark:text-neutral-50\": !disabled && !emphasisDeletedSkin && !emphasisSuccessSkin,\n \"border-none\": noBorder,\n \"focus:border-none\": noBorder,\n \"focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)] bg-white dark:bg-black-600\": !emphasisModifiedSkin && !emphasisDeletedSkin && !emphasisSuccessSkin && !showRiskSkin && !errorMessage,\n },\n emphasisDeletedSkin && \"border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]\",\n emphasisModifiedSkin && \"border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]\",\n emphasisSuccessSkin && \"border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]\",\n className,\n showRiskSkin && `!bg-${riskDetails!.color}-50 border-${riskDetails!.color}-300`\n )}\n style={\n showRiskSkin && riskDetails\n ? {\n backgroundColor: riskDetails.hexBgColor || undefined,\n borderColor: riskDetails.hexBorderColor || undefined,\n ...inputStyle,\n }\n : inputStyle\n }\n rows={row}\n placeholder={placeholder}\n disabled={disabled}\n maxLength={maxLength || undefined}\n id={id}\n ref={inputRef}\n onClick={(e) => e.stopPropagation()}\n autoComplete=\"off\"\n />\n {maxLength ? (\n <Typography\n className=\"mt-0.5 text-right text-neutral-900 dark:text-white\"\n appearance=\"custom\"\n size=\"extra-small\"\n >\n <span\n className={`${\n value?.length >= maxLength\n ? \"text-error-500\"\n : value?.length > maxLength - Math.min(50, maxLength / 5)\n ? \"text-warning-500 dark:text-warning-300\"\n : \"\"\n }`}\n >\n {value?.length || 0}{\" \"}\n </span>\n / {maxLength}\n </Typography>\n ) : null}\n\n {errorMessage && (\n <Typography\n className=\"text-error-500 mt-1\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n\n {isHovered && isRiskAnalysisOpen && riskDetails && RiskDetailsCard && (\n <div\n role=\"tooltip\"\n tabIndex={0}\n className=\"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl\"\n onClick={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.preventDefault()}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nTextAreaField.displayName = \"TextAreaField\";\n\n"],"names":["TextAreaField","forwardRef","label","placeholder","value","onChange","row","errorMessage","defaultValue","required","isRequiredConditional","tags","disabled","className","inputRef","maxLength","tooltip","originalCase","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","gtnName","noBorder","id","inputStyle","labelClassName","isLiveField","onBlur","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","onAddGTNToDocument","labelExtra","inputEmphasis","textareaProps","ref","t","useTranslation","isHovered","setIsHovered","useState","showRiskSkin","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","handleKeyDown","form","submitButton","handleAddGTNToDocument","jsxs","cn","jsx","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","AntTooltip","HelpIcon","Tooltip","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","NoteAddOutlined","Typography"],"mappings":";;;;;;;;;;;;;;AA6KO,MAAMA,KAAgBC;AAAA,EAC3B,CACE;AAAA,IACE,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,uBAAAC,IAAwB;AAAA,IACxB,MAAAC,IAAO,CAAA;AAAA,IACP,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU;AAAA,IACV,cAAAC,IAAe;AAAA,IACf,eAAAC,IAAgB;AAAA,IAChB,iBAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,mBAAAC;AAAA,IACA,YAAAC,IAAa,CAAA;AAAA,IACb,wBAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,IAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC,IAAqB;AAAA,IACrB,iBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,GAAA,GACR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;AAAA,kBAAA;AAAA,kBAChB;AAAA,kBACJW;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA,IAEH;AAAA,YAEHR,KACC,gBAAAgD;AAAA,cAACe;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,YAAW;AAAA,gBACX,MAAK;AAAA,gBACL,SAAQ;AAAA,gBAEP,UAAA/D;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,GAEJ;AAAA,UAECmC,KAAaT,KAAsBD,KAAeE,KACjD,gBAAAqB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,WAAU;AAAA,cACV,SAAS,CAAC,MAAM,EAAE,gBAAA;AAAA,cAClB,aAAa,CAAC,MAAM,EAAE,eAAA;AAAA,cACtB,WAAW,CAAC,MAAM;AAChB,gBAAI,EAAE,QAAQ,YACZZ,EAAa,EAAK;AAAA,cAEtB;AAAA,cAEA,UAAA,gBAAAY,EAACrB,KAAgB,aAAAF,EAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAhC,GAAc,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.16.3",
4
+ "version": "0.16.4",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",