@razorpay/blade 12.90.0 → 12.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/build/lib/web/development/_virtual/cloneDeep.js +1 -1
  2. package/build/lib/web/development/_virtual/cloneDeep3.js +1 -1
  3. package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js +10 -2
  4. package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js.map +1 -1
  5. package/build/lib/web/development/components/ChatMessage/DefaultMessageBubble.web.js +26 -7
  6. package/build/lib/web/development/components/ChatMessage/DefaultMessageBubble.web.js.map +1 -1
  7. package/build/lib/web/development/components/ChatMessage/ReasoningTraces.web.js +378 -0
  8. package/build/lib/web/development/components/ChatMessage/ReasoningTraces.web.js.map +1 -0
  9. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
  10. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
  11. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
  12. package/build/lib/web/development/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
  13. package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js +10 -2
  14. package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js.map +1 -1
  15. package/build/lib/web/production/components/ChatMessage/DefaultMessageBubble.web.js +26 -7
  16. package/build/lib/web/production/components/ChatMessage/DefaultMessageBubble.web.js.map +1 -1
  17. package/build/lib/web/production/components/ChatMessage/ReasoningTraces.web.js +378 -0
  18. package/build/lib/web/production/components/ChatMessage/ReasoningTraces.web.js.map +1 -0
  19. package/build/types/components/index.d.ts +41 -0
  20. package/build/types/components/index.native.d.ts +41 -0
  21. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReasoningTraces.web.js","sources":["../../../../../../src/components/ChatMessage/ReasoningTraces.web.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { AnimatePresence, m } from 'framer-motion';\nimport type { ReasoningTrace, ReasoningTracesProps } from './types';\nimport Rotate from './Rotate';\nimport { useTheme } from '~components/BladeProvider';\nimport { msToSeconds } from '~utils/msToSeconds';\nimport { cssBezierToArray } from '~utils/cssBezierToArray';\nimport { castWebType } from '~utils';\nimport type { IconComponent } from '~components/Icons';\nimport { ChevronDownIcon, ChevronUpIcon } from '~components/Icons';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Collapsible } from '~components/Collapsible/Collapsible';\nimport { CollapsibleBody } from '~components/Collapsible/CollapsibleBody';\nimport { Svg, Path } from '~components/Icons/_Svg';\nimport useIconProps from '~components/Icons/useIconProps';\n\n// Custom 4-pointed star matching the Figma design\nconst SparkleIcon: IconComponent = ({ size, color, ...styledProps }) => {\n const { height, width } = useIconProps({ size, color });\n return (\n <Svg {...styledProps} width={width} height={height} viewBox=\"0 0 9 9\" fill=\"none\">\n <Path\n d=\"M4.7169 8.67519C4.62025 8.93638 4.25084 8.93638 4.15419 8.67519L3.13296 5.91537C3.10258 5.83326 3.03784 5.76851 2.95572 5.73813L0.195898 4.7169C-0.0652872 4.62025 -0.0652871 4.25084 0.195899 4.15419L2.95572 3.13296C3.03784 3.10258 3.10258 3.03784 3.13297 2.95572L4.15419 0.1959C4.25084 -0.0652861 4.62026 -0.0652861 4.7169 0.195899L5.73813 2.95572C5.76851 3.03784 5.83326 3.10258 5.91537 3.13297L8.6752 4.15419C8.93638 4.25084 8.93638 4.62026 8.6752 4.7169L5.91537 5.73813C5.83326 5.76851 5.76851 5.83326 5.73813 5.91537L4.7169 8.67519Z\"\n fill=\"#009E5C\"\n />\n </Svg>\n );\n};\n\n// Spinning sparkle for the active step row (smaller)\nconst ActiveStepIcon = (): React.ReactElement => {\n return (\n <Rotate animate={true}>\n <SparkleIcon size=\"xsmall\" color=\"feedback.icon.positive.intense\" />\n </Rotate>\n );\n};\n\ntype StepStatus = 'completed' | 'active' | 'pending';\n\nconst StepDot = ({ status }: { status: StepStatus }): React.ReactElement => (\n <BaseBox\n style={{ opacity: status === 'pending' ? 0.3 : 1 }}\n width=\"6px\"\n height=\"6px\"\n borderRadius=\"max\"\n backgroundColor={\n status === 'completed' ? 'surface.icon.onSea.onSubtle' : 'surface.icon.gray.muted'\n }\n flexShrink={0}\n />\n);\n\n// Connector color follows the step above it: green after completed, gray otherwise\nconst StepConnector = ({ fromStatus }: { fromStatus: StepStatus }): React.ReactElement => (\n <BaseBox\n style={{ flex: 1, minHeight: '6px' }}\n width=\"1px\"\n backgroundColor={\n fromStatus === 'completed' ? 'surface.icon.onSea.onSubtle' : 'surface.border.gray.muted'\n }\n />\n);\n\nconst ShimmerOverlay = ({\n children,\n isActive,\n}: {\n children: React.ReactNode;\n isActive: boolean;\n}): React.ReactElement => {\n const { theme } = useTheme();\n\n const shimmerColor = theme.colors.surface.text.staticWhite.muted;\n const shimmerDuration = msToSeconds(theme.motion.duration['2xgentle']);\n const shimmerDelay = msToSeconds(theme.motion.delay.gentle);\n const shimmerEase = cssBezierToArray(castWebType(theme.motion.easing.standard));\n return (\n <BaseBox position=\"relative\" overflow=\"hidden\">\n {children}\n {isActive && (\n <m.span\n aria-hidden\n style={{\n position: 'absolute',\n inset: 0,\n background: `linear-gradient(90deg, transparent 0%, ${shimmerColor} 50%, transparent 100%)`,\n pointerEvents: 'none',\n }}\n initial={{ x: '-100%' }}\n animate={{ x: '100%' }}\n transition={{\n duration: shimmerDuration,\n ease: shimmerEase,\n repeat: Infinity,\n repeatDelay: shimmerDelay,\n }}\n />\n )}\n </BaseBox>\n );\n};\n\nconst TraceRow = ({\n text,\n isLast,\n stepStatus,\n}: {\n text: string;\n isLast: boolean;\n stepStatus: StepStatus;\n}): React.ReactElement => (\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"stretch\">\n {/* Left column: icon + connector */}\n <BaseBox\n display=\"flex\"\n flexDirection=\"column\"\n alignItems=\"center\"\n flexShrink={0}\n width=\"16px\"\n marginRight=\"spacing.3\"\n >\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n height=\"17px\"\n flexShrink={0}\n >\n {stepStatus === 'active' ? <ActiveStepIcon /> : <StepDot status={stepStatus} />}\n </BaseBox>\n {!isLast && <StepConnector fromStatus={stepStatus} />}\n </BaseBox>\n\n {/* Text */}\n <BaseBox\n paddingBottom={isLast ? 'spacing.0' : 'spacing.2'}\n style={stepStatus === 'pending' ? { opacity: 0.5 } : undefined}\n >\n <ShimmerOverlay isActive={stepStatus === 'active'}>\n <Text\n color={\n stepStatus === 'active' ? 'surface.text.onSea.onSubtle' : 'surface.text.gray.muted'\n }\n size=\"small\"\n weight=\"regular\"\n >\n {text}\n </Text>\n </ShimmerOverlay>\n </BaseBox>\n </BaseBox>\n);\n\nconst ReasoningTraces = ({\n traces,\n status = 'loading',\n title = 'Explored',\n activeStepIndex,\n}: ReasoningTracesProps): React.ReactElement => {\n // Upfront mode: all steps are known; activeStepIndex controls which is active\n const isUpfrontMode = activeStepIndex !== undefined;\n\n // Start collapsed in upfront mode so the open animation plays on mount\n const [isExpanded, setIsExpanded] = useState(!isUpfrontMode);\n const { theme } = useTheme();\n const isLoading = status === 'loading';\n const rowTransition = {\n duration: msToSeconds(theme.motion.duration.moderate),\n ease: cssBezierToArray(castWebType(theme.motion.easing.entrance)),\n };\n const slideTransition = {\n duration: msToSeconds(theme.motion.duration.xmoderate),\n ease: cssBezierToArray(castWebType(theme.motion.easing.emphasized)),\n };\n\n // Reset to expanded when status changes back to loading (for replay scenarios)\n useEffect(() => {\n if (status === 'loading') {\n setIsExpanded(true);\n }\n }, [status]);\n\n // Auto-collapse once all steps complete\n useEffect(() => {\n if (status === 'complete') {\n const timer = setTimeout(() => setIsExpanded(false), 600);\n return () => clearTimeout(timer);\n }\n return undefined;\n }, [status]);\n\n const handleExpandChange = ({ isExpanded: next }: { isExpanded: boolean }): void => {\n setIsExpanded(next);\n };\n\n const getStepStatus = (index: number): StepStatus => {\n if (status === 'complete') return 'completed';\n if (isUpfrontMode) {\n if (index < activeStepIndex) return 'completed';\n if (index === activeStepIndex) return 'active';\n return 'pending';\n }\n // Streaming mode: last trace is active, all before are completed\n return index < traces.length - 1 ? 'completed' : 'active';\n };\n\n const getTraceLabel = (trace: ReasoningTrace, stepStatus: StepStatus): string => {\n return stepStatus === 'completed' && trace.completedLabel ? trace.completedLabel : trace.label;\n };\n\n return (\n <BaseBox marginTop=\"spacing.2\" marginBottom=\"spacing.3\">\n {/* Show header only when complete */}\n {status === 'complete' && (\n <BaseBox\n as=\"button\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"spacing.2\"\n onClick={() => setIsExpanded((prev) => !prev)}\n cursor=\"pointer\"\n style={{ background: 'none', border: 'none' }}\n padding=\"spacing.0\"\n textAlign=\"left\"\n marginBottom=\"spacing.3\"\n >\n <Text color=\"surface.text.gray.muted\" weight=\"regular\" variant=\"body\" size=\"medium\">\n {title}\n </Text>\n\n <BaseBox display=\"flex\" alignItems=\"center\">\n {isExpanded ? (\n <ChevronUpIcon size=\"small\" color=\"surface.icon.gray.muted\" />\n ) : (\n <ChevronDownIcon size=\"small\" color=\"surface.icon.gray.muted\" />\n )}\n </BaseBox>\n </BaseBox>\n )}\n\n {/* ── Body (animated via Blade Collapsible) ── */}\n <Collapsible\n isExpanded={isExpanded}\n onExpandChange={handleExpandChange}\n _shouldApplyWidthRestrictions={false}\n >\n <CollapsibleBody _hasMargin={false}>\n <BaseBox paddingTop=\"spacing.2\">\n {isUpfrontMode || !isLoading ? (\n // Upfront mode OR complete: render all traces with computed step status\n traces.map((trace, index) => {\n const stepStatus = getStepStatus(index);\n return (\n <TraceRow\n key={index}\n text={getTraceLabel(trace, stepStatus)}\n isLast={index === traces.length - 1}\n stepStatus={stepStatus}\n />\n );\n })\n ) : (\n // Streaming mode (loading, steps added one by one):\n // completed rows + active RollingText row\n <>\n {traces.slice(0, -1).map((trace, index) => {\n // The last completed row just transitioned from the active position —\n // it was already visible, so skip the entry animation for it.\n const isJustCompleted = index === traces.length - 2;\n return (\n <m.div\n key={trace.label}\n initial={isJustCompleted ? false : { opacity: 0, y: 8 }}\n animate={{ opacity: 1, y: 0 }}\n transition={rowTransition}\n >\n <TraceRow\n text={getTraceLabel(trace, 'completed')}\n isLast={false}\n stepStatus=\"completed\"\n />\n </m.div>\n );\n })}\n\n {traces.length > 0 && (\n <m.div\n key=\"active-row\"\n initial={{ opacity: 0, y: 8 }}\n animate={{ opacity: 1, y: 0 }}\n transition={rowTransition}\n >\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"center\" gap=\"spacing.3\">\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n flexShrink={0}\n width=\"16px\"\n >\n <ActiveStepIcon />\n </BaseBox>\n <BaseBox position=\"relative\" overflow=\"hidden\">\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <m.div\n key={traces.length}\n initial={{ y: 12, opacity: 0 }}\n animate={{ y: 0, opacity: 1 }}\n exit={{ y: -12, opacity: 0, position: 'absolute' }}\n transition={slideTransition}\n >\n <ShimmerOverlay isActive>\n <Text\n color=\"surface.text.onSea.onSubtle\"\n size=\"small\"\n weight=\"regular\"\n >\n {getTraceLabel(traces[traces.length - 1], 'active')}\n </Text>\n </ShimmerOverlay>\n </m.div>\n </AnimatePresence>\n </BaseBox>\n </BaseBox>\n </m.div>\n )}\n </>\n )}\n </BaseBox>\n </CollapsibleBody>\n </Collapsible>\n </BaseBox>\n );\n};\n\nexport { ReasoningTraces };\n"],"names":["SparkleIcon","_ref","size","color","styledProps","_objectWithoutProperties","_excluded","_useIconProps","useIconProps","height","width","_jsx","Svg","_objectSpread","viewBox","fill","children","Path","d","ActiveStepIcon","Rotate","animate","StepDot","_ref2","status","BaseBox","style","opacity","borderRadius","backgroundColor","flexShrink","StepConnector","_ref3","fromStatus","flex","minHeight","ShimmerOverlay","_ref4","isActive","_useTheme","useTheme","theme","shimmerColor","colors","surface","text","staticWhite","muted","shimmerDuration","msToSeconds","motion","duration","shimmerDelay","delay","gentle","shimmerEase","cssBezierToArray","castWebType","easing","standard","_jsxs","position","overflow","m","span","inset","background","concat","pointerEvents","initial","x","transition","ease","repeat","Infinity","repeatDelay","TraceRow","_ref5","isLast","stepStatus","display","flexDirection","alignItems","marginRight","justifyContent","paddingBottom","undefined","Text","weight","ReasoningTraces","_ref6","traces","_ref6$status","_ref6$title","title","activeStepIndex","isUpfrontMode","_useState","useState","_useState2","_slicedToArray","isExpanded","setIsExpanded","_useTheme2","isLoading","rowTransition","moderate","entrance","slideTransition","xmoderate","emphasized","useEffect","timer","setTimeout","clearTimeout","handleExpandChange","_ref7","next","getStepStatus","index","length","getTraceLabel","trace","completedLabel","label","marginTop","marginBottom","as","gap","onClick","prev","cursor","border","padding","textAlign","variant","ChevronUpIcon","ChevronDownIcon","Collapsible","onExpandChange","_shouldApplyWidthRestrictions","CollapsibleBody","_hasMargin","paddingTop","map","_Fragment","slice","isJustCompleted","div","y","AnimatePresence","mode","exit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAMA,WAA0B,GAAG,SAA7BA,WAA0BA,CAAAC,IAAA,EAAwC;AAAA,EAAA,IAAlCC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;AAAKC,IAAAA,WAAW,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA,CAAA;EAC/D,IAAAC,aAAA,GAA0BC,YAAY,CAAC;AAAEN,MAAAA,IAAI,EAAJA,IAAI;AAAEC,MAAAA,KAAK,EAALA,KAAAA;AAAM,KAAC,CAAC;IAA/CM,MAAM,GAAAF,aAAA,CAANE,MAAM;IAAEC,KAAK,GAAAH,aAAA,CAALG,KAAK,CAAA;EACrB,oBACEC,GAAA,CAACC,GAAG,EAAAC,aAAA,CAAAA,aAAA,KAAKT,WAAW,CAAA,EAAA,EA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CAAC,EAAE,QAAQ,CAAA;yBAC9C,CAAA;uBACQ,CAAA;qBAdX7B,EAAAA,MAAM,CAAC6B,MAeP,CAAA;mBACQ,CAAA;AAAC,iBACX,CAAC,CAAA;eACH,CAAA;AAAC,aAAA,EApCN,YAqCC,CACR,CAAA;WACD,CAAA;SAEG,CAAA;OACM,CAAA;AAAC,KACP,CAAC,CAAA;AAAA,GACP,CAAC,CAAA;AAEd;;;;"}
@@ -14278,6 +14278,12 @@ type ThumbnailItem = {
14278
14278
  url: string;
14279
14279
  alt?: string;
14280
14280
  };
14281
+ type ReasoningTrace = {
14282
+ /** Text shown while the step is active or pending. */
14283
+ label: string;
14284
+ /** Text shown once the step is completed. Falls back to `label` if omitted. */
14285
+ completedLabel?: string;
14286
+ };
14281
14287
  type CommonChatMessageProps = {
14282
14288
  /**
14283
14289
  * isLoading prop is used to show loading state in chat message. it will add loading styles and animation to chat message.
@@ -14356,6 +14362,41 @@ type CommonChatMessageProps = {
14356
14362
  * onThumbnailClick is called when the image preview is clicked.
14357
14363
  */
14358
14364
  onThumbnailClick?: () => void;
14365
+ /**
14366
+ * Reasoning traces to display above the message content.
14367
+ * When provided, renders an animated collapsible panel showing the AI's reasoning steps.
14368
+ *
14369
+ * - While `reasoningStatus` is `'loading'`, the last step is highlighted as active.
14370
+ * - When `reasoningStatus` changes to `'complete'`, the panel auto-collapses.
14371
+ * - The user can manually expand/collapse the panel afterwards.
14372
+ *
14373
+ * Only works when `senderType` is `'other'`.
14374
+ */
14375
+ reasoningTraces?: ReasoningTrace[];
14376
+ /**
14377
+ * Controls the state of the reasoning traces panel.
14378
+ * - `'loading'`: Traces are streaming in; the panel is open and animated.
14379
+ * - `'complete'`: All traces are done; the panel auto-collapses.
14380
+ *
14381
+ * @default 'loading'
14382
+ */
14383
+ reasoningStatus?: 'loading' | 'complete';
14384
+ /**
14385
+ * Title text shown in the reasoning traces header.
14386
+ *
14387
+ * @default 'Explored'
14388
+ */
14389
+ reasoningTitle?: string;
14390
+ /**
14391
+ * When all reasoning steps are known upfront, set this to the index of the
14392
+ * step currently being processed (0-based). Steps before it are completed
14393
+ * (green), the step at this index is active (spinning), and steps after are
14394
+ * pending (dimmed).
14395
+ *
14396
+ * When omitted, the component uses streaming mode where steps are added
14397
+ * one-by-one and the last item in `reasoningTraces` is the active step.
14398
+ */
14399
+ reasoningActiveStepIndex?: number;
14359
14400
  } & TestID & StyledPropsBlade & DataAnalyticsAttribute;
14360
14401
  type SelfChatMessageProps = CommonChatMessageProps & {
14361
14402
  senderType: 'self' | 'other';
@@ -10118,6 +10118,12 @@ type ThumbnailItem = {
10118
10118
  url: string;
10119
10119
  alt?: string;
10120
10120
  };
10121
+ type ReasoningTrace = {
10122
+ /** Text shown while the step is active or pending. */
10123
+ label: string;
10124
+ /** Text shown once the step is completed. Falls back to `label` if omitted. */
10125
+ completedLabel?: string;
10126
+ };
10121
10127
  type CommonChatMessageProps = {
10122
10128
  /**
10123
10129
  * isLoading prop is used to show loading state in chat message. it will add loading styles and animation to chat message.
@@ -10196,6 +10202,41 @@ type CommonChatMessageProps = {
10196
10202
  * onThumbnailClick is called when the image preview is clicked.
10197
10203
  */
10198
10204
  onThumbnailClick?: () => void;
10205
+ /**
10206
+ * Reasoning traces to display above the message content.
10207
+ * When provided, renders an animated collapsible panel showing the AI's reasoning steps.
10208
+ *
10209
+ * - While `reasoningStatus` is `'loading'`, the last step is highlighted as active.
10210
+ * - When `reasoningStatus` changes to `'complete'`, the panel auto-collapses.
10211
+ * - The user can manually expand/collapse the panel afterwards.
10212
+ *
10213
+ * Only works when `senderType` is `'other'`.
10214
+ */
10215
+ reasoningTraces?: ReasoningTrace[];
10216
+ /**
10217
+ * Controls the state of the reasoning traces panel.
10218
+ * - `'loading'`: Traces are streaming in; the panel is open and animated.
10219
+ * - `'complete'`: All traces are done; the panel auto-collapses.
10220
+ *
10221
+ * @default 'loading'
10222
+ */
10223
+ reasoningStatus?: 'loading' | 'complete';
10224
+ /**
10225
+ * Title text shown in the reasoning traces header.
10226
+ *
10227
+ * @default 'Explored'
10228
+ */
10229
+ reasoningTitle?: string;
10230
+ /**
10231
+ * When all reasoning steps are known upfront, set this to the index of the
10232
+ * step currently being processed (0-based). Steps before it are completed
10233
+ * (green), the step at this index is active (spinning), and steps after are
10234
+ * pending (dimmed).
10235
+ *
10236
+ * When omitted, the component uses streaming mode where steps are added
10237
+ * one-by-one and the last item in `reasoningTraces` is the active step.
10238
+ */
10239
+ reasoningActiveStepIndex?: number;
10199
10240
  } & TestID & StyledPropsBlade & DataAnalyticsAttribute;
10200
10241
  type SelfChatMessageProps = CommonChatMessageProps & {
10201
10242
  senderType: 'self' | 'other';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@razorpay/blade",
3
3
  "description": "The Design System that powers Razorpay",
4
- "version": "12.90.0",
4
+ "version": "12.91.0",
5
5
  "license": "MIT",
6
6
  "engines": {
7
7
  "node": ">=18.12.1"