@lax-wp/design-system 0.13.33 → 0.13.35

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 (169) 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/CheckboxCell.cjs.js +1 -1
  18. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js.map +1 -1
  19. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js +23 -23
  20. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js.map +1 -1
  21. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js +1 -1
  22. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js.map +1 -1
  23. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js +1 -1
  24. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js.map +1 -1
  25. package/dist/components/data-display/infinite-table/body/rows/index.cjs.js +1 -1
  26. package/dist/components/data-display/infinite-table/body/rows/index.cjs.js.map +1 -1
  27. package/dist/components/data-display/infinite-table/body/rows/index.es.js +104 -101
  28. package/dist/components/data-display/infinite-table/body/rows/index.es.js.map +1 -1
  29. package/dist/components/data-display/infinite-table/constants.cjs.js +1 -1
  30. package/dist/components/data-display/infinite-table/constants.cjs.js.map +1 -1
  31. package/dist/components/data-display/infinite-table/constants.d.ts +6 -0
  32. package/dist/components/data-display/infinite-table/constants.es.js +17 -16
  33. package/dist/components/data-display/infinite-table/constants.es.js.map +1 -1
  34. package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js +1 -1
  35. package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js.map +1 -1
  36. package/dist/components/data-display/infinite-table/head/CheckAll.es.js +4 -4
  37. package/dist/components/data-display/infinite-table/head/CheckAll.es.js.map +1 -1
  38. package/dist/components/data-display/infinite-table/head/index.cjs.js +1 -1
  39. package/dist/components/data-display/infinite-table/head/index.cjs.js.map +1 -1
  40. package/dist/components/data-display/infinite-table/head/index.es.js +5 -5
  41. package/dist/components/data-display/infinite-table/head/index.es.js.map +1 -1
  42. package/dist/components/data-display/infinite-table/index.cjs.js +1 -1
  43. package/dist/components/data-display/infinite-table/index.cjs.js.map +1 -1
  44. package/dist/components/data-display/infinite-table/index.es.js +188 -187
  45. package/dist/components/data-display/infinite-table/index.es.js.map +1 -1
  46. package/dist/components/data-display/infinite-table/useRowHeight.cjs.js +2 -0
  47. package/dist/components/data-display/infinite-table/useRowHeight.cjs.js.map +1 -0
  48. package/dist/components/data-display/infinite-table/useRowHeight.d.ts +15 -0
  49. package/dist/components/data-display/infinite-table/useRowHeight.es.js +24 -0
  50. package/dist/components/data-display/infinite-table/useRowHeight.es.js.map +1 -0
  51. package/dist/components/data-display/tag/Tag.cjs.js +1 -1
  52. package/dist/components/data-display/tag/Tag.cjs.js.map +1 -1
  53. package/dist/components/data-display/tag/Tag.es.js +11 -9
  54. package/dist/components/data-display/tag/Tag.es.js.map +1 -1
  55. package/dist/components/floating-bar/FloatingBar.cjs.js +1 -1
  56. package/dist/components/floating-bar/FloatingBar.cjs.js.map +1 -1
  57. package/dist/components/floating-bar/FloatingBar.es.js +9 -9
  58. package/dist/components/floating-bar/FloatingBar.es.js.map +1 -1
  59. package/dist/components/forms/base-input-field/BaseInputField.cjs.js +2 -2
  60. package/dist/components/forms/base-input-field/BaseInputField.cjs.js.map +1 -1
  61. package/dist/components/forms/base-input-field/BaseInputField.es.js +40 -42
  62. package/dist/components/forms/base-input-field/BaseInputField.es.js.map +1 -1
  63. package/dist/components/forms/creatable-select/CreatableSelect.cjs.js +1 -1
  64. package/dist/components/forms/creatable-select/CreatableSelect.cjs.js.map +1 -1
  65. package/dist/components/forms/creatable-select/CreatableSelect.es.js +14 -15
  66. package/dist/components/forms/creatable-select/CreatableSelect.es.js.map +1 -1
  67. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js +1 -1
  68. package/dist/components/forms/currency-input/CurrencyInputField.cjs.js.map +1 -1
  69. package/dist/components/forms/currency-input/CurrencyInputField.es.js +57 -65
  70. package/dist/components/forms/currency-input/CurrencyInputField.es.js.map +1 -1
  71. package/dist/components/forms/date-time-field/DateTimeField.cjs.js +1 -1
  72. package/dist/components/forms/date-time-field/DateTimeField.cjs.js.map +1 -1
  73. package/dist/components/forms/date-time-field/DateTimeField.es.js +33 -33
  74. package/dist/components/forms/date-time-field/DateTimeField.es.js.map +1 -1
  75. package/dist/components/forms/debounce-input/DebounceInputField.cjs.js +1 -1
  76. package/dist/components/forms/debounce-input/DebounceInputField.cjs.js.map +1 -1
  77. package/dist/components/forms/debounce-input/DebounceInputField.es.js +2 -2
  78. package/dist/components/forms/debounce-input/DebounceInputField.es.js.map +1 -1
  79. package/dist/components/forms/dynamic-data-input/DynamicDataInput.cjs.js +1 -1
  80. package/dist/components/forms/dynamic-data-input/DynamicDataInput.cjs.js.map +1 -1
  81. package/dist/components/forms/dynamic-data-input/DynamicDataInput.es.js +7 -7
  82. package/dist/components/forms/dynamic-data-input/DynamicDataInput.es.js.map +1 -1
  83. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js +1 -1
  84. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js.map +1 -1
  85. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js +17 -19
  86. package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js.map +1 -1
  87. package/dist/components/forms/field-options/Item.cjs.js +1 -1
  88. package/dist/components/forms/field-options/Item.cjs.js.map +1 -1
  89. package/dist/components/forms/field-options/Item.es.js +5 -5
  90. package/dist/components/forms/field-options/Item.es.js.map +1 -1
  91. package/dist/components/forms/formula-input/FormulaInput.cjs.js +1 -1
  92. package/dist/components/forms/formula-input/FormulaInput.cjs.js.map +1 -1
  93. package/dist/components/forms/formula-input/FormulaInput.es.js +10 -10
  94. package/dist/components/forms/formula-input/FormulaInput.es.js.map +1 -1
  95. package/dist/components/forms/icon-picker/IconPicker.cjs.js +1 -1
  96. package/dist/components/forms/icon-picker/IconPicker.cjs.js.map +1 -1
  97. package/dist/components/forms/icon-picker/IconPicker.es.js +42 -57
  98. package/dist/components/forms/icon-picker/IconPicker.es.js.map +1 -1
  99. package/dist/components/forms/input-field/InputField.cjs.js.map +1 -1
  100. package/dist/components/forms/input-field/InputField.es.js.map +1 -1
  101. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js +1 -1
  102. package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js.map +1 -1
  103. package/dist/components/forms/master-data-input/MasterDataInputField.es.js +54 -60
  104. package/dist/components/forms/master-data-input/MasterDataInputField.es.js.map +1 -1
  105. package/dist/components/forms/md-input/RichMarkdownInput.cjs.js +3 -3
  106. package/dist/components/forms/md-input/RichMarkdownInput.cjs.js.map +1 -1
  107. package/dist/components/forms/md-input/RichMarkdownInput.es.js +63 -63
  108. package/dist/components/forms/md-input/RichMarkdownInput.es.js.map +1 -1
  109. package/dist/components/forms/number-input-field/NumberInputField.cjs.js +1 -1
  110. package/dist/components/forms/number-input-field/NumberInputField.cjs.js.map +1 -1
  111. package/dist/components/forms/number-input-field/NumberInputField.es.js +5 -5
  112. package/dist/components/forms/number-input-field/NumberInputField.es.js.map +1 -1
  113. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js +2 -2
  114. package/dist/components/forms/percentage-input/PercentageInputField.cjs.js.map +1 -1
  115. package/dist/components/forms/percentage-input/PercentageInputField.es.js +20 -20
  116. package/dist/components/forms/percentage-input/PercentageInputField.es.js.map +1 -1
  117. package/dist/components/forms/search-bar/SearchBar.cjs.js +1 -1
  118. package/dist/components/forms/search-bar/SearchBar.cjs.js.map +1 -1
  119. package/dist/components/forms/search-bar/SearchBar.es.js +16 -16
  120. package/dist/components/forms/search-bar/SearchBar.es.js.map +1 -1
  121. package/dist/components/forms/select-field/SelectField.cjs.js +2 -2
  122. package/dist/components/forms/select-field/SelectField.cjs.js.map +1 -1
  123. package/dist/components/forms/select-field/SelectField.d.ts +4 -0
  124. package/dist/components/forms/select-field/SelectField.es.js +202 -203
  125. package/dist/components/forms/select-field/SelectField.es.js.map +1 -1
  126. package/dist/components/forms/text-area-field/TextAreaField.cjs.js +1 -1
  127. package/dist/components/forms/text-area-field/TextAreaField.cjs.js.map +1 -1
  128. package/dist/components/forms/text-area-field/TextAreaField.es.js +14 -14
  129. package/dist/components/forms/text-area-field/TextAreaField.es.js.map +1 -1
  130. package/dist/components/forms/toggle/Toggle.cjs.js +1 -1
  131. package/dist/components/forms/toggle/Toggle.cjs.js.map +1 -1
  132. package/dist/components/forms/toggle/Toggle.es.js +65 -59
  133. package/dist/components/forms/toggle/Toggle.es.js.map +1 -1
  134. package/dist/components/navigation/accordion/Accordion.cjs.js +1 -1
  135. package/dist/components/navigation/accordion/Accordion.cjs.js.map +1 -1
  136. package/dist/components/navigation/accordion/Accordion.es.js +5 -5
  137. package/dist/components/navigation/accordion/Accordion.es.js.map +1 -1
  138. package/dist/components/navigation/stepper/Stepper.cjs.js +1 -1
  139. package/dist/components/navigation/stepper/Stepper.cjs.js.map +1 -1
  140. package/dist/components/navigation/stepper/Stepper.es.js +1 -1
  141. package/dist/components/navigation/stepper/Stepper.es.js.map +1 -1
  142. package/dist/components/navigation/tabs/TabOptions.cjs.js +1 -1
  143. package/dist/components/navigation/tabs/TabOptions.cjs.js.map +1 -1
  144. package/dist/components/navigation/tabs/TabOptions.es.js +15 -15
  145. package/dist/components/navigation/tabs/TabOptions.es.js.map +1 -1
  146. package/dist/components/navigation/tabs/TabSwitch.cjs.js +1 -1
  147. package/dist/components/navigation/tabs/TabSwitch.cjs.js.map +1 -1
  148. package/dist/components/navigation/tabs/TabSwitch.es.js +7 -7
  149. package/dist/components/navigation/tabs/TabSwitch.es.js.map +1 -1
  150. package/dist/components/navigation/tabs/Tabs.cjs.js +1 -1
  151. package/dist/components/navigation/tabs/Tabs.cjs.js.map +1 -1
  152. package/dist/components/navigation/tabs/Tabs.es.js +1 -1
  153. package/dist/components/navigation/tabs/Tabs.es.js.map +1 -1
  154. package/dist/components/tooltip/Tooltip.cjs.js +1 -1
  155. package/dist/components/tooltip/Tooltip.cjs.js.map +1 -1
  156. package/dist/components/tooltip/Tooltip.es.js +19 -19
  157. package/dist/components/tooltip/Tooltip.es.js.map +1 -1
  158. package/dist/components/user-avatar/UserAvatar.cjs.js +1 -1
  159. package/dist/components/user-avatar/UserAvatar.cjs.js.map +1 -1
  160. package/dist/components/user-avatar/UserAvatar.d.ts +1 -1
  161. package/dist/components/user-avatar/UserAvatar.es.js +40 -38
  162. package/dist/components/user-avatar/UserAvatar.es.js.map +1 -1
  163. package/dist/components/user-avatar/constants.cjs.js +1 -1
  164. package/dist/components/user-avatar/constants.cjs.js.map +1 -1
  165. package/dist/components/user-avatar/constants.d.ts +1 -0
  166. package/dist/components/user-avatar/constants.es.js +10 -9
  167. package/dist/components/user-avatar/constants.es.js.map +1 -1
  168. package/dist/design-system.css +1 -1
  169. package/package.json +2 -3
@@ -1 +1 @@
1
- {"version":3,"file":"BaseInputField.es.js","sources":["../../../../src/components/forms/base-input-field/BaseInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport React, { forwardRef, useState } from \"react\";\nimport { useTranslation } from 'react-i18next';\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\n/**\n * Bounding boxes interface\n */\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props\n */\nexport interface RiskDetailsCardProps {\n riskDetails: RiskDetails;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Eye icon for password visibility toggle\n */\nconst EyeIcon = ({ className, size = 16 }: { className?: string; size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n);\n\n/**\n * Eye off icon for password visibility toggle\n */\nconst EyeOffIcon = ({ className, size = 16 }: { className?: string; size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24\" />\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\" />\n </svg>\n);\n\n/**\n * Close icon for clearable input\n */\nconst CloseIcon = ({ className, size = 16 }: { className?: string; size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n);\n\n/**\n * Revert icon for revert back value\n */\nconst RevertIcon = ({ className, size = 16 }: { className?: string; size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n </svg>\n);\n\n/** Visual emphasis for the input surface (background + border) */\nexport type BaseInputFieldEmphasis = \"default\" | \"modified\" | \"deleted\" | \"success\";\n\n/**\n * Props for the BaseInputField component\n */\nexport type TBaseInputFieldProps = any & {\n /** Current value of the input */\n value: string;\n /** Callback function called when the input value changes */\n onChange(data: any): void;\n /** Callback function for key down events */\n onKeyDown?: void;\n /** Error message to display */\n errorMessage: string;\n /** Default value for the input */\n defaultValue?: string;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Maximum value for number inputs */\n max?: number;\n /** Minimum value for number inputs */\n min?: number;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional */\n isRequiredConditional?: boolean;\n /** Background color class */\n bg?: string;\n /** Tags to display with the label */\n tags?: (string | LabelType)[];\n /** Text color class */\n color?: string;\n /** Unique identifier for the input */\n id: string;\n /** Label text for the input */\n label?: string;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input type (text, email, password, number, etc.) */\n type?: string;\n /** Value to revert back to */\n revertBackValue?: any;\n /** Placeholder text */\n placeholder?: string;\n /** Whether this is a password field with visibility toggle */\n isPasswordField?: boolean;\n /** Callback to set password visibility */\n setIsPasswordVisible?: any;\n /** Tooltip text */\n tooltip?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Icon or element to display at the end of the input */\n suffixIcon?: React.ReactNode;\n /** Text size class */\n textSize?: string;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Whether this is a GTN field */\n isGTN?: boolean;\n /** Confidence score shown as a compact badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence score badge */\n confidenceTooltip?: React.ReactNode;\n /** GTN name for document integration */\n gtnName?: any;\n /** Success message to display */\n successMessage?: string;\n /** Additional CSS classes for the input element */\n inputClassName?: string;\n /** Inline styles for the input element */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function for blur events */\n onBlur?: () => void;\n /** Whether the input is clearable */\n isClearable?: boolean;\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Ref for the input element */\n inputRef?: React.RefObject<HTMLInputElement>;\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>;\n /** Bounding box for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Callback function for confidence score click */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Input surface style: `'modified'` — `--Warning-50` / `--Warning-200`; `'deleted'` — `--Error-50` / `--Error-200`, text `#475467`; `'success'` — `--Success-50` / `--Success-200`, text `#101828`. */\n inputEmphasis?: BaseInputFieldEmphasis;\n};\n\n/**\n * A feature-rich input field component with label, validation, GTN integration,\n * risk analysis support, and comprehensive styling options.\n *\n * @example\n * ```tsx\n * <BaseInputField\n * id=\"email\"\n * label=\"Email Address\"\n * type=\"email\"\n * value={email}\n * onChange={setEmail}\n * placeholder=\"Enter your email\"\n * required\n * errorMessage={emailError}\n * />\n * ```\n */\nexport const BaseInputField = forwardRef<HTMLInputElement, TBaseInputFieldProps>(\n (\n {\n id,\n label,\n labelExtra,\n onChange,\n errorMessage,\n successMessage,\n required,\n isRequiredConditional = false,\n bg,\n tags,\n color,\n className,\n isPasswordField,\n setIsPasswordVisible,\n inputRef,\n tooltip,\n suffixIcon,\n revertBackValue,\n originalCase = false,\n textSize,\n isAiExtracted = false,\n isGTN = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n gtnName = null,\n inputClassName = \"\",\n inputStyle = {},\n labelClassName,\n onBlur,\n isLiveField = false,\n isClearable = false,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n onAddGTNToDocument,\n sourceMeta = [],\n inputEmphasis = \"default\",\n onConfidenceScoreClick,\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const showRiskSkin = Boolean(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisModifiedSkin =\n inputEmphasis === \"modified\" &&\n !errorMessage &&\n !successMessage &&\n !showRiskSkin;\n const emphasisDeletedSkin =\n inputEmphasis === \"deleted\" &&\n !errorMessage &&\n !successMessage &&\n !showRiskSkin;\n const emphasisSuccessSkin =\n inputEmphasis === \"success\" &&\n !errorMessage &&\n !successMessage &&\n !showRiskSkin;\n const [showPassword, setShowPassword] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n const handleAddGTNToDocument = (value: string) => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value,\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n return (\n <div\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-neutral-50 dark:focus:border-neutral-50\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"flex flex-col w-full\", className)}>\n <style>\n {`\n .dark input:-webkit-autofill,\n .dark input:-webkit-autofill:hover,\n .dark input:-webkit-autofill:focus {\n -webkit-text-fill-color: white !important;\n -webkit-box-shadow: 0 0 0px 1000px var(--input-bg-color) inset !important;\n transition: background-color 5000s ease-in-out 0s;\n }\n \n input:-webkit-autofill,\n input:-webkit-autofill:hover,\n input:-webkit-autofill:focus {\n -webkit-text-fill-color: #111827 !important;\n -webkit-box-shadow: 0 0 0px 1000px white inset !important;\n transition: background-color 5000s ease-in-out 0s;\n }\n `}\n </style>\n {(label || labelExtra) && (\n <label\n id={id}\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${!originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"!uppercse\"}`}\n >\n <div className=\"flex flex-wrap items-center justify-between w-full\">\n <div className=\"inline-flex flex-wrap items-center gap-1\">\n {(label || required || isRequiredConditional) && (\n <InputLabel label={label ?? \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n )}\n {revertBackValue?.length > 0 &&\n revertBackValue !== props.value && (\n <AntTooltip placement=\"top\" title={revertBackValue}>\n <button\n className=\"cursor-pointer\"\n onClick={() => onChange(revertBackValue)}\n type=\"button\"\n >\n <RevertIcon\n size={16}\n className=\"cursor-pointer pb-0.5 text-primary-600\"\n />\n </button>\n </AntTooltip>\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 <AntTooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon />\n </div>\n </AntTooltip>\n )}\n {labelExtra}\n </div>\n <div className=\"flex items-center gap-1\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip || \"\"}\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\n className={cn(\n \"text-xs font-medium leading-4\",\n getConfidenceScoreBadgeTextColor(confidenceType)\n )}\n >\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id={`btn-base-input-field-add-to-document-${id}`}\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(props?.value)}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n className=\"text-primary-600\"\n sx={{\n fontSize: 16,\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n )}\n <label className=\"relative block\">\n <div className=\"relative\">\n <input\n {...props}\n ref={inputRef || ref}\n id={id || label}\n key={id}\n required={required}\n style={\n {\n \"--input-bg-color\":\n \"var(--tw-bg-opacity, 1) rgb(var(--bg-color))\",\n ...inputStyle,\n } as React.CSSProperties\n }\n className={cn(\n \"border border-solid h-[32px] text-neutral-900 dark:text-black-100 block w-full px-3 py-1.5 font-medium disabled:opacity-70 focus:outline-none focus:ring-0 dark:disabled:placeholder:!text-black-400\",\n textSize ? textSize : \"text-sm\",\n color ? color : \"text-neutral-900 dark:text-black-100\",\n bg && bg,\n inputClassName ? inputClassName : \"\",\n errorMessage\n ? cn(\n \"rounded-md border-red-300 dark:border-red-500 bg-white hover:border-red-400 dark:bg-black-600 dark:hover:border-red-400 focus:border-red-600 focus:shadow-[0_0_0_1.5px_rgba(239,68,68,0.22)] dark:focus:border-red-500 dark:focus:shadow-[0_0_0_1.5px_rgba(248,113,113,0.25)]\",\n )\n : successMessage\n ? cn(\n \"rounded-md border-green-300 bg-white hover:border-green-400 dark:border-green-600 dark:bg-black-600 dark:hover:border-green-500 focus:border-green-600 focus:shadow-[0_0_0_1.5px_rgba(34,197,94,0.22)] dark:focus:border-green-500\",\n )\n : showRiskSkin && riskDetails?.color\n ? cn(\n \"rounded-md hover:border-primary-500 dark:hover:border-primary-400 focus:border-primary-600 dark:focus:border-primary-400 focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]\",\n `bg-${riskDetails.color}-50 border-${riskDetails.color}-300`,\n )\n : emphasisDeletedSkin\n ? \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254_202_202_/_0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)] dark:disabled:!bg-[var(--Error-50,#FEF2F2)]\"\n : emphasisModifiedSkin\n ? \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254_223_137_/_0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)] dark:disabled:!bg-[var(--Warning-50,#FFFAEB)]\"\n : emphasisSuccessSkin\n ? \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187_247_208_/_0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)] dark:disabled:!bg-[var(--Success-50,#F0FDF4)] disabled:!text-[#101828] dark:disabled:!text-[#101828]\"\n : \"rounded-md border-neutral-200 bg-white hover:border-primary-500 dark:border-black-600 dark:bg-black-600 dark:hover:border-primary-400 focus:border-primary-600 dark:focus:border-primary-400 focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)] disabled:!bg-neutral-50 dark:disabled:!bg-black-800\"\n )}\n onChange={(e) => {\n onChange(e.target.value);\n }}\n onClick={(e) => e.stopPropagation()}\n autoComplete=\"off\"\n onBlur={onBlur}\n />\n {isPasswordField ? (\n <button\n className=\"absolute inset-y-0 flex items-center cursor-pointer right-2\"\n onClick={() => {\n setShowPassword(!showPassword);\n setIsPasswordVisible?.(!showPassword);\n }}\n type=\"button\"\n >\n {showPassword ? (\n <EyeIcon className=\"text-gray-400\" size={16} />\n ) : (\n <EyeOffIcon className=\"text-gray-400\" size={16} />\n )}\n </button>\n ) : isClearable && props.value ? (\n <button\n id={`btn-input-field-clear-${id}`}\n className=\"absolute inset-y-0 flex items-center cursor-pointer right-2 focus:outline-none\"\n onClick={(e) => {\n e.stopPropagation();\n onChange(\"\");\n }}\n type=\"button\"\n >\n <CloseIcon\n className=\"text-neutral-200 dark:text-black-500\"\n size={16}\n />\n </button>\n ) : suffixIcon ? (\n <div className=\"absolute inset-y-0 flex items-center right-2\">\n {suffixIcon}\n </div>\n ) : null}\n </div>\n </label>\n <AnimatePresence>\n {errorMessage && (\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 >\n <Typography\n className=\"mt-1 text-error-500\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n <AnimatePresence>\n {successMessage && (\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 >\n <Typography\n className=\"mt-1 text-success-500 dark:text-success-300\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {successMessage}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n\n {isHovered &&\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 setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nBaseInputField.displayName = \"BaseInputField\";\n\nexport default BaseInputField;\n\n"],"names":["EyeIcon","className","size","jsxs","jsx","EyeOffIcon","CloseIcon","RevertIcon","BaseInputField","forwardRef","id","label","labelExtra","onChange","errorMessage","successMessage","required","isRequiredConditional","bg","tags","color","isPasswordField","setIsPasswordVisible","inputRef","tooltip","suffixIcon","revertBackValue","originalCase","textSize","isAiExtracted","isGTN","confidenceScore","confidenceType","confidenceTooltip","gtnName","inputClassName","inputStyle","labelClassName","onBlur","isLiveField","isClearable","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","onAddGTNToDocument","sourceMeta","inputEmphasis","onConfidenceScoreClick","props","ref","t","useTranslation","showRiskSkin","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","showPassword","setShowPassword","useState","isHovered","setIsHovered","handleAddGTNToDocument","value","cn","InputLabel","AntTooltip","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","HelpIcon","Tooltip","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","NoteAddOutlined","createElement","e","AnimatePresence","motion","Typography"],"mappings":";;;;;;;;;;;;;;;AAyEA,MAAMA,KAAU,CAAC,EAAE,WAAAC,GAAW,MAAAC,IAAO,SACnC,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAOD;AAAA,IACP,QAAQA;AAAA,IACR,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,eAAc;AAAA,IAC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WAAU;AAAA,oBACV,YAAW;AAAA,oBACX,MAAK;AAAA,oBACL,SAAQ;AAAA,oBAEP,UAAAnE;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA,EACF,CAEJ;AAAA,UAAA,GACF;AAAA,UAEC4C,KACClB,KACAC,KACAC,KACE,gBAAAvC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAU;AAAA,cACV,WAAU;AAAA,cACV,SAAS,CAAC2E,MAAMA,EAAE,gBAAA;AAAA,cAClB,aAAa,CAACA,MAAMA,EAAE,eAAA;AAAA,cACtB,WAAW,CAACA,MAAM;AAChB,gBAAIA,EAAE,QAAQ,YACZnB,EAAa,EAAK;AAAA,cAEtB;AAAA,cAEA,UAAA,gBAAAxD,EAACuC,KAAgB,aAAAF,EAAA,CAA0B;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7C;AAAA,MAAA;AAAA,IAAA;AAAA,EAIV;AACF;AAEAjC,GAAe,cAAc;"}
1
+ {"version":3,"file":"BaseInputField.es.js","sources":["../../../../src/components/forms/base-input-field/BaseInputField.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport React, { forwardRef, useState } from \"react\";\nimport { useTranslation } from 'react-i18next';\nimport { Tooltip as AntTooltip } from \"antd\";\nimport { Typography } from \"../../data-display/typography/Typography\";\nimport { Label } from \"../../data-display/label/Label\";\nimport type { LabelType } from \"../../data-display/label/Label\";\nimport { NoteAddOutlined, BoltOutlined } from \"@mui/icons-material\";\nimport { AIExtractedIndicator } from \"../../icons/AIExtractedIndicator\";\nimport { AIStarIcon } from \"../../icons/AIStarIcon\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport Tooltip from \"../../tooltip/Tooltip\";\nimport {\n getConfidenceScoreBadgeClass,\n getConfidenceScoreBadgeColor,\n getConfidenceScoreBadgeFill,\n getConfidenceScoreBadgeTextColor,\n shouldShowConfidenceScore,\n} from \"../../../utils/confidenceScoreUtils\";\nimport { HelpIcon } from \"../../icons/HelpIcon\";\n\n/**\n * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\n/**\n * Bounding boxes interface\n */\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\nexport type SourceMetaItem = {\n bbox: SourceMetaBBox;\n confidence_score?: number;\n is_primary?: boolean;\n match_score?: number;\n match_type?: string;\n page_height: number;\n page_width: number;\n source_page: number;\n source_text?: string;\n};\n\n/**\n * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n hexBgColor?: string;\n hexBorderColor?: string;\n [key: string]: any;\n}\n\n/**\n * Risk details card component props\n */\nexport interface RiskDetailsCardProps {\n riskDetails: RiskDetails;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Eye icon for password visibility toggle\n */\nconst EyeIcon = ({ className, size = 16 }: { className?: string; size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n);\n\n/**\n * Eye off icon for password visibility toggle\n */\nconst EyeOffIcon = ({ className, size = 16 }: { className?: string; size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24\" />\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\" />\n </svg>\n);\n\n/**\n * Close icon for clearable input\n */\nconst CloseIcon = ({ className, size = 16 }: { className?: string; size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n);\n\n/**\n * Revert icon for revert back value\n */\nconst RevertIcon = ({ className, size = 16 }: { className?: string; size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n >\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n </svg>\n);\n\n/** Visual emphasis for the input surface (background + border) */\nexport type BaseInputFieldEmphasis = \"default\" | \"modified\" | \"deleted\" | \"success\";\n\n/**\n * Props for the BaseInputField component\n */\nexport type TBaseInputFieldProps = any & {\n /** Current value of the input */\n value: string;\n /** Callback function called when the input value changes */\n onChange(data: any): void;\n /** Callback function for key down events */\n onKeyDown?: void;\n /** Error message to display */\n errorMessage: string;\n /** Default value for the input */\n defaultValue?: string;\n /** Whether the input is disabled */\n disabled?: boolean;\n /** Maximum value for number inputs */\n max?: number;\n /** Minimum value for number inputs */\n min?: number;\n /** Whether the field is required */\n required?: boolean;\n /** Whether the required indicator shows as conditional */\n isRequiredConditional?: boolean;\n /** Background color class */\n bg?: string;\n /** Tags to display with the label */\n tags?: (string | LabelType)[];\n /** Text color class */\n color?: string;\n /** Unique identifier for the input */\n id: string;\n /** Label text for the input */\n label?: string;\n /** Optional extra content in the label row (e.g. actions, badges) */\n labelExtra?: React.ReactNode;\n /** Input type (text, email, password, number, etc.) */\n type?: string;\n /** Value to revert back to */\n revertBackValue?: any;\n /** Placeholder text */\n placeholder?: string;\n /** Whether this is a password field with visibility toggle */\n isPasswordField?: boolean;\n /** Callback to set password visibility */\n setIsPasswordVisible?: any;\n /** Tooltip text */\n tooltip?: string;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Icon or element to display at the end of the input */\n suffixIcon?: React.ReactNode;\n /** Text size class */\n textSize?: string;\n /** Whether the value was AI extracted */\n isAiExtracted?: boolean;\n /** Whether this is a GTN field */\n isGTN?: boolean;\n /** Confidence score shown as a compact badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence score badge */\n confidenceTooltip?: React.ReactNode;\n /** GTN name for document integration */\n gtnName?: any;\n /** Success message to display */\n successMessage?: string;\n /** Additional CSS classes for the input element */\n inputClassName?: string;\n /** Inline styles for the input element */\n inputStyle?: React.CSSProperties;\n /** Additional CSS classes for the label */\n labelClassName?: string;\n /** Whether this is a live field */\n isLiveField?: boolean;\n /** Callback function for blur events */\n onBlur?: () => void;\n /** Whether the input is clearable */\n isClearable?: boolean;\n /** Additional CSS classes for the wrapper */\n className?: string;\n /** Ref for the input element */\n inputRef?: React.RefObject<HTMLInputElement>;\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>;\n /** Bounding box for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler for adding GTN to document */\n onAddGTNToDocument?: (keyValuePair: { key: string; value: string }) => void;\n /** Callback function for confidence score click */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Input surface style: `'modified'` — `--Warning-50` / `--Warning-200`; `'deleted'` — `--Error-50` / `--Error-200`, text `#475467`; `'success'` — `--Success-50` / `--Success-200`, text `#101828`. */\n inputEmphasis?: BaseInputFieldEmphasis;\n};\n\n/**\n * A feature-rich input field component with label, validation, GTN integration,\n * risk analysis support, and comprehensive styling options.\n *\n * @example\n * ```tsx\n * <BaseInputField\n * id=\"email\"\n * label=\"Email Address\"\n * type=\"email\"\n * value={email}\n * onChange={setEmail}\n * placeholder=\"Enter your email\"\n * required\n * errorMessage={emailError}\n * />\n * ```\n */\nexport const BaseInputField = forwardRef<HTMLInputElement, TBaseInputFieldProps>(\n (\n {\n id,\n label,\n labelExtra,\n onChange,\n errorMessage,\n successMessage,\n required,\n isRequiredConditional = false,\n bg,\n tags,\n color,\n className,\n isPasswordField,\n setIsPasswordVisible,\n inputRef,\n tooltip,\n suffixIcon,\n revertBackValue,\n originalCase = false,\n textSize,\n isAiExtracted = false,\n isGTN = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n gtnName = null,\n inputClassName = \"\",\n inputStyle = {},\n labelClassName,\n onBlur,\n isLiveField = false,\n isClearable = false,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n onAddGTNToDocument,\n sourceMeta = [],\n inputEmphasis = \"default\",\n onConfidenceScoreClick,\n ...props\n },\n ref\n ) => {\n const { t } = useTranslation();\n const showRiskSkin = Boolean(isRiskAnalysisOpen && riskDetails?.color);\n const emphasisModifiedSkin =\n inputEmphasis === \"modified\" &&\n !errorMessage &&\n !successMessage &&\n !showRiskSkin;\n const emphasisDeletedSkin =\n inputEmphasis === \"deleted\" &&\n !errorMessage &&\n !successMessage &&\n !showRiskSkin;\n const emphasisSuccessSkin =\n inputEmphasis === \"success\" &&\n !errorMessage &&\n !successMessage &&\n !showRiskSkin;\n const [showPassword, setShowPassword] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n const handleAddGTNToDocument = (value: string) => {\n if (onAddGTNToDocument) {\n const keyValuePair = {\n key: gtnName,\n value,\n };\n onAddGTNToDocument(keyValuePair);\n }\n };\n\n return (\n <div\n className={cn(\n \"flex gap-0.5 relative\",\n isHovered && isGTN\n ? \"border rounded-lg border-primary-100 bg-primary-50 p-1 focus:ring-primary-500 focus:border-primary-500 dark:focus:ring-neutral-50 dark:focus:border-neutral-50\"\n : \"\"\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n {isGTN && !isHovered ? (\n <div className=\"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5\" />\n ) : null}\n <div className={cn(\"flex flex-col w-full\", className)}>\n <style>\n {`\n .dark input:-webkit-autofill,\n .dark input:-webkit-autofill:hover,\n .dark input:-webkit-autofill:focus {\n -webkit-text-fill-color: white !important;\n -webkit-box-shadow: 0 0 0px 1000px var(--input-bg-color) inset !important;\n transition: background-color 5000s ease-in-out 0s;\n }\n \n input:-webkit-autofill,\n input:-webkit-autofill:hover,\n input:-webkit-autofill:focus {\n -webkit-text-fill-color: #111827 !important;\n -webkit-box-shadow: 0 0 0px 1000px white inset !important;\n transition: background-color 5000s ease-in-out 0s;\n }\n `}\n </style>\n {(label || labelExtra) && (\n <label\n id={id}\n htmlFor=\"text\"\n className={`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${!originalCase ? \"capitalize\" : \"\"\n } ${labelClassName || \"!uppercse\"}`}\n >\n <div className=\"flex flex-wrap items-center justify-between w-full\">\n <div className=\"inline-flex flex-wrap items-center gap-1\">\n {(label || required || isRequiredConditional) && (\n <InputLabel label={label ?? \"\"} required={required || false} isRequiredConditional={isRequiredConditional || false} />\n )}\n {revertBackValue?.length > 0 &&\n revertBackValue !== props.value && (\n <AntTooltip placement=\"top\" title={revertBackValue}>\n <button\n className=\"cursor-pointer\"\n onClick={() => onChange(revertBackValue)}\n type=\"button\"\n >\n <RevertIcon\n className=\"cursor-pointer pb-0.5 text-primary-600 w-4 h-4\"\n />\n </button>\n </AntTooltip>\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 <AntTooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </AntTooltip>\n )}\n {labelExtra}\n </div>\n <div className=\"flex items-center gap-1\">\n {(shouldShowConfidenceScore(confidenceScore) && confidenceType) ? (\n <Tooltip\n placement=\"top-end\"\n title={confidenceTooltip || \"\"}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\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\n className={cn(\n \"text-xs font-medium leading-4\",\n getConfidenceScoreBadgeTextColor(confidenceType)\n )}\n >\n {confidenceScore}%\n </span>\n </div>\n </Tooltip>\n ) : null}\n\n {isGTN && isHovered && onAddGTNToDocument ? (\n <button\n id={`btn-base-input-field-add-to-document-${id}`}\n className=\"cursor-pointer\"\n onClick={() => handleAddGTNToDocument(props?.value)}\n type=\"button\"\n >\n <AntTooltip placement=\"top\" title={t(\"Add to document\")}>\n <NoteAddOutlined\n className=\"text-primary-600\"\n sx={{\n fontSize: 16,\n }}\n />\n </AntTooltip>\n </button>\n ) : null}\n </div>\n </div>\n </label>\n )}\n <label className=\"relative block\">\n <div className=\"relative\">\n <input\n {...props}\n ref={inputRef || ref}\n id={id || label}\n key={id}\n required={required}\n style={\n {\n \"--input-bg-color\":\n \"var(--tw-bg-opacity, 1) rgb(var(--bg-color))\",\n ...inputStyle,\n } as React.CSSProperties\n }\n className={cn(\n \"border border-solid h-8 text-neutral-900 dark:text-black-100 block w-full px-3 py-1.5 font-medium disabled:opacity-70 focus:outline-none focus:ring-0 dark:disabled:placeholder:!text-black-400\",\n textSize ? textSize : \"text-sm\",\n color ? color : \"text-neutral-900 dark:text-black-100\",\n bg && bg,\n inputClassName ? inputClassName : \"\",\n errorMessage\n ? cn(\n \"rounded-md border-red-300 dark:border-red-500 bg-white hover:border-red-400 dark:bg-black-600 dark:hover:border-red-400 focus:border-red-600 focus:shadow-[0_0_0_1.5px_rgba(239,68,68,0.22)] dark:focus:border-red-500 dark:focus:shadow-[0_0_0_1.5px_rgba(248,113,113,0.25)]\",\n )\n : successMessage\n ? cn(\n \"rounded-md border-green-300 bg-white hover:border-green-400 dark:border-green-600 dark:bg-black-600 dark:hover:border-green-500 focus:border-green-600 focus:shadow-[0_0_0_1.5px_rgba(34,197,94,0.22)] dark:focus:border-green-500\",\n )\n : showRiskSkin && riskDetails?.color\n ? cn(\n \"rounded-md hover:border-primary-500 dark:hover:border-primary-400 focus:border-primary-600 dark:focus:border-primary-400 focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]\",\n `bg-${riskDetails.color}-50 border-${riskDetails.color}-300`,\n )\n : emphasisDeletedSkin\n ? \"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254_202_202_/_0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)] dark:disabled:!bg-[var(--Error-50,#FEF2F2)]\"\n : emphasisModifiedSkin\n ? \"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254_223_137_/_0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)] dark:disabled:!bg-[var(--Warning-50,#FFFAEB)]\"\n : emphasisSuccessSkin\n ? \"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187_247_208_/_0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)] dark:disabled:!bg-[var(--Success-50,#F0FDF4)] disabled:!text-[#101828] dark:disabled:!text-[#101828]\"\n : \"rounded-md border-neutral-200 bg-white hover:border-primary-500 dark:border-black-600 dark:bg-black-600 dark:hover:border-primary-400 focus:border-primary-600 dark:focus:border-primary-400 focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)] disabled:!bg-neutral-50 dark:disabled:!bg-black-800\"\n )}\n onChange={(e) => {\n onChange(e.target.value);\n }}\n onClick={(e) => e.stopPropagation()}\n autoComplete=\"off\"\n onBlur={onBlur}\n />\n {isPasswordField ? (\n <button\n className=\"absolute inset-y-0 flex items-center cursor-pointer right-2\"\n onClick={() => {\n setShowPassword(!showPassword);\n setIsPasswordVisible?.(!showPassword);\n }}\n type=\"button\"\n >\n {showPassword ? (\n <EyeIcon className=\"text-gray-400 w-4 h-4\" />\n ) : (\n <EyeOffIcon className=\"text-gray-400 w-4 h-4\" />\n )}\n </button>\n ) : isClearable && props.value ? (\n <button\n id={`btn-input-field-clear-${id}`}\n className=\"absolute inset-y-0 flex items-center cursor-pointer right-2 focus:outline-none\"\n onClick={(e) => {\n e.stopPropagation();\n onChange(\"\");\n }}\n type=\"button\"\n >\n <CloseIcon\n className=\"text-neutral-200 dark:text-black-500 w-4 h-4\"\n />\n </button>\n ) : suffixIcon ? (\n <div className=\"absolute inset-y-0 flex items-center right-2\">\n {suffixIcon}\n </div>\n ) : null}\n </div>\n </label>\n <AnimatePresence>\n {errorMessage && (\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 >\n <Typography\n className=\"mt-1 text-error-500\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {errorMessage}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n <AnimatePresence>\n {successMessage && (\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 >\n <Typography\n className=\"mt-1 text-success-500 dark:text-success-300\"\n appearance=\"custom\"\n size=\"extra-small\"\n variant=\"medium\"\n >\n {successMessage}\n </Typography>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n\n {isHovered &&\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 setIsHovered(false);\n }\n }}\n >\n <RiskDetailsCard riskDetails={riskDetails} />\n </div>\n )}\n </div>\n );\n }\n);\n\nBaseInputField.displayName = \"BaseInputField\";\n\nexport default BaseInputField;\n\n"],"names":["EyeIcon","className","size","jsxs","jsx","EyeOffIcon","CloseIcon","RevertIcon","BaseInputField","forwardRef","id","label","labelExtra","onChange","errorMessage","successMessage","required","isRequiredConditional","bg","tags","color","isPasswordField","setIsPasswordVisible","inputRef","tooltip","suffixIcon","revertBackValue","originalCase","textSize","isAiExtracted","isGTN","confidenceScore","confidenceType","confidenceTooltip","gtnName","inputClassName","inputStyle","labelClassName","onBlur","isLiveField","isClearable","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","onAddGTNToDocument","sourceMeta","inputEmphasis","onConfidenceScoreClick","props","ref","t","useTranslation","showRiskSkin","emphasisModifiedSkin","emphasisDeletedSkin","emphasisSuccessSkin","showPassword","setShowPassword","useState","isHovered","setIsHovered","handleAddGTNToDocument","value","cn","InputLabel","AntTooltip","BoltOutlined","shouldShowConfidenceScore","AIExtractedIndicator","Label","HelpIcon","Tooltip","getConfidenceScoreBadgeClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","getConfidenceScoreBadgeTextColor","NoteAddOutlined","createElement","e","AnimatePresence","motion","Typography"],"mappings":";;;;;;;;;;;;;;;AAyEA,MAAMA,KAAU,CAAC,EAAE,WAAAC,GAAW,MAAAC,IAAO,SACnC,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAOD;AAAA,IACP,QAAQA;AAAA,IACR,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,eAAc;AAAA,IACd,gBAAe;AAAA,IACf,WAAAD;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAG,EAAC,QAAA,EAAK,GAAE,+CAAA,CAA+C;AAAA,wBACtD,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,IAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAChC,GAMIC,KAAa,CAAC,EAAE,WAAAJ,GAAW,MAAAC,IAAO,SACtC,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAOD;AAAA,IACP,QAAQA;AAAA,IACR,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,eAAc;AAAA,IACd,gBAAe;AAAA,IACf,WAAAD;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAG,EAAC,Q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;AAAA,MAAA;AAAA,IAAA;AAAA,EAIV;AACF;AAEAjC,GAAe,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),E=require("../../../_virtual/index.cjs.js"),M=require("react-select/creatable"),m=require("@mui/icons-material"),P=require("antd"),V=require("../../data-display/typography/Typography.cjs.js"),T=require("../../icons/HelpIcon.cjs.js"),O=require("../../data-display/label/Label.cjs.js"),$=require("react"),A=require("../shared/InputLabel.cjs.js"),B=require("../../../hooks/useIsDarkMode.cjs.js"),v=({id:l,label:i,errorMessage:n,selectOptions:h,loading:y,isClearable:C,multiSelect:t,selectedValues:c,disabled:d,required:s,value:p,className:S,tooltip:b,tags:j,originalCase:D=!1,onChange:x,filterOption:w,placeholder:k,...I})=>{const r=B.useIsDarkMode(),[L,u]=$.useState(!1),f=(e,o)=>{x&&x(e);const g=document.getElementById(l);if(g){const R=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${l}`,value:e,type:"change"}});g.dispatchEvent(R)}},z={control:(e,o)=>({...e,borderColor:n&&s?r?"#F04438":"#fda49b":o.isFocused?"var(--color-primary-600)":r?"#434343":"#d9d9d9",backgroundColor:r?"#141414":o.isDisabled?"#f5f5f5":"#fff",borderRadius:"6px",minHeight:"32px",fontSize:"14px",padding:"0 4px 0 12px",opacity:o.isDisabled?.6:1,cursor:o.isDisabled?"not-allowed":"pointer",boxShadow:o.isFocused?r?"0 0 0 1.5px var(--color-primary-950)":"0 0 0 1.5px var(--color-primary-100)":"none","&:hover":{borderColor:n&&s?r?"#F04438":"#fda49b":"var(--color-primary-600)"}}),valueContainer:e=>({...e,fontSize:"14px",padding:0}),input:e=>({...e,margin:"0",padding:"0",color:r?"rgba(255,255,255,0.85)":"inherit"}),indicatorsContainer:e=>({...e,padding:0}),option:(e,o)=>({...e,fontSize:"14px",lineHeight:"22px",padding:"5px 12px",margin:0,backgroundColor:o.isSelected?r?"var(--color-primary-975)":"var(--color-primary-50)":o.isFocused?r?"var(--color-primary-950)":"var(--color-primary-100)":r?"#141414":"#fff",color:o.isDisabled?r?"rgba(255,255,255,0.25)":"#a3a3a3":r?o.isSelected?"var(--color-primary-600)":"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)",cursor:o.isDisabled?"not-allowed":"pointer",opacity:o.isDisabled?.6:1,"&:hover":{backgroundColor:o.isDisabled?r?"#141414":"#fff":r?"var(--color-primary-950)":"var(--color-primary-100)"},"&:active":{backgroundColor:r?"var(--color-primary-950)":"var(--color-primary-50)"}}),singleValue:(e,o)=>({...e,fontSize:"14px",lineHeight:"20px",color:o.isDisabled?r?"rgba(255,255,255,0.25)":"#a3a3a3":r?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)"}),placeholder:e=>({...e,fontSize:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:r?"rgba(255,255,255,0.25)":"#bfbfbf"}),multiValue:e=>({...e,backgroundColor:r?"rgba(255,255,255,0.08)":"#f0f5ff",border:r?"1px solid transparent":"1px solid #adc6ff",borderRadius:"4px"}),multiValueLabel:e=>({...e,color:r?"rgba(255,255,255,0.85)":"var(--color-primary-600)",fontSize:"12px"}),multiValueRemove:e=>({...e,color:r?"rgba(255,255,255,0.85)":"var(--color-primary-600)","&:hover":{backgroundColor:r?"rgba(255,255,255,0.16)":"#e6f4ff",color:r?"#fff":"var(--color-primary-600)"}}),menu:e=>({...e,zIndex:5001,borderRadius:"8px",boxShadow:r?"0 6px 16px 0 rgba(0,0,0,0.45)":"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)",backgroundColor:r?"#141414":"#fff",border:r?"1px solid #303030":"none",overflow:"hidden"}),menuList:e=>({...e,padding:"0",maxHeight:"256px"})},F=!!c?.length,q=L&&!d&&(C?F||!!p:!1),N=e=>{e.stopPropagation(),e.preventDefault(),f(t?[]:null)},H=()=>a.jsx("div",{className:"flex items-center",children:q?a.jsx(m.CancelRounded,{onClick:N,sx:{fontSize:"16px",cursor:"pointer",color:r?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.25)","&:hover":{color:r?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.45)"}}}):a.jsx(m.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"18px",color:r?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)"}})});return a.jsxs("div",{id:l,className:E("w-full flex flex-col gap-1",S),onMouseDown:e=>e.stopPropagation(),role:"group","aria-labelledby":i?l+"Label":void 0,children:[i&&a.jsxs("label",{id:l+"Label",htmlFor:"text",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${D?"":"capitalize"}`,children:[a.jsx(A.InputLabel,{label:i||"",required:s||!1}),a.jsx(O.Label,{labels:j}),b&&a.jsx(P.Tooltip,{placement:"top",title:b,children:a.jsx("div",{className:"cursor-pointer",children:a.jsx(T.HelpIcon,{})})})]}),a.jsx("div",{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:a.jsx(M,{...I,id:"cm"+i,classNamePrefix:"lax-select",required:s,options:h,isClearable:!1,isLoading:y,isDisabled:d,styles:z,isMulti:t,value:t?c:p,onChange:f,filterOption:w,placeholder:k,classNames:{menuList:()=>"nowheel"},components:{DropdownIndicator:H,IndicatorSeparator:()=>null}})}),n&&a.jsx(V.Typography,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})]})};v.displayName="CreatableSelectField";exports.CreatableSelectField=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),E=require("../../../_virtual/index.cjs.js"),M=require("react-select/creatable"),g=require("@mui/icons-material"),P=require("antd"),V=require("../../data-display/typography/Typography.cjs.js"),T=require("../../icons/HelpIcon.cjs.js"),O=require("../../data-display/label/Label.cjs.js"),$=require("react"),A=require("../shared/InputLabel.cjs.js"),B=require("../../../hooks/useIsDarkMode.cjs.js"),v=({id:l,label:i,errorMessage:n,selectOptions:h,loading:y,isClearable:C,multiSelect:t,selectedValues:c,disabled:d,required:s,value:p,className:S,tooltip:b,tags:j,originalCase:w=!1,onChange:x,filterOption:D,placeholder:k,...I})=>{const r=B.useIsDarkMode(),[L,u]=$.useState(!1),f=(e,o)=>{x&&x(e);const m=document.getElementById(l);if(m){const H=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${l}`,value:e,type:"change"}});m.dispatchEvent(H)}},F={control:(e,o)=>({...e,borderColor:n&&s?r?"#F04438":"#fda49b":o.isFocused?"var(--color-primary-600)":r?"#434343":"#d9d9d9",backgroundColor:r?"#141414":o.isDisabled?"#f5f5f5":"#fff",borderRadius:"6px",padding:"0 4px 0 12px",opacity:o.isDisabled?.6:1,cursor:o.isDisabled?"not-allowed":"pointer",boxShadow:o.isFocused?r?"0 0 0 1.5px var(--color-primary-950)":"0 0 0 1.5px var(--color-primary-100)":"none","&:hover":{borderColor:n&&s?r?"#F04438":"#fda49b":"var(--color-primary-600)"}}),valueContainer:e=>({...e,fontSize:"14px",padding:0}),input:e=>({...e,margin:"0",padding:"0",color:r?"rgba(255,255,255,0.85)":"inherit"}),indicatorsContainer:e=>({...e,padding:0}),option:(e,o)=>({...e,fontSize:"14px",lineHeight:"22px",padding:"5px 12px",margin:0,backgroundColor:o.isSelected?r?"var(--color-primary-975)":"var(--color-primary-50)":o.isFocused?r?"var(--color-primary-950)":"var(--color-primary-100)":r?"#141414":"#fff",color:o.isDisabled?r?"rgba(255,255,255,0.25)":"#a3a3a3":r?o.isSelected?"var(--color-primary-600)":"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)",cursor:o.isDisabled?"not-allowed":"pointer",opacity:o.isDisabled?.6:1,"&:hover":{backgroundColor:o.isDisabled?r?"#141414":"#fff":r?"var(--color-primary-950)":"var(--color-primary-100)"},"&:active":{backgroundColor:r?"var(--color-primary-950)":"var(--color-primary-50)"}}),singleValue:(e,o)=>({...e,fontSize:"14px",lineHeight:"20px",color:o.isDisabled?r?"rgba(255,255,255,0.25)":"#a3a3a3":r?"rgba(255,255,255,0.85)":"rgba(0,0,0,0.88)"}),placeholder:e=>({...e,fontSize:"14px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:r?"rgba(255,255,255,0.25)":"#bfbfbf"}),multiValue:e=>({...e,backgroundColor:r?"rgba(255,255,255,0.08)":"#f0f5ff",border:r?"1px solid transparent":"1px solid #adc6ff",borderRadius:"4px"}),multiValueLabel:e=>({...e,color:r?"rgba(255,255,255,0.85)":"var(--color-primary-600)",fontSize:"12px"}),multiValueRemove:e=>({...e,color:r?"rgba(255,255,255,0.85)":"var(--color-primary-600)","&:hover":{backgroundColor:r?"rgba(255,255,255,0.16)":"#e6f4ff",color:r?"#fff":"var(--color-primary-600)"}}),menu:e=>({...e,zIndex:5001,borderRadius:"8px",boxShadow:r?"0 6px 16px 0 rgba(0,0,0,0.45)":"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)",backgroundColor:r?"#141414":"#fff",border:r?"1px solid #303030":"none",overflow:"hidden"}),menuList:e=>({...e,padding:"0",maxHeight:"256px"})},z=!!c?.length,N=L&&!d&&(C?z||!!p:!1),q=e=>{e.stopPropagation(),e.preventDefault(),f(t?[]:null)},R=()=>a.jsx("div",{className:"flex items-center",children:N?a.jsx(g.CancelRounded,{onClick:q,sx:{fontSize:"16px",cursor:"pointer",color:r?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.25)","&:hover":{color:r?"rgba(255,255,255,0.65)":"rgba(0,0,0,0.45)"}}}):a.jsx(g.ChevronLeftRounded,{className:"-rotate-90",sx:{fontSize:"18px",color:r?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.25)"}})});return a.jsxs("div",{id:l,className:E("w-full flex flex-col gap-1",S),onMouseDown:e=>e.stopPropagation(),role:"group","aria-labelledby":i?l+"Label":void 0,children:[i&&a.jsxs("label",{id:l+"Label",htmlFor:"text",className:`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${w?"":"capitalize"}`,children:[a.jsx(A.InputLabel,{label:i||"",required:s||!1}),a.jsx(O.Label,{labels:j}),b&&a.jsx(P.Tooltip,{placement:"top",title:b,children:a.jsx("div",{className:"cursor-pointer",children:a.jsx(T.HelpIcon,{className:"w-icon-sm h-icon-sm"})})})]}),a.jsx("div",{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:a.jsx(M,{...I,id:"cm"+i,classNamePrefix:"lax-select",required:s,options:h,isClearable:!1,isLoading:y,isDisabled:d,styles:F,isMulti:t,value:t?c:p,onChange:f,filterOption:D,placeholder:k,classNames:{menuList:()=>"nowheel",control:()=>"!min-h-8 !text-sm"},components:{DropdownIndicator:R,IndicatorSeparator:()=>null}})}),n&&a.jsx(V.Typography,{className:"text-error-500",appearance:"custom",size:"extra-small",variant:"medium",children:n})]})};v.displayName="CreatableSelectField";exports.CreatableSelectField=v;
2
2
  //# sourceMappingURL=CreatableSelect.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CreatableSelect.cjs.js","sources":["../../../../src/components/forms/creatable-select/CreatableSelect.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport CreatableSelect from \"react-select/creatable\";\nimport { CancelRounded, ChevronLeftRounded } from \"@mui/icons-material\";\nimport { Tooltip } from \"antd\";\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 { useState, type ComponentProps } from \"react\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { useIsDarkMode } from \"../../../hooks/useIsDarkMode\";\n\n/**\n * Option type for the CreatableSelect component\n */\nexport interface SelectOption {\n /** The value of the option */\n value: string | number;\n /** The label displayed for the option */\n label: string;\n /** Whether the option is disabled */\n isDisabled?: boolean;\n /** Additional data for the option */\n data?: Record<string, unknown>;\n}\n\n/**\n * Props for the CreatableSelectField component\n * Matches the lax-web-portal implementation for drop-in replacement\n */\nexport type TProps = {\n /** Unique identifier for the select */\n id: string;\n /** Label text to display above the select */\n label: string;\n /** Placeholder text for the select */\n placeholder?: string;\n /** Current value for single select */\n value?: any;\n /** Callback function called when selection changes */\n onChange(data: any): void;\n /** Error message to display below the select */\n errorMessage?: string;\n /** Array of available options */\n selectOptions: any[];\n /** Whether the select is in loading state */\n loading?: boolean;\n /** Whether multiple selections are allowed */\n multiSelect?: boolean;\n /** Current values for multi select */\n selectedValues?: any[];\n /** Custom filter function for options */\n filterOption?: any;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Whether the select is disabled */\n disabled?: boolean;\n /** Whether the select is clearable */\n isClearable?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Additional CSS classes for the wrapper */\n className?: string;\n};\n\n// Export type alias for backward compatibility\nexport type CreatableSelectProps = TProps & ComponentProps<typeof CreatableSelect>;\n\n/**\n * A creatable select component with label, validation, and styling support.\n * Features dark mode support, accessibility enhancements, and comprehensive prop support.\n * Built on top of react-select/creatable for advanced functionality.\n *\n * This component is designed as a drop-in replacement for the lax-web-portal\n * CreatableSelectField component.\n *\n * @example\n * ```tsx\n * <CreatableSelectField\n * id=\"tags\"\n * label=\"Tags\"\n * selectOptions={tagOptions}\n * value={selectedTag}\n * onChange={(newValue) => setSelectedTag(newValue)}\n * placeholder=\"Select or create tags...\"\n * multiSelect\n * />\n * ```\n */\nexport const CreatableSelectField = ({\n id,\n label,\n errorMessage,\n selectOptions,\n loading,\n isClearable,\n multiSelect,\n selectedValues,\n disabled,\n required,\n value,\n className,\n tooltip,\n tags,\n originalCase = false,\n onChange,\n filterOption,\n placeholder,\n ...props\n}: TProps & ComponentProps<typeof CreatableSelect>) => {\n const isDarkMode = useIsDarkMode();\n const [isHovered, setIsHovered] = useState(false);\n\n const handleChange = (newValue: any, _actionMeta?: any) => {\n // Call the original onChange handler\n if (onChange) {\n onChange(newValue);\n }\n\n // Dispatch pilot-change event for recording\n const containerElement = document.getElementById(id);\n if (containerElement) {\n const pilotChangeEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: newValue,\n type: \"change\",\n },\n });\n containerElement.dispatchEvent(pilotChangeEvent);\n }\n };\n\n const styleProps = {\n control: (baseStyles: any, state: any) => ({\n ...baseStyles,\n borderColor:\n errorMessage && required\n ? isDarkMode ? \"#F04438\" : \"#fda49b\"\n : state.isFocused\n ? \"var(--color-primary-600)\"\n : isDarkMode ? \"#434343\" : \"#d9d9d9\",\n backgroundColor: isDarkMode\n ? \"#141414\"\n : state.isDisabled ? \"#f5f5f5\" : \"#fff\",\n borderRadius: \"6px\",\n minHeight: \"32px\",\n fontSize: \"14px\",\n padding: \"0 4px 0 12px\",\n opacity: state.isDisabled ? 0.6 : 1,\n cursor: state.isDisabled ? \"not-allowed\" : \"pointer\",\n boxShadow: state.isFocused\n ? isDarkMode\n ? \"0 0 0 1.5px var(--color-primary-950)\"\n : \"0 0 0 1.5px var(--color-primary-100)\"\n : \"none\",\n \"&:hover\": {\n borderColor:\n errorMessage && required\n ? isDarkMode ? \"#F04438\" : \"#fda49b\"\n : \"var(--color-primary-600)\",\n },\n }),\n valueContainer: (baseStyles: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n padding: 0,\n }),\n input: (baseStyles: any) => ({\n ...baseStyles,\n margin: \"0\",\n padding: \"0\",\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"inherit\",\n }),\n indicatorsContainer: (baseStyles: any) => ({\n ...baseStyles,\n padding: 0,\n }),\n option: (baseStyles: any, state: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n lineHeight: \"22px\",\n padding: \"5px 12px\",\n margin: 0,\n backgroundColor: state.isSelected\n ? isDarkMode ? \"var(--color-primary-975)\" : \"var(--color-primary-50)\"\n : state.isFocused\n ? isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-100)\"\n : isDarkMode ? \"#141414\" : \"#fff\",\n color: state.isDisabled\n ? isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#a3a3a3\"\n : isDarkMode\n ? state.isSelected\n ? \"var(--color-primary-600)\"\n : \"rgba(255,255,255,0.85)\"\n : \"rgba(0,0,0,0.88)\",\n cursor: state.isDisabled ? \"not-allowed\" : \"pointer\",\n opacity: state.isDisabled ? 0.6 : 1,\n \"&:hover\": {\n backgroundColor: state.isDisabled\n ? isDarkMode ? \"#141414\" : \"#fff\"\n : isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-100)\",\n },\n \"&:active\": {\n backgroundColor: isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-50)\",\n },\n }),\n singleValue: (baseStyles: any, state: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n lineHeight: \"20px\",\n color: state.isDisabled\n ? isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#a3a3a3\"\n : isDarkMode ? \"rgba(255,255,255,0.85)\" : \"rgba(0,0,0,0.88)\",\n }),\n placeholder: (baseStyles: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n whiteSpace: \"nowrap\" as const,\n textOverflow: \"ellipsis\",\n overflow: \"hidden\",\n color: isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#bfbfbf\",\n }),\n multiValue: (baseStyles: any) => ({\n ...baseStyles,\n backgroundColor: isDarkMode ? \"rgba(255,255,255,0.08)\" : \"#f0f5ff\",\n border: isDarkMode ? \"1px solid transparent\" : \"1px solid #adc6ff\",\n borderRadius: \"4px\",\n }),\n multiValueLabel: (baseStyles: any) => ({\n ...baseStyles,\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"var(--color-primary-600)\",\n fontSize: \"12px\",\n }),\n multiValueRemove: (baseStyles: any) => ({\n ...baseStyles,\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"var(--color-primary-600)\",\n \"&:hover\": {\n backgroundColor: isDarkMode ? \"rgba(255,255,255,0.16)\" : \"#e6f4ff\",\n color: isDarkMode ? \"#fff\" : \"var(--color-primary-600)\",\n },\n }),\n menu: (baseStyles: any) => ({\n ...baseStyles,\n zIndex: 5001,\n borderRadius: \"8px\",\n boxShadow: isDarkMode\n ? \"0 6px 16px 0 rgba(0,0,0,0.45)\"\n : \"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)\",\n backgroundColor: isDarkMode ? \"#141414\" : \"#fff\",\n border: isDarkMode ? \"1px solid #303030\" : \"none\",\n overflow: \"hidden\",\n }),\n menuList: (baseStyles: any) => ({\n ...baseStyles,\n padding: \"0\",\n maxHeight: \"256px\",\n }),\n };\n\n const hasSelectedValues = !!selectedValues?.length;\n const hasValue = !!value;\n const isFieldClearable = isClearable ? hasSelectedValues || hasValue : false;\n const showClearIcon = isHovered && !disabled && isFieldClearable;\n\n const handleClear = (e: React.MouseEvent) => {\n e.stopPropagation();\n e.preventDefault();\n handleChange(multiSelect ? [] : null);\n };\n\n const DropdownIndicator = () => (\n <div className=\"flex items-center\">\n {showClearIcon ? (\n <CancelRounded\n onClick={handleClear}\n sx={{\n fontSize: \"16px\",\n cursor: \"pointer\",\n color: isDarkMode ? \"rgba(255,255,255,0.45)\" : \"rgba(0,0,0,0.25)\",\n \"&:hover\": {\n color: isDarkMode ? \"rgba(255,255,255,0.65)\" : \"rgba(0,0,0,0.45)\",\n },\n }}\n />\n ) : (\n <ChevronLeftRounded\n className=\"-rotate-90\"\n sx={{\n fontSize: \"18px\",\n color: isDarkMode ? \"rgba(255,255,255,0.25)\" : \"rgba(0,0,0,0.25)\",\n }}\n />\n )}\n </div>\n );\n\n return (\n <div\n id={id}\n className={cn(\"w-full flex flex-col gap-1\", className)}\n onMouseDown={(e) => e.stopPropagation()}\n role=\"group\"\n aria-labelledby={label ? id + \"Label\" : undefined}\n >\n {label && (\n <label\n id={id + \"Label\"}\n htmlFor=\"text\"\n className={`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${!originalCase ? \"capitalize\" : \"\"}`}\n >\n <InputLabel label={label || \"\"} required={required || false} />\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 </label>\n )}\n\n <div\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <CreatableSelect\n {...props}\n id={\"cm\" + label}\n classNamePrefix=\"lax-select\"\n required={required}\n options={selectOptions}\n isClearable={false}\n isLoading={loading}\n isDisabled={disabled}\n styles={styleProps}\n isMulti={multiSelect}\n value={multiSelect ? selectedValues : value}\n onChange={handleChange}\n filterOption={filterOption}\n placeholder={placeholder}\n classNames={{\n menuList: () => \"nowheel\",\n }}\n components={{\n DropdownIndicator,\n IndicatorSeparator: () => null,\n }}\n />\n </div>\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};\n\nCreatableSelectField.displayName = \"CreatableSelectField\";\n"],"names":["CreatableSelectField","id","label","errorMessage","selectOptions","loading","isClearable","multiSelect","selectedValues","disabled","required","value","className","tooltip","tags","originalCase","onChange","filterOption","placeholder","props","isDarkMode","useIsDarkMode","isHovered","setIsHovered","useState","handleChange","newValue","_actionMeta","containerElement","pilotChangeEvent","styleProps","baseStyles","state","hasSelectedValues","showClearIcon","handleClear","DropdownIndicator","jsx","CancelRounded","ChevronLeftRounded","jsxs","cn","InputLabel","Label","Tooltip","HelpIcon","CreatableSelect","Typography"],"mappings":"8fA8FaA,EAAuB,CAAC,CACnC,GAAAC,EACA,MAA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EAKNR,EAAAA,IAAC,MAAA,CACC,aAAc,IAAMd,EAAa,EAAI,EACrC,aAAc,IAAMA,EAAa,EAAK,EAEtC,SAAAc,EAAAA,IAACS,EAAA,CACE,GAAG3B,EACJ,GAAI,KAAOjB,EACX,gBAAgB,aAChB,SAAAQ,EACA,QAASN,EACT,YAAa,GACb,UAAWC,EACX,WAAYI,EACZ,OAAQqB,EACR,QAASvB,EACT,MAAOA,EAAcC,EAAiBG,EACtC,SAAUc,EACV,aAAAR,EACA,YAAAC,EACA,WAAY,CACV,SAAU,IAAM,SAAA,EAElB,WAAY,CACV,kBAAAkB,EACA,mBAAoB,IAAM,IAAA,CAC5B,CAAA,CACF,CAAA,EAEDjC,GACCkC,EAAAA,IAACU,EAAAA,WAAA,CACC,UAAU,iBACV,WAAW,SACX,KAAK,cACL,QAAQ,SAEP,SAAA5C,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,EAEAH,EAAqB,YAAc"}
1
+ {"version":3,"file":"CreatableSelect.cjs.js","sources":["../../../../src/components/forms/creatable-select/CreatableSelect.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport CreatableSelect from \"react-select/creatable\";\nimport { CancelRounded, ChevronLeftRounded } from \"@mui/icons-material\";\nimport { Tooltip } from \"antd\";\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 { useState, type ComponentProps } from \"react\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { useIsDarkMode } from \"../../../hooks/useIsDarkMode\";\n\n/**\n * Option type for the CreatableSelect component\n */\nexport interface SelectOption {\n /** The value of the option */\n value: string | number;\n /** The label displayed for the option */\n label: string;\n /** Whether the option is disabled */\n isDisabled?: boolean;\n /** Additional data for the option */\n data?: Record<string, unknown>;\n}\n\n/**\n * Props for the CreatableSelectField component\n * Matches the lax-web-portal implementation for drop-in replacement\n */\nexport type TProps = {\n /** Unique identifier for the select */\n id: string;\n /** Label text to display above the select */\n label: string;\n /** Placeholder text for the select */\n placeholder?: string;\n /** Current value for single select */\n value?: any;\n /** Callback function called when selection changes */\n onChange(data: any): void;\n /** Error message to display below the select */\n errorMessage?: string;\n /** Array of available options */\n selectOptions: any[];\n /** Whether the select is in loading state */\n loading?: boolean;\n /** Whether multiple selections are allowed */\n multiSelect?: boolean;\n /** Current values for multi select */\n selectedValues?: any[];\n /** Custom filter function for options */\n filterOption?: any;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Whether the select is disabled */\n disabled?: boolean;\n /** Whether the select is clearable */\n isClearable?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Additional CSS classes for the wrapper */\n className?: string;\n};\n\n// Export type alias for backward compatibility\nexport type CreatableSelectProps = TProps & ComponentProps<typeof CreatableSelect>;\n\n/**\n * A creatable select component with label, validation, and styling support.\n * Features dark mode support, accessibility enhancements, and comprehensive prop support.\n * Built on top of react-select/creatable for advanced functionality.\n *\n * This component is designed as a drop-in replacement for the lax-web-portal\n * CreatableSelectField component.\n *\n * @example\n * ```tsx\n * <CreatableSelectField\n * id=\"tags\"\n * label=\"Tags\"\n * selectOptions={tagOptions}\n * value={selectedTag}\n * onChange={(newValue) => setSelectedTag(newValue)}\n * placeholder=\"Select or create tags...\"\n * multiSelect\n * />\n * ```\n */\nexport const CreatableSelectField = ({\n id,\n label,\n errorMessage,\n selectOptions,\n loading,\n isClearable,\n multiSelect,\n selectedValues,\n disabled,\n required,\n value,\n className,\n tooltip,\n tags,\n originalCase = false,\n onChange,\n filterOption,\n placeholder,\n ...props\n}: TProps & ComponentProps<typeof CreatableSelect>) => {\n const isDarkMode = useIsDarkMode();\n const [isHovered, setIsHovered] = useState(false);\n\n const handleChange = (newValue: any, _actionMeta?: any) => {\n // Call the original onChange handler\n if (onChange) {\n onChange(newValue);\n }\n\n // Dispatch pilot-change event for recording\n const containerElement = document.getElementById(id);\n if (containerElement) {\n const pilotChangeEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: newValue,\n type: \"change\",\n },\n });\n containerElement.dispatchEvent(pilotChangeEvent);\n }\n };\n\n const styleProps = {\n control: (baseStyles: any, state: any) => ({\n ...baseStyles,\n borderColor:\n errorMessage && required\n ? isDarkMode ? \"#F04438\" : \"#fda49b\"\n : state.isFocused\n ? \"var(--color-primary-600)\"\n : isDarkMode ? \"#434343\" : \"#d9d9d9\",\n backgroundColor: isDarkMode\n ? \"#141414\"\n : state.isDisabled ? \"#f5f5f5\" : \"#fff\",\n borderRadius: \"6px\",\n padding: \"0 4px 0 12px\",\n opacity: state.isDisabled ? 0.6 : 1,\n cursor: state.isDisabled ? \"not-allowed\" : \"pointer\",\n boxShadow: state.isFocused\n ? isDarkMode\n ? \"0 0 0 1.5px var(--color-primary-950)\"\n : \"0 0 0 1.5px var(--color-primary-100)\"\n : \"none\",\n \"&:hover\": {\n borderColor:\n errorMessage && required\n ? isDarkMode ? \"#F04438\" : \"#fda49b\"\n : \"var(--color-primary-600)\",\n },\n }),\n valueContainer: (baseStyles: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n padding: 0,\n }),\n input: (baseStyles: any) => ({\n ...baseStyles,\n margin: \"0\",\n padding: \"0\",\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"inherit\",\n }),\n indicatorsContainer: (baseStyles: any) => ({\n ...baseStyles,\n padding: 0,\n }),\n option: (baseStyles: any, state: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n lineHeight: \"22px\",\n padding: \"5px 12px\",\n margin: 0,\n backgroundColor: state.isSelected\n ? isDarkMode ? \"var(--color-primary-975)\" : \"var(--color-primary-50)\"\n : state.isFocused\n ? isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-100)\"\n : isDarkMode ? \"#141414\" : \"#fff\",\n color: state.isDisabled\n ? isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#a3a3a3\"\n : isDarkMode\n ? state.isSelected\n ? \"var(--color-primary-600)\"\n : \"rgba(255,255,255,0.85)\"\n : \"rgba(0,0,0,0.88)\",\n cursor: state.isDisabled ? \"not-allowed\" : \"pointer\",\n opacity: state.isDisabled ? 0.6 : 1,\n \"&:hover\": {\n backgroundColor: state.isDisabled\n ? isDarkMode ? \"#141414\" : \"#fff\"\n : isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-100)\",\n },\n \"&:active\": {\n backgroundColor: isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-50)\",\n },\n }),\n singleValue: (baseStyles: any, state: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n lineHeight: \"20px\",\n color: state.isDisabled\n ? isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#a3a3a3\"\n : isDarkMode ? \"rgba(255,255,255,0.85)\" : \"rgba(0,0,0,0.88)\",\n }),\n placeholder: (baseStyles: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n whiteSpace: \"nowrap\" as const,\n textOverflow: \"ellipsis\",\n overflow: \"hidden\",\n color: isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#bfbfbf\",\n }),\n multiValue: (baseStyles: any) => ({\n ...baseStyles,\n backgroundColor: isDarkMode ? \"rgba(255,255,255,0.08)\" : \"#f0f5ff\",\n border: isDarkMode ? \"1px solid transparent\" : \"1px solid #adc6ff\",\n borderRadius: \"4px\",\n }),\n multiValueLabel: (baseStyles: any) => ({\n ...baseStyles,\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"var(--color-primary-600)\",\n fontSize: \"12px\",\n }),\n multiValueRemove: (baseStyles: any) => ({\n ...baseStyles,\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"var(--color-primary-600)\",\n \"&:hover\": {\n backgroundColor: isDarkMode ? \"rgba(255,255,255,0.16)\" : \"#e6f4ff\",\n color: isDarkMode ? \"#fff\" : \"var(--color-primary-600)\",\n },\n }),\n menu: (baseStyles: any) => ({\n ...baseStyles,\n zIndex: 5001,\n borderRadius: \"8px\",\n boxShadow: isDarkMode\n ? \"0 6px 16px 0 rgba(0,0,0,0.45)\"\n : \"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)\",\n backgroundColor: isDarkMode ? \"#141414\" : \"#fff\",\n border: isDarkMode ? \"1px solid #303030\" : \"none\",\n overflow: \"hidden\",\n }),\n menuList: (baseStyles: any) => ({\n ...baseStyles,\n padding: \"0\",\n maxHeight: \"256px\",\n }),\n };\n\n const hasSelectedValues = !!selectedValues?.length;\n const hasValue = !!value;\n const isFieldClearable = isClearable ? hasSelectedValues || hasValue : false;\n const showClearIcon = isHovered && !disabled && isFieldClearable;\n\n const handleClear = (e: React.MouseEvent) => {\n e.stopPropagation();\n e.preventDefault();\n handleChange(multiSelect ? [] : null);\n };\n\n const DropdownIndicator = () => (\n <div className=\"flex items-center\">\n {showClearIcon ? (\n <CancelRounded\n onClick={handleClear}\n sx={{\n fontSize: \"16px\",\n cursor: \"pointer\",\n color: isDarkMode ? \"rgba(255,255,255,0.45)\" : \"rgba(0,0,0,0.25)\",\n \"&:hover\": {\n color: isDarkMode ? \"rgba(255,255,255,0.65)\" : \"rgba(0,0,0,0.45)\",\n },\n }}\n />\n ) : (\n <ChevronLeftRounded\n className=\"-rotate-90\"\n sx={{\n fontSize: \"18px\",\n color: isDarkMode ? \"rgba(255,255,255,0.25)\" : \"rgba(0,0,0,0.25)\",\n }}\n />\n )}\n </div>\n );\n\n return (\n <div\n id={id}\n className={cn(\"w-full flex flex-col gap-1\", className)}\n onMouseDown={(e) => e.stopPropagation()}\n role=\"group\"\n aria-labelledby={label ? id + \"Label\" : undefined}\n >\n {label && (\n <label\n id={id + \"Label\"}\n htmlFor=\"text\"\n className={`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${!originalCase ? \"capitalize\" : \"\"}`}\n >\n <InputLabel label={label || \"\"} required={required || false} />\n <Label labels={tags} />\n {tooltip && (\n <Tooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n </label>\n )}\n\n <div\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <CreatableSelect\n {...props}\n id={\"cm\" + label}\n classNamePrefix=\"lax-select\"\n required={required}\n options={selectOptions}\n isClearable={false}\n isLoading={loading}\n isDisabled={disabled}\n styles={styleProps}\n isMulti={multiSelect}\n value={multiSelect ? selectedValues : value}\n onChange={handleChange}\n filterOption={filterOption}\n placeholder={placeholder}\n classNames={{\n menuList: () => \"nowheel\",\n control: ()=> \"!min-h-8 !text-sm\"\n }}\n components={{\n DropdownIndicator,\n IndicatorSeparator: () => null,\n }}\n />\n </div>\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};\n\nCreatableSelectField.displayName = \"CreatableSelectField\";\n"],"names":["CreatableSelectField","id","label","errorMessage","selectOptions","loading","isClearable","multiSelect","selectedValues","disabled","required","value","className","tooltip","tags","originalCase","onChange","filterOption","placeholder","props","isDarkMode","useIsDarkMode","isHovered","setIsHovered","useState","handleChange","newValue","_actionMeta","containerElement","pilotChangeEvent","styleProps","baseStyles","state","hasSelectedValues","showClearIcon","handleClear","DropdownIndicator","jsx","CancelRounded","ChevronLeftRounded","jsxs","cn","InputLabel","Label","Tooltip","HelpIcon","CreatableSelect","Typography"],"mappings":"8fA8FaA,EAAuB,CAAC,CACnC,GAAAC,EACA,MAAAC,EACA,aAAAC,EACA,cAAAC,EACA,QAAAC,EACA,YAAAC,EACA,YAAAC,EACA,eAAAC,EACA,SAAAC,EACA,S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S,EAAA,CACE,GAAG3B,EACJ,GAAI,KAAOjB,EACX,gBAAgB,aAChB,SAAAQ,EACA,QAASN,EACT,YAAa,GACb,UAAWC,EACX,WAAYI,EACZ,OAAQqB,EACR,QAASvB,EACT,MAAOA,EAAcC,EAAiBG,EACtC,SAAUc,EACV,aAAAR,EACA,YAAAC,EACA,WAAY,CACV,SAAU,IAAM,UAChB,QAAS,IAAK,mBAAA,EAEhB,WAAY,CACV,kBAAAkB,EACA,mBAAoB,IAAM,IAAA,CAC5B,CAAA,CACF,CAAA,EAEDjC,GACCkC,EAAAA,IAACU,EAAAA,WAAA,CACC,UAAU,iBACV,WAAW,SACX,KAAK,cACL,QAAQ,SAEP,SAAA5C,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,EAEAH,EAAqB,YAAc"}
@@ -16,9 +16,9 @@ const J = ({
16
16
  selectOptions: v,
17
17
  loading: h,
18
18
  isClearable: y,
19
- multiSelect: p,
20
- selectedValues: s,
21
- disabled: c,
19
+ multiSelect: s,
20
+ selectedValues: c,
21
+ disabled: p,
22
22
  required: t,
23
23
  value: d,
24
24
  className: C,
@@ -50,8 +50,6 @@ const J = ({
50
50
  borderColor: n && t ? r ? "#F04438" : "#fda49b" : e.isFocused ? "var(--color-primary-600)" : r ? "#434343" : "#d9d9d9",
51
51
  backgroundColor: r ? "#141414" : e.isDisabled ? "#f5f5f5" : "#fff",
52
52
  borderRadius: "6px",
53
- minHeight: "32px",
54
- fontSize: "14px",
55
53
  padding: "0 4px 0 12px",
56
54
  opacity: e.isDisabled ? 0.6 : 1,
57
55
  cursor: e.isDisabled ? "not-allowed" : "pointer",
@@ -139,12 +137,12 @@ const J = ({
139
137
  padding: "0",
140
138
  maxHeight: "256px"
141
139
  })
142
- }, I = !!s?.length, N = F && !c && (y ? I || !!d : !1), H = (o) => {
143
- o.stopPropagation(), o.preventDefault(), x(p ? [] : null);
144
- }, E = () => /* @__PURE__ */ a("div", { className: "flex items-center", children: N ? /* @__PURE__ */ a(
140
+ }, N = !!c?.length, I = F && !p && (y ? N || !!d : !1), E = (o) => {
141
+ o.stopPropagation(), o.preventDefault(), x(s ? [] : null);
142
+ }, H = () => /* @__PURE__ */ a("div", { className: "flex items-center", children: I ? /* @__PURE__ */ a(
145
143
  P,
146
144
  {
147
- onClick: H,
145
+ onClick: E,
148
146
  sx: {
149
147
  fontSize: "16px",
150
148
  cursor: "pointer",
@@ -182,7 +180,7 @@ const J = ({
182
180
  children: [
183
181
  /* @__PURE__ */ a(A, { label: i || "", required: t || !1 }),
184
182
  /* @__PURE__ */ a(O, { labels: S }),
185
- m && /* @__PURE__ */ a(T, { placement: "top", title: m, children: /* @__PURE__ */ a("div", { className: "cursor-pointer", children: /* @__PURE__ */ a(B, {}) }) })
183
+ m && /* @__PURE__ */ a(T, { placement: "top", title: m, children: /* @__PURE__ */ a("div", { className: "cursor-pointer", children: /* @__PURE__ */ a(B, { className: "w-icon-sm h-icon-sm" }) }) })
186
184
  ]
187
185
  }
188
186
  ),
@@ -201,18 +199,19 @@ const J = ({
201
199
  options: v,
202
200
  isClearable: !1,
203
201
  isLoading: h,
204
- isDisabled: c,
202
+ isDisabled: p,
205
203
  styles: L,
206
- isMulti: p,
207
- value: p ? s : d,
204
+ isMulti: s,
205
+ value: s ? c : d,
208
206
  onChange: x,
209
207
  filterOption: D,
210
208
  placeholder: k,
211
209
  classNames: {
212
- menuList: () => "nowheel"
210
+ menuList: () => "nowheel",
211
+ control: () => "!min-h-8 !text-sm"
213
212
  },
214
213
  components: {
215
- DropdownIndicator: E,
214
+ DropdownIndicator: H,
216
215
  IndicatorSeparator: () => null
217
216
  }
218
217
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CreatableSelect.es.js","sources":["../../../../src/components/forms/creatable-select/CreatableSelect.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport CreatableSelect from \"react-select/creatable\";\nimport { CancelRounded, ChevronLeftRounded } from \"@mui/icons-material\";\nimport { Tooltip } from \"antd\";\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 { useState, type ComponentProps } from \"react\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { useIsDarkMode } from \"../../../hooks/useIsDarkMode\";\n\n/**\n * Option type for the CreatableSelect component\n */\nexport interface SelectOption {\n /** The value of the option */\n value: string | number;\n /** The label displayed for the option */\n label: string;\n /** Whether the option is disabled */\n isDisabled?: boolean;\n /** Additional data for the option */\n data?: Record<string, unknown>;\n}\n\n/**\n * Props for the CreatableSelectField component\n * Matches the lax-web-portal implementation for drop-in replacement\n */\nexport type TProps = {\n /** Unique identifier for the select */\n id: string;\n /** Label text to display above the select */\n label: string;\n /** Placeholder text for the select */\n placeholder?: string;\n /** Current value for single select */\n value?: any;\n /** Callback function called when selection changes */\n onChange(data: any): void;\n /** Error message to display below the select */\n errorMessage?: string;\n /** Array of available options */\n selectOptions: any[];\n /** Whether the select is in loading state */\n loading?: boolean;\n /** Whether multiple selections are allowed */\n multiSelect?: boolean;\n /** Current values for multi select */\n selectedValues?: any[];\n /** Custom filter function for options */\n filterOption?: any;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Whether the select is disabled */\n disabled?: boolean;\n /** Whether the select is clearable */\n isClearable?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Additional CSS classes for the wrapper */\n className?: string;\n};\n\n// Export type alias for backward compatibility\nexport type CreatableSelectProps = TProps & ComponentProps<typeof CreatableSelect>;\n\n/**\n * A creatable select component with label, validation, and styling support.\n * Features dark mode support, accessibility enhancements, and comprehensive prop support.\n * Built on top of react-select/creatable for advanced functionality.\n *\n * This component is designed as a drop-in replacement for the lax-web-portal\n * CreatableSelectField component.\n *\n * @example\n * ```tsx\n * <CreatableSelectField\n * id=\"tags\"\n * label=\"Tags\"\n * selectOptions={tagOptions}\n * value={selectedTag}\n * onChange={(newValue) => setSelectedTag(newValue)}\n * placeholder=\"Select or create tags...\"\n * multiSelect\n * />\n * ```\n */\nexport const CreatableSelectField = ({\n id,\n label,\n errorMessage,\n selectOptions,\n loading,\n isClearable,\n multiSelect,\n selectedValues,\n disabled,\n required,\n value,\n className,\n tooltip,\n tags,\n originalCase = false,\n onChange,\n filterOption,\n placeholder,\n ...props\n}: TProps & ComponentProps<typeof CreatableSelect>) => {\n const isDarkMode = useIsDarkMode();\n const [isHovered, setIsHovered] = useState(false);\n\n const handleChange = (newValue: any, _actionMeta?: any) => {\n // Call the original onChange handler\n if (onChange) {\n onChange(newValue);\n }\n\n // Dispatch pilot-change event for recording\n const containerElement = document.getElementById(id);\n if (containerElement) {\n const pilotChangeEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: newValue,\n type: \"change\",\n },\n });\n containerElement.dispatchEvent(pilotChangeEvent);\n }\n };\n\n const styleProps = {\n control: (baseStyles: any, state: any) => ({\n ...baseStyles,\n borderColor:\n errorMessage && required\n ? isDarkMode ? \"#F04438\" : \"#fda49b\"\n : state.isFocused\n ? \"var(--color-primary-600)\"\n : isDarkMode ? \"#434343\" : \"#d9d9d9\",\n backgroundColor: isDarkMode\n ? \"#141414\"\n : state.isDisabled ? \"#f5f5f5\" : \"#fff\",\n borderRadius: \"6px\",\n minHeight: \"32px\",\n fontSize: \"14px\",\n padding: \"0 4px 0 12px\",\n opacity: state.isDisabled ? 0.6 : 1,\n cursor: state.isDisabled ? \"not-allowed\" : \"pointer\",\n boxShadow: state.isFocused\n ? isDarkMode\n ? \"0 0 0 1.5px var(--color-primary-950)\"\n : \"0 0 0 1.5px var(--color-primary-100)\"\n : \"none\",\n \"&:hover\": {\n borderColor:\n errorMessage && required\n ? isDarkMode ? \"#F04438\" : \"#fda49b\"\n : \"var(--color-primary-600)\",\n },\n }),\n valueContainer: (baseStyles: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n padding: 0,\n }),\n input: (baseStyles: any) => ({\n ...baseStyles,\n margin: \"0\",\n padding: \"0\",\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"inherit\",\n }),\n indicatorsContainer: (baseStyles: any) => ({\n ...baseStyles,\n padding: 0,\n }),\n option: (baseStyles: any, state: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n lineHeight: \"22px\",\n padding: \"5px 12px\",\n margin: 0,\n backgroundColor: state.isSelected\n ? isDarkMode ? \"var(--color-primary-975)\" : \"var(--color-primary-50)\"\n : state.isFocused\n ? isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-100)\"\n : isDarkMode ? \"#141414\" : \"#fff\",\n color: state.isDisabled\n ? isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#a3a3a3\"\n : isDarkMode\n ? state.isSelected\n ? \"var(--color-primary-600)\"\n : \"rgba(255,255,255,0.85)\"\n : \"rgba(0,0,0,0.88)\",\n cursor: state.isDisabled ? \"not-allowed\" : \"pointer\",\n opacity: state.isDisabled ? 0.6 : 1,\n \"&:hover\": {\n backgroundColor: state.isDisabled\n ? isDarkMode ? \"#141414\" : \"#fff\"\n : isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-100)\",\n },\n \"&:active\": {\n backgroundColor: isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-50)\",\n },\n }),\n singleValue: (baseStyles: any, state: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n lineHeight: \"20px\",\n color: state.isDisabled\n ? isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#a3a3a3\"\n : isDarkMode ? \"rgba(255,255,255,0.85)\" : \"rgba(0,0,0,0.88)\",\n }),\n placeholder: (baseStyles: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n whiteSpace: \"nowrap\" as const,\n textOverflow: \"ellipsis\",\n overflow: \"hidden\",\n color: isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#bfbfbf\",\n }),\n multiValue: (baseStyles: any) => ({\n ...baseStyles,\n backgroundColor: isDarkMode ? \"rgba(255,255,255,0.08)\" : \"#f0f5ff\",\n border: isDarkMode ? \"1px solid transparent\" : \"1px solid #adc6ff\",\n borderRadius: \"4px\",\n }),\n multiValueLabel: (baseStyles: any) => ({\n ...baseStyles,\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"var(--color-primary-600)\",\n fontSize: \"12px\",\n }),\n multiValueRemove: (baseStyles: any) => ({\n ...baseStyles,\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"var(--color-primary-600)\",\n \"&:hover\": {\n backgroundColor: isDarkMode ? \"rgba(255,255,255,0.16)\" : \"#e6f4ff\",\n color: isDarkMode ? \"#fff\" : \"var(--color-primary-600)\",\n },\n }),\n menu: (baseStyles: any) => ({\n ...baseStyles,\n zIndex: 5001,\n borderRadius: \"8px\",\n boxShadow: isDarkMode\n ? \"0 6px 16px 0 rgba(0,0,0,0.45)\"\n : \"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)\",\n backgroundColor: isDarkMode ? \"#141414\" : \"#fff\",\n border: isDarkMode ? \"1px solid #303030\" : \"none\",\n overflow: \"hidden\",\n }),\n menuList: (baseStyles: any) => ({\n ...baseStyles,\n padding: \"0\",\n maxHeight: \"256px\",\n }),\n };\n\n const hasSelectedValues = !!selectedValues?.length;\n const hasValue = !!value;\n const isFieldClearable = isClearable ? hasSelectedValues || hasValue : false;\n const showClearIcon = isHovered && !disabled && isFieldClearable;\n\n const handleClear = (e: React.MouseEvent) => {\n e.stopPropagation();\n e.preventDefault();\n handleChange(multiSelect ? [] : null);\n };\n\n const DropdownIndicator = () => (\n <div className=\"flex items-center\">\n {showClearIcon ? (\n <CancelRounded\n onClick={handleClear}\n sx={{\n fontSize: \"16px\",\n cursor: \"pointer\",\n color: isDarkMode ? \"rgba(255,255,255,0.45)\" : \"rgba(0,0,0,0.25)\",\n \"&:hover\": {\n color: isDarkMode ? \"rgba(255,255,255,0.65)\" : \"rgba(0,0,0,0.45)\",\n },\n }}\n />\n ) : (\n <ChevronLeftRounded\n className=\"-rotate-90\"\n sx={{\n fontSize: \"18px\",\n color: isDarkMode ? \"rgba(255,255,255,0.25)\" : \"rgba(0,0,0,0.25)\",\n }}\n />\n )}\n </div>\n );\n\n return (\n <div\n id={id}\n className={cn(\"w-full flex flex-col gap-1\", className)}\n onMouseDown={(e) => e.stopPropagation()}\n role=\"group\"\n aria-labelledby={label ? id + \"Label\" : undefined}\n >\n {label && (\n <label\n id={id + \"Label\"}\n htmlFor=\"text\"\n className={`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${!originalCase ? \"capitalize\" : \"\"}`}\n >\n <InputLabel label={label || \"\"} required={required || false} />\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 </label>\n )}\n\n <div\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <CreatableSelect\n {...props}\n id={\"cm\" + label}\n classNamePrefix=\"lax-select\"\n required={required}\n options={selectOptions}\n isClearable={false}\n isLoading={loading}\n isDisabled={disabled}\n styles={styleProps}\n isMulti={multiSelect}\n value={multiSelect ? selectedValues : value}\n onChange={handleChange}\n filterOption={filterOption}\n placeholder={placeholder}\n classNames={{\n menuList: () => \"nowheel\",\n }}\n components={{\n DropdownIndicator,\n IndicatorSeparator: () => null,\n }}\n />\n </div>\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};\n\nCreatableSelectField.displayName = \"CreatableSelectField\";\n"],"names":["CreatableSelectField","id","label","errorMessage","selectOptions","loading","isClearable","multiSelect","selectedValues","disabled","required","value","className","tooltip","tags","originalCase","onChange","filterOption","placeholder","props","isDarkMode","useIsDarkMode","isHovered","setIsHovered","useState","handleChange","newValue","_actionMeta","containerElement","pilotChangeEvent","styleProps","baseStyles","state","hasSelectedValues","showClearIcon","handleClear","e","DropdownIndicator","jsx","CancelRounded","ChevronLeftRounded","jsxs","cn","InputLabel","Label","Tooltip","HelpIcon","CreatableSelect","Typography"],"mappings":";;;;;;;;;;;AA8FO,MAAMA,IAAuB,CAAC;AAAA,EACnC,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAGC;AACL,MAAuD;AACrD,QAAMC,IAAaC,EAAA,GACb,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAE1CC,IAAe,CAACC,GAAeC,MAAsB;AAEzD,IAAIX,KACFA,EAASU,CAAQ;AAInB,UAAME,IAAmB,SAAS,eAAe3B,CAAE;AACnD,QAAI2B,GAAkB;AACpB,YAAMC,IAAmB,IAAI,YAAY,gBAAgB;AAAA,QACvD,SAAS;AAAA,QACT,QAAQ;AAAA,UACN,UAAU,IAAI5B,CAAE;AAAA,UAChB,OAAOyB;AAAA,UACP,MAAM;AAAA,QAAA;AAAA,MACR,CACD;AACD,MAAAE,EAAiB,cAAcC,CAAgB;AAAA,IACjD;AAAA,EACF,GAEMC,IAAa;AAAA,IACjB,SAAS,CAACC,GAAiBC,OAAgB;AAAA,MACzC,GAAGD;AAAA,MACH,aACE5B,KAAgBO,IACZU,IAAa,YAAY,YACzBY,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UAAA,gBAAAyB,EAAC,OAAA,EAAI,WAAU,kBACb,UAAA,gBAAAA,EAACQ,GAAA,CAAA,CAAS,GACZ,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAKN,gBAAAR;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,cAAc,MAAMf,EAAa,EAAI;AAAA,YACrC,cAAc,MAAMA,EAAa,EAAK;AAAA,YAEtC,UAAA,gBAAAe;AAAA,cAACS;AAAA,cAAA;AAAA,gBACE,GAAG5B;AAAA,gBACJ,IAAI,OAAOjB;AAAA,gBACX,iBAAgB;AAAA,gBAChB,UAAAQ;AAAA,gBACA,SAASN;AAAA,gBACT,aAAa;AAAA,gBACb,WAAWC;AAAA,gBACX,YAAYI;AAAA,gBACZ,QAAQqB;AAAA,gBACR,SAASvB;AAAA,gBACT,OAAOA,IAAcC,IAAiBG;AAAA,gBACtC,UAAUc;AAAA,gBACV,cAAAR;AAAA,gBACA,aAAAC;AAAA,gBACA,YAAY;AAAA,kBACV,UAAU,MAAM;AAAA,gBAAA;AAAA,gBAElB,YAAY;AAAA,kBACV,mBAAAmB;AAAA,kBACA,oBAAoB,MAAM;AAAA,gBAAA;AAAA,cAC5B;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,QAEDlC,KACC,gBAAAmC;AAAA,UAACU;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,YAAW;AAAA,YACX,MAAK;AAAA,YACL,SAAQ;AAAA,YAEP,UAAA7C;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR;AAEAH,EAAqB,cAAc;"}
1
+ {"version":3,"file":"CreatableSelect.es.js","sources":["../../../../src/components/forms/creatable-select/CreatableSelect.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport cn from \"classnames\";\nimport CreatableSelect from \"react-select/creatable\";\nimport { CancelRounded, ChevronLeftRounded } from \"@mui/icons-material\";\nimport { Tooltip } from \"antd\";\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 { useState, type ComponentProps } from \"react\";\nimport { InputLabel } from \"../shared/InputLabel\";\nimport { useIsDarkMode } from \"../../../hooks/useIsDarkMode\";\n\n/**\n * Option type for the CreatableSelect component\n */\nexport interface SelectOption {\n /** The value of the option */\n value: string | number;\n /** The label displayed for the option */\n label: string;\n /** Whether the option is disabled */\n isDisabled?: boolean;\n /** Additional data for the option */\n data?: Record<string, unknown>;\n}\n\n/**\n * Props for the CreatableSelectField component\n * Matches the lax-web-portal implementation for drop-in replacement\n */\nexport type TProps = {\n /** Unique identifier for the select */\n id: string;\n /** Label text to display above the select */\n label: string;\n /** Placeholder text for the select */\n placeholder?: string;\n /** Current value for single select */\n value?: any;\n /** Callback function called when selection changes */\n onChange(data: any): void;\n /** Error message to display below the select */\n errorMessage?: string;\n /** Array of available options */\n selectOptions: any[];\n /** Whether the select is in loading state */\n loading?: boolean;\n /** Whether multiple selections are allowed */\n multiSelect?: boolean;\n /** Current values for multi select */\n selectedValues?: any[];\n /** Custom filter function for options */\n filterOption?: any;\n /** Whether to preserve original case in the label */\n originalCase?: boolean;\n /** Whether the select is disabled */\n disabled?: boolean;\n /** Whether the select is clearable */\n isClearable?: boolean;\n /** Whether the field is required */\n required?: boolean;\n /** Tags/labels to display next to the label */\n tags?: (string | LabelType)[];\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Additional CSS classes for the wrapper */\n className?: string;\n};\n\n// Export type alias for backward compatibility\nexport type CreatableSelectProps = TProps & ComponentProps<typeof CreatableSelect>;\n\n/**\n * A creatable select component with label, validation, and styling support.\n * Features dark mode support, accessibility enhancements, and comprehensive prop support.\n * Built on top of react-select/creatable for advanced functionality.\n *\n * This component is designed as a drop-in replacement for the lax-web-portal\n * CreatableSelectField component.\n *\n * @example\n * ```tsx\n * <CreatableSelectField\n * id=\"tags\"\n * label=\"Tags\"\n * selectOptions={tagOptions}\n * value={selectedTag}\n * onChange={(newValue) => setSelectedTag(newValue)}\n * placeholder=\"Select or create tags...\"\n * multiSelect\n * />\n * ```\n */\nexport const CreatableSelectField = ({\n id,\n label,\n errorMessage,\n selectOptions,\n loading,\n isClearable,\n multiSelect,\n selectedValues,\n disabled,\n required,\n value,\n className,\n tooltip,\n tags,\n originalCase = false,\n onChange,\n filterOption,\n placeholder,\n ...props\n}: TProps & ComponentProps<typeof CreatableSelect>) => {\n const isDarkMode = useIsDarkMode();\n const [isHovered, setIsHovered] = useState(false);\n\n const handleChange = (newValue: any, _actionMeta?: any) => {\n // Call the original onChange handler\n if (onChange) {\n onChange(newValue);\n }\n\n // Dispatch pilot-change event for recording\n const containerElement = document.getElementById(id);\n if (containerElement) {\n const pilotChangeEvent = new CustomEvent(\"pilot-change\", {\n bubbles: true,\n detail: {\n selector: `#${id}`,\n value: newValue,\n type: \"change\",\n },\n });\n containerElement.dispatchEvent(pilotChangeEvent);\n }\n };\n\n const styleProps = {\n control: (baseStyles: any, state: any) => ({\n ...baseStyles,\n borderColor:\n errorMessage && required\n ? isDarkMode ? \"#F04438\" : \"#fda49b\"\n : state.isFocused\n ? \"var(--color-primary-600)\"\n : isDarkMode ? \"#434343\" : \"#d9d9d9\",\n backgroundColor: isDarkMode\n ? \"#141414\"\n : state.isDisabled ? \"#f5f5f5\" : \"#fff\",\n borderRadius: \"6px\",\n padding: \"0 4px 0 12px\",\n opacity: state.isDisabled ? 0.6 : 1,\n cursor: state.isDisabled ? \"not-allowed\" : \"pointer\",\n boxShadow: state.isFocused\n ? isDarkMode\n ? \"0 0 0 1.5px var(--color-primary-950)\"\n : \"0 0 0 1.5px var(--color-primary-100)\"\n : \"none\",\n \"&:hover\": {\n borderColor:\n errorMessage && required\n ? isDarkMode ? \"#F04438\" : \"#fda49b\"\n : \"var(--color-primary-600)\",\n },\n }),\n valueContainer: (baseStyles: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n padding: 0,\n }),\n input: (baseStyles: any) => ({\n ...baseStyles,\n margin: \"0\",\n padding: \"0\",\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"inherit\",\n }),\n indicatorsContainer: (baseStyles: any) => ({\n ...baseStyles,\n padding: 0,\n }),\n option: (baseStyles: any, state: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n lineHeight: \"22px\",\n padding: \"5px 12px\",\n margin: 0,\n backgroundColor: state.isSelected\n ? isDarkMode ? \"var(--color-primary-975)\" : \"var(--color-primary-50)\"\n : state.isFocused\n ? isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-100)\"\n : isDarkMode ? \"#141414\" : \"#fff\",\n color: state.isDisabled\n ? isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#a3a3a3\"\n : isDarkMode\n ? state.isSelected\n ? \"var(--color-primary-600)\"\n : \"rgba(255,255,255,0.85)\"\n : \"rgba(0,0,0,0.88)\",\n cursor: state.isDisabled ? \"not-allowed\" : \"pointer\",\n opacity: state.isDisabled ? 0.6 : 1,\n \"&:hover\": {\n backgroundColor: state.isDisabled\n ? isDarkMode ? \"#141414\" : \"#fff\"\n : isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-100)\",\n },\n \"&:active\": {\n backgroundColor: isDarkMode ? \"var(--color-primary-950)\" : \"var(--color-primary-50)\",\n },\n }),\n singleValue: (baseStyles: any, state: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n lineHeight: \"20px\",\n color: state.isDisabled\n ? isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#a3a3a3\"\n : isDarkMode ? \"rgba(255,255,255,0.85)\" : \"rgba(0,0,0,0.88)\",\n }),\n placeholder: (baseStyles: any) => ({\n ...baseStyles,\n fontSize: \"14px\",\n whiteSpace: \"nowrap\" as const,\n textOverflow: \"ellipsis\",\n overflow: \"hidden\",\n color: isDarkMode ? \"rgba(255,255,255,0.25)\" : \"#bfbfbf\",\n }),\n multiValue: (baseStyles: any) => ({\n ...baseStyles,\n backgroundColor: isDarkMode ? \"rgba(255,255,255,0.08)\" : \"#f0f5ff\",\n border: isDarkMode ? \"1px solid transparent\" : \"1px solid #adc6ff\",\n borderRadius: \"4px\",\n }),\n multiValueLabel: (baseStyles: any) => ({\n ...baseStyles,\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"var(--color-primary-600)\",\n fontSize: \"12px\",\n }),\n multiValueRemove: (baseStyles: any) => ({\n ...baseStyles,\n color: isDarkMode ? \"rgba(255,255,255,0.85)\" : \"var(--color-primary-600)\",\n \"&:hover\": {\n backgroundColor: isDarkMode ? \"rgba(255,255,255,0.16)\" : \"#e6f4ff\",\n color: isDarkMode ? \"#fff\" : \"var(--color-primary-600)\",\n },\n }),\n menu: (baseStyles: any) => ({\n ...baseStyles,\n zIndex: 5001,\n borderRadius: \"8px\",\n boxShadow: isDarkMode\n ? \"0 6px 16px 0 rgba(0,0,0,0.45)\"\n : \"0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)\",\n backgroundColor: isDarkMode ? \"#141414\" : \"#fff\",\n border: isDarkMode ? \"1px solid #303030\" : \"none\",\n overflow: \"hidden\",\n }),\n menuList: (baseStyles: any) => ({\n ...baseStyles,\n padding: \"0\",\n maxHeight: \"256px\",\n }),\n };\n\n const hasSelectedValues = !!selectedValues?.length;\n const hasValue = !!value;\n const isFieldClearable = isClearable ? hasSelectedValues || hasValue : false;\n const showClearIcon = isHovered && !disabled && isFieldClearable;\n\n const handleClear = (e: React.MouseEvent) => {\n e.stopPropagation();\n e.preventDefault();\n handleChange(multiSelect ? [] : null);\n };\n\n const DropdownIndicator = () => (\n <div className=\"flex items-center\">\n {showClearIcon ? (\n <CancelRounded\n onClick={handleClear}\n sx={{\n fontSize: \"16px\",\n cursor: \"pointer\",\n color: isDarkMode ? \"rgba(255,255,255,0.45)\" : \"rgba(0,0,0,0.25)\",\n \"&:hover\": {\n color: isDarkMode ? \"rgba(255,255,255,0.65)\" : \"rgba(0,0,0,0.45)\",\n },\n }}\n />\n ) : (\n <ChevronLeftRounded\n className=\"-rotate-90\"\n sx={{\n fontSize: \"18px\",\n color: isDarkMode ? \"rgba(255,255,255,0.25)\" : \"rgba(0,0,0,0.25)\",\n }}\n />\n )}\n </div>\n );\n\n return (\n <div\n id={id}\n className={cn(\"w-full flex flex-col gap-1\", className)}\n onMouseDown={(e) => e.stopPropagation()}\n role=\"group\"\n aria-labelledby={label ? id + \"Label\" : undefined}\n >\n {label && (\n <label\n id={id + \"Label\"}\n htmlFor=\"text\"\n className={`text-xs font-medium text-gray-600 dark:text-black-300 inline-flex items-center gap-1 ${!originalCase ? \"capitalize\" : \"\"}`}\n >\n <InputLabel label={label || \"\"} required={required || false} />\n <Label labels={tags} />\n {tooltip && (\n <Tooltip placement=\"top\" title={tooltip}>\n <div className=\"cursor-pointer\">\n <HelpIcon className=\"w-icon-sm h-icon-sm\" />\n </div>\n </Tooltip>\n )}\n </label>\n )}\n\n <div\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <CreatableSelect\n {...props}\n id={\"cm\" + label}\n classNamePrefix=\"lax-select\"\n required={required}\n options={selectOptions}\n isClearable={false}\n isLoading={loading}\n isDisabled={disabled}\n styles={styleProps}\n isMulti={multiSelect}\n value={multiSelect ? selectedValues : value}\n onChange={handleChange}\n filterOption={filterOption}\n placeholder={placeholder}\n classNames={{\n menuList: () => \"nowheel\",\n control: ()=> \"!min-h-8 !text-sm\"\n }}\n components={{\n DropdownIndicator,\n IndicatorSeparator: () => null,\n }}\n />\n </div>\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};\n\nCreatableSelectField.displayName = \"CreatableSelectField\";\n"],"names":["CreatableSelectField","id","label","errorMessage","selectOptions","loading","isClearable","multiSelect","selectedValues","disabled","required","value","className","tooltip","tags","originalCase","onChange","filterOption","placeholder","props","isDarkMode","useIsDarkMode","isHovered","setIsHovered","useState","handleChange","newValue","_actionMeta","containerElement","pilotChangeEvent","styleProps","baseStyles","state","hasSelectedValues","showClearIcon","handleClear","e","DropdownIndicator","jsx","CancelRounded","ChevronLeftRounded","jsxs","cn","InputLabel","Label","Tooltip","HelpIcon","CreatableSelect","Typography"],"mappings":";;;;;;;;;;;AA8FO,MAAMA,IAAuB,CAAC;AAAA,EACnC,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAGC;AACL,MAAuD;AACrD,QAAMC,IAAaC,EAAA,GACb,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAE1CC,IAAe,CAACC,GAAeC,MAAsB;AAEzD,IAAIX,KACFA,EAASU,CAAQ;AAInB,UAAME,IAAmB,SAAS,eAAe3B,CAAE;AACnD,QAAI2B,GAAkB;AACpB,YAAMC,IAAmB,IAAI,YAAY,gBAAgB;AAAA,QACvD,SAAS;AAAA,QACT,QAAQ;AAAA,UACN,UAAU,IAAI5B,CAAE;AAAA,UAChB,OAAOyB;AAAA,UACP,MAAM;AAAA,QAAA;AAAA,MACR,CACD;AACD,MAAAE,EAAiB,cAAcC,CAAgB;AAAA,IACjD;AAAA,EACF,GAEMC,IAAa;AAAA,IACjB,SAAS,CAACC,GAAiBC,OAAgB;AAAA,MACzC,GAAGD;AAAA,MACH,aACE5B,KAAgBO,IACZU,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,EAAC,OAAA,EAAI,WAAU,kBACb,UAAA,gBAAAA,EAACQ,GAAA,EAAS,WAAU,uBAAsB,GAC5C,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAKN,gBAAAR;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,cAAc,MAAMf,EAAa,EAAI;AAAA,YACrC,cAAc,MAAMA,EAAa,EAAK;AAAA,YAEtC,UAAA,gBAAAe;AAAA,cAACS;AAAA,cAAA;AAAA,gBACE,GAAG5B;AAAA,gBACJ,IAAI,OAAOjB;AAAA,gBACX,iBAAgB;AAAA,gBAChB,UAAAQ;AAAA,gBACA,SAASN;AAAA,gBACT,aAAa;AAAA,gBACb,WAAWC;AAAA,gBACX,YAAYI;AAAA,gBACZ,QAAQqB;AAAA,gBACR,SAASvB;AAAA,gBACT,OAAOA,IAAcC,IAAiBG;AAAA,gBACtC,UAAUc;AAAA,gBACV,cAAAR;AAAA,gBACA,aAAAC;AAAA,gBACA,YAAY;AAAA,kBACV,UAAU,MAAM;AAAA,kBAChB,SAAS,MAAK;AAAA,gBAAA;AAAA,gBAEhB,YAAY;AAAA,kBACV,mBAAAmB;AAAA,kBACA,oBAAoB,MAAM;AAAA,gBAAA;AAAA,cAC5B;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,QAEDlC,KACC,gBAAAmC;AAAA,UAACU;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,YAAW;AAAA,YACX,MAAK;AAAA,YACL,SAAQ;AAAA,YAEP,UAAA7C;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR;AAEAH,EAAqB,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../../../_virtual/index.cjs.js"),l=require("react"),M=require("antd"),ke=require("react-i18next"),Se=require("../../data-display/typography/Typography.cjs.js"),je=require("../../data-display/label/Label.cjs.js"),Q=require("./currency.constant.cjs.js"),X=require("@mui/icons-material"),Ee=require("../../icons/AIExtractedIndicator.cjs.js"),Ce=require("../../icons/AIStarIcon.cjs.js"),we=require("../../icons/HelpIcon.cjs.js"),Z=require("../../tooltip/Tooltip.cjs.js"),x=require("../../../utils/confidenceScoreUtils.cjs.js"),Ne=require("../search-bar/SearchBar.cjs.js"),_e=require("../../buttons/option-button/OptionButton.cjs.js"),T=require("../../../utils/countryFlags.cjs.js"),Ie=require("../shared/InputLabel.cjs.js"),Be=require("../../../utils/formatters.cjs.js"),V=l.forwardRef(({id:c,label:F,value:o,onChange:B,errorMessage:i,defaultValue:m,required:k=!1,isRequiredConditional:G=!1,tags:ee,className:re,originalCase:q=!1,tooltip:A,simpleMode:te=!1,inputFieldClassName:d="",isAiExtracted:ae=!1,confidenceScore:S,confidenceType:f="high",confidenceTooltip:j,sourceMeta:oe=[],onConfidenceScoreClick:ne,isGTN:E=!1,gtnName:le=null,allowMultiCurrency:$=!1,placeholder:se,disabled:ce=!1,currencyCode:u="USD",inputStyle:de,labelClassName:z,isLiveField:ie=!1,onBlur:ue,autoFocus:D=!1,isRecording:L=!1,isPlaying:O=!1,onAddGTNToDocument:C,riskDetails:s,isRiskAnalysisOpen:p=!1,RiskDetailsCard:U,labelExtra:be,inputEmphasis:w="default",...W},H)=>{const{t:xe}=ke.useTranslation(),me=w==="modified"&&!i&&!(p&&s?.color),fe=w==="deleted"&&!i&&!(p&&s?.color),pe=w==="success"&&!i&&!(p&&s?.color),[b,R]=l.useState(!1),[ge,he]=l.useState([]),[N,K]=l.useState(""),[a,P]=l.useState(u||"USD"),[v,_]=l.useState(!1),ve=r=>{if(C){const t={key:le,value:Be.formatCurrency(r,a)};C(t)}},g=r=>{if(r==null)return"";const t=Number(r);return isNaN(t)?r:t?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},I=r=>{const t=r.target.value,h=t===""||t===null||t===void 0?0:Number(t);B(h,a);const y=document.getElementById(c);if(y&&y.setAttribute("data-selected-value",JSON.stringify({value:h,currency_code:a})),y&&(L||O)){const Fe=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${c}`,value:{value:h,currency_code:a},type:"change"}});y.dispatchEvent(Fe)}},Y=()=>{R(!0)},J=()=>{R(!1),(o==null||o==="")&&I({target:{value:"0.00"}}),ue?.()},ye=()=>{const r="pl-11 border h-[32px] text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0";return i?n(r,"rounded-md border-red-300 bg-white dark:bg-black-600",d):p&&s?.color?n(r,`rounded-md border-${s.color}-300 bg-${s.color}-50`,"text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800",d):fe?n(r,"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]",d):me?n(r,"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]",d):pe?n(r,"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]",d):n(r,"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]",d)};return l.useEffect(()=>{u&&P(u)},[u]),l.useEffect(()=>{if(a){const r=o===""||o===null||o===void 0?0:Number(o);u!==a&&B(r,a);const t=document.getElementById(c);if(t&&(t.setAttribute("data-selected-value",JSON.stringify({value:r,currency_code:a})),L||O)){const h=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${c}`,value:{value:r,currency_code:a},type:"change"}});t.dispatchEvent(h)}}},[a]),l.useEffect(()=>{const r=Q.CURRENCIES.filter(t=>(t.value+" - "+t.label).toLowerCase().includes(N.toLowerCase())).map(t=>({label:e.jsx(_e.OptionButton,{text:`${t.value} - ${t.label}`,icon:T.getFlagComponent(t.value),showTick:a===t.value,onClick:()=>P(t.value),className:"text-black-900 dark:text-white"}),key:t.value}));he(r)},[N,a]),l.useEffect(()=>{K("")},[a]),te?e.jsxs("label",{id:c,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${q?"":"capitalize"} ${z||""}`,children:[e.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3",children:"$"}),e.jsx("input",{...W,ref:H,type:b?"number":"text",required:k,className:n(d,"pl-8 h-[32px]"),onChange:I,min:0,onFocus:Y,onBlur:J,value:b?o:g(o),...m&&!o?{defaultValue:b?m:g(m)}:{},id:c||F,autoFocus:D})]}):e.jsxs("div",{className:n("flex gap-0.5 relative",v&&E?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[E&&!v?e.jsx("div",{className:"w-1 h-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,e.jsxs("div",{className:n("w-full flex flex-col",re),children:[e.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${q?"":"uppercase"} ${z||""}`,children:e.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[e.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[e.jsx(Ie.InputLabel,{label:F||"",required:k||!1,isRequiredConditional:G||!1}),ie&&e.jsx(X.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),ae&&!x.shouldShowConfidenceScore(S)&&e.jsx(Ee.AIExtractedIndicator,{}),e.jsx(je.Label,{labels:ee}),A&&e.jsx(Z,{placement:"top",title:A,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(we.HelpIcon,{})})}),be]}),e.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[x.shouldShowConfidenceScore(S)&&f?e.jsx(Z,{placement:"top-end",title:j??"",hideTooltip:j==null,className:"cursor-pointer",children:e.jsxs("div",{className:n("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",x.getConfidenceScoreBadgeClass(f)),onClick:()=>ne?.(oe),children:[e.jsx(Ce.AIStarIcon,{size:12,fill:x.getConfidenceScoreBadgeColor(f),fillSecondary:x.getConfidenceScoreBadgeFill(f)}),e.jsxs("span",{className:n("text-xs font-medium leading-4",x.getConfidenceScoreBadgeTextColor(f)),children:[S,"%"]})]})}):null,E&&v&&C?e.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>ve(g(o)),type:"button",children:e.jsx(M.Tooltip,{placement:"top",title:xe("Add to document"),children:e.jsx(X.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]})}),e.jsxs("label",{className:"relative block",children:[e.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white",children:Q.CURRENCY_SYMBOLS[a]}),e.jsx("input",{...W,ref:H,placeholder:se,type:b?"number":"text",required:k,disabled:ce,className:ye(),onChange:I,min:0,onFocus:Y,onBlur:J,value:b?o:g(o),defaultValue:b?m:g(m),id:c||F,style:de,autoComplete:"off",autoFocus:D}),e.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center z-[1000px] h-full cursor-pointer dark:text-black-200 ${$?"cursor-pointer":""}`,children:$?e.jsx(M.Dropdown,{menu:{items:[...ge]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:r=>r.parentElement,popupRender:r=>e.jsxs("div",{style:{maxHeight:"200px",width:"330px",textOverflow:"ellipsis",overflowY:"auto",zIndex:"999px",borderRadius:"6px"},className:"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600",children:[e.jsx(Ne.SearchBar,{id:"search-bar-currency-input",value:N,onChange:t=>K(t),className:"mb-2"}),r]}),children:e.jsxs("div",{className:"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1",children:[T.getFlagComponent(a)," ",a]})}):a})]}),i&&e.jsx(Se.Typography,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:i})]}),v&&s&&p&&U&&e.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:r=>r.stopPropagation(),onMouseDown:r=>r.preventDefault(),onKeyDown:r=>{r.key==="Escape"&&_(!1)},children:e.jsx(U,{riskDetails:s})})]})});V.displayName="CurrencyInputField";exports.CurrencyInputField=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../../../_virtual/index.cjs.js"),l=require("react"),M=require("antd"),ke=require("react-i18next"),Se=require("../../data-display/typography/Typography.cjs.js"),je=require("../../data-display/label/Label.cjs.js"),Q=require("./currency.constant.cjs.js"),X=require("@mui/icons-material"),Ee=require("../../icons/AIExtractedIndicator.cjs.js"),Ce=require("../../icons/AIStarIcon.cjs.js"),we=require("../../icons/HelpIcon.cjs.js"),Z=require("../../tooltip/Tooltip.cjs.js"),m=require("../../../utils/confidenceScoreUtils.cjs.js"),Ne=require("../search-bar/SearchBar.cjs.js"),_e=require("../../buttons/option-button/OptionButton.cjs.js"),T=require("../../../utils/countryFlags.cjs.js"),Ie=require("../shared/InputLabel.cjs.js"),Be=require("../../../utils/formatters.cjs.js"),V=l.forwardRef(({id:c,label:F,value:o,onChange:B,errorMessage:i,defaultValue:x,required:k=!1,isRequiredConditional:G=!1,tags:ee,className:re,originalCase:q=!1,tooltip:A,simpleMode:te=!1,inputFieldClassName:d="",isAiExtracted:ae=!1,confidenceScore:S,confidenceType:f="high",confidenceTooltip:j,sourceMeta:oe=[],onConfidenceScoreClick:ne,isGTN:E=!1,gtnName:le=null,allowMultiCurrency:$=!1,placeholder:se,disabled:ce=!1,currencyCode:u="USD",inputStyle:de,labelClassName:z,isLiveField:ie=!1,onBlur:ue,autoFocus:D=!1,isRecording:L=!1,isPlaying:O=!1,onAddGTNToDocument:C,riskDetails:s,isRiskAnalysisOpen:p=!1,RiskDetailsCard:U,labelExtra:be,inputEmphasis:w="default",...W},H)=>{const{t:me}=ke.useTranslation(),xe=w==="modified"&&!i&&!(p&&s?.color),fe=w==="deleted"&&!i&&!(p&&s?.color),pe=w==="success"&&!i&&!(p&&s?.color),[b,R]=l.useState(!1),[ge,he]=l.useState([]),[N,K]=l.useState(""),[a,P]=l.useState(u||"USD"),[v,_]=l.useState(!1),ve=r=>{if(C){const t={key:le,value:Be.formatCurrency(r,a)};C(t)}},g=r=>{if(r==null)return"";const t=Number(r);return isNaN(t)?r:t?.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},I=r=>{const t=r.target.value,h=t===""||t===null||t===void 0?0:Number(t);B(h,a);const y=document.getElementById(c);if(y&&y.setAttribute("data-selected-value",JSON.stringify({value:h,currency_code:a})),y&&(L||O)){const Fe=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${c}`,value:{value:h,currency_code:a},type:"change"}});y.dispatchEvent(Fe)}},J=()=>{R(!0)},Y=()=>{R(!1),(o==null||o==="")&&I({target:{value:"0.00"}}),ue?.()},ye=()=>{const r="pl-11 border h-8 text-sm block w-full p-2.5 font-inter font-medium focus:outline-none focus:ring-0";return i?n(r,"rounded-md border-red-300 bg-white dark:bg-black-600",d):p&&s?.color?n(r,`rounded-md border-${s.color}-300 bg-${s.color}-50`,"text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800",d):fe?n(r,"rounded-lg border border-solid border-[var(--Error-200,#FECACA)] bg-[var(--Error-50,#FEF2F2)] !text-[#475467] focus:border-[var(--Error-200,#FECACA)] focus:shadow-[0_0_0_2px_rgba(254,202,202,0.45)] dark:border-[var(--Error-200,#FECACA)] dark:bg-[var(--Error-50,#FEF2F2)] dark:!text-[#475467] disabled:!opacity-100 disabled:!bg-[var(--Error-50,#FEF2F2)]",d):xe?n(r,"rounded-lg border border-solid border-[var(--Warning-200,#FEDF89)] bg-[var(--Warning-50,#FFFAEB)] text-neutral-900 dark:text-black-100 focus:border-[var(--Warning-200,#FEDF89)] focus:shadow-[0_0_0_2px_rgba(254,223,137,0.45)] dark:border-[var(--Warning-200,#FEDF89)] dark:bg-[var(--Warning-50,#FFFAEB)] disabled:!opacity-100 disabled:!bg-[var(--Warning-50,#FFFAEB)]",d):pe?n(r,"rounded-lg border border-solid border-[var(--Success-200,#BBF7D0)] bg-[var(--Success-50,#F0FDF4)] !text-[#101828] focus:border-[var(--Success-200,#BBF7D0)] focus:shadow-[0_0_0_2px_rgba(187,247,208,0.45)] dark:border-[var(--Success-200,#BBF7D0)] dark:bg-[var(--Success-50,#F0FDF4)] dark:!text-[#101828] disabled:!opacity-100 disabled:!bg-[var(--Success-50,#F0FDF4)]",d):n(r,"rounded-lg border-gray-300 dark:border-black-600 bg-white dark:bg-black-600 text-neutral-900 dark:text-black-200 disabled:bg-neutral-50 dark:disabled:!bg-black-800 dark:disabled:placeholder:!text-black-400 focus:border-[var(--color-primary-600)] dark:focus:border-[var(--color-primary-400)] focus:shadow-[0_0_0_1.5px_var(--color-primary-100)] dark:focus:shadow-[0_0_0_1.5px_var(--color-primary-950)]",d)};return l.useEffect(()=>{u&&P(u)},[u]),l.useEffect(()=>{if(a){const r=o===""||o===null||o===void 0?0:Number(o);u!==a&&B(r,a);const t=document.getElementById(c);if(t&&(t.setAttribute("data-selected-value",JSON.stringify({value:r,currency_code:a})),L||O)){const h=new CustomEvent("pilot-change",{bubbles:!0,detail:{selector:`#${c}`,value:{value:r,currency_code:a},type:"change"}});t.dispatchEvent(h)}}},[a]),l.useEffect(()=>{const r=Q.CURRENCIES.filter(t=>(t.value+" - "+t.label).toLowerCase().includes(N.toLowerCase())).map(t=>({label:e.jsx(_e.OptionButton,{text:`${t.value} - ${t.label}`,icon:T.getFlagComponent(t.value),showTick:a===t.value,onClick:()=>P(t.value),className:"text-black-900 dark:text-white"}),key:t.value}));he(r)},[N,a]),l.useEffect(()=>{K("")},[a]),te?e.jsxs("label",{id:c,className:`mb-1 text-xs font-medium text-gray-600 h-full inline-flex items-center gap-1 ${q?"":"capitalize"} ${z||""}`,children:[e.jsx("span",{className:"absolute inset-y-0 left-1 top-0.5 flex items-center pl-3",children:"$"}),e.jsx("input",{...W,ref:H,type:b?"number":"text",required:k,className:n(d,"pl-8 h-8"),onChange:I,min:0,onFocus:J,onBlur:Y,value:b?o:g(o),...x&&!o?{defaultValue:b?x:g(x)}:{},id:c||F,autoFocus:D})]}):e.jsxs("div",{className:n("flex gap-0.5 relative",v&&E?"border rounded-lg border-primary-100 bg-primary-50 p-1":""),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[E&&!v?e.jsx("div",{className:"size-1 bg-primary-600 rounded-full animate-blink mt-1.5"}):null,e.jsxs("div",{className:n("w-full flex flex-col",re),children:[e.jsx("label",{htmlFor:"text",className:`mb-1 text-xs font-medium text-gray-600 inline-flex items-center gap-1 ${q?"":"uppercase"} ${z||""}`,children:e.jsxs("div",{className:"grid w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-1",children:[e.jsxs("div",{className:"inline-flex min-w-0 items-center gap-1 flex-wrap",children:[e.jsx(Ie.InputLabel,{label:F||"",required:k||!1,isRequiredConditional:G||!1}),ie&&e.jsx(X.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),ae&&!m.shouldShowConfidenceScore(S)&&e.jsx(Ee.AIExtractedIndicator,{}),e.jsx(je.Label,{labels:ee}),A&&e.jsx(Z,{placement:"top",title:A,children:e.jsx("div",{className:"cursor-pointer",children:e.jsx(we.HelpIcon,{className:"w-icon-sm h-icon-sm"})})}),be]}),e.jsxs("div",{className:"flex items-center gap-1 justify-self-end",children:[m.shouldShowConfidenceScore(S)&&f?e.jsx(Z,{placement:"top-end",title:j??"",hideTooltip:j==null,className:"cursor-pointer",children:e.jsxs("div",{className:n("inline-flex min-w-[50px] items-center gap-1 rounded-md px-1 py-0.5",m.getConfidenceScoreBadgeClass(f)),onClick:()=>ne?.(oe),children:[e.jsx(Ce.AIStarIcon,{size:12,fill:m.getConfidenceScoreBadgeColor(f),fillSecondary:m.getConfidenceScoreBadgeFill(f)}),e.jsxs("span",{className:n("text-xs font-medium leading-4",m.getConfidenceScoreBadgeTextColor(f)),children:[S,"%"]})]})}):null,E&&v&&C?e.jsx("button",{id:"btn-currency-input-add-to-document",className:"cursor-pointer",onClick:()=>ve(g(o)),type:"button",children:e.jsx(M.Tooltip,{placement:"top",title:me("Add to document"),children:e.jsx(X.NoteAddOutlined,{className:"text-primary-600",sx:{fontSize:16}})})}):null]})]})}),e.jsxs("label",{className:"relative block",children:[e.jsx("span",{className:"absolute inset-y-0 left-1 flex items-center pl-3 text-neutral-900 dark:text-white",children:Q.CURRENCY_SYMBOLS[a]}),e.jsx("input",{...W,ref:H,placeholder:se,type:b?"number":"text",required:k,disabled:ce,className:ye(),onChange:I,min:0,onFocus:J,onBlur:Y,value:b?o:g(o),defaultValue:b?x:g(x),id:c||F,style:de,autoComplete:"off",autoFocus:D}),e.jsx("span",{className:`absolute inset-y-0 right-2 flex items-center z-[1000] h-full cursor-pointer dark:text-black-200 ${$?"cursor-pointer":""}`,children:$?e.jsx(M.Dropdown,{menu:{items:[...ge]},trigger:["click"],overlayClassName:"row-option-cell",placement:"bottomRight",overlayStyle:{zIndex:999},getPopupContainer:r=>r.parentElement,popupRender:r=>e.jsxs("div",{className:"[&>*:nth-child(2)]:!shadow-none [&>*:nth-child(2)>*]:!px-2 flex flex-col gap-2 p-2 bg-white dark:bg-black-700 border border-solid border-neutral-200 dark:border-black-600 max-h-[200px] w-[330px] text-ellipsis overflow-y-auto z-[999] rounded-md",children:[e.jsx(Ne.SearchBar,{id:"search-bar-currency-input",value:N,onChange:t=>K(t),className:"mb-2"}),r]}),children:e.jsxs("div",{className:"pl-4 pr-2 py-1.5 text-sm text-gray-700 dark:text-black-200 flex items-center gap-1",children:[T.getFlagComponent(a)," ",a]})}):a})]}),i&&e.jsx(Se.Typography,{className:"text-error-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:i})]}),v&&s&&p&&U&&e.jsx("div",{role:"tooltip",tabIndex:0,className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:r=>r.stopPropagation(),onMouseDown:r=>r.preventDefault(),onKeyDown:r=>{r.key==="Escape"&&_(!1)},children:e.jsx(U,{riskDetails:s})})]})});V.displayName="CurrencyInputField";exports.CurrencyInputField=V;
2
2
  //# sourceMappingURL=CurrencyInputField.cjs.js.map