@lax-wp/design-system 0.14.42 → 0.14.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-display/label-value/LabelValue.cjs.js +1 -1
- package/dist/components/data-display/label-value/LabelValue.cjs.js.map +1 -1
- package/dist/components/data-display/label-value/LabelValue.d.ts +6 -0
- package/dist/components/data-display/label-value/LabelValue.es.js +53 -52
- package/dist/components/data-display/label-value/LabelValue.es.js.map +1 -1
- package/dist/components/icons/ShieldIcon.cjs.js +1 -1
- package/dist/components/icons/ShieldIcon.cjs.js.map +1 -1
- package/dist/components/icons/ShieldIcon.es.js +16 -14
- package/dist/components/icons/ShieldIcon.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),p=require("../../../_virtual/index.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),p=require("../../../_virtual/index.cjs.js"),Se=require("../../icons/HelpIcon.cjs.js"),Ne=require("../../icons/SearchIcon.cjs.js"),L=require("../typography/Typography.cjs.js"),i=require("../../../utils/formatters.cjs.js"),ke=require("../../forms/currency-input/currency.constant.cjs.js"),Le=require("../label/Label.cjs.js"),Ie=require("framer-motion"),j=require("@mui/icons-material"),C=require("../../tooltip/Tooltip.cjs.js"),Te=require("../../icons/AIExtractedIndicator.cjs.js"),qe=require("../../icons/AIStarIcon.cjs.js"),S=require("../../../utils/confidenceScoreUtils.cjs.js"),F=require("dayjs"),K=require("../../icon/icons.generated.cjs.js"),P=u.forwardRef(({id:Y,label:l,value:r,className:G,type:s="string",tags:J,tooltip:I,items:n,isModified:Q=!1,isChanged:W=!1,size:X="medium",isHighlighted:v=!1,deletedValue:a,highlightColor:V="warning",isSearchActive:ee=!1,originalValue:T=!1,showDiff:q=!1,isLiveField:re=!1,isAiExtracted:te=!1,confidenceScore:se,confidenceType:g="high",confidenceTooltip:oe,sourceMeta:ae=[],onConfidenceScoreClick:ne,deltaChange:m,theme:ze="light",onUpload:z,acceptsUpload:ie=!1,MasterDataModal:$,riskDetails:f,isRiskAnalysisOpen:M=!1,RiskDetailsCard:_,"aria-label":ce,decodeEntities:le=!0,onAiExtractedIndicatorClick:de,copyOnHover:ue=!1,urlAlias:D,allowTimezoneConversion:pe=!1},me)=>{const[c,fe]=u.useState(!0),[xe,E]=u.useState(!1),[he,R]=u.useState(null),[H,N]=u.useState(!1),[w,A]=u.useState(!1),y=u.useRef(null);u.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]);const d=t=>le?i.decodeHTMLEntities(t):t,x=100,O=()=>{fe(!c)},k=()=>e.jsx("button",{id:`btn-label-value-${c?"Show more":"Show less"}`,className:"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",onClick:O,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),O())},"aria-label":c?"Show more content":"Show less content",type:"button",children:c?"Show more":"Show less"}),Z=t=>{if(D)return e.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-semibold text-neutral-900 dark:text-white hover:text-primary-600 dark:hover:text-primary-400 transition-colors",children:[D,e.jsx(j.OpenInNew,{sx:{fontSize:16},className:"text-primary-600 dark:text-primary-400"})]});const o=d(t);return o.length<=x?e.jsx("a",{href:t,className:"text-primary-600 truncate",children:o}):e.jsxs("p",{children:[e.jsx("a",{href:t,className:"text-primary-600 break-all",children:o.slice(0,c?x:o.length)}),c?"... ":" ",k()]})},B=t=>{E(!0),R({...t,value:r})},ye=()=>{E(!1),R(null)},ge=()=>{const t=r==null||typeof r=="object"?"":String(r);t&&navigator.clipboard?.writeText(t).then(()=>{A(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>A(!1),1500)}).catch(()=>{})},we=t=>{const o=t.target.files?.[0];o&&z&&z(o),t.target.value=""},b=()=>{const t=typeof r=="string"&&i.isISODateString(r);if(ee&&typeof r=="object")return r;if(r||s?.toLowerCase()==="boolean"&&r===0||s?.toLowerCase()==="currency"&&Number(r)>=0){if((r===!0||r==="True")&&!T&&s?.toLowerCase()!=="choice")return"Yes";if((r===!1||r==="False")&&!T&&s?.toLowerCase()!=="choice")return"No";if(s?.toLowerCase()==="url")return Z(r);if(s?.toLowerCase()==="boolean")return i.formatBooleanValue(r);if(s?.toLowerCase()==="currency"){const o=i.formatCurrency(r,n?.currency_code)||"-",h=n?.currency_code?ke.CURRENCIES.find(Ce=>Ce.value===n.currency_code)?.label:void 0,je=h?`${n.currency_code} — ${h}`:n?.currency_code??"";return h?e.jsx(C,{title:je,placement:"top",children:e.jsx("span",{children:o})}):o}else if(s?.toLowerCase()==="datetime"){const o=typeof r=="string"&&r.includes("Z")?r.replace(/\.000Z$/,"Z"):r;return i.formatDate(o,{skipTimezone:!pe,withTime:!0})}else if(s?.toLowerCase()==="date"||t){let o=r;if(typeof r=="string"&&r.includes("Z"))o=r.replace(/\.000Z$/,"Z");else if(typeof r=="string"&&!r.includes("Z")){const h=F(r);o=F(h).isValid()?h.toString():r}return i.formatDate(o,{skipTimezone:!0,withTime:!1})}else{if(s?.toLowerCase()==="percentage")return`${r}%`;if(typeof r=="string"&&r.length>x){const o=d(r);return e.jsxs("p",{children:[o.slice(0,c?x:o.length),c?"... ":" ",k()]})}else return typeof r=="string"?d(r):r}}return"-"},U=()=>{switch(X){case"small":return"extra-small";case"large":return"large";default:return"small"}},be=()=>{switch(V){case"success":return"bg-success-100";case"warning":return"bg-warning-100";case"error":return"bg-error-100";case"info":return"bg-info-100";default:return"bg-warning-100"}};return e.jsxs("div",{id:Y||"",ref:me,className:p("font-medium relative",G),onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),"aria-label":ce||`Label: ${l}, Value: ${r}`,children:[e.jsxs(L.Typography,{variant:"medium",size:U(),className:"flex gap-1 items-center flex-wrap",appearance:"subtitle",children:[typeof l=="string"?d(l):l," ",e.jsx(Le.Label,{labels:J?.map(t=>({...t,color:t.color||"primary"}))}),re&&e.jsx(j.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),te&&(S.shouldShowConfidenceScore(se)&&g?e.jsx(C,{placement:"top",title:oe||"",className:"cursor-pointer",children:e.jsx("div",{className:p("cursor-pointer w-3 h-3 flex items-center justify-center rounded-full",S.getConfidenceScoreBadgeHoverClass(g)),onClick:()=>ne?.(ae),children:e.jsx(qe.AIStarIcon,{size:12,fill:S.getConfidenceScoreBadgeColor(g),fillSecondary:S.getConfidenceScoreBadgeFill(g)})})}):e.jsx(Te.AIExtractedIndicator,{onClick:()=>de?.(b())})),I&&e.jsx(C,{placement:"top",title:I,whiteSpace:"pre-wrap",children:e.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&t.preventDefault()},children:e.jsx(Se.HelpIcon,{size:14})})}),ue&&H&&e.jsx(C,{title:w?"Copied":`Copy ${l??"value"}`,placement:"top",whiteSpace:"pre-wrap",children:e.jsx("button",{type:"button",onClick:ge,"aria-label":w?`Copied ${l??"value"}`:`Copy ${l??"value"}`,className:"p-1 flex items-center justify-center rounded text-neutral-500 hover:!text-primary-600 hover:bg-neutral-100 dark:text-primary-400 dark:hover:!text-primary-600 dark:hover:bg-neutral-800 cursor-pointer",children:e.jsxs("span",{className:"relative inline-flex h-4 w-4 items-center justify-center",children:[e.jsx(K.ContentCopyIcon,{size:16,className:p("absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out",w?"opacity-0 scale-50 rotate-[-90deg]":"opacity-100 scale-100 rotate-0")}),e.jsx(K.CheckFilledIcon,{size:16,className:p("absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out",w?"opacity-100 scale-100 rotate-0":"opacity-0 scale-50 rotate-90")})]})})})]}),e.jsxs(L.Typography,{variant:"medium",size:U(),className:p("text-- whitespace-normal break-all flex gap-1 pt-0.5",Q&&"bg-neutral-50 dark:bg-black-700 p-1 rounded",M&&f?.color&&`bg-${f.color}-50 border-${f.color}-300 px-0.5 rounded-lg`),appearance:"body",children:[q&&a&&r?e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"line-through",children:d(a)}),e.jsx("span",{children:b()})]}):W||v?e.jsx("mark",{className:p("rounded-md py-0.5 px-1",be()),children:b()}):b(),s?.toLowerCase()==="currency"&&m!==0&&m!==void 0&&m!==null&&e.jsxs(Ie.motion.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0},transition:{duration:.25},className:p("inline-flex items-center gap-1 ml-1.5 text-xs font-medium",m>0?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"),children:[e.jsx("span",{className:"flex items-center justify-center w-4 h-4",children:m>0?e.jsx(j.ArrowUpwardRounded,{sx:{fontSize:16},className:"text-emerald-600 dark:text-emerald-400"}):e.jsx(j.ArrowDownwardRounded,{sx:{fontSize:16},className:"text-red-600 dark:text-red-400"})}),e.jsx("span",{children:i.formatCurrency(Math.abs(m),n?.currency_code||"USD")})]}),n?.is_master_data&&n?.reference&&r&&e.jsx("button",{onClick:()=>B(n),onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),B(n))},"aria-label":`Search master data for ${l}`,type:"button",className:"cursor-pointer",children:e.jsx(Ne.SearchIcon,{width:20,height:20})}),ie&&e.jsx("input",{type:"file",onChange:we,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":`Upload file for ${l}`})]}),a&&!q&&e.jsx(L.Typography,{variant:"medium",size:"extra-small",className:"pt-0.5",appearance:"body",children:e.jsx("mark",{className:"rounded-md py-0.5 px-1 bg-error-100",children:e.jsx("del",{children:a||s?.toLowerCase()==="boolean"&&a==="0"?a==="True"&&s?.toLowerCase()!=="choice"?"Yes":a==="False"&&s?.toLowerCase()!=="choice"?"No":s?.toLowerCase()==="boolean"?i.formatBooleanValue(a):s?.toLowerCase()==="currency"?i.formatCurrency(a,n?.currency_code):s?.toLowerCase()==="date"?i.formatDate(a,{skipTimezone:!0,withTime:!1}):s?.toLowerCase()==="datetime"?i.formatDate(a,{skipTimezone:!0,withTime:!0}):s?.toLowerCase()==="percentage"?`${a}%`:s?.toLowerCase()==="url"?Z(a):a.length>x?e.jsxs("p",{children:[d(a).slice(0,c?x:d(a).length),c?"... ":" ",k()]}):d(a):"-"})})}),$&&e.jsx($,{isVisible:xe,onClose:ye,masterdataInfo:he}),H&&f&&M&&e.jsx("div",{className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:t=>t.stopPropagation(),onMouseDown:t=>t.preventDefault(),onKeyDown:t=>{t.key==="Escape"&&N(!1)},role:"tooltip","aria-label":"Risk analysis details",tabIndex:0,children:_?e.jsx(_,{riskDetails:f}):e.jsx("div",{className:"shadow-lg p-4",children:e.jsxs("div",{className:"text-sm",children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Risk Details"}),e.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:f.description||"Risk analysis information"})]})})})]})});P.displayName="LabelValue";exports.LabelValue=P;
|
|
2
2
|
//# sourceMappingURL=LabelValue.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelValue.cjs.js","sources":["../../../../src/components/data-display/label-value/LabelValue.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, forwardRef, type ReactNode } from 'react';\nimport cn from 'classnames';\nimport { HelpIcon } from '../../icons/HelpIcon';\nimport { SearchIcon } from '../../icons/SearchIcon';\nimport { Typography } from '../typography/Typography';\nimport { formatCurrency, formatDate, formatBooleanValue, isISODateString, decodeHTMLEntities } from '../../../utils/formatters';\nimport { CURRENCIES } from '../../forms/currency-input/currency.constant';\nimport { Label } from '../label/Label';\nimport { motion } from 'framer-motion';\nimport { ArrowUpwardRounded, ArrowDownwardRounded, BoltOutlined, OpenInNew } from '@mui/icons-material';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { AIExtractedIndicator } from '../../icons/AIExtractedIndicator';\nimport { AIStarIcon } from '../../icons/AIStarIcon';\nimport { CheckFilledIcon, ContentCopyIcon } from '../../icon';\nimport { getConfidenceScoreBadgeColor, getConfidenceScoreBadgeFill, getConfidenceScoreBadgeHoverClass, shouldShowConfidenceScore } from '../../../utils/confidenceScoreUtils';\nimport dayjs from 'dayjs';\n\n/**\n * Source meta bounding box\n */\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\n/**\n * Source meta item\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 * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\n/**\n * Available label value size options\n */\nexport type LabelValueSize = 'small' | 'medium' | 'large';\n\n/**\n * Available highlight color options\n */\nexport type HighlightColor = 'success' | 'warning' | 'error' | 'info';\n\n/**\n * Theme mode for styling\n */\nexport type ThemeMode = 'light' | 'dark';\n\n/**\n * Upload handler function type\n */\nexport type UploadHandler = (file: File) => void | Promise<void>;\n\n/**\n * Master data item interface\n */\nexport interface MasterDataItem {\n is_master_data?: boolean;\n reference?: string;\n group_technical_name?: string;\n currency_code?: string;\n}\n\n/**\n * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\n/**\n * Master data modal component props\n */\nexport interface MasterDataModalProps {\n isVisible: boolean;\n onClose: () => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n masterdataInfo: any;\n}\n\n/**\n * Risk details card component props\n * Using generic to allow custom risk detail types from consumers\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface RiskDetailsCardProps<TRisk = any> {\n riskDetails: TRisk;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the LabelValue component\n */\nexport interface LabelValueProps {\n /** The id of the label value */\n id?: string;\n /** The label text to display */\n label?: string;\n /** The value to display */\n value?: string | number | boolean | ReactNode;\n /** Additional CSS classes */\n className?: string;\n /** Data type for formatting */\n type?: 'string' | 'number' | 'boolean' | 'currency' | 'date' | 'datetime' | 'percentage' | 'url';\n /** Tags to display with the label */\n tags?: Array<{ label: string; color?: string; value?: string }>;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Master data item information */\n items?: MasterDataItem;\n /** Whether the value has been modified */\n isModified?: boolean;\n /** Whether the value has been changed */\n isChanged?: boolean;\n /** Size variant */\n size?: LabelValueSize;\n /** Whether the value is highlighted */\n isHighlighted?: boolean;\n /** Deleted value for diff display */\n deletedValue?: string;\n /** Highlight color for changes */\n highlightColor?: HighlightColor;\n /** Whether search is active */\n isSearchActive?: boolean;\n /** Whether to show original boolean value */\n originalValue?: boolean;\n /** Whether to show diff between old and new values */\n showDiff?: boolean;\n /** Whether this is a live field (shows bolt icon) */\n isLiveField?: boolean;\n /** Whether this is an AI extracted field (shows AI extracted icon) */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Delta change value for currency fields */\n deltaChange?: number;\n /** Theme mode */\n theme?: ThemeMode;\n /** Upload handler function */\n onUpload?: UploadHandler;\n /** Whether the component accepts file uploads */\n acceptsUpload?: boolean;\n /** Master data modal component */\n MasterDataModal?: React.ComponentType<MasterDataModalProps>;\n /** Risk analysis data - accepts any risk object extending RiskDetails */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n riskDetails?: RiskDetails | any;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component - accepts components with custom risk types */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Custom aria-label for accessibility */\n 'aria-label'?: string;\n /** Whether to decode HTML character entities in string values (default: true) */\n decodeEntities?: boolean;\n /** Function to handle AI extracted indicator click */\n onAiExtractedIndicatorClick?: (value: string) => void;\n /** Whether to show a copy-to-clipboard icon in the top-right corner on hover */\n copyOnHover?: boolean;\n /** Display alias text for URL type — shown instead of the raw URL, with an external link icon */\n urlAlias?: string;\n}\n\n/**\n * LabelValue component displays a label-value pair with various formatting options\n *\n * @example\n * ```tsx\n * <LabelValue \n * label=\"Status\" \n * value=\"Active\" \n * type=\"string\" \n * size=\"medium\" \n * />\n * <LabelValue \n * label=\"Price\" \n * value={99.99} \n * type=\"currency\" \n * items={{ currency_code: 'USD' }}\n * />\n * <LabelValue \n * label=\"Upload File\" \n * acceptsUpload \n * onUpload={handleUpload}\n * />\n * ```\n */\nexport const LabelValue = forwardRef<HTMLDivElement, LabelValueProps>(\n (\n {\n id,\n label,\n value,\n className,\n type = 'string',\n tags,\n tooltip,\n items,\n isModified = false,\n isChanged = false,\n size = 'medium',\n isHighlighted = false,\n deletedValue,\n highlightColor = 'warning',\n isSearchActive = false,\n originalValue = false,\n showDiff = false,\n isLiveField = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n deltaChange,\n theme: _theme = 'light',\n onUpload,\n acceptsUpload = false,\n MasterDataModal,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n 'aria-label': ariaLabel,\n decodeEntities = true,\n onAiExtractedIndicatorClick,\n copyOnHover = false,\n urlAlias,\n },\n ref\n ) => {\n const [collapseValue, setCollapseValue] = useState(true);\n const [isOpenMasterDataModal, setIsOpenMasterDataModal] = useState(false);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [masterdataModalInfo, setMasterdataModalInfo] = useState<any>(null);\n const [isHovered, setIsHovered] = useState(false);\n const [isCopied, setIsCopied] = useState(false);\n const copyResetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n return () => {\n if (copyResetTimer.current) clearTimeout(copyResetTimer.current);\n };\n }, []);\n\n // Theme is passed as prop but not used in current implementation\n\n /**\n * Conditionally decode HTML entities based on the decodeEntities prop\n */\n const decode = (text: string): string => decodeEntities ? decodeHTMLEntities(text) : text;\n\n const COLLAPSE_CHAR_LIMIT = 100;\n\n /**\n * Handle collapse toggle for long text\n */\n const handleCollapse = () => {\n setCollapseValue(!collapseValue);\n };\n\n /**\n * Show more / Show less toggle for long text and URLs\n */\n const renderCollapseToggle = () => (\n <button\n id={`btn-label-value-${collapseValue ? 'Show more' : 'Show less'}`}\n className=\"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap\"\n onClick={handleCollapse}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleCollapse();\n }\n }}\n aria-label={collapseValue ? 'Show more content' : 'Show less content'}\n type=\"button\"\n >\n {collapseValue ? 'Show more' : 'Show less'}\n </button>\n );\n\n /**\n * Render a URL with optional collapse for long href/display text\n */\n const renderUrlValue = (href: string) => {\n if (urlAlias) {\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 font-semibold text-neutral-900 dark:text-white hover:text-primary-600 dark:hover:text-primary-400 transition-colors\"\n >\n {urlAlias}\n <OpenInNew sx={{ fontSize: 16 }} className=\"text-primary-600 dark:text-primary-400\" />\n </a>\n );\n }\n const decoded = decode(href);\n if (decoded.length <= COLLAPSE_CHAR_LIMIT) {\n return (\n <a href={href} className=\"text-primary-600 truncate\">\n {decoded}\n </a>\n );\n }\n return (\n <p>\n <a href={href} className=\"text-primary-600 break-all\">\n {decoded.slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decoded.length)}\n </a>\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n );\n };\n\n /**\n * Handle master data click\n */\n const handleMasterDataClick = (item: MasterDataItem) => {\n setIsOpenMasterDataModal(true);\n setMasterdataModalInfo({ ...item, value });\n };\n\n /**\n * Handle master data modal close\n */\n const handleMasterDataClose = () => {\n setIsOpenMasterDataModal(false);\n setMasterdataModalInfo(null);\n };\n\n /**\n * Copy the current value to the clipboard\n */\n const handleCopyValue = () => {\n const textToCopy =\n value === null || value === undefined || typeof value === 'object'\n ? ''\n : String(value);\n if (!textToCopy) return;\n navigator.clipboard?.writeText(textToCopy)\n .then(() => {\n setIsCopied(true);\n if (copyResetTimer.current) clearTimeout(copyResetTimer.current);\n copyResetTimer.current = setTimeout(() => setIsCopied(false), 1500);\n })\n .catch(() => { });\n };\n\n /**\n * Handle file upload\n */\n const handleFileUpload = (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file && onUpload) {\n onUpload(file);\n }\n // Reset input value to allow same file selection\n event.target.value = '';\n };\n\n /**\n * Format and display the value based on type\n */\n const displayValue = () => {\n const isISODate = typeof value === 'string' && isISODateString(value);\n\n if (isSearchActive && typeof value === 'object') {\n return value;\n }\n\n if (value || (type?.toLowerCase() === 'boolean' && value === 0) || (type?.toLowerCase() === 'currency' && Number(value) >= 0)) {\n if ((value === true || value === 'True') && !originalValue && (type?.toLowerCase() !== 'choice')) {\n return 'Yes';\n } else if ((value === false || value === 'False') && !originalValue && (type?.toLowerCase() !== 'choice')) {\n return 'No';\n } else if (type?.toLowerCase() === 'url') {\n return renderUrlValue(value as string);\n } else if (type?.toLowerCase() === 'boolean') {\n return formatBooleanValue(value);\n } else if (type?.toLowerCase() === 'currency') {\n const formatted = formatCurrency(value, items?.currency_code) || '-';\n const currencyName = items?.currency_code\n ? CURRENCIES.find(c => c.value === items.currency_code)?.label\n : undefined;\n const tooltipTitle = currencyName\n ? `${items!.currency_code} — ${currencyName}`\n : items?.currency_code ?? '';\n return currencyName ? (\n <Tooltip title={tooltipTitle} placement=\"top\">\n <span>{formatted}</span>\n </Tooltip>\n ) : formatted;\n } else if (type?.toLowerCase() === 'datetime') {\n const dateValue = typeof value === 'string' && value.includes('Z') ? value.replace(/\\.000Z$/, 'Z') : value;\n return formatDate(dateValue as string, {\n skipTimezone: false,\n withTime: true,\n });\n } else if (type?.toLowerCase() === 'date' || isISODate) {\n let dateValue = value;\n\n if (typeof value === 'string' && value.includes('Z')) {\n dateValue = value.replace(/\\.000Z$/, 'Z')\n } else if (typeof value === 'string' && !value.includes('Z')) {\n const parsed = dayjs(value);\n dateValue = dayjs(parsed).isValid() ? parsed.toString() : value;\n }\n\n return formatDate(dateValue as string, {\n skipTimezone: true,\n withTime: false,\n });\n } else if (type?.toLowerCase() === 'percentage') {\n return `${value}%`;\n } else if (typeof value === 'string' && value.length > COLLAPSE_CHAR_LIMIT) {\n const decoded = decode(value);\n return (\n <p>\n {decoded.slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decoded.length)}\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n );\n } else {\n return typeof value === 'string' ? decode(value) : value;\n }\n }\n return '-';\n };\n\n /**\n * Get Typography size based on LabelValue size\n */\n const getTypographySize = () => {\n switch (size) {\n case 'small':\n return 'extra-small' as const;\n case 'large':\n return 'large' as const;\n default: // medium\n return 'small' as const;\n }\n };\n\n /**\n * Get highlight color classes\n */\n const getHighlightClasses = (): string => {\n switch (highlightColor) {\n case 'success':\n return 'bg-success-100';\n case 'warning':\n return 'bg-warning-100';\n case 'error':\n return 'bg-error-100';\n case 'info':\n return 'bg-info-100';\n default:\n return 'bg-warning-100';\n }\n };\n\n return (\n <div\n id={id || ''}\n ref={ref}\n className={cn(\n 'font-medium relative',\n className\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n aria-label={ariaLabel || `Label: ${label}, Value: ${value}`}\n >\n {/* Label section */}\n <Typography\n variant=\"medium\"\n size={getTypographySize()}\n className=\"flex gap-1 items-center flex-wrap\"\n appearance=\"subtitle\"\n >\n\n {/* Live field indicator */}\n {typeof label === 'string' ? decode(label) : label} {<Label labels={tags?.map(tag => ({ ...tag, color: tag.color || 'primary' }))} />}\n\n {isLiveField && <BoltOutlined sx={{ fontSize: 16, color: 'var(--color-primary-600)', rotate: '15deg' }} />}\n {isAiExtracted &&\n (shouldShowConfidenceScore(confidenceScore) && confidenceType ? (\n <Tooltip\n placement=\"top\"\n title={confidenceTooltip || \"\"}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\"cursor-pointer w-3 h-3 flex items-center justify-center rounded-full\", getConfidenceScoreBadgeHoverClass(confidenceType))}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n </div>\n </Tooltip>\n ) : (\n <AIExtractedIndicator onClick={() => onAiExtractedIndicatorClick?.(displayValue() as string)} />\n ))}\n\n {/* Tooltip */}\n {tooltip && (\n <Tooltip\n placement=\"top\"\n title={tooltip}\n whiteSpace=\"pre-wrap\"\n >\n <div\n className=\"cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n // Tooltip will show on focus\n }\n }}\n >\n <HelpIcon size={14} />\n </div>\n </Tooltip>\n )}\n {copyOnHover && isHovered && (\n <Tooltip title={isCopied ? 'Copied' : `Copy ${label ?? 'value'}`} placement=\"top\" whiteSpace=\"pre-wrap\">\n <button\n type=\"button\"\n onClick={handleCopyValue}\n aria-label={isCopied ? `Copied ${label ?? 'value'}` : `Copy ${label ?? 'value'}`}\n className=\"p-1 flex items-center justify-center rounded text-neutral-500 hover:!text-primary-600 hover:bg-neutral-100 dark:text-primary-400 dark:hover:!text-primary-600 dark:hover:bg-neutral-800 cursor-pointer\"\n >\n <span className=\"relative inline-flex h-4 w-4 items-center justify-center\">\n <ContentCopyIcon\n size={16}\n className={cn(\n 'absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out',\n isCopied ? 'opacity-0 scale-50 rotate-[-90deg]' : 'opacity-100 scale-100 rotate-0'\n )}\n />\n <CheckFilledIcon\n size={16}\n className={cn(\n 'absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out',\n isCopied ? 'opacity-100 scale-100 rotate-0' : 'opacity-0 scale-50 rotate-90'\n )}\n />\n </span>\n </button>\n </Tooltip>\n )}\n </Typography>\n\n {/* Value section */}\n <Typography\n variant=\"medium\"\n size={getTypographySize()}\n className={cn(\n 'text-- whitespace-normal break-all flex gap-1 pt-0.5',\n isModified && 'bg-neutral-50 dark:bg-black-700 p-1 rounded',\n isRiskAnalysisOpen && riskDetails?.color &&\n `bg-${riskDetails.color}-50 border-${riskDetails.color}-300 px-0.5 rounded-lg`\n )}\n appearance=\"body\"\n >\n {/* Value display */}\n {showDiff && deletedValue && value ? (\n <div className=\"flex gap-2\">\n <span className=\"line-through\">{decode(deletedValue)}</span>\n <span>{displayValue()}</span>\n </div>\n ) : isChanged || isHighlighted ? (\n <mark className={cn('rounded-md py-0.5 px-1', getHighlightClasses())}>\n {displayValue()}\n </mark>\n ) : (\n displayValue()\n )}\n\n {/* Delta change indicator for currency fields */}\n {type?.toLowerCase() === 'currency' && deltaChange !== 0 && deltaChange !== undefined && deltaChange !== null && (\n <motion.span\n initial={{ opacity: 0, y: 2 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.25 }}\n className={cn(\n 'inline-flex items-center gap-1 ml-1.5 text-xs font-medium',\n deltaChange > 0 ? 'text-emerald-600 dark:text-emerald-400' : 'text-red-600 dark:text-red-400'\n )}\n >\n <span className=\"flex items-center justify-center w-4 h-4\">\n {deltaChange > 0 ? (\n <ArrowUpwardRounded sx={{ fontSize: 16 }} className=\"text-emerald-600 dark:text-emerald-400\" />\n ) : (\n <ArrowDownwardRounded sx={{ fontSize: 16 }} className=\"text-red-600 dark:text-red-400\" />\n )}\n </span>\n <span>{formatCurrency(Math.abs(deltaChange), items?.currency_code || 'USD')}</span>\n </motion.span>\n )}\n\n {/* Master data search icon */}\n {items?.is_master_data && items?.reference && value && (\n <button\n onClick={() => handleMasterDataClick(items)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleMasterDataClick(items);\n }\n }}\n aria-label={`Search master data for ${label}`}\n type=\"button\"\n className=\"cursor-pointer\"\n >\n <SearchIcon width={20} height={20} />\n </button>\n )}\n\n {/* File upload input */}\n {acceptsUpload && (\n <input\n type=\"file\"\n onChange={handleFileUpload}\n className=\"absolute inset-0 w-full h-full opacity-0 cursor-pointer\"\n aria-label={`Upload file for ${label}`}\n />\n )}\n </Typography>\n\n {/* Deleted value display */}\n {deletedValue && !showDiff && (\n <Typography\n variant=\"medium\"\n size=\"extra-small\"\n className=\"pt-0.5\"\n appearance=\"body\"\n >\n <mark className=\"rounded-md py-0.5 px-1 bg-error-100\">\n <del>\n {deletedValue || (type?.toLowerCase() === 'boolean' && deletedValue === '0') ? (\n deletedValue === 'True' && (type?.toLowerCase() !== 'choice') ? (\n 'Yes'\n ) : deletedValue === 'False' && (type?.toLowerCase() !== 'choice') ? (\n 'No'\n ) : type?.toLowerCase() === 'boolean' ? (\n formatBooleanValue(deletedValue)\n ) : type?.toLowerCase() === 'currency' ? (\n formatCurrency(deletedValue, items?.currency_code)\n ) : type?.toLowerCase() === 'date' ? (\n formatDate(deletedValue, {\n skipTimezone: true,\n withTime: false,\n })\n ) : type?.toLowerCase() === 'datetime' ? (\n formatDate(deletedValue, {\n skipTimezone: true,\n withTime: true,\n })\n ) : type?.toLowerCase() === 'percentage' ? (\n `${deletedValue}%`\n ) : type?.toLowerCase() === 'url' ? (\n renderUrlValue(deletedValue)\n ) : deletedValue.length > COLLAPSE_CHAR_LIMIT ? (\n <p>\n {decode(deletedValue).slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decode(deletedValue).length)}\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n ) : (\n decode(deletedValue)\n )\n ) : (\n '-'\n )}\n </del>\n </mark>\n </Typography>\n )}\n\n {/* Master data modal */}\n {MasterDataModal && (\n <MasterDataModal\n isVisible={isOpenMasterDataModal}\n onClose={handleMasterDataClose}\n masterdataInfo={masterdataModalInfo}\n />\n )}\n\n {/* Risk details tooltip */}\n {isHovered && riskDetails && isRiskAnalysisOpen && (\n <div\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 role=\"tooltip\"\n aria-label=\"Risk analysis details\"\n tabIndex={0}\n >\n {RiskDetailsCard ? (\n <RiskDetailsCard riskDetails={riskDetails} />\n ) : (\n <div className=\"shadow-lg p-4\">\n <div className=\"text-sm\">\n <h4 className=\"font-semibold mb-2\">Risk Details</h4>\n <p className=\"text-neutral-600 dark:text-neutral-300\">\n {riskDetails.description || 'Risk analysis information'}\n </p>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nLabelValue.displayName = 'LabelValue';\n"],"names":["LabelValue","forwardRef","id","label","value","className","type","tags","tooltip","items","isModified","isChanged","size","isHighlighted","deletedValue","highlightColor","isSearchActive","originalValue","showDiff","isLiveField","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","deltaChange","_theme","onUpload","acceptsUpload","MasterDataModal","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","ariaLabel","decodeEntities","onAiExtractedIndicatorClick","copyOnHover","urlAlias","ref","collapseValue","setCollapseValue","useState","isOpenMasterDataModal","setIsOpenMasterDataModal","masterdataModalInfo","setMasterdataModalInfo","isHovered","setIsHovered","isCopied","setIsCopied","copyResetTimer","useRef","useEffect","decode","text","decodeHTMLEntities","COLLAPSE_CHAR_LIMIT","handleCollapse","renderCollapseToggle","jsx","e","renderUrlValue","href","jsxs","OpenInNew","decoded","handleMasterDataClick","item","handleMasterDataClose","handleCopyValue","textToCopy","handleFileUpload","event","file","displayValue","isISODate","isISODateString","formatBooleanValue","formatted","formatCurrency","currencyName","CURRENCIES","c","tooltipTitle","Tooltip","dateValue","formatDate","parsed","dayjs","getTypographySize","getHighlightClasses","cn","Typography","Label","tag","BoltOutlined","shouldShowConfidenceScore","getConfidenceScoreBadgeHoverClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","AIExtractedIndicator","HelpIcon","ContentCopyIcon","CheckFilledIcon","motion","ArrowUpwardRounded","ArrowDownwardRounded","SearchIcon"],"mappings":"8wBAsNaA,EAAaC,EAAAA,WACxB,CACE,CACE,GAAAC,EACA,MAAAC,EACA,MAAAC,EACA,UAAAC,EACA,KAAAC,EAAO,SACP,KAAAC,EACA,QAAAC,EACA,MAAAC,EACA,WAAAC,EAAa,GACb,UAAAC,EAAY,GACZ,KAAAC,EAAO,SACP,cAAAC,EAAgB,GAChB,aAAAC,EACA,eAAAC,EAAiB,UACjB,eAAAC,GAAiB,GACjB,cAAAC,EAAgB,GAChB,SAAAC,EAAW,GACX,YAAAC,GAAc,GACd,cAAAC,GAAgB,GAChB,gBAAAC,GACA,eAAAC,EAAiB,OACjB,kBAAAC,GACA,WAAAC,GAAa,CAAA,EACb,uBAAAC,GACA,YAAAC,EACA,MAAOC,GAAS,QAChB,SAAAC,EACA,cAAAC,GAAgB,GAChB,gBAAAC,EACA,YAAAC,EACA,mBAAAC,EAAqB,GACrB,gBAAAC,EACA,aAAcC,GACd,eAAAC,GAAiB,GACjB,4BAAAC,GACA,YAAAC,GAAc,GACd,SAA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EAAehD,CAAY,EACzBA,EAAa,OAAS2C,SACvB,IAAA,CACE,SAAA,CAAAH,EAAOxC,CAAY,EAAE,MAAM,EAAG0B,EAAgBiB,EAAsBH,EAAOxC,CAAY,EAAE,MAAM,EAC/F0B,EAAgB,OAAS,IACzBmB,EAAA,CAAqB,CAAA,CACxB,EAEAL,EAAOxC,CAAY,EAGrB,IAEJ,CAAA,CACF,CAAA,CAAA,EAKHgB,GACC8B,EAAAA,IAAC9B,EAAA,CACC,UAAWa,GACX,QAAS0B,GACT,eAAgBxB,EAAA,CAAA,EAKnBE,GAAahB,GAAeC,GAC3B4B,EAAAA,IAAC,MAAA,CACC,UAAU,oFACV,QAAUC,GAAMA,EAAE,gBAAA,EAClB,YAAcA,GAAMA,EAAE,eAAA,EACtB,UAAYA,GAAM,CACZA,EAAE,MAAQ,UACZb,EAAa,EAAK,CAEtB,EACA,KAAK,UACL,aAAW,wBACX,SAAU,EAET,SAAAf,EACC2B,MAAC3B,EAAA,CAAgB,YAAAF,CAAA,CAA0B,EAE3C6B,EAAAA,IAAC,MAAA,CAAI,UAAU,gBACb,SAAAI,EAAAA,KAAC,MAAA,CAAI,UAAU,UACb,SAAA,CAAAJ,EAAAA,IAAC,KAAA,CAAG,UAAU,qBAAqB,SAAA,eAAY,QAC9C,IAAA,CAAE,UAAU,yCACV,SAAA7B,EAAY,aAAe,2BAAA,CAC9B,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,CAAA,CAIR,CACF,EAEA/B,EAAW,YAAc"}
|
|
1
|
+
{"version":3,"file":"LabelValue.cjs.js","sources":["../../../../src/components/data-display/label-value/LabelValue.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, forwardRef, type ReactNode } from 'react';\nimport cn from 'classnames';\nimport { HelpIcon } from '../../icons/HelpIcon';\nimport { SearchIcon } from '../../icons/SearchIcon';\nimport { Typography } from '../typography/Typography';\nimport { formatCurrency, formatDate, formatBooleanValue, isISODateString, decodeHTMLEntities } from '../../../utils/formatters';\nimport { CURRENCIES } from '../../forms/currency-input/currency.constant';\nimport { Label } from '../label/Label';\nimport { motion } from 'framer-motion';\nimport { ArrowUpwardRounded, ArrowDownwardRounded, BoltOutlined, OpenInNew } from '@mui/icons-material';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { AIExtractedIndicator } from '../../icons/AIExtractedIndicator';\nimport { AIStarIcon } from '../../icons/AIStarIcon';\nimport { CheckFilledIcon, ContentCopyIcon } from '../../icon';\nimport { getConfidenceScoreBadgeColor, getConfidenceScoreBadgeFill, getConfidenceScoreBadgeHoverClass, shouldShowConfidenceScore } from '../../../utils/confidenceScoreUtils';\nimport dayjs from 'dayjs';\n\n/**\n * Source meta bounding box\n */\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\n/**\n * Source meta item\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 * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\n/**\n * Available label value size options\n */\nexport type LabelValueSize = 'small' | 'medium' | 'large';\n\n/**\n * Available highlight color options\n */\nexport type HighlightColor = 'success' | 'warning' | 'error' | 'info';\n\n/**\n * Theme mode for styling\n */\nexport type ThemeMode = 'light' | 'dark';\n\n/**\n * Upload handler function type\n */\nexport type UploadHandler = (file: File) => void | Promise<void>;\n\n/**\n * Master data item interface\n */\nexport interface MasterDataItem {\n is_master_data?: boolean;\n reference?: string;\n group_technical_name?: string;\n currency_code?: string;\n}\n\n/**\n * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\n/**\n * Master data modal component props\n */\nexport interface MasterDataModalProps {\n isVisible: boolean;\n onClose: () => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n masterdataInfo: any;\n}\n\n/**\n * Risk details card component props\n * Using generic to allow custom risk detail types from consumers\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface RiskDetailsCardProps<TRisk = any> {\n riskDetails: TRisk;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the LabelValue component\n */\nexport interface LabelValueProps {\n /** The id of the label value */\n id?: string;\n /** The label text to display */\n label?: string;\n /** The value to display */\n value?: string | number | boolean | ReactNode;\n /** Additional CSS classes */\n className?: string;\n /** Data type for formatting */\n type?: 'string' | 'number' | 'boolean' | 'currency' | 'date' | 'datetime' | 'percentage' | 'url';\n /** Tags to display with the label */\n tags?: Array<{ label: string; color?: string; value?: string }>;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Master data item information */\n items?: MasterDataItem;\n /** Whether the value has been modified */\n isModified?: boolean;\n /** Whether the value has been changed */\n isChanged?: boolean;\n /** Size variant */\n size?: LabelValueSize;\n /** Whether the value is highlighted */\n isHighlighted?: boolean;\n /** Deleted value for diff display */\n deletedValue?: string;\n /** Highlight color for changes */\n highlightColor?: HighlightColor;\n /** Whether search is active */\n isSearchActive?: boolean;\n /** Whether to show original boolean value */\n originalValue?: boolean;\n /** Whether to show diff between old and new values */\n showDiff?: boolean;\n /** Whether this is a live field (shows bolt icon) */\n isLiveField?: boolean;\n /** Whether this is an AI extracted field (shows AI extracted icon) */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Delta change value for currency fields */\n deltaChange?: number;\n /** Theme mode */\n theme?: ThemeMode;\n /** Upload handler function */\n onUpload?: UploadHandler;\n /** Whether the component accepts file uploads */\n acceptsUpload?: boolean;\n /** Master data modal component */\n MasterDataModal?: React.ComponentType<MasterDataModalProps>;\n /** Risk analysis data - accepts any risk object extending RiskDetails */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n riskDetails?: RiskDetails | any;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component - accepts components with custom risk types */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Custom aria-label for accessibility */\n 'aria-label'?: string;\n /** Whether to decode HTML character entities in string values (default: true) */\n decodeEntities?: boolean;\n /** Function to handle AI extracted indicator click */\n onAiExtractedIndicatorClick?: (value: string) => void;\n /** Whether to show a copy-to-clipboard icon in the top-right corner on hover */\n copyOnHover?: boolean;\n /** Display alias text for URL type — shown instead of the raw URL, with an external link icon */\n urlAlias?: string;\n /**\n * Whether a `datetime` value is an instant that should be converted to the viewer's timezone.\n * Field values are wall clock — what the user typed — so this is off by default; turn it on for\n * system timestamps (created_at, executed_on...).\n */\n allowTimezoneConversion?: boolean;\n}\n\n/**\n * LabelValue component displays a label-value pair with various formatting options\n *\n * @example\n * ```tsx\n * <LabelValue \n * label=\"Status\" \n * value=\"Active\" \n * type=\"string\" \n * size=\"medium\" \n * />\n * <LabelValue \n * label=\"Price\" \n * value={99.99} \n * type=\"currency\" \n * items={{ currency_code: 'USD' }}\n * />\n * <LabelValue \n * label=\"Upload File\" \n * acceptsUpload \n * onUpload={handleUpload}\n * />\n * ```\n */\nexport const LabelValue = forwardRef<HTMLDivElement, LabelValueProps>(\n (\n {\n id,\n label,\n value,\n className,\n type = 'string',\n tags,\n tooltip,\n items,\n isModified = false,\n isChanged = false,\n size = 'medium',\n isHighlighted = false,\n deletedValue,\n highlightColor = 'warning',\n isSearchActive = false,\n originalValue = false,\n showDiff = false,\n isLiveField = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n deltaChange,\n theme: _theme = 'light',\n onUpload,\n acceptsUpload = false,\n MasterDataModal,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n 'aria-label': ariaLabel,\n decodeEntities = true,\n onAiExtractedIndicatorClick,\n copyOnHover = false,\n urlAlias,\n allowTimezoneConversion = false,\n },\n ref\n ) => {\n const [collapseValue, setCollapseValue] = useState(true);\n const [isOpenMasterDataModal, setIsOpenMasterDataModal] = useState(false);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [masterdataModalInfo, setMasterdataModalInfo] = useState<any>(null);\n const [isHovered, setIsHovered] = useState(false);\n const [isCopied, setIsCopied] = useState(false);\n const copyResetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n return () => {\n if (copyResetTimer.current) clearTimeout(copyResetTimer.current);\n };\n }, []);\n\n // Theme is passed as prop but not used in current implementation\n\n /**\n * Conditionally decode HTML entities based on the decodeEntities prop\n */\n const decode = (text: string): string => decodeEntities ? decodeHTMLEntities(text) : text;\n\n const COLLAPSE_CHAR_LIMIT = 100;\n\n /**\n * Handle collapse toggle for long text\n */\n const handleCollapse = () => {\n setCollapseValue(!collapseValue);\n };\n\n /**\n * Show more / Show less toggle for long text and URLs\n */\n const renderCollapseToggle = () => (\n <button\n id={`btn-label-value-${collapseValue ? 'Show more' : 'Show less'}`}\n className=\"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap\"\n onClick={handleCollapse}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleCollapse();\n }\n }}\n aria-label={collapseValue ? 'Show more content' : 'Show less content'}\n type=\"button\"\n >\n {collapseValue ? 'Show more' : 'Show less'}\n </button>\n );\n\n /**\n * Render a URL with optional collapse for long href/display text\n */\n const renderUrlValue = (href: string) => {\n if (urlAlias) {\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 font-semibold text-neutral-900 dark:text-white hover:text-primary-600 dark:hover:text-primary-400 transition-colors\"\n >\n {urlAlias}\n <OpenInNew sx={{ fontSize: 16 }} className=\"text-primary-600 dark:text-primary-400\" />\n </a>\n );\n }\n const decoded = decode(href);\n if (decoded.length <= COLLAPSE_CHAR_LIMIT) {\n return (\n <a href={href} className=\"text-primary-600 truncate\">\n {decoded}\n </a>\n );\n }\n return (\n <p>\n <a href={href} className=\"text-primary-600 break-all\">\n {decoded.slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decoded.length)}\n </a>\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n );\n };\n\n /**\n * Handle master data click\n */\n const handleMasterDataClick = (item: MasterDataItem) => {\n setIsOpenMasterDataModal(true);\n setMasterdataModalInfo({ ...item, value });\n };\n\n /**\n * Handle master data modal close\n */\n const handleMasterDataClose = () => {\n setIsOpenMasterDataModal(false);\n setMasterdataModalInfo(null);\n };\n\n /**\n * Copy the current value to the clipboard\n */\n const handleCopyValue = () => {\n const textToCopy =\n value === null || value === undefined || typeof value === 'object'\n ? ''\n : String(value);\n if (!textToCopy) return;\n navigator.clipboard?.writeText(textToCopy)\n .then(() => {\n setIsCopied(true);\n if (copyResetTimer.current) clearTimeout(copyResetTimer.current);\n copyResetTimer.current = setTimeout(() => setIsCopied(false), 1500);\n })\n .catch(() => { });\n };\n\n /**\n * Handle file upload\n */\n const handleFileUpload = (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file && onUpload) {\n onUpload(file);\n }\n // Reset input value to allow same file selection\n event.target.value = '';\n };\n\n /**\n * Format and display the value based on type\n */\n const displayValue = () => {\n const isISODate = typeof value === 'string' && isISODateString(value);\n\n if (isSearchActive && typeof value === 'object') {\n return value;\n }\n\n if (value || (type?.toLowerCase() === 'boolean' && value === 0) || (type?.toLowerCase() === 'currency' && Number(value) >= 0)) {\n if ((value === true || value === 'True') && !originalValue && (type?.toLowerCase() !== 'choice')) {\n return 'Yes';\n } else if ((value === false || value === 'False') && !originalValue && (type?.toLowerCase() !== 'choice')) {\n return 'No';\n } else if (type?.toLowerCase() === 'url') {\n return renderUrlValue(value as string);\n } else if (type?.toLowerCase() === 'boolean') {\n return formatBooleanValue(value);\n } else if (type?.toLowerCase() === 'currency') {\n const formatted = formatCurrency(value, items?.currency_code) || '-';\n const currencyName = items?.currency_code\n ? CURRENCIES.find(c => c.value === items.currency_code)?.label\n : undefined;\n const tooltipTitle = currencyName\n ? `${items!.currency_code} — ${currencyName}`\n : items?.currency_code ?? '';\n return currencyName ? (\n <Tooltip title={tooltipTitle} placement=\"top\">\n <span>{formatted}</span>\n </Tooltip>\n ) : formatted;\n } else if (type?.toLowerCase() === 'datetime') {\n const dateValue = typeof value === 'string' && value.includes('Z') ? value.replace(/\\.000Z$/, 'Z') : value;\n return formatDate(dateValue as string, {\n skipTimezone: !allowTimezoneConversion,\n withTime: true,\n });\n } else if (type?.toLowerCase() === 'date' || isISODate) {\n let dateValue = value;\n\n if (typeof value === 'string' && value.includes('Z')) {\n dateValue = value.replace(/\\.000Z$/, 'Z')\n } else if (typeof value === 'string' && !value.includes('Z')) {\n const parsed = dayjs(value);\n dateValue = dayjs(parsed).isValid() ? parsed.toString() : value;\n }\n\n return formatDate(dateValue as string, {\n skipTimezone: true,\n withTime: false,\n });\n } else if (type?.toLowerCase() === 'percentage') {\n return `${value}%`;\n } else if (typeof value === 'string' && value.length > COLLAPSE_CHAR_LIMIT) {\n const decoded = decode(value);\n return (\n <p>\n {decoded.slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decoded.length)}\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n );\n } else {\n return typeof value === 'string' ? decode(value) : value;\n }\n }\n return '-';\n };\n\n /**\n * Get Typography size based on LabelValue size\n */\n const getTypographySize = () => {\n switch (size) {\n case 'small':\n return 'extra-small' as const;\n case 'large':\n return 'large' as const;\n default: // medium\n return 'small' as const;\n }\n };\n\n /**\n * Get highlight color classes\n */\n const getHighlightClasses = (): string => {\n switch (highlightColor) {\n case 'success':\n return 'bg-success-100';\n case 'warning':\n return 'bg-warning-100';\n case 'error':\n return 'bg-error-100';\n case 'info':\n return 'bg-info-100';\n default:\n return 'bg-warning-100';\n }\n };\n\n return (\n <div\n id={id || ''}\n ref={ref}\n className={cn(\n 'font-medium relative',\n className\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n aria-label={ariaLabel || `Label: ${label}, Value: ${value}`}\n >\n {/* Label section */}\n <Typography\n variant=\"medium\"\n size={getTypographySize()}\n className=\"flex gap-1 items-center flex-wrap\"\n appearance=\"subtitle\"\n >\n\n {/* Live field indicator */}\n {typeof label === 'string' ? decode(label) : label} {<Label labels={tags?.map(tag => ({ ...tag, color: tag.color || 'primary' }))} />}\n\n {isLiveField && <BoltOutlined sx={{ fontSize: 16, color: 'var(--color-primary-600)', rotate: '15deg' }} />}\n {isAiExtracted &&\n (shouldShowConfidenceScore(confidenceScore) && confidenceType ? (\n <Tooltip\n placement=\"top\"\n title={confidenceTooltip || \"\"}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\"cursor-pointer w-3 h-3 flex items-center justify-center rounded-full\", getConfidenceScoreBadgeHoverClass(confidenceType))}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n </div>\n </Tooltip>\n ) : (\n <AIExtractedIndicator onClick={() => onAiExtractedIndicatorClick?.(displayValue() as string)} />\n ))}\n\n {/* Tooltip */}\n {tooltip && (\n <Tooltip\n placement=\"top\"\n title={tooltip}\n whiteSpace=\"pre-wrap\"\n >\n <div\n className=\"cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n // Tooltip will show on focus\n }\n }}\n >\n <HelpIcon size={14} />\n </div>\n </Tooltip>\n )}\n {copyOnHover && isHovered && (\n <Tooltip title={isCopied ? 'Copied' : `Copy ${label ?? 'value'}`} placement=\"top\" whiteSpace=\"pre-wrap\">\n <button\n type=\"button\"\n onClick={handleCopyValue}\n aria-label={isCopied ? `Copied ${label ?? 'value'}` : `Copy ${label ?? 'value'}`}\n className=\"p-1 flex items-center justify-center rounded text-neutral-500 hover:!text-primary-600 hover:bg-neutral-100 dark:text-primary-400 dark:hover:!text-primary-600 dark:hover:bg-neutral-800 cursor-pointer\"\n >\n <span className=\"relative inline-flex h-4 w-4 items-center justify-center\">\n <ContentCopyIcon\n size={16}\n className={cn(\n 'absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out',\n isCopied ? 'opacity-0 scale-50 rotate-[-90deg]' : 'opacity-100 scale-100 rotate-0'\n )}\n />\n <CheckFilledIcon\n size={16}\n className={cn(\n 'absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out',\n isCopied ? 'opacity-100 scale-100 rotate-0' : 'opacity-0 scale-50 rotate-90'\n )}\n />\n </span>\n </button>\n </Tooltip>\n )}\n </Typography>\n\n {/* Value section */}\n <Typography\n variant=\"medium\"\n size={getTypographySize()}\n className={cn(\n 'text-- whitespace-normal break-all flex gap-1 pt-0.5',\n isModified && 'bg-neutral-50 dark:bg-black-700 p-1 rounded',\n isRiskAnalysisOpen && riskDetails?.color &&\n `bg-${riskDetails.color}-50 border-${riskDetails.color}-300 px-0.5 rounded-lg`\n )}\n appearance=\"body\"\n >\n {/* Value display */}\n {showDiff && deletedValue && value ? (\n <div className=\"flex gap-2\">\n <span className=\"line-through\">{decode(deletedValue)}</span>\n <span>{displayValue()}</span>\n </div>\n ) : isChanged || isHighlighted ? (\n <mark className={cn('rounded-md py-0.5 px-1', getHighlightClasses())}>\n {displayValue()}\n </mark>\n ) : (\n displayValue()\n )}\n\n {/* Delta change indicator for currency fields */}\n {type?.toLowerCase() === 'currency' && deltaChange !== 0 && deltaChange !== undefined && deltaChange !== null && (\n <motion.span\n initial={{ opacity: 0, y: 2 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.25 }}\n className={cn(\n 'inline-flex items-center gap-1 ml-1.5 text-xs font-medium',\n deltaChange > 0 ? 'text-emerald-600 dark:text-emerald-400' : 'text-red-600 dark:text-red-400'\n )}\n >\n <span className=\"flex items-center justify-center w-4 h-4\">\n {deltaChange > 0 ? (\n <ArrowUpwardRounded sx={{ fontSize: 16 }} className=\"text-emerald-600 dark:text-emerald-400\" />\n ) : (\n <ArrowDownwardRounded sx={{ fontSize: 16 }} className=\"text-red-600 dark:text-red-400\" />\n )}\n </span>\n <span>{formatCurrency(Math.abs(deltaChange), items?.currency_code || 'USD')}</span>\n </motion.span>\n )}\n\n {/* Master data search icon */}\n {items?.is_master_data && items?.reference && value && (\n <button\n onClick={() => handleMasterDataClick(items)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleMasterDataClick(items);\n }\n }}\n aria-label={`Search master data for ${label}`}\n type=\"button\"\n className=\"cursor-pointer\"\n >\n <SearchIcon width={20} height={20} />\n </button>\n )}\n\n {/* File upload input */}\n {acceptsUpload && (\n <input\n type=\"file\"\n onChange={handleFileUpload}\n className=\"absolute inset-0 w-full h-full opacity-0 cursor-pointer\"\n aria-label={`Upload file for ${label}`}\n />\n )}\n </Typography>\n\n {/* Deleted value display */}\n {deletedValue && !showDiff && (\n <Typography\n variant=\"medium\"\n size=\"extra-small\"\n className=\"pt-0.5\"\n appearance=\"body\"\n >\n <mark className=\"rounded-md py-0.5 px-1 bg-error-100\">\n <del>\n {deletedValue || (type?.toLowerCase() === 'boolean' && deletedValue === '0') ? (\n deletedValue === 'True' && (type?.toLowerCase() !== 'choice') ? (\n 'Yes'\n ) : deletedValue === 'False' && (type?.toLowerCase() !== 'choice') ? (\n 'No'\n ) : type?.toLowerCase() === 'boolean' ? (\n formatBooleanValue(deletedValue)\n ) : type?.toLowerCase() === 'currency' ? (\n formatCurrency(deletedValue, items?.currency_code)\n ) : type?.toLowerCase() === 'date' ? (\n formatDate(deletedValue, {\n skipTimezone: true,\n withTime: false,\n })\n ) : type?.toLowerCase() === 'datetime' ? (\n formatDate(deletedValue, {\n skipTimezone: true,\n withTime: true,\n })\n ) : type?.toLowerCase() === 'percentage' ? (\n `${deletedValue}%`\n ) : type?.toLowerCase() === 'url' ? (\n renderUrlValue(deletedValue)\n ) : deletedValue.length > COLLAPSE_CHAR_LIMIT ? (\n <p>\n {decode(deletedValue).slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decode(deletedValue).length)}\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n ) : (\n decode(deletedValue)\n )\n ) : (\n '-'\n )}\n </del>\n </mark>\n </Typography>\n )}\n\n {/* Master data modal */}\n {MasterDataModal && (\n <MasterDataModal\n isVisible={isOpenMasterDataModal}\n onClose={handleMasterDataClose}\n masterdataInfo={masterdataModalInfo}\n />\n )}\n\n {/* Risk details tooltip */}\n {isHovered && riskDetails && isRiskAnalysisOpen && (\n <div\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 role=\"tooltip\"\n aria-label=\"Risk analysis details\"\n tabIndex={0}\n >\n {RiskDetailsCard ? (\n <RiskDetailsCard riskDetails={riskDetails} />\n ) : (\n <div className=\"shadow-lg p-4\">\n <div className=\"text-sm\">\n <h4 className=\"font-semibold mb-2\">Risk Details</h4>\n <p className=\"text-neutral-600 dark:text-neutral-300\">\n {riskDetails.description || 'Risk analysis information'}\n </p>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nLabelValue.displayName = 'LabelValue';\n"],"names":["LabelValue","forwardRef","id","label","value","className","type","tags","tooltip","items","isModified","isChanged","size","isHighlighted","deletedValue","highlightColor","isSearchActive","originalValue","showDiff","isLiveField","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","deltaChange","_theme","onUpload","acceptsUpload","MasterDataModal","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","ariaLabel","decodeEntities","onAiExtractedIndicatorClick","copyOnHover","urlAlias","allowTimezoneConversion","ref","collapseValue","setCollapseValue","useState","isOpenMasterDataModal","setIsOpenMasterDataModal","masterdataModalInfo","setMasterdataModalInfo","isHovered","setIsHovered","isCopied","setIsCopied","copyResetTimer","useRef","useEffect","decode","text","decodeHTMLEntities","COLLAPSE_CHAR_LIMIT","handleCollapse","renderCollapseToggle","jsx","e","renderUrlValue","href","jsxs","OpenInNew","decoded","handleMasterDataClick","item","handleMasterDataClose","handleCopyValue","textToCopy","handleFileUpload","event","file","displayValue","isISODate","isISODateString","formatBooleanValue","formatted","formatCurrency","currencyName","CURRENCIES","c","tooltipTitle","Tooltip","dateValue","formatDate","parsed","dayjs","getTypographySize","getHighlightClasses","cn","Typography","Label","tag","BoltOutlined","shouldShowConfidenceScore","getConfidenceScoreBadgeHoverClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","AIExtractedIndicator","HelpIcon","ContentCopyIcon","CheckFilledIcon","motion","ArrowUpwardRounded","ArrowDownwardRounded","SearchIcon"],"mappings":"8wBA4NaA,EAAaC,EAAAA,WACxB,CACE,CACE,GAAAC,EACA,MAAAC,EACA,MAAAC,EACA,UAAAC,EACA,KAAAC,EAAO,SACP,KAAAC,EACA,QAAAC,EACA,MAAAC,EACA,WAAAC,EAAa,GACb,UAAAC,EAAY,GACZ,KAAAC,EAAO,SACP,cAAAC,EAAgB,GAChB,aAAAC,EACA,eAAAC,EAAiB,UACjB,eAAAC,GAAiB,GACjB,cAAAC,EAAgB,GAChB,SAAAC,EAAW,GACX,YAAAC,GAAc,GACd,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,CAAA,CAAA,CAIR,CACF,EAEA/B,EAAW,YAAc"}
|
|
@@ -158,6 +158,12 @@ export interface LabelValueProps {
|
|
|
158
158
|
copyOnHover?: boolean;
|
|
159
159
|
/** Display alias text for URL type — shown instead of the raw URL, with an external link icon */
|
|
160
160
|
urlAlias?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Whether a `datetime` value is an instant that should be converted to the viewer's timezone.
|
|
163
|
+
* Field values are wall clock — what the user typed — so this is off by default; turn it on for
|
|
164
|
+
* system timestamps (created_at, executed_on...).
|
|
165
|
+
*/
|
|
166
|
+
allowTimezoneConversion?: boolean;
|
|
161
167
|
}
|
|
162
168
|
/**
|
|
163
169
|
* LabelValue component displays a label-value pair with various formatting options
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as Ne, useState as w, useRef as ke, useEffect as Se } from "react";
|
|
3
3
|
import d from "../../../_virtual/index.es.js";
|
|
4
|
-
import { HelpIcon as
|
|
5
|
-
import { SearchIcon as
|
|
4
|
+
import { HelpIcon as Le } from "../../icons/HelpIcon.es.js";
|
|
5
|
+
import { SearchIcon as Ie } from "../../icons/SearchIcon.es.js";
|
|
6
6
|
import { Typography as L } from "../typography/Typography.es.js";
|
|
7
|
-
import { decodeHTMLEntities as
|
|
8
|
-
import { CURRENCIES as
|
|
9
|
-
import { Label as
|
|
10
|
-
import { motion as
|
|
11
|
-
import { BoltOutlined as
|
|
7
|
+
import { decodeHTMLEntities as Te, formatCurrency as I, formatBooleanValue as K, formatDate as C, isISODateString as ze } from "../../../utils/formatters.es.js";
|
|
8
|
+
import { CURRENCIES as $e } from "../../forms/currency-input/currency.constant.es.js";
|
|
9
|
+
import { Label as Me } from "../label/Label.es.js";
|
|
10
|
+
import { motion as _e } from "framer-motion";
|
|
11
|
+
import { BoltOutlined as De, ArrowUpwardRounded as Ee, ArrowDownwardRounded as je, OpenInNew as Re } from "@mui/icons-material";
|
|
12
12
|
import N from "../../tooltip/Tooltip.es.js";
|
|
13
|
-
import { AIExtractedIndicator as
|
|
14
|
-
import { AIStarIcon as
|
|
15
|
-
import { shouldShowConfidenceScore as
|
|
13
|
+
import { AIExtractedIndicator as He } from "../../icons/AIExtractedIndicator.es.js";
|
|
14
|
+
import { AIStarIcon as Ze } from "../../icons/AIStarIcon.es.js";
|
|
15
|
+
import { shouldShowConfidenceScore as Oe, getConfidenceScoreBadgeFill as Be, getConfidenceScoreBadgeColor as Fe, getConfidenceScoreBadgeHoverClass as Ue } from "../../../utils/confidenceScoreUtils.es.js";
|
|
16
16
|
import P from "dayjs";
|
|
17
|
-
import { ContentCopyIcon as
|
|
18
|
-
const
|
|
17
|
+
import { ContentCopyIcon as Ae, CheckFilledIcon as Ke } from "../../icon/icons.generated.es.js";
|
|
18
|
+
const Pe = Ne(
|
|
19
19
|
({
|
|
20
20
|
id: Y,
|
|
21
21
|
label: l,
|
|
@@ -42,7 +42,7 @@ const Ke = Ce(
|
|
|
42
42
|
sourceMeta: ae = [],
|
|
43
43
|
onConfidenceScoreClick: ne,
|
|
44
44
|
deltaChange: p,
|
|
45
|
-
theme:
|
|
45
|
+
theme: Ye = "light",
|
|
46
46
|
onUpload: M,
|
|
47
47
|
acceptsUpload: se = !1,
|
|
48
48
|
MasterDataModal: _,
|
|
@@ -53,14 +53,15 @@ const Ke = Ce(
|
|
|
53
53
|
decodeEntities: ce = !0,
|
|
54
54
|
onAiExtractedIndicatorClick: le,
|
|
55
55
|
copyOnHover: me = !1,
|
|
56
|
-
urlAlias: j
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
urlAlias: j,
|
|
57
|
+
allowTimezoneConversion: de = !1
|
|
58
|
+
}, pe) => {
|
|
59
|
+
const [c, fe] = w(!0), [ue, R] = w(!1), [he, H] = w(null), [Z, k] = w(!1), [x, O] = w(!1), g = ke(null);
|
|
60
|
+
Se(() => () => {
|
|
60
61
|
g.current && clearTimeout(g.current);
|
|
61
62
|
}, []);
|
|
62
|
-
const m = (r) => ce ?
|
|
63
|
-
|
|
63
|
+
const m = (r) => ce ? Te(r) : r, u = 100, B = () => {
|
|
64
|
+
fe(!c);
|
|
64
65
|
}, S = () => /* @__PURE__ */ t(
|
|
65
66
|
"button",
|
|
66
67
|
{
|
|
@@ -85,7 +86,7 @@ const Ke = Ce(
|
|
|
85
86
|
className: "inline-flex items-center gap-1 font-semibold text-neutral-900 dark:text-white hover:text-primary-600 dark:hover:text-primary-400 transition-colors",
|
|
86
87
|
children: [
|
|
87
88
|
j,
|
|
88
|
-
/* @__PURE__ */ t(
|
|
89
|
+
/* @__PURE__ */ t(Re, { sx: { fontSize: 16 }, className: "text-primary-600 dark:text-primary-400" })
|
|
89
90
|
]
|
|
90
91
|
}
|
|
91
92
|
);
|
|
@@ -97,19 +98,19 @@ const Ke = Ce(
|
|
|
97
98
|
] });
|
|
98
99
|
}, U = (r) => {
|
|
99
100
|
R(!0), H({ ...r, value: e });
|
|
100
|
-
}, he = () => {
|
|
101
|
-
R(!1), H(null);
|
|
102
101
|
}, ge = () => {
|
|
102
|
+
R(!1), H(null);
|
|
103
|
+
}, we = () => {
|
|
103
104
|
const r = e == null || typeof e == "object" ? "" : String(e);
|
|
104
105
|
r && navigator.clipboard?.writeText(r).then(() => {
|
|
105
106
|
O(!0), g.current && clearTimeout(g.current), g.current = setTimeout(() => O(!1), 1500);
|
|
106
107
|
}).catch(() => {
|
|
107
108
|
});
|
|
108
|
-
},
|
|
109
|
+
}, ye = (r) => {
|
|
109
110
|
const a = r.target.files?.[0];
|
|
110
111
|
a && M && M(a), r.target.value = "";
|
|
111
112
|
}, b = () => {
|
|
112
|
-
const r = typeof e == "string" &&
|
|
113
|
+
const r = typeof e == "string" && ze(e);
|
|
113
114
|
if (V && typeof e == "object")
|
|
114
115
|
return e;
|
|
115
116
|
if (e || o?.toLowerCase() === "boolean" && e === 0 || o?.toLowerCase() === "currency" && Number(e) >= 0) {
|
|
@@ -122,12 +123,12 @@ const Ke = Ce(
|
|
|
122
123
|
if (o?.toLowerCase() === "boolean")
|
|
123
124
|
return K(e);
|
|
124
125
|
if (o?.toLowerCase() === "currency") {
|
|
125
|
-
const a = I(e, s?.currency_code) || "-", h = s?.currency_code ?
|
|
126
|
-
return h ? /* @__PURE__ */ t(N, { title:
|
|
126
|
+
const a = I(e, s?.currency_code) || "-", h = s?.currency_code ? $e.find((Ce) => Ce.value === s.currency_code)?.label : void 0, be = h ? `${s.currency_code} — ${h}` : s?.currency_code ?? "";
|
|
127
|
+
return h ? /* @__PURE__ */ t(N, { title: be, placement: "top", children: /* @__PURE__ */ t("span", { children: a }) }) : a;
|
|
127
128
|
} else if (o?.toLowerCase() === "datetime") {
|
|
128
129
|
const a = typeof e == "string" && e.includes("Z") ? e.replace(/\.000Z$/, "Z") : e;
|
|
129
130
|
return C(a, {
|
|
130
|
-
skipTimezone: !
|
|
131
|
+
skipTimezone: !de,
|
|
131
132
|
withTime: !0
|
|
132
133
|
});
|
|
133
134
|
} else if (o?.toLowerCase() === "date" || r) {
|
|
@@ -166,7 +167,7 @@ const Ke = Ce(
|
|
|
166
167
|
default:
|
|
167
168
|
return "small";
|
|
168
169
|
}
|
|
169
|
-
},
|
|
170
|
+
}, xe = () => {
|
|
170
171
|
switch (v) {
|
|
171
172
|
case "success":
|
|
172
173
|
return "bg-success-100";
|
|
@@ -184,7 +185,7 @@ const Ke = Ce(
|
|
|
184
185
|
"div",
|
|
185
186
|
{
|
|
186
187
|
id: Y || "",
|
|
187
|
-
ref:
|
|
188
|
+
ref: pe,
|
|
188
189
|
className: d(
|
|
189
190
|
"font-medium relative",
|
|
190
191
|
q
|
|
@@ -203,9 +204,9 @@ const Ke = Ce(
|
|
|
203
204
|
children: [
|
|
204
205
|
typeof l == "string" ? m(l) : l,
|
|
205
206
|
" ",
|
|
206
|
-
/* @__PURE__ */ t(
|
|
207
|
-
ee && /* @__PURE__ */ t(
|
|
208
|
-
re && (
|
|
207
|
+
/* @__PURE__ */ t(Me, { labels: G?.map((r) => ({ ...r, color: r.color || "primary" })) }),
|
|
208
|
+
ee && /* @__PURE__ */ t(De, { sx: { fontSize: 16, color: "var(--color-primary-600)", rotate: "15deg" } }),
|
|
209
|
+
re && (Oe(te) && y ? /* @__PURE__ */ t(
|
|
209
210
|
N,
|
|
210
211
|
{
|
|
211
212
|
placement: "top",
|
|
@@ -214,20 +215,20 @@ const Ke = Ce(
|
|
|
214
215
|
children: /* @__PURE__ */ t(
|
|
215
216
|
"div",
|
|
216
217
|
{
|
|
217
|
-
className: d("cursor-pointer w-3 h-3 flex items-center justify-center rounded-full",
|
|
218
|
+
className: d("cursor-pointer w-3 h-3 flex items-center justify-center rounded-full", Ue(y)),
|
|
218
219
|
onClick: () => ne?.(ae),
|
|
219
220
|
children: /* @__PURE__ */ t(
|
|
220
|
-
|
|
221
|
+
Ze,
|
|
221
222
|
{
|
|
222
223
|
size: 12,
|
|
223
|
-
fill:
|
|
224
|
-
fillSecondary:
|
|
224
|
+
fill: Fe(y),
|
|
225
|
+
fillSecondary: Be(y)
|
|
225
226
|
}
|
|
226
227
|
)
|
|
227
228
|
}
|
|
228
229
|
)
|
|
229
230
|
}
|
|
230
|
-
) : /* @__PURE__ */ t(
|
|
231
|
+
) : /* @__PURE__ */ t(He, { onClick: () => le?.(b()) })),
|
|
231
232
|
T && /* @__PURE__ */ t(
|
|
232
233
|
N,
|
|
233
234
|
{
|
|
@@ -243,7 +244,7 @@ const Ke = Ce(
|
|
|
243
244
|
onKeyDown: (r) => {
|
|
244
245
|
(r.key === "Enter" || r.key === " ") && r.preventDefault();
|
|
245
246
|
},
|
|
246
|
-
children: /* @__PURE__ */ t(
|
|
247
|
+
children: /* @__PURE__ */ t(Le, { size: 14 })
|
|
247
248
|
}
|
|
248
249
|
)
|
|
249
250
|
}
|
|
@@ -252,12 +253,12 @@ const Ke = Ce(
|
|
|
252
253
|
"button",
|
|
253
254
|
{
|
|
254
255
|
type: "button",
|
|
255
|
-
onClick:
|
|
256
|
+
onClick: we,
|
|
256
257
|
"aria-label": x ? `Copied ${l ?? "value"}` : `Copy ${l ?? "value"}`,
|
|
257
258
|
className: "p-1 flex items-center justify-center rounded text-neutral-500 hover:!text-primary-600 hover:bg-neutral-100 dark:text-primary-400 dark:hover:!text-primary-600 dark:hover:bg-neutral-800 cursor-pointer",
|
|
258
259
|
children: /* @__PURE__ */ i("span", { className: "relative inline-flex h-4 w-4 items-center justify-center", children: [
|
|
259
260
|
/* @__PURE__ */ t(
|
|
260
|
-
|
|
261
|
+
Ae,
|
|
261
262
|
{
|
|
262
263
|
size: 16,
|
|
263
264
|
className: d(
|
|
@@ -267,7 +268,7 @@ const Ke = Ce(
|
|
|
267
268
|
}
|
|
268
269
|
),
|
|
269
270
|
/* @__PURE__ */ t(
|
|
270
|
-
|
|
271
|
+
Ke,
|
|
271
272
|
{
|
|
272
273
|
size: 16,
|
|
273
274
|
className: d(
|
|
@@ -297,9 +298,9 @@ const Ke = Ce(
|
|
|
297
298
|
$ && n && e ? /* @__PURE__ */ i("div", { className: "flex gap-2", children: [
|
|
298
299
|
/* @__PURE__ */ t("span", { className: "line-through", children: m(n) }),
|
|
299
300
|
/* @__PURE__ */ t("span", { children: b() })
|
|
300
|
-
] }) : Q || X ? /* @__PURE__ */ t("mark", { className: d("rounded-md py-0.5 px-1",
|
|
301
|
+
] }) : Q || X ? /* @__PURE__ */ t("mark", { className: d("rounded-md py-0.5 px-1", xe()), children: b() }) : b(),
|
|
301
302
|
o?.toLowerCase() === "currency" && p !== 0 && p !== void 0 && p !== null && /* @__PURE__ */ i(
|
|
302
|
-
|
|
303
|
+
_e.span,
|
|
303
304
|
{
|
|
304
305
|
initial: { opacity: 0, y: 2 },
|
|
305
306
|
animate: { opacity: 1, y: 0 },
|
|
@@ -309,7 +310,7 @@ const Ke = Ce(
|
|
|
309
310
|
p > 0 ? "text-emerald-600 dark:text-emerald-400" : "text-red-600 dark:text-red-400"
|
|
310
311
|
),
|
|
311
312
|
children: [
|
|
312
|
-
/* @__PURE__ */ t("span", { className: "flex items-center justify-center w-4 h-4", children: p > 0 ? /* @__PURE__ */ t(
|
|
313
|
+
/* @__PURE__ */ t("span", { className: "flex items-center justify-center w-4 h-4", children: p > 0 ? /* @__PURE__ */ t(Ee, { sx: { fontSize: 16 }, className: "text-emerald-600 dark:text-emerald-400" }) : /* @__PURE__ */ t(je, { sx: { fontSize: 16 }, className: "text-red-600 dark:text-red-400" }) }),
|
|
313
314
|
/* @__PURE__ */ t("span", { children: I(Math.abs(p), s?.currency_code || "USD") })
|
|
314
315
|
]
|
|
315
316
|
}
|
|
@@ -324,14 +325,14 @@ const Ke = Ce(
|
|
|
324
325
|
"aria-label": `Search master data for ${l}`,
|
|
325
326
|
type: "button",
|
|
326
327
|
className: "cursor-pointer",
|
|
327
|
-
children: /* @__PURE__ */ t(
|
|
328
|
+
children: /* @__PURE__ */ t(Ie, { width: 20, height: 20 })
|
|
328
329
|
}
|
|
329
330
|
),
|
|
330
331
|
se && /* @__PURE__ */ t(
|
|
331
332
|
"input",
|
|
332
333
|
{
|
|
333
334
|
type: "file",
|
|
334
|
-
onChange:
|
|
335
|
+
onChange: ye,
|
|
335
336
|
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer",
|
|
336
337
|
"aria-label": `Upload file for ${l}`
|
|
337
338
|
}
|
|
@@ -362,9 +363,9 @@ const Ke = Ce(
|
|
|
362
363
|
_ && /* @__PURE__ */ t(
|
|
363
364
|
_,
|
|
364
365
|
{
|
|
365
|
-
isVisible:
|
|
366
|
-
onClose:
|
|
367
|
-
masterdataInfo:
|
|
366
|
+
isVisible: ue,
|
|
367
|
+
onClose: ge,
|
|
368
|
+
masterdataInfo: he
|
|
368
369
|
}
|
|
369
370
|
),
|
|
370
371
|
Z && f && D && /* @__PURE__ */ t(
|
|
@@ -390,8 +391,8 @@ const Ke = Ce(
|
|
|
390
391
|
);
|
|
391
392
|
}
|
|
392
393
|
);
|
|
393
|
-
|
|
394
|
+
Pe.displayName = "LabelValue";
|
|
394
395
|
export {
|
|
395
|
-
|
|
396
|
+
Pe as LabelValue
|
|
396
397
|
};
|
|
397
398
|
//# sourceMappingURL=LabelValue.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelValue.es.js","sources":["../../../../src/components/data-display/label-value/LabelValue.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, forwardRef, type ReactNode } from 'react';\nimport cn from 'classnames';\nimport { HelpIcon } from '../../icons/HelpIcon';\nimport { SearchIcon } from '../../icons/SearchIcon';\nimport { Typography } from '../typography/Typography';\nimport { formatCurrency, formatDate, formatBooleanValue, isISODateString, decodeHTMLEntities } from '../../../utils/formatters';\nimport { CURRENCIES } from '../../forms/currency-input/currency.constant';\nimport { Label } from '../label/Label';\nimport { motion } from 'framer-motion';\nimport { ArrowUpwardRounded, ArrowDownwardRounded, BoltOutlined, OpenInNew } from '@mui/icons-material';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { AIExtractedIndicator } from '../../icons/AIExtractedIndicator';\nimport { AIStarIcon } from '../../icons/AIStarIcon';\nimport { CheckFilledIcon, ContentCopyIcon } from '../../icon';\nimport { getConfidenceScoreBadgeColor, getConfidenceScoreBadgeFill, getConfidenceScoreBadgeHoverClass, shouldShowConfidenceScore } from '../../../utils/confidenceScoreUtils';\nimport dayjs from 'dayjs';\n\n/**\n * Source meta bounding box\n */\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\n/**\n * Source meta item\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 * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\n/**\n * Available label value size options\n */\nexport type LabelValueSize = 'small' | 'medium' | 'large';\n\n/**\n * Available highlight color options\n */\nexport type HighlightColor = 'success' | 'warning' | 'error' | 'info';\n\n/**\n * Theme mode for styling\n */\nexport type ThemeMode = 'light' | 'dark';\n\n/**\n * Upload handler function type\n */\nexport type UploadHandler = (file: File) => void | Promise<void>;\n\n/**\n * Master data item interface\n */\nexport interface MasterDataItem {\n is_master_data?: boolean;\n reference?: string;\n group_technical_name?: string;\n currency_code?: string;\n}\n\n/**\n * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\n/**\n * Master data modal component props\n */\nexport interface MasterDataModalProps {\n isVisible: boolean;\n onClose: () => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n masterdataInfo: any;\n}\n\n/**\n * Risk details card component props\n * Using generic to allow custom risk detail types from consumers\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface RiskDetailsCardProps<TRisk = any> {\n riskDetails: TRisk;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the LabelValue component\n */\nexport interface LabelValueProps {\n /** The id of the label value */\n id?: string;\n /** The label text to display */\n label?: string;\n /** The value to display */\n value?: string | number | boolean | ReactNode;\n /** Additional CSS classes */\n className?: string;\n /** Data type for formatting */\n type?: 'string' | 'number' | 'boolean' | 'currency' | 'date' | 'datetime' | 'percentage' | 'url';\n /** Tags to display with the label */\n tags?: Array<{ label: string; color?: string; value?: string }>;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Master data item information */\n items?: MasterDataItem;\n /** Whether the value has been modified */\n isModified?: boolean;\n /** Whether the value has been changed */\n isChanged?: boolean;\n /** Size variant */\n size?: LabelValueSize;\n /** Whether the value is highlighted */\n isHighlighted?: boolean;\n /** Deleted value for diff display */\n deletedValue?: string;\n /** Highlight color for changes */\n highlightColor?: HighlightColor;\n /** Whether search is active */\n isSearchActive?: boolean;\n /** Whether to show original boolean value */\n originalValue?: boolean;\n /** Whether to show diff between old and new values */\n showDiff?: boolean;\n /** Whether this is a live field (shows bolt icon) */\n isLiveField?: boolean;\n /** Whether this is an AI extracted field (shows AI extracted icon) */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Delta change value for currency fields */\n deltaChange?: number;\n /** Theme mode */\n theme?: ThemeMode;\n /** Upload handler function */\n onUpload?: UploadHandler;\n /** Whether the component accepts file uploads */\n acceptsUpload?: boolean;\n /** Master data modal component */\n MasterDataModal?: React.ComponentType<MasterDataModalProps>;\n /** Risk analysis data - accepts any risk object extending RiskDetails */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n riskDetails?: RiskDetails | any;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component - accepts components with custom risk types */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Custom aria-label for accessibility */\n 'aria-label'?: string;\n /** Whether to decode HTML character entities in string values (default: true) */\n decodeEntities?: boolean;\n /** Function to handle AI extracted indicator click */\n onAiExtractedIndicatorClick?: (value: string) => void;\n /** Whether to show a copy-to-clipboard icon in the top-right corner on hover */\n copyOnHover?: boolean;\n /** Display alias text for URL type — shown instead of the raw URL, with an external link icon */\n urlAlias?: string;\n}\n\n/**\n * LabelValue component displays a label-value pair with various formatting options\n *\n * @example\n * ```tsx\n * <LabelValue \n * label=\"Status\" \n * value=\"Active\" \n * type=\"string\" \n * size=\"medium\" \n * />\n * <LabelValue \n * label=\"Price\" \n * value={99.99} \n * type=\"currency\" \n * items={{ currency_code: 'USD' }}\n * />\n * <LabelValue \n * label=\"Upload File\" \n * acceptsUpload \n * onUpload={handleUpload}\n * />\n * ```\n */\nexport const LabelValue = forwardRef<HTMLDivElement, LabelValueProps>(\n (\n {\n id,\n label,\n value,\n className,\n type = 'string',\n tags,\n tooltip,\n items,\n isModified = false,\n isChanged = false,\n size = 'medium',\n isHighlighted = false,\n deletedValue,\n highlightColor = 'warning',\n isSearchActive = false,\n originalValue = false,\n showDiff = false,\n isLiveField = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n deltaChange,\n theme: _theme = 'light',\n onUpload,\n acceptsUpload = false,\n MasterDataModal,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n 'aria-label': ariaLabel,\n decodeEntities = true,\n onAiExtractedIndicatorClick,\n copyOnHover = false,\n urlAlias,\n },\n ref\n ) => {\n const [collapseValue, setCollapseValue] = useState(true);\n const [isOpenMasterDataModal, setIsOpenMasterDataModal] = useState(false);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [masterdataModalInfo, setMasterdataModalInfo] = useState<any>(null);\n const [isHovered, setIsHovered] = useState(false);\n const [isCopied, setIsCopied] = useState(false);\n const copyResetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n return () => {\n if (copyResetTimer.current) clearTimeout(copyResetTimer.current);\n };\n }, []);\n\n // Theme is passed as prop but not used in current implementation\n\n /**\n * Conditionally decode HTML entities based on the decodeEntities prop\n */\n const decode = (text: string): string => decodeEntities ? decodeHTMLEntities(text) : text;\n\n const COLLAPSE_CHAR_LIMIT = 100;\n\n /**\n * Handle collapse toggle for long text\n */\n const handleCollapse = () => {\n setCollapseValue(!collapseValue);\n };\n\n /**\n * Show more / Show less toggle for long text and URLs\n */\n const renderCollapseToggle = () => (\n <button\n id={`btn-label-value-${collapseValue ? 'Show more' : 'Show less'}`}\n className=\"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap\"\n onClick={handleCollapse}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleCollapse();\n }\n }}\n aria-label={collapseValue ? 'Show more content' : 'Show less content'}\n type=\"button\"\n >\n {collapseValue ? 'Show more' : 'Show less'}\n </button>\n );\n\n /**\n * Render a URL with optional collapse for long href/display text\n */\n const renderUrlValue = (href: string) => {\n if (urlAlias) {\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 font-semibold text-neutral-900 dark:text-white hover:text-primary-600 dark:hover:text-primary-400 transition-colors\"\n >\n {urlAlias}\n <OpenInNew sx={{ fontSize: 16 }} className=\"text-primary-600 dark:text-primary-400\" />\n </a>\n );\n }\n const decoded = decode(href);\n if (decoded.length <= COLLAPSE_CHAR_LIMIT) {\n return (\n <a href={href} className=\"text-primary-600 truncate\">\n {decoded}\n </a>\n );\n }\n return (\n <p>\n <a href={href} className=\"text-primary-600 break-all\">\n {decoded.slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decoded.length)}\n </a>\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n );\n };\n\n /**\n * Handle master data click\n */\n const handleMasterDataClick = (item: MasterDataItem) => {\n setIsOpenMasterDataModal(true);\n setMasterdataModalInfo({ ...item, value });\n };\n\n /**\n * Handle master data modal close\n */\n const handleMasterDataClose = () => {\n setIsOpenMasterDataModal(false);\n setMasterdataModalInfo(null);\n };\n\n /**\n * Copy the current value to the clipboard\n */\n const handleCopyValue = () => {\n const textToCopy =\n value === null || value === undefined || typeof value === 'object'\n ? ''\n : String(value);\n if (!textToCopy) return;\n navigator.clipboard?.writeText(textToCopy)\n .then(() => {\n setIsCopied(true);\n if (copyResetTimer.current) clearTimeout(copyResetTimer.current);\n copyResetTimer.current = setTimeout(() => setIsCopied(false), 1500);\n })\n .catch(() => { });\n };\n\n /**\n * Handle file upload\n */\n const handleFileUpload = (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file && onUpload) {\n onUpload(file);\n }\n // Reset input value to allow same file selection\n event.target.value = '';\n };\n\n /**\n * Format and display the value based on type\n */\n const displayValue = () => {\n const isISODate = typeof value === 'string' && isISODateString(value);\n\n if (isSearchActive && typeof value === 'object') {\n return value;\n }\n\n if (value || (type?.toLowerCase() === 'boolean' && value === 0) || (type?.toLowerCase() === 'currency' && Number(value) >= 0)) {\n if ((value === true || value === 'True') && !originalValue && (type?.toLowerCase() !== 'choice')) {\n return 'Yes';\n } else if ((value === false || value === 'False') && !originalValue && (type?.toLowerCase() !== 'choice')) {\n return 'No';\n } else if (type?.toLowerCase() === 'url') {\n return renderUrlValue(value as string);\n } else if (type?.toLowerCase() === 'boolean') {\n return formatBooleanValue(value);\n } else if (type?.toLowerCase() === 'currency') {\n const formatted = formatCurrency(value, items?.currency_code) || '-';\n const currencyName = items?.currency_code\n ? CURRENCIES.find(c => c.value === items.currency_code)?.label\n : undefined;\n const tooltipTitle = currencyName\n ? `${items!.currency_code} — ${currencyName}`\n : items?.currency_code ?? '';\n return currencyName ? (\n <Tooltip title={tooltipTitle} placement=\"top\">\n <span>{formatted}</span>\n </Tooltip>\n ) : formatted;\n } else if (type?.toLowerCase() === 'datetime') {\n const dateValue = typeof value === 'string' && value.includes('Z') ? value.replace(/\\.000Z$/, 'Z') : value;\n return formatDate(dateValue as string, {\n skipTimezone: false,\n withTime: true,\n });\n } else if (type?.toLowerCase() === 'date' || isISODate) {\n let dateValue = value;\n\n if (typeof value === 'string' && value.includes('Z')) {\n dateValue = value.replace(/\\.000Z$/, 'Z')\n } else if (typeof value === 'string' && !value.includes('Z')) {\n const parsed = dayjs(value);\n dateValue = dayjs(parsed).isValid() ? parsed.toString() : value;\n }\n\n return formatDate(dateValue as string, {\n skipTimezone: true,\n withTime: false,\n });\n } else if (type?.toLowerCase() === 'percentage') {\n return `${value}%`;\n } else if (typeof value === 'string' && value.length > COLLAPSE_CHAR_LIMIT) {\n const decoded = decode(value);\n return (\n <p>\n {decoded.slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decoded.length)}\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n );\n } else {\n return typeof value === 'string' ? decode(value) : value;\n }\n }\n return '-';\n };\n\n /**\n * Get Typography size based on LabelValue size\n */\n const getTypographySize = () => {\n switch (size) {\n case 'small':\n return 'extra-small' as const;\n case 'large':\n return 'large' as const;\n default: // medium\n return 'small' as const;\n }\n };\n\n /**\n * Get highlight color classes\n */\n const getHighlightClasses = (): string => {\n switch (highlightColor) {\n case 'success':\n return 'bg-success-100';\n case 'warning':\n return 'bg-warning-100';\n case 'error':\n return 'bg-error-100';\n case 'info':\n return 'bg-info-100';\n default:\n return 'bg-warning-100';\n }\n };\n\n return (\n <div\n id={id || ''}\n ref={ref}\n className={cn(\n 'font-medium relative',\n className\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n aria-label={ariaLabel || `Label: ${label}, Value: ${value}`}\n >\n {/* Label section */}\n <Typography\n variant=\"medium\"\n size={getTypographySize()}\n className=\"flex gap-1 items-center flex-wrap\"\n appearance=\"subtitle\"\n >\n\n {/* Live field indicator */}\n {typeof label === 'string' ? decode(label) : label} {<Label labels={tags?.map(tag => ({ ...tag, color: tag.color || 'primary' }))} />}\n\n {isLiveField && <BoltOutlined sx={{ fontSize: 16, color: 'var(--color-primary-600)', rotate: '15deg' }} />}\n {isAiExtracted &&\n (shouldShowConfidenceScore(confidenceScore) && confidenceType ? (\n <Tooltip\n placement=\"top\"\n title={confidenceTooltip || \"\"}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\"cursor-pointer w-3 h-3 flex items-center justify-center rounded-full\", getConfidenceScoreBadgeHoverClass(confidenceType))}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n </div>\n </Tooltip>\n ) : (\n <AIExtractedIndicator onClick={() => onAiExtractedIndicatorClick?.(displayValue() as string)} />\n ))}\n\n {/* Tooltip */}\n {tooltip && (\n <Tooltip\n placement=\"top\"\n title={tooltip}\n whiteSpace=\"pre-wrap\"\n >\n <div\n className=\"cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n // Tooltip will show on focus\n }\n }}\n >\n <HelpIcon size={14} />\n </div>\n </Tooltip>\n )}\n {copyOnHover && isHovered && (\n <Tooltip title={isCopied ? 'Copied' : `Copy ${label ?? 'value'}`} placement=\"top\" whiteSpace=\"pre-wrap\">\n <button\n type=\"button\"\n onClick={handleCopyValue}\n aria-label={isCopied ? `Copied ${label ?? 'value'}` : `Copy ${label ?? 'value'}`}\n className=\"p-1 flex items-center justify-center rounded text-neutral-500 hover:!text-primary-600 hover:bg-neutral-100 dark:text-primary-400 dark:hover:!text-primary-600 dark:hover:bg-neutral-800 cursor-pointer\"\n >\n <span className=\"relative inline-flex h-4 w-4 items-center justify-center\">\n <ContentCopyIcon\n size={16}\n className={cn(\n 'absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out',\n isCopied ? 'opacity-0 scale-50 rotate-[-90deg]' : 'opacity-100 scale-100 rotate-0'\n )}\n />\n <CheckFilledIcon\n size={16}\n className={cn(\n 'absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out',\n isCopied ? 'opacity-100 scale-100 rotate-0' : 'opacity-0 scale-50 rotate-90'\n )}\n />\n </span>\n </button>\n </Tooltip>\n )}\n </Typography>\n\n {/* Value section */}\n <Typography\n variant=\"medium\"\n size={getTypographySize()}\n className={cn(\n 'text-- whitespace-normal break-all flex gap-1 pt-0.5',\n isModified && 'bg-neutral-50 dark:bg-black-700 p-1 rounded',\n isRiskAnalysisOpen && riskDetails?.color &&\n `bg-${riskDetails.color}-50 border-${riskDetails.color}-300 px-0.5 rounded-lg`\n )}\n appearance=\"body\"\n >\n {/* Value display */}\n {showDiff && deletedValue && value ? (\n <div className=\"flex gap-2\">\n <span className=\"line-through\">{decode(deletedValue)}</span>\n <span>{displayValue()}</span>\n </div>\n ) : isChanged || isHighlighted ? (\n <mark className={cn('rounded-md py-0.5 px-1', getHighlightClasses())}>\n {displayValue()}\n </mark>\n ) : (\n displayValue()\n )}\n\n {/* Delta change indicator for currency fields */}\n {type?.toLowerCase() === 'currency' && deltaChange !== 0 && deltaChange !== undefined && deltaChange !== null && (\n <motion.span\n initial={{ opacity: 0, y: 2 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.25 }}\n className={cn(\n 'inline-flex items-center gap-1 ml-1.5 text-xs font-medium',\n deltaChange > 0 ? 'text-emerald-600 dark:text-emerald-400' : 'text-red-600 dark:text-red-400'\n )}\n >\n <span className=\"flex items-center justify-center w-4 h-4\">\n {deltaChange > 0 ? (\n <ArrowUpwardRounded sx={{ fontSize: 16 }} className=\"text-emerald-600 dark:text-emerald-400\" />\n ) : (\n <ArrowDownwardRounded sx={{ fontSize: 16 }} className=\"text-red-600 dark:text-red-400\" />\n )}\n </span>\n <span>{formatCurrency(Math.abs(deltaChange), items?.currency_code || 'USD')}</span>\n </motion.span>\n )}\n\n {/* Master data search icon */}\n {items?.is_master_data && items?.reference && value && (\n <button\n onClick={() => handleMasterDataClick(items)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleMasterDataClick(items);\n }\n }}\n aria-label={`Search master data for ${label}`}\n type=\"button\"\n className=\"cursor-pointer\"\n >\n <SearchIcon width={20} height={20} />\n </button>\n )}\n\n {/* File upload input */}\n {acceptsUpload && (\n <input\n type=\"file\"\n onChange={handleFileUpload}\n className=\"absolute inset-0 w-full h-full opacity-0 cursor-pointer\"\n aria-label={`Upload file for ${label}`}\n />\n )}\n </Typography>\n\n {/* Deleted value display */}\n {deletedValue && !showDiff && (\n <Typography\n variant=\"medium\"\n size=\"extra-small\"\n className=\"pt-0.5\"\n appearance=\"body\"\n >\n <mark className=\"rounded-md py-0.5 px-1 bg-error-100\">\n <del>\n {deletedValue || (type?.toLowerCase() === 'boolean' && deletedValue === '0') ? (\n deletedValue === 'True' && (type?.toLowerCase() !== 'choice') ? (\n 'Yes'\n ) : deletedValue === 'False' && (type?.toLowerCase() !== 'choice') ? (\n 'No'\n ) : type?.toLowerCase() === 'boolean' ? (\n formatBooleanValue(deletedValue)\n ) : type?.toLowerCase() === 'currency' ? (\n formatCurrency(deletedValue, items?.currency_code)\n ) : type?.toLowerCase() === 'date' ? (\n formatDate(deletedValue, {\n skipTimezone: true,\n withTime: false,\n })\n ) : type?.toLowerCase() === 'datetime' ? (\n formatDate(deletedValue, {\n skipTimezone: true,\n withTime: true,\n })\n ) : type?.toLowerCase() === 'percentage' ? (\n `${deletedValue}%`\n ) : type?.toLowerCase() === 'url' ? (\n renderUrlValue(deletedValue)\n ) : deletedValue.length > COLLAPSE_CHAR_LIMIT ? (\n <p>\n {decode(deletedValue).slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decode(deletedValue).length)}\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n ) : (\n decode(deletedValue)\n )\n ) : (\n '-'\n )}\n </del>\n </mark>\n </Typography>\n )}\n\n {/* Master data modal */}\n {MasterDataModal && (\n <MasterDataModal\n isVisible={isOpenMasterDataModal}\n onClose={handleMasterDataClose}\n masterdataInfo={masterdataModalInfo}\n />\n )}\n\n {/* Risk details tooltip */}\n {isHovered && riskDetails && isRiskAnalysisOpen && (\n <div\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 role=\"tooltip\"\n aria-label=\"Risk analysis details\"\n tabIndex={0}\n >\n {RiskDetailsCard ? (\n <RiskDetailsCard riskDetails={riskDetails} />\n ) : (\n <div className=\"shadow-lg p-4\">\n <div className=\"text-sm\">\n <h4 className=\"font-semibold mb-2\">Risk Details</h4>\n <p className=\"text-neutral-600 dark:text-neutral-300\">\n {riskDetails.description || 'Risk analysis information'}\n </p>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nLabelValue.displayName = 'LabelValue';\n"],"names":["LabelValue","forwardRef","id","label","value","className","type","tags","tooltip","items","isModified","isChanged","size","isHighlighted","deletedValue","highlightColor","isSearchActive","originalValue","showDiff","isLiveField","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","deltaChange","_theme","onUpload","acceptsUpload","MasterDataModal","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","ariaLabel","decodeEntities","onAiExtractedIndicatorClick","copyOnHover","urlAlias","ref","collapseValue","setCollapseValue","useState","isOpenMasterDataModal","setIsOpenMasterDataModal","masterdataModalInfo","setMasterdataModalInfo","isHovered","setIsHovered","isCopied","setIsCopied","copyResetTimer","useRef","useEffect","decode","text","decodeHTMLEntities","COLLAPSE_CHAR_LIMIT","handleCollapse","renderCollapseToggle","jsx","e","renderUrlValue","href","jsxs","OpenInNew","decoded","handleMasterDataClick","item","handleMasterDataClose","handleCopyValue","textToCopy","handleFileUpload","event","file","displayValue","isISODate","isISODateString","formatBooleanValue","formatted","formatCurrency","currencyName","CURRENCIES","c","tooltipTitle","Tooltip","dateValue","formatDate","parsed","dayjs","getTypographySize","getHighlightClasses","cn","Typography","Label","tag","BoltOutlined","shouldShowConfidenceScore","getConfidenceScoreBadgeHoverClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","AIExtractedIndicator","HelpIcon","ContentCopyIcon","CheckFilledIcon","motion","ArrowUpwardRounded","ArrowDownwardRounded","SearchIcon"],"mappings":";;;;;;;;;;;;;;;;;AAsNO,MAAMA,KAAaC;AAAA,EACxB,CACE;AAAA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0B,IAAgB,SAAS;AAAA,gBACzBmB,EAAA;AAAA,cAAqB,EAAA,CACxB,IAEAL,EAAOxC,CAAY,IAGrB,KAEJ,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,UAKHgB,KACC,gBAAA8B;AAAA,YAAC9B;AAAA,YAAA;AAAA,cACC,WAAWa;AAAA,cACX,SAAS0B;AAAA,cACT,gBAAgBxB;AAAA,YAAA;AAAA,UAAA;AAAA,UAKnBE,KAAahB,KAAeC,KAC3B,gBAAA4B;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,SAAS,CAACC,MAAMA,EAAE,gBAAA;AAAA,cAClB,aAAa,CAACA,MAAMA,EAAE,eAAA;AAAA,cACtB,WAAW,CAACA,MAAM;AAChB,gBAAIA,EAAE,QAAQ,YACZb,EAAa,EAAK;AAAA,cAEtB;AAAA,cACA,MAAK;AAAA,cACL,cAAW;AAAA,cACX,UAAU;AAAA,cAET,UAAAf,IACC,gBAAA2B,EAAC3B,GAAA,EAAgB,aAAAF,EAAA,CAA0B,IAE3C,gBAAA6B,EAAC,OAAA,EAAI,WAAU,iBACb,UAAA,gBAAAI,EAAC,OAAA,EAAI,WAAU,WACb,UAAA;AAAA,gBAAA,gBAAAJ,EAAC,MAAA,EAAG,WAAU,sBAAqB,UAAA,gBAAY;AAAA,kCAC9C,KAAA,EAAE,WAAU,0CACV,UAAA7B,EAAY,eAAe,4BAAA,CAC9B;AAAA,cAAA,EAAA,CACF,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA/B,GAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"LabelValue.es.js","sources":["../../../../src/components/data-display/label-value/LabelValue.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, forwardRef, type ReactNode } from 'react';\nimport cn from 'classnames';\nimport { HelpIcon } from '../../icons/HelpIcon';\nimport { SearchIcon } from '../../icons/SearchIcon';\nimport { Typography } from '../typography/Typography';\nimport { formatCurrency, formatDate, formatBooleanValue, isISODateString, decodeHTMLEntities } from '../../../utils/formatters';\nimport { CURRENCIES } from '../../forms/currency-input/currency.constant';\nimport { Label } from '../label/Label';\nimport { motion } from 'framer-motion';\nimport { ArrowUpwardRounded, ArrowDownwardRounded, BoltOutlined, OpenInNew } from '@mui/icons-material';\nimport Tooltip from '../../tooltip/Tooltip';\nimport { AIExtractedIndicator } from '../../icons/AIExtractedIndicator';\nimport { AIStarIcon } from '../../icons/AIStarIcon';\nimport { CheckFilledIcon, ContentCopyIcon } from '../../icon';\nimport { getConfidenceScoreBadgeColor, getConfidenceScoreBadgeFill, getConfidenceScoreBadgeHoverClass, shouldShowConfidenceScore } from '../../../utils/confidenceScoreUtils';\nimport dayjs from 'dayjs';\n\n/**\n * Source meta bounding box\n */\nexport type SourceMetaBBox = {\n b: number;\n l: number;\n r: number;\n t: number;\n};\n\n/**\n * Source meta item\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 * Confidence score type\n */\nexport type ConfidenceScoreType = \"low\" | \"medium\" | \"high\";\n\n/**\n * Available label value size options\n */\nexport type LabelValueSize = 'small' | 'medium' | 'large';\n\n/**\n * Available highlight color options\n */\nexport type HighlightColor = 'success' | 'warning' | 'error' | 'info';\n\n/**\n * Theme mode for styling\n */\nexport type ThemeMode = 'light' | 'dark';\n\n/**\n * Upload handler function type\n */\nexport type UploadHandler = (file: File) => void | Promise<void>;\n\n/**\n * Master data item interface\n */\nexport interface MasterDataItem {\n is_master_data?: boolean;\n reference?: string;\n group_technical_name?: string;\n currency_code?: string;\n}\n\n/**\n * Risk details interface\n */\nexport interface RiskDetails {\n color?: string;\n description?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\n/**\n * Master data modal component props\n */\nexport interface MasterDataModalProps {\n isVisible: boolean;\n onClose: () => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n masterdataInfo: any;\n}\n\n/**\n * Risk details card component props\n * Using generic to allow custom risk detail types from consumers\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface RiskDetailsCardProps<TRisk = any> {\n riskDetails: TRisk;\n maxWidth?: string;\n showAllRisksSuggestions?: boolean;\n}\n\n/**\n * Props for the LabelValue component\n */\nexport interface LabelValueProps {\n /** The id of the label value */\n id?: string;\n /** The label text to display */\n label?: string;\n /** The value to display */\n value?: string | number | boolean | ReactNode;\n /** Additional CSS classes */\n className?: string;\n /** Data type for formatting */\n type?: 'string' | 'number' | 'boolean' | 'currency' | 'date' | 'datetime' | 'percentage' | 'url';\n /** Tags to display with the label */\n tags?: Array<{ label: string; color?: string; value?: string }>;\n /** Tooltip text for the help icon */\n tooltip?: string;\n /** Master data item information */\n items?: MasterDataItem;\n /** Whether the value has been modified */\n isModified?: boolean;\n /** Whether the value has been changed */\n isChanged?: boolean;\n /** Size variant */\n size?: LabelValueSize;\n /** Whether the value is highlighted */\n isHighlighted?: boolean;\n /** Deleted value for diff display */\n deletedValue?: string;\n /** Highlight color for changes */\n highlightColor?: HighlightColor;\n /** Whether search is active */\n isSearchActive?: boolean;\n /** Whether to show original boolean value */\n originalValue?: boolean;\n /** Whether to show diff between old and new values */\n showDiff?: boolean;\n /** Whether this is a live field (shows bolt icon) */\n isLiveField?: boolean;\n /** Whether this is an AI extracted field (shows AI extracted icon) */\n isAiExtracted?: boolean;\n /** Confidence percentage shown as a badge */\n confidenceScore?: number;\n /** Confidence classification for badge styling */\n confidenceType?: ConfidenceScoreType;\n /** Optional tooltip content for confidence badge */\n confidenceTooltip?: ReactNode;\n /** Source meta for confidence score */\n sourceMeta?: SourceMetaItem[];\n /** Handler fired when confidence score badge is clicked */\n onConfidenceScoreClick?: (sourceMeta: SourceMetaItem[]) => void;\n /** Delta change value for currency fields */\n deltaChange?: number;\n /** Theme mode */\n theme?: ThemeMode;\n /** Upload handler function */\n onUpload?: UploadHandler;\n /** Whether the component accepts file uploads */\n acceptsUpload?: boolean;\n /** Master data modal component */\n MasterDataModal?: React.ComponentType<MasterDataModalProps>;\n /** Risk analysis data - accepts any risk object extending RiskDetails */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n riskDetails?: RiskDetails | any;\n /** Whether risk analysis is open */\n isRiskAnalysisOpen?: boolean;\n /** Custom risk details card component - accepts components with custom risk types */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RiskDetailsCard?: React.ComponentType<RiskDetailsCardProps<any>>;\n /** Custom aria-label for accessibility */\n 'aria-label'?: string;\n /** Whether to decode HTML character entities in string values (default: true) */\n decodeEntities?: boolean;\n /** Function to handle AI extracted indicator click */\n onAiExtractedIndicatorClick?: (value: string) => void;\n /** Whether to show a copy-to-clipboard icon in the top-right corner on hover */\n copyOnHover?: boolean;\n /** Display alias text for URL type — shown instead of the raw URL, with an external link icon */\n urlAlias?: string;\n /**\n * Whether a `datetime` value is an instant that should be converted to the viewer's timezone.\n * Field values are wall clock — what the user typed — so this is off by default; turn it on for\n * system timestamps (created_at, executed_on...).\n */\n allowTimezoneConversion?: boolean;\n}\n\n/**\n * LabelValue component displays a label-value pair with various formatting options\n *\n * @example\n * ```tsx\n * <LabelValue \n * label=\"Status\" \n * value=\"Active\" \n * type=\"string\" \n * size=\"medium\" \n * />\n * <LabelValue \n * label=\"Price\" \n * value={99.99} \n * type=\"currency\" \n * items={{ currency_code: 'USD' }}\n * />\n * <LabelValue \n * label=\"Upload File\" \n * acceptsUpload \n * onUpload={handleUpload}\n * />\n * ```\n */\nexport const LabelValue = forwardRef<HTMLDivElement, LabelValueProps>(\n (\n {\n id,\n label,\n value,\n className,\n type = 'string',\n tags,\n tooltip,\n items,\n isModified = false,\n isChanged = false,\n size = 'medium',\n isHighlighted = false,\n deletedValue,\n highlightColor = 'warning',\n isSearchActive = false,\n originalValue = false,\n showDiff = false,\n isLiveField = false,\n isAiExtracted = false,\n confidenceScore,\n confidenceType = \"high\",\n confidenceTooltip,\n sourceMeta = [],\n onConfidenceScoreClick,\n deltaChange,\n theme: _theme = 'light',\n onUpload,\n acceptsUpload = false,\n MasterDataModal,\n riskDetails,\n isRiskAnalysisOpen = false,\n RiskDetailsCard,\n 'aria-label': ariaLabel,\n decodeEntities = true,\n onAiExtractedIndicatorClick,\n copyOnHover = false,\n urlAlias,\n allowTimezoneConversion = false,\n },\n ref\n ) => {\n const [collapseValue, setCollapseValue] = useState(true);\n const [isOpenMasterDataModal, setIsOpenMasterDataModal] = useState(false);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const [masterdataModalInfo, setMasterdataModalInfo] = useState<any>(null);\n const [isHovered, setIsHovered] = useState(false);\n const [isCopied, setIsCopied] = useState(false);\n const copyResetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n return () => {\n if (copyResetTimer.current) clearTimeout(copyResetTimer.current);\n };\n }, []);\n\n // Theme is passed as prop but not used in current implementation\n\n /**\n * Conditionally decode HTML entities based on the decodeEntities prop\n */\n const decode = (text: string): string => decodeEntities ? decodeHTMLEntities(text) : text;\n\n const COLLAPSE_CHAR_LIMIT = 100;\n\n /**\n * Handle collapse toggle for long text\n */\n const handleCollapse = () => {\n setCollapseValue(!collapseValue);\n };\n\n /**\n * Show more / Show less toggle for long text and URLs\n */\n const renderCollapseToggle = () => (\n <button\n id={`btn-label-value-${collapseValue ? 'Show more' : 'Show less'}`}\n className=\"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap\"\n onClick={handleCollapse}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleCollapse();\n }\n }}\n aria-label={collapseValue ? 'Show more content' : 'Show less content'}\n type=\"button\"\n >\n {collapseValue ? 'Show more' : 'Show less'}\n </button>\n );\n\n /**\n * Render a URL with optional collapse for long href/display text\n */\n const renderUrlValue = (href: string) => {\n if (urlAlias) {\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 font-semibold text-neutral-900 dark:text-white hover:text-primary-600 dark:hover:text-primary-400 transition-colors\"\n >\n {urlAlias}\n <OpenInNew sx={{ fontSize: 16 }} className=\"text-primary-600 dark:text-primary-400\" />\n </a>\n );\n }\n const decoded = decode(href);\n if (decoded.length <= COLLAPSE_CHAR_LIMIT) {\n return (\n <a href={href} className=\"text-primary-600 truncate\">\n {decoded}\n </a>\n );\n }\n return (\n <p>\n <a href={href} className=\"text-primary-600 break-all\">\n {decoded.slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decoded.length)}\n </a>\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n );\n };\n\n /**\n * Handle master data click\n */\n const handleMasterDataClick = (item: MasterDataItem) => {\n setIsOpenMasterDataModal(true);\n setMasterdataModalInfo({ ...item, value });\n };\n\n /**\n * Handle master data modal close\n */\n const handleMasterDataClose = () => {\n setIsOpenMasterDataModal(false);\n setMasterdataModalInfo(null);\n };\n\n /**\n * Copy the current value to the clipboard\n */\n const handleCopyValue = () => {\n const textToCopy =\n value === null || value === undefined || typeof value === 'object'\n ? ''\n : String(value);\n if (!textToCopy) return;\n navigator.clipboard?.writeText(textToCopy)\n .then(() => {\n setIsCopied(true);\n if (copyResetTimer.current) clearTimeout(copyResetTimer.current);\n copyResetTimer.current = setTimeout(() => setIsCopied(false), 1500);\n })\n .catch(() => { });\n };\n\n /**\n * Handle file upload\n */\n const handleFileUpload = (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file && onUpload) {\n onUpload(file);\n }\n // Reset input value to allow same file selection\n event.target.value = '';\n };\n\n /**\n * Format and display the value based on type\n */\n const displayValue = () => {\n const isISODate = typeof value === 'string' && isISODateString(value);\n\n if (isSearchActive && typeof value === 'object') {\n return value;\n }\n\n if (value || (type?.toLowerCase() === 'boolean' && value === 0) || (type?.toLowerCase() === 'currency' && Number(value) >= 0)) {\n if ((value === true || value === 'True') && !originalValue && (type?.toLowerCase() !== 'choice')) {\n return 'Yes';\n } else if ((value === false || value === 'False') && !originalValue && (type?.toLowerCase() !== 'choice')) {\n return 'No';\n } else if (type?.toLowerCase() === 'url') {\n return renderUrlValue(value as string);\n } else if (type?.toLowerCase() === 'boolean') {\n return formatBooleanValue(value);\n } else if (type?.toLowerCase() === 'currency') {\n const formatted = formatCurrency(value, items?.currency_code) || '-';\n const currencyName = items?.currency_code\n ? CURRENCIES.find(c => c.value === items.currency_code)?.label\n : undefined;\n const tooltipTitle = currencyName\n ? `${items!.currency_code} — ${currencyName}`\n : items?.currency_code ?? '';\n return currencyName ? (\n <Tooltip title={tooltipTitle} placement=\"top\">\n <span>{formatted}</span>\n </Tooltip>\n ) : formatted;\n } else if (type?.toLowerCase() === 'datetime') {\n const dateValue = typeof value === 'string' && value.includes('Z') ? value.replace(/\\.000Z$/, 'Z') : value;\n return formatDate(dateValue as string, {\n skipTimezone: !allowTimezoneConversion,\n withTime: true,\n });\n } else if (type?.toLowerCase() === 'date' || isISODate) {\n let dateValue = value;\n\n if (typeof value === 'string' && value.includes('Z')) {\n dateValue = value.replace(/\\.000Z$/, 'Z')\n } else if (typeof value === 'string' && !value.includes('Z')) {\n const parsed = dayjs(value);\n dateValue = dayjs(parsed).isValid() ? parsed.toString() : value;\n }\n\n return formatDate(dateValue as string, {\n skipTimezone: true,\n withTime: false,\n });\n } else if (type?.toLowerCase() === 'percentage') {\n return `${value}%`;\n } else if (typeof value === 'string' && value.length > COLLAPSE_CHAR_LIMIT) {\n const decoded = decode(value);\n return (\n <p>\n {decoded.slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decoded.length)}\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n );\n } else {\n return typeof value === 'string' ? decode(value) : value;\n }\n }\n return '-';\n };\n\n /**\n * Get Typography size based on LabelValue size\n */\n const getTypographySize = () => {\n switch (size) {\n case 'small':\n return 'extra-small' as const;\n case 'large':\n return 'large' as const;\n default: // medium\n return 'small' as const;\n }\n };\n\n /**\n * Get highlight color classes\n */\n const getHighlightClasses = (): string => {\n switch (highlightColor) {\n case 'success':\n return 'bg-success-100';\n case 'warning':\n return 'bg-warning-100';\n case 'error':\n return 'bg-error-100';\n case 'info':\n return 'bg-info-100';\n default:\n return 'bg-warning-100';\n }\n };\n\n return (\n <div\n id={id || ''}\n ref={ref}\n className={cn(\n 'font-medium relative',\n className\n )}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n aria-label={ariaLabel || `Label: ${label}, Value: ${value}`}\n >\n {/* Label section */}\n <Typography\n variant=\"medium\"\n size={getTypographySize()}\n className=\"flex gap-1 items-center flex-wrap\"\n appearance=\"subtitle\"\n >\n\n {/* Live field indicator */}\n {typeof label === 'string' ? decode(label) : label} {<Label labels={tags?.map(tag => ({ ...tag, color: tag.color || 'primary' }))} />}\n\n {isLiveField && <BoltOutlined sx={{ fontSize: 16, color: 'var(--color-primary-600)', rotate: '15deg' }} />}\n {isAiExtracted &&\n (shouldShowConfidenceScore(confidenceScore) && confidenceType ? (\n <Tooltip\n placement=\"top\"\n title={confidenceTooltip || \"\"}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\"cursor-pointer w-3 h-3 flex items-center justify-center rounded-full\", getConfidenceScoreBadgeHoverClass(confidenceType))}\n onClick={() => onConfidenceScoreClick?.(sourceMeta)}\n >\n <AIStarIcon\n size={12}\n fill={getConfidenceScoreBadgeColor(confidenceType)}\n fillSecondary={getConfidenceScoreBadgeFill(confidenceType)}\n />\n </div>\n </Tooltip>\n ) : (\n <AIExtractedIndicator onClick={() => onAiExtractedIndicatorClick?.(displayValue() as string)} />\n ))}\n\n {/* Tooltip */}\n {tooltip && (\n <Tooltip\n placement=\"top\"\n title={tooltip}\n whiteSpace=\"pre-wrap\"\n >\n <div\n className=\"cursor-pointer\"\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n // Tooltip will show on focus\n }\n }}\n >\n <HelpIcon size={14} />\n </div>\n </Tooltip>\n )}\n {copyOnHover && isHovered && (\n <Tooltip title={isCopied ? 'Copied' : `Copy ${label ?? 'value'}`} placement=\"top\" whiteSpace=\"pre-wrap\">\n <button\n type=\"button\"\n onClick={handleCopyValue}\n aria-label={isCopied ? `Copied ${label ?? 'value'}` : `Copy ${label ?? 'value'}`}\n className=\"p-1 flex items-center justify-center rounded text-neutral-500 hover:!text-primary-600 hover:bg-neutral-100 dark:text-primary-400 dark:hover:!text-primary-600 dark:hover:bg-neutral-800 cursor-pointer\"\n >\n <span className=\"relative inline-flex h-4 w-4 items-center justify-center\">\n <ContentCopyIcon\n size={16}\n className={cn(\n 'absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out',\n isCopied ? 'opacity-0 scale-50 rotate-[-90deg]' : 'opacity-100 scale-100 rotate-0'\n )}\n />\n <CheckFilledIcon\n size={16}\n className={cn(\n 'absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out',\n isCopied ? 'opacity-100 scale-100 rotate-0' : 'opacity-0 scale-50 rotate-90'\n )}\n />\n </span>\n </button>\n </Tooltip>\n )}\n </Typography>\n\n {/* Value section */}\n <Typography\n variant=\"medium\"\n size={getTypographySize()}\n className={cn(\n 'text-- whitespace-normal break-all flex gap-1 pt-0.5',\n isModified && 'bg-neutral-50 dark:bg-black-700 p-1 rounded',\n isRiskAnalysisOpen && riskDetails?.color &&\n `bg-${riskDetails.color}-50 border-${riskDetails.color}-300 px-0.5 rounded-lg`\n )}\n appearance=\"body\"\n >\n {/* Value display */}\n {showDiff && deletedValue && value ? (\n <div className=\"flex gap-2\">\n <span className=\"line-through\">{decode(deletedValue)}</span>\n <span>{displayValue()}</span>\n </div>\n ) : isChanged || isHighlighted ? (\n <mark className={cn('rounded-md py-0.5 px-1', getHighlightClasses())}>\n {displayValue()}\n </mark>\n ) : (\n displayValue()\n )}\n\n {/* Delta change indicator for currency fields */}\n {type?.toLowerCase() === 'currency' && deltaChange !== 0 && deltaChange !== undefined && deltaChange !== null && (\n <motion.span\n initial={{ opacity: 0, y: 2 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.25 }}\n className={cn(\n 'inline-flex items-center gap-1 ml-1.5 text-xs font-medium',\n deltaChange > 0 ? 'text-emerald-600 dark:text-emerald-400' : 'text-red-600 dark:text-red-400'\n )}\n >\n <span className=\"flex items-center justify-center w-4 h-4\">\n {deltaChange > 0 ? (\n <ArrowUpwardRounded sx={{ fontSize: 16 }} className=\"text-emerald-600 dark:text-emerald-400\" />\n ) : (\n <ArrowDownwardRounded sx={{ fontSize: 16 }} className=\"text-red-600 dark:text-red-400\" />\n )}\n </span>\n <span>{formatCurrency(Math.abs(deltaChange), items?.currency_code || 'USD')}</span>\n </motion.span>\n )}\n\n {/* Master data search icon */}\n {items?.is_master_data && items?.reference && value && (\n <button\n onClick={() => handleMasterDataClick(items)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleMasterDataClick(items);\n }\n }}\n aria-label={`Search master data for ${label}`}\n type=\"button\"\n className=\"cursor-pointer\"\n >\n <SearchIcon width={20} height={20} />\n </button>\n )}\n\n {/* File upload input */}\n {acceptsUpload && (\n <input\n type=\"file\"\n onChange={handleFileUpload}\n className=\"absolute inset-0 w-full h-full opacity-0 cursor-pointer\"\n aria-label={`Upload file for ${label}`}\n />\n )}\n </Typography>\n\n {/* Deleted value display */}\n {deletedValue && !showDiff && (\n <Typography\n variant=\"medium\"\n size=\"extra-small\"\n className=\"pt-0.5\"\n appearance=\"body\"\n >\n <mark className=\"rounded-md py-0.5 px-1 bg-error-100\">\n <del>\n {deletedValue || (type?.toLowerCase() === 'boolean' && deletedValue === '0') ? (\n deletedValue === 'True' && (type?.toLowerCase() !== 'choice') ? (\n 'Yes'\n ) : deletedValue === 'False' && (type?.toLowerCase() !== 'choice') ? (\n 'No'\n ) : type?.toLowerCase() === 'boolean' ? (\n formatBooleanValue(deletedValue)\n ) : type?.toLowerCase() === 'currency' ? (\n formatCurrency(deletedValue, items?.currency_code)\n ) : type?.toLowerCase() === 'date' ? (\n formatDate(deletedValue, {\n skipTimezone: true,\n withTime: false,\n })\n ) : type?.toLowerCase() === 'datetime' ? (\n formatDate(deletedValue, {\n skipTimezone: true,\n withTime: true,\n })\n ) : type?.toLowerCase() === 'percentage' ? (\n `${deletedValue}%`\n ) : type?.toLowerCase() === 'url' ? (\n renderUrlValue(deletedValue)\n ) : deletedValue.length > COLLAPSE_CHAR_LIMIT ? (\n <p>\n {decode(deletedValue).slice(0, collapseValue ? COLLAPSE_CHAR_LIMIT : decode(deletedValue).length)}\n {collapseValue ? '... ' : ' '}\n {renderCollapseToggle()}\n </p>\n ) : (\n decode(deletedValue)\n )\n ) : (\n '-'\n )}\n </del>\n </mark>\n </Typography>\n )}\n\n {/* Master data modal */}\n {MasterDataModal && (\n <MasterDataModal\n isVisible={isOpenMasterDataModal}\n onClose={handleMasterDataClose}\n masterdataInfo={masterdataModalInfo}\n />\n )}\n\n {/* Risk details tooltip */}\n {isHovered && riskDetails && isRiskAnalysisOpen && (\n <div\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 role=\"tooltip\"\n aria-label=\"Risk analysis details\"\n tabIndex={0}\n >\n {RiskDetailsCard ? (\n <RiskDetailsCard riskDetails={riskDetails} />\n ) : (\n <div className=\"shadow-lg p-4\">\n <div className=\"text-sm\">\n <h4 className=\"font-semibold mb-2\">Risk Details</h4>\n <p className=\"text-neutral-600 dark:text-neutral-300\">\n {riskDetails.description || 'Risk analysis information'}\n </p>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n\nLabelValue.displayName = 'LabelValue';\n"],"names":["LabelValue","forwardRef","id","label","value","className","type","tags","tooltip","items","isModified","isChanged","size","isHighlighted","deletedValue","highlightColor","isSearchActive","originalValue","showDiff","isLiveField","isAiExtracted","confidenceScore","confidenceType","confidenceTooltip","sourceMeta","onConfidenceScoreClick","deltaChange","_theme","onUpload","acceptsUpload","MasterDataModal","riskDetails","isRiskAnalysisOpen","RiskDetailsCard","ariaLabel","decodeEntities","onAiExtractedIndicatorClick","copyOnHover","urlAlias","allowTimezoneConversion","ref","collapseValue","setCollapseValue","useState","isOpenMasterDataModal","setIsOpenMasterDataModal","masterdataModalInfo","setMasterdataModalInfo","isHovered","setIsHovered","isCopied","setIsCopied","copyResetTimer","useRef","useEffect","decode","text","decodeHTMLEntities","COLLAPSE_CHAR_LIMIT","handleCollapse","renderCollapseToggle","jsx","e","renderUrlValue","href","jsxs","OpenInNew","decoded","handleMasterDataClick","item","handleMasterDataClose","handleCopyValue","textToCopy","handleFileUpload","event","file","displayValue","isISODate","isISODateString","formatBooleanValue","formatted","formatCurrency","currencyName","CURRENCIES","c","tooltipTitle","Tooltip","dateValue","formatDate","parsed","dayjs","getTypographySize","getHighlightClasses","cn","Typography","Label","tag","BoltOutlined","shouldShowConfidenceScore","getConfidenceScoreBadgeHoverClass","AIStarIcon","getConfidenceScoreBadgeColor","getConfidenceScoreBadgeFill","AIExtractedIndicator","HelpIcon","ContentCopyIcon","CheckFilledIcon","motion","ArrowUpwardRounded","ArrowDownwardRounded","SearchIcon"],"mappings":";;;;;;;;;;;;;;;;;AA4NO,MAAMA,KAAaC;AAAA,EACxB,CACE;AAAA,IACE,IAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,WAAA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,KACC,gBAAA+B;AAAA,YAAC/B;AAAA,YAAA;AAAA,cACC,WAAWc;AAAA,cACX,SAAS0B;AAAA,cACT,gBAAgBxB;AAAA,YAAA;AAAA,UAAA;AAAA,UAKnBE,KAAajB,KAAeC,KAC3B,gBAAA6B;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,SAAS,CAACC,MAAMA,EAAE,gBAAA;AAAA,cAClB,aAAa,CAACA,MAAMA,EAAE,eAAA;AAAA,cACtB,WAAW,CAACA,MAAM;AAChB,gBAAIA,EAAE,QAAQ,YACZb,EAAa,EAAK;AAAA,cAEtB;AAAA,cACA,MAAK;AAAA,cACL,cAAW;AAAA,cACX,UAAU;AAAA,cAET,UAAAhB,IACC,gBAAA4B,EAAC5B,GAAA,EAAgB,aAAAF,EAAA,CAA0B,IAE3C,gBAAA8B,EAAC,OAAA,EAAI,WAAU,iBACb,UAAA,gBAAAI,EAAC,OAAA,EAAI,WAAU,WACb,UAAA;AAAA,gBAAA,gBAAAJ,EAAC,MAAA,EAAG,WAAU,sBAAqB,UAAA,gBAAY;AAAA,kCAC9C,KAAA,EAAE,WAAU,0CACV,UAAA9B,EAAY,eAAe,4BAAA,CAC9B;AAAA,cAAA,EAAA,CACF,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA/B,GAAW,cAAc;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),t=require("../../constants/colors.cjs.js"),d=34/36,o=({fill:l=t.COLORS.primary[600],size:e=36,className:n})=>i.jsx("svg",{width:e*d,height:e,viewBox:"0 0 34 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,"aria-hidden":"true",children:i.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.9678 0C17.293 0 17.6183 0.0706991 17.9152 0.205027L31.2278 5.85389C32.7832 6.51139 33.9427 8.04556 33.9356 9.89788C33.9003 16.9112 31.0157 29.7431 18.8343 35.5758C17.6536 36.1414 16.282 36.1414 15.1014 35.5758C2.91991 29.7431 0.0353817 16.9112 3.21574e-05 9.89788C-0.00703776 8.04556 1.15243 6.51139 2.70781 5.85389L16.0275 0.205027C16.3174 0.0706991 16.6426 0 16.9678 0ZM16.9678 4.7227V31.447C26.7243 26.7243 29.3472 16.2679 29.4109 9.99686L16.9678 4.7227Z",fill:l})});o.displayName="ShieldIcon";exports.ShieldIcon=o;
|
|
2
2
|
//# sourceMappingURL=ShieldIcon.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShieldIcon.cjs.js","sources":["../../../src/components/icons/ShieldIcon.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { COLORS } from '../../constants/colors';\n\nexport interface ShieldIconProps {\n /** Icon fill colour. Defaults to the primary brand colour (`primary-600`).\n * Pass `currentColor` to inherit the surrounding text colour instead. */\n fill?: string;\n /** Icon height in pixels — the width scales with the artwork's 34:36 ratio */\n size?: number;\n /** Additional CSS classes */\n className?: string;\n}\n\n/** Intrinsic artwork dimensions — kept in sync with the viewBox */\nconst ASPECT_RATIO = 34 / 36;\n\n/**\n * ShieldIcon renders the brand shield mark (half-filled security badge).\n *\n * @example\n * ```tsx\n * <ShieldIcon size={36} />\n * <ShieldIcon fill=\"currentColor\" className=\"text-neutral-400\" />\n * ```\n */\nexport const ShieldIcon: FC<ShieldIconProps> = ({\n fill = COLORS.primary[600],\n size = 36,\n className,\n}) => (\n <svg\n width={size * ASPECT_RATIO}\n height={size}\n viewBox='0 0 34 36'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n className={className}\n aria-hidden='true'\n >\n <path\n d='M16.9678 0C17.293 0 17.6183 0.0706991 17.9152 0.205027L31.2278 5.85389C32.7832 6.51139 33.9427 8.04556 33.9356 9.89788C33.9003 16.9112 31.0157 29.7431 18.8343 35.5758C17.6536 36.1414 16.282 36.1414 15.1014 35.5758C2.91991 29.7431 0.0353817 16.9112 3.21574e-05 9.89788C-0.00703776 8.04556 1.15243 6.51139 2.70781 5.85389L16.0275 0.205027C16.3174 0.0706991 16.6426 0 16.9678 0ZM16.9678 4.7227V31.447C26.7243 26.7243 29.3472 16.2679 29.4109 9.99686L16.9678 4.7227Z'\n fill={fill}\n />\n </svg>\n);\n\nShieldIcon.displayName = 'ShieldIcon';\n"],"names":["ASPECT_RATIO","ShieldIcon","fill","COLORS","size","className","jsx"],"mappings":"gKAcMA,EAAe,GAAK,GAWbC,EAAkC,CAAC,CAC9C,KAAAC,EAAOC,EAAAA,OAAO,QAAQ,GAAG,EACzB,KAAAC,EAAO,GACP,UAAAC,CACF,IACEC,EAAAA,IAAC,MAAA,CACC,MAAOF,EAAOJ,EACd,OAAQI,EACR,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,UAAAC,EACA,cAAY,OAEZ,SAAAC,EAAAA,IAAC,OAAA,CACC,EAAE,gdACF,KAAAJ,CAAA,CAAA,CACF,CACF,EAGFD,EAAW,YAAc"}
|
|
1
|
+
{"version":3,"file":"ShieldIcon.cjs.js","sources":["../../../src/components/icons/ShieldIcon.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { COLORS } from '../../constants/colors';\n\nexport interface ShieldIconProps {\n /** Icon fill colour. Defaults to the primary brand colour (`primary-600`).\n * Pass `currentColor` to inherit the surrounding text colour instead. */\n fill?: string;\n /** Icon height in pixels — the width scales with the artwork's 34:36 ratio */\n size?: number;\n /** Additional CSS classes */\n className?: string;\n}\n\n/** Intrinsic artwork dimensions — kept in sync with the viewBox */\nconst ASPECT_RATIO = 34 / 36;\n\n/**\n * ShieldIcon renders the brand shield mark (half-filled security badge).\n *\n * @example\n * ```tsx\n * <ShieldIcon size={36} />\n * <ShieldIcon fill=\"currentColor\" className=\"text-neutral-400\" />\n * ```\n */\nexport const ShieldIcon: FC<ShieldIconProps> = ({\n fill = COLORS.primary[600],\n size = 36,\n className,\n}) => (\n <svg\n width={size * ASPECT_RATIO}\n height={size}\n viewBox='0 0 34 36'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n className={className}\n aria-hidden='true'\n >\n <path\n fillRule='evenodd'\n clipRule='evenodd'\n d='M16.9678 0C17.293 0 17.6183 0.0706991 17.9152 0.205027L31.2278 5.85389C32.7832 6.51139 33.9427 8.04556 33.9356 9.89788C33.9003 16.9112 31.0157 29.7431 18.8343 35.5758C17.6536 36.1414 16.282 36.1414 15.1014 35.5758C2.91991 29.7431 0.0353817 16.9112 3.21574e-05 9.89788C-0.00703776 8.04556 1.15243 6.51139 2.70781 5.85389L16.0275 0.205027C16.3174 0.0706991 16.6426 0 16.9678 0ZM16.9678 4.7227V31.447C26.7243 26.7243 29.3472 16.2679 29.4109 9.99686L16.9678 4.7227Z'\n fill={fill}\n />\n </svg>\n);\n\nShieldIcon.displayName = 'ShieldIcon';\n"],"names":["ASPECT_RATIO","ShieldIcon","fill","COLORS","size","className","jsx"],"mappings":"gKAcMA,EAAe,GAAK,GAWbC,EAAkC,CAAC,CAC9C,KAAAC,EAAOC,EAAAA,OAAO,QAAQ,GAAG,EACzB,KAAAC,EAAO,GACP,UAAAC,CACF,IACEC,EAAAA,IAAC,MAAA,CACC,MAAOF,EAAOJ,EACd,OAAQI,EACR,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,UAAAC,EACA,cAAY,OAEZ,SAAAC,EAAAA,IAAC,OAAA,CACC,SAAS,UACT,SAAS,UACT,EAAE,gdACF,KAAAJ,CAAA,CAAA,CACF,CACF,EAGFD,EAAW,YAAc"}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { COLORS as
|
|
3
|
-
const
|
|
4
|
-
fill:
|
|
5
|
-
size:
|
|
6
|
-
className:
|
|
7
|
-
}) => /* @__PURE__ */
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { COLORS as l } from "../../constants/colors.es.js";
|
|
3
|
+
const n = 34 / 36, r = ({
|
|
4
|
+
fill: o = l.primary[600],
|
|
5
|
+
size: e = 36,
|
|
6
|
+
className: d
|
|
7
|
+
}) => /* @__PURE__ */ i(
|
|
8
8
|
"svg",
|
|
9
9
|
{
|
|
10
|
-
width:
|
|
11
|
-
height:
|
|
10
|
+
width: e * n,
|
|
11
|
+
height: e,
|
|
12
12
|
viewBox: "0 0 34 36",
|
|
13
13
|
fill: "none",
|
|
14
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
-
className:
|
|
15
|
+
className: d,
|
|
16
16
|
"aria-hidden": "true",
|
|
17
|
-
children: /* @__PURE__ */
|
|
17
|
+
children: /* @__PURE__ */ i(
|
|
18
18
|
"path",
|
|
19
19
|
{
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
clipRule: "evenodd",
|
|
20
22
|
d: "M16.9678 0C17.293 0 17.6183 0.0706991 17.9152 0.205027L31.2278 5.85389C32.7832 6.51139 33.9427 8.04556 33.9356 9.89788C33.9003 16.9112 31.0157 29.7431 18.8343 35.5758C17.6536 36.1414 16.282 36.1414 15.1014 35.5758C2.91991 29.7431 0.0353817 16.9112 3.21574e-05 9.89788C-0.00703776 8.04556 1.15243 6.51139 2.70781 5.85389L16.0275 0.205027C16.3174 0.0706991 16.6426 0 16.9678 0ZM16.9678 4.7227V31.447C26.7243 26.7243 29.3472 16.2679 29.4109 9.99686L16.9678 4.7227Z",
|
|
21
|
-
fill:
|
|
23
|
+
fill: o
|
|
22
24
|
}
|
|
23
25
|
)
|
|
24
26
|
}
|
|
25
27
|
);
|
|
26
|
-
|
|
28
|
+
r.displayName = "ShieldIcon";
|
|
27
29
|
export {
|
|
28
|
-
|
|
30
|
+
r as ShieldIcon
|
|
29
31
|
};
|
|
30
32
|
//# sourceMappingURL=ShieldIcon.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShieldIcon.es.js","sources":["../../../src/components/icons/ShieldIcon.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { COLORS } from '../../constants/colors';\n\nexport interface ShieldIconProps {\n /** Icon fill colour. Defaults to the primary brand colour (`primary-600`).\n * Pass `currentColor` to inherit the surrounding text colour instead. */\n fill?: string;\n /** Icon height in pixels — the width scales with the artwork's 34:36 ratio */\n size?: number;\n /** Additional CSS classes */\n className?: string;\n}\n\n/** Intrinsic artwork dimensions — kept in sync with the viewBox */\nconst ASPECT_RATIO = 34 / 36;\n\n/**\n * ShieldIcon renders the brand shield mark (half-filled security badge).\n *\n * @example\n * ```tsx\n * <ShieldIcon size={36} />\n * <ShieldIcon fill=\"currentColor\" className=\"text-neutral-400\" />\n * ```\n */\nexport const ShieldIcon: FC<ShieldIconProps> = ({\n fill = COLORS.primary[600],\n size = 36,\n className,\n}) => (\n <svg\n width={size * ASPECT_RATIO}\n height={size}\n viewBox='0 0 34 36'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n className={className}\n aria-hidden='true'\n >\n <path\n d='M16.9678 0C17.293 0 17.6183 0.0706991 17.9152 0.205027L31.2278 5.85389C32.7832 6.51139 33.9427 8.04556 33.9356 9.89788C33.9003 16.9112 31.0157 29.7431 18.8343 35.5758C17.6536 36.1414 16.282 36.1414 15.1014 35.5758C2.91991 29.7431 0.0353817 16.9112 3.21574e-05 9.89788C-0.00703776 8.04556 1.15243 6.51139 2.70781 5.85389L16.0275 0.205027C16.3174 0.0706991 16.6426 0 16.9678 0ZM16.9678 4.7227V31.447C26.7243 26.7243 29.3472 16.2679 29.4109 9.99686L16.9678 4.7227Z'\n fill={fill}\n />\n </svg>\n);\n\nShieldIcon.displayName = 'ShieldIcon';\n"],"names":["ASPECT_RATIO","ShieldIcon","fill","COLORS","size","className","jsx"],"mappings":";;AAcA,MAAMA,IAAe,KAAK,IAWbC,IAAkC,CAAC;AAAA,EAC9C,MAAAC,IAAOC,EAAO,QAAQ,GAAG;AAAA,EACzB,MAAAC,IAAO;AAAA,EACP,WAAAC;AACF,MACE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAOF,IAAOJ;AAAA,IACd,QAAQI;AAAA,IACR,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACN,WAAAC;AAAA,IACA,eAAY;AAAA,IAEZ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAE;AAAA,QACF,MAAAJ;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AACF;AAGFD,EAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"ShieldIcon.es.js","sources":["../../../src/components/icons/ShieldIcon.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { COLORS } from '../../constants/colors';\n\nexport interface ShieldIconProps {\n /** Icon fill colour. Defaults to the primary brand colour (`primary-600`).\n * Pass `currentColor` to inherit the surrounding text colour instead. */\n fill?: string;\n /** Icon height in pixels — the width scales with the artwork's 34:36 ratio */\n size?: number;\n /** Additional CSS classes */\n className?: string;\n}\n\n/** Intrinsic artwork dimensions — kept in sync with the viewBox */\nconst ASPECT_RATIO = 34 / 36;\n\n/**\n * ShieldIcon renders the brand shield mark (half-filled security badge).\n *\n * @example\n * ```tsx\n * <ShieldIcon size={36} />\n * <ShieldIcon fill=\"currentColor\" className=\"text-neutral-400\" />\n * ```\n */\nexport const ShieldIcon: FC<ShieldIconProps> = ({\n fill = COLORS.primary[600],\n size = 36,\n className,\n}) => (\n <svg\n width={size * ASPECT_RATIO}\n height={size}\n viewBox='0 0 34 36'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n className={className}\n aria-hidden='true'\n >\n <path\n fillRule='evenodd'\n clipRule='evenodd'\n d='M16.9678 0C17.293 0 17.6183 0.0706991 17.9152 0.205027L31.2278 5.85389C32.7832 6.51139 33.9427 8.04556 33.9356 9.89788C33.9003 16.9112 31.0157 29.7431 18.8343 35.5758C17.6536 36.1414 16.282 36.1414 15.1014 35.5758C2.91991 29.7431 0.0353817 16.9112 3.21574e-05 9.89788C-0.00703776 8.04556 1.15243 6.51139 2.70781 5.85389L16.0275 0.205027C16.3174 0.0706991 16.6426 0 16.9678 0ZM16.9678 4.7227V31.447C26.7243 26.7243 29.3472 16.2679 29.4109 9.99686L16.9678 4.7227Z'\n fill={fill}\n />\n </svg>\n);\n\nShieldIcon.displayName = 'ShieldIcon';\n"],"names":["ASPECT_RATIO","ShieldIcon","fill","COLORS","size","className","jsx"],"mappings":";;AAcA,MAAMA,IAAe,KAAK,IAWbC,IAAkC,CAAC;AAAA,EAC9C,MAAAC,IAAOC,EAAO,QAAQ,GAAG;AAAA,EACzB,MAAAC,IAAO;AAAA,EACP,WAAAC;AACF,MACE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAOF,IAAOJ;AAAA,IACd,QAAQI;AAAA,IACR,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACN,WAAAC;AAAA,IACA,eAAY;AAAA,IAEZ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAAJ;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AACF;AAGFD,EAAW,cAAc;"}
|