@razorpay/blade 12.95.0 → 12.95.2

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 (67) hide show
  1. package/build/lib/native/components/Card/Card.js +1 -1
  2. package/build/lib/native/components/Card/Card.js.map +1 -1
  3. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +1 -1
  4. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  5. package/build/lib/native/components/Spark/RazorSenseGradient/shader.js +10 -3
  6. package/build/lib/native/components/Spark/RazorSenseGradient/shader.js.map +1 -1
  7. package/build/lib/native/components/Spark/RzpGlass/RzpGlass.js +5 -4
  8. package/build/lib/native/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
  9. package/build/lib/native/components/Spark/RzpGlass/RzpGlassMount.js +2 -1
  10. package/build/lib/native/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
  11. package/build/lib/native/components/Spark/RzpGlass/rzpGlassShader.js +8 -5
  12. package/build/lib/native/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
  13. package/build/lib/native/components/Spark/RzpGlass/utils.js +4 -2
  14. package/build/lib/native/components/Spark/RzpGlass/utils.js.map +1 -1
  15. package/build/lib/web/development/components/Card/Card.js +7 -1
  16. package/build/lib/web/development/components/Card/Card.js.map +1 -1
  17. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +0 -1
  18. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  19. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +1 -0
  20. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  21. package/build/lib/web/development/components/Modal/Modal.web.js +31 -28
  22. package/build/lib/web/development/components/Modal/Modal.web.js.map +1 -1
  23. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavItem.web.js +1 -1
  24. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavItem.web.js.map +1 -1
  25. package/build/lib/web/development/components/Spark/RazorSenseGradient/shader.js +1 -1
  26. package/build/lib/web/development/components/Spark/RazorSenseGradient/shader.js.map +1 -1
  27. package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js +14 -103
  28. package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
  29. package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js +8 -6
  30. package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
  31. package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
  32. package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
  33. package/build/lib/web/development/components/Spark/RzpGlass/utils.js +68 -1
  34. package/build/lib/web/development/components/Spark/RzpGlass/utils.js.map +1 -1
  35. package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js +3 -2
  36. package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
  37. package/build/lib/web/production/_virtual/flatten.js +1 -1
  38. package/build/lib/web/production/_virtual/flatten3.js +1 -1
  39. package/build/lib/web/production/components/Card/Card.js +7 -1
  40. package/build/lib/web/production/components/Card/Card.js.map +1 -1
  41. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +0 -1
  42. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  43. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +1 -0
  44. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  45. package/build/lib/web/production/components/Modal/Modal.web.js +31 -28
  46. package/build/lib/web/production/components/Modal/Modal.web.js.map +1 -1
  47. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavItem.web.js +1 -1
  48. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavItem.web.js.map +1 -1
  49. package/build/lib/web/production/components/Spark/RazorSenseGradient/shader.js +1 -1
  50. package/build/lib/web/production/components/Spark/RazorSenseGradient/shader.js.map +1 -1
  51. package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js +14 -103
  52. package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
  53. package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js +8 -6
  54. package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
  55. package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
  56. package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
  57. package/build/lib/web/production/components/Spark/RzpGlass/utils.js +68 -1
  58. package/build/lib/web/production/components/Spark/RzpGlass/utils.js.map +1 -1
  59. package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js +3 -2
  60. package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
  61. package/build/lib/web/production/node_modules/es-toolkit/dist/array/flatten.js +1 -1
  62. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
  63. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
  64. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
  65. package/build/types/components/index.d.ts +40 -0
  66. package/build/types/components/index.native.d.ts +39 -0
  67. package/package.json +1 -1
@@ -23,7 +23,7 @@ import { useCheckboxGroupContext } from '../Checkbox/CheckboxGroup/CheckboxGroup
23
23
  import { useRadioGroupContext } from '../Radio/RadioGroup/RadioContext.js';
24
24
  import { jsx, jsxs } from 'react/jsx-runtime';
25
25
 
26
- var _excluded=["children","backgroundColor","borderRadius","elevation","testID","padding","width","height","minHeight","minWidth","maxWidth","onClick","isSelected","accessibilityLabel","shouldScaleOnHover","onHover","href","target","rel","as","size","cursor","opacity","transition","flexShrink"],_excluded2=["height","children","testID"];var ComponentIds={CardHeader:'CardHeader',CardHeaderTrailing:'CardHeaderTrailing',CardHeaderLeading:'CardHeaderLeading',CardFooter:'CardFooter',CardFooterTrailing:'CardFooterTrailing',CardFooterLeading:'CardFooterLeading',CardBody:'CardBody',CardHeaderIcon:'CardHeaderIcon',CardHeaderCounter:'CardHeaderCounter',CardHeaderBadge:'CardHeaderBadge',CardHeaderAmount:'CardHeaderAmount',CardHeaderText:'CardHeaderText',CardHeaderLink:'CardHeaderLink',CardHeaderIconButton:'CardHeaderIconButton'};var _Card=function _Card(_ref,ref){var children=_ref.children;_ref.backgroundColor;_ref.borderRadius;_ref.elevation;var testID=_ref.testID,_ref$padding=_ref.padding,padding=_ref$padding===void 0?'spacing.7':_ref$padding,width=_ref.width,height=_ref.height,minHeight=_ref.minHeight,minWidth=_ref.minWidth,maxWidth=_ref.maxWidth,onClick=_ref.onClick,_ref$isSelected=_ref.isSelected,isSelected=_ref$isSelected===void 0?false:_ref$isSelected,accessibilityLabel=_ref.accessibilityLabel,_ref$shouldScaleOnHov=_ref.shouldScaleOnHover,shouldScaleOnHover=_ref$shouldScaleOnHov===void 0?false:_ref$shouldScaleOnHov,onHover=_ref.onHover,href=_ref.href,target=_ref.target,rel=_ref.rel,as=_ref.as,_ref$size=_ref.size,size=_ref$size===void 0?'large':_ref$size,cursor=_ref.cursor,opacity=_ref.opacity,transition=_ref.transition,flexShrink=_ref.flexShrink,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isFocused=_React$useState2[0],setIsFocused=_React$useState2[1];var _useTheme=useTheme(),colorScheme=_useTheme.colorScheme;useVerifyAllowedChildren({children:children,componentName:'Card',allowedComponents:[ComponentIds.CardHeader,ComponentIds.CardBody,ComponentIds.CardFooter]});var linkOverlayProps=Object.assign({},metaAttribute({name:CARD_LINK_OVERLAY_ID}),makeAccessible({label:accessibilityLabel,pressed:href?undefined:isSelected}),{onFocus:function onFocus(){setIsFocused(true);},onBlur:function onBlur(){setIsFocused(false);}});var defaultRel=target&&target==='_blank'?'noreferrer noopener':undefined;var checkboxGroupProps=useCheckboxGroupContext();var radioGroupProps=useRadioGroupContext();var getGroupProps=function getGroupProps(){if(Object.keys(checkboxGroupProps).length>0)return checkboxGroupProps;if(Object.keys(radioGroupProps).length>0)return radioGroupProps;return undefined;};var groupProps=getGroupProps();var _validationState=groupProps==null?void 0:groupProps.validationState;return jsx(CardProvider,{size:size,children:jsx(CardRoot,Object.assign({as:as,ref:ref,display:'block',borderRadius:"medium",onMouseEnter:onHover,shouldScaleOnHover:shouldScaleOnHover,isSelected:isSelected,isFocused:isFocused,onClick:isReactNative()?onClick:undefined,width:width,height:height,minHeight:minHeight,minWidth:minWidth,maxWidth:maxWidth,href:href,accessibilityLabel:accessibilityLabel,validationState:_validationState,cursor:isReactNative()?undefined:cursor,opacity:opacity,transition:transition,flexShrink:flexShrink},metaAttribute({name:MetaConstants.Card,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsxs(CardSurface,{height:height,minHeight:minHeight,padding:padding,borderRadius:"medium",textAlign:'left',backgroundColor:"surface.background.gray.intense",colorScheme:colorScheme,isSelected:isSelected,children:[href?jsx(LinkOverlay,Object.assign({onClick:onClick,href:href,target:target,rel:rel!=null?rel:defaultRel},linkOverlayProps)):null,!href&&onClick?jsx(LinkOverlay,Object.assign({as:"button",onClick:onClick},linkOverlayProps)):null,children]})}))});};var _CardBody=function _CardBody(_ref2){var height=_ref2.height,children=_ref2.children,testID=_ref2.testID,rest=_objectWithoutProperties(_ref2,_excluded2);useVerifyInsideCard('CardBody');return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.CardBody,testID:testID}),makeAnalyticsAttribute(rest),{height:height,children:children}));};var Card=React__default.forwardRef(_Card);var CardBody=assignWithoutSideEffects(_CardBody,{componentId:ComponentIds.CardBody});
26
+ var _excluded=["children","backgroundColor","borderRadius","elevation","testID","padding","width","height","minHeight","minWidth","maxWidth","onClick","isSelected","accessibilityLabel","shouldScaleOnHover","onHover","href","target","rel","as","size","cursor","opacity","transition","flexShrink","overflow","overflowX","overflowY"],_excluded2=["height","children","testID"];var ComponentIds={CardHeader:'CardHeader',CardHeaderTrailing:'CardHeaderTrailing',CardHeaderLeading:'CardHeaderLeading',CardFooter:'CardFooter',CardFooterTrailing:'CardFooterTrailing',CardFooterLeading:'CardFooterLeading',CardBody:'CardBody',CardHeaderIcon:'CardHeaderIcon',CardHeaderCounter:'CardHeaderCounter',CardHeaderBadge:'CardHeaderBadge',CardHeaderAmount:'CardHeaderAmount',CardHeaderText:'CardHeaderText',CardHeaderLink:'CardHeaderLink',CardHeaderIconButton:'CardHeaderIconButton'};var _Card=function _Card(_ref,ref){var children=_ref.children;_ref.backgroundColor;_ref.borderRadius;_ref.elevation;var testID=_ref.testID,_ref$padding=_ref.padding,padding=_ref$padding===void 0?'spacing.7':_ref$padding,width=_ref.width,height=_ref.height,minHeight=_ref.minHeight,minWidth=_ref.minWidth,maxWidth=_ref.maxWidth,onClick=_ref.onClick,_ref$isSelected=_ref.isSelected,isSelected=_ref$isSelected===void 0?false:_ref$isSelected,accessibilityLabel=_ref.accessibilityLabel,_ref$shouldScaleOnHov=_ref.shouldScaleOnHover,shouldScaleOnHover=_ref$shouldScaleOnHov===void 0?false:_ref$shouldScaleOnHov,onHover=_ref.onHover,href=_ref.href,target=_ref.target,rel=_ref.rel,as=_ref.as,_ref$size=_ref.size,size=_ref$size===void 0?'large':_ref$size,cursor=_ref.cursor,opacity=_ref.opacity,transition=_ref.transition,flexShrink=_ref.flexShrink,overflow=_ref.overflow,overflowX=_ref.overflowX,overflowY=_ref.overflowY,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isFocused=_React$useState2[0],setIsFocused=_React$useState2[1];var _useTheme=useTheme(),colorScheme=_useTheme.colorScheme;useVerifyAllowedChildren({children:children,componentName:'Card',allowedComponents:[ComponentIds.CardHeader,ComponentIds.CardBody,ComponentIds.CardFooter]});var linkOverlayProps=Object.assign({},metaAttribute({name:CARD_LINK_OVERLAY_ID}),makeAccessible({label:accessibilityLabel,pressed:href?undefined:isSelected}),{onFocus:function onFocus(){setIsFocused(true);},onBlur:function onBlur(){setIsFocused(false);}});var defaultRel=target&&target==='_blank'?'noreferrer noopener':undefined;var checkboxGroupProps=useCheckboxGroupContext();var radioGroupProps=useRadioGroupContext();var getGroupProps=function getGroupProps(){if(Object.keys(checkboxGroupProps).length>0)return checkboxGroupProps;if(Object.keys(radioGroupProps).length>0)return radioGroupProps;return undefined;};var groupProps=getGroupProps();var _validationState=groupProps==null?void 0:groupProps.validationState;return jsx(CardProvider,{size:size,children:jsx(CardRoot,Object.assign({as:as,ref:ref,display:'block',borderRadius:"medium",onMouseEnter:onHover,shouldScaleOnHover:shouldScaleOnHover,isSelected:isSelected,isFocused:isFocused,onClick:isReactNative()?onClick:undefined,width:width,height:height,minHeight:minHeight,minWidth:minWidth,maxWidth:maxWidth,href:href,accessibilityLabel:accessibilityLabel,validationState:_validationState,cursor:isReactNative()?undefined:cursor,opacity:opacity,transition:transition,flexShrink:flexShrink},metaAttribute({name:MetaConstants.Card,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsxs(CardSurface,{height:height,minHeight:minHeight,padding:padding,borderRadius:"medium",textAlign:'left',backgroundColor:"surface.background.gray.intense",colorScheme:colorScheme,isSelected:isSelected,overflow:overflow,overflowX:overflowX,overflowY:overflowY,children:[href?jsx(LinkOverlay,Object.assign({onClick:onClick,href:href,target:target,rel:rel!=null?rel:defaultRel},linkOverlayProps)):null,!href&&onClick?jsx(LinkOverlay,Object.assign({as:"button",onClick:onClick},linkOverlayProps)):null,children]})}))});};var _CardBody=function _CardBody(_ref2){var height=_ref2.height,children=_ref2.children,testID=_ref2.testID,rest=_objectWithoutProperties(_ref2,_excluded2);useVerifyInsideCard('CardBody');return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.CardBody,testID:testID}),makeAnalyticsAttribute(rest),{height:height,children:children}));};var Card=React__default.forwardRef(_Card);var CardBody=assignWithoutSideEffects(_CardBody,{componentId:ComponentIds.CardBody});
27
27
 
28
28
  export { Card, CardBody, ComponentIds };
29
29
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../../src/components/Card/Card.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport { CardSurface } from './CardSurface';\nimport { CardProvider, useVerifyInsideCard } from './CardContext';\nimport { LinkOverlay } from './LinkOverlay';\nimport { CardRoot } from './CardRoot';\nimport type { CardSpacingValueType, LinkOverlayProps } from './types';\nimport { CARD_LINK_OVERLAY_ID } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { Elevation } from '~tokens/global';\nimport type { BoxProps } from '~components/Box';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { Platform } from '~utils';\nimport { isReactNative, useTheme } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useCheckboxGroupContext } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport { useRadioGroupContext } from '~components/Radio/RadioGroup/RadioContext';\nimport type { CheckboxGroupContextType } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport type { RadioGroupContextType } from '~components/Radio/RadioGroup/RadioContext';\n\nexport const ComponentIds = {\n CardHeader: 'CardHeader',\n CardHeaderTrailing: 'CardHeaderTrailing',\n CardHeaderLeading: 'CardHeaderLeading',\n CardFooter: 'CardFooter',\n CardFooterTrailing: 'CardFooterTrailing',\n CardFooterLeading: 'CardFooterLeading',\n CardBody: 'CardBody',\n CardHeaderIcon: 'CardHeaderIcon',\n CardHeaderCounter: 'CardHeaderCounter',\n CardHeaderBadge: 'CardHeaderBadge',\n CardHeaderAmount: 'CardHeaderAmount',\n CardHeaderText: 'CardHeaderText',\n CardHeaderLink: 'CardHeaderLink',\n CardHeaderIconButton: 'CardHeaderIconButton',\n};\n\ntype CardSurfaceBackgroundColors = `surface.background.gray.${DotNotationToken<\n Theme['colors']['surface']['background']['gray']\n>}`;\n\nexport type CardProps = {\n /**\n * Card contents\n */\n children: React.ReactNode;\n /**\n * Sets the background color of the Card\n *\n * @default `surface.background.gray.intense`\n *\n * @deprecated The `backgroundColor` prop is deprecated and is a no-op. The Card always uses `surface.background.gray.intense`. This prop will be removed in a future major version.\n */\n backgroundColor?: CardSurfaceBackgroundColors;\n /**\n * Sets the border radius of the Card\n *\n * @default `medium`\n *\n * @deprecated The `borderRadius` prop is deprecated and is a no-op. The Card always uses `medium` borderRadius. This prop will be removed in a future major version.\n */\n borderRadius?: Extract<BoxProps['borderRadius'], 'medium' | 'large' | 'xlarge'>;\n /**\n * Sets the elevation for Cards\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n *\n * @deprecated The `elevation` prop is deprecated and is a no-op. The Card always uses a custom elevation. This prop will be removed in a future major version.\n */\n elevation?: keyof Elevation;\n /**\n * Sets the padding equally on all sides. Only few `spacing` tokens are allowed deliberately\n * @default `spacing.7`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-spacing--docs\n */\n padding?: CardSpacingValueType;\n /**\n * Sets the width of the card\n */\n width?: BoxProps['width'];\n /**\n * Sets the height of the card\n */\n height?: BoxProps['height'];\n /**\n * Sets minimum height of the card\n */\n minHeight?: BoxProps['minHeight'];\n /**\n * Sets minimum width of the card\n */\n minWidth?: BoxProps['minWidth'];\n /**\n * Sets maximum width of the card\n */\n maxWidth?: BoxProps['maxWidth'];\n /**\n * If `true`, the card will be in selected state\n * Card will have a primary color border around it.\n *\n * @default false\n */\n isSelected?: boolean;\n /**\n * Makes the Card linkable by setting the `href` prop\n *\n * @default undefined\n */\n href?: string;\n /**\n * Sets the `target` attribute for the linkable card\n */\n target?: string;\n /**\n * Sets the `rel` attribute for the linkable card\n */\n rel?: string;\n /**\n * Sets the accessibility label for the card\n * This is useful when the card has an `href` or `onClick` prop\n * Setting this will announce the label when the card is focused\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the card will scale up on hover\n *\n * On mobile devices it will scale down on press\n *\n * **This prop is deprecated in favour of motion presets released in v12**\n *\n * ### Migration\n *\n * ```diff\n * - <Card\n * - shouldScaleOnHover\n * - />\n *\n * + <Scale motionTriggers={['hover']}>\n * + <Card />\n * + </Scale>\n * ```\n *\n * @default false\n *\n * @deprecated This prop is deprecated in favour of motion presets released in v12\n */\n shouldScaleOnHover?: boolean;\n /**\n * Callback triggered when the card is hovered\n */\n onHover?: () => void;\n /**\n * Sets the size of the card header title\n *\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /**\n * Callback triggered when the card is clicked\n */\n onClick?: (\n event: Platform.Select<{\n web: React.MouseEvent;\n native: GestureResponderEvent;\n }>,\n ) => void;\n /**\n * Sets the HTML element for the Card\n *\n * When `as` is set to `label`, the card will be rendered as a label element\n * This can be used to create a custom checkbox or radio button using the card\n *\n * @default undefined\n */\n as?: 'label';\n cursor?: Platform.Select<{\n web: CSSObject['cursor'];\n native: undefined;\n }>;\n opacity?: BoxProps['opacity'];\n transition?: BoxProps['transition'];\n flexShrink?: BoxProps['flexShrink'];\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _Card: React.ForwardRefRenderFunction<BladeElementRef, CardProps> = (\n {\n children,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n backgroundColor,\n borderRadius = 'medium',\n elevation = 'lowRaised',\n testID,\n padding = 'spacing.7',\n width,\n height,\n minHeight,\n minWidth,\n maxWidth,\n onClick,\n isSelected = false,\n accessibilityLabel,\n shouldScaleOnHover = false,\n onHover,\n href,\n target,\n rel,\n as,\n size = 'large',\n cursor,\n opacity,\n transition,\n flexShrink,\n ...rest\n },\n ref,\n): React.ReactElement => {\n const [isFocused, setIsFocused] = React.useState(false);\n const { colorScheme } = useTheme();\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Card',\n allowedComponents: [ComponentIds.CardHeader, ComponentIds.CardBody, ComponentIds.CardFooter],\n });\n\n const linkOverlayProps: LinkOverlayProps = {\n ...metaAttribute({ name: CARD_LINK_OVERLAY_ID }),\n ...makeAccessible({ label: accessibilityLabel, pressed: href ? undefined : isSelected }),\n onFocus: () => {\n setIsFocused(true);\n },\n onBlur: () => {\n setIsFocused(false);\n },\n };\n const defaultRel = target && target === '_blank' ? 'noreferrer noopener' : undefined;\n\n const checkboxGroupProps = useCheckboxGroupContext();\n const radioGroupProps = useRadioGroupContext();\n\n const getGroupProps = (): CheckboxGroupContextType | RadioGroupContextType | undefined => {\n if (Object.keys(checkboxGroupProps).length > 0) return checkboxGroupProps;\n if (Object.keys(radioGroupProps).length > 0) return radioGroupProps;\n return undefined;\n };\n\n const groupProps = getGroupProps();\n\n const _validationState = groupProps?.validationState;\n\n return (\n <CardProvider size={size}>\n <CardRoot\n as={as}\n ref={ref as never}\n display={'block' as never}\n borderRadius=\"medium\"\n onMouseEnter={onHover as never}\n shouldScaleOnHover={shouldScaleOnHover}\n isSelected={isSelected}\n isFocused={isFocused}\n // on react native we need to pass onClick to root, because we don't need the LinkOverlay in RN\n onClick={isReactNative() ? onClick : undefined}\n width={width}\n height={height}\n minHeight={minHeight}\n minWidth={minWidth}\n maxWidth={maxWidth}\n href={href}\n accessibilityLabel={accessibilityLabel}\n validationState={_validationState}\n cursor={isReactNative() ? undefined : cursor}\n opacity={opacity}\n transition={transition}\n flexShrink={flexShrink}\n {...metaAttribute({ name: MetaConstants.Card, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <CardSurface\n height={height}\n minHeight={minHeight}\n padding={padding}\n borderRadius=\"medium\"\n textAlign={'left' as never}\n backgroundColor=\"surface.background.gray.intense\"\n colorScheme={colorScheme}\n isSelected={isSelected}\n >\n {href ? (\n <LinkOverlay\n onClick={onClick}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n {...linkOverlayProps}\n />\n ) : null}\n {!href && onClick ? (\n <LinkOverlay as=\"button\" onClick={onClick} {...linkOverlayProps} />\n ) : null}\n {children}\n </CardSurface>\n </CardRoot>\n </CardProvider>\n );\n};\n\ntype CardBodyProps = {\n children: React.ReactNode;\n height?: BoxProps['height'];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardBody = ({ height, children, testID, ...rest }: CardBodyProps): React.ReactElement => {\n useVerifyInsideCard('CardBody');\n\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.CardBody, testID })}\n {...makeAnalyticsAttribute(rest)}\n height={height}\n >\n {children}\n </BaseBox>\n );\n};\n\nconst Card = React.forwardRef(_Card);\nconst CardBody = assignWithoutSideEffects(_CardBody, { componentId: ComponentIds.CardBody });\n\nexport { Card, CardBody };\n"],"names":["ComponentIds","CardHeader","CardHeaderTrailing","CardHeaderLeading","CardFooter","CardFooterTrailing","CardFooterLeading","CardBody","CardHeaderIcon","CardHeaderCounter","CardHeaderBadge","CardHeaderAmount","CardHeaderText","CardHeaderLink","CardHeaderIconButton","_Card","_ref","ref","children","backgroundColor","borderRadius","elevation","testID","_ref$padding","padding","width","height","minHeight","minWidth","maxWidth","onClick","_ref$isSelected","isSelected","accessibilityLabel","_ref$shouldScaleOnHov","shouldScaleOnHover","onHover","href","target","rel","as","_ref$size","size","cursor","opacity","transition","flexShrink","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isFocused","setIsFocused","_useTheme","useTheme","colorScheme","useVerifyAllowedChildren","componentName","allowedComponents","linkOverlayProps","Object","assign","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","undefined","onFocus","onBlur","defaultRel","checkboxGroupProps","useCheckboxGroupContext","radioGroupProps","useRadioGroupContext","getGroupProps","keys","length","groupProps","_validationState","validationState","_jsx","CardProvider","CardRoot","display","onMouseEnter","isReactNative","MetaConstants","Card","getStyledProps","makeAnalyticsAttribute","_jsxs","CardSurface","textAlign","LinkOverlay","_CardBody","_ref2","_excluded2","useVerifyInsideCard","BaseBox","forwardRef","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;kVA8Ba,IAAAA,YAAY,CAAG,CAC1BC,UAAU,CAAE,YAAY,CACxBC,kBAAkB,CAAE,oBAAoB,CACxCC,iBAAiB,CAAE,mBAAmB,CACtCC,UAAU,CAAE,YAAY,CACxBC,kBAAkB,CAAE,oBAAoB,CACxCC,iBAAiB,CAAE,mBAAmB,CACtCC,QAAQ,CAAE,UAAU,CACpBC,cAAc,CAAE,gBAAgB,CAChCC,iBAAiB,CAAE,mBAAmB,CACtCC,eAAe,CAAE,iBAAiB,CAClCC,gBAAgB,CAAE,kBAAkB,CACpCC,cAAc,CAAE,gBAAgB,CAChCC,cAAc,CAAE,gBAAgB,CAChCC,oBAAoB,CAAE,sBACxB,EA0JA,IAAMC,KAAiE,CAAG,SAApEA,KAAiEA,CAAAC,IAAA,CA8BrEC,GAAG,CACoB,CA7BrB,IAAAC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAEOF,IAAA,CAAfG,eAAe,CAAAH,IAAA,CACfI,YAAY,CAAWJ,IAAA,CACvBK,SAAS,KACTC,MAAM,CAAAN,IAAA,CAANM,MAAM,CAAAC,YAAA,CAAAP,IAAA,CACNQ,OAAO,CAAPA,OAAO,CAAAD,YAAA,GAAA,KAAA,CAAA,CAAG,WAAW,CAAAA,YAAA,CACrBE,KAAK,CAAAT,IAAA,CAALS,KAAK,CACLC,MAAM,CAAAV,IAAA,CAANU,MAAM,CACNC,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AAGmG,wBAAwB,CAACN,SAAS,CAAE,CAAEO,WAAW,CAAE3G,YAAY,CAACO,QAAS,CAAC;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../../src/components/Card/Card.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport { CardSurface } from './CardSurface';\nimport { CardProvider, useVerifyInsideCard } from './CardContext';\nimport { LinkOverlay } from './LinkOverlay';\nimport { CardRoot } from './CardRoot';\nimport type { CardSpacingValueType, LinkOverlayProps } from './types';\nimport { CARD_LINK_OVERLAY_ID } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { Elevation } from '~tokens/global';\nimport type { BoxProps } from '~components/Box';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { Platform } from '~utils';\nimport { isReactNative, useTheme } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useCheckboxGroupContext } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport { useRadioGroupContext } from '~components/Radio/RadioGroup/RadioContext';\nimport type { CheckboxGroupContextType } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport type { RadioGroupContextType } from '~components/Radio/RadioGroup/RadioContext';\n\nexport const ComponentIds = {\n CardHeader: 'CardHeader',\n CardHeaderTrailing: 'CardHeaderTrailing',\n CardHeaderLeading: 'CardHeaderLeading',\n CardFooter: 'CardFooter',\n CardFooterTrailing: 'CardFooterTrailing',\n CardFooterLeading: 'CardFooterLeading',\n CardBody: 'CardBody',\n CardHeaderIcon: 'CardHeaderIcon',\n CardHeaderCounter: 'CardHeaderCounter',\n CardHeaderBadge: 'CardHeaderBadge',\n CardHeaderAmount: 'CardHeaderAmount',\n CardHeaderText: 'CardHeaderText',\n CardHeaderLink: 'CardHeaderLink',\n CardHeaderIconButton: 'CardHeaderIconButton',\n};\n\ntype CardSurfaceBackgroundColors = `surface.background.gray.${DotNotationToken<\n Theme['colors']['surface']['background']['gray']\n>}`;\n\nexport type CardProps = {\n /**\n * Card contents\n */\n children: React.ReactNode;\n /**\n * Sets the background color of the Card\n *\n * @default `surface.background.gray.intense`\n *\n * @deprecated The `backgroundColor` prop is deprecated and is a no-op. The Card always uses `surface.background.gray.intense`. This prop will be removed in a future major version.\n */\n backgroundColor?: CardSurfaceBackgroundColors;\n /**\n * Sets the border radius of the Card\n *\n * @default `medium`\n *\n * @deprecated The `borderRadius` prop is deprecated and is a no-op. The Card always uses `medium` borderRadius. This prop will be removed in a future major version.\n */\n borderRadius?: Extract<BoxProps['borderRadius'], 'medium' | 'large' | 'xlarge'>;\n /**\n * Sets the elevation for Cards\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n *\n * @deprecated The `elevation` prop is deprecated and is a no-op. The Card always uses a custom elevation. This prop will be removed in a future major version.\n */\n elevation?: keyof Elevation;\n /**\n * Sets the padding equally on all sides. Only few `spacing` tokens are allowed deliberately\n * @default `spacing.7`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-spacing--docs\n */\n padding?: CardSpacingValueType;\n /**\n * Sets the width of the card\n */\n width?: BoxProps['width'];\n /**\n * Sets the height of the card\n */\n height?: BoxProps['height'];\n /**\n * Sets minimum height of the card\n */\n minHeight?: BoxProps['minHeight'];\n /**\n * Sets minimum width of the card\n */\n minWidth?: BoxProps['minWidth'];\n /**\n * Sets maximum width of the card\n */\n maxWidth?: BoxProps['maxWidth'];\n /**\n * If `true`, the card will be in selected state\n * Card will have a primary color border around it.\n *\n * @default false\n */\n isSelected?: boolean;\n /**\n * Makes the Card linkable by setting the `href` prop\n *\n * @default undefined\n */\n href?: string;\n /**\n * Sets the `target` attribute for the linkable card\n */\n target?: string;\n /**\n * Sets the `rel` attribute for the linkable card\n */\n rel?: string;\n /**\n * Sets the accessibility label for the card\n * This is useful when the card has an `href` or `onClick` prop\n * Setting this will announce the label when the card is focused\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the card will scale up on hover\n *\n * On mobile devices it will scale down on press\n *\n * **This prop is deprecated in favour of motion presets released in v12**\n *\n * ### Migration\n *\n * ```diff\n * - <Card\n * - shouldScaleOnHover\n * - />\n *\n * + <Scale motionTriggers={['hover']}>\n * + <Card />\n * + </Scale>\n * ```\n *\n * @default false\n *\n * @deprecated This prop is deprecated in favour of motion presets released in v12\n */\n shouldScaleOnHover?: boolean;\n /**\n * Callback triggered when the card is hovered\n */\n onHover?: () => void;\n /**\n * Sets the size of the card header title\n *\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /**\n * Callback triggered when the card is clicked\n */\n onClick?: (\n event: Platform.Select<{\n web: React.MouseEvent;\n native: GestureResponderEvent;\n }>,\n ) => void;\n /**\n * Sets the HTML element for the Card\n *\n * When `as` is set to `label`, the card will be rendered as a label element\n * This can be used to create a custom checkbox or radio button using the card\n *\n * @default undefined\n */\n as?: 'label';\n cursor?: Platform.Select<{\n web: CSSObject['cursor'];\n native: undefined;\n }>;\n opacity?: BoxProps['opacity'];\n transition?: BoxProps['transition'];\n flexShrink?: BoxProps['flexShrink'];\n /**\n * Sets the overflow behavior of the card content\n */\n overflow?: BoxProps['overflow'];\n /**\n * Sets the horizontal overflow behavior of the card content\n */\n overflowX?: BoxProps['overflowX'];\n /**\n * Sets the vertical overflow behavior of the card content\n */\n overflowY?: BoxProps['overflowY'];\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _Card: React.ForwardRefRenderFunction<BladeElementRef, CardProps> = (\n {\n children,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n backgroundColor,\n borderRadius = 'medium',\n elevation = 'lowRaised',\n testID,\n padding = 'spacing.7',\n width,\n height,\n minHeight,\n minWidth,\n maxWidth,\n onClick,\n isSelected = false,\n accessibilityLabel,\n shouldScaleOnHover = false,\n onHover,\n href,\n target,\n rel,\n as,\n size = 'large',\n cursor,\n opacity,\n transition,\n flexShrink,\n overflow,\n overflowX,\n overflowY,\n ...rest\n },\n ref,\n): React.ReactElement => {\n const [isFocused, setIsFocused] = React.useState(false);\n const { colorScheme } = useTheme();\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Card',\n allowedComponents: [ComponentIds.CardHeader, ComponentIds.CardBody, ComponentIds.CardFooter],\n });\n\n const linkOverlayProps: LinkOverlayProps = {\n ...metaAttribute({ name: CARD_LINK_OVERLAY_ID }),\n ...makeAccessible({ label: accessibilityLabel, pressed: href ? undefined : isSelected }),\n onFocus: () => {\n setIsFocused(true);\n },\n onBlur: () => {\n setIsFocused(false);\n },\n };\n const defaultRel = target && target === '_blank' ? 'noreferrer noopener' : undefined;\n\n const checkboxGroupProps = useCheckboxGroupContext();\n const radioGroupProps = useRadioGroupContext();\n\n const getGroupProps = (): CheckboxGroupContextType | RadioGroupContextType | undefined => {\n if (Object.keys(checkboxGroupProps).length > 0) return checkboxGroupProps;\n if (Object.keys(radioGroupProps).length > 0) return radioGroupProps;\n return undefined;\n };\n\n const groupProps = getGroupProps();\n\n const _validationState = groupProps?.validationState;\n\n return (\n <CardProvider size={size}>\n <CardRoot\n as={as}\n ref={ref as never}\n display={'block' as never}\n borderRadius=\"medium\"\n onMouseEnter={onHover as never}\n shouldScaleOnHover={shouldScaleOnHover}\n isSelected={isSelected}\n isFocused={isFocused}\n // on react native we need to pass onClick to root, because we don't need the LinkOverlay in RN\n onClick={isReactNative() ? onClick : undefined}\n width={width}\n height={height}\n minHeight={minHeight}\n minWidth={minWidth}\n maxWidth={maxWidth}\n href={href}\n accessibilityLabel={accessibilityLabel}\n validationState={_validationState}\n cursor={isReactNative() ? undefined : cursor}\n opacity={opacity}\n transition={transition}\n flexShrink={flexShrink}\n {...metaAttribute({ name: MetaConstants.Card, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <CardSurface\n height={height}\n minHeight={minHeight}\n padding={padding}\n borderRadius=\"medium\"\n textAlign={'left' as never}\n backgroundColor=\"surface.background.gray.intense\"\n colorScheme={colorScheme}\n isSelected={isSelected}\n overflow={overflow}\n overflowX={overflowX}\n overflowY={overflowY}\n >\n {href ? (\n <LinkOverlay\n onClick={onClick}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n {...linkOverlayProps}\n />\n ) : null}\n {!href && onClick ? (\n <LinkOverlay as=\"button\" onClick={onClick} {...linkOverlayProps} />\n ) : null}\n {children}\n </CardSurface>\n </CardRoot>\n </CardProvider>\n );\n};\n\ntype CardBodyProps = {\n children: React.ReactNode;\n height?: BoxProps['height'];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardBody = ({ height, children, testID, ...rest }: CardBodyProps): React.ReactElement => {\n useVerifyInsideCard('CardBody');\n\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.CardBody, testID })}\n {...makeAnalyticsAttribute(rest)}\n height={height}\n >\n {children}\n </BaseBox>\n );\n};\n\nconst Card = React.forwardRef(_Card);\nconst CardBody = assignWithoutSideEffects(_CardBody, { componentId: ComponentIds.CardBody });\n\nexport { Card, CardBody };\n"],"names":["ComponentIds","CardHeader","CardHeaderTrailing","CardHeaderLeading","CardFooter","CardFooterTrailing","CardFooterLeading","CardBody","CardHeaderIcon","CardHeaderCounter","CardHeaderBadge","CardHeaderAmount","CardHeaderText","CardHeaderLink","CardHeaderIconButton","_Card","_ref","ref","children","backgroundColor","borderRadius","elevation","testID","_ref$padding","padding","width","height","minHeight","minWidth","maxWidth","onClick","_ref$isSelected","isSelected","accessibilityLabel","_ref$shouldScaleOnHov","shouldScaleOnHover","onHover","href","target","rel","as","_ref$size","size","cursor","opacity","transition","flexShrink","overflow","overflowX","overflowY","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isFocused","setIsFocused","_useTheme","useTheme","colorScheme","useVerifyAllowedChildren","componentName","allowedComponents","linkOverlayProps","Object","assign","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","undefined","onFocus","onBlur","defaultRel","checkboxGroupProps","useCheckboxGroupContext","radioGroupProps","useRadioGroupContext","getGroupProps","keys","length","groupProps","_validationState","validationState","_jsx","CardProvider","CardRoot","display","onMouseEnter","isReactNative","MetaConstants","Card","getStyledProps","makeAnalyticsAttribute","_jsxs","CardSurface","textAlign","LinkOverlay","_CardBody","_ref2","_excluded2","useVerifyInsideCard","BaseBox","forwardRef","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;qXA8Ba,IAAAA,YAAY,CAAG,CAC1BC,UAAU,CAAE,YAAY,CACxBC,kBAAkB,CAAE,oBAAoB,CACxCC,iBAAiB,CAAE,mBAAmB,CACtCC,UAAU,CAAE,YAAY,CACxBC,kBAAkB,CAAE,oBAAoB,CACxCC,iBAAiB,CAAE,mBAAmB,CACtCC,QAAQ,CAAE,UAAU,CACpBC,cAAc,CAAE,gBAAgB,CAChCC,iBAAiB,CAAE,mBAAmB,CACtCC,eAAe,CAAE,iBAAiB,CAClCC,gBAAgB,CAAE,kBAAkB,CACpCC,cAAc,CAAE,gBAAgB,CAChCC,cAAc,CAAE,gBAAgB,CAChCC,oBAAoB,CAAE,sBACxB,EAsKA,IAAMC,KAAiE,CAAG,SAApEA,KAAiEA,CAAAC,IAAA,CAiCrEC,GAAG,CACoB,CAhCrB,IAAAC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAEOF,IAAA,CAAfG,eAAe,CAAAH,IAAA,CACfI,YAA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AI,CAAAC,wBAAA,CAAAqD,KAAA,CAAAC,UAAA,CAAA,CACpDC,mBAAmB,CAAC,UAAU,CAAC,CAE/B,OACEjB,GAAA,CAACkB,OAAO,CAAAxC,MAAA,CAAAC,MAAA,CACFC,EAAAA,CAAAA,aAAa,CAAC,CAAEC,IAAI,CAAEyB,aAAa,CAACxF,QAAQ,CAAEe,MAAM,CAANA,MAAO,CAAC,CAAC,CACvD4E,sBAAsB,CAAChD,IAAI,CAAC,CAAA,CAChCxB,MAAM,CAAEA,MAAO,CAAAR,QAAA,CAEdA,QAAQ,CAAA,CACF,CAAC,CAEd,CAAC,CAEK,IAAA8E,IAAI,CAAG1C,cAAK,CAACsD,UAAU,CAAC7F,KAAK,EAC7B,IAAAR,QAAQ,CAAGsG,wBAAwB,CAACN,SAAS,CAAE,CAAEO,WAAW,CAAE9G,YAAY,CAACO,QAAS,CAAC;;;;"}
@@ -14,7 +14,7 @@ import getIn from '../../../utils/lodashButBetter/get.js';
14
14
  import getTextStyles from '../../Typography/Text/getTextStyles.js';
15
15
  import getHeadingStyles from '../../Typography/Heading/getHeadingStyles.js';
16
16
 
17
- var getBaseInputState=function getBaseInputState(_ref){var isFocused=_ref.isFocused,isHovered=_ref.isHovered,isDisabled=_ref.isDisabled;if(isDisabled){return 'disabled';}else if(isFocused){return 'focused';}else if(isHovered){return 'hovered';}else {return 'default';}};var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles(_ref2){var theme=_ref2.theme,isHovered=_ref2.isHovered,isFocused=_ref2.isFocused,isDisabled=_ref2.isDisabled,validationState=_ref2.validationState,isTextArea=_ref2.isTextArea,isDropdownTrigger=_ref2.isDropdownTrigger,isTableInputCell=_ref2.isTableInputCell,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,borderRadius=_ref2.borderRadius;var backgroundColorTokens=isTableInputCell?baseInputBorderlessBackgroundColor:baseInputBackgroundColor;var backgroundColor=getIn(theme.colors,backgroundColorTokens.default);var borderColor=isTableInputCell?theme.colors.transparent:getIn(theme.colors,baseInputBorderColor.default);var borderWidth=getIn(theme.border.width,baseInputBorderWidth.default);var zIndex;var baseInputState=getBaseInputState({isFocused:isFocused,isHovered:isHovered,isDisabled:isDisabled});backgroundColor=getIn(theme.colors,backgroundColorTokens[baseInputState]);borderColor=isTableInputCell&&baseInputState!=='focused'?theme.colors.transparent:getIn(theme.colors,baseInputBorderColor[baseInputState]);borderWidth=getIn(theme.border.width,baseInputBorderWidth[baseInputState]);if(!isTableInputCell&&validationState&&validationState!=='none'){borderColor=getIn(theme.colors,baseInputBorderColor[validationState]);borderWidth=getIn(theme.border.width,baseInputBorderWidth[validationState]);zIndex=1;}else if(validationState&&validationState!=='none'){backgroundColor=getIn(theme.colors,baseInputBorderlessBackgroundColor[validationState]);}return Object.assign({backgroundColor:backgroundColor,borderRadius:makeBorderSize(isTableInputCell?theme.border.radius.none:theme.border.radius[borderRadius!=null?borderRadius:baseInputBorderRadius[size]]),borderStyle:'solid',display:'flex',flexDirection:'row',width:'100%',alignItems:isTextArea?'flex-start':'center',position:'relative',height:isDropdownTrigger&&!isTextArea?'auto':undefined,border:'none',zIndex:zIndex},getBaseInputBorderStyles({theme:theme,borderColor:borderColor,borderWidth:borderWidth,isFocused:isFocused}));};var getLeftPadding=function getLeftPadding(_ref3){var theme=_ref3.theme,isDropdownTrigger=_ref3.isDropdownTrigger,hasLeadingIcon=_ref3.hasLeadingIcon,hasPrefix=_ref3.hasPrefix,size=_ref3.size,hasLeadingDropdown=_ref3.hasLeadingDropdown,isInsideCounterInput=_ref3.isInsideCounterInput;if(isDropdownTrigger){return theme.spacing[0];}if(hasLeadingIcon||hasPrefix||hasLeadingDropdown){return theme.spacing[3];}if(isInsideCounterInput){return theme.spacing[baseInputCounterInputPaddingTokens.left[size]];}return theme.spacing[baseInputPaddingTokens.left[size]];};var getRightPadding=function getRightPadding(_ref4){var theme=_ref4.theme,hasTrailingInteractionElement=_ref4.hasTrailingInteractionElement,hasSuffix=_ref4.hasSuffix,hasTrailingIcon=_ref4.hasTrailingIcon,size=_ref4.size,isInsideCounterInput=_ref4.isInsideCounterInput;if(hasTrailingInteractionElement||hasSuffix||hasTrailingIcon){return theme.spacing[3];}if(isInsideCounterInput){return theme.spacing[baseInputCounterInputPaddingTokens.right[size]];}return theme.spacing[baseInputPaddingTokens.right[size]];};var getTopPadding=function getTopPadding(_ref5){var theme=_ref5.theme,size=_ref5.size,isInsideCounterInput=_ref5.isInsideCounterInput;if(isInsideCounterInput){return theme.spacing[baseInputCounterInputPaddingTokens.top[size]];}return theme.spacing[baseInputPaddingTokens.top[size]];};var getBottomPadding=function getBottomPadding(_ref6){var theme=_ref6.theme,size=_ref6.size,isInsideCounterInput=_ref6.isInsideCounterInput;if(isInsideCounterInput){return theme.spacing[baseInputCounterInputPaddingTokens.top[size]];}return theme.spacing[baseInputPaddingTokens.bottom[size]];};var getBaseInputStyles=function getBaseInputStyles(_ref7){var theme=_ref7.theme,isDisabled=_ref7.isDisabled,leadingIcon=_ref7.leadingIcon,prefix=_ref7.prefix,trailingInteractionElement=_ref7.trailingInteractionElement,leadingInteractionElement=_ref7.leadingInteractionElement,suffix=_ref7.suffix,trailingIcon=_ref7.trailingIcon,textAlign=_ref7.textAlign,isTextArea=_ref7.isTextArea,hasTags=_ref7.hasTags,isDropdownTrigger=_ref7.isDropdownTrigger,size=_ref7.size,padding=_ref7.padding,valueComponentType=_ref7.valueComponentType,_ref7$hasLeadingDropd=_ref7.hasLeadingDropdown,hasLeadingDropdown=_ref7$hasLeadingDropd===void 0?false:_ref7$hasLeadingDropd,color=_ref7.color,disabledColor=_ref7.disabledColor,isInsideCounterInput=_ref7.isInsideCounterInput;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,size:size}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasTrailingInteractionElement=_getInputVisualsToBeR.hasTrailingInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var isDropdownWithTags=isDropdownTrigger&&hasTags;var isReactNative=getPlatformType()==='react-native';var shouldHaveFlexibleHeight=isTextArea||isDropdownWithTags;return Object.assign({},valueComponentType==='heading'?getHeadingStyles({size:size==='xsmall'?'small':size,weight:'regular',color:isDisabled?'surface.text.gray.disabled':'interactive.text.gray.normal',theme:theme}):getTextStyles({size:isInsideCounterInput&&size==='xsmall'?'small':size,variant:'body',weight:isInsideCounterInput?'semibold':'regular',color:isDisabled?disabledColor!=null?disabledColor:'surface.text.gray.disabled':color!=null?color:'interactive.text.gray.normal',theme:theme}),{flex:1,backgroundColor:theme.colors.transparent,paddingTop:padding!=null?padding:makeSpace(getTopPadding({theme:theme,size:size,isInsideCounterInput:isInsideCounterInput})),paddingBottom:padding!=null?padding:makeSpace(getBottomPadding({theme:theme,size:size,isInsideCounterInput:isInsideCounterInput})),paddingLeft:padding!=null?padding:makeSpace(getLeftPadding({theme:theme,isDropdownTrigger:isDropdownTrigger,hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix,size:size,hasLeadingDropdown:hasLeadingDropdown,isInsideCounterInput:isInsideCounterInput})),paddingRight:padding!=null?padding:getRightPadding({theme:theme,hasTrailingInteractionElement:hasTrailingInteractionElement,hasSuffix:hasSuffix,hasTrailingIcon:hasTrailingIcon,size:size,isInsideCounterInput:isInsideCounterInput}),textAlign:textAlign,width:'100%',height:shouldHaveFlexibleHeight?undefined:makeSpace(baseInputHeight[size]),minHeight:shouldHaveFlexibleHeight?undefined:makeSpace(baseInputHeight[size])},isReactNative?{}:{resize:'none',boxSizing:'border-box'});};var getAnimatedBaseInputWrapperMaxHeight=function getAnimatedBaseInputWrapperMaxHeight(_ref8){var maxTagRows=_ref8.maxTagRows,showAllTags=_ref8.showAllTags,size=_ref8.size;if(maxTagRows==='single'){return baseInputHeight[size];}if(maxTagRows==='multiple'){return baseInputWrapperMaxHeight[size];}return showAllTags?baseInputWrapperMaxHeight[size]:baseInputHeight[size];};
17
+ var getBaseInputState=function getBaseInputState(_ref){var isFocused=_ref.isFocused,isHovered=_ref.isHovered,isDisabled=_ref.isDisabled;if(isDisabled){return 'disabled';}else if(isFocused){return 'focused';}else if(isHovered){return 'hovered';}else {return 'default';}};var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles(_ref2){var theme=_ref2.theme,isHovered=_ref2.isHovered,isFocused=_ref2.isFocused,isDisabled=_ref2.isDisabled,validationState=_ref2.validationState,isTextArea=_ref2.isTextArea,isDropdownTrigger=_ref2.isDropdownTrigger,isTableInputCell=_ref2.isTableInputCell,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,borderRadius=_ref2.borderRadius;var backgroundColorTokens=isTableInputCell?baseInputBorderlessBackgroundColor:baseInputBackgroundColor;var backgroundColor=getIn(theme.colors,backgroundColorTokens.default);var borderColor=isTableInputCell?theme.colors.transparent:getIn(theme.colors,baseInputBorderColor.default);var borderWidth=getIn(theme.border.width,baseInputBorderWidth.default);var zIndex;var baseInputState=getBaseInputState({isFocused:isFocused,isHovered:isHovered,isDisabled:isDisabled});backgroundColor=getIn(theme.colors,backgroundColorTokens[baseInputState]);borderColor=isTableInputCell&&baseInputState!=='focused'?theme.colors.transparent:getIn(theme.colors,baseInputBorderColor[baseInputState]);borderWidth=getIn(theme.border.width,baseInputBorderWidth[baseInputState]);if(!isTableInputCell&&validationState&&validationState!=='none'){borderColor=getIn(theme.colors,baseInputBorderColor[validationState]);borderWidth=getIn(theme.border.width,baseInputBorderWidth[validationState]);zIndex=1;}else if(validationState&&validationState!=='none'){backgroundColor=getIn(theme.colors,baseInputBorderlessBackgroundColor[validationState]);}return Object.assign({backgroundColor:backgroundColor,borderRadius:makeBorderSize(isTableInputCell?theme.border.radius.none:theme.border.radius[borderRadius!=null?borderRadius:baseInputBorderRadius[size]]),overflow:'hidden',borderStyle:'solid',display:'flex',flexDirection:'row',width:'100%',alignItems:isTextArea?'flex-start':'center',position:'relative',height:isDropdownTrigger&&!isTextArea?'auto':undefined,border:'none',zIndex:zIndex},getBaseInputBorderStyles({theme:theme,borderColor:borderColor,borderWidth:borderWidth,isFocused:isFocused}));};var getLeftPadding=function getLeftPadding(_ref3){var theme=_ref3.theme,isDropdownTrigger=_ref3.isDropdownTrigger,hasLeadingIcon=_ref3.hasLeadingIcon,hasPrefix=_ref3.hasPrefix,size=_ref3.size,hasLeadingDropdown=_ref3.hasLeadingDropdown,isInsideCounterInput=_ref3.isInsideCounterInput;if(isDropdownTrigger){return theme.spacing[0];}if(hasLeadingIcon||hasPrefix||hasLeadingDropdown){return theme.spacing[3];}if(isInsideCounterInput){return theme.spacing[baseInputCounterInputPaddingTokens.left[size]];}return theme.spacing[baseInputPaddingTokens.left[size]];};var getRightPadding=function getRightPadding(_ref4){var theme=_ref4.theme,hasTrailingInteractionElement=_ref4.hasTrailingInteractionElement,hasSuffix=_ref4.hasSuffix,hasTrailingIcon=_ref4.hasTrailingIcon,size=_ref4.size,isInsideCounterInput=_ref4.isInsideCounterInput;if(hasTrailingInteractionElement||hasSuffix||hasTrailingIcon){return theme.spacing[3];}if(isInsideCounterInput){return theme.spacing[baseInputCounterInputPaddingTokens.right[size]];}return theme.spacing[baseInputPaddingTokens.right[size]];};var getTopPadding=function getTopPadding(_ref5){var theme=_ref5.theme,size=_ref5.size,isInsideCounterInput=_ref5.isInsideCounterInput;if(isInsideCounterInput){return theme.spacing[baseInputCounterInputPaddingTokens.top[size]];}return theme.spacing[baseInputPaddingTokens.top[size]];};var getBottomPadding=function getBottomPadding(_ref6){var theme=_ref6.theme,size=_ref6.size,isInsideCounterInput=_ref6.isInsideCounterInput;if(isInsideCounterInput){return theme.spacing[baseInputCounterInputPaddingTokens.top[size]];}return theme.spacing[baseInputPaddingTokens.bottom[size]];};var getBaseInputStyles=function getBaseInputStyles(_ref7){var theme=_ref7.theme,isDisabled=_ref7.isDisabled,leadingIcon=_ref7.leadingIcon,prefix=_ref7.prefix,trailingInteractionElement=_ref7.trailingInteractionElement,leadingInteractionElement=_ref7.leadingInteractionElement,suffix=_ref7.suffix,trailingIcon=_ref7.trailingIcon,textAlign=_ref7.textAlign,isTextArea=_ref7.isTextArea,hasTags=_ref7.hasTags,isDropdownTrigger=_ref7.isDropdownTrigger,size=_ref7.size,padding=_ref7.padding,valueComponentType=_ref7.valueComponentType,_ref7$hasLeadingDropd=_ref7.hasLeadingDropdown,hasLeadingDropdown=_ref7$hasLeadingDropd===void 0?false:_ref7$hasLeadingDropd,color=_ref7.color,disabledColor=_ref7.disabledColor,isInsideCounterInput=_ref7.isInsideCounterInput;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,size:size}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasTrailingInteractionElement=_getInputVisualsToBeR.hasTrailingInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var isDropdownWithTags=isDropdownTrigger&&hasTags;var isReactNative=getPlatformType()==='react-native';var shouldHaveFlexibleHeight=isTextArea||isDropdownWithTags;return Object.assign({},valueComponentType==='heading'?getHeadingStyles({size:size==='xsmall'?'small':size,weight:'regular',color:isDisabled?'surface.text.gray.disabled':'interactive.text.gray.normal',theme:theme}):getTextStyles({size:isInsideCounterInput&&size==='xsmall'?'small':size,variant:'body',weight:isInsideCounterInput?'semibold':'regular',color:isDisabled?disabledColor!=null?disabledColor:'surface.text.gray.disabled':color!=null?color:'interactive.text.gray.normal',theme:theme}),{flex:1,backgroundColor:theme.colors.transparent,paddingTop:padding!=null?padding:makeSpace(getTopPadding({theme:theme,size:size,isInsideCounterInput:isInsideCounterInput})),paddingBottom:padding!=null?padding:makeSpace(getBottomPadding({theme:theme,size:size,isInsideCounterInput:isInsideCounterInput})),paddingLeft:padding!=null?padding:makeSpace(getLeftPadding({theme:theme,isDropdownTrigger:isDropdownTrigger,hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix,size:size,hasLeadingDropdown:hasLeadingDropdown,isInsideCounterInput:isInsideCounterInput})),paddingRight:padding!=null?padding:getRightPadding({theme:theme,hasTrailingInteractionElement:hasTrailingInteractionElement,hasSuffix:hasSuffix,hasTrailingIcon:hasTrailingIcon,size:size,isInsideCounterInput:isInsideCounterInput}),textAlign:textAlign,width:'100%',height:shouldHaveFlexibleHeight?undefined:makeSpace(baseInputHeight[size]),minHeight:shouldHaveFlexibleHeight?undefined:makeSpace(baseInputHeight[size])},isReactNative?{}:{resize:'none',boxSizing:'border-box'});};var getAnimatedBaseInputWrapperMaxHeight=function getAnimatedBaseInputWrapperMaxHeight(_ref8){var maxTagRows=_ref8.maxTagRows,showAllTags=_ref8.showAllTags,size=_ref8.size;if(maxTagRows==='single'){return baseInputHeight[size];}if(maxTagRows==='multiple'){return baseInputWrapperMaxHeight[size];}return showAllTags?baseInputWrapperMaxHeight[size]:baseInputHeight[size];};
18
18
 
19
19
  export { getAnimatedBaseInputWrapperMaxHeight, getBaseInputState, getBaseInputStyles, getInputBackgroundAndBorderStyles };
20
20
  //# sourceMappingURL=baseInputStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseInputStyles.js","sources":["../../../../../../src/components/Input/BaseInput/baseInputStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport { getBaseInputBorderStyles } from './getBaseInputBorderStyles';\nimport {\n baseInputBackgroundColor,\n baseInputBorderColor,\n baseInputBorderRadius,\n baseInputBorderWidth,\n baseInputBorderlessBackgroundColor,\n baseInputCounterInputPaddingTokens,\n baseInputHeight,\n baseInputPaddingTokens,\n baseInputWrapperMaxHeight,\n} from './baseInputTokens';\nimport { getInputVisualsToBeRendered } from './BaseInputVisuals';\nimport type { BaseInputWrapperProps } from './types';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { getPlatformType } from '~utils';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { makeSpace } from '~utils/makeSpace';\nimport getHeadingStyles from '~components/Typography/Heading/getHeadingStyles';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\n\ntype GetInputStyles = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'leadingIcon'\n | 'prefix'\n | 'trailingInteractionElement'\n | 'leadingInteractionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'textAlign'\n | 'isDropdownTrigger'\n | 'valueComponentType'\n> & {\n isHovered?: boolean;\n isFocused?: boolean;\n isTextArea?: boolean;\n hasTags?: boolean;\n theme: Theme;\n size: NonNullable<BaseInputProps['size']>;\n padding?: BaseInputProps['padding'];\n borderRadius?: BaseInputProps['borderRadius'];\n isTableInputCell: NonNullable<BaseInputProps['isTableInputCell']>;\n hasLeadingDropdown?: boolean;\n color?: BaseTextProps['color'];\n disabledColor?: BaseTextProps['color'];\n isInsideCounterInput?: boolean;\n};\n\nexport const getBaseInputState = ({\n isFocused,\n isHovered,\n isDisabled,\n}: {\n isFocused?: boolean;\n isHovered?: boolean;\n isDisabled?: boolean;\n}): 'focused' | 'hovered' | 'disabled' | 'default' => {\n if (isDisabled) {\n return 'disabled';\n } else if (isFocused) {\n return 'focused';\n } else if (isHovered) {\n return 'hovered';\n } else {\n return 'default';\n }\n};\n\nexport const getInputBackgroundAndBorderStyles = ({\n theme,\n isHovered,\n isFocused,\n isDisabled,\n validationState,\n isTextArea,\n isDropdownTrigger,\n isTableInputCell,\n size = 'medium',\n borderRadius,\n}: Pick<\n GetInputStyles,\n | 'theme'\n | 'isFocused'\n | 'isDisabled'\n | 'validationState'\n | 'isHovered'\n | 'isTextArea'\n | 'isDropdownTrigger'\n | 'isTableInputCell'\n | 'size'\n | 'borderRadius'\n>): CSSObject => {\n // normal state\n const backgroundColorTokens = isTableInputCell\n ? baseInputBorderlessBackgroundColor\n : baseInputBackgroundColor;\n let backgroundColor = getIn(theme.colors, backgroundColorTokens.default);\n let borderColor = isTableInputCell\n ? theme.colors.transparent\n : getIn(theme.colors, baseInputBorderColor.default);\n let borderWidth = getIn(theme.border.width, baseInputBorderWidth.default);\n let zIndex: number | undefined;\n\n const baseInputState = getBaseInputState({ isFocused, isHovered, isDisabled });\n\n backgroundColor = getIn(theme.colors, backgroundColorTokens[baseInputState]);\n borderColor =\n isTableInputCell && baseInputState !== 'focused'\n ? theme.colors.transparent\n : getIn(theme.colors, baseInputBorderColor[baseInputState]);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth[baseInputState]);\n\n if (!isTableInputCell && validationState && validationState !== 'none') {\n borderColor = getIn(theme.colors, baseInputBorderColor[validationState]);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth[validationState]);\n zIndex = 1; // Prevent validation ring clipping by adjacent inputs in InputGroup\n } else if (validationState && validationState !== 'none') {\n backgroundColor = getIn(theme.colors, baseInputBorderlessBackgroundColor[validationState]);\n }\n return {\n backgroundColor,\n borderRadius: makeBorderSize(\n isTableInputCell\n ? theme.border.radius.none\n : theme.border.radius[borderRadius ?? baseInputBorderRadius[size]],\n ),\n borderStyle: 'solid',\n display: 'flex',\n flexDirection: 'row',\n width: '100%',\n alignItems: isTextArea ? 'flex-start' : 'center',\n position: 'relative',\n height: isDropdownTrigger && !isTextArea ? 'auto' : undefined,\n border: 'none',\n zIndex,\n ...getBaseInputBorderStyles({ theme, borderColor, borderWidth, isFocused }),\n };\n};\n\nconst getLeftPadding = ({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n size,\n hasLeadingDropdown,\n isInsideCounterInput,\n}: {\n theme: Theme;\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n isDropdownTrigger: GetInputStyles['isDropdownTrigger'];\n size: GetInputStyles['size'];\n hasLeadingDropdown: boolean;\n isInsideCounterInput?: boolean;\n}): number => {\n if (isDropdownTrigger) {\n return theme.spacing[0];\n }\n\n if (hasLeadingIcon || hasPrefix || hasLeadingDropdown) {\n return theme.spacing[3];\n }\n\n /**\n * CounterInput uses tighter padding (4px vs 8-12px) for compact design\n */\n if (isInsideCounterInput) {\n return theme.spacing[baseInputCounterInputPaddingTokens.left[size]];\n }\n\n return theme.spacing[baseInputPaddingTokens.left[size]];\n};\n\nconst getRightPadding = ({\n theme,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n isInsideCounterInput,\n}: {\n theme: Theme;\n hasTrailingInteractionElement: boolean;\n hasSuffix: boolean;\n hasTrailingIcon: boolean;\n size: GetInputStyles['size'];\n isInsideCounterInput?: boolean;\n}): number => {\n if (hasTrailingInteractionElement || hasSuffix || hasTrailingIcon) {\n return theme.spacing[3];\n }\n\n // CounterInput uses compact padding\n if (isInsideCounterInput) {\n return theme.spacing[baseInputCounterInputPaddingTokens.right[size]];\n }\n return theme.spacing[baseInputPaddingTokens.right[size]];\n};\n\nconst getTopPadding = ({\n theme,\n size,\n isInsideCounterInput,\n}: {\n theme: Theme;\n size: GetInputStyles['size'];\n isInsideCounterInput?: boolean;\n}): number => {\n // CounterInput uses compact padding\n if (isInsideCounterInput) {\n return theme.spacing[baseInputCounterInputPaddingTokens.top[size]];\n }\n return theme.spacing[baseInputPaddingTokens.top[size]];\n};\n\nconst getBottomPadding = ({\n theme,\n size,\n isInsideCounterInput,\n}: {\n theme: Theme;\n size: GetInputStyles['size'];\n isInsideCounterInput?: boolean;\n}): number => {\n // CounterInput uses compact padding\n if (isInsideCounterInput) {\n return theme.spacing[baseInputCounterInputPaddingTokens.top[size]];\n }\n return theme.spacing[baseInputPaddingTokens.bottom[size]];\n};\n\nexport const getBaseInputStyles = ({\n theme,\n isDisabled,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n textAlign,\n isTextArea,\n hasTags,\n isDropdownTrigger,\n size,\n padding,\n valueComponentType,\n hasLeadingDropdown = false,\n color,\n disabledColor,\n isInsideCounterInput,\n}: GetInputStyles): CSSObject => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n size,\n });\n\n const isDropdownWithTags = isDropdownTrigger && hasTags;\n const isReactNative = getPlatformType() === 'react-native';\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n const shouldHaveFlexibleHeight = isTextArea || isDropdownWithTags;\n\n return {\n ...(valueComponentType === 'heading'\n ? getHeadingStyles({\n size: size === 'xsmall' ? 'small' : size,\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'interactive.text.gray.normal',\n theme,\n })\n : getTextStyles({\n /**\n * CounterInput: uses 'small' size for xsmall and 'semibold' weight for prominence\n */\n size: isInsideCounterInput && size === 'xsmall' ? 'small' : size,\n variant: 'body',\n weight: isInsideCounterInput ? 'semibold' : 'regular',\n color: isDisabled\n ? disabledColor ?? 'surface.text.gray.disabled'\n : color ?? 'interactive.text.gray.normal',\n theme,\n })),\n\n // take the full available width of parent container for input field\n flex: 1,\n backgroundColor: theme.colors.transparent,\n\n paddingTop: padding ?? makeSpace(getTopPadding({ theme, size, isInsideCounterInput })),\n paddingBottom: padding ?? makeSpace(getBottomPadding({ theme, size, isInsideCounterInput })),\n paddingLeft:\n padding ??\n makeSpace(\n getLeftPadding({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n size,\n hasLeadingDropdown,\n isInsideCounterInput,\n }),\n ),\n paddingRight:\n padding ??\n getRightPadding({\n theme,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n isInsideCounterInput,\n }),\n\n textAlign,\n width: '100%',\n height: shouldHaveFlexibleHeight ? undefined : makeSpace(baseInputHeight[size]),\n minHeight: shouldHaveFlexibleHeight ? undefined : makeSpace(baseInputHeight[size]),\n ...(isReactNative ? {} : { resize: 'none', boxSizing: 'border-box' }),\n };\n};\n\nexport const getAnimatedBaseInputWrapperMaxHeight = ({\n maxTagRows,\n showAllTags,\n size,\n}: Pick<BaseInputWrapperProps, 'maxTagRows' | 'showAllTags' | 'size'>): number => {\n if (maxTagRows === 'single') {\n return baseInputHeight[size];\n }\n\n if (maxTagRows === 'multiple') {\n return baseInputWrapperMaxHeight[size];\n }\n\n // In expandable, max-height depends on the state\n return showAllTags ? baseInputWrapperMaxHeight[size] : baseInputHeight[size];\n};\n"],"names":["getBaseInputState","_ref","isFocused","isHovered","isDisabled","getInputBackgroundAndBorderStyles","_ref2","theme","validationState","isTextArea","isDropdownTrigger","isTableInputCell","_ref2$size","size","borderRadius","backgroundColorTokens","baseInputBorderlessBackgroundColor","baseInputBackgroundColor","backgroundColor","getIn","colors","default","borderColor","transparent","baseInputBorderColor","borderWidth","border","width","baseInputBorderWidth","zIndex","baseInputState","Object","assign","makeBorderSize","radius","none","baseInputBorderRadius","borderStyle","display","flexDirection","alignItems","position","height","undefined","getBaseInputBorderStyles","getLeftPadding","_ref3","hasLeadingIcon","hasPrefix","hasLeadingDropdown","isInsideCounterInput","spacing","baseInputCounterInputPaddingTokens","left","baseInputPaddingTokens","getRightPadding","_ref4","hasTrailingInteractionElement","hasSuffix","hasTrailingIcon","right","getTopPadding","_ref5","top","getBottomPadding","_ref6","bottom","getBaseInputStyles","_ref7","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","textAlign","hasTags","padding","valueComponentType","_ref7$hasLeadingDropd","color","disabledColor","_getInputVisualsToBeR","getInputVisualsToBeRendered","isDropdownWithTags","isReactNative","getPlatformType","shouldHaveFlexibleHeight","getHeadingStyles","weight","getTextStyles","variant","flex","paddingTop","makeSpace","paddingBottom","paddingLeft","paddingRight","baseInputHeight","minHeight","resize","boxSizing","getAnimatedBaseInputWrapperMaxHeight","_ref8","maxTagRows","showAllTags","baseInputWrapperMaxHeight"],"mappings":";;;;;;;;;;;;;;;;AAsDa,IAAAA,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,IAAA,CAQwB,CAAA,IAPpDC,SAAS,CAAAD,IAAA,CAATC,SAAS,CACTC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CAMV,GAAIA,UAAU,CAAE,CACd,OAAO,UAAU,CACnB,CAAC,KAAM,GAAIF,SAAS,CAAE,CACpB,OAAO,SAAS,CAClB,CAAC,QAAUC,SAAS,CAAE,CACpB,OAAO,SAAS,CAClB,CAAC,KAAM,CACL,OAAO,SAAS,CAClB,CACF,EAEa,IAAAE,iCAAiC,CAAG,SAApCA,iCAAiCA,CAAAC,KAAA,CAuB7B,CAAA,IAtBfC,KAAK,CAAAD,KAAA,CAALC,KAAK,CACLJ,SAAS,CAAAG,KAAA,CAATH,SAAS,CACTD,SAAS,CAAAI,KAAA,CAATJ,SAAS,CACTE,UAAU,CAAAE,KAAA,CAAVF,UAAU,CACVI,eAAe,CAAAF,KAAA,CAAfE,eAAe,CACfC,UAAU,CAAAH,KAAA,CAAVG,UAAU,CACVC,iBAAiB,CAAAJ,KAAA,CAAjBI,iBAAiB,CACjBC,gBAAgB,CAAAL,KAAA,CAAhBK,gBAAgB,CAAAC,UAAA,CAAAN,KAAA,CAChBO,IAAI,CAAJA,IAAI,CAAAD,UAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,UAAA,CACfE,YAAY,CAAAR,KAAA,CAAZQ,YAAY,CAeZ,IAAMC,qBAAqB,CAAGJ,gBAAgB,CAC1CK,kCAAkC,CAClCC,wBAAwB,CAC5B,IAAIC,eAAe,CAAGC,KAAK,CAACZ,KAAK,CAACa,MAAM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CAATA,SAAS,CACTC,eAAe,CAAfA,eAAe,CACf9C,IAAI,CAAJA,IAAI,CACJqC,oBAAoB,CAApBA,oBACF,CAAC,CAAC,CAEJyB,SAAS,CAATA,SAAS,CACThD,KAAK,CAAE,MAAM,CACbe,MAAM,CAAE6C,wBAAwB,CAAG5C,SAAS,CAAGmD,SAAS,CAACI,eAAe,CAACrF,IAAI,CAAC,CAAC,CAC/EsF,SAAS,CAAEZ,wBAAwB,CAAG5C,SAAS,CAAGmD,SAAS,CAACI,eAAe,CAACrF,IAAI,CAAC,CAAC,CAC9EwE,CAAAA,aAAa,CAAG,EAAE,CAAG,CAAEe,MAAM,CAAE,MAAM,CAAEC,SAAS,CAAE,YAAa,CAAC,EAExE,EAEa,IAAAC,oCAAoC,CAAG,SAAvCA,oCAAoCA,CAAAC,KAAA,CAIiC,KAHhFC,UAAU,CAAAD,KAAA,CAAVC,UAAU,CACVC,WAAW,CAAAF,KAAA,CAAXE,WAAW,CACX5F,IAAI,CAAA0F,KAAA,CAAJ1F,IAAI,CAEJ,GAAI2F,UAAU,GAAK,QAAQ,CAAE,CAC3B,OAAON,eAAe,CAACrF,IAAI,CAAC,CAC9B,CAEA,GAAI2F,UAAU,GAAK,UAAU,CAAE,CAC7B,OAAOE,yBAAyB,CAAC7F,IAAI,CAAC,CACxC,CAGA,OAAO4F,WAAW,CAAGC,yBAAyB,CAAC7F,IAAI,CAAC,CAAGqF,eAAe,CAACrF,IAAI,CAAC,CAC9E;;;;"}
1
+ {"version":3,"file":"baseInputStyles.js","sources":["../../../../../../src/components/Input/BaseInput/baseInputStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport { getBaseInputBorderStyles } from './getBaseInputBorderStyles';\nimport {\n baseInputBackgroundColor,\n baseInputBorderColor,\n baseInputBorderRadius,\n baseInputBorderWidth,\n baseInputBorderlessBackgroundColor,\n baseInputCounterInputPaddingTokens,\n baseInputHeight,\n baseInputPaddingTokens,\n baseInputWrapperMaxHeight,\n} from './baseInputTokens';\nimport { getInputVisualsToBeRendered } from './BaseInputVisuals';\nimport type { BaseInputWrapperProps } from './types';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { getPlatformType } from '~utils';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { makeSpace } from '~utils/makeSpace';\nimport getHeadingStyles from '~components/Typography/Heading/getHeadingStyles';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\n\ntype GetInputStyles = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'leadingIcon'\n | 'prefix'\n | 'trailingInteractionElement'\n | 'leadingInteractionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'textAlign'\n | 'isDropdownTrigger'\n | 'valueComponentType'\n> & {\n isHovered?: boolean;\n isFocused?: boolean;\n isTextArea?: boolean;\n hasTags?: boolean;\n theme: Theme;\n size: NonNullable<BaseInputProps['size']>;\n padding?: BaseInputProps['padding'];\n borderRadius?: BaseInputProps['borderRadius'];\n isTableInputCell: NonNullable<BaseInputProps['isTableInputCell']>;\n hasLeadingDropdown?: boolean;\n color?: BaseTextProps['color'];\n disabledColor?: BaseTextProps['color'];\n isInsideCounterInput?: boolean;\n};\n\nexport const getBaseInputState = ({\n isFocused,\n isHovered,\n isDisabled,\n}: {\n isFocused?: boolean;\n isHovered?: boolean;\n isDisabled?: boolean;\n}): 'focused' | 'hovered' | 'disabled' | 'default' => {\n if (isDisabled) {\n return 'disabled';\n } else if (isFocused) {\n return 'focused';\n } else if (isHovered) {\n return 'hovered';\n } else {\n return 'default';\n }\n};\n\nexport const getInputBackgroundAndBorderStyles = ({\n theme,\n isHovered,\n isFocused,\n isDisabled,\n validationState,\n isTextArea,\n isDropdownTrigger,\n isTableInputCell,\n size = 'medium',\n borderRadius,\n}: Pick<\n GetInputStyles,\n | 'theme'\n | 'isFocused'\n | 'isDisabled'\n | 'validationState'\n | 'isHovered'\n | 'isTextArea'\n | 'isDropdownTrigger'\n | 'isTableInputCell'\n | 'size'\n | 'borderRadius'\n>): CSSObject => {\n // normal state\n const backgroundColorTokens = isTableInputCell\n ? baseInputBorderlessBackgroundColor\n : baseInputBackgroundColor;\n let backgroundColor = getIn(theme.colors, backgroundColorTokens.default);\n let borderColor = isTableInputCell\n ? theme.colors.transparent\n : getIn(theme.colors, baseInputBorderColor.default);\n let borderWidth = getIn(theme.border.width, baseInputBorderWidth.default);\n let zIndex: number | undefined;\n\n const baseInputState = getBaseInputState({ isFocused, isHovered, isDisabled });\n\n backgroundColor = getIn(theme.colors, backgroundColorTokens[baseInputState]);\n borderColor =\n isTableInputCell && baseInputState !== 'focused'\n ? theme.colors.transparent\n : getIn(theme.colors, baseInputBorderColor[baseInputState]);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth[baseInputState]);\n\n if (!isTableInputCell && validationState && validationState !== 'none') {\n borderColor = getIn(theme.colors, baseInputBorderColor[validationState]);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth[validationState]);\n zIndex = 1; // Prevent validation ring clipping by adjacent inputs in InputGroup\n } else if (validationState && validationState !== 'none') {\n backgroundColor = getIn(theme.colors, baseInputBorderlessBackgroundColor[validationState]);\n }\n return {\n backgroundColor,\n borderRadius: makeBorderSize(\n isTableInputCell\n ? theme.border.radius.none\n : theme.border.radius[borderRadius ?? baseInputBorderRadius[size]],\n ),\n overflow: 'hidden',\n borderStyle: 'solid',\n display: 'flex',\n flexDirection: 'row',\n width: '100%',\n alignItems: isTextArea ? 'flex-start' : 'center',\n position: 'relative',\n height: isDropdownTrigger && !isTextArea ? 'auto' : undefined,\n border: 'none',\n zIndex,\n ...getBaseInputBorderStyles({ theme, borderColor, borderWidth, isFocused }),\n };\n};\n\nconst getLeftPadding = ({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n size,\n hasLeadingDropdown,\n isInsideCounterInput,\n}: {\n theme: Theme;\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n isDropdownTrigger: GetInputStyles['isDropdownTrigger'];\n size: GetInputStyles['size'];\n hasLeadingDropdown: boolean;\n isInsideCounterInput?: boolean;\n}): number => {\n if (isDropdownTrigger) {\n return theme.spacing[0];\n }\n\n if (hasLeadingIcon || hasPrefix || hasLeadingDropdown) {\n return theme.spacing[3];\n }\n\n /**\n * CounterInput uses tighter padding (4px vs 8-12px) for compact design\n */\n if (isInsideCounterInput) {\n return theme.spacing[baseInputCounterInputPaddingTokens.left[size]];\n }\n\n return theme.spacing[baseInputPaddingTokens.left[size]];\n};\n\nconst getRightPadding = ({\n theme,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n isInsideCounterInput,\n}: {\n theme: Theme;\n hasTrailingInteractionElement: boolean;\n hasSuffix: boolean;\n hasTrailingIcon: boolean;\n size: GetInputStyles['size'];\n isInsideCounterInput?: boolean;\n}): number => {\n if (hasTrailingInteractionElement || hasSuffix || hasTrailingIcon) {\n return theme.spacing[3];\n }\n\n // CounterInput uses compact padding\n if (isInsideCounterInput) {\n return theme.spacing[baseInputCounterInputPaddingTokens.right[size]];\n }\n return theme.spacing[baseInputPaddingTokens.right[size]];\n};\n\nconst getTopPadding = ({\n theme,\n size,\n isInsideCounterInput,\n}: {\n theme: Theme;\n size: GetInputStyles['size'];\n isInsideCounterInput?: boolean;\n}): number => {\n // CounterInput uses compact padding\n if (isInsideCounterInput) {\n return theme.spacing[baseInputCounterInputPaddingTokens.top[size]];\n }\n return theme.spacing[baseInputPaddingTokens.top[size]];\n};\n\nconst getBottomPadding = ({\n theme,\n size,\n isInsideCounterInput,\n}: {\n theme: Theme;\n size: GetInputStyles['size'];\n isInsideCounterInput?: boolean;\n}): number => {\n // CounterInput uses compact padding\n if (isInsideCounterInput) {\n return theme.spacing[baseInputCounterInputPaddingTokens.top[size]];\n }\n return theme.spacing[baseInputPaddingTokens.bottom[size]];\n};\n\nexport const getBaseInputStyles = ({\n theme,\n isDisabled,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n textAlign,\n isTextArea,\n hasTags,\n isDropdownTrigger,\n size,\n padding,\n valueComponentType,\n hasLeadingDropdown = false,\n color,\n disabledColor,\n isInsideCounterInput,\n}: GetInputStyles): CSSObject => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n size,\n });\n\n const isDropdownWithTags = isDropdownTrigger && hasTags;\n const isReactNative = getPlatformType() === 'react-native';\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n const shouldHaveFlexibleHeight = isTextArea || isDropdownWithTags;\n\n return {\n ...(valueComponentType === 'heading'\n ? getHeadingStyles({\n size: size === 'xsmall' ? 'small' : size,\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'interactive.text.gray.normal',\n theme,\n })\n : getTextStyles({\n /**\n * CounterInput: uses 'small' size for xsmall and 'semibold' weight for prominence\n */\n size: isInsideCounterInput && size === 'xsmall' ? 'small' : size,\n variant: 'body',\n weight: isInsideCounterInput ? 'semibold' : 'regular',\n color: isDisabled\n ? disabledColor ?? 'surface.text.gray.disabled'\n : color ?? 'interactive.text.gray.normal',\n theme,\n })),\n\n // take the full available width of parent container for input field\n flex: 1,\n backgroundColor: theme.colors.transparent,\n\n paddingTop: padding ?? makeSpace(getTopPadding({ theme, size, isInsideCounterInput })),\n paddingBottom: padding ?? makeSpace(getBottomPadding({ theme, size, isInsideCounterInput })),\n paddingLeft:\n padding ??\n makeSpace(\n getLeftPadding({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n size,\n hasLeadingDropdown,\n isInsideCounterInput,\n }),\n ),\n paddingRight:\n padding ??\n getRightPadding({\n theme,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n isInsideCounterInput,\n }),\n\n textAlign,\n width: '100%',\n height: shouldHaveFlexibleHeight ? undefined : makeSpace(baseInputHeight[size]),\n minHeight: shouldHaveFlexibleHeight ? undefined : makeSpace(baseInputHeight[size]),\n ...(isReactNative ? {} : { resize: 'none', boxSizing: 'border-box' }),\n };\n};\n\nexport const getAnimatedBaseInputWrapperMaxHeight = ({\n maxTagRows,\n showAllTags,\n size,\n}: Pick<BaseInputWrapperProps, 'maxTagRows' | 'showAllTags' | 'size'>): number => {\n if (maxTagRows === 'single') {\n return baseInputHeight[size];\n }\n\n if (maxTagRows === 'multiple') {\n return baseInputWrapperMaxHeight[size];\n }\n\n // In expandable, max-height depends on the state\n return showAllTags ? baseInputWrapperMaxHeight[size] : baseInputHeight[size];\n};\n"],"names":["getBaseInputState","_ref","isFocused","isHovered","isDisabled","getInputBackgroundAndBorderStyles","_ref2","theme","validationState","isTextArea","isDropdownTrigger","isTableInputCell","_ref2$size","size","borderRadius","backgroundColorTokens","baseInputBorderlessBackgroundColor","baseInputBackgroundColor","backgroundColor","getIn","colors","default","borderColor","transparent","baseInputBorderColor","borderWidth","border","width","baseInputBorderWidth","zIndex","baseInputState","Object","assign","makeBorderSize","radius","none","baseInputBorderRadius","overflow","borderStyle","display","flexDirection","alignItems","position","height","undefined","getBaseInputBorderStyles","getLeftPadding","_ref3","hasLeadingIcon","hasPrefix","hasLeadingDropdown","isInsideCounterInput","spacing","baseInputCounterInputPaddingTokens","left","baseInputPaddingTokens","getRightPadding","_ref4","hasTrailingInteractionElement","hasSuffix","hasTrailingIcon","right","getTopPadding","_ref5","top","getBottomPadding","_ref6","bottom","getBaseInputStyles","_ref7","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","textAlign","hasTags","padding","valueComponentType","_ref7$hasLeadingDropd","color","disabledColor","_getInputVisualsToBeR","getInputVisualsToBeRendered","isDropdownWithTags","isReactNative","getPlatformType","shouldHaveFlexibleHeight","getHeadingStyles","weight","getTextStyles","variant","flex","paddingTop","makeSpace","paddingBottom","paddingLeft","paddingRight","baseInputHeight","minHeight","resize","boxSizing","getAnimatedBaseInputWrapperMaxHeight","_ref8","maxTagRows","showAllTags","baseInputWrapperMaxHeight"],"mappings":";;;;;;;;;;;;;;;;AAsDa,IAAAA,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,IAAA,CAQwB,CAAA,IAPpDC,SAAS,CAAAD,IAAA,CAATC,SAAS,CACTC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CAMV,GAAIA,UAAU,CAAE,CACd,OAAO,UAAU,CACnB,CAAC,KAAM,GAAIF,SAAS,CAAE,CACpB,OAAO,SAAS,CAClB,CAAC,QAAUC,SAAS,CAAE,CACpB,OAAO,SAAS,CAClB,CAAC,KAAM,CACL,OAAO,SAAS,CAClB,CACF,EAEa,IAAAE,iCAAiC,CAAG,SAApCA,iCAAiCA,CAAAC,KAAA,CAuB7B,CAAA,IAtBfC,KAAK,CAAAD,KAAA,CAALC,KAAK,CACLJ,SAAS,CAAAG,KAAA,CAATH,SAAS,CACTD,SAAS,CAAAI,KAAA,CAATJ,SAAS,CACTE,UAAU,CAAAE,KAAA,CAAVF,UAAU,CACVI,eAAe,CAAAF,KAAA,CAAfE,eAAe,CACfC,UAAU,CAAAH,KAAA,CAAVG,UAAU,CACVC,iBAAiB,CAAAJ,KAAA,CAAjBI,iBAAiB,CACjBC,gBAAgB,CAAAL,KAAA,CAAhBK,gBAAgB,CAAAC,UAAA,CAAAN,KAAA,CAChBO,IAAI,CAAJA,IAAI,CAAAD,UAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,UAAA,CACfE,YAAY,CAAAR,KAAA,CAAZQ,YAAY,CAeZ,IAAMC,qBAAqB,CAAGJ,gBAAgB,CAC1CK,kCAAkC,CAClCC,wBAAwB,CAC5B,IAAIC,eAAe,CAAGC,KAAK,CAACZ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CAALA,KAAK,CACLmD,6BAA6B,CAA7BA,6BAA6B,CAC7BC,SAAS,CAATA,SAAS,CACTC,eAAe,CAAfA,eAAe,CACf/C,IAAI,CAAJA,IAAI,CACJsC,oBAAoB,CAApBA,oBACF,CAAC,CAAC,CAEJyB,SAAS,CAATA,SAAS,CACTjD,KAAK,CAAE,MAAM,CACbgB,MAAM,CAAE6C,wBAAwB,CAAG5C,SAAS,CAAGmD,SAAS,CAACI,eAAe,CAACtF,IAAI,CAAC,CAAC,CAC/EuF,SAAS,CAAEZ,wBAAwB,CAAG5C,SAAS,CAAGmD,SAAS,CAACI,eAAe,CAACtF,IAAI,CAAC,CAAC,CAAA,CAC9EyE,aAAa,CAAG,EAAE,CAAG,CAAEe,MAAM,CAAE,MAAM,CAAEC,SAAS,CAAE,YAAa,CAAC,EAExE,EAEa,IAAAC,oCAAoC,CAAG,SAAvCA,oCAAoCA,CAAAC,KAAA,CAIiC,KAHhFC,UAAU,CAAAD,KAAA,CAAVC,UAAU,CACVC,WAAW,CAAAF,KAAA,CAAXE,WAAW,CACX7F,IAAI,CAAA2F,KAAA,CAAJ3F,IAAI,CAEJ,GAAI4F,UAAU,GAAK,QAAQ,CAAE,CAC3B,OAAON,eAAe,CAACtF,IAAI,CAAC,CAC9B,CAEA,GAAI4F,UAAU,GAAK,UAAU,CAAE,CAC7B,OAAOE,yBAAyB,CAAC9F,IAAI,CAAC,CACxC,CAGA,OAAO6F,WAAW,CAAGC,yBAAyB,CAAC9F,IAAI,CAAC,CAAGsF,eAAe,CAACtF,IAAI,CAAC,CAC9E;;;;"}
@@ -30,6 +30,10 @@ float vnoise(vec2 p) {
30
30
  }
31
31
 
32
32
  void main() {
33
+ // Envelope controls: how the gradient fades from center outward
34
+ const float FADE_OUTER_EDGE = 1.4; // distance where gradient fully fades to black
35
+ const float FADE_INNER_EDGE = 0.4; // distance where gradient is at full opacity
36
+
33
37
  vec2 uv = vUv - uOrigin;
34
38
  float angle = atan(uv.y, uv.x);
35
39
  float r = length(uv);
@@ -57,9 +61,12 @@ void main() {
57
61
  float phase = w * 0.5 + 0.5;
58
62
  vec3 color = gradientColor(phase);
59
63
 
60
- float envelope = smoothstep(0.75, 0.42, r);
61
- float centerFill = smoothstep(0.06, 0.0, r);
62
- color = mix(color * envelope, gradientColor(0.0), centerFill);
64
+ float envelope = smoothstep(FADE_OUTER_EDGE, FADE_INNER_EDGE, r);
65
+ color = color * envelope;
66
+
67
+ // Film grain effect
68
+ float grain = hash(vUv * 500.0 + fract(uTime * 0.5)) * 2.0 - 1.0;
69
+ color += grain * 0.0002;
63
70
 
64
71
  gl_FragColor = vec4(color, 1.0);
65
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shader.js","sources":["../../../../../../src/components/Spark/RazorSenseGradient/shader.ts"],"sourcesContent":["export const FLUID_GRADIENT_LOOP = 12.0;\n\n// vec3 c0 = vec3(0.55, 0.95, 0.75);\n// vec3 c1 = vec3(0.35, 0.90, 0.65);\n// vec3 c2 = vec3(0.20, 0.88, 0.70);\n// vec3 c3 = vec3(0.08, 0.82, 0.48);\n// vec3 c4 = vec3(0.04, 0.68, 0.30);\n\n// vec3 c0 = vec3(0.72, 0.92, 1.00); // light sky blue\n// vec3 c1 = vec3(0.38, 0.72, 0.98); // cornflower blue\n// vec3 c2 = vec3(0.16, 0.50, 0.92); // medium blue\n// vec3 c3 = vec3(0.08, 0.30, 0.78); // deep royal blue\n// vec3 c4 = vec3(0.10, 0.28, 0.72); // deep blue (not black)\n\nexport const fragmentShader = /* glsl */ `\nprecision mediump float;\n\nuniform float uTime; // pre-wrapped: mod(raw, LOOP)\nuniform vec2 iResolution;\nuniform vec2 uOrigin; // gradient origin in UV space (0,0)=top-left (1,1)=bottom-right\nvarying vec2 vUv;\n\n// Cubic smoothstep inside each segment — no kink at stop boundaries\nvec3 gradientColor(float t) {\n t = clamp(t, 0.0, 1.0);\n vec3 c0 = vec3(0.682, 0.957, 0.831); // 174, 244, 212\n vec3 c1 = vec3(0.310, 0.882, 0.620); // 79, 225, 158\n vec3 c2 = vec3(0.306, 0.973, 0.910); // 78, 248, 232\n vec3 c3 = vec3(0.004, 0.753, 0.443); // 1, 192, 113\n vec3 c4 = vec3(0.004, 0.753, 0.443); // 1, 192, 113\n float s;\n if (t < 0.25) { s = smoothstep(0.0,1.0, t/0.25); return mix(c0,c1,s); }\n if (t < 0.55) { s = smoothstep(0.0,1.0,(t-0.25)/0.30); return mix(c1,c2,s); }\n if (t < 0.80) { s = smoothstep(0.0,1.0,(t-0.55)/0.25); return mix(c2,c3,s); }\n s = smoothstep(0.0,1.0,(t-0.80)/0.20); return mix(c3,c4,s);\n}\n\n// Value noise\nfloat hash(vec2 p) { return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453); }\nfloat vnoise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n vec2 u = f*f*(3.0-2.0*f);\n return mix(mix(hash(i),hash(i+vec2(1,0)),u.x), mix(hash(i+vec2(0,1)),hash(i+vec2(1,1)),u.x),u.y);\n}\n\nvoid main() {\n vec2 uv = vUv - uOrigin;\n float angle = atan(uv.y, uv.x);\n float r = length(uv);\n\n // Warp: traces a circle in noise space → exactly periodic in LOOP seconds.\n // speed = 2π * n / LOOP (n integer → 1 full orbit per loop)\n float ws = 6.2832 / 12.0; // 2π/LOOP — 1 orbit in LOOP s\n float ws2 = ws * 2.0; // 2 orbits in LOOP s\n float warp =\n vnoise(vec2(cos(angle)*1.4 + sin(uTime*ws )*2.0, sin(angle)*1.4 + cos(uTime*ws )*2.0)) * 0.50 +\n vnoise(vec2(cos(angle)*2.6 + sin(uTime*ws2)*1.2, sin(angle)*2.6 + cos(uTime*ws2)*1.2)) * 0.25;\n float organicR = r + (warp - 0.45) * 0.04;\n\n // Three wave sines — speeds are 2π*n/LOOP (n=3,2,1) → integer cycles in LOOP s.\n // Spatial frequencies are irrational ratios so they never phase-lock into\n // distinct bands; the result is one broad, shifting swell.\n float s1 = 6.2832 * 3.0 / 12.0; // 3 cycles in LOOP s\n float s2 = 6.2832 * 2.0 / 12.0; // 2 cycles\n float s3 = 6.2832 * 1.0 / 12.0; // 1 cycle\n float w =\n sin(organicR * 4.80 - uTime * s1) * 0.55 +\n sin(organicR * 2.55 - uTime * s2) * 0.30 +\n sin(organicR * 1.45 - uTime * s3) * 0.15;\n\n float phase = w * 0.5 + 0.5;\n vec3 color = gradientColor(phase);\n\n float envelope = smoothstep(0.75, 0.42, r);\n float centerFill = smoothstep(0.06, 0.0, r);\n color = mix(color * envelope, gradientColor(0.0), centerFill);\n\n gl_FragColor = vec4(color, 1.0);\n}\n`;\n"],"names":["FLUID_GRADIENT_LOOP","fragmentShader"],"mappings":"AAAa,IAAAA,mBAAmB,CAAG,KActB,IAAAC,cAAc,CAAc,CAAA;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"shader.js","sources":["../../../../../../src/components/Spark/RazorSenseGradient/shader.ts"],"sourcesContent":["export const FLUID_GRADIENT_LOOP = 12.0;\n\n// vec3 c0 = vec3(0.55, 0.95, 0.75);\n// vec3 c1 = vec3(0.35, 0.90, 0.65);\n// vec3 c2 = vec3(0.20, 0.88, 0.70);\n// vec3 c3 = vec3(0.08, 0.82, 0.48);\n// vec3 c4 = vec3(0.04, 0.68, 0.30);\n\n// vec3 c0 = vec3(0.72, 0.92, 1.00); // light sky blue\n// vec3 c1 = vec3(0.38, 0.72, 0.98); // cornflower blue\n// vec3 c2 = vec3(0.16, 0.50, 0.92); // medium blue\n// vec3 c3 = vec3(0.08, 0.30, 0.78); // deep royal blue\n// vec3 c4 = vec3(0.10, 0.28, 0.72); // deep blue (not black)\n\nexport const fragmentShader = /* glsl */ `\nprecision mediump float;\n\nuniform float uTime; // pre-wrapped: mod(raw, LOOP)\nuniform vec2 iResolution;\nuniform vec2 uOrigin; // gradient origin in UV space (0,0)=top-left (1,1)=bottom-right\nvarying vec2 vUv;\n\n// Cubic smoothstep inside each segment — no kink at stop boundaries\nvec3 gradientColor(float t) {\n t = clamp(t, 0.0, 1.0);\n vec3 c0 = vec3(0.682, 0.957, 0.831); // 174, 244, 212\n vec3 c1 = vec3(0.310, 0.882, 0.620); // 79, 225, 158\n vec3 c2 = vec3(0.306, 0.973, 0.910); // 78, 248, 232\n vec3 c3 = vec3(0.004, 0.753, 0.443); // 1, 192, 113\n vec3 c4 = vec3(0.004, 0.753, 0.443); // 1, 192, 113\n float s;\n if (t < 0.25) { s = smoothstep(0.0,1.0, t/0.25); return mix(c0,c1,s); }\n if (t < 0.55) { s = smoothstep(0.0,1.0,(t-0.25)/0.30); return mix(c1,c2,s); }\n if (t < 0.80) { s = smoothstep(0.0,1.0,(t-0.55)/0.25); return mix(c2,c3,s); }\n s = smoothstep(0.0,1.0,(t-0.80)/0.20); return mix(c3,c4,s);\n}\n\n// Value noise\nfloat hash(vec2 p) { return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453); }\nfloat vnoise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n vec2 u = f*f*(3.0-2.0*f);\n return mix(mix(hash(i),hash(i+vec2(1,0)),u.x), mix(hash(i+vec2(0,1)),hash(i+vec2(1,1)),u.x),u.y);\n}\n\nvoid main() {\n // Envelope controls: how the gradient fades from center outward\n const float FADE_OUTER_EDGE = 1.4; // distance where gradient fully fades to black\n const float FADE_INNER_EDGE = 0.4; // distance where gradient is at full opacity\n\n vec2 uv = vUv - uOrigin;\n float angle = atan(uv.y, uv.x);\n float r = length(uv);\n\n // Warp: traces a circle in noise space → exactly periodic in LOOP seconds.\n // speed = 2π * n / LOOP (n integer → 1 full orbit per loop)\n float ws = 6.2832 / 12.0; // 2π/LOOP — 1 orbit in LOOP s\n float ws2 = ws * 2.0; // 2 orbits in LOOP s\n float warp =\n vnoise(vec2(cos(angle)*1.4 + sin(uTime*ws )*2.0, sin(angle)*1.4 + cos(uTime*ws )*2.0)) * 0.50 +\n vnoise(vec2(cos(angle)*2.6 + sin(uTime*ws2)*1.2, sin(angle)*2.6 + cos(uTime*ws2)*1.2)) * 0.25;\n float organicR = r + (warp - 0.45) * 0.04;\n\n // Three wave sines — speeds are 2π*n/LOOP (n=3,2,1) → integer cycles in LOOP s.\n // Spatial frequencies are irrational ratios so they never phase-lock into\n // distinct bands; the result is one broad, shifting swell.\n float s1 = 6.2832 * 3.0 / 12.0; // 3 cycles in LOOP s\n float s2 = 6.2832 * 2.0 / 12.0; // 2 cycles\n float s3 = 6.2832 * 1.0 / 12.0; // 1 cycle\n float w =\n sin(organicR * 4.80 - uTime * s1) * 0.55 +\n sin(organicR * 2.55 - uTime * s2) * 0.30 +\n sin(organicR * 1.45 - uTime * s3) * 0.15;\n\n float phase = w * 0.5 + 0.5;\n vec3 color = gradientColor(phase);\n\n float envelope = smoothstep(FADE_OUTER_EDGE, FADE_INNER_EDGE, r);\n color = color * envelope;\n\n // Film grain effect\n float grain = hash(vUv * 500.0 + fract(uTime * 0.5)) * 2.0 - 1.0;\n color += grain * 0.0002;\n\n gl_FragColor = vec4(color, 1.0);\n}\n`;\n"],"names":["FLUID_GRADIENT_LOOP","fragmentShader"],"mappings":"AAAa,IAAAA,mBAAmB,CAAG,KActB,IAAAC,cAAc,CAAc,CAAA;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -2,12 +2,13 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
3
3
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
- import { forwardRef, useState, useRef, useEffect, useCallback } from 'react';
5
+ import { forwardRef, useState, useRef, useEffect } from 'react';
6
6
  import { RzpGlassMount } from './RzpGlassMount.js';
7
- import { getPresets } from './presets.js';
7
+ import { getPresetAssets, resolveConfig, DEFAULT_CDN_PATH, getDefaultAssets } from './utils.js';
8
+ import { useMergeRefs } from '../../../utils/useMergeRefs.js';
8
9
  import { jsx } from 'react/jsx-runtime';
9
10
 
10
- var _excluded=["width","height","className","style","onLoad","onError","preset","assetsPath","gradientMapSrc","gradientMap2Src","gradientMapCanvas","imageSrc"],_excluded2=["width","height","className","style","onLoad","onError","assetsPath","gradientMapCanvas","gradientMapSrc","gradientMap2Src","imageSrc"];var FADE_IN_MS=200;var DEFAULT_CDN_PATH='https://cdn.jsdelivr.net/npm/@razorpay/blade/assets/spark';var getDefaultAssets=function getDefaultAssets(assetsPath){return {videoSrc:`${assetsPath}/spark-base-video.mp4`,imageSrc:`${assetsPath}/bottom-frame.jpg`,gradientMapSrc:`${assetsPath}/colorama-gradient-map-green.jpg`,gradientMap2Src:`${assetsPath}/colorama-gradient-map-blue.jpg`,centerGradientMapSrc:`${assetsPath}/colorama-center-gradient-map.jpg`};};function useMergeRefs(refs){return useCallback(function(value){refs.forEach(function(ref){if(typeof ref==='function'){ref(value);}else if(ref!=null){ref.current=value;}});},[refs]);}function extractConfig(props){props.width;props.height;props.className;props.style;props.onLoad;props.onError;props.preset;props.assetsPath;props.gradientMapSrc;props.gradientMap2Src;props.gradientMapCanvas;props.imageSrc;var config=_objectWithoutProperties(props,_excluded);return Object.fromEntries(Object.entries(config).filter(function(_ref){var _ref2=_slicedToArray(_ref,2),v=_ref2[1];return v!==undefined;}));}var ASSET_KEYS=new Set(['videoSrc','imageSrc','gradientMapSrc','gradientMap2Src','centerGradientMapSrc']);function getPresetDefinition(preset,assetsPath){var presets=getPresets(assetsPath);if(preset&&preset in presets)return Object.assign({},presets[preset]);return {};}function getPresetConfig(preset,assetsPath){var def=getPresetDefinition(preset,assetsPath);return Object.fromEntries(Object.entries(def).filter(function(_ref3){var _ref4=_slicedToArray(_ref3,1),k=_ref4[0];return !ASSET_KEYS.has(k);}));}function getPresetAssets(preset,assetsPath){var def=getPresetDefinition(preset,assetsPath);return Object.fromEntries(Object.entries(def).filter(function(_ref5){var _ref6=_slicedToArray(_ref5,1),k=_ref6[0];return ASSET_KEYS.has(k);}));}function resolveConfig(props,assetsPath){return Object.assign({},getPresetConfig(props.preset,assetsPath),extractConfig(props));}var RzpGlass=forwardRef(function RzpGlass(props,forwardedRef){var _presetAssets$videoSr,_ref7,_ref8,_presetAssets$centerG,_configProps$edgeFeat;var _props$width=props.width,width=_props$width===void 0?'100%':_props$width,_props$height=props.height,height=_props$height===void 0?'100%':_props$height,className=props.className,style=props.style,onLoad=props.onLoad,onError=props.onError,assetsPathProp=props.assetsPath,gradientMapCanvas=props.gradientMapCanvas,gradientMapSrcProp=props.gradientMapSrc,gradientMap2SrcProp=props.gradientMap2Src,imageSrcProp=props.imageSrc,configProps=_objectWithoutProperties(props,_excluded2);var assetsPath=assetsPathProp!=null?assetsPathProp:DEFAULT_CDN_PATH;var defaultAssets=getDefaultAssets(assetsPath);var presetAssets=getPresetAssets(props.preset,assetsPath);var imageSrc=imageSrcProp!=null?imageSrcProp:presetAssets.imageSrc;var videoSrc=imageSrc?undefined:(_presetAssets$videoSr=presetAssets.videoSrc)!=null?_presetAssets$videoSr:defaultAssets.videoSrc;var gradientMapSrc=(_ref7=gradientMapSrcProp!=null?gradientMapSrcProp:presetAssets.gradientMapSrc)!=null?_ref7:defaultAssets.gradientMapSrc;var gradientMap2Src=(_ref8=gradientMap2SrcProp!=null?gradientMap2SrcProp:presetAssets.gradientMap2Src)!=null?_ref8:defaultAssets.gradientMap2Src;var centerGradientMapSrc=(_presetAssets$centerG=presetAssets.centerGradientMapSrc)!=null?_presetAssets$centerG:defaultAssets.centerGradientMapSrc;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isInitialized=_useState2[0],setIsInitialized=_useState2[1];var _useState3=useState(null),_useState4=_slicedToArray(_useState3,2),error=_useState4[0],setError=_useState4[1];var divRef=useRef(null);var mountRef=useRef(null);useEffect(function(){var init=function(){var _ref9=_asyncToGenerator(function*(){if(!divRef.current||mountRef.current)return;try{var _config$paused;var config=resolveConfig(props,assetsPath);mountRef.current=new RzpGlassMount(divRef.current,{videoSrc:videoSrc,imageSrc:imageSrc,gradientMapSrc:gradientMapSrc,gradientMap2Src:gradientMap2Src,centerGradientMapSrc:centerGradientMapSrc},config);yield mountRef.current.loadAssets();var userWantsPaused=(_config$paused=config.paused)!=null?_config$paused:false;if(!userWantsPaused){mountRef.current.pause();}setIsInitialized(true);setTimeout(function(){if(!mountRef.current)return;if(!userWantsPaused){mountRef.current.play();}onLoad==null?void 0:onLoad();},FADE_IN_MS);}catch(err){var _error=err instanceof Error?err:new Error(String(err));setError(_error);onError==null?void 0:onError(_error);}});return function init(){return _ref9.apply(this,arguments);};}();void init();return function(){var _mountRef$current;(_mountRef$current=mountRef.current)==null?void 0:_mountRef$current.dispose();mountRef.current=null;setIsInitialized(false);};},[assetsPath,videoSrc,imageSrc,gradientMapSrc,gradientMap2Src,centerGradientMapSrc,configProps.preset]);useEffect(function(){if(isInitialized&&mountRef.current){var config=resolveConfig(props,assetsPath);mountRef.current.setUniforms(config);}},[isInitialized,configProps.preset,configProps.inputMin,configProps.inputMax,configProps.modifyGamma,configProps.posterizeLevels,configProps.cycleRepetitions,configProps.phaseShift,configProps.cycleSpeed,configProps.wrapMode,configProps.reverse,configProps.blendWithOriginal,configProps.numSegments,configProps.slitAngle,configProps.displacementX,configProps.displacementY,configProps.enableCenterElement,configProps.centerAnimDuration,configProps.ccBlackPoint,configProps.ccWhitePoint,configProps.ccMidtoneGamma,configProps.ccGamma,configProps.ccContrast,configProps.zoom,configProps.panX,configProps.panY].concat(_toConsumableArray((_configProps$edgeFeat=configProps.edgeFeather)!=null?_configProps$edgeFeat:[0,0,0,0]),[configProps.enableDisplacement,configProps.enableColorama,configProps.enableBloom,configProps.enableLightSweep,configProps.lightIntensity,configProps.lightStartFrame,configProps.paused,configProps.startTime,configProps.endTime,configProps.animateLightIndependently,configProps.animateCycleReps,configProps.cycleRepetitionsStart,configProps.cycleRepetitionsEnd,configProps.cycleRepetitionsStartFrame,configProps.cycleRepetitionsDuration,configProps.gradientMapBlend,configProps.gradientMapBlendDuration]));useEffect(function(){if(isInitialized&&mountRef.current&&gradientMapCanvas){mountRef.current.updateGradientMapTexture(gradientMapCanvas);}},[isInitialized,gradientMapCanvas]);var mergedRef=useMergeRefs([divRef,forwardedRef]);var widthStyle=typeof width==='number'?`${width}px`:width;var heightStyle=typeof height==='number'?`${height}px`:height;if(error){return jsx("div",{ref:mergedRef,className:className,style:Object.assign({width:widthStyle,height:heightStyle},style)});}return jsx("div",{ref:mergedRef,className:className,style:Object.assign({width:widthStyle,height:heightStyle,position:'relative',overflow:'hidden',backgroundColor:'transparent',transition:'2s opacity'},isInitialized?{opacity:1}:{opacity:0},style)});});
11
+ var _excluded=["width","height","className","style","onLoad","onError","assetsPath","gradientMapCanvas","gradientMapSrc","gradientMap2Src","imageSrc"];var FADE_IN_MS=200;var RzpGlass=forwardRef(function RzpGlass(props,forwardedRef){var _presetAssets$videoSr,_ref,_ref2,_presetAssets$centerG,_configProps$edgeFeat;var _props$width=props.width,width=_props$width===void 0?'100%':_props$width,_props$height=props.height,height=_props$height===void 0?'100%':_props$height,className=props.className,style=props.style,onLoad=props.onLoad,onError=props.onError,assetsPathProp=props.assetsPath,gradientMapCanvas=props.gradientMapCanvas,gradientMapSrcProp=props.gradientMapSrc,gradientMap2SrcProp=props.gradientMap2Src,imageSrcProp=props.imageSrc,configProps=_objectWithoutProperties(props,_excluded);var assetsPath=assetsPathProp!=null?assetsPathProp:DEFAULT_CDN_PATH;var defaultAssets=getDefaultAssets(assetsPath);var presetAssets=getPresetAssets(props.preset,assetsPath);var imageSrc=imageSrcProp!=null?imageSrcProp:presetAssets.imageSrc;var videoSrc=imageSrc?undefined:(_presetAssets$videoSr=presetAssets.videoSrc)!=null?_presetAssets$videoSr:defaultAssets.videoSrc;var gradientMapSrc=(_ref=gradientMapSrcProp!=null?gradientMapSrcProp:presetAssets.gradientMapSrc)!=null?_ref:defaultAssets.gradientMapSrc;var gradientMap2Src=(_ref2=gradientMap2SrcProp!=null?gradientMap2SrcProp:presetAssets.gradientMap2Src)!=null?_ref2:defaultAssets.gradientMap2Src;var centerGradientMapSrc=(_presetAssets$centerG=presetAssets.centerGradientMapSrc)!=null?_presetAssets$centerG:defaultAssets.centerGradientMapSrc;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isInitialized=_useState2[0],setIsInitialized=_useState2[1];var _useState3=useState(null),_useState4=_slicedToArray(_useState3,2),error=_useState4[0],setError=_useState4[1];var divRef=useRef(null);var mountRef=useRef(null);useEffect(function(){var init=function(){var _ref3=_asyncToGenerator(function*(){if(!divRef.current||mountRef.current)return;try{var _config$paused;var config=resolveConfig(props,assetsPath);mountRef.current=new RzpGlassMount(divRef.current,{videoSrc:videoSrc,imageSrc:imageSrc,gradientMapSrc:gradientMapSrc,gradientMap2Src:gradientMap2Src,centerGradientMapSrc:centerGradientMapSrc},config);yield mountRef.current.loadAssets();var userWantsPaused=(_config$paused=config.paused)!=null?_config$paused:false;if(!userWantsPaused){mountRef.current.pause();}setIsInitialized(true);setTimeout(function(){if(!mountRef.current)return;if(!userWantsPaused){mountRef.current.play();}onLoad==null?void 0:onLoad();},FADE_IN_MS);}catch(err){var _error=err instanceof Error?err:new Error(String(err));setError(_error);onError==null?void 0:onError(_error);}});return function init(){return _ref3.apply(this,arguments);};}();void init();return function(){var _mountRef$current;(_mountRef$current=mountRef.current)==null?void 0:_mountRef$current.dispose();mountRef.current=null;setIsInitialized(false);};},[assetsPath,videoSrc,imageSrc,gradientMapSrc,gradientMap2Src,centerGradientMapSrc,configProps.preset]);useEffect(function(){if(isInitialized&&mountRef.current){var config=resolveConfig(props,assetsPath);mountRef.current.setUniforms(config);}},[isInitialized,configProps.preset,configProps.inputMin,configProps.inputMax,configProps.modifyGamma,configProps.posterizeLevels,configProps.cycleRepetitions,configProps.phaseShift,configProps.cycleSpeed,configProps.wrapMode,configProps.reverse,configProps.blendWithOriginal,configProps.numSegments,configProps.slitAngle,configProps.displacementX,configProps.displacementY,configProps.enableCenterElement,configProps.centerAnimDuration,configProps.ccBlackPoint,configProps.ccWhitePoint,configProps.ccMidtoneGamma,configProps.ccGamma,configProps.ccContrast,configProps.zoom,configProps.panX,configProps.panY].concat(_toConsumableArray((_configProps$edgeFeat=configProps.edgeFeather)!=null?_configProps$edgeFeat:[0,0,0,0]),[configProps.enableDisplacement,configProps.enableColorama,configProps.enableBloom,configProps.enableLightSweep,configProps.lightIntensity,configProps.lightStartFrame,configProps.paused,configProps.startTime,configProps.endTime,configProps.animateLightIndependently,configProps.animateCycleReps,configProps.cycleRepetitionsStart,configProps.cycleRepetitionsEnd,configProps.cycleRepetitionsStartFrame,configProps.cycleRepetitionsDuration,configProps.gradientMapBlend,configProps.gradientMapBlendDuration]));useEffect(function(){if(isInitialized&&mountRef.current&&gradientMapCanvas){mountRef.current.updateGradientMapTexture(gradientMapCanvas);}},[isInitialized,gradientMapCanvas]);var mergedRef=useMergeRefs(forwardedRef,divRef);var widthStyle=typeof width==='number'?`${width}px`:width;var heightStyle=typeof height==='number'?`${height}px`:height;if(error){return jsx("div",{ref:mergedRef,className:className,style:Object.assign({width:widthStyle,height:heightStyle},style)});}return jsx("div",{ref:mergedRef,className:className,style:Object.assign({width:widthStyle,height:heightStyle,position:'relative',overflow:'hidden',backgroundColor:'transparent',transition:`${FADE_IN_MS}ms opacity`},isInitialized?{opacity:1}:{opacity:0},style)});});
11
12
 
12
- export { RzpGlass, RzpGlass as default };
13
+ export { RzpGlass };
13
14
  //# sourceMappingURL=RzpGlass.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RzpGlass.js","sources":["../../../../../../src/components/Spark/RzpGlass/RzpGlass.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable react/react-in-jsx-scope */\n/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable @typescript-eslint/no-implicit-any-catch */\n/* eslint-disable @typescript-eslint/no-shadow */\n/**\n * RzpGlass React Component\n *\n * A React wrapper for the RzpGlassMount WebGL shader effect.\n * Manages the component lifecycle with useEffect hooks.\n *\n * @example\n * ```tsx\n * // Uses default assets and config\n * <RzpGlass width=\"400px\" height=\"300px\" />\n *\n * // With custom assets\n * <RzpGlass\n * videoSrc=\"/custom_video.mp4\"\n * gradientMapSrc=\"/custom-gradient.jpg\"\n * enableBloom={true}\n * />\n * ```\n */\n\nimport { forwardRef, useEffect, useRef, useState, useCallback } from 'react';\nimport { RzpGlassMount } from './RzpGlassMount';\nimport type {\n RzpGlassProps,\n RzpGlassConfig,\n RzpGlassAssets,\n RzpGlassPresetDefinition,\n} from './types';\nimport { getPresets } from './presets';\nimport type { RzpGlassPreset } from './presets';\n\n// Duration of the component's built-in fade-in transition.\n// The video is kept paused during this window so one-shot animations\n// (e.g. circleSlideUp) don't \"waste\" frames while the canvas is invisible.\nconst FADE_IN_MS = 200;\n\nconst DEFAULT_CDN_PATH = 'https://cdn.jsdelivr.net/npm/@razorpay/blade/assets/spark';\n\nconst getDefaultAssets = (assetsPath: string): Required<RzpGlassAssets> => ({\n videoSrc: `${assetsPath}/spark-base-video.mp4`,\n imageSrc: `${assetsPath}/bottom-frame.jpg`,\n gradientMapSrc: `${assetsPath}/colorama-gradient-map-green.jpg`,\n gradientMap2Src: `${assetsPath}/colorama-gradient-map-blue.jpg`,\n centerGradientMapSrc: `${assetsPath}/colorama-center-gradient-map.jpg`,\n});\n\n/**\n * Hook to merge multiple refs into one\n */\nfunction useMergeRefs<T>(refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n return useCallback(\n (value: T) => {\n refs.forEach((ref) => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n });\n },\n [refs],\n );\n}\n\n/**\n * Extract config from props (exclude non-config props).\n * Strips undefined values so they don't clobber preset defaults.\n */\nfunction extractConfig(props: RzpGlassProps): Partial<RzpGlassConfig> {\n const {\n width: _width,\n height: _height,\n className: _className,\n style: _style,\n onLoad: _onLoad,\n onError: _onError,\n preset: _preset,\n assetsPath: _assetsPath,\n gradientMapSrc: _gradientMapSrc,\n gradientMap2Src: _gradientMap2Src,\n gradientMapCanvas: _gradientMapCanvas,\n imageSrc: _imageSrc,\n ...config\n } = props;\n\n // Drop keys with undefined values so preset config isn't overridden by unset props\n return Object.fromEntries(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n Object.entries(config).filter(([, v]) => v !== undefined),\n ) as Partial<RzpGlassConfig>;\n}\n\nconst ASSET_KEYS = new Set<string>([\n 'videoSrc',\n 'imageSrc',\n 'gradientMapSrc',\n 'gradientMap2Src',\n 'centerGradientMapSrc',\n]);\n\n/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return */\nfunction getPresetDefinition(\n preset: RzpGlassPreset | undefined,\n assetsPath: string,\n): RzpGlassPresetDefinition {\n const presets = getPresets(assetsPath);\n if (preset && preset in presets) return { ...presets[preset] };\n return {};\n}\n\nfunction getPresetConfig(\n preset: RzpGlassPreset | undefined,\n assetsPath: string,\n): Partial<RzpGlassConfig> {\n const def = getPresetDefinition(preset, assetsPath) as Record<string, unknown>;\n return Object.fromEntries(\n Object.entries(def).filter(([k]) => !ASSET_KEYS.has(k)),\n ) as Partial<RzpGlassConfig>;\n}\n\nfunction getPresetAssets(\n preset: RzpGlassPreset | undefined,\n assetsPath: string,\n): Partial<RzpGlassAssets> {\n const def = getPresetDefinition(preset, assetsPath) as Record<string, unknown>;\n return Object.fromEntries(\n Object.entries(def).filter(([k]) => ASSET_KEYS.has(k)),\n ) as Partial<RzpGlassAssets>;\n}\n\n/**\n * Merge preset config with user-provided config.\n * Preset values are used as base; any explicit prop overrides them.\n */\nfunction resolveConfig(props: RzpGlassProps, assetsPath: string): Partial<RzpGlassConfig> {\n return {\n ...getPresetConfig(props.preset, assetsPath),\n ...extractConfig(props),\n };\n}\n\nexport const RzpGlass = forwardRef<HTMLDivElement, RzpGlassProps>(function RzpGlass(\n props,\n forwardedRef,\n) {\n const {\n width = '100%',\n height = '100%',\n className,\n style,\n onLoad,\n onError,\n assetsPath: assetsPathProp,\n gradientMapCanvas,\n gradientMapSrc: gradientMapSrcProp,\n gradientMap2Src: gradientMap2SrcProp,\n imageSrc: imageSrcProp,\n ...configProps\n } = props;\n\n // Get default assets based on assetsPath\n const assetsPath: string = assetsPathProp ?? DEFAULT_CDN_PATH;\n const defaultAssets = getDefaultAssets(assetsPath);\n\n // Resolve assets: prop overrides preset, preset overrides default\n const presetAssets = getPresetAssets(props.preset, assetsPath);\n const imageSrc = imageSrcProp ?? presetAssets.imageSrc;\n const videoSrc = imageSrc ? undefined : presetAssets.videoSrc ?? defaultAssets.videoSrc;\n const gradientMapSrc =\n gradientMapSrcProp ?? presetAssets.gradientMapSrc ?? defaultAssets.gradientMapSrc;\n const gradientMap2Src =\n gradientMap2SrcProp ?? presetAssets.gradientMap2Src ?? defaultAssets.gradientMap2Src;\n const centerGradientMapSrc =\n presetAssets.centerGradientMapSrc ?? defaultAssets.centerGradientMapSrc;\n\n const [isInitialized, setIsInitialized] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const divRef = useRef<HTMLDivElement>(null);\n const mountRef = useRef<RzpGlassMount | null>(null);\n\n // Initialize on mount\n useEffect(() => {\n const init = async () => {\n if (!divRef.current || mountRef.current) return;\n\n try {\n const config = resolveConfig(props, assetsPath);\n\n mountRef.current = new RzpGlassMount(\n divRef.current,\n {\n videoSrc,\n imageSrc,\n gradientMapSrc,\n gradientMap2Src,\n centerGradientMapSrc,\n },\n config,\n );\n\n await mountRef.current.loadAssets();\n\n // Pause the video during the CSS fade-in so one-shot animations\n // don't burn frames while the component is still transparent.\n // Only do this when the consumer hasn't explicitly set paused: true.\n const userWantsPaused = config.paused ?? false;\n if (!userWantsPaused) {\n mountRef.current.pause();\n }\n\n setIsInitialized(true); // kicks off the CSS opacity 0 → 1 transition\n\n // After the fade-in completes, resume video and notify the consumer.\n setTimeout(() => {\n if (!mountRef.current) return;\n if (!userWantsPaused) {\n mountRef.current.play();\n }\n onLoad?.();\n }, FADE_IN_MS);\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n onError?.(error);\n }\n };\n\n void init();\n\n return () => {\n mountRef.current?.dispose();\n mountRef.current = null;\n setIsInitialized(false);\n };\n }, [\n assetsPath,\n videoSrc,\n imageSrc,\n gradientMapSrc,\n gradientMap2Src,\n centerGradientMapSrc,\n configProps.preset,\n ]);\n\n // Update uniforms when config props change\n useEffect(() => {\n if (isInitialized && mountRef.current) {\n const config = resolveConfig(props, assetsPath);\n mountRef.current.setUniforms(config);\n }\n }, [\n isInitialized,\n configProps.preset,\n // Colorama\n configProps.inputMin,\n configProps.inputMax,\n configProps.modifyGamma,\n configProps.posterizeLevels,\n configProps.cycleRepetitions,\n configProps.phaseShift,\n configProps.cycleSpeed,\n configProps.wrapMode,\n configProps.reverse,\n configProps.blendWithOriginal,\n // Displacement\n configProps.numSegments,\n configProps.slitAngle,\n configProps.displacementX,\n configProps.displacementY,\n // Center element\n configProps.enableCenterElement,\n configProps.centerAnimDuration,\n // Color correction\n configProps.ccBlackPoint,\n configProps.ccWhitePoint,\n configProps.ccMidtoneGamma,\n configProps.ccGamma,\n configProps.ccContrast,\n // Zoom & Pan\n configProps.zoom,\n configProps.panX,\n configProps.panY,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...(configProps.edgeFeather ?? [0, 0, 0, 0]),\n // Effect toggles\n configProps.enableDisplacement,\n configProps.enableColorama,\n configProps.enableBloom,\n configProps.enableLightSweep,\n // Light\n configProps.lightIntensity,\n configProps.lightStartFrame,\n // Playback\n configProps.paused,\n configProps.startTime,\n configProps.endTime,\n configProps.animateLightIndependently,\n // Cycle animation\n configProps.animateCycleReps,\n configProps.cycleRepetitionsStart,\n configProps.cycleRepetitionsEnd,\n configProps.cycleRepetitionsStartFrame,\n configProps.cycleRepetitionsDuration,\n // Gradient map blend\n configProps.gradientMapBlend,\n configProps.gradientMapBlendDuration,\n ]);\n\n // Update gradient map texture when a canvas is provided\n useEffect(() => {\n if (isInitialized && mountRef.current && gradientMapCanvas) {\n mountRef.current.updateGradientMapTexture(gradientMapCanvas);\n }\n }, [isInitialized, gradientMapCanvas]);\n\n const mergedRef = useMergeRefs([divRef, forwardedRef]);\n\n // Convert width/height to string if number\n const widthStyle = typeof width === 'number' ? `${width}px` : width;\n const heightStyle = typeof height === 'number' ? `${height}px` : height;\n\n if (error) {\n return (\n <div\n ref={mergedRef}\n className={className}\n style={{\n width: widthStyle,\n height: heightStyle,\n ...style,\n }}\n />\n );\n }\n\n return (\n <div\n ref={mergedRef}\n className={className}\n style={{\n width: widthStyle,\n height: heightStyle,\n position: 'relative',\n overflow: 'hidden',\n backgroundColor: 'transparent',\n transition: '2s opacity',\n ...(isInitialized ? { opacity: 1 } : { opacity: 0 }),\n ...style,\n }}\n />\n );\n});\n\nexport default RzpGlass;\n"],"names":["FADE_IN_MS","DEFAULT_CDN_PATH","getDefaultAssets","assetsPath","videoSrc","imageSrc","gradientMapSrc","gradientMap2Src","centerGradientMapSrc","useMergeRefs","refs","useCallback","value","forEach","ref","current","extractConfig","props","width","height","className","style","onLoad","onError","preset","gradientMapCanvas","config","_objectWithoutProperties","_excluded","Object","fromEntries","entries","filter","_ref","_ref2","_slicedToArray","v","undefined","ASSET_KEYS","Set","getPresetDefinition","presets","getPresets","assign","getPresetConfig","def","_ref3","_ref4","k","has","getPresetAssets","_ref5","_ref6","resolveConfig","RzpGlass","forwardRef","forwardedRef","_presetAssets$videoSr","_ref7","_ref8","_presetAssets$centerG","_configProps$edgeFeat","_props$width","_props$height","assetsPathProp","gradientMapSrcProp","gradientMap2SrcProp","imageSrcProp","configProps","_excluded2","defaultAssets","presetAssets","_useState","useState","_useState2","isInitialized","setIsInitialized","_useState3","_useState4","error","setError","divRef","useRef","mountRef","useEffect","init","_ref9","_asyncToGenerator","_config$paused","RzpGlassMount","loadAssets","userWantsPaused","paused","pause","setTimeout","play","err","Error","String","apply","arguments","_mountRef$current","dispose","setUniforms","inputMin","inputMax","modifyGamma","posterizeLevels","cycleRepetitions","phaseShift","cycleSpeed","wrapMode","reverse","blendWithOriginal","numSegments","slitAngle","displacementX","displacementY","enableCenterElement","centerAnimDuration","ccBlackPoint","ccWhitePoint","ccMidtoneGamma","ccGamma","ccContrast","zoom","panX","panY","concat","_toConsumableArray","edgeFeather","enableDisplacement","enableColorama","enableBloom","enableLightSweep","lightIntensity","lightStartFrame","startTime","endTime","animateLightIndependently","animateCycleReps","cycleRepetitionsStart","cycleRepetitionsEnd","cycleRepetitionsStartFrame","cycleRepetitionsDuration","gradientMapBlend","gradientMapBlendDuration","updateGradientMapTexture","mergedRef","widthStyle","heightStyle","_jsx","position","overflow","backgroundColor","transition","opacity"],"mappings":";;;;;;;;;AA2BA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,QAAA,CAAA,WAAA,CAAA,OAAA,CAAA,QAAA,CAAA,SAAA,CAAA,QAAA,CAAA,YAAA,CAAA,gBAAA,CAAA,iBAAA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,CAAE,CAAC,CAAG,CAAEA,OAAO,CAAE,CAAE,CAAC,CAChDvI,KAAK,CACR,CACH,CAAC,CAEN,CAAC;;;;"}
1
+ {"version":3,"file":"RzpGlass.js","sources":["../../../../../../src/components/Spark/RzpGlass/RzpGlass.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable react/react-in-jsx-scope */\n/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable @typescript-eslint/no-implicit-any-catch */\n/* eslint-disable @typescript-eslint/no-shadow */\nimport { forwardRef, useEffect, useRef, useState } from 'react';\nimport { RzpGlassMount } from './RzpGlassMount';\nimport type { RzpGlassProps } from './types';\nimport { DEFAULT_CDN_PATH, getDefaultAssets, getPresetAssets, resolveConfig } from './utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\n\n// Duration of the component's built-in fade-in transition.\n// The video is kept paused during this window so one-shot animations\n// (e.g. circleSlideUp) don't \"waste\" frames while the canvas is invisible.\nconst FADE_IN_MS = 200;\n\nconst RzpGlass = forwardRef<HTMLDivElement, RzpGlassProps>(function RzpGlass(props, forwardedRef) {\n const {\n width = '100%',\n height = '100%',\n className,\n style,\n onLoad,\n onError,\n assetsPath: assetsPathProp,\n gradientMapCanvas,\n gradientMapSrc: gradientMapSrcProp,\n gradientMap2Src: gradientMap2SrcProp,\n imageSrc: imageSrcProp,\n ...configProps\n } = props;\n\n // Get default assets based on assetsPath\n const assetsPath: string = assetsPathProp ?? DEFAULT_CDN_PATH;\n const defaultAssets = getDefaultAssets(assetsPath);\n\n // Resolve assets: prop overrides preset, preset overrides default\n const presetAssets = getPresetAssets(props.preset, assetsPath);\n const imageSrc = imageSrcProp ?? presetAssets.imageSrc;\n const videoSrc = imageSrc ? undefined : presetAssets.videoSrc ?? defaultAssets.videoSrc;\n const gradientMapSrc =\n gradientMapSrcProp ?? presetAssets.gradientMapSrc ?? defaultAssets.gradientMapSrc;\n const gradientMap2Src =\n gradientMap2SrcProp ?? presetAssets.gradientMap2Src ?? defaultAssets.gradientMap2Src;\n const centerGradientMapSrc =\n presetAssets.centerGradientMapSrc ?? defaultAssets.centerGradientMapSrc;\n\n const [isInitialized, setIsInitialized] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const divRef = useRef<HTMLDivElement>(null);\n const mountRef = useRef<RzpGlassMount | null>(null);\n\n // Initialize on mount\n useEffect(() => {\n const init = async () => {\n if (!divRef.current || mountRef.current) return;\n\n try {\n const config = resolveConfig(props, assetsPath);\n\n mountRef.current = new RzpGlassMount(\n divRef.current,\n {\n videoSrc,\n imageSrc,\n gradientMapSrc,\n gradientMap2Src,\n centerGradientMapSrc,\n },\n config,\n );\n\n await mountRef.current.loadAssets();\n\n // Pause the video during the CSS fade-in so one-shot animations\n // don't burn frames while the component is still transparent.\n // Only do this when the consumer hasn't explicitly set paused: true.\n const userWantsPaused = config.paused ?? false;\n if (!userWantsPaused) {\n mountRef.current.pause();\n }\n\n setIsInitialized(true); // kicks off the CSS opacity 0 → 1 transition\n\n // After the fade-in completes, resume video and notify the consumer.\n setTimeout(() => {\n if (!mountRef.current) return;\n if (!userWantsPaused) {\n mountRef.current.play();\n }\n onLoad?.();\n }, FADE_IN_MS);\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n onError?.(error);\n }\n };\n\n void init();\n\n return () => {\n mountRef.current?.dispose();\n mountRef.current = null;\n setIsInitialized(false);\n };\n }, [assetsPath, videoSrc, imageSrc, gradientMapSrc, gradientMap2Src, centerGradientMapSrc, configProps.preset]);\n\n // Update uniforms when config props change\n useEffect(() => {\n if (isInitialized && mountRef.current) {\n const config = resolveConfig(props, assetsPath);\n mountRef.current.setUniforms(config);\n }\n }, [\n isInitialized,\n configProps.preset,\n // Colorama\n configProps.inputMin,\n configProps.inputMax,\n configProps.modifyGamma,\n configProps.posterizeLevels,\n configProps.cycleRepetitions,\n configProps.phaseShift,\n configProps.cycleSpeed,\n configProps.wrapMode,\n configProps.reverse,\n configProps.blendWithOriginal,\n // Displacement\n configProps.numSegments,\n configProps.slitAngle,\n configProps.displacementX,\n configProps.displacementY,\n // Center element\n configProps.enableCenterElement,\n configProps.centerAnimDuration,\n // Color correction\n configProps.ccBlackPoint,\n configProps.ccWhitePoint,\n configProps.ccMidtoneGamma,\n configProps.ccGamma,\n configProps.ccContrast,\n // Zoom & Pan\n configProps.zoom,\n configProps.panX,\n configProps.panY,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...(configProps.edgeFeather ?? [0, 0, 0, 0]),\n // Effect toggles\n configProps.enableDisplacement,\n configProps.enableColorama,\n configProps.enableBloom,\n configProps.enableLightSweep,\n // Light\n configProps.lightIntensity,\n configProps.lightStartFrame,\n // Playback\n configProps.paused,\n configProps.startTime,\n configProps.endTime,\n configProps.animateLightIndependently,\n // Cycle animation\n configProps.animateCycleReps,\n configProps.cycleRepetitionsStart,\n configProps.cycleRepetitionsEnd,\n configProps.cycleRepetitionsStartFrame,\n configProps.cycleRepetitionsDuration,\n // Gradient map blend\n configProps.gradientMapBlend,\n configProps.gradientMapBlendDuration,\n ]);\n\n // Update gradient map texture when a canvas is provided\n useEffect(() => {\n if (isInitialized && mountRef.current && gradientMapCanvas) {\n mountRef.current.updateGradientMapTexture(gradientMapCanvas);\n }\n }, [isInitialized, gradientMapCanvas]);\n\n const mergedRef = useMergeRefs(forwardedRef, divRef);\n\n // Convert width/height to string if number\n const widthStyle = typeof width === 'number' ? `${width}px` : width;\n const heightStyle = typeof height === 'number' ? `${height}px` : height;\n\n if (error) {\n return (\n <div\n ref={mergedRef}\n className={className}\n style={{\n width: widthStyle,\n height: heightStyle,\n ...style,\n }}\n />\n );\n }\n\n return (\n <div\n ref={mergedRef}\n className={className}\n style={{\n width: widthStyle,\n height: heightStyle,\n position: 'relative',\n overflow: 'hidden',\n backgroundColor: 'transparent',\n transition: `${FADE_IN_MS}ms opacity`,\n ...(isInitialized ? { opacity: 1 } : { opacity: 0 }),\n ...style,\n }}\n />\n );\n});\n\nexport { RzpGlass };\n"],"names":["FADE_IN_MS","RzpGlass","forwardRef","props","forwardedRef","_presetAssets$videoSr","_ref","_ref2","_presetAssets$centerG","_configProps$edgeFeat","_props$width","width","_props$height","height","className","style","onLoad","onError","assetsPathProp","assetsPath","gradientMapCanvas","gradientMapSrcProp","gradientMapSrc","gradientMap2SrcProp","gradientMap2Src","imageSrcProp","imageSrc","configProps","_objectWithoutProperties","_excluded","DEFAULT_CDN_PATH","defaultAssets","getDefaultAssets","presetAssets","getPresetAssets","preset","videoSrc","undefined","centerGradientMapSrc","_useState","useState","_useState2","_slicedToArray","isInitialized","setIsInitialized","_useState3","_useState4","error","setError","divRef","useRef","mountRef","useEffect","init","_ref3","_asyncToGenerator","current","_config$paused","config","resolveConfig","RzpGlassMount","loadAssets","userWantsPaused","paused","pause","setTimeout","play","err","Error","String","apply","arguments","_mountRef$current","dispose","setUniforms","inputMin","inputMax","modifyGamma","posterizeLevels","cycleRepetitions","phaseShift","cycleSpeed","wrapMode","reverse","blendWithOriginal","numSegments","slitAngle","displacementX","displacementY","enableCenterElement","centerAnimDuration","ccBlackPoint","ccWhitePoint","ccMidtoneGamma","ccGamma","ccContrast","zoom","panX","panY","concat","_toConsumableArray","edgeFeather","enableDisplacement","enableColorama","enableBloom","enableLightSweep","lightIntensity","lightStartFrame","startTime","endTime","animateLightIndependently","animateCycleReps","cycleRepetitionsStart","cycleRepetitionsEnd","cycleRepetitionsStartFrame","cycleRepetitionsDuration","gradientMapBlend","gradientMapBlendDuration","updateGradientMapTexture","mergedRef","useMergeRefs","widthStyle","heightStyle","_jsx","ref","Object","assign","position","overflow","backgroundColor","transition","opacity"],"mappings":";;;;;;;;;;uJAgBA,IAAMA,UAAU,CAAG,GAAG,CAEhB,IAAAC,QAAQ,CAAGC,UAAU,CAAgC,SAASD,QAAQA,CAACE,KAAK,CAAEC,YAAY,CAAE,CAAA,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