@razorpay/blade 12.95.2 → 12.95.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/spark/bottom-frame.jpg +0 -0
- package/build/lib/native/components/Card/Card.js +1 -1
- package/build/lib/native/components/Card/Card.js.map +1 -1
- package/build/lib/native/components/Spark/RzpGlass/presets.js +1 -1
- package/build/lib/native/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/development/_virtual/flatten.js +1 -1
- package/build/lib/web/development/_virtual/flatten3.js +1 -1
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js +2 -1
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js +3 -0
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js.map +1 -1
- package/build/lib/web/development/components/Card/Card.js +1 -0
- package/build/lib/web/development/components/Card/Card.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/CalendarStyles.web.js +6 -6
- package/build/lib/web/development/components/DatePicker/CalendarStyles.web.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/presets.js +2 -1
- package/build/lib/web/development/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/development/components/TopNav/TabNav/TabNavIndicator.web.js +1 -1
- package/build/lib/web/development/components/TopNav/TabNav/TabNavIndicator.web.js.map +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/lib/web/production/_virtual/cloneDeep.js +1 -1
- package/build/lib/web/production/_virtual/cloneDeep3.js +1 -1
- package/build/lib/web/production/_virtual/flatten.js +1 -1
- package/build/lib/web/production/_virtual/flatten3.js +1 -1
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js +2 -1
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js +3 -0
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js.map +1 -1
- package/build/lib/web/production/components/Card/Card.js +1 -0
- package/build/lib/web/production/components/Card/Card.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/CalendarStyles.web.js +6 -6
- package/build/lib/web/production/components/DatePicker/CalendarStyles.web.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js +2 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/production/components/TopNav/TabNav/TabNavIndicator.web.js +1 -1
- package/build/lib/web/production/components/TopNav/TabNav/TabNavIndicator.web.js.map +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
- package/package.json +3 -2
|
Binary file
|
|
@@ -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","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
|
|
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;var _ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?'lowRaised':_ref$elevation,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,elevation:elevation,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 /**\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,YAAY,CAAWJ,IAAA,CACvBK,SAAS,KACTC,MAAM,CAAAN,IAAA,CAANM,MAAM,CAAAC,YAAA,CAAAP,IAAA,CACNQ,OAAO,CAAPA,OAAO,CAAAD,YAAA,GAAG,KAAA,CAAA,CAAA,WAAW,CAAAA,YAAA,CACrBE,KAAK,CAAAT,IAAA,CAALS,KAAK,CACLC,MAAM,CAAAV,IAAA,CAANU,MAAM,CACNC,SAAS,CAAAX,IAAA,CAATW,SAAS,CACTC,QAAQ,CAAAZ,IAAA,CAARY,QAAQ,CACRC,QAAQ,CAAAb,IAAA,CAARa,QAAQ,CACRC,OAAO,CAAAd,IA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AAA8E,IAAI,CAAG1C,cAAK,CAACsD,UAAU,CAAC7F,KAAK,EAC7B,IAAAR,QAAQ,CAAGsG,wBAAwB,CAACN,SAAS,CAAE,CAAEO,WAAW,CAAE9G,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 elevation={elevation}\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","_ref$elevation","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,GAA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D,IAAMsF,SAAS,CAAG,SAAZA,SAASA,CAAAC,KAAA,CAAiF,KAA3E9E,MAAM,CAAA8E,KAAA,CAAN9E,MAAM,CAAET,QAAQ,CAAAuF,KAAA,CAARvF,QAAQ,CAAEK,MAAM,CAAAkF,KAAA,CAANlF,MAAM,CAAK4B,IAAI,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,CAACzF,QAAQ,CAAEgB,MAAM,CAANA,MAAO,CAAC,CAAC,CACvD4E,sBAAsB,CAAChD,IAAI,CAAC,CAAA,CAChCxB,MAAM,CAAEA,MAAO,CAAAT,QAAA,CAEdA,QAAQ,CAAA,CACF,CAAC,CAEd,CAAC,CAEK,IAAA+E,IAAI,CAAG1C,cAAK,CAACsD,UAAU,CAAC9F,KAAK,EAC7B,IAAAR,QAAQ,CAAGuG,wBAAwB,CAACN,SAAS,CAAE,CAAEO,WAAW,CAAE/G,YAAY,CAACO,QAAS,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var DEFAULT_CONFIG={inputMin:0.0,inputMax:1.0,modifyGamma:1.05,posterizeLevels:0.0,cycleRepetitions:1.0,phaseShift:0.0,cycleSpeed:0.0,wrapMode:false,reverse:true,blendWithOriginal:0.0,gradientMapBlend:0.0,gradientMapBlendDuration:0.6,enableCenterElement:true,centerAnimDuration:6.0,ccBlackPoint:0.0,ccWhitePoint:0.9,ccMidtoneGamma:1.2,ccGamma:1.2,ccContrast:0.0,numSegments:45.0,slitAngle:0.15,displacementX:-12.0,displacementY:-20.0,paused:false,startTime:0,endTime:14,animateLightIndependently:false,playbackRate:1.0,lightIntensity:0.2,lightStartFrame:140,enableDisplacement:true,enableColorama:true,enableBloom:true,enableLightSweep:true,aspectRatio:3/2,zoom:1,panX:0,panY:0,edgeFeather:[0,0,0,0],backgroundColor:[-1,-1,-1],animateCycleReps:true,cycleRepetitionsStart:1.0,cycleRepetitionsEnd:1.15,cycleRepetitionsStartFrame:0,cycleRepetitionsDuration:140};var getPresets=function getPresets(assetsPath){return {default:{},zoomed:{lightIntensity:0.2,lightStartFrame:0,ccBlackPoint:0.0,ccWhitePoint:0.9,ccMidtoneGamma:1.2,ccGamma:1.62,ccContrast:0.0,numSegments:20.0,slitAngle:15*Math.PI/180,displacementX:-12.0,displacementY:-20.0,paused:true,startTime:10,endTime:14,animateLightIndependently:true,zoom:5,panX:-0.01,panY:0.1,edgeFeather:[3,5,3,3],animateCycleReps:true,cycleRepetitionsStart:1.0,cycleRepetitionsEnd:1.15,cycleRepetitionsStartFrame:0,cycleRepetitionsDuration:140},bottomWave:{imageSrc:`${assetsPath}/bottom-frame.jpg`,gradientMapSrc:`${assetsPath}/colorama-gradient-map-green.jpg`,gradientMap2Src:`${assetsPath}/colorama-gradient-map-blue.jpg`,gradientMapBlend:0,edgeFeather:[0.3,0,3,0],panY
|
|
1
|
+
var DEFAULT_CONFIG={inputMin:0.0,inputMax:1.0,modifyGamma:1.05,posterizeLevels:0.0,cycleRepetitions:1.0,phaseShift:0.0,cycleSpeed:0.0,wrapMode:false,reverse:true,blendWithOriginal:0.0,gradientMapBlend:0.0,gradientMapBlendDuration:0.6,enableCenterElement:true,centerAnimDuration:6.0,ccBlackPoint:0.0,ccWhitePoint:0.9,ccMidtoneGamma:1.2,ccGamma:1.2,ccContrast:0.0,numSegments:45.0,slitAngle:0.15,displacementX:-12.0,displacementY:-20.0,paused:false,startTime:0,endTime:14,animateLightIndependently:false,playbackRate:1.0,lightIntensity:0.2,lightStartFrame:140,enableDisplacement:true,enableColorama:true,enableBloom:true,enableLightSweep:true,aspectRatio:3/2,zoom:1,panX:0,panY:0,edgeFeather:[0,0,0,0],backgroundColor:[-1,-1,-1],animateCycleReps:true,cycleRepetitionsStart:1.0,cycleRepetitionsEnd:1.15,cycleRepetitionsStartFrame:0,cycleRepetitionsDuration:140};var getPresets=function getPresets(assetsPath){return {default:{},zoomed:{lightIntensity:0.2,lightStartFrame:0,ccBlackPoint:0.0,ccWhitePoint:0.9,ccMidtoneGamma:1.2,ccGamma:1.62,ccContrast:0.0,numSegments:20.0,slitAngle:15*Math.PI/180,displacementX:-12.0,displacementY:-20.0,paused:true,startTime:10,endTime:14,animateLightIndependently:true,zoom:5,panX:-0.01,panY:0.1,edgeFeather:[3,5,3,3],animateCycleReps:true,cycleRepetitionsStart:1.0,cycleRepetitionsEnd:1.15,cycleRepetitionsStartFrame:0,cycleRepetitionsDuration:140},bottomWave:{imageSrc:`${assetsPath}/bottom-frame.jpg`,gradientMapSrc:`${assetsPath}/colorama-gradient-map-green.jpg`,gradientMap2Src:`${assetsPath}/colorama-gradient-map-blue.jpg`,gradientMapBlend:0,modifyGamma:0.97,edgeFeather:[0.3,0,3,0],panY:0.03,numSegments:30,enableBloom:false,slitAngle:15*Math.PI/180},rippleWave:{videoSrc:`${assetsPath}/ray-pulse.mp4`,aspectRatio:1.61,playbackRate:0.7,slitAngle:15*Math.PI/180,numSegments:35,ccGamma:2.0,displacementX:-2.0,displacementY:-11.0,enableDisplacement:true,enableCenterElement:false,enableLightSweep:false,enableBloom:false,animateCycleReps:false,zoom:2},circleSlideUp:{videoSrc:`${assetsPath}/success-animation-circle.mp4`,aspectRatio:1.61,playbackRate:0.85,slitAngle:15*Math.PI/180,numSegments:25,enableDisplacement:true,enableCenterElement:false,enableLightSweep:false,enableBloom:false,animateCycleReps:false,zoom:1}};};
|
|
2
2
|
|
|
3
3
|
export { DEFAULT_CONFIG, getPresets };
|
|
4
4
|
//# sourceMappingURL=presets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sources":["../../../../../../src/components/Spark/RzpGlass/presets.ts"],"sourcesContent":["import type { RzpGlassConfig, RzpGlassPresetDefinition } from './types';\n\n// ============================================\n// DEFAULT CONFIG VALUES\n// ============================================\nconst DEFAULT_CONFIG: Required<RzpGlassConfig> = {\n // Input Phase\n inputMin: 0.0,\n inputMax: 1.0,\n // Modify Phase\n modifyGamma: 1.05,\n posterizeLevels: 0.0,\n cycleRepetitions: 1.0,\n phaseShift: 0.0,\n cycleSpeed: 0.0,\n // Output Cycle\n wrapMode: false,\n reverse: true,\n // Composite\n blendWithOriginal: 0.0,\n gradientMapBlend: 0.0,\n gradientMapBlendDuration: 0.6,\n\n // Center Element\n enableCenterElement: true,\n centerAnimDuration: 6.0,\n\n // Color Correction\n ccBlackPoint: 0.0,\n ccWhitePoint: 0.9,\n ccMidtoneGamma: 1.2,\n ccGamma: 1.2,\n ccContrast: 0.0,\n\n // Displacement\n numSegments: 45.0,\n slitAngle: 0.15,\n displacementX: -12.0,\n displacementY: -20.0,\n\n // Playback\n paused: false,\n startTime: 0,\n endTime: 14,\n animateLightIndependently: false,\n playbackRate: 1.0,\n\n // Light Effect\n lightIntensity: 0.2,\n lightStartFrame: 140,\n\n // Effect Toggles\n enableDisplacement: true,\n enableColorama: true,\n enableBloom: true,\n enableLightSweep: true,\n\n // Canvas\n aspectRatio: 3 / 2,\n\n // Zoom & Pan\n zoom: 1,\n panX: 0,\n panY: 0,\n edgeFeather: [0, 0, 0, 0],\n\n // Background Color\n backgroundColor: [-1, -1, -1],\n\n // Cycle Animation\n animateCycleReps: true,\n cycleRepetitionsStart: 1.0,\n cycleRepetitionsEnd: 1.15,\n cycleRepetitionsStartFrame: 0,\n cycleRepetitionsDuration: 140,\n};\n\n// ============================================\n// PRESETS\n// ============================================\nexport type RzpGlassPreset = 'default' | 'zoomed' | 'bottomWave' | 'rippleWave' | 'circleSlideUp';\n\n/**\n * Get preset definitions with dynamic CDN path support.\n * Asset URLs in presets will use the provided assetsPath.\n */\nconst getPresets = (assetsPath: string): Record<RzpGlassPreset, RzpGlassPresetDefinition> => ({\n /** Baseline — identical to DEFAULT_CONFIG, no overrides */\n default: {},\n\n /**\n * Zoomed-in closeup: high zoom, fine segments, edge feathering.\n * Good for a tight card/badge usage.\n */\n zoomed: {\n lightIntensity: 0.2,\n lightStartFrame: 0,\n // Color Correction\n ccBlackPoint: 0.0,\n ccWhitePoint: 0.9,\n ccMidtoneGamma: 1.2,\n ccGamma: 1.62,\n ccContrast: 0.0,\n // Displacement\n numSegments: 20.0,\n slitAngle: (15 * Math.PI) / 180,\n displacementX: -12.0,\n displacementY: -20.0,\n // Playback\n paused: true,\n startTime: 10,\n endTime: 14,\n animateLightIndependently: true,\n // Zoom & Pan\n zoom: 5,\n panX: -0.01,\n panY: 0.1,\n edgeFeather: [3, 5, 3, 3],\n // Animation\n animateCycleReps: true,\n cycleRepetitionsStart: 1.0,\n cycleRepetitionsEnd: 1.15,\n cycleRepetitionsStartFrame: 0,\n cycleRepetitionsDuration: 140,\n },\n bottomWave: {\n imageSrc: `${assetsPath}/bottom-frame.jpg`,\n gradientMapSrc: `${assetsPath}/colorama-gradient-map-green.jpg`,\n gradientMap2Src: `${assetsPath}/colorama-gradient-map-blue.jpg`,\n gradientMapBlend: 0,\n edgeFeather: [0.3, 0, 3, 0],\n panY:
|
|
1
|
+
{"version":3,"file":"presets.js","sources":["../../../../../../src/components/Spark/RzpGlass/presets.ts"],"sourcesContent":["import type { RzpGlassConfig, RzpGlassPresetDefinition } from './types';\n\n// ============================================\n// DEFAULT CONFIG VALUES\n// ============================================\nconst DEFAULT_CONFIG: Required<RzpGlassConfig> = {\n // Input Phase\n inputMin: 0.0,\n inputMax: 1.0,\n // Modify Phase\n modifyGamma: 1.05,\n posterizeLevels: 0.0,\n cycleRepetitions: 1.0,\n phaseShift: 0.0,\n cycleSpeed: 0.0,\n // Output Cycle\n wrapMode: false,\n reverse: true,\n // Composite\n blendWithOriginal: 0.0,\n gradientMapBlend: 0.0,\n gradientMapBlendDuration: 0.6,\n\n // Center Element\n enableCenterElement: true,\n centerAnimDuration: 6.0,\n\n // Color Correction\n ccBlackPoint: 0.0,\n ccWhitePoint: 0.9,\n ccMidtoneGamma: 1.2,\n ccGamma: 1.2,\n ccContrast: 0.0,\n\n // Displacement\n numSegments: 45.0,\n slitAngle: 0.15,\n displacementX: -12.0,\n displacementY: -20.0,\n\n // Playback\n paused: false,\n startTime: 0,\n endTime: 14,\n animateLightIndependently: false,\n playbackRate: 1.0,\n\n // Light Effect\n lightIntensity: 0.2,\n lightStartFrame: 140,\n\n // Effect Toggles\n enableDisplacement: true,\n enableColorama: true,\n enableBloom: true,\n enableLightSweep: true,\n\n // Canvas\n aspectRatio: 3 / 2,\n\n // Zoom & Pan\n zoom: 1,\n panX: 0,\n panY: 0,\n edgeFeather: [0, 0, 0, 0],\n\n // Background Color\n backgroundColor: [-1, -1, -1],\n\n // Cycle Animation\n animateCycleReps: true,\n cycleRepetitionsStart: 1.0,\n cycleRepetitionsEnd: 1.15,\n cycleRepetitionsStartFrame: 0,\n cycleRepetitionsDuration: 140,\n};\n\n// ============================================\n// PRESETS\n// ============================================\nexport type RzpGlassPreset = 'default' | 'zoomed' | 'bottomWave' | 'rippleWave' | 'circleSlideUp';\n\n/**\n * Get preset definitions with dynamic CDN path support.\n * Asset URLs in presets will use the provided assetsPath.\n */\nconst getPresets = (assetsPath: string): Record<RzpGlassPreset, RzpGlassPresetDefinition> => ({\n /** Baseline — identical to DEFAULT_CONFIG, no overrides */\n default: {},\n\n /**\n * Zoomed-in closeup: high zoom, fine segments, edge feathering.\n * Good for a tight card/badge usage.\n */\n zoomed: {\n lightIntensity: 0.2,\n lightStartFrame: 0,\n // Color Correction\n ccBlackPoint: 0.0,\n ccWhitePoint: 0.9,\n ccMidtoneGamma: 1.2,\n ccGamma: 1.62,\n ccContrast: 0.0,\n // Displacement\n numSegments: 20.0,\n slitAngle: (15 * Math.PI) / 180,\n displacementX: -12.0,\n displacementY: -20.0,\n // Playback\n paused: true,\n startTime: 10,\n endTime: 14,\n animateLightIndependently: true,\n // Zoom & Pan\n zoom: 5,\n panX: -0.01,\n panY: 0.1,\n edgeFeather: [3, 5, 3, 3],\n // Animation\n animateCycleReps: true,\n cycleRepetitionsStart: 1.0,\n cycleRepetitionsEnd: 1.15,\n cycleRepetitionsStartFrame: 0,\n cycleRepetitionsDuration: 140,\n },\n bottomWave: {\n imageSrc: `${assetsPath}/bottom-frame.jpg`,\n gradientMapSrc: `${assetsPath}/colorama-gradient-map-green.jpg`,\n gradientMap2Src: `${assetsPath}/colorama-gradient-map-blue.jpg`,\n gradientMapBlend: 0,\n modifyGamma: 0.97,\n edgeFeather: [0.3, 0, 3, 0],\n panY: 0.03,\n numSegments: 30,\n enableBloom: false,\n slitAngle: (15 * Math.PI) / 180,\n },\n rippleWave: {\n videoSrc: `${assetsPath}/ray-pulse.mp4`,\n aspectRatio: 1.61,\n playbackRate: 0.7,\n slitAngle: (15 * Math.PI) / 180,\n numSegments: 35,\n ccGamma: 2.0,\n displacementX: -2.0,\n displacementY: -11.0,\n enableDisplacement: true,\n enableCenterElement: false,\n enableLightSweep: false,\n enableBloom: false,\n animateCycleReps: false,\n zoom: 2,\n },\n circleSlideUp: {\n videoSrc: `${assetsPath}/success-animation-circle.mp4`,\n aspectRatio: 1.61,\n playbackRate: 0.85,\n slitAngle: (15 * Math.PI) / 180,\n numSegments: 25,\n enableDisplacement: true,\n enableCenterElement: false,\n enableLightSweep: false,\n enableBloom: false,\n animateCycleReps: false,\n zoom: 1,\n },\n});\n\nexport { DEFAULT_CONFIG, getPresets };\n"],"names":["DEFAULT_CONFIG","inputMin","inputMax","modifyGamma","posterizeLevels","cycleRepetitions","phaseShift","cycleSpeed","wrapMode","reverse","blendWithOriginal","gradientMapBlend","gradientMapBlendDuration","enableCenterElement","centerAnimDuration","ccBlackPoint","ccWhitePoint","ccMidtoneGamma","ccGamma","ccContrast","numSegments","slitAngle","displacementX","displacementY","paused","startTime","endTime","animateLightIndependently","playbackRate","lightIntensity","lightStartFrame","enableDisplacement","enableColorama","enableBloom","enableLightSweep","aspectRatio","zoom","panX","panY","edgeFeather","backgroundColor","animateCycleReps","cycleRepetitionsStart","cycleRepetitionsEnd","cycleRepetitionsStartFrame","cycleRepetitionsDuration","getPresets","assetsPath","default","zoomed","Math","PI","bottomWave","imageSrc","gradientMapSrc","gradientMap2Src","rippleWave","videoSrc","circleSlideUp"],"mappings":"AAKM,IAAAA,cAAwC,CAAG,CAE/CC,QAAQ,CAAE,GAAG,CACbC,QAAQ,CAAE,GAAG,CAEbC,WAAW,CAAE,IAAI,CACjBC,eAAe,CAAE,GAAG,CACpBC,gBAAgB,CAAE,GAAG,CACrBC,UAAU,CAAE,GAAG,CACfC,UAAU,CAAE,GAAG,CAEfC,QAAQ,CAAE,KAAK,CACfC,OAAO,CAAE,IAAI,CAEbC,iBAAiB,CAAE,GAAG,CACtBC,gBAAgB,CAAE,GAAG,CACrBC,wBAAwB,CAAE,GAAG,CAG7BC,mBAAmB,CAAE,IAAI,CACzBC,kBAAkB,CAAE,GAAG,CAGvBC,YAAY,CAAE,GAAG,CACjBC,YAAY,CAAE,GAAG,CACjBC,cAAc,CAAE,GAAG,CACnBC,OAAO,CAAE,GAAG,CACZC,UAAU,CAAE,GAAG,CAGfC,WAAW,CAAE,IAAI,CACjBC,SAAS,CAAE,IAAI,CACfC,aAAa,CAAE,CAAC,IAAI,CACpBC,aAAa,CAAE,CAAC,IAAI,CAGpBC,MAAM,CAAE,KAAK,CACbC,SAAS,CAAE,CAAC,CACZC,OAAO,CAAE,EAAE,CACXC,yBAAyB,CAAE,KAAK,CAChCC,YAAY,CAAE,GAAG,CAGjBC,cAAc,CAAE,GAAG,CACnBC,eAAe,CAAE,GAAG,CAGpBC,kBAAkB,CAAE,IAAI,CACxBC,cAAc,CAAE,IAAI,CACpBC,WAAW,CAAE,IAAI,CACjBC,gBAAgB,CAAE,IAAI,CAGtBC,WAAW,CAAE,CAAC,CAAG,CAAC,CAGlBC,IAAI,CAAE,CAAC,CACPC,IAAI,CAAE,CAAC,CACPC,IAAI,CAAE,CAAC,CACPC,WAAW,CAAE,CAAC,C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,CACF,CAAC,CAAC;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../node_modules/es-toolkit/dist/array/flatten.js';
|
|
1
|
+
import '../node_modules/es-toolkit/dist/compat/array/flatten.js';
|
|
2
2
|
//# sourceMappingURL=flatten.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../node_modules/es-toolkit/dist/
|
|
1
|
+
import '../node_modules/es-toolkit/dist/array/flatten.js';
|
|
2
2
|
//# sourceMappingURL=flatten3.js.map
|
|
@@ -82,8 +82,9 @@ var getVirtualItemParams = function getVirtualItemParams(_ref3) {
|
|
|
82
82
|
itemCount = _ref3.itemCount,
|
|
83
83
|
itemData = _ref3.itemData;
|
|
84
84
|
var itemHeightResponsive = getActionListItemHeight(theme);
|
|
85
|
+
var actionListItemVerticalMargin = theme.spacing[1] * 2;
|
|
85
86
|
var actionListPadding = getActionListPadding(theme);
|
|
86
|
-
var actionListItemHeight = isMobile ? itemHeightResponsive.itemHeightMobile : itemHeightResponsive.itemHeightDesktop;
|
|
87
|
+
var actionListItemHeight = (isMobile ? itemHeightResponsive.itemHeightMobile : itemHeightResponsive.itemHeightDesktop) + actionListItemVerticalMargin;
|
|
87
88
|
var shouldCalculateMinimumHeight = itemCount <= 10;
|
|
88
89
|
var actionListBoxHeight = actionListMaxHeight - actionListPadding * 2;
|
|
89
90
|
var actionListBoxMinHeight = shouldCalculateMinimumHeight ? itemData.reduce(function (acc, _, index) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListBox.web.js","sources":["../../../../../../src/components/ActionList/ActionListBox.web.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport React, { useCallback } from 'react';\nimport type { VariableSizeList } from 'react-window';\nimport { VariableSizeList as VirtualizedList } from 'react-window';\nimport { StyledListBoxWrapper } from './styles/StyledListBoxWrapper';\nimport type { SectionData } from './actionListUtils';\nimport { actionListMaxHeight, getActionListPadding } from './styles/getBaseListBoxWrapperStyles';\nimport { componentIds } from './componentIds';\nimport { ActionListSectionTitle } from './ActionListItem';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useIsMobile } from '~utils/useIsMobile';\nimport {\n actionListSectionTitleHeight,\n actionListDividerHeight,\n getActionListItemHeight,\n} from '~components/BaseMenu/BaseMenuItem/tokens';\nimport { useTheme } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { Divider } from '~components/Divider';\nimport type { ActionListItemProps } from '~components/ActionList';\n\ntype ActionListBoxProps = {\n childrenWithId?: React.ReactNode[] | null;\n sectionData: SectionData;\n actionListItemWrapperRole: 'listbox' | 'menu' | undefined;\n isMultiSelectable: boolean;\n isInBottomSheet: boolean;\n} & DataAnalyticsAttribute;\n\nconst _ActionListBox = React.forwardRef<HTMLDivElement, ActionListBoxProps>(\n ({ childrenWithId, actionListItemWrapperRole, isMultiSelectable, ...rest }, ref) => {\n const { isInBottomSheet } = useBottomSheetContext();\n\n return (\n <StyledListBoxWrapper\n isInBottomSheet={isInBottomSheet}\n ref={ref}\n {...makeAccessible({\n role: actionListItemWrapperRole,\n multiSelectable: actionListItemWrapperRole === 'listbox' ? isMultiSelectable : undefined,\n })}\n {...makeAnalyticsAttribute(rest)}\n >\n {childrenWithId}\n </StyledListBoxWrapper>\n );\n },\n);\n\nconst ActionListBox = assignWithoutSideEffects(React.memo(_ActionListBox), {\n displayName: 'ActionListBox',\n});\n\n/**\n * get the height of the item based on the componentId\n */\nconst getItemHeight = ({\n index,\n itemData,\n actionListItemHeight,\n}: {\n index: number;\n itemData: React.ReactNode[];\n actionListItemHeight: number;\n}): number => {\n if (getComponentId(itemData[index]) === componentIds.ActionListItem) {\n return actionListItemHeight;\n }\n\n if (getComponentId(itemData[index]) === componentIds.ActionListSectionTitle) {\n return actionListSectionTitleHeight;\n }\n // @ts-expect-error: key does exist\n if (itemData[index]?.key.includes('divider')) {\n return actionListDividerHeight;\n }\n return 0;\n};\n\n/**\n * Returns the height of item and height of container based on theme and device\n */\nconst getVirtualItemParams = ({\n theme,\n isMobile,\n itemCount,\n itemData,\n}: {\n theme: Theme;\n isMobile: boolean;\n itemCount: number;\n itemData: React.ReactNode[];\n}): {\n actionListItemHeight: number;\n actionListBoxHeight: number;\n} => {\n const itemHeightResponsive = getActionListItemHeight(theme);\n const actionListPadding = getActionListPadding(theme);\n const actionListItemHeight = isMobile\n ? itemHeightResponsive.itemHeightMobile\n : itemHeightResponsive.itemHeightDesktop;\n const shouldCalculateMinimumHeight = itemCount <= 10;\n const actionListBoxHeight = actionListMaxHeight - actionListPadding * 2;\n const actionListBoxMinHeight = shouldCalculateMinimumHeight\n ? itemData.reduce<number>((acc, _, index) => {\n const itemHeight = getItemHeight({ index, itemData, actionListItemHeight });\n return acc + itemHeight;\n }, 0)\n : actionListBoxHeight;\n const finalActionListBoxHeight = Math.min(actionListBoxHeight, actionListBoxMinHeight);\n\n return {\n actionListItemHeight,\n actionListBoxHeight: finalActionListBoxHeight,\n };\n};\n\n/**\n * Takes the children (ActionListItem) and returns the filtered items based on `filteredValues` state\n */\nconst useFilteredItems = (\n children: React.ReactNode[],\n): {\n itemData: React.ReactNode[];\n itemCount: number;\n} => {\n const childrenArray = React.Children.toArray(children); // Convert children to an array\n\n const { filteredValues, hasAutoCompleteInHeader, dropdownTriggerer } = useDropdown();\n\n const items = React.useMemo(() => {\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n if (!hasAutoComplete) {\n return childrenArray;\n }\n\n const filteredItems = childrenArray.reduce<React.ReactNode[]>((acc, item, index) => {\n if (getComponentId(item) === componentIds.ActionListSection) {\n const sectionTitle = (\n <ActionListSectionTitle\n key={index}\n // @ts-expect-error: props does exist\n title={item?.props.title}\n isInsideVirtualizedList\n />\n );\n // @ts-expect-error: props does exist\n const sectionChildren = item?.props.children;\n\n const divider =\n index !== childrenArray.length - 1 ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" key={`divider-${index}`} />\n ) : null;\n const filteredSectionChildren = sectionChildren.filter(\n (item: { props: { value: string } }) => filteredValues.includes(item.props.value),\n );\n if (filteredSectionChildren.length !== 0) {\n acc.push(sectionTitle, ...filteredSectionChildren, divider);\n }\n } else {\n // @ts-expect-error: props does exist\n const value = item?.props.value;\n if (filteredValues.includes(value)) {\n acc.push(item);\n }\n }\n return acc;\n }, []);\n\n return filteredItems;\n }, [filteredValues, hasAutoCompleteInHeader, dropdownTriggerer, childrenArray]);\n\n return {\n itemData: items,\n itemCount: items.length,\n };\n};\n\nconst VirtualListItem = React.memo(\n ({\n index,\n style,\n data,\n onVirtualizedFocus,\n }: {\n index: number;\n style: React.CSSProperties;\n data: React.ReactNode[];\n onVirtualizedFocus: (index: number) => void;\n }): React.ReactElement | null => {\n const currentItem = data[index];\n\n if (\n React.isValidElement(currentItem) &&\n getComponentId(currentItem) === componentIds.ActionListItem\n ) {\n // Clone the element passed via `data` and add the `_virtualizedIndex` prop\n const elementWithIndex = React.cloneElement(\n currentItem as React.ReactElement<ActionListItemProps>,\n {\n _virtualizedIndex: index,\n _onVirtualizedFocus: onVirtualizedFocus,\n },\n );\n\n return <div style={style}>{elementWithIndex}</div>;\n }\n\n return <div style={style}>{data[index]}</div>;\n },\n (prevProps, nextProps) => {\n // Custom comparison function to determine if component should update\n return (\n prevProps.index === nextProps.index &&\n prevProps.style === nextProps.style &&\n prevProps.data[prevProps.index] === nextProps.data[nextProps.index]\n );\n },\n);\n\nconst _ActionListVirtualizedBox = React.forwardRef<HTMLDivElement, ActionListBoxProps>(\n ({ childrenWithId, actionListItemWrapperRole, isMultiSelectable, ...rest }, ref) => {\n const virtualizedListRef = React.useRef<VariableSizeList>(null);\n const [visibleStartIndex, setVisibleStartIndex] = React.useState(0);\n const [visibleStopIndex, setVisibleStopIndex] = React.useState(0);\n const items = React.Children.toArray(childrenWithId); // Convert children to an array\n const { isInBottomSheet } = useBottomSheetContext();\n const { itemData, itemCount } = useFilteredItems(items);\n\n const isMobile = useIsMobile();\n const { theme } = useTheme();\n const { actionListItemHeight, actionListBoxHeight } = React.useMemo(\n () => getVirtualItemParams({ theme, isMobile, itemCount, itemData }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [theme.name, isMobile, itemCount, itemData],\n );\n React.useEffect(() => {\n virtualizedListRef?.current?.resetAfterIndex(0);\n virtualizedListRef?.current?.scrollToItem(0);\n }, [itemCount]);\n\n return (\n <StyledListBoxWrapper\n isInBottomSheet={isInBottomSheet}\n // in case of virtualized list, we only render visible items. so css will hide divider for every last item visible. instead of hiding the last divider of the list.\n ref={ref}\n {...makeAccessible({\n role: actionListItemWrapperRole,\n multiSelectable: actionListItemWrapperRole === 'listbox' ? isMultiSelectable : undefined,\n })}\n {...makeAnalyticsAttribute(rest)}\n >\n <VirtualizedList<React.ReactNode[]>\n ref={virtualizedListRef}\n height={actionListBoxHeight}\n width=\"100%\"\n itemSize={(index) => getItemHeight({ index, itemData, actionListItemHeight })}\n itemCount={itemCount}\n itemData={itemData}\n itemKey={(index) =>\n // @ts-expect-error: props does exist\n itemData[index]?.props.value ??\n // @ts-expect-error: props does exist\n itemData[index]?.props.title ??\n // @ts-expect-error: props does exist\n itemData[index]?.props.key\n }\n onItemsRendered={({ visibleStartIndex, visibleStopIndex }) => {\n setVisibleStartIndex(visibleStartIndex);\n setVisibleStopIndex(visibleStopIndex);\n }}\n >\n {useCallback(\n ({ index, style, data }) => {\n return (\n <VirtualListItem\n index={index}\n style={style}\n data={data}\n onVirtualizedFocus={(index) => {\n // We need scroll Direction to determine the index to focus\n const scrollDirection =\n Math.round((visibleStartIndex + visibleStopIndex) / 2) > index\n ? 'top'\n : 'bottom';\n virtualizedListRef?.current?.resetAfterIndex(0);\n /**\n * we are scrolling to the item which is 3 items away from the current item.\n * since we can have 2 item sectoin header and divider which are not focusable.\n */\n virtualizedListRef?.current?.scrollToItem(\n index + (scrollDirection === 'top' ? -3 : 3),\n 'smart',\n );\n }}\n />\n );\n },\n [visibleStartIndex, visibleStopIndex],\n )}\n </VirtualizedList>\n </StyledListBoxWrapper>\n );\n },\n);\n\nconst ActionListVirtualizedBox = assignWithoutSideEffects(React.memo(_ActionListVirtualizedBox), {\n displayName: 'ActionListVirtualizedBox',\n});\n\nexport { ActionListBox, ActionListVirtualizedBox };\n"],"names":["_ActionListBox","React","forwardRef","_ref","ref","childrenWithId","actionListItemWrapperRole","isMultiSelectable","rest","_objectWithoutProperties","_excluded","_useBottomSheetContex","useBottomSheetContext","isInBottomSheet","_jsx","StyledListBoxWrapper","_objectSpread","makeAccessible","role","multiSelectable","undefined","makeAnalyticsAttribute","children","ActionListBox","assignWithoutSideEffects","memo","displayName","getItemHeight","_ref2","_itemData$index","index","itemData","actionListItemHeight","getComponentId","componentIds","ActionListItem","ActionListSectionTitle","actionListSectionTitleHeight","key","includes","actionListDividerHeight","getVirtualItemParams","_ref3","theme","isMobile","itemCount","itemHeightResponsive","getActionListItemHeight","actionListPadding","getActionListPadding","itemHeightMobile","itemHeightDesktop","shouldCalculateMinimumHeight","actionListBoxHeight","actionListMaxHeight","actionListBoxMinHeight","reduce","acc","_","itemHeight","finalActionListBoxHeight","Math","min","useFilteredItems","childrenArray","Children","toArray","_useDropdown","useDropdown","filteredValues","hasAutoCompleteInHeader","dropdownTriggerer","items","useMemo","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","filteredItems","item","ActionListSection","sectionTitle","title","props","isInsideVirtualizedList","sectionChildren","divider","length","Divider","marginX","marginY","concat","filteredSectionChildren","filter","value","push","apply","_toConsumableArray","VirtualListItem","_ref4","style","data","onVirtualizedFocus","currentItem","isValidElement","elementWithIndex","cloneElement","_virtualizedIndex","_onVirtualizedFocus","prevProps","nextProps","_ActionListVirtualizedBox","_ref5","_excluded2","virtualizedListRef","useRef","_React$useState","useState","_React$useState2","_slicedToArray","visibleStartIndex","setVisibleStartIndex","_React$useState3","_React$useState4","visibleStopIndex","setVisibleStopIndex","_useBottomSheetContex2","_useFilteredItems","useIsMobile","_useTheme","useTheme","_React$useMemo","name","useEffect","_virtualizedListRef$c","_virtualizedListRef$c2","current","resetAfterIndex","scrollToItem","VirtualizedList","height","width","itemSize","itemKey","_ref6","_itemData$index$props","_itemData$index2","_itemData$index3","_itemData$index4","onItemsRendered","_ref7","useCallback","_ref8","_virtualizedListRef$c3","_virtualizedListRef$c4","scrollDirection","round","ActionListVirtualizedBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAMA,cAAc,gBAAGC,cAAK,CAACC,UAAU,CACrC,UAAAC,IAAA,EAA4EC,GAAG,EAAK;AAAA,EAAA,IAAjFC,cAAc,GAAAF,IAAA,CAAdE,cAAc;IAAEC,yBAAyB,GAAAH,IAAA,CAAzBG,yBAAyB;IAAEC,iBAAiB,GAAAJ,IAAA,CAAjBI,iBAAiB;AAAKC,IAAAA,IAAI,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA,CAAA;AACtE,EAAA,IAAAC,qBAAA,GAA4BC,qBAAqB,EAAE;IAA3CC,eAAe,GAAAF,qBAAA,CAAfE,eAAe,CAAA;EAEvB,oBACEC,GAAA,CAACC,oBAAoB,EAAAC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA;AACnBH,IAAAA,eAAe,EAAEA,eAAgB;AACjCT,IAAAA,GAAG,EAAEA,GAAAA;AAAI,GAAA,EACLa,cAAc,CAAC;AACjBC,IAAAA,IAAI,EAAEZ,yBAAyB;AAC/Ba,IAAAA,eAAe,EAAEb,yBAAyB,KAAK,SAAS,GAAGC,iBAAiB,GAA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BAAA,eAA3BA,sBAAA,CAA6BhB,eAAe,CAAC,CAAC,CAAC,CAAA;AAC/C;AACpB;AACA;AACA;AACoBvB,YAAAA,kBAAkB,KAAlBA,IAAAA,IAAAA,kBAAkB,KAAAwC,KAAAA,CAAAA,IAAAA,CAAAA,sBAAA,GAAlBxC,kBAAkB,CAAEsB,OAAO,MAAAkB,IAAAA,IAAAA,sBAAA,KAA3BA,KAAAA,CAAAA,IAAAA,sBAAA,CAA6BhB,YAAY,CACvC5G,KAAK,IAAI6H,eAAe,KAAK,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAC5C,OACF,CAAC,CAAA;AACH,WAAA;AAAE,SACH,CAAC,CAAA;AAEN,OAAC,EACD,CAACnC,iBAAiB,EAAEI,gBAAgB,CACtC,CAAA;KACe,CAAA;AAAC,GAAA,CACE,CAAC,CAAA;AAE3B,CACF,CAAC,CAAA;AAEKiC,IAAAA,wBAAwB,gBAAGrI,wBAAwB,cAACvB,cAAK,CAACwB,IAAI,CAACsF,yBAAyB,CAAC,EAAE;AAC/FrF,EAAAA,WAAW,EAAE,0BAAA;AACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"ActionListBox.web.js","sources":["../../../../../../src/components/ActionList/ActionListBox.web.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport React, { useCallback } from 'react';\nimport type { VariableSizeList } from 'react-window';\nimport { VariableSizeList as VirtualizedList } from 'react-window';\nimport { StyledListBoxWrapper } from './styles/StyledListBoxWrapper';\nimport type { SectionData } from './actionListUtils';\nimport { actionListMaxHeight, getActionListPadding } from './styles/getBaseListBoxWrapperStyles';\nimport { componentIds } from './componentIds';\nimport { ActionListSectionTitle } from './ActionListItem';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useIsMobile } from '~utils/useIsMobile';\nimport {\n actionListSectionTitleHeight,\n actionListDividerHeight,\n getActionListItemHeight,\n} from '~components/BaseMenu/BaseMenuItem/tokens';\nimport { useTheme } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { Divider } from '~components/Divider';\nimport type { ActionListItemProps } from '~components/ActionList';\n\ntype ActionListBoxProps = {\n childrenWithId?: React.ReactNode[] | null;\n sectionData: SectionData;\n actionListItemWrapperRole: 'listbox' | 'menu' | undefined;\n isMultiSelectable: boolean;\n isInBottomSheet: boolean;\n} & DataAnalyticsAttribute;\n\nconst _ActionListBox = React.forwardRef<HTMLDivElement, ActionListBoxProps>(\n ({ childrenWithId, actionListItemWrapperRole, isMultiSelectable, ...rest }, ref) => {\n const { isInBottomSheet } = useBottomSheetContext();\n\n return (\n <StyledListBoxWrapper\n isInBottomSheet={isInBottomSheet}\n ref={ref}\n {...makeAccessible({\n role: actionListItemWrapperRole,\n multiSelectable: actionListItemWrapperRole === 'listbox' ? isMultiSelectable : undefined,\n })}\n {...makeAnalyticsAttribute(rest)}\n >\n {childrenWithId}\n </StyledListBoxWrapper>\n );\n },\n);\n\nconst ActionListBox = assignWithoutSideEffects(React.memo(_ActionListBox), {\n displayName: 'ActionListBox',\n});\n\n/**\n * get the height of the item based on the componentId\n */\nconst getItemHeight = ({\n index,\n itemData,\n actionListItemHeight,\n}: {\n index: number;\n itemData: React.ReactNode[];\n actionListItemHeight: number;\n}): number => {\n if (getComponentId(itemData[index]) === componentIds.ActionListItem) {\n return actionListItemHeight;\n }\n\n if (getComponentId(itemData[index]) === componentIds.ActionListSectionTitle) {\n return actionListSectionTitleHeight;\n }\n // @ts-expect-error: key does exist\n if (itemData[index]?.key.includes('divider')) {\n return actionListDividerHeight;\n }\n return 0;\n};\n\n/**\n * Returns the height of item and height of container based on theme and device\n */\nconst getVirtualItemParams = ({\n theme,\n isMobile,\n itemCount,\n itemData,\n}: {\n theme: Theme;\n isMobile: boolean;\n itemCount: number;\n itemData: React.ReactNode[];\n}): {\n actionListItemHeight: number;\n actionListBoxHeight: number;\n} => {\n const itemHeightResponsive = getActionListItemHeight(theme);\n const actionListItemVerticalMargin = theme.spacing[1] * 2;\n const actionListPadding = getActionListPadding(theme);\n const actionListItemHeight =\n (isMobile ? itemHeightResponsive.itemHeightMobile : itemHeightResponsive.itemHeightDesktop) +\n actionListItemVerticalMargin;\n const shouldCalculateMinimumHeight = itemCount <= 10;\n const actionListBoxHeight = actionListMaxHeight - actionListPadding * 2;\n const actionListBoxMinHeight = shouldCalculateMinimumHeight\n ? itemData.reduce<number>((acc, _, index) => {\n const itemHeight = getItemHeight({ index, itemData, actionListItemHeight });\n return acc + itemHeight;\n }, 0)\n : actionListBoxHeight;\n const finalActionListBoxHeight = Math.min(actionListBoxHeight, actionListBoxMinHeight);\n\n return {\n actionListItemHeight,\n actionListBoxHeight: finalActionListBoxHeight,\n };\n};\n\n/**\n * Takes the children (ActionListItem) and returns the filtered items based on `filteredValues` state\n */\nconst useFilteredItems = (\n children: React.ReactNode[],\n): {\n itemData: React.ReactNode[];\n itemCount: number;\n} => {\n const childrenArray = React.Children.toArray(children); // Convert children to an array\n\n const { filteredValues, hasAutoCompleteInHeader, dropdownTriggerer } = useDropdown();\n\n const items = React.useMemo(() => {\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n if (!hasAutoComplete) {\n return childrenArray;\n }\n\n const filteredItems = childrenArray.reduce<React.ReactNode[]>((acc, item, index) => {\n if (getComponentId(item) === componentIds.ActionListSection) {\n const sectionTitle = (\n <ActionListSectionTitle\n key={index}\n // @ts-expect-error: props does exist\n title={item?.props.title}\n isInsideVirtualizedList\n />\n );\n // @ts-expect-error: props does exist\n const sectionChildren = item?.props.children;\n\n const divider =\n index !== childrenArray.length - 1 ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" key={`divider-${index}`} />\n ) : null;\n const filteredSectionChildren = sectionChildren.filter(\n (item: { props: { value: string } }) => filteredValues.includes(item.props.value),\n );\n if (filteredSectionChildren.length !== 0) {\n acc.push(sectionTitle, ...filteredSectionChildren, divider);\n }\n } else {\n // @ts-expect-error: props does exist\n const value = item?.props.value;\n if (filteredValues.includes(value)) {\n acc.push(item);\n }\n }\n return acc;\n }, []);\n\n return filteredItems;\n }, [filteredValues, hasAutoCompleteInHeader, dropdownTriggerer, childrenArray]);\n\n return {\n itemData: items,\n itemCount: items.length,\n };\n};\n\nconst VirtualListItem = React.memo(\n ({\n index,\n style,\n data,\n onVirtualizedFocus,\n }: {\n index: number;\n style: React.CSSProperties;\n data: React.ReactNode[];\n onVirtualizedFocus: (index: number) => void;\n }): React.ReactElement | null => {\n const currentItem = data[index];\n\n if (\n React.isValidElement(currentItem) &&\n getComponentId(currentItem) === componentIds.ActionListItem\n ) {\n // Clone the element passed via `data` and add the `_virtualizedIndex` prop\n const elementWithIndex = React.cloneElement(\n currentItem as React.ReactElement<ActionListItemProps>,\n {\n _virtualizedIndex: index,\n _onVirtualizedFocus: onVirtualizedFocus,\n },\n );\n\n return <div style={style}>{elementWithIndex}</div>;\n }\n\n return <div style={style}>{data[index]}</div>;\n },\n (prevProps, nextProps) => {\n // Custom comparison function to determine if component should update\n return (\n prevProps.index === nextProps.index &&\n prevProps.style === nextProps.style &&\n prevProps.data[prevProps.index] === nextProps.data[nextProps.index]\n );\n },\n);\n\nconst _ActionListVirtualizedBox = React.forwardRef<HTMLDivElement, ActionListBoxProps>(\n ({ childrenWithId, actionListItemWrapperRole, isMultiSelectable, ...rest }, ref) => {\n const virtualizedListRef = React.useRef<VariableSizeList>(null);\n const [visibleStartIndex, setVisibleStartIndex] = React.useState(0);\n const [visibleStopIndex, setVisibleStopIndex] = React.useState(0);\n const items = React.Children.toArray(childrenWithId); // Convert children to an array\n const { isInBottomSheet } = useBottomSheetContext();\n const { itemData, itemCount } = useFilteredItems(items);\n\n const isMobile = useIsMobile();\n const { theme } = useTheme();\n const { actionListItemHeight, actionListBoxHeight } = React.useMemo(\n () => getVirtualItemParams({ theme, isMobile, itemCount, itemData }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [theme.name, isMobile, itemCount, itemData],\n );\n React.useEffect(() => {\n virtualizedListRef?.current?.resetAfterIndex(0);\n virtualizedListRef?.current?.scrollToItem(0);\n }, [itemCount]);\n\n return (\n <StyledListBoxWrapper\n isInBottomSheet={isInBottomSheet}\n // in case of virtualized list, we only render visible items. so css will hide divider for every last item visible. instead of hiding the last divider of the list.\n ref={ref}\n {...makeAccessible({\n role: actionListItemWrapperRole,\n multiSelectable: actionListItemWrapperRole === 'listbox' ? isMultiSelectable : undefined,\n })}\n {...makeAnalyticsAttribute(rest)}\n >\n <VirtualizedList<React.ReactNode[]>\n ref={virtualizedListRef}\n height={actionListBoxHeight}\n width=\"100%\"\n itemSize={(index) => getItemHeight({ index, itemData, actionListItemHeight })}\n itemCount={itemCount}\n itemData={itemData}\n itemKey={(index) =>\n // @ts-expect-error: props does exist\n itemData[index]?.props.value ??\n // @ts-expect-error: props does exist\n itemData[index]?.props.title ??\n // @ts-expect-error: props does exist\n itemData[index]?.props.key\n }\n onItemsRendered={({ visibleStartIndex, visibleStopIndex }) => {\n setVisibleStartIndex(visibleStartIndex);\n setVisibleStopIndex(visibleStopIndex);\n }}\n >\n {useCallback(\n ({ index, style, data }) => {\n return (\n <VirtualListItem\n index={index}\n style={style}\n data={data}\n onVirtualizedFocus={(index) => {\n // We need scroll Direction to determine the index to focus\n const scrollDirection =\n Math.round((visibleStartIndex + visibleStopIndex) / 2) > index\n ? 'top'\n : 'bottom';\n virtualizedListRef?.current?.resetAfterIndex(0);\n /**\n * we are scrolling to the item which is 3 items away from the current item.\n * since we can have 2 item sectoin header and divider which are not focusable.\n */\n virtualizedListRef?.current?.scrollToItem(\n index + (scrollDirection === 'top' ? -3 : 3),\n 'smart',\n );\n }}\n />\n );\n },\n [visibleStartIndex, visibleStopIndex],\n )}\n </VirtualizedList>\n </StyledListBoxWrapper>\n );\n },\n);\n\nconst ActionListVirtualizedBox = assignWithoutSideEffects(React.memo(_ActionListVirtualizedBox), {\n displayName: 'ActionListVirtualizedBox',\n});\n\nexport { ActionListBox, ActionListVirtualizedBox };\n"],"names":["_ActionListBox","React","forwardRef","_ref","ref","childrenWithId","actionListItemWrapperRole","isMultiSelectable","rest","_objectWithoutProperties","_excluded","_useBottomSheetContex","useBottomSheetContext","isInBottomSheet","_jsx","StyledListBoxWrapper","_objectSpread","makeAccessible","role","multiSelectable","undefined","makeAnalyticsAttribute","children","ActionListBox","assignWithoutSideEffects","memo","displayName","getItemHeight","_ref2","_itemData$index","index","itemData","actionListItemHeight","getComponentId","componentIds","ActionListItem","ActionListSectionTitle","actionListSectionTitleHeight","key","includes","actionListDividerHeight","getVirtualItemParams","_ref3","theme","isMobile","itemCount","itemHeightResponsive","getActionListItemHeight","actionListItemVerticalMargin","spacing","actionListPadding","getActionListPadding","itemHeightMobile","itemHeightDesktop","shouldCalculateMinimumHeight","actionListBoxHeight","actionListMaxHeight","actionListBoxMinHeight","reduce","acc","_","itemHeight","finalActionListBoxHeight","Math","min","useFilteredItems","childrenArray","Children","toArray","_useDropdown","useDropdown","filteredValues","hasAutoCompleteInHeader","dropdownTriggerer","items","useMemo","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","filteredItems","item","ActionListSection","sectionTitle","title","props","isInsideVirtualizedList","sectionChildren","divider","length","Divider","marginX","marginY","concat","filteredSectionChildren","filter","value","push","apply","_toConsumableArray","VirtualListItem","_ref4","style","data","onVirtualizedFocus","currentItem","isValidElement","elementWithIndex","cloneElement","_virtualizedIndex","_onVirtualizedFocus","prevProps","nextProps","_ActionListVirtualizedBox","_ref5","_excluded2","virtualizedListRef","useRef","_React$useState","useState","_React$useState2","_slicedToArray","visibleStartIndex","setVisibleStartIndex","_React$useState3","_React$useState4","visibleStopIndex","setVisibleStopIndex","_useBottomSheetContex2","_useFilteredItems","useIsMobile","_useTheme","useTheme","_React$useMemo","name","useEffect","_virtualizedListRef$c","_virtualizedListRef$c2","current","resetAfterIndex","scrollToItem","VirtualizedList","height","width","itemSize","itemKey","_ref6","_itemData$index$props","_itemData$index2","_itemData$index3","_itemData$index4","onItemsRendered","_ref7","useCallback","_ref8","_virtualizedListRef$c3","_virtualizedListRef$c4","scrollDirection","round","ActionListVirtualizedBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAMA,cAAc,gBAAGC,cAAK,CAACC,UAAU,CACrC,UAAAC,IAAA,EAA4EC,GAAG,EAAK;AAAA,EAAA,IAAjFC,cAAc,GAAAF,IAAA,CAAdE,cAAc;IAAEC,yBAAyB,GAAAH,IAAA,CAAzBG,yBAAyB;IAAEC,iBAAiB,GAAAJ,IAAA,CAAjBI,iBAAiB;AAAKC,IAAAA,IAAI,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,SAAA,CAAA,CAAA;AACtE,EAAA,IAAAC,qBAAA,GAA4BC,qBAAqB,EAAE;IAA3CC,eAAe,GAAAF,qBAAA,CAAfE,eAAe,CAAA;EAEvB,oBACEC,GAAA,CAACC,oBAAoB,EAAAC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA;AACnBH,IAAAA,eAAe,EAAEA,eAAgB;AACjCT,IAAAA,GAAG,EAAEA,GAAAA;AAAI,GAAA,EACLa,cAAc,CAAC;AACjBC,IAAAA,IAAI,EAAEZ,yBAAyB;AAC/Ba,IAAAA,eAAe,EAAEb,yBAAyB,KAAK,SAAS,GAAGC,iBAAiB,GAAGa,SAAAA;AACjF,GAAC,CAAC,CAAA,EACEC,sBAAsB,CAACb,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAc,IAAAA,QAAA,EAE/BjB,cAAAA;AAAc,GAAA,CACK,C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CAAC,CAAC,CAAC,CAAA;AAC/C;AACpB;AACA;AACA;AACoBvB,YAAAA,kBAAkB,KAAlBA,IAAAA,IAAAA,kBAAkB,KAAAwC,KAAAA,CAAAA,IAAAA,CAAAA,sBAAA,GAAlBxC,kBAAkB,CAAEsB,OAAO,MAAAkB,IAAAA,IAAAA,sBAAA,KAA3BA,KAAAA,CAAAA,IAAAA,sBAAA,CAA6BhB,YAAY,CACvC9G,KAAK,IAAI+H,eAAe,KAAK,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAC5C,OACF,CAAC,CAAA;AACH,WAAA;AAAE,SACH,CAAC,CAAA;AAEN,OAAC,EACD,CAACnC,iBAAiB,EAAEI,gBAAgB,CACtC,CAAA;KACe,CAAA;AAAC,GAAA,CACE,CAAC,CAAA;AAE3B,CACF,CAAC,CAAA;AAEKiC,IAAAA,wBAAwB,gBAAGvI,wBAAwB,cAACvB,cAAK,CAACwB,IAAI,CAACwF,yBAAyB,CAAC,EAAE;AAC/FvF,EAAAA,WAAW,EAAE,0BAAA;AACf,CAAC;;;;"}
|
package/build/lib/web/development/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js
CHANGED
|
@@ -7,6 +7,7 @@ import '../../../utils/getFocusRingStyles/index.js';
|
|
|
7
7
|
import '../../Box/BaseBox/index.js';
|
|
8
8
|
import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
9
9
|
import { makeSize } from '../../../utils/makeSize/makeSize.js';
|
|
10
|
+
import { makeSpace } from '../../../utils/makeSpace/makeSpace.js';
|
|
10
11
|
import { getMediaQuery } from '../../../utils/getMediaQuery/getMediaQuery.js';
|
|
11
12
|
import { getFocusRingStyles } from '../../../utils/getFocusRingStyles/getFocusRingStyles.web.js';
|
|
12
13
|
|
|
@@ -20,6 +21,8 @@ var StyledMenuItemContainer = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
20
21
|
theme: props.theme
|
|
21
22
|
})), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
22
23
|
padding: makeSize(getItemPadding(props.theme).itemPaddingMobile),
|
|
24
|
+
marginTop: makeSpace(props.theme.spacing[1]),
|
|
25
|
+
marginBottom: makeSpace(props.theme.spacing[1]),
|
|
23
26
|
display: props.isVisible ? 'flex' : 'none'
|
|
24
27
|
}, "@media ".concat(getMediaQuery({
|
|
25
28
|
min: props.theme.breakpoints.m
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledMenuItemContainer.web.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport type { StyledBaseMenuItemContainerProps } from '../types';\nimport { getBaseMenuItemStyles } from './getBaseMenuItemStyles';\nimport { getItemPadding } from './tokens';\nimport { getMediaQuery, makeSize } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst StyledMenuItemContainer = styled(BaseBox)<StyledBaseMenuItemContainerProps>((props) => {\n return {\n ...getBaseMenuItemStyles({ theme: props.theme }),\n padding: makeSize(getItemPadding(props.theme).itemPaddingMobile),\n display: props.isVisible ? 'flex' : 'none',\n [`@media ${getMediaQuery({ min: props.theme.breakpoints.m })}`]: {\n padding: makeSize(getItemPadding(props.theme).itemPaddingDesktop),\n },\n '&:hover:not([aria-disabled=true]), &[aria-expanded=\"true\"]': {\n backgroundColor:\n props.color === 'negative'\n ? props.theme.colors.interactive.background.negative.faded\n : props.theme.colors.interactive.background.gray.default,\n },\n '&:focus-visible': getFocusRingStyles({ theme: props.theme }),\n '&.active-focus': props.isKeydownPressed\n ? getFocusRingStyles({ theme: props.theme })\n : undefined,\n '&[aria-selected=true], &[aria-selected=true]:hover': {\n backgroundColor:\n props.selectionType === 'single'\n ? props.theme.colors.interactive.background.gray.fadedHighlighted\n : undefined,\n },\n };\n});\n\nexport { StyledMenuItemContainer };\n"],"names":["StyledMenuItemContainer","styled","BaseBox","withConfig","displayName","componentId","props","_objectSpread","getBaseMenuItemStyles","theme","_defineProperty","padding","makeSize","getItemPadding","itemPaddingMobile","display","isVisible","concat","getMediaQuery","min","breakpoints","m","itemPaddingDesktop","backgroundColor","color","colors","interactive","background","negative","faded","gray","getFocusRingStyles","isKeydownPressed","undefined","selectionType","fadedHighlighted"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StyledMenuItemContainer.web.js","sources":["../../../../../../../src/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport type { StyledBaseMenuItemContainerProps } from '../types';\nimport { getBaseMenuItemStyles } from './getBaseMenuItemStyles';\nimport { getItemPadding } from './tokens';\nimport { getMediaQuery, makeSize, makeSpace } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst StyledMenuItemContainer = styled(BaseBox)<StyledBaseMenuItemContainerProps>((props) => {\n return {\n ...getBaseMenuItemStyles({ theme: props.theme }),\n padding: makeSize(getItemPadding(props.theme).itemPaddingMobile),\n marginTop: makeSpace(props.theme.spacing[1]),\n marginBottom: makeSpace(props.theme.spacing[1]),\n display: props.isVisible ? 'flex' : 'none',\n [`@media ${getMediaQuery({ min: props.theme.breakpoints.m })}`]: {\n padding: makeSize(getItemPadding(props.theme).itemPaddingDesktop),\n },\n '&:hover:not([aria-disabled=true]), &[aria-expanded=\"true\"]': {\n backgroundColor:\n props.color === 'negative'\n ? props.theme.colors.interactive.background.negative.faded\n : props.theme.colors.interactive.background.gray.default,\n },\n '&:focus-visible': getFocusRingStyles({ theme: props.theme }),\n '&.active-focus': props.isKeydownPressed\n ? getFocusRingStyles({ theme: props.theme })\n : undefined,\n '&[aria-selected=true], &[aria-selected=true]:hover': {\n backgroundColor:\n props.selectionType === 'single'\n ? props.theme.colors.interactive.background.gray.fadedHighlighted\n : undefined,\n },\n };\n});\n\nexport { StyledMenuItemContainer };\n"],"names":["StyledMenuItemContainer","styled","BaseBox","withConfig","displayName","componentId","props","_objectSpread","getBaseMenuItemStyles","theme","_defineProperty","padding","makeSize","getItemPadding","itemPaddingMobile","marginTop","makeSpace","spacing","marginBottom","display","isVisible","concat","getMediaQuery","min","breakpoints","m","itemPaddingDesktop","backgroundColor","color","colors","interactive","background","negative","faded","gray","getFocusRingStyles","isKeydownPressed","undefined","selectionType","fadedHighlighted"],"mappings":";;;;;;;;;;;;;;;AAQA,IAAMA,uBAAuB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,qDAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAmC,CAAA,CAAA,UAACC,KAAK,EAAK;AAC3F,EAAA,OAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EACKC,qBAAqB,CAAC;IAAEC,KAAK,EAAEH,KAAK,CAACG,KAAAA;GAAO,CAAC,CAAAC,EAAAA,EAAAA,EAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAA;IAChDC,OAAO,EAAEC,QAAQ,CAACC,cAAc,CAACP,KAAK,CAACG,KAAK,CAAC,CAACK,iBAAiB,CAAC;IAChEC,SAAS,EAAEC,SAAS,CAACV,KAAK,CAACG,KAAK,CAACQ,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5CC,YAAY,EAAEF,SAAS,CAACV,KAAK,CAACG,KAAK,CAACQ,OAAO,CAAC,CAAC,CAAC,CAAC;AAC/CE,IAAAA,OAAO,EAAEb,KAAK,CAACc,SAAS,GAAG,MAAM,GAAG,MAAA;GAAMC,EAAAA,SAAAA,CAAAA,MAAA,CAC/BC,aAAa,CAAC;AAAEC,IAAAA,GAAG,EAAEjB,KAAK,CAACG,KAAK,CAACe,WAAW,CAACC,CAAAA;AAAE,GAAC,CAAC,CAAK,EAAA;IAC/Dd,OAAO,EAAEC,QAAQ,CAACC,cAAc,CAACP,KAAK,CAACG,KAAK,CAAC,CAACiB,kBAAkB,CAAA;GACjE,CAAA,EACD,4DAA4D,EAAE;AAC5DC,IAAAA,eAAe,EACbrB,KAAK,CAACsB,KAAK,KAAK,UAAU,GACtBtB,KAAK,CAACG,KAAK,CAACoB,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,QAAQ,CAACC,KAAK,GACxD3B,KAAK,CAACG,KAAK,CAACoB,MAAM,CAACC,WAAW,CAACC,UAAU,CAACG,IAAI,CAAA,SAAA,CAAA;AACtD,GAAC,CACD,EAAA,iBAAiB,EAAEC,kBAAkB,CAAC;IAAE1B,KAAK,EAAEH,KAAK,CAACG,KAAAA;GAAO,CAAC,GAC7D,gBAAgB,EAAEH,KAAK,CAAC8B,gBAAgB,GACpCD,kBAAkB,CAAC;IAAE1B,KAAK,EAAEH,KAAK,CAACG,KAAAA;AAAM,GAAC,CAAC,GAC1C4B,SAAS,CAAA,EACb,oDAAoD,EAAE;IACpDV,eAAe,EACbrB,KAAK,CAACgC,aAAa,KAAK,QAAQ,GAC5BhC,KAAK,CAACG,KAAK,CAACoB,MAAM,CAACC,WAAW,CAACC,UAAU,CAACG,IAAI,CAACK,gBAAgB,GAC/DF,SAAAA;GACP,CAAA,CAAA,CAAA;AAEL,CAAC;;;;"}
|
|
@@ -157,6 +157,7 @@ var _Card = function _Card(_ref, ref) {
|
|
|
157
157
|
backgroundColor: "surface.background.gray.intense",
|
|
158
158
|
colorScheme: colorScheme,
|
|
159
159
|
isSelected: isSelected,
|
|
160
|
+
elevation: elevation,
|
|
160
161
|
overflow: overflow,
|
|
161
162
|
overflowX: overflowX,
|
|
162
163
|
overflowY: overflowY,
|
|
@@ -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 /**\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","_ref$borderRadius","borderRadius","_ref$elevation","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","_objectSpread","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","undefined","onFocus","onBlur","defaultRel","checkboxGroupProps","useCheckboxGroupContext","radioGroupProps","useRadioGroupContext","getGroupProps","Object","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,EAAAA,cAAc,EAAE,gBAAgB;AAChCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,eAAe,EAAE,iBAAiB;AAClCC,EAAAA,gBAAgB,EAAE,kBAAkB;AACpCC,EAAAA,cAAc,EAAE,gBAAgB;AAChCC,EAAAA,cAAc,EAAE,gBAAgB;AAChCC,EAAAA,oBAAoB,EAAE,sBAAA;AACxB,EAAC;AAsKD,IAAMC,KAAiE,GAAG,SAApEA,KAAiEA,CAAAC,IAAA,EAiCrEC,GAAG,EACoB;AAAA,EAAA,IAhCrBC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAERC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IAAAC,iBAAA,GAAAJ,IAAA,CACfK,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,iBAAA;IAAAE,cA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MAAM,EAAEA,MAAO;AAAAV,IAAAA,QAAA,EAEdA,QAAAA;AAAQ,GAAA,CACF,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMgF,IAAI,gBAAG1C,cAAK,CAACsD,UAAU,CAAC/F,KAAK,EAAC;AACpC,IAAMR,QAAQ,gBAAGwG,wBAAwB,CAACN,SAAS,EAAE;EAAEO,WAAW,EAAEhH,YAAY,CAACO,QAAAA;AAAS,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 elevation={elevation}\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","_ref$borderRadius","borderRadius","_ref$elevation","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","_objectSpread","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","undefined","onFocus","onBlur","defaultRel","checkboxGroupProps","useCheckboxGroupContext","radioGroupProps","useRadioGroupContext","getGroupProps","Object","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,EAAAA,cAAc,EAAE,gBAAgB;AAChCC,EAAAA,iBAAiB,EAAE,mBAAm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IAA3E9E,MAAM,GAAA8E,KAAA,CAAN9E,MAAM;IAAEV,QAAQ,GAAAwF,KAAA,CAARxF,QAAQ;IAAEM,MAAM,GAAAkF,KAAA,CAANlF,MAAM;AAAK4B,IAAAA,IAAI,GAAAC,wBAAA,CAAAqD,KAAA,EAAAC,UAAA,CAAA,CAAA;EACpDC,mBAAmB,CAAC,UAAU,CAAC,CAAA;EAE/B,oBACEjB,GAAA,CAACkB,OAAO,EAAAxC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CACFC,EAAAA,EAAAA,aAAa,CAAC;IAAEC,IAAI,EAAE0B,aAAa,CAAC1F,QAAQ;AAAEiB,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA,EACvD4E,sBAAsB,CAAChD,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAChCxB,IAAAA,MAAM,EAAEA,MAAO;AAAAV,IAAAA,QAAA,EAEdA,QAAAA;AAAQ,GAAA,CACF,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMgF,IAAI,gBAAG1C,cAAK,CAACsD,UAAU,CAAC/F,KAAK,EAAC;AACpC,IAAMR,QAAQ,gBAAGwG,wBAAwB,CAACN,SAAS,EAAE;EAAEO,WAAW,EAAEhH,YAAY,CAACO,QAAAA;AAAS,CAAC;;;;"}
|
|
@@ -79,16 +79,16 @@ var selectedCell = {
|
|
|
79
79
|
};
|
|
80
80
|
var inRangeCell = {
|
|
81
81
|
background: {
|
|
82
|
-
"default": '
|
|
83
|
-
hover: 'interactive.background.
|
|
82
|
+
"default": 'interactive.background.gray.fadedHighlighted',
|
|
83
|
+
hover: 'interactive.background.gray.fadedHighlighted'
|
|
84
84
|
},
|
|
85
85
|
border: {
|
|
86
|
-
"default": 'interactive.border.
|
|
87
|
-
hover: 'interactive.border.
|
|
86
|
+
"default": 'interactive.border.gray.default',
|
|
87
|
+
hover: 'interactive.border.gray.default'
|
|
88
88
|
},
|
|
89
89
|
text: {
|
|
90
|
-
"default": 'interactive.text.
|
|
91
|
-
hover: 'interactive.text.
|
|
90
|
+
"default": 'interactive.text.gray.normal',
|
|
91
|
+
hover: 'interactive.text.gray.normal'
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
var CalendarGradientStyles = /*#__PURE__*/styled(BaseBox).withConfig({
|