@lax-wp/design-system 0.13.29 → 0.13.33-beta.0

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 (163) hide show
  1. package/dist/components/button/Button.cjs.js +5 -5
  2. package/dist/components/button/Button.cjs.js.map +1 -1
  3. package/dist/components/button/Button.es.js +18 -18
  4. package/dist/components/button/Button.es.js.map +1 -1
  5. package/dist/components/button/IconButton.cjs.js +1 -1
  6. package/dist/components/button/IconButton.cjs.js.map +1 -1
  7. package/dist/components/button/IconButton.es.js +8 -8
  8. package/dist/components/button/IconButton.es.js.map +1 -1
  9. package/dist/components/buttons/option-button/OptionButton.cjs.js +1 -1
  10. package/dist/components/buttons/option-button/OptionButton.cjs.js.map +1 -1
  11. package/dist/components/buttons/option-button/OptionButton.es.js +1 -1
  12. package/dist/components/buttons/option-button/OptionButton.es.js.map +1 -1
  13. package/dist/components/data-display/comparison/components/Header.cjs.js +1 -1
  14. package/dist/components/data-display/comparison/components/Header.cjs.js.map +1 -1
  15. package/dist/components/data-display/comparison/components/Header.es.js +13 -13
  16. package/dist/components/data-display/comparison/components/Header.es.js.map +1 -1
  17. package/dist/components/data-display/infinite-table/body/cell/ActionCell.cjs.js +1 -1
  18. package/dist/components/data-display/infinite-table/body/cell/ActionCell.cjs.js.map +1 -1
  19. package/dist/components/data-display/infinite-table/body/cell/ActionCell.es.js +11 -11
  20. package/dist/components/data-display/infinite-table/body/cell/ActionCell.es.js.map +1 -1
  21. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js +1 -1
  22. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js.map +1 -1
  23. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js +12 -12
  24. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js.map +1 -1
  25. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js +1 -1
  26. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js.map +1 -1
  27. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js +141 -143
  28. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js.map +1 -1
  29. package/dist/components/data-display/infinite-table/body/cell/LoaderCell.cjs.js +1 -1
  30. package/dist/components/data-display/infinite-table/body/cell/LoaderCell.cjs.js.map +1 -1
  31. package/dist/components/data-display/infinite-table/body/cell/LoaderCell.es.js +2 -2
  32. package/dist/components/data-display/infinite-table/body/cell/LoaderCell.es.js.map +1 -1
  33. package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.cjs.js +1 -1
  34. package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.cjs.js.map +1 -1
  35. package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.es.js +1 -1
  36. package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.es.js.map +1 -1
  37. package/dist/components/data-display/infinite-table/body/rows/row.cjs.js +1 -1
  38. package/dist/components/data-display/infinite-table/body/rows/row.cjs.js.map +1 -1
  39. package/dist/components/data-display/infinite-table/body/rows/row.es.js +296 -301
  40. package/dist/components/data-display/infinite-table/body/rows/row.es.js.map +1 -1
  41. package/dist/components/data-display/infinite-table/context.cjs.js.map +1 -1
  42. package/dist/components/data-display/infinite-table/context.d.ts +0 -1
  43. package/dist/components/data-display/infinite-table/context.es.js.map +1 -1
  44. package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js +1 -1
  45. package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js.map +1 -1
  46. package/dist/components/data-display/infinite-table/head/CheckAll.es.js +1 -1
  47. package/dist/components/data-display/infinite-table/head/CheckAll.es.js.map +1 -1
  48. package/dist/components/data-display/infinite-table/head/cell/index.cjs.js +1 -1
  49. package/dist/components/data-display/infinite-table/head/cell/index.cjs.js.map +1 -1
  50. package/dist/components/data-display/infinite-table/head/cell/index.es.js +2 -2
  51. package/dist/components/data-display/infinite-table/head/cell/index.es.js.map +1 -1
  52. package/dist/components/data-display/infinite-table/head/index.cjs.js +1 -1
  53. package/dist/components/data-display/infinite-table/head/index.cjs.js.map +1 -1
  54. package/dist/components/data-display/infinite-table/head/index.es.js +20 -20
  55. package/dist/components/data-display/infinite-table/head/index.es.js.map +1 -1
  56. package/dist/components/data-display/infinite-table/index.cjs.js +1 -1
  57. package/dist/components/data-display/infinite-table/index.cjs.js.map +1 -1
  58. package/dist/components/data-display/infinite-table/index.d.ts +1 -1
  59. package/dist/components/data-display/infinite-table/index.es.js +208 -211
  60. package/dist/components/data-display/infinite-table/index.es.js.map +1 -1
  61. package/dist/components/data-display/infinite-table/types.d.ts +0 -22
  62. package/dist/components/data-display/tag/Tag.cjs.js +1 -1
  63. package/dist/components/data-display/tag/Tag.cjs.js.map +1 -1
  64. package/dist/components/data-display/tag/Tag.es.js +11 -9
  65. package/dist/components/data-display/tag/Tag.es.js.map +1 -1
  66. package/dist/components/floating-bar/FloatingBar.cjs.js +1 -1
  67. package/dist/components/floating-bar/FloatingBar.cjs.js.map +1 -1
  68. package/dist/components/floating-bar/FloatingBar.es.js +9 -9
  69. package/dist/components/floating-bar/FloatingBar.es.js.map +1 -1
  70. package/dist/components/forms/base-input-field/BaseInputField.cjs.js +2 -2
  71. package/dist/components/forms/base-input-field/BaseInputField.cjs.js.map +1 -1
  72. package/dist/components/forms/base-input-field/BaseInputField.es.js +30 -32
  73. package/dist/components/forms/base-input-field/BaseInputField.es.js.map +1 -1
  74. package/dist/components/forms/creatable-select/CreatableSelect.cjs.js +1 -1
  75. package/dist/components/forms/creatable-select/CreatableSelect.cjs.js.map +1 -1
  76. package/dist/components/forms/creatable-select/CreatableSelect.es.js +11 -12
  77. package/dist/components/forms/creatable-select/CreatableSelect.es.js.map +1 -1
  78. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js +1 -1
  79. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js.map +1 -1
  80. package/dist/components/forms/currency-input/CurrencyInputField.es.js +62 -70
  81. package/dist/components/forms/currency-input/CurrencyInputField.es.js.map +1 -1
  82. package/dist/components/forms/date-time-field/DateTimeField.cjs.js +1 -1
  83. package/dist/components/forms/date-time-field/DateTimeField.cjs.js.map +1 -1
  84. package/dist/components/forms/date-time-field/DateTimeField.es.js +32 -32
  85. package/dist/components/forms/date-time-field/DateTimeField.es.js.map +1 -1
  86. package/dist/components/forms/debounce-input/DebounceInputField.cjs.js +1 -1
  87. package/dist/components/forms/debounce-input/DebounceInputField.cjs.js.map +1 -1
  88. package/dist/components/forms/debounce-input/DebounceInputField.es.js +2 -2
  89. package/dist/components/forms/debounce-input/DebounceInputField.es.js.map +1 -1
  90. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js +1 -1
  91. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js.map +1 -1
  92. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js +16 -18
  93. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js.map +1 -1
  94. package/dist/components/forms/field-options/Item.cjs.js +1 -1
  95. package/dist/components/forms/field-options/Item.cjs.js.map +1 -1
  96. package/dist/components/forms/field-options/Item.es.js +5 -5
  97. package/dist/components/forms/field-options/Item.es.js.map +1 -1
  98. package/dist/components/forms/icon-picker/IconPicker.cjs.js +1 -1
  99. package/dist/components/forms/icon-picker/IconPicker.cjs.js.map +1 -1
  100. package/dist/components/forms/icon-picker/IconPicker.es.js +42 -57
  101. package/dist/components/forms/icon-picker/IconPicker.es.js.map +1 -1
  102. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js +1 -1
  103. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js.map +1 -1
  104. package/dist/components/forms/master-data-input/MasterDataInputField.es.js +33 -35
  105. package/dist/components/forms/master-data-input/MasterDataInputField.es.js.map +1 -1
  106. package/dist/components/forms/md-input/RichMarkdownInput.cjs.js +3 -3
  107. package/dist/components/forms/md-input/RichMarkdownInput.cjs.js.map +1 -1
  108. package/dist/components/forms/md-input/RichMarkdownInput.es.js +63 -63
  109. package/dist/components/forms/md-input/RichMarkdownInput.es.js.map +1 -1
  110. package/dist/components/forms/number-input-field/NumberInputField.cjs.js +1 -1
  111. package/dist/components/forms/number-input-field/NumberInputField.cjs.js.map +1 -1
  112. package/dist/components/forms/number-input-field/NumberInputField.es.js +5 -5
  113. package/dist/components/forms/number-input-field/NumberInputField.es.js.map +1 -1
  114. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js +1 -1
  115. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js.map +1 -1
  116. package/dist/components/forms/percentage-input/PercentageInputField.es.js +2 -2
  117. package/dist/components/forms/percentage-input/PercentageInputField.es.js.map +1 -1
  118. package/dist/components/forms/search-bar/SearchBar.cjs.js +1 -1
  119. package/dist/components/forms/search-bar/SearchBar.cjs.js.map +1 -1
  120. package/dist/components/forms/search-bar/SearchBar.es.js +16 -16
  121. package/dist/components/forms/search-bar/SearchBar.es.js.map +1 -1
  122. package/dist/components/forms/select-field/SelectField.cjs.js +2 -2
  123. package/dist/components/forms/select-field/SelectField.cjs.js.map +1 -1
  124. package/dist/components/forms/select-field/SelectField.d.ts +4 -0
  125. package/dist/components/forms/select-field/SelectField.es.js +202 -203
  126. package/dist/components/forms/select-field/SelectField.es.js.map +1 -1
  127. package/dist/components/forms/toggle/Toggle.cjs.js +1 -1
  128. package/dist/components/forms/toggle/Toggle.cjs.js.map +1 -1
  129. package/dist/components/forms/toggle/Toggle.es.js +14 -14
  130. package/dist/components/forms/toggle/Toggle.es.js.map +1 -1
  131. package/dist/components/navigation/accordion/Accordion.cjs.js +1 -1
  132. package/dist/components/navigation/accordion/Accordion.cjs.js.map +1 -1
  133. package/dist/components/navigation/accordion/Accordion.es.js +5 -5
  134. package/dist/components/navigation/accordion/Accordion.es.js.map +1 -1
  135. package/dist/components/navigation/stepper/Stepper.cjs.js +1 -1
  136. package/dist/components/navigation/stepper/Stepper.cjs.js.map +1 -1
  137. package/dist/components/navigation/stepper/Stepper.es.js +1 -1
  138. package/dist/components/navigation/stepper/Stepper.es.js.map +1 -1
  139. package/dist/components/navigation/tabs/TabOptions.cjs.js +1 -1
  140. package/dist/components/navigation/tabs/TabOptions.cjs.js.map +1 -1
  141. package/dist/components/navigation/tabs/TabOptions.es.js +15 -15
  142. package/dist/components/navigation/tabs/TabOptions.es.js.map +1 -1
  143. package/dist/components/navigation/tabs/TabSwitch.cjs.js +1 -1
  144. package/dist/components/navigation/tabs/TabSwitch.cjs.js.map +1 -1
  145. package/dist/components/navigation/tabs/TabSwitch.es.js +7 -7
  146. package/dist/components/navigation/tabs/TabSwitch.es.js.map +1 -1
  147. package/dist/components/navigation/tabs/Tabs.cjs.js +1 -1
  148. package/dist/components/navigation/tabs/Tabs.cjs.js.map +1 -1
  149. package/dist/components/navigation/tabs/Tabs.es.js +1 -1
  150. package/dist/components/navigation/tabs/Tabs.es.js.map +1 -1
  151. package/dist/components/user-avatar/UserAvatar.cjs.js +1 -1
  152. package/dist/components/user-avatar/UserAvatar.cjs.js.map +1 -1
  153. package/dist/components/user-avatar/UserAvatar.d.ts +1 -1
  154. package/dist/components/user-avatar/UserAvatar.es.js +40 -38
  155. package/dist/components/user-avatar/UserAvatar.es.js.map +1 -1
  156. package/dist/components/user-avatar/constants.cjs.js +1 -1
  157. package/dist/components/user-avatar/constants.cjs.js.map +1 -1
  158. package/dist/components/user-avatar/constants.d.ts +1 -0
  159. package/dist/components/user-avatar/constants.es.js +10 -9
  160. package/dist/components/user-avatar/constants.es.js.map +1 -1
  161. package/dist/design-system.css +1 -1
  162. package/dist/index.d.ts +1 -1
  163. package/package.json +2 -3
@@ -1 +1 @@
1
- {"version":3,"file":"SelectField.es.js","sources":["../../../../src/components/forms/select-field/SelectField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Select as AntDSelect, Skeleton } from \"antd\";\nimport type { SelectProps } from \"antd\";\nimport \"./SelectField.css\";\nimport classNames from \"classnames\";\nimport debounce from \"lodash/debounce\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ReactNode } from \"react\";\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 { Tag } from \"../../data-display/tag/Tag\";\nimport { BoltOutlined, NoteAddOutlined } 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 * Label-value pair for select options\n */\nexport type TLabelValue = { label: string; value: string; icon?: JSX.Element };\n\n/**\n * Select option interface\n */\nexport interface SelectOption {\n label: string | any;\n value: string | number;\n color?: string;\n}\n\ntype TagRender = SelectProps[\"tagRender\"];\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 SelectField component\n */\nexport interface SelectFieldProps extends Omit<SelectProps, \"onChange\"> {\n /** Select mode - multiple or tags */\n mode?: \"multiple\" | \"tags\";\n /** The label text to display above the select */\n label?: string | ReactNode;\n /** Current value of the select */\n value?: string | string[] | SelectOption | SelectOption[] | any;\n /** Array of select options */\n selectOptions?: SelectOption[];\n /** Whether content is loading */\n hasContentLoading?: boolean;\n /** Callback function called when the select value changes */\n onChange?: (value: any) => void;\n /** Callback function for search */\n onSearch?: (searchValue: string) => void;\n /** Callback function for scroll */\n onScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;\n /** Callback function for input change */\n onInputChange?: (newValue: string) => void;\n /** Debounce timeout for search */\n debounceTimeout?: number;\n /** Error message to display */\n errorMessage?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Tags to display with the label */\n tags?: (string | LabelType)[];\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 to preserve original case in the label */\n originalCase?: boolean;\n /** Whether this is a GTN (Global Technical Name) field */\n isGTN?: boolean;\n /** GTN name for the field */\n gtnName?: any;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Whether the field is hovered */\n isHovered?: boolean;\n /** Whether to enable filter option */\n filterOption?: boolean;\n /** Whether the select is loading */\n isLoading?: boolean;\n /** Whether to auto clear search value */\n autoClearSearchValue?: boolean;\n /** Whether to show label with full opacity */\n fullOpacityLabel?: boolean;\n /** Color for the select */\n color?: string;\n /** Whether to show all tags */\n showAllTags?: boolean;\n /** Custom tag render function */\n customTagRender?: TagRender;\n /** Custom inline styles for the select */\n inputStyles?: React.CSSProperties;\n /** Whether the select is disabled */\n disabled?: boolean;\n /** Whether to show select all option */\n showSelectAll?: boolean;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Additional CSS classes for the wrapper */\n className?: string;\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 /** Add to document icon component */\n AddToDocumentIcon?: React.ComponentType<{\n fontSize?: number;\n color?: string;\n }>;\n /** Primary color shades for styling */\n primaryColorShades?: Record<number, string>;\n /** User avatar component for option rendering */\n UserAvatar?: React.ComponentType<{\n firstName: string;\n lastName: string;\n profilePic: string;\n size: string;\n enablePopper: boolean;\n userId: string;\n }>;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Whether this is a live field */\n isLiveField?: boolean;\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 * Parse value type alias for return type\n */\ntype ParsedValue = string | number | string[] | number[] | SelectOption | null;\n\n/**\n * Parse value to the correct format for Ant Design Select\n */\nconst parseValue = (\n value: string | string[] | SelectOption | SelectOption[]\n): ParsedValue => {\n if (Array.isArray(value)) {\n return value.map((item) =>\n typeof item === \"string\" || typeof item === \"number\" ? item : item.value\n ) as string[] | number[];\n }\n\n return value || null;\n};\n\n/**\n * Remove duplicate options\n */\nconst removeDuplicates = (arr: any[]) => {\n return arr.filter(\n (item: { value: any; label: any }, index: any, self: any[]) => {\n return (\n self.findIndex(\n (t: { value: any; label: any }) =>\n t.value === item.value && t.label === item.label\n ) === index\n );\n }\n );\n};\n\n/**\n * Prepare options from various input formats\n */\nconst prepareOptions = ({\n options,\n value,\n defaultValue,\n}: {\n options?: SelectOption[];\n value: string | string[] | SelectOption | SelectOption[];\n defaultValue?: string | string[] | SelectOption | SelectOption[];\n}): SelectOption[] => {\n if (options?.length) {\n return removeDuplicates(\n options.map((opt) => ({ ...opt, color: opt.color }))\n );\n }\n\n if (\n Array.isArray(value) &&\n value.length &&\n typeof value[0] === \"object\" &&\n \"label\" in value[0]\n ) {\n return value.map((item: any) => ({\n label: String(item?.label || \"\"),\n value: String(item?.value || \"\"),\n color: item?.color,\n }));\n }\n\n if (value && typeof value === \"object\" && \"label\" in value) {\n return [\n {\n label: String((value as any).label || \"\"),\n value: String((value as any).value || \"\"),\n color: (value as any)?.color,\n },\n ];\n }\n\n if (\n Array.isArray(defaultValue) &&\n defaultValue.length &&\n typeof defaultValue[0] === \"object\" &&\n \"label\" in defaultValue[0]\n ) {\n return defaultValue.map((item: any) => ({\n label: String(item?.label || \"\"),\n value: String(item?.value || \"\"),\n color: item?.color,\n }));\n }\n\n if (\n defaultValue &&\n typeof defaultValue === \"object\" &&\n \"label\" in defaultValue\n ) {\n return [\n {\n label: String((defaultValue as any).label || \"\"),\n value: String((defaultValue as any).value || \"\"),\n color: (defaultValue as any)?.color,\n },\n ];\n }\n\n return [];\n};\n\n/**\n * Loading indicator component for select dropdown\n */\nconst LoadingIndicator = ({\n hasExistingData,\n}: {\n hasExistingData: boolean;\n}) => (\n <div className=\"!w-full px-3 py-1.5\">\n {hasExistingData ? (\n <Skeleton paragraph={{ rows: 1, width: \"100%\" }} />\n ) : (\n <Skeleton />\n )}\n </div>\n);\n\n/**\n * Props for SelectPopupRender component\n */\ninterface SelectPopupRenderProps {\n showSelectAll: boolean;\n mode?: \"multiple\" | \"tags\";\n options: SelectOption[];\n searchValue: string;\n handleSelectAll: () => void;\n isAllSelected: boolean;\n menu: ReactNode;\n isLoading: boolean;\n hasExistingData: boolean;\n t: (key: string) => string;\n}\n\n/**\n * SelectPopupRender component - Renders the custom popup content for the select dropdown\n */\nconst SelectPopupRender = ({\n showSelectAll,\n mode,\n options,\n searchValue,\n handleSelectAll,\n isAllSelected,\n menu,\n isLoading,\n hasExistingData,\n t,\n}: SelectPopupRenderProps) => (\n <>\n {showSelectAll &&\n mode === \"multiple\" &&\n options.length > 0 &&\n searchValue.trim().length === 0 && (\n <div\n role=\"button\"\n tabIndex={0}\n className=\"px-3 py-2 border-b border-gray-200 dark:border-gray-600 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700\"\n onClick={(e) => {\n e.stopPropagation();\n handleSelectAll();\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n handleSelectAll();\n }\n }}\n >\n <Typography\n size=\"small\"\n variant=\"semibold\"\n className=\"text-primary-600 dark:text-primary-300\"\n appearance=\"custom\"\n >\n {isAllSelected ? t(\"Deselect all\") : t(\"Select all\")}\n </Typography>\n </div>\n )}\n {menu}\n {isLoading && <LoadingIndicator hasExistingData={hasExistingData} />}\n </>\n);\n\n/**\n * SelectField component - A feature-rich select dropdown with multi-select, tags, search, and more\n *\n * @example\n * ```tsx\n * <SelectField\n * label=\"Country\"\n * value=\"us\"\n * selectOptions={[\n * { label: 'United States', value: 'us' },\n * { label: 'Canada', value: 'ca' }\n * ]}\n * onChange={(value) => console.log(value)}\n * />\n *\n * <SelectField\n * label=\"Tags\"\n * mode=\"multiple\"\n * value={['tag1', 'tag2']}\n * selectOptions={tagOptions}\n * onChange={(values) => console.log(values)}\n * />\n * ```\n */\nexport const SelectField = forwardRef<HTMLDivElement, SelectFieldProps>(\n (\n {\n label,\n value: valueProp,\n mode,\n errorMessage,\n selectOptions = [],\n required = false,\n tags,\n className,\n onInputChange,\n tooltip,\n originalCase = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName: _gtnName = null,\n onChange,\n onSearch,\n debounceTimeout = 500,\n filterOption = true,\n onScroll,\n isLoading = false,\n allowClear = true,\n autoClearSearchValue = true,\n fullOpacityLabel: _fullOpacityLabel = false,\n showAllTags = false,\n customTagRender,\n inputStyles: _inputStyles,\n disabled = false,\n showSelectAll = false,\n labelClassName,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n AddToDocumentIcon: _AddToDocumentIcon,\n primaryColorShades: _primaryColorShades,\n UserAvatar,\n onAddGTNToDocument,\n isRequiredConditional,\n isLiveField = false,\n labelExtra,\n inputEmphasis = \"default\",\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const [isHoveredState, setIsHoveredState] = useState(false);\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const selectRef = useRef<HTMLDivElement>(null);\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const [searchValue, setSearchValue] = useState(\"\");\n\n useEffect(() => {\n const styleId = \"select-field-scrollbar-styles\";\n if (document.getElementById(styleId)) return;\n const style = document.createElement(\"style\");\n style.id = styleId;\n style.textContent = `\n [class*=\"virtual-list-scrollbar\"]:not([class*=\"thumb\"]) {\n width: 8px !important;\n background: transparent !important;\n }\n [class*=\"virtual-list-scrollbar-thumb\"] {\n background: rgba(0, 0, 0, 0.2) !important;\n border-radius: 6px !important;\n }\n .dark [class*=\"virtual-list-scrollbar-thumb\"] {\n background: #454545 !important;\n }\n `;\n document.head.appendChild(style);\n }, []);\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n let _value: string = \"\";\n\n if (value == null) {\n _value = \"\";\n } else if (typeof value === \"string\" || typeof value === \"number\") {\n _value = String(value);\n } else if (Array.isArray(value)) {\n // If array of SelectOption, string, or number\n _value = value\n .map((item) =>\n typeof item === \"object\" && item !== null && \"value\" in item\n ? (item as { value: string | number }).value\n : item\n )\n .join(\", \");\n } else if (typeof value === \"object\" && \"value\" in value) {\n _value = String(value.value);\n }\n\n const keyValuePair = {\n key: _gtnName,\n value: _value,\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const value = parseValue(valueProp);\n const debounceFetcher = useMemo(\n () => (onSearch ? debounce(onSearch, debounceTimeout) : null),\n [onSearch, debounceTimeout]\n );\n\n const handleChange = (\n _newValue: string | string[],\n selectedOptions: any\n ) => {\n if (selectRef.current && props.id) {\n const containerElement = document.getElementById(props.id);\n if (containerElement) {\n const valueToStore = Array.isArray(selectedOptions)\n ? selectedOptions.map((opt: any) => opt.value)\n : selectedOptions?.value;\n\n containerElement.dataset.selectedValue = JSON.stringify(valueToStore);\n const changeEvent = new Event(\"change\", { bubbles: true });\n\n Object.defineProperty(changeEvent, \"target\", {\n writable: false,\n value: containerElement,\n });\n\n containerElement.dispatchEvent(changeEvent);\n\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${props.id}`,\n value: valueToStore,\n type: \"change\",\n },\n });\n containerElement.dispatchEvent(pilotEvent);\n }\n }\n\n if (mode === \"tags\") {\n const _values = Array.isArray(_newValue) ? _newValue : [_newValue];\n onChange?.(_values?.map((item) => ({ label: item, value: item })));\n } else {\n onChange?.(selectedOptions);\n }\n };\n\n const options = prepareOptions({\n options: selectOptions,\n value: valueProp,\n defaultValue: props?.defaultValue,\n });\n\n const hasExistingData = useMemo(() => {\n return options.length > 0 || (value !== null && value !== undefined);\n }, [options, value]);\n\n const isAllSelected = useMemo(() => {\n if (!mode || mode !== \"multiple\" || options.length === 0) return false;\n\n const currentValues = Array.isArray(value) ? value : [];\n const allOptionValues = options.map((option) => option.value);\n\n return allOptionValues.every((optionValue) =>\n currentValues.some((currentValue: any) =>\n typeof currentValue === \"object\" &&\n currentValue !== null &&\n \"value\" in currentValue\n ? String(currentValue.value) === String(optionValue)\n : String(currentValue) === String(optionValue)\n )\n );\n }, [value, options, mode]);\n\n const handleSelectAll = () => {\n if (!mode || mode !== \"multiple\" || !onChange) return;\n\n onChange(isAllSelected ? [] : options);\n };\n\n const triggerSubmit = useCallback((formEl: HTMLFormElement | null) => {\n if (!formEl) return;\n\n const submitEvent = new Event(\"submit\", {\n bubbles: true,\n cancelable: true,\n });\n formEl.dispatchEvent(submitEvent);\n\n const submitBtn = formEl.querySelector<HTMLButtonElement>(\n 'button[type=\"submit\"]'\n );\n if (submitBtn) {\n submitBtn.click();\n }\n }, []);\n\n const handleKeyDownCapture = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" && !isDropdownOpen) {\n e.preventDefault();\n e.stopPropagation();\n\n if (value) {\n const form = e.currentTarget.closest(\"form\") as HTMLFormElement;\n triggerSubmit(form);\n }\n }\n },\n [isDropdownOpen, value, triggerSubmit]\n );\n\n const tagRender: TagRender = useCallback(\n (renderProps: any) => {\n const { label: tagLabel, value: tagValue, onClose } = renderProps;\n\n const option = options.find(\n (opt) => String(opt.value) === String(tagValue)\n );\n const tagColor = option?.color || \"primary\";\n\n const onPreventMouseDown = (\n event: React.MouseEvent<HTMLSpanElement>\n ) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n return (\n <div className=\"cursor-pointer me-1 inline-flex\">\n <Tag\n label={tagLabel as string}\n color={tagColor}\n className=\"!px-0.5 !py-0 !rounded\"\n size=\"md\"\n onMouseDown={onPreventMouseDown}\n onClick={disabled ? undefined : onClose}\n isHashColor\n removable\n onRemove={onClose}\n />\n </div>\n );\n },\n [options, disabled]\n );\n\n const handleOnInputChange = useCallback(\n (value: string) => {\n setSearchValue(value);\n (onInputChange || debounceFetcher)?.(value);\n },\n [onInputChange, debounceFetcher]\n );\n\n return (\n <div\n ref={ref}\n className={classNames(\n \"flex gap-0.5 w-full relative\",\n isHoveredState && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHoveredState(true)}\n onMouseLeave={() => setIsHoveredState(false)}\n id={props.id}\n >\n {isGTN && !isHoveredState ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div\n className={classNames(\n \"w-full flex flex-col gap-1 risk-analysis-select-field\",\n className\n )}\n onMouseDown={(e) => e.stopPropagation()}\n onKeyDownCapture={handleKeyDownCapture}\n role=\"group\"\n aria-labelledby={label ? \"select-field-label\" : undefined}\n >\n {label ? (\n <label\n id=\"select-field-label\"\n htmlFor=\"label\"\n className={`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${!originalCase ? \"capitalize\" : \"\"} ${\n labelClassName || \"\"\n }`}\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\n label={label || \"\"}\n required={required || false}\n isRequiredConditional={isRequiredConditional || false}\n />\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 <Tooltip 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 // Tooltip will show on focus\n }\n }}\n >\n <HelpIcon />\n </div>\n </Tooltip>\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={classNames(\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={classNames(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHoveredState ? (\n <button\n id=\"btn-select-field-base-add-to-document\"\n className=\"cursor-pointer\"\n onClick={handleAddGTNToDocument}\n type=\"button\"\n >\n <Tooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n className=\"text-primary-600\"\n sx={{ fontSize: 16 }}\n />\n </Tooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n ) : null}\n <AntDSelect\n onOpenChange={setIsDropdownOpen}\n disabled={disabled}\n className={`w-full text-black-900 dark:text-black-200 ${errorMessage && required ? \"ant-select-status-error\" : \"#e2e8f0\"} ${\n isRiskAnalysisOpen && riskDetails?.color\n ? \"risk-select-field\"\n : \"\"\n } ${\n emphasisModifiedSkin ? \"select-field-emphasis-modified\" :\n emphasisDeletedSkin ? \"select-field-emphasis-deleted\" :\n emphasisSuccessSkin ? \"select-field-emphasis-success\" : \"\"\n }`}\n classNames={{\n popup: {\n root: \"!z-[5001]\",\n },\n }}\n style={\n {\n width: \"100%\",\n \"--risk-color\":\n isRiskAnalysisOpen && riskDetails?.hexBgColor\n ? riskDetails?.hexBgColor\n : \"\",\n \"--risk-border-color\":\n isRiskAnalysisOpen && riskDetails?.hexBorderColor\n ? riskDetails?.hexBorderColor\n : \"\",\n } as React.CSSProperties\n }\n aria-required={required}\n mode={mode}\n value={value as string | string[] | null | undefined}\n onChange={handleChange}\n filterOption={\n onSearch\n ? filterOption\n : (input, option) =>\n ((option?.label as string) || \"\")\n ?.toLowerCase()\n ?.includes(input?.toLowerCase())\n }\n showSearch\n onSearch={handleOnInputChange || undefined}\n onPopupScroll={onScroll}\n popupClassName=\"select-field-dropdown-popup\"\n popupRender={(menu) => (\n <SelectPopupRender\n showSelectAll={showSelectAll}\n mode={mode}\n options={options}\n searchValue={searchValue}\n handleSelectAll={handleSelectAll}\n isAllSelected={isAllSelected}\n menu={menu}\n isLoading={isLoading}\n hasExistingData={hasExistingData}\n t={t}\n />\n )}\n options={options.map(\n ({\n label: optionLabel,\n value: optionValue,\n color: optionColor,\n ...rest\n }) => ({\n label: String(optionLabel),\n value: String(optionValue),\n key: String(optionValue),\n id: String(optionValue),\n color: optionColor,\n ...rest,\n })\n )}\n optionRender={(option) => {\n const fullname = option?.data?.fullname;\n\n if (fullname && UserAvatar) {\n const [firstName, lastName] = fullname.split(\" \");\n\n return (\n <div className=\"flex items-center justify-start gap-1\">\n <UserAvatar\n firstName={firstName}\n lastName={lastName}\n profilePic={option?.data?.url || \"\"}\n size=\"xs\"\n enablePopper={true}\n userId={option?.data?.value as string}\n />\n <span className=\"ml-2\">{option.label}</span>\n </div>\n );\n }\n return <span>{option.label}</span>;\n }}\n autoClearSearchValue={autoClearSearchValue}\n onClear={() =>\n onChange &&\n onChange(mode === \"tags\" || mode === \"multiple\" ? [] : null)\n }\n maxTagCount={\n mode === \"tags\" && showAllTags ? undefined : \"responsive\"\n }\n maxTagPlaceholder={(omittedValues) => (\n <Tooltip\n placement=\"top\"\n title={\n omittedValues.length > 3\n ? omittedValues\n .slice(0, 3)\n .map(({ label: l }) => l)\n .join(\", \") + \"...\"\n : omittedValues.map(({ label: l }) => l).join(\", \")\n }\n >\n <span>+{omittedValues.length} more</span>\n </Tooltip>\n )}\n tagRender={customTagRender || tagRender}\n allowClear={allowClear}\n {...props}\n />\n {errorMessage && (\n <Typography\n className=\"text-error-500\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n\n {isHoveredState &&\n riskDetails &&\n isRiskAnalysisOpen &&\n 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 setIsHoveredState(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nSelectField.displayName = \"SelectField\";\n"],"names":["parseValue","value","item","removeDuplicates","arr","index","self","t","prepareOptions","options","defaultValue","opt","LoadingIndicator","hasExistingData","Skeleton","jsx","SelectPopupRender","showSelectAll","mode","searchValue","handleSelectAll","isAllSelected","menu","isLoading","jsxs","Fragment","e","Typography","SelectField","forwardRef","label","valueProp","errorMessage","selectOptions","required","tags","className","onInputChange","tooltip","originalCase","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","_gtnName","onChange","onSearch","debounceTimeout","filterOption","onScroll","allowClear","autoClearSearchValue","_fullOpacityLabel","showAllTags","customTagRender","_inputStyles","disabled","labelClassName","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","_AddToDocumentIcon","_primaryColorShades","UserAvatar","onAddGTNToDocument","isRequiredConditional","isLiveField","labelExtra","inputEmphasis","props","ref","useTranslation","isHoveredState","setIsHoveredState","useState","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","selectRef","useRef","isDropdownOpen","setIsDropdownOpen","setSearchValue","useEffect","styleId","style","handleAddGTNToDocument","_value","debounceFetcher","useMemo","debounce","handleChange","_newValue","selectedOptions","containerElement","valueToStore","changeEvent","pilotEvent","_values","currentValues","option","optionValue","currentValue","triggerSubmit","useCallback","formEl","submitEvent","submitBtn","handleKeyDownCapture","form","tagRender","renderProps","tagLabel","tagValue","onClose","tagColor","Tag","event","handleOnInputChange","classNames","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","NoteAddOutlined","AntDSelect","input","optionLabel","optionColor","rest","fullname","firstName","lastName","omittedValues","l"],"mappings":";;;;;;;;;;;;;;;;;AAoNA,MAAMA,KAAa,CACjBC,MAEI,MAAM,QAAQA,CAAK,IACdA,EAAM;AAAA,EAAI,CAACC,MAChB,OAAOA,KAAS,YAAY,OAAOA,KAAS,WAAWA,IAAOA,EAAK;AAAA,IAIhED,KAAS,MAMZE,KAAmB,CAACC,MACjBA,EAAI;AAAA,EACT,CAACF,GAAkCG,GAAYC,MAE3CA,EAAK;AAAA,IACH,CAACC,MACCA,EAAE,UAAUL,EAAK,SAASK,EAAE,UAAUL,EAAK;AAAA,EAAA,MACzCG;AAEV,GAOEG,KAAiB,CAAC;AAAA,EACtB,SAAAC;AAAA,EACA,OAAAR;AAAA,EACA,cAAAS;AACF,MAKMD,GAAS,SACJN;AAAA,EACLM,EAAQ,IAAI,CAACE,OAAS,EAAE,GAAGA,GAAK,OAAOA,EAAI,QAAQ;AAAA,IAKrD,MAAM,QAAQV,CAAK,KACnBA,EAAM,UACN,OAAOA,EAAM,CAAC,KAAM,YACpB,WAAWA,EAAM,CAAC,IAEXA,EAAM,IAAI,CAACC,OAAe;AAAA,EAC/B,OAAO,OAAOA,GAAM,SAAS,EAAE;AAAA,EAC/B,OAAO,OAAOA,GAAM,SAAS,EAAE;AAAA,EAC/B,OAAOA,GAAM;AAAA,EACb,IAGAD,KAAS,OAAOA,KAAU,YAAY,WAAWA,IAC5C;AAAA,EACL;AAAA,IACE,OAAO,OAAQA,EAAc,SAAS,EAAE;AAAA,IACxC,OAAO,OAAQA,EAAc,SAAS,EAAE;AAAA,IACxC,OAAQA,GAAe;AAAA,EAAA;AACzB,IAKF,MAAM,QAAQS,CAAY,KAC1BA,EAAa,UACb,OAAOA,EAAa,CAAC,KAAM,YAC3B,WAAWA,EAAa,CAA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OACEgB,EAAc,SAAS,IACnBA,EACG,MAAM,GAAG,CAAC,EACV,IAAI,CAAC,EAAE,OAAOC,EAAA,MAAQA,CAAC,EACvB,KAAK,IAAI,IAAI,QAChBD,EAAc,IAAI,CAAC,EAAE,OAAOC,EAAA,MAAQA,CAAC,EAAE,KAAK,IAAI;AAAA,wBAGtD,4BAAC,QAAA,EAAK,UAAA;AAAA,0BAAA;AAAA,0BAAED,EAAc;AAAA,0BAAO;AAAA,wBAAA,EAAA,CAAK;AAAA,sBAAA;AAAA,oBAAA;AAAA,oBAGtC,WAAWvF,MAAmBwD;AAAA,oBAC9B,YAAA5D;AAAA,oBACC,GAAGmB;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAELxC,KACC,gBAAAjB;AAAA,kBAACY;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,YAAW;AAAA,oBACX,MAAK;AAAA,oBACL,SAAQ;AAAA,oBAEP,UAAAK;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA;AAAA,UAAA;AAAA,UAIH2C,KACCd,KACAC,KACAC,KACE,gBAAAhD;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,YACZ6D,EAAkB,EAAK;AAAA,cAE3B;AAAA,cAEA,UAAA,gBAAA7D,EAACgD,KAAgB,aAAAF,EAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,EAIV;AACF;AAEAjC,GAAY,cAAc;"}
1
+ {"version":3,"file":"SelectField.es.js","sources":["../../../../src/components/forms/select-field/SelectField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Select as AntDSelect, Skeleton } from \"antd\";\nimport type { SelectProps } from \"antd\";\nimport \"./SelectField.css\";\nimport classNames from \"classnames\";\nimport debounce from \"lodash/debounce\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ReactNode } from \"react\";\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 { Tag } from \"../../data-display/tag/Tag\";\nimport { BoltOutlined, NoteAddOutlined } 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\n/** Height size variant for the select trigger. Maps to a Tailwind min-height class. */\nexport type SelectFieldInputSize = \"sm\" | \"md\" | \"lg\";\n\nconst INPUT_SIZE_CLASS: Record<SelectFieldInputSize, string> = {\n sm: \"[&_.ant-select-selector]:!min-h-6\", // 24px\n md: \"[&_.ant-select-selector]:!min-h-8\", // 32px\n lg: \"[&_.ant-select-selector]:!min-h-10\", // 40px\n};\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 * Label-value pair for select options\n */\nexport type TLabelValue = { label: string; value: string; icon?: JSX.Element };\n\n/**\n * Select option interface\n */\nexport interface SelectOption {\n label: string | any;\n value: string | number;\n color?: string;\n}\n\ntype TagRender = SelectProps[\"tagRender\"];\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 SelectField component\n */\nexport interface SelectFieldProps extends Omit<SelectProps, \"onChange\"> {\n /** Select mode - multiple or tags */\n mode?: \"multiple\" | \"tags\";\n /** The label text to display above the select */\n label?: string | ReactNode;\n /** Current value of the select */\n value?: string | string[] | SelectOption | SelectOption[] | any;\n /** Array of select options */\n selectOptions?: SelectOption[];\n /** Whether content is loading */\n hasContentLoading?: boolean;\n /** Callback function called when the select value changes */\n onChange?: (value: any) => void;\n /** Callback function for search */\n onSearch?: (searchValue: string) => void;\n /** Callback function for scroll */\n onScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;\n /** Callback function for input change */\n onInputChange?: (newValue: string) => void;\n /** Debounce timeout for search */\n debounceTimeout?: number;\n /** Error message to display */\n errorMessage?: string;\n /** Whether the field is required */\n required?: boolean;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Tags to display with the label */\n tags?: (string | LabelType)[];\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 to preserve original case in the label */\n originalCase?: boolean;\n /** Whether this is a GTN (Global Technical Name) field */\n isGTN?: boolean;\n /** GTN name for the field */\n gtnName?: any;\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Whether the field is hovered */\n isHovered?: boolean;\n /** Whether to enable filter option */\n filterOption?: boolean;\n /** Whether the select is loading */\n isLoading?: boolean;\n /** Whether to auto clear search value */\n autoClearSearchValue?: boolean;\n /** Whether to show label with full opacity */\n fullOpacityLabel?: boolean;\n /** Color for the select */\n color?: string;\n /** Whether to show all tags */\n showAllTags?: boolean;\n /** Custom tag render function */\n customTagRender?: TagRender;\n /** Custom inline styles for the select */\n inputStyles?: React.CSSProperties;\n /** Whether the select is disabled */\n disabled?: boolean;\n /** Whether to show select all option */\n showSelectAll?: boolean;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Additional CSS classes for the wrapper */\n className?: string;\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 /** Add to document icon component */\n AddToDocumentIcon?: React.ComponentType<{\n fontSize?: number;\n color?: string;\n }>;\n /** Primary color shades for styling */\n primaryColorShades?: Record<number, string>;\n /** User avatar component for option rendering */\n UserAvatar?: React.ComponentType<{\n firstName: string;\n lastName: string;\n profilePic: string;\n size: string;\n enablePopper: boolean;\n userId: string;\n }>;\n /** Whether the required indicator shows as conditional (yellow instead of red) */\n isRequiredConditional?: boolean;\n /** Whether this is a live field */\n isLiveField?: boolean;\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 /** Height size of the select trigger. `'sm'` = 24px, `'md'` = 32px (default), `'lg'` = 40px. */\n inputSize?: SelectFieldInputSize;\n}\n\n/**\n * Parse value type alias for return type\n */\ntype ParsedValue = string | number | string[] | number[] | SelectOption | null;\n\n/**\n * Parse value to the correct format for Ant Design Select\n */\nconst parseValue = (\n value: string | string[] | SelectOption | SelectOption[]\n): ParsedValue => {\n if (Array.isArray(value)) {\n return value.map((item) =>\n typeof item === \"string\" || typeof item === \"number\" ? item : item.value\n ) as string[] | number[];\n }\n\n return value || null;\n};\n\n/**\n * Remove duplicate options\n */\nconst removeDuplicates = (arr: any[]) => {\n return arr.filter(\n (item: { value: any; label: any }, index: any, self: any[]) => {\n return (\n self.findIndex(\n (t: { value: any; label: any }) =>\n t.value === item.value && t.label === item.label\n ) === index\n );\n }\n );\n};\n\n/**\n * Prepare options from various input formats\n */\nconst prepareOptions = ({\n options,\n value,\n defaultValue,\n}: {\n options?: SelectOption[];\n value: string | string[] | SelectOption | SelectOption[];\n defaultValue?: string | string[] | SelectOption | SelectOption[];\n}): SelectOption[] => {\n if (options?.length) {\n return removeDuplicates(\n options.map((opt) => ({ ...opt, color: opt.color }))\n );\n }\n\n if (\n Array.isArray(value) &&\n value.length &&\n typeof value[0] === \"object\" &&\n \"label\" in value[0]\n ) {\n return value.map((item: any) => ({\n label: String(item?.label || \"\"),\n value: String(item?.value || \"\"),\n color: item?.color,\n }));\n }\n\n if (value && typeof value === \"object\" && \"label\" in value) {\n return [\n {\n label: String((value as any).label || \"\"),\n value: String((value as any).value || \"\"),\n color: (value as any)?.color,\n },\n ];\n }\n\n if (\n Array.isArray(defaultValue) &&\n defaultValue.length &&\n typeof defaultValue[0] === \"object\" &&\n \"label\" in defaultValue[0]\n ) {\n return defaultValue.map((item: any) => ({\n label: String(item?.label || \"\"),\n value: String(item?.value || \"\"),\n color: item?.color,\n }));\n }\n\n if (\n defaultValue &&\n typeof defaultValue === \"object\" &&\n \"label\" in defaultValue\n ) {\n return [\n {\n label: String((defaultValue as any).label || \"\"),\n value: String((defaultValue as any).value || \"\"),\n color: (defaultValue as any)?.color,\n },\n ];\n }\n\n return [];\n};\n\n/**\n * Loading indicator component for select dropdown\n */\nconst LoadingIndicator = ({\n hasExistingData,\n}: {\n hasExistingData: boolean;\n}) => (\n <div className=\"!w-full px-3 py-1.5\">\n {hasExistingData ? (\n <Skeleton paragraph={{ rows: 1, width: \"100%\" }} />\n ) : (\n <Skeleton />\n )}\n </div>\n);\n\n/**\n * Props for SelectPopupRender component\n */\ninterface SelectPopupRenderProps {\n showSelectAll: boolean;\n mode?: \"multiple\" | \"tags\";\n options: SelectOption[];\n searchValue: string;\n handleSelectAll: () => void;\n isAllSelected: boolean;\n menu: ReactNode;\n isLoading: boolean;\n hasExistingData: boolean;\n t: (key: string) => string;\n}\n\n/**\n * SelectPopupRender component - Renders the custom popup content for the select dropdown\n */\nconst SelectPopupRender = ({\n showSelectAll,\n mode,\n options,\n searchValue,\n handleSelectAll,\n isAllSelected,\n menu,\n isLoading,\n hasExistingData,\n t,\n}: SelectPopupRenderProps) => (\n <>\n {showSelectAll &&\n mode === \"multiple\" &&\n options.length > 0 &&\n searchValue.trim().length === 0 && (\n <div\n role=\"button\"\n tabIndex={0}\n className=\"px-3 py-2 border-b border-gray-200 dark:border-gray-600 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700\"\n onClick={(e) => {\n e.stopPropagation();\n handleSelectAll();\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n handleSelectAll();\n }\n }}\n >\n <Typography\n size=\"small\"\n variant=\"semibold\"\n className=\"text-primary-600 dark:text-primary-300\"\n appearance=\"custom\"\n >\n {isAllSelected ? t(\"Deselect all\") : t(\"Select all\")}\n </Typography>\n </div>\n )}\n {menu}\n {isLoading && <LoadingIndicator hasExistingData={hasExistingData} />}\n </>\n);\n\n/**\n * SelectField component - A feature-rich select dropdown with multi-select, tags, search, and more\n *\n * @example\n * ```tsx\n * <SelectField\n * label=\"Country\"\n * value=\"us\"\n * selectOptions={[\n * { label: 'United States', value: 'us' },\n * { label: 'Canada', value: 'ca' }\n * ]}\n * onChange={(value) => console.log(value)}\n * />\n *\n * <SelectField\n * label=\"Tags\"\n * mode=\"multiple\"\n * value={['tag1', 'tag2']}\n * selectOptions={tagOptions}\n * onChange={(values) => console.log(values)}\n * />\n * ```\n */\nexport const SelectField = forwardRef<HTMLDivElement, SelectFieldProps>(\n (\n {\n label,\n value: valueProp,\n mode,\n errorMessage,\n selectOptions = [],\n required = false,\n tags,\n className,\n onInputChange,\n tooltip,\n originalCase = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n isGTN = false,\n gtnName: _gtnName = null,\n onChange,\n onSearch,\n debounceTimeout = 500,\n filterOption = true,\n onScroll,\n isLoading = false,\n allowClear = true,\n autoClearSearchValue = true,\n fullOpacityLabel: _fullOpacityLabel = false,\n showAllTags = false,\n customTagRender,\n inputStyles: _inputStyles,\n disabled = false,\n showSelectAll = false,\n labelClassName,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n AddToDocumentIcon: _AddToDocumentIcon,\n primaryColorShades: _primaryColorShades,\n UserAvatar,\n onAddGTNToDocument,\n isRequiredConditional,\n isLiveField = false,\n labelExtra,\n inputEmphasis = \"default\",\n inputSize = \"md\",\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const [isHoveredState, setIsHoveredState] = useState(false);\n const emphasisModifiedSkin = inputEmphasis === \"modified\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisDeletedSkin = inputEmphasis === \"deleted\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisSuccessSkin = inputEmphasis === \"success\" && !errorMessage && !(isRiskAnalysisOpen && riskDetails?.color);\n const selectRef = useRef<HTMLDivElement>(null);\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const [searchValue, setSearchValue] = useState(\"\");\n\n useEffect(() => {\n const styleId = \"select-field-scrollbar-styles\";\n if (document.getElementById(styleId)) return;\n const style = document.createElement(\"style\");\n style.id = styleId;\n style.textContent = `\n [class*=\"virtual-list-scrollbar\"]:not([class*=\"thumb\"]) {\n width: 8px !important;\n background: transparent !important;\n }\n [class*=\"virtual-list-scrollbar-thumb\"] {\n background: rgba(0, 0, 0, 0.2) !important;\n border-radius: 6px !important;\n }\n .dark [class*=\"virtual-list-scrollbar-thumb\"] {\n background: #454545 !important;\n }\n `;\n document.head.appendChild(style);\n }, []);\n\n const handleAddGTNToDocument = () => {\n if (onAddGTNToDocument) {\n let _value: string = \"\";\n\n if (value == null) {\n _value = \"\";\n } else if (typeof value === \"string\" || typeof value === \"number\") {\n _value = String(value);\n } else if (Array.isArray(value)) {\n // If array of SelectOption, string, or number\n _value = value\n .map((item) =>\n typeof item === \"object\" && item !== null && \"value\" in item\n ? (item as { value: string | number }).value\n : item\n )\n .join(\", \");\n } else if (typeof value === \"object\" && \"value\" in value) {\n _value = String(value.value);\n }\n\n const keyValuePair = {\n key: _gtnName,\n value: _value,\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n const value = parseValue(valueProp);\n const debounceFetcher = useMemo(\n () => (onSearch ? debounce(onSearch, debounceTimeout) : null),\n [onSearch, debounceTimeout]\n );\n\n const handleChange = (\n _newValue: string | string[],\n selectedOptions: any\n ) => {\n if (selectRef.current && props.id) {\n const containerElement = document.getElementById(props.id);\n if (containerElement) {\n const valueToStore = Array.isArray(selectedOptions)\n ? selectedOptions.map((opt: any) => opt.value)\n : selectedOptions?.value;\n\n containerElement.dataset.selectedValue = JSON.stringify(valueToStore);\n const changeEvent = new Event(\"change\", { bubbles: true });\n\n Object.defineProperty(changeEvent, \"target\", {\n writable: false,\n value: containerElement,\n });\n\n containerElement.dispatchEvent(changeEvent);\n\n const pilotEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${props.id}`,\n value: valueToStore,\n type: \"change\",\n },\n });\n containerElement.dispatchEvent(pilotEvent);\n }\n }\n\n if (mode === \"tags\") {\n const _values = Array.isArray(_newValue) ? _newValue : [_newValue];\n onChange?.(_values?.map((item) => ({ label: item, value: item })));\n } else {\n onChange?.(selectedOptions);\n }\n };\n\n const options = prepareOptions({\n options: selectOptions,\n value: valueProp,\n defaultValue: props?.defaultValue,\n });\n\n const hasExistingData = useMemo(() => {\n return options.length > 0 || (value !== null && value !== undefined);\n }, [options, value]);\n\n const isAllSelected = useMemo(() => {\n if (!mode || mode !== \"multiple\" || options.length === 0) return false;\n\n const currentValues = Array.isArray(value) ? value : [];\n const allOptionValues = options.map((option) => option.value);\n\n return allOptionValues.every((optionValue) =>\n currentValues.some((currentValue: any) =>\n typeof currentValue === \"object\" &&\n currentValue !== null &&\n \"value\" in currentValue\n ? String(currentValue.value) === String(optionValue)\n : String(currentValue) === String(optionValue)\n )\n );\n }, [value, options, mode]);\n\n const handleSelectAll = () => {\n if (!mode || mode !== \"multiple\" || !onChange) return;\n\n onChange(isAllSelected ? [] : options);\n };\n\n const triggerSubmit = useCallback((formEl: HTMLFormElement | null) => {\n if (!formEl) return;\n\n const submitEvent = new Event(\"submit\", {\n bubbles: true,\n cancelable: true,\n });\n formEl.dispatchEvent(submitEvent);\n\n const submitBtn = formEl.querySelector<HTMLButtonElement>(\n 'button[type=\"submit\"]'\n );\n if (submitBtn) {\n submitBtn.click();\n }\n }, []);\n\n const handleKeyDownCapture = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" && !isDropdownOpen) {\n e.preventDefault();\n e.stopPropagation();\n\n if (value) {\n const form = e.currentTarget.closest(\"form\") as HTMLFormElement;\n triggerSubmit(form);\n }\n }\n },\n [isDropdownOpen, value, triggerSubmit]\n );\n\n const tagRender: TagRender = useCallback(\n (renderProps: any) => {\n const { label: tagLabel, value: tagValue, onClose } = renderProps;\n\n const option = options.find(\n (opt) => String(opt.value) === String(tagValue)\n );\n const tagColor = option?.color || \"primary\";\n\n const onPreventMouseDown = (\n event: React.MouseEvent<HTMLSpanElement>\n ) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n return (\n <div className=\"cursor-pointer me-1 inline-flex\">\n <Tag\n label={tagLabel as string}\n color={tagColor}\n className=\"!px-0.5 !py-0 !rounded\"\n size=\"md\"\n onMouseDown={onPreventMouseDown}\n onClick={disabled ? undefined : onClose}\n isHashColor\n removable\n onRemove={onClose}\n />\n </div>\n );\n },\n [options, disabled]\n );\n\n const handleOnInputChange = useCallback(\n (value: string) => {\n setSearchValue(value);\n (onInputChange || debounceFetcher)?.(value);\n },\n [onInputChange, debounceFetcher]\n );\n\n return (\n <div\n ref={ref}\n className={classNames(\n \"flex gap-0.5 w-full relative\",\n isHoveredState && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1\"\n : \"\"\n )}\n onMouseEnter={() => setIsHoveredState(true)}\n onMouseLeave={() => setIsHoveredState(false)}\n id={props.id}\n >\n {isGTN && !isHoveredState ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div\n className={classNames(\n \"w-full flex flex-col gap-1 risk-analysis-select-field\",\n className\n )}\n onMouseDown={(e) => e.stopPropagation()}\n onKeyDownCapture={handleKeyDownCapture}\n role=\"group\"\n aria-labelledby={label ? \"select-field-label\" : undefined}\n >\n {label ? (\n <label\n id=\"select-field-label\"\n htmlFor=\"label\"\n className={`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${!originalCase ? \"capitalize\" : \"\"} ${\n labelClassName || \"\"\n }`}\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\n label={label || \"\"}\n required={required || false}\n isRequiredConditional={isRequiredConditional || false}\n />\n {isLiveField && (\n <BoltOutlined className=\"!text-base text-primary-600 rotate-[15deg]\" />\n )}\n {isAiExtracted && !shouldShowConfidenceScore(confidenceScore) && <AIExtractedIndicator />}\n <Label labels={tags} />\n {tooltip && (\n <Tooltip 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 // Tooltip will show on focus\n }\n }}\n >\n <HelpIcon />\n </div>\n </Tooltip>\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={classNames(\n \"inline-flex min-w-12 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={classNames(\"text-xs font-medium leading-4\", getConfidenceScoreBadgeTextColor(confidenceType))}>\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n {isGTN && isHoveredState ? (\n <button\n id=\"btn-select-field-base-add-to-document\"\n className=\"cursor-pointer\"\n onClick={handleAddGTNToDocument}\n type=\"button\"\n >\n <Tooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined className=\"!text-base text-primary-600\" />\n </Tooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n ) : null}\n <AntDSelect\n onOpenChange={setIsDropdownOpen}\n disabled={disabled}\n className={classNames(\n \"w-full h-8 flex items-center justify-center text-black-900 dark:text-black-200 text-sm\",\n INPUT_SIZE_CLASS[inputSize],\n errorMessage && required ? \"ant-select-status-error\" : \"\",\n isRiskAnalysisOpen && riskDetails?.color ? \"risk-select-field\" : \"\",\n emphasisModifiedSkin ? \"select-field-emphasis-modified\" :\n emphasisDeletedSkin ? \"select-field-emphasis-deleted\" :\n emphasisSuccessSkin ? \"select-field-emphasis-success\" : \"\"\n )}\n classNames={{\n popup: {\n root: \"!z-[5001]\",\n },\n }}\n style={\n {\n width: \"100%\",\n \"--risk-color\":\n isRiskAnalysisOpen && riskDetails?.hexBgColor\n ? riskDetails?.hexBgColor\n : \"\",\n \"--risk-border-color\":\n isRiskAnalysisOpen && riskDetails?.hexBorderColor\n ? riskDetails?.hexBorderColor\n : \"\",\n } as React.CSSProperties\n }\n aria-required={required}\n mode={mode}\n value={value as string | string[] | null | undefined}\n onChange={handleChange}\n filterOption={\n onSearch\n ? filterOption\n : (input, option) =>\n ((option?.label as string) || \"\")\n ?.toLowerCase()\n ?.includes(input?.toLowerCase())\n }\n showSearch\n onSearch={handleOnInputChange || undefined}\n onPopupScroll={onScroll}\n popupClassName=\"select-field-dropdown-popup\"\n popupRender={(menu) => (\n <SelectPopupRender\n showSelectAll={showSelectAll}\n mode={mode}\n options={options}\n searchValue={searchValue}\n handleSelectAll={handleSelectAll}\n isAllSelected={isAllSelected}\n menu={menu}\n isLoading={isLoading}\n hasExistingData={hasExistingData}\n t={t}\n />\n )}\n options={options.map(\n ({\n label: optionLabel,\n value: optionValue,\n color: optionColor,\n ...rest\n }) => ({\n label: String(optionLabel),\n value: String(optionValue),\n key: String(optionValue),\n id: String(optionValue),\n color: optionColor,\n ...rest,\n })\n )}\n optionRender={(option) => {\n const fullname = option?.data?.fullname;\n\n if (fullname && UserAvatar) {\n const [firstName, lastName] = fullname.split(\" \");\n\n return (\n <div className=\"flex items-center justify-start gap-1\">\n <UserAvatar\n firstName={firstName}\n lastName={lastName}\n profilePic={option?.data?.url || \"\"}\n size=\"xs\"\n enablePopper={true}\n userId={option?.data?.value as string}\n />\n <span className=\"ml-2\">{option.label}</span>\n </div>\n );\n }\n return <span>{option.label}</span>;\n }}\n autoClearSearchValue={autoClearSearchValue}\n onClear={() =>\n onChange &&\n onChange(mode === \"tags\" || mode === \"multiple\" ? [] : null)\n }\n maxTagCount={\n mode === \"tags\" && showAllTags ? undefined : \"responsive\"\n }\n maxTagPlaceholder={(omittedValues) => (\n <Tooltip\n placement=\"top\"\n title={\n omittedValues.length > 3\n ? omittedValues\n .slice(0, 3)\n .map(({ label: l }) => l)\n .join(\", \") + \"...\"\n : omittedValues.map(({ label: l }) => l).join(\", \")\n }\n >\n <span>+{omittedValues.length} more</span>\n </Tooltip>\n )}\n tagRender={customTagRender || tagRender}\n allowClear={allowClear}\n {...props}\n />\n {errorMessage && (\n <Typography\n className=\"text-error-500\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n )}\n </div>\n\n {isHoveredState &&\n riskDetails &&\n isRiskAnalysisOpen &&\n 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 setIsHoveredState(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nSelectField.displayName = \"SelectField\";\n"],"names":["INPUT_SIZE_CLASS","parseValue","value","item","removeDuplicates","arr","index","self","t","prepareOptions","options","defaultValue","opt","LoadingIndicator","hasExistingData","Skeleton","jsx","SelectPopupRender","showSelectAll","mode","searchValue","handleSelectAll","isAllSelected","menu","isLoading","jsxs","Fragment","e","Typography","SelectField","forwardRef","label","valueProp","errorMessage","selectOptions","required","tags","className","onInputChange","tooltip","originalCase","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","isGTN","_gtnName","onChange","onSearch","debounceTimeout","filterOption","onScroll","allowClear","autoClearSearchValue","_fullOpacityLabel","showAllTags","customTagRender","_inputStyles","disabled","labelClassName","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","_AddToDocumentIcon","_primaryColorShades","UserAvatar","onAddGTNToDocument","isRequiredConditional","isLiveField","labelExtra","inputEmphasis","inputSize","props","ref","useTranslation","isHoveredState","setIsHoveredState","useState","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","selectRef","useRef","isDropdownOpen","setIsDropdownOpen","setSearchValue","useEffect","styleId","style","handleAddGTNToDocument","_value","debounceFetcher","useMemo","debounce","handleChange","_newValue","selectedOptions","containerElement","valueToStore","changeEvent","pilotEvent","_values","currentValues","option","optionValue","currentValue","triggerSubmit","useCallback","formEl","submitEvent","submitBtn","handleKeyDownCapture","form","tagRender","renderProps","tagLabel","tagValue","onClose","tagColor","Tag","event","handleOnInputChange","classNames","InputLabel","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","Tooltip","HelpIcon","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","NoteAddOutlined","AntDSelect","input","optionLabel","optionColor","rest","fullname","firstName","lastName","omittedValues"],"mappings":";;;;;;;;;;;;;;;;;AA0CA,MAAMA,KAAyD;AAAA,EAC7D,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN,GAiLMC,KAAa,CACjBC,MAEI,MAAM,QAAQA,CAAK,IACdA,EAAM;AAAA,EAAI,CAACC,MAChB,OAAOA,KAAS,YAAY,OAAOA,KAAS,WAAWA,IAAOA,EAAK;AAAA,IAIhED,KAAS,MAMZE,KAAmB,CAACC,MACjBA,EAAI;AAAA,EACT,CAACF,GAAkCG,GAAYC,MAE3CA,EAAK;AAAA,IACH,CAACC,MACCA,EAAE,UAAUL,EAAK,SAASK,EAAE,UAAUL,EAAK;AAAA,EAAA,MACzCG;AAEV,GAOEG,KAAiB,CAAC;AAAA,EACtB,SAAAC;AAAA,EACA,OAAAR;AAAA,EACA,cAAAS;AACF,MAKMD,GAAS,SACJN;AAAA,EACLM,EAAQ,IAAI,CAACE,OAAS,EA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AA,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,YACZ8D,EAAkB,EAAK;AAAA,cAE3B;AAAA,cAEA,UAAA,gBAAA9D,EAACgD,KAAgB,aAAAF,EAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,EAIV;AACF;AAEAjC,GAAY,cAAc;"}
@@ -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"),m=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"),pe=require("../../data-display/label/Label.cjs.js"),S=require("../../tooltip/Tooltip.cjs.js"),me=require("../../icons/HelpIcon.cjs.js"),xe=require("../shared/InputLabel.cjs.js"),o=require("../../../utils/confidenceScoreUtils.cjs.js"),fe=(t,r,s,x="medium")=>{const i={small:"w-7 h-4 after:h-3 after:w-3 after:top-0.5 after:left-0.5",medium:"w-9 h-5 after:h-4 after:w-4 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"},f={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[x],f[x],{"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:x,label:i,required:f,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:p,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(xe.InputLabel,{label:i||"",required:f||!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(pe.Label,{labels:z||[]}),C&&e.jsx(S,{placement:"top",title:C,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(me.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]})]}),p&&e.jsx(m.Typography,{className:"mb-2 text-neutral-600 dark:text-neutral-400",appearance:"custom",size:"extra-small",variant:"regular",children:p}),e.jsxs("div",{className:"flex",children:[ie&&e.jsx(m.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&&x(n.target.checked),value:"",disabled:h,checked:r,className:a("sr-only peer w-full",W),"aria-required":f,"aria-invalid":d&&u==="error"?"true":"false","aria-describedby":d||p?`${s}-description`:void 0}),e.jsx("div",{className:fe(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-[-6px]"),l==="medium"&&(r?"translate-x-[8.5px]":"translate-x-[-8px]"),l==="large"&&(r?"translate-x-2.5":"translate-x-[-10px]")),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(m.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(m.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(m.Typography,{className:a("mt-1",ne()),appearance:"custom",size:"extra-small",variant:"medium",children:d})})}),p&&!d&&e.jsx("div",{id:`${s}-description`,className:"sr-only",children:p})]})]})});M.displayName="Toggle";exports.Toggle=M;
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-9 h-5 after:h-4 after:w-4 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;
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-9 h-5 after:h-4 after:w-4 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-[-6px]\"),\n size === \"medium\" &&\n (isChecked\n ? \"translate-x-[8.5px]\"\n : \"translate-x-[-8px]\"),\n size === \"large\" &&\n (isChecked\n ? \"translate-x-2.5\"\n : \"translate-x-[-10px]\")\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,2DACR,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,sBA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A,IAACwE,EAAAA,iBACE,SAAA1C,GACC9B,EAAAA,IAACyE,EAAAA,OAAO,IAAP,CACC,QAAS,CAAE,QAAS,EAAG,EAAG,GAAA,EAC1B,QAAS,CAAE,QAAS,EAAG,EAAG,CAAA,EAC1B,KAAM,CAAE,QAAS,EAAG,EAAG,GAAA,EACvB,WAAY,CAAE,SAAU,EAAA,EACxB,GAAI,GAAGpE,CAAE,eACT,KAAM0B,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-9 h-5 after:h-4 after:w-4 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,2DACR,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,G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E,eACT,KAAM0B,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"}
@@ -11,8 +11,8 @@ import { AIExtractedIndicator as pe } from "../../icons/AIExtractedIndicator.es.
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
- import { HelpIcon as xe } from "../../icons/HelpIcon.es.js";
15
- import { InputLabel as he } from "../shared/InputLabel.es.js";
14
+ import { HelpIcon as he } from "../../icons/HelpIcon.es.js";
15
+ import { InputLabel as xe } from "../shared/InputLabel.es.js";
16
16
  import { shouldShowConfidenceScore as O, getConfidenceScoreBadgeFill as be, getConfidenceScoreBadgeColor as ve, getConfidenceScoreBadgeTextColor as ke, getConfidenceScoreBadgeClass as ye } from "../../../utils/confidenceScoreUtils.es.js";
17
17
  const we = (t, r, o, u = "medium") => {
18
18
  const n = {
@@ -71,7 +71,7 @@ const we = (t, r, o, u = "medium") => {
71
71
  className: V = "",
72
72
  disabled: W,
73
73
  isDisabled: Y = !1,
74
- icon: x,
74
+ icon: h,
75
75
  stopClickPropagation: G = !0,
76
76
  gtnName: J,
77
77
  variant: Ie = "primary",
@@ -87,7 +87,7 @@ const we = (t, r, o, u = "medium") => {
87
87
  onAddGTNToDocument: D,
88
88
  inputEmphasis: F = "default"
89
89
  }, U) => {
90
- const { t: X } = de(), Z = F === "modified", ee = F === "deleted", re = F === "success", C = W ?? Y, h = !!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 = 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 = () => {
91
91
  D && D({
92
92
  key: J,
93
93
  value: r ? "Yes" : "No"
@@ -123,11 +123,11 @@ const we = (t, r, o, u = "medium") => {
123
123
  N
124
124
  ),
125
125
  children: [
126
- /* @__PURE__ */ e(he, { label: n || "", required: g || !1, isRequiredConditional: z || !1 }),
126
+ /* @__PURE__ */ e(xe, { 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 || [] }),
130
- _ && /* @__PURE__ */ e(L, { placement: "top", title: _, children: /* @__PURE__ */ e("div", { className: "cursor-pointer", children: /* @__PURE__ */ e(xe, {}) }) }),
130
+ _ && /* @__PURE__ */ e(L, { placement: "top", title: _, children: /* @__PURE__ */ e("div", { className: "cursor-pointer", children: /* @__PURE__ */ e(he, {}) }) }),
131
131
  T
132
132
  ]
133
133
  }
@@ -205,7 +205,7 @@ const we = (t, r, o, u = "medium") => {
205
205
  className: a(
206
206
  "relative inline-flex items-center",
207
207
  A || k ? "" : "w-min",
208
- h ? "cursor-not-allowed opacity-50" : "cursor-pointer"
208
+ x ? "cursor-not-allowed opacity-50" : "cursor-pointer"
209
209
  ),
210
210
  onClick: (s) => s.stopPropagation(),
211
211
  children: [
@@ -215,9 +215,9 @@ const we = (t, r, o, u = "medium") => {
215
215
  ref: U,
216
216
  type: "checkbox",
217
217
  id: o,
218
- onChange: (s) => !h && u(s.target.checked),
218
+ onChange: (s) => !x && u(s.target.checked),
219
219
  value: "",
220
- disabled: h,
220
+ disabled: x,
221
221
  checked: r,
222
222
  className: a("sr-only peer w-full", V),
223
223
  "aria-required": g,
@@ -225,16 +225,16 @@ const we = (t, r, o, u = "medium") => {
225
225
  "aria-describedby": d || f ? `${o}-description` : void 0
226
226
  }
227
227
  ),
228
- /* @__PURE__ */ e("div", { className: we(r, S, h, i), children: S ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-full w-full", children: /* @__PURE__ */ e(
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
229
  "div",
230
230
  {
231
231
  className: a(
232
232
  "z-10 transition-all transform",
233
- i === "small" && (r ? "translate-x-2" : "translate-x-[-6px]"),
234
- i === "medium" && (r ? "translate-x-[8.5px]" : "translate-x-[-8px]"),
235
- i === "large" && (r ? "translate-x-2.5" : "translate-x-[-10px]")
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
236
  ),
237
- children: r ? x?.checkedIcon ? x.checkedIcon : /* @__PURE__ */ e(Ne, { size: 18, fill: "#016DCF" }) : x?.uncheckedIcon ? x.uncheckedIcon : /* @__PURE__ */ e(Fe, { size: 18, fill: "#101828" })
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
238
  }
239
239
  ) }) : null }),
240
240
  E && /* @__PURE__ */ e(L, { placement: "top", title: E, className: "-ml-2", children: /* @__PURE__ */ e("span", { className: a(