@razorpay/blade 11.28.1 → 11.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/build/lib/native/components/ActionList/ActionListItem.js +3 -2
  2. package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
  3. package/build/lib/native/components/ActionList/actionListUtils.js +1 -1
  4. package/build/lib/native/components/ActionList/actionListUtils.js.map +1 -1
  5. package/build/lib/native/components/ActionList/componentIds.js +1 -1
  6. package/build/lib/native/components/ActionList/componentIds.js.map +1 -1
  7. package/build/lib/native/components/Form/FormHint.js +2 -1
  8. package/build/lib/native/components/Form/FormHint.js.map +1 -1
  9. package/build/lib/native/components/index.js +1 -1
  10. package/build/lib/web/development/components/ActionList/ActionListItem.js +11 -1
  11. package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
  12. package/build/lib/web/development/components/ActionList/actionListUtils.js +2 -2
  13. package/build/lib/web/development/components/ActionList/actionListUtils.js.map +1 -1
  14. package/build/lib/web/development/components/ActionList/componentIds.js +1 -0
  15. package/build/lib/web/development/components/ActionList/componentIds.js.map +1 -1
  16. package/build/lib/web/development/components/ActionList/index.js +1 -1
  17. package/build/lib/web/development/components/Form/FormHint.js +19 -15
  18. package/build/lib/web/development/components/Form/FormHint.js.map +1 -1
  19. package/build/lib/web/development/components/Form/FormHintWrapper.web.js +2 -4
  20. package/build/lib/web/development/components/Form/FormHintWrapper.web.js.map +1 -1
  21. package/build/lib/web/development/components/StepGroup/StepItem.web.js +11 -6
  22. package/build/lib/web/development/components/StepGroup/StepItem.web.js.map +1 -1
  23. package/build/lib/web/development/components/Tooltip/TooltipInteractiveWrapper.web.js +9 -13
  24. package/build/lib/web/development/components/Tooltip/TooltipInteractiveWrapper.web.js.map +1 -1
  25. package/build/lib/web/development/components/index.js +1 -1
  26. package/build/lib/web/production/components/ActionList/ActionListItem.js +11 -1
  27. package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
  28. package/build/lib/web/production/components/ActionList/actionListUtils.js +2 -2
  29. package/build/lib/web/production/components/ActionList/actionListUtils.js.map +1 -1
  30. package/build/lib/web/production/components/ActionList/componentIds.js +1 -0
  31. package/build/lib/web/production/components/ActionList/componentIds.js.map +1 -1
  32. package/build/lib/web/production/components/ActionList/index.js +1 -1
  33. package/build/lib/web/production/components/Form/FormHint.js +19 -15
  34. package/build/lib/web/production/components/Form/FormHint.js.map +1 -1
  35. package/build/lib/web/production/components/Form/FormHintWrapper.web.js +2 -4
  36. package/build/lib/web/production/components/Form/FormHintWrapper.web.js.map +1 -1
  37. package/build/lib/web/production/components/StepGroup/StepItem.web.js +11 -6
  38. package/build/lib/web/production/components/StepGroup/StepItem.web.js.map +1 -1
  39. package/build/lib/web/production/components/Tooltip/TooltipInteractiveWrapper.web.js +9 -13
  40. package/build/lib/web/production/components/Tooltip/TooltipInteractiveWrapper.web.js.map +1 -1
  41. package/build/lib/web/production/components/index.js +1 -1
  42. package/build/types/components/index.d.ts +445 -1131
  43. package/build/types/components/index.native.d.ts +254 -249
  44. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ActionListItem.js","sources":["../../../../../../src/components/ActionList/ActionListItem.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { TouchableOpacity } from 'react-native';\nimport { componentIds } from './componentIds';\nimport { validateActionListItemProps, getNormalTextColor } from './actionListUtils';\nimport { getActionListItemRole, getActionListSectionRole } from './getA11yRoles';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport type { Platform } from '~utils';\nimport { castWebType, isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport { Box } from '~components/Box';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { BaseMenuItem, useBaseMenuItem } from '~components/BaseMenu';\nimport { Checkbox } from '~components/Checkbox';\n\ntype ActionListItemProps = {\n title: string;\n description?: string;\n onClick?: (clickProps: {\n name: string;\n value?: boolean;\n event: Platform.Select<{\n web: React.MouseEvent;\n native: React.TouchEvent<TouchableOpacity>;\n }>;\n }) => void;\n /**\n * value that you get from `onChange` event on SelectInput or in form submissions.\n */\n value: string;\n /**\n * Link to open when item is clicked.\n */\n href?: string;\n /**\n * HTML target of the link\n */\n target?: string;\n /**\n * Item that goes on left-side of item.\n *\n * Valid elements - `<ActionListItemIcon />`, `<ActionListItemAsset />`\n *\n * Will be overriden in multiselect\n */\n leading?: React.ReactNode;\n /**\n * Item that goes on right-side of item.\n *\n * Valid elements - `<ActionListItemText />`, `<ActionListItemIcon />`\n */\n trailing?: React.ReactNode;\n /**\n * Item that goes immediately next to the title.\n *\n * Valid elements - `<ActionListItemBadge />`, `<ActionListItemBadgeGroup />`\n *\n */\n titleSuffix?: React.ReactElement;\n isDisabled?: boolean;\n intent?: Extract<FeedbackColors, 'negative'>;\n /**\n * Can be used in combination of `onClick` to highlight item as selected in Button Triggers.\n *\n * When trigger is SelectInput, Use `value` prop on SelectInput instead to make dropdown controlled.\n */\n isSelected?: boolean;\n /**\n * Internally passed from ActionList. No need to pass it explicitly\n *\n * @private\n */\n _index?: number;\n} & TestID;\n\nconst StyledActionListSectionTitle = styled(BaseBox)((props) => ({\n // @TODO: replace this styled-component with new layout box when we have padding shorthand\n padding: makeSize(props.theme.spacing[3]),\n}));\n\ntype ActionListSectionProps = {\n title: string;\n children: React.ReactNode[] | React.ReactNode;\n /**\n * Internally used to hide the divider on final item in React Native.\n *\n * Should not be used by consumers (also won't work on web)\n *\n * @private\n */\n _hideDivider?: boolean;\n /**\n * Internally used to hide / show section in AutoComplete\n *\n * @private\n */\n _sectionChildValues?: string[];\n} & TestID;\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInBottomSheetHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const isSectionVisible = React.useMemo(() => {\n if (hasAutoComplete) {\n const visibleActionListItemInSection = _sectionChildValues?.find((actionItemValue) =>\n filteredValues.includes(actionItemValue),\n );\n\n return Boolean(visibleActionListItemInSection);\n }\n\n return true;\n }, [_sectionChildValues, hasAutoComplete, filteredValues]);\n\n const showDividerInRN = !(_hideDivider && isReactNative());\n const showDividerInAutoComplete = hasAutoComplete\n ? isSectionVisible && filteredValues.length > 1\n : true;\n\n return (\n <BaseBox\n {...makeAccessible({\n role: getActionListSectionRole(),\n label: title,\n })}\n {...metaAttribute({ name: MetaConstants.ActionListSection, testID })}\n >\n {/* We're announcing title as group label so we can hide this */}\n {isSectionVisible ? (\n <StyledActionListSectionTitle {...makeAccessible({ hidden: true })}>\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n ) : null}\n <BaseBox\n {...makeAccessible({\n // On web, we just wrap it in another listbox to announce item count properly for particular group.\n // On React Native, we ignore it since `menu` + `group` role will take care of accessibility\n role: isReactNative() ? undefined : 'listbox',\n })}\n >\n {children}\n </BaseBox>\n {showDividerInAutoComplete && showDividerInRN ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" />\n ) : null}\n </BaseBox>\n );\n};\n\nconst ActionListSection = assignWithoutSideEffects(_ActionListSection, {\n componentId: componentIds.ActionListSection,\n});\n\nconst _ActionListItemIcon = ({ icon }: { icon: IconComponent }): React.ReactElement => {\n const Icon = icon;\n const { color, isDisabled } = useBaseMenuItem();\n const iconState = isDisabled ? 'disabled' : 'muted';\n return (\n <Icon\n color={\n color === 'negative'\n ? 'feedback.icon.negative.intense'\n : `interactive.icon.gray.${iconState}`\n }\n size=\"medium\"\n />\n );\n};\n\nconst ActionListItemIcon = assignWithoutSideEffects(_ActionListItemIcon, {\n componentId: componentIds.ActionListItemIcon,\n});\n\nconst _ActionListItemBadgeGroup = ({\n children,\n}: {\n children: React.ReactElement[] | React.ReactElement;\n}): React.ReactElement => {\n return (\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n {children}\n </Box>\n );\n};\n\nconst ActionListItemBadgeGroup = assignWithoutSideEffects(_ActionListItemBadgeGroup, {\n componentId: componentIds.ActionListItemBadgeGroup,\n});\n\nconst _ActionListItemBadge = (props: BadgeProps): React.ReactElement => {\n return <Badge size=\"medium\" marginLeft=\"spacing.3\" {...props} />;\n};\n\nconst ActionListItemBadge = assignWithoutSideEffects(_ActionListItemBadge, {\n componentId: componentIds.ActionListItemBadge,\n});\n\nconst _ActionListItemText = ({\n children,\n}: {\n children: StringChildrenType;\n}): React.ReactElement => {\n const { isDisabled } = useBaseMenuItem();\n\n return (\n <Text variant=\"caption\" color={getNormalTextColor(isDisabled, { isMuted: true })}>\n {children}\n </Text>\n );\n};\n\nconst ActionListItemText = assignWithoutSideEffects(_ActionListItemText, {\n componentId: componentIds.ActionListItemText,\n});\n\ntype ClickHandlerType = (e: React.MouseEvent<HTMLButtonElement>) => void;\n\nconst makeActionListItemClickable = (\n clickHandler: ClickHandlerType,\n): { onPress?: (e: React.TouchEvent<TouchableOpacity>) => void; onClick?: ClickHandlerType } => {\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: ignoring ReactNative press type for the peace of mind\n return { onPress: clickHandler };\n }\n\n return {\n onClick: clickHandler,\n };\n};\n\n/**\n * ### ActionListItem\n *\n * Creates option inside `ActionList`.\n *\n * #### Usage\n *\n * ```jsx\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * trailing={<ActionListItemText>⌘ + S</ActionListItemText>}\n * />\n * </ActionList>\n * ```\n */\nconst _ActionListItem = (props: ActionListItemProps): React.ReactElement => {\n const {\n activeIndex,\n dropdownBaseId,\n onOptionClick,\n selectedIndices,\n setShouldIgnoreBlurAnimation,\n selectionType,\n dropdownTriggerer,\n isKeydownPressed,\n filteredValues,\n hasAutoCompleteInBottomSheetHeader,\n } = useDropdown();\n\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n\n /**\n * In SelectInput, returns the isSelected according to selected indexes in the state\n *\n * In Other Triggers (Menu Usecase), returns `props.isSelected` since passing the\n * isSelected prop explicitly is the only way to select item in menu\n */\n const getIsSelected = (): boolean | undefined => {\n if (dropdownTriggerer === dropdownComponentIds.triggers.SelectInput || hasAutoComplete) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\n\n return undefined;\n }\n\n return props.isSelected;\n };\n\n const isSelected = getIsSelected();\n\n React.useEffect(() => {\n validateActionListItemProps({\n leading: props.leading,\n trailing: props.trailing,\n titleSuffix: props.titleSuffix,\n });\n }, [props.leading, props.trailing, props.titleSuffix]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput &&\n props.intent === 'negative'\n ) {\n throwBladeError({\n message:\n 'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',\n moduleName: 'ActionListItem',\n });\n }\n }\n }, [props.intent, dropdownTriggerer]);\n\n return (\n // We use this context to change the color of subcomponents like ActionListItemIcon, ActionListItemText, etc\n <BaseMenuItem\n isVisible={hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true}\n as={!isReactNative() ? renderOnWebAs : undefined}\n id={`${dropdownBaseId}-${props._index}`}\n tabIndex={-1}\n title={props.title}\n description={props.description}\n leading={\n selectionType === 'multiple' ? (\n <BaseBox\n pointerEvents=\"none\"\n // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us\n {...makeAccessible({\n hidden: true,\n })}\n >\n <Checkbox isChecked={isSelected} tabIndex={-1} isDisabled={props.isDisabled}>\n {/* \n Checkbox requires children. Didn't want to make it optional because its helpful for consumers\n But for this case in particular, we just want to use Text separately so that we can control spacing and color and keep it consistent with non-multiselect dropdowns\n */}\n {null}\n </Checkbox>\n </BaseBox>\n ) : (\n props.leading\n )\n }\n trailing={props.trailing}\n titleSuffix={props.titleSuffix}\n href={props.href}\n target={props.target}\n className={activeIndex === props._index ? 'active-focus' : ''}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n role={getActionListItemRole(dropdownTriggerer, props.href)}\n {...makeActionListItemClickable((e: React.MouseEvent<HTMLButtonElement>): void => {\n if (typeof props._index === 'number') {\n onOptionClick(e, props._index);\n props.onClick?.({ name: props.value, value: isSelected, event: castWebType(e) });\n }\n })}\n {...metaAttribute({ name: MetaConstants.ActionListItem, testID: props.testID })}\n onMouseDown={() => {\n // We want to keep focus on Dropdown's trigger while option is being clicked\n // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in\n setShouldIgnoreBlurAnimation(true);\n }}\n onMouseUp={() => {\n // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time\n setShouldIgnoreBlurAnimation(false);\n }}\n data-value={props.value}\n data-index={props._index}\n selectionType={selectionType}\n color={props.intent}\n isKeydownPressed={isKeydownPressed}\n />\n );\n};\n\nconst ActionListItem = assignWithoutSideEffects(React.memo(_ActionListItem), {\n componentId: componentIds.ActionListItem,\n displayName: componentIds.ActionListItem,\n});\n\nexport type { ActionListItemProps, ActionListSectionProps };\nexport {\n ActionListItem,\n ActionListItemIcon,\n ActionListItemText,\n ActionListItemBadge,\n ActionListItemBadgeGroup,\n ActionListSection,\n};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","withConfig","displayName","componentId","props","padding","makeSize","theme","spacing","_ActionListSection","_ref","title","children","testID","_hideDivider","_sectionChildValues","_useDropdown","useDropdown","hasAutoCompleteInBottomSheetHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","_objectSpread","makeAccessible","role","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","_jsx","hidden","Text","color","size","weight","undefined","Divider","marginX","marginY","assignWithoutSideEffects","componentIds","_ActionListItemIcon","_ref2","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","concat","ActionListItemIcon","_ActionListItemBadgeGroup","_ref3","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref4","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","renderOnWebAs","href","getIsSelected","SelectInput","_index","isSelected","useEffect","validateActionListItemProps","leading","trailing","titleSuffix","intent","throwBladeError","message","moduleName","BaseMenuItem","isVisible","value","as","id","tabIndex","description","pointerEvents","Checkbox","isChecked","target","className","getActionListItemRole","e","_props$onClick","call","event","castWebType","ActionListItem","onMouseDown","onMouseUp","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,IAAMA,4BAA4B,gBAAGC,MAAM,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nB,CAAA,CAAA;AAAC,IAAA;AAEN,CAAC,CAAA;AAEKkC,IAAAA,cAAc,gBAAG5E,wBAAwB,eAAC/B,cAAK,CAAC8G,IAAI,CAAC7C,eAAe,CAAC,EAAE;EAC3ExF,WAAW,EAAEuD,YAAY,CAAC2E,cAAc;EACxCnI,WAAW,EAAEwD,YAAY,CAAC2E,cAAAA;AAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"ActionListItem.js","sources":["../../../../../../src/components/ActionList/ActionListItem.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { TouchableOpacity } from 'react-native';\nimport { componentIds } from './componentIds';\nimport { validateActionListItemProps, getNormalTextColor } from './actionListUtils';\nimport { getActionListItemRole, getActionListSectionRole } from './getA11yRoles';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport type { Platform } from '~utils';\nimport { castWebType, isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport { Box } from '~components/Box';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { BaseMenuItem, useBaseMenuItem } from '~components/BaseMenu';\nimport { Checkbox } from '~components/Checkbox';\nimport type { AvatarProps } from '~components/Avatar/types';\nimport { Avatar } from '~components/Avatar';\n\ntype ActionListItemProps = {\n title: string;\n description?: string;\n onClick?: (clickProps: {\n name: string;\n value?: boolean;\n event: Platform.Select<{\n web: React.MouseEvent;\n native: React.TouchEvent<TouchableOpacity>;\n }>;\n }) => void;\n /**\n * value that you get from `onChange` event on SelectInput or in form submissions.\n */\n value: string;\n /**\n * Link to open when item is clicked.\n */\n href?: string;\n /**\n * HTML target of the link\n */\n target?: string;\n /**\n * Item that goes on left-side of item.\n *\n * Valid elements - `<ActionListItemIcon />`, `<ActionListItemAsset />`\n *\n * Will be overriden in multiselect\n */\n leading?: React.ReactNode;\n /**\n * Item that goes on right-side of item.\n *\n * Valid elements - `<ActionListItemText />`, `<ActionListItemIcon />`\n */\n trailing?: React.ReactNode;\n /**\n * Item that goes immediately next to the title.\n *\n * Valid elements - `<ActionListItemBadge />`, `<ActionListItemBadgeGroup />`\n *\n */\n titleSuffix?: React.ReactElement;\n isDisabled?: boolean;\n intent?: Extract<FeedbackColors, 'negative'>;\n /**\n * Can be used in combination of `onClick` to highlight item as selected in Button Triggers.\n *\n * When trigger is SelectInput, Use `value` prop on SelectInput instead to make dropdown controlled.\n */\n isSelected?: boolean;\n /**\n * Internally passed from ActionList. No need to pass it explicitly\n *\n * @private\n */\n _index?: number;\n} & TestID;\n\nconst StyledActionListSectionTitle = styled(BaseBox)((props) => ({\n // @TODO: replace this styled-component with new layout box when we have padding shorthand\n padding: makeSize(props.theme.spacing[3]),\n}));\n\ntype ActionListSectionProps = {\n title: string;\n children: React.ReactNode[] | React.ReactNode;\n /**\n * Internally used to hide the divider on final item in React Native.\n *\n * Should not be used by consumers (also won't work on web)\n *\n * @private\n */\n _hideDivider?: boolean;\n /**\n * Internally used to hide / show section in AutoComplete\n *\n * @private\n */\n _sectionChildValues?: string[];\n} & TestID;\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInBottomSheetHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const isSectionVisible = React.useMemo(() => {\n if (hasAutoComplete) {\n const visibleActionListItemInSection = _sectionChildValues?.find((actionItemValue) =>\n filteredValues.includes(actionItemValue),\n );\n\n return Boolean(visibleActionListItemInSection);\n }\n\n return true;\n }, [_sectionChildValues, hasAutoComplete, filteredValues]);\n\n const showDividerInRN = !(_hideDivider && isReactNative());\n const showDividerInAutoComplete = hasAutoComplete\n ? isSectionVisible && filteredValues.length > 1\n : true;\n\n return (\n <BaseBox\n {...makeAccessible({\n role: getActionListSectionRole(),\n label: title,\n })}\n {...metaAttribute({ name: MetaConstants.ActionListSection, testID })}\n >\n {/* We're announcing title as group label so we can hide this */}\n {isSectionVisible ? (\n <StyledActionListSectionTitle {...makeAccessible({ hidden: true })}>\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n ) : null}\n <BaseBox\n {...makeAccessible({\n // On web, we just wrap it in another listbox to announce item count properly for particular group.\n // On React Native, we ignore it since `menu` + `group` role will take care of accessibility\n role: isReactNative() ? undefined : 'listbox',\n })}\n >\n {children}\n </BaseBox>\n {showDividerInAutoComplete && showDividerInRN ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" />\n ) : null}\n </BaseBox>\n );\n};\n\nconst ActionListSection = assignWithoutSideEffects(_ActionListSection, {\n componentId: componentIds.ActionListSection,\n});\n\nconst _ActionListItemIcon = ({ icon }: { icon: IconComponent }): React.ReactElement => {\n const Icon = icon;\n const { color, isDisabled } = useBaseMenuItem();\n const iconState = isDisabled ? 'disabled' : 'muted';\n return (\n <Icon\n color={\n color === 'negative'\n ? 'feedback.icon.negative.intense'\n : `interactive.icon.gray.${iconState}`\n }\n size=\"medium\"\n />\n );\n};\n\nconst ActionListItemIcon = assignWithoutSideEffects(_ActionListItemIcon, {\n componentId: componentIds.ActionListItemIcon,\n});\n\nconst _ActionListItemBadgeGroup = ({\n children,\n}: {\n children: React.ReactElement[] | React.ReactElement;\n}): React.ReactElement => {\n return (\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n {children}\n </Box>\n );\n};\n\nconst ActionListItemBadgeGroup = assignWithoutSideEffects(_ActionListItemBadgeGroup, {\n componentId: componentIds.ActionListItemBadgeGroup,\n});\n\nconst _ActionListItemAvatar = (avatarProps: Omit<AvatarProps, 'size' | ''>): React.ReactElement => {\n return <Avatar size=\"xsmall\" {...avatarProps} />;\n};\n\nconst ActionListItemAvatar = assignWithoutSideEffects(_ActionListItemAvatar, {\n componentId: componentIds.ActionListItemAvatar,\n});\n\nconst _ActionListItemBadge = (props: BadgeProps): React.ReactElement => {\n return <Badge size=\"medium\" marginLeft=\"spacing.3\" {...props} />;\n};\n\nconst ActionListItemBadge = assignWithoutSideEffects(_ActionListItemBadge, {\n componentId: componentIds.ActionListItemBadge,\n});\n\nconst _ActionListItemText = ({\n children,\n}: {\n children: StringChildrenType;\n}): React.ReactElement => {\n const { isDisabled } = useBaseMenuItem();\n\n return (\n <Text variant=\"caption\" color={getNormalTextColor(isDisabled, { isMuted: true })}>\n {children}\n </Text>\n );\n};\n\nconst ActionListItemText = assignWithoutSideEffects(_ActionListItemText, {\n componentId: componentIds.ActionListItemText,\n});\n\ntype ClickHandlerType = (e: React.MouseEvent<HTMLButtonElement>) => void;\n\nconst makeActionListItemClickable = (\n clickHandler: ClickHandlerType,\n): { onPress?: (e: React.TouchEvent<TouchableOpacity>) => void; onClick?: ClickHandlerType } => {\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: ignoring ReactNative press type for the peace of mind\n return { onPress: clickHandler };\n }\n\n return {\n onClick: clickHandler,\n };\n};\n\n/**\n * ### ActionListItem\n *\n * Creates option inside `ActionList`.\n *\n * #### Usage\n *\n * ```jsx\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * trailing={<ActionListItemText>⌘ + S</ActionListItemText>}\n * />\n * </ActionList>\n * ```\n */\nconst _ActionListItem = (props: ActionListItemProps): React.ReactElement => {\n const {\n activeIndex,\n dropdownBaseId,\n onOptionClick,\n selectedIndices,\n setShouldIgnoreBlurAnimation,\n selectionType,\n dropdownTriggerer,\n isKeydownPressed,\n filteredValues,\n hasAutoCompleteInBottomSheetHeader,\n } = useDropdown();\n\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n\n /**\n * In SelectInput, returns the isSelected according to selected indexes in the state\n *\n * In Other Triggers (Menu Usecase), returns `props.isSelected` since passing the\n * isSelected prop explicitly is the only way to select item in menu\n */\n const getIsSelected = (): boolean | undefined => {\n if (dropdownTriggerer === dropdownComponentIds.triggers.SelectInput || hasAutoComplete) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\n\n return undefined;\n }\n\n return props.isSelected;\n };\n\n const isSelected = getIsSelected();\n\n React.useEffect(() => {\n validateActionListItemProps({\n leading: props.leading,\n trailing: props.trailing,\n titleSuffix: props.titleSuffix,\n });\n }, [props.leading, props.trailing, props.titleSuffix]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput &&\n props.intent === 'negative'\n ) {\n throwBladeError({\n message:\n 'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',\n moduleName: 'ActionListItem',\n });\n }\n }\n }, [props.intent, dropdownTriggerer]);\n\n return (\n // We use this context to change the color of subcomponents like ActionListItemIcon, ActionListItemText, etc\n <BaseMenuItem\n isVisible={hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true}\n as={!isReactNative() ? renderOnWebAs : undefined}\n id={`${dropdownBaseId}-${props._index}`}\n tabIndex={-1}\n title={props.title}\n description={props.description}\n leading={\n selectionType === 'multiple' ? (\n <BaseBox\n pointerEvents=\"none\"\n // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us\n {...makeAccessible({\n hidden: true,\n })}\n >\n <Checkbox isChecked={isSelected} tabIndex={-1} isDisabled={props.isDisabled}>\n {/* \n Checkbox requires children. Didn't want to make it optional because its helpful for consumers\n But for this case in particular, we just want to use Text separately so that we can control spacing and color and keep it consistent with non-multiselect dropdowns\n */}\n {null}\n </Checkbox>\n </BaseBox>\n ) : (\n props.leading\n )\n }\n trailing={props.trailing}\n titleSuffix={props.titleSuffix}\n href={props.href}\n target={props.target}\n className={activeIndex === props._index ? 'active-focus' : ''}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n role={getActionListItemRole(dropdownTriggerer, props.href)}\n {...makeActionListItemClickable((e: React.MouseEvent<HTMLButtonElement>): void => {\n if (typeof props._index === 'number') {\n onOptionClick(e, props._index);\n props.onClick?.({ name: props.value, value: isSelected, event: castWebType(e) });\n }\n })}\n {...metaAttribute({ name: MetaConstants.ActionListItem, testID: props.testID })}\n onMouseDown={() => {\n // We want to keep focus on Dropdown's trigger while option is being clicked\n // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in\n setShouldIgnoreBlurAnimation(true);\n }}\n onMouseUp={() => {\n // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time\n setShouldIgnoreBlurAnimation(false);\n }}\n data-value={props.value}\n data-index={props._index}\n selectionType={selectionType}\n color={props.intent}\n isKeydownPressed={isKeydownPressed}\n />\n );\n};\n\nconst ActionListItem = assignWithoutSideEffects(React.memo(_ActionListItem), {\n componentId: componentIds.ActionListItem,\n displayName: componentIds.ActionListItem,\n});\n\nexport type { ActionListItemProps, ActionListSectionProps };\nexport {\n ActionListItem,\n ActionListItemIcon,\n ActionListItemText,\n ActionListItemAvatar,\n ActionListItemBadge,\n ActionListItemBadgeGroup,\n ActionListSection,\n};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","withConfig","displayName","componentId","props","padding","makeSize","theme","spacing","_ActionListSection","_ref","title","children","testID","_hideDivider","_sectionChildValues","_useDropdown","useDropdown","hasAutoCompleteInBottomSheetHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","_objectSpread","makeAccessible","role","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","_jsx","hidden","Text","color","size","weight","undefined","Divider","marginX","marginY","assignWithoutSideEffects","componentIds","_ActionListItemIcon","_ref2","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","concat","ActionListItemIcon","_ActionListItemBadgeGroup","_ref3","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemAvatar","avatarProps","Avatar","ActionListItemAvatar","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref4","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","renderOnWebAs","href","getIsSelected","SelectInput","_index","isSelected","useEffect","validateActionListItemProps","leading","trailing","titleSuffix","intent","throwBladeError","message","moduleName","BaseMenuItem","isVisible","value","as","id","tabIndex","description","pointerEvents","Checkbox","isChecked","target","className","getActionListItemRole","e","_props$onClick","call","event","castWebType","ActionListItem","onMouseDown","onMouseUp","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,IAAMA,4BAA4B,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,8CAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAAC,UAACC,KAAK,EAAA;EAAA,OAAM;AAC/D;IACA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C;MACF,YAAYjG,EAAAA,KAAK,CAACqH,KAAM;MACxB,YAAYrH,EAAAA,KAAK,CAACwG,MAAO;AACzBN,MAAAA,aAAa,EAAEA,aAAc;MAC7BpD,KAAK,EAAE9C,KAAK,CAAC+G,MAAO;AACpBZ,MAAAA,gBAAgB,EAAEA,gBAAAA;KACnB,CAAA,CAAA;AAAC,IAAA;AAEN,CAAC,CAAA;AAEKkC,IAAAA,cAAc,gBAAGhF,wBAAwB,eAAC/B,cAAK,CAACkH,IAAI,CAAC7C,eAAe,CAAC,EAAE;EAC3E5F,WAAW,EAAEuD,YAAY,CAAC+E,cAAc;EACxCvI,WAAW,EAAEwD,YAAY,CAAC+E,cAAAA;AAC5B,CAAC;;;;"}
@@ -163,9 +163,9 @@ var validateActionListItemProps = function validateActionListItemProps(_ref) {
163
163
  }
164
164
  });
165
165
  React__default.Children.map(leading, function (child) {
166
- if (!isValidAllowedChildren(child, componentIds.ActionListItemIcon) && !isValidAllowedChildren(child, componentIds.ActionListItemText) && !isValidAllowedChildren(child, componentIds.ActionListItemAsset)) {
166
+ if (!isValidAllowedChildren(child, componentIds.ActionListItemIcon) && !isValidAllowedChildren(child, componentIds.ActionListItemText) && !isValidAllowedChildren(child, componentIds.ActionListItemAsset) && !isValidAllowedChildren(child, componentIds.ActionListItemAvatar)) {
167
167
  throwBladeError({
168
- message: "Only ".concat(componentIds.ActionListItemIcon, ", ").concat(componentIds.ActionListItemAsset, ", and ").concat(componentIds.ActionListItemText, " are allowed in leading prop"),
168
+ message: "Only ".concat(componentIds.ActionListItemIcon, ", ").concat(componentIds.ActionListItemAvatar, ", ").concat(componentIds.ActionListItemAsset, ", and ").concat(componentIds.ActionListItemText, " are allowed in leading prop"),
169
169
  moduleName: 'ActionListItem'
170
170
  });
171
171
  }
@@ -1 +1 @@
1
- {"version":3,"file":"actionListUtils.js","sources":["../../../../../../src/components/ActionList/actionListUtils.ts"],"sourcesContent":["import React from 'react';\nimport { componentIds } from './componentIds';\nimport type { ActionListItemProps } from './ActionListItem';\nimport type { OptionsType } from '~components/Dropdown/useDropdown';\nimport { isReactNative } from '~utils';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\n/**\n * Returns if there is ActionListItem after ActionListSection\n * and an index of last ActionListSection\n *\n * It is used to decide if ActionListSection add divider at the end\n */\nconst getActionListSectionPosition = (\n children: React.ReactNode,\n): {\n isActionListItemPresentAfterSection: boolean;\n lastActionListSectionIndex: number;\n} => {\n // Creating an array of componentIds\n const childComponentIdArray = React.Children.toArray(children).map((child) =>\n getComponentId(child),\n );\n\n // Reading the last `ActionListSection` component's index\n const lastActionListSectionIndex = childComponentIdArray.lastIndexOf(\n componentIds.ActionListSection,\n );\n\n // Checking if there is any `ActionListItem` present after `ActionListSection`\n const isActionListItemPresentAfterSection = childComponentIdArray\n .slice(lastActionListSectionIndex)\n .includes(componentIds.ActionListItem);\n\n return {\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n };\n};\n\nconst actionListAllowedChildren = [componentIds.ActionListItem, componentIds.ActionListSection];\n\nexport type SectionData = {\n title: string;\n hideDivider: boolean;\n data: ActionListItemProps[];\n}[];\n\n/**\n * Loops over action list items and returns different properties from children like option values, header and footer child, etc\n */\nconst getActionListProperties = (\n children: React.ReactNode,\n): {\n sectionData: SectionData;\n childrenWithId?: React.ReactNode[] | null;\n actionListOptions: OptionsType;\n} => {\n const sectionData: SectionData = [];\n let currentSection: string | null = null;\n const actionListOptions: OptionsType = [];\n\n const getActionListItemWithId = (\n child: React.ReactNode,\n hideDivider: boolean,\n ): React.ReactNode => {\n if (React.isValidElement(child) && !child.props.isDisabled) {\n actionListOptions.push({\n title: child.props.title,\n value: child.props.value,\n onClickTrigger: (value) => {\n const anchorLink = child.props.href;\n child.props.onClick?.({\n name: child.props.value,\n value: child.props.isSelected ?? value,\n });\n\n if (anchorLink && !isReactNative()) {\n const target = child.props.target ?? '_self';\n window.open(anchorLink, target);\n if (window.top) {\n window.top.open(anchorLink, target);\n }\n }\n },\n });\n const currentIndex = actionListOptions.length - 1;\n\n const foundSection = sectionData.find((v) => v.title === currentSection);\n // push the item in the appropriate bucket\n if (foundSection) {\n foundSection?.data.push({\n ...child.props,\n _index: currentIndex,\n });\n } else {\n // create a new bucket\n sectionData.push({\n title: currentSection!,\n hideDivider,\n data: [\n {\n ...child.props,\n _index: currentIndex,\n },\n ],\n });\n }\n\n const clonedChild = React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n _index: currentIndex,\n });\n return clonedChild;\n }\n\n return child;\n };\n\n let isActionListItemPresentAfterSection: boolean;\n // eslint-disable-next-line one-var\n let lastActionListSectionIndex: number;\n\n if (isReactNative()) {\n // We're reading this so that we can decide whether to show the divider or not.\n // If ActionListSection is final item and no ActionListItem is present after that, we hide the divider\n\n // On web, we do it using descendant styling\n ({\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n } = getActionListSectionPosition(children));\n }\n\n // Looping through ActionListItems to add index to them and get an options array for moving focus between items\n const childrenWithId = React.Children.map(children, (child, index) => {\n if (React.isValidElement(child)) {\n if (isValidAllowedChildren(child, componentIds.ActionListSection)) {\n const shouldHideDivider =\n index === lastActionListSectionIndex && !isActionListItemPresentAfterSection;\n const sectionChildValues: string[] = [];\n return React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n children: React.Children.map(child.props.children, (childInSection) => {\n currentSection = child.props.title;\n sectionChildValues.push(childInSection.props.value);\n if (isValidAllowedChildren(childInSection, componentIds.ActionListItem)) {\n return getActionListItemWithId(childInSection, shouldHideDivider);\n }\n\n return childInSection;\n }),\n // On web, we handle it with descendant styling in css so no need of JS there\n _hideDivider: isReactNative() ? shouldHideDivider : undefined,\n _sectionChildValues: sectionChildValues,\n });\n }\n\n if (isValidAllowedChildren(child, componentIds.ActionListItem)) {\n return getActionListItemWithId(child, true);\n }\n\n if (__DEV__) {\n throwBladeError({\n message: `Only ${actionListAllowedChildren.join(', ')} supported inside ActionList`,\n moduleName: 'ActionList',\n });\n }\n }\n return child;\n });\n\n return {\n sectionData,\n childrenWithId,\n actionListOptions,\n };\n};\n\nconst validateActionListItemProps = ({\n leading,\n trailing,\n titleSuffix,\n}: {\n leading: ActionListItemProps['leading'];\n trailing: ActionListItemProps['trailing'];\n titleSuffix: ActionListItemProps['titleSuffix'];\n}): void => {\n if (__DEV__) {\n React.Children.map(trailing, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon} and ${componentIds.ActionListItemText} are allowed in trailing prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(titleSuffix, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemBadge) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemBadgeGroup)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemBadge} and ${componentIds.ActionListItemBadgeGroup} are allowed in titleSuffix prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(leading, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemAsset)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon}, ${componentIds.ActionListItemAsset}, and ${componentIds.ActionListItemText} are allowed in leading prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n }\n};\n\nconst getNormalTextColor = (\n isDisabled: boolean | undefined,\n { isMuted }: { isMuted?: boolean } = {},\n): Extract<\n BaseTextProps['color'],\n 'interactive.text.gray.disabled' | 'interactive.text.gray.muted' | 'interactive.text.gray.normal'\n> => {\n if (isDisabled) {\n return 'interactive.text.gray.disabled';\n }\n\n if (isMuted) {\n return 'interactive.text.gray.muted';\n }\n\n return 'interactive.text.gray.normal';\n};\n\nexport { getActionListProperties, validateActionListItemProps, getNormalTextColor };\n"],"names":["getActionListSectionPosition","children","childComponentIdArray","React","Children","toArray","map","child","getComponentId","lastActionListSectionIndex","lastIndexOf","componentIds","ActionListSection","isActionListItemPresentAfterSection","slice","includes","ActionListItem","actionListAllowedChildren","getActionListProperties","sectionData","currentSection","actionListOptions","getActionListItemWithId","hideDivider","isValidElement","props","isDisabled","push","title","value","onClickTrigger","_child$props$onClick","_child$props","_child$props$isSelect","anchorLink","href","onClick","call","name","isSelected","isReactNative","_child$props$target","target","window","open","top","currentIndex","length","foundSection","find","v","data","_objectSpread","_index","clonedChild","cloneElement","_getActionListSection","childrenWithId","index","isValidAllowedChildren","shouldHideDivider","sectionChildValues","childInSection","_hideDivider","undefined","_sectionChildValues","throwBladeError","message","concat","join","moduleName","validateActionListItemProps","_ref","leading","trailing","titleSuffix","ActionListItemIcon","ActionListItemText","ActionListItemBadge","ActionListItemBadgeGroup","ActionListItemAsset","getNormalTextColor","_ref2","arguments","isMuted"],"mappings":";;;;;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAChCC,QAAyB,EAItB;AACH;AACA,EAAA,IAAMC,qBAAqB,GAAGC,cAAK,CAACC,QAAQ,CAACC,OAAO,CAACJ,QAAQ,CAAC,CAACK,GAAG,CAAC,UAACC,KAAK,EAAA;IAAA,OACvEC,cAAc,CAACD,KAAK,CAAC,CAAA;AAAA,GACvB,CAAC,CAAA;;AAED;EACA,IAAME,0BAA0B,GAAGP,qBAAqB,CAACQ,WAAW,CAClEC,YAAY,CAACC,iBACf,CAAC,CAAA;;AAED;AACA,EAAA,IAAMC,mCAAmC,GAAGX,qBAAqB,CAC9DY,KAAK,CAACL,0BAA0B,CAAC,CACjCM,QAAQ,CAACJ,YAAY,CAACK,cAAc,CAAC,CAAA;EAExC,OAAO;AACLH,IAAAA,mCAAmC,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actionListUtils.ts"],"sourcesContent":["import React from 'react';\nimport { componentIds } from './componentIds';\nimport type { ActionListItemProps } from './ActionListItem';\nimport type { OptionsType } from '~components/Dropdown/useDropdown';\nimport { isReactNative } from '~utils';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\n/**\n * Returns if there is ActionListItem after ActionListSection\n * and an index of last ActionListSection\n *\n * It is used to decide if ActionListSection add divider at the end\n */\nconst getActionListSectionPosition = (\n children: React.ReactNode,\n): {\n isActionListItemPresentAfterSection: boolean;\n lastActionListSectionIndex: number;\n} => {\n // Creating an array of componentIds\n const childComponentIdArray = React.Children.toArray(children).map((child) =>\n getComponentId(child),\n );\n\n // Reading the last `ActionListSection` component's index\n const lastActionListSectionIndex = childComponentIdArray.lastIndexOf(\n componentIds.ActionListSection,\n );\n\n // Checking if there is any `ActionListItem` present after `ActionListSection`\n const isActionListItemPresentAfterSection = childComponentIdArray\n .slice(lastActionListSectionIndex)\n .includes(componentIds.ActionListItem);\n\n return {\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n };\n};\n\nconst actionListAllowedChildren = [componentIds.ActionListItem, componentIds.ActionListSection];\n\nexport type SectionData = {\n title: string;\n hideDivider: boolean;\n data: ActionListItemProps[];\n}[];\n\n/**\n * Loops over action list items and returns different properties from children like option values, header and footer child, etc\n */\nconst getActionListProperties = (\n children: React.ReactNode,\n): {\n sectionData: SectionData;\n childrenWithId?: React.ReactNode[] | null;\n actionListOptions: OptionsType;\n} => {\n const sectionData: SectionData = [];\n let currentSection: string | null = null;\n const actionListOptions: OptionsType = [];\n\n const getActionListItemWithId = (\n child: React.ReactNode,\n hideDivider: boolean,\n ): React.ReactNode => {\n if (React.isValidElement(child) && !child.props.isDisabled) {\n actionListOptions.push({\n title: child.props.title,\n value: child.props.value,\n onClickTrigger: (value) => {\n const anchorLink = child.props.href;\n child.props.onClick?.({\n name: child.props.value,\n value: child.props.isSelected ?? value,\n });\n\n if (anchorLink && !isReactNative()) {\n const target = child.props.target ?? '_self';\n window.open(anchorLink, target);\n if (window.top) {\n window.top.open(anchorLink, target);\n }\n }\n },\n });\n const currentIndex = actionListOptions.length - 1;\n\n const foundSection = sectionData.find((v) => v.title === currentSection);\n // push the item in the appropriate bucket\n if (foundSection) {\n foundSection?.data.push({\n ...child.props,\n _index: currentIndex,\n });\n } else {\n // create a new bucket\n sectionData.push({\n title: currentSection!,\n hideDivider,\n data: [\n {\n ...child.props,\n _index: currentIndex,\n },\n ],\n });\n }\n\n const clonedChild = React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n _index: currentIndex,\n });\n return clonedChild;\n }\n\n return child;\n };\n\n let isActionListItemPresentAfterSection: boolean;\n // eslint-disable-next-line one-var\n let lastActionListSectionIndex: number;\n\n if (isReactNative()) {\n // We're reading this so that we can decide whether to show the divider or not.\n // If ActionListSection is final item and no ActionListItem is present after that, we hide the divider\n\n // On web, we do it using descendant styling\n ({\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n } = getActionListSectionPosition(children));\n }\n\n // Looping through ActionListItems to add index to them and get an options array for moving focus between items\n const childrenWithId = React.Children.map(children, (child, index) => {\n if (React.isValidElement(child)) {\n if (isValidAllowedChildren(child, componentIds.ActionListSection)) {\n const shouldHideDivider =\n index === lastActionListSectionIndex && !isActionListItemPresentAfterSection;\n const sectionChildValues: string[] = [];\n return React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n children: React.Children.map(child.props.children, (childInSection) => {\n currentSection = child.props.title;\n sectionChildValues.push(childInSection.props.value);\n if (isValidAllowedChildren(childInSection, componentIds.ActionListItem)) {\n return getActionListItemWithId(childInSection, shouldHideDivider);\n }\n\n return childInSection;\n }),\n // On web, we handle it with descendant styling in css so no need of JS there\n _hideDivider: isReactNative() ? shouldHideDivider : undefined,\n _sectionChildValues: sectionChildValues,\n });\n }\n\n if (isValidAllowedChildren(child, componentIds.ActionListItem)) {\n return getActionListItemWithId(child, true);\n }\n\n if (__DEV__) {\n throwBladeError({\n message: `Only ${actionListAllowedChildren.join(', ')} supported inside ActionList`,\n moduleName: 'ActionList',\n });\n }\n }\n return child;\n });\n\n return {\n sectionData,\n childrenWithId,\n actionListOptions,\n };\n};\n\nconst validateActionListItemProps = ({\n leading,\n trailing,\n titleSuffix,\n}: {\n leading: ActionListItemProps['leading'];\n trailing: ActionListItemProps['trailing'];\n titleSuffix: ActionListItemProps['titleSuffix'];\n}): void => {\n if (__DEV__) {\n React.Children.map(trailing, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon} and ${componentIds.ActionListItemText} are allowed in trailing prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(titleSuffix, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemBadge) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemBadgeGroup)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemBadge} and ${componentIds.ActionListItemBadgeGroup} are allowed in titleSuffix prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(leading, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemAsset) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemAvatar)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon}, ${componentIds.ActionListItemAvatar}, ${componentIds.ActionListItemAsset}, and ${componentIds.ActionListItemText} are allowed in leading prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n }\n};\n\nconst getNormalTextColor = (\n isDisabled: boolean | undefined,\n { isMuted }: { isMuted?: boolean } = {},\n): Extract<\n BaseTextProps['color'],\n 'interactive.text.gray.disabled' | 'interactive.text.gray.muted' | 'interactive.text.gray.normal'\n> => {\n if (isDisabled) {\n return 'interactive.text.gray.disabled';\n }\n\n if (isMuted) {\n return 'interactive.text.gray.muted';\n }\n\n return 'interactive.text.gray.normal';\n};\n\nexport { getActionListProperties, validateActionListItemProps, getNormalTextColor };\n"],"names":["getActionListSectionPosition","children","childComponentIdArray","React","Children","toArray","map","child","getComponentId","lastActionListSectionIndex","lastIndexOf","componentIds","ActionListSection","isActionListItemPresentAfterSection","slice","includes","ActionListItem","actionListAllowedChildren","getActionListProperties","sectionData","currentSection","actionListOptions","getActionListItemWithId","hideDivider","isValidElement","props","isDisabled","push","title","value","onClickTrigger","_child$props$onClick","_child$props","_child$props$isSelect","anchorLink","href","onClick","call","name","isSelected","isReactNative","_child$props$target","target","window","open","top","currentIndex","length","foundSection","find","v","data","_objectSpread","_index","clonedChild","cloneElement","_getActionListSection","childrenWithId","index","isValidAllowedChildren","shouldHideDivider","sectionChildValues","childInSection","_hideDivider","undefined","_sectionChildValues","throwBladeError","message","concat","join","moduleName","validateActionListItemProps","_ref","leading","trailing","titleSuffix","ActionListItemIcon","ActionListItemText","ActionListItemBadge","ActionListItemBadgeGroup","ActionListItemAsset","ActionListItemAvatar","getNormalTextColor","_ref2","arguments","isMuted"],"mappings":";;;;;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAChCC,QAAyB,EAItB;AACH;AACA,EAAA,IAAMC,qBAAqB,GAAGC,cAAK,CAACC,QAAQ,CAACC,OAAO,CAACJ,QAAQ,CAAC,CAACK,GAAG,CAAC,UAACC,KAAK,EAAA;IAAA,OACvEC,cAAc,CAACD,KAAK,CAAC,CAAA;AAAA,GACvB,CAAC,CAAA;;AAED;EACA,IAAME,0BAA0B,GAAGP,qBAAqB,CAACQ,WAAW,CAClEC,YAAY,CAACC,iBACf,CAAC,CAAA;;AAED;AACA,EAAA,IAAMC,mCA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,KAAA,CAAPE,OAAO,CAAA;AAKT,EAAA,IAAI3D,UAAU,EAAE;AACd,IAAA,OAAO,gCAAgC,CAAA;AACzC,GAAA;AAEA,EAAA,IAAI2D,OAAO,EAAE;AACX,IAAA,OAAO,6BAA6B,CAAA;AACtC,GAAA;AAEA,EAAA,OAAO,8BAA8B,CAAA;AACvC;;;;"}
@@ -5,6 +5,7 @@ var componentIds = {
5
5
  ActionListItemBadgeGroup: 'ActionListItemBadgeGroup',
6
6
  ActionListItemAsset: 'ActionListItemAsset',
7
7
  ActionListItemIcon: 'ActionListItemIcon',
8
+ ActionListItemAvatar: 'ActionListItemAvatar',
8
9
  ActionListItemText: 'ActionListItemText',
9
10
  ActionListSection: 'ActionListSection'
10
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"componentIds.js","sources":["../../../../../../src/components/ActionList/componentIds.ts"],"sourcesContent":["export const componentIds = {\n ActionList: 'ActionList',\n ActionListItem: 'ActionListItem',\n ActionListItemBadge: 'ActionListItemBadge',\n ActionListItemBadgeGroup: 'ActionListItemBadgeGroup',\n ActionListItemAsset: 'ActionListItemAsset',\n ActionListItemIcon: 'ActionListItemIcon',\n ActionListItemText: 'ActionListItemText',\n ActionListSection: 'ActionListSection',\n};\n"],"names":["componentIds","ActionList","ActionListItem","ActionListItemBadge","ActionListItemBadgeGroup","ActionListItemAsset","ActionListItemIcon","ActionListItemText","ActionListSection"],"mappings":"AAAO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,cAAc,EAAE,gBAAgB;AAChCC,EAAAA,mBAAmB,EAAE,qBAAqB;AAC1CC,EAAAA,wBAAwB,EAAE,0BAA0B;AACpDC,EAAAA,mBAAmB,EAAE,qBAAqB;AAC1CC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAA;AACrB;;;;"}
1
+ {"version":3,"file":"componentIds.js","sources":["../../../../../../src/components/ActionList/componentIds.ts"],"sourcesContent":["export const componentIds = {\n ActionList: 'ActionList',\n ActionListItem: 'ActionListItem',\n ActionListItemBadge: 'ActionListItemBadge',\n ActionListItemBadgeGroup: 'ActionListItemBadgeGroup',\n ActionListItemAsset: 'ActionListItemAsset',\n ActionListItemIcon: 'ActionListItemIcon',\n ActionListItemAvatar: 'ActionListItemAvatar',\n ActionListItemText: 'ActionListItemText',\n ActionListSection: 'ActionListSection',\n};\n"],"names":["componentIds","ActionList","ActionListItem","ActionListItemBadge","ActionListItemBadgeGroup","ActionListItemAsset","ActionListItemIcon","ActionListItemAvatar","ActionListItemText","ActionListSection"],"mappings":"AAAO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,cAAc,EAAE,gBAAgB;AAChCC,EAAAA,mBAAmB,EAAE,qBAAqB;AAC1CC,EAAAA,wBAAwB,EAAE,0BAA0B;AACpDC,EAAAA,mBAAmB,EAAE,qBAAqB;AAC1CC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,oBAAoB,EAAE,sBAAsB;AAC5CC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAA;AACrB;;;;"}
@@ -1,4 +1,4 @@
1
1
  export { ActionList } from './ActionList.js';
2
- export { ActionListItem, ActionListItemBadge, ActionListItemBadgeGroup, ActionListItemIcon, ActionListItemText, ActionListSection } from './ActionListItem.js';
2
+ export { ActionListItem, ActionListItemAvatar, ActionListItemBadge, ActionListItemBadgeGroup, ActionListItemIcon, ActionListItemText, ActionListSection } from './ActionListItem.js';
3
3
  export { ActionListItemAsset } from './ActionListItemAsset.web.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -5,9 +5,11 @@ import '../Typography/Text/index.js';
5
5
  import '../Box/BaseBox/index.js';
6
6
  import '../Icons/index.js';
7
7
  import '../../utils/getPlatformType/index.js';
8
+ import '../Box/index.js';
8
9
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
10
  import { getPlatformType } from '../../utils/getPlatformType/getPlatformType.js';
10
11
  import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
12
+ import { Box } from '../Box/Box.js';
11
13
  import { Text } from '../Typography/Text/Text.js';
12
14
  import InfoIcon from '../Icons/InfoIcon/InfoIcon.js';
13
15
  import CheckIcon from '../Icons/CheckIcon/CheckIcon.js';
@@ -25,11 +27,19 @@ var HintText = function HintText(_ref) {
25
27
  marginTop: hintMarginTop[size],
26
28
  id: id,
27
29
  children: /*#__PURE__*/jsxs(FormHintWrapper, {
28
- children: [Icon ? /*#__PURE__*/jsx(Icon, {}) : null, /*#__PURE__*/jsx(Text, {
30
+ children: [Icon ?
31
+ /*#__PURE__*/
32
+ // offset block element 2px down to align with text
33
+ jsx(Box, {
34
+ flexShrink: 0,
35
+ marginTop: "spacing.1",
36
+ children: /*#__PURE__*/jsx(Icon, {})
37
+ }) : null, /*#__PURE__*/jsx(Text, {
29
38
  as: isReactNative ? undefined : 'span',
30
39
  color: color,
31
40
  size: hintTextSize[size],
32
41
  variant: "caption",
42
+ wordBreak: "break-word",
33
43
  children: children
34
44
  })]
35
45
  })
@@ -38,24 +48,18 @@ var HintText = function HintText(_ref) {
38
48
  var Icons = {
39
49
  error: function error(_ref2) {
40
50
  var size = _ref2.size;
41
- return /*#__PURE__*/jsxs(Fragment, {
42
- children: [/*#__PURE__*/jsx(InfoIcon, {
43
- color: "feedback.icon.negative.intense",
44
- size: hintIconSize[size]
45
- }), /*#__PURE__*/jsx(BaseBox, {
46
- marginRight: "spacing.2"
47
- })]
51
+ return /*#__PURE__*/jsx(InfoIcon, {
52
+ display: 'block',
53
+ color: "feedback.icon.negative.intense",
54
+ size: hintIconSize[size]
48
55
  });
49
56
  },
50
57
  success: function success(_ref3) {
51
58
  var size = _ref3.size;
52
- return /*#__PURE__*/jsxs(Fragment, {
53
- children: [/*#__PURE__*/jsx(CheckIcon, {
54
- color: "feedback.icon.positive.intense",
55
- size: hintIconSize[size]
56
- }), /*#__PURE__*/jsx(BaseBox, {
57
- marginRight: "spacing.2"
58
- })]
59
+ return /*#__PURE__*/jsx(CheckIcon, {
60
+ display: 'block',
61
+ color: "feedback.icon.positive.intense",
62
+ size: hintIconSize[size]
59
63
  });
60
64
  }
61
65
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FormHint.js","sources":["../../../../../../src/components/Form/FormHint.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { FormHintWrapper } from './FormHintWrapper';\nimport { hintIconSize, hintMarginTop, hintTextSize } from './formTokens';\nimport type { TextProps } from '~components/Typography/Text';\nimport { Text } from '~components/Typography/Text';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CheckIcon, InfoIcon } from '~components/Icons';\nimport { getPlatformType } from '~utils/getPlatformType';\n\ntype HintTextProps = {\n icon?: React.ElementType;\n children: string;\n id?: string;\n color: TextProps<{ variant: 'caption' }>['color'];\n size: 'small' | 'medium' | 'large';\n};\n\nconst HintText = ({ icon: Icon, children, id, color, size }: HintTextProps): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox marginTop={hintMarginTop[size]} id={id}>\n <FormHintWrapper>\n {Icon ? <Icon /> : null}\n <Text\n as={isReactNative ? undefined : 'span'}\n color={color}\n size={hintTextSize[size]}\n variant=\"caption\"\n >\n {children}\n </Text>\n </FormHintWrapper>\n </BaseBox>\n );\n};\n\nexport type FormHintProps = {\n type: 'help' | 'error' | 'success';\n /**\n * Help text for the group\n */\n helpText?: string;\n /**\n * Error text for the group\n *\n * Renders when `state` is set to 'error'\n */\n errorText?: string;\n /**\n * Success text for the group\n *\n * Renders when `state` is set to 'success'\n */\n successText?: string;\n /**\n * Sets the id on errorText.\n * Needed for accessibility reasons.\n */\n errorTextId?: string;\n /**\n * Sets the id on helpText.\n * Needed for accessibility reasons.\n */\n helpTextId?: string;\n /**\n * Sets the id on successText.\n * Needed for accessibility reasons.\n */\n successTextId?: string;\n /**\n * Sets the size of the hint\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n};\n\nconst Icons = {\n error: ({ size }: { size: 'small' | 'medium' | 'large' }): ReactElement => (\n <>\n <InfoIcon color=\"feedback.icon.negative.intense\" size={hintIconSize[size]} />\n <BaseBox marginRight=\"spacing.2\" />\n </>\n ),\n success: ({ size }: { size: 'small' | 'medium' | 'large' }): ReactElement => (\n <>\n <CheckIcon color=\"feedback.icon.positive.intense\" size={hintIconSize[size]} />\n <BaseBox marginRight=\"spacing.2\" />\n </>\n ),\n};\n\nconst FormHint = ({\n type,\n helpText,\n errorText,\n successText,\n helpTextId,\n errorTextId,\n successTextId,\n size = 'medium',\n}: FormHintProps): React.ReactElement => {\n const colors: Record<string, TextProps<{ variant: 'caption' }>['color']> = {\n help: 'surface.text.gray.muted',\n error: 'feedback.text.negative.intense',\n success: 'feedback.text.positive.intense',\n };\n\n const showError = type === 'error' && errorText;\n const showSuccess = type === 'success' && successText;\n const showHelp = !showError && !showSuccess && helpText;\n\n return (\n <>\n {showHelp && (\n <HintText size={size} id={helpTextId} color={colors.help}>\n {helpText}\n </HintText>\n )}\n\n {showError && (\n <HintText\n size={size}\n id={errorTextId}\n icon={() => Icons.error({ size })}\n color={colors.error}\n >\n {errorText}\n </HintText>\n )}\n\n {showSuccess && (\n <HintText\n size={size}\n id={successTextId}\n icon={() => Icons.success({ size })}\n color={colors.success}\n >\n {successText}\n </HintText>\n )}\n </>\n );\n};\n\nexport { FormHint };\n"],"names":["HintText","_ref","Icon","icon","children","id","color","size","isReactNative","getPlatformType","_jsx","BaseBox","marginTop","hintMarginTop","_jsxs","FormHintWrapper","Text","as","undefined","hintTextSize","variant","Icons","error","_ref2","_Fragment","InfoIcon","hintIconSize","marginRight","success","_ref3","CheckIcon","FormHint","_ref4","type","helpText","errorText","successText","helpTextId","errorTextId","successTextId","_ref4$size","colors","help","showError","showSuccess","showHelp"],"mappings":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;;;;"}
1
+ {"version":3,"file":"FormHint.js","sources":["../../../../../../src/components/Form/FormHint.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { FormHintWrapper } from './FormHintWrapper';\nimport { hintIconSize, hintMarginTop, hintTextSize } from './formTokens';\nimport type { TextProps } from '~components/Typography/Text';\nimport { Text } from '~components/Typography/Text';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { CheckIcon, InfoIcon } from '~components/Icons';\nimport { getPlatformType } from '~utils/getPlatformType';\nimport { Box } from '~components/Box';\n\ntype HintTextProps = {\n icon?: IconComponent;\n children: string;\n id?: string;\n color: TextProps<{ variant: 'caption' }>['color'];\n size: 'small' | 'medium' | 'large';\n};\n\nconst HintText = ({ icon: Icon, children, id, color, size }: HintTextProps): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox marginTop={hintMarginTop[size]} id={id}>\n <FormHintWrapper>\n {Icon ? (\n // offset block element 2px down to align with text\n <Box flexShrink={0} marginTop=\"spacing.1\">\n <Icon />\n </Box>\n ) : null}\n <Text\n as={isReactNative ? undefined : 'span'}\n color={color}\n size={hintTextSize[size]}\n variant=\"caption\"\n wordBreak=\"break-word\"\n >\n {children}\n </Text>\n </FormHintWrapper>\n </BaseBox>\n );\n};\n\nexport type FormHintProps = {\n type: 'help' | 'error' | 'success';\n /**\n * Help text for the group\n */\n helpText?: string;\n /**\n * Error text for the group\n *\n * Renders when `state` is set to 'error'\n */\n errorText?: string;\n /**\n * Success text for the group\n *\n * Renders when `state` is set to 'success'\n */\n successText?: string;\n /**\n * Sets the id on errorText.\n * Needed for accessibility reasons.\n */\n errorTextId?: string;\n /**\n * Sets the id on helpText.\n * Needed for accessibility reasons.\n */\n helpTextId?: string;\n /**\n * Sets the id on successText.\n * Needed for accessibility reasons.\n */\n successTextId?: string;\n /**\n * Sets the size of the hint\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n};\n\nconst Icons = {\n error: ({ size }: { size: 'small' | 'medium' | 'large' }): ReactElement => (\n <InfoIcon\n display={'block' as never}\n color=\"feedback.icon.negative.intense\"\n size={hintIconSize[size]}\n />\n ),\n success: ({ size }: { size: 'small' | 'medium' | 'large' }): ReactElement => (\n <CheckIcon\n display={'block' as never}\n color=\"feedback.icon.positive.intense\"\n size={hintIconSize[size]}\n />\n ),\n};\n\nconst FormHint = ({\n type,\n helpText,\n errorText,\n successText,\n helpTextId,\n errorTextId,\n successTextId,\n size = 'medium',\n}: FormHintProps): React.ReactElement => {\n const colors: Record<string, TextProps<{ variant: 'caption' }>['color']> = {\n help: 'surface.text.gray.muted',\n error: 'feedback.text.negative.intense',\n success: 'feedback.text.positive.intense',\n };\n\n const showError = type === 'error' && errorText;\n const showSuccess = type === 'success' && successText;\n const showHelp = !showError && !showSuccess && helpText;\n\n return (\n <>\n {showHelp && (\n <HintText size={size} id={helpTextId} color={colors.help}>\n {helpText}\n </HintText>\n )}\n\n {showError && (\n <HintText\n size={size}\n id={errorTextId}\n icon={() => Icons.error({ size })}\n color={colors.error}\n >\n {errorText}\n </HintText>\n )}\n\n {showSuccess && (\n <HintText\n size={size}\n id={successTextId}\n icon={() => Icons.success({ size })}\n color={colors.success}\n >\n {successText}\n </HintText>\n )}\n </>\n );\n};\n\nexport { FormHint };\n"],"names":["HintText","_ref","Icon","icon","children","id","color","size","isReactNative","getPlatformType","_jsx","BaseBox","marginTop","hintMarginTop","_jsxs","FormHintWrapper","Box","flexShrink","Text","as","undefined","hintTextSize","variant","wordBreak","Icons","error","_ref2","InfoIcon","display","hintIconSize","success","_ref3","CheckIcon","FormHint","_ref4","type","helpText","errorText","successText","helpTextId","errorTextId","successTextId","_ref4$size","colors","help","showError","showSuccess","showHelp","_Fragment"],"mappings":";;;;;;;;;;;;;;;;AAAA;;AAqBA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAA+E;AAAA,EAAA,IAAnEC,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AAS,IAAI,CAACC,WAAW,IAAIV,QAAQ,CAAA;EAEvD,oBACEtB,IAAA,CAAAkC,QAAA,EAAA;AAAA5C,IAAAA,QAAA,EACG2C,CAAAA,QAAQ,iBACPrC,GAAA,CAACV,QAAQ,EAAA;AAACO,MAAAA,IAAI,EAAEA,IAAK;AAACF,MAAAA,EAAE,EAAEkC,UAAW;MAACjC,KAAK,EAAEqC,MAAM,CAACC,IAAK;AAAAxC,MAAAA,QAAA,EACtDgC,QAAAA;AAAQ,KACD,CACX,EAEAS,SAAS,iBACRnC,GAAA,CAACV,QAAQ,EAAA;AACPO,MAAAA,IAAI,EAAEA,IAAK;AACXF,MAAAA,EAAE,EAAEmC,WAAY;MAChBrC,IAAI,EAAE,SAAAA,IAAA,GAAA;QAAA,OAAMqB,KAAK,CAACC,KAAK,CAAC;AAAElB,UAAAA,IAAI,EAAJA,IAAAA;AAAK,SAAC,CAAC,CAAA;OAAC;MAClCD,KAAK,EAAEqC,MAAM,CAAClB,KAAM;AAAArB,MAAAA,QAAA,EAEnBiC,SAAAA;AAAS,KACF,CACX,EAEAS,WAAW,iBACVpC,GAAA,CAACV,QAAQ,EAAA;AACPO,MAAAA,IAAI,EAAEA,IAAK;AACXF,MAAAA,EAAE,EAAEoC,aAAc;MAClBtC,IAAI,EAAE,SAAAA,IAAA,GAAA;QAAA,OAAMqB,KAAK,CAACM,OAAO,CAAC;AAAEvB,UAAAA,IAAI,EAAJA,IAAAA;AAAK,SAAC,CAAC,CAAA;OAAC;MACpCD,KAAK,EAAEqC,MAAM,CAACb,OAAQ;AAAA1B,MAAAA,QAAA,EAErBkC,WAAAA;AAAW,KACJ,CACX,CAAA;AAAA,GACD,CAAC,CAAA;AAEP;;;;"}
@@ -9,10 +9,8 @@ var FormHintWrapper = function FormHintWrapper(_ref) {
9
9
  as: "span",
10
10
  display: "flex",
11
11
  flexDirection: "row",
12
- alignItems: "center",
13
- style: {
14
- wordBreak: 'break-all'
15
- },
12
+ alignItems: "flex-start",
13
+ gap: "spacing.2",
16
14
  children: children
17
15
  });
18
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FormHintWrapper.web.js","sources":["../../../../../../src/components/Form/FormHintWrapper.web.tsx"],"sourcesContent":["import React from 'react';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst FormHintWrapper = ({ children }: { children: React.ReactNode }): React.ReactElement => {\n return (\n <BaseBox\n as=\"span\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n style={{\n wordBreak: 'break-all',\n }}\n >\n {children}\n </BaseBox>\n );\n};\n\nexport { FormHintWrapper };\n"],"names":["FormHintWrapper","_ref","children","_jsx","BaseBox","as","display","flexDirection","alignItems","style","wordBreak"],"mappings":";;;;;AAGA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAAwE;AAAA,EAAA,IAAlEC,QAAQ,GAAAD,IAAA,CAARC,QAAQ,CAAA;EACjC,oBACEC,GAAA,CAACC,OAAO,EAAA;AACNC,IAAAA,EAAE,EAAC,MAAM;AACTC,IAAAA,OAAO,EAAC,MAAM;AACdC,IAAAA,aAAa,EAAC,KAAK;AACnBC,IAAAA,UAAU,EAAC,QAAQ;AACnBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,SAAS,EAAE,WAAA;KACX;AAAAR,IAAAA,QAAA,EAEDA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEd;;;;"}
1
+ {"version":3,"file":"FormHintWrapper.web.js","sources":["../../../../../../src/components/Form/FormHintWrapper.web.tsx"],"sourcesContent":["import React from 'react';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst FormHintWrapper = ({ children }: { children: React.ReactNode }): React.ReactElement => {\n return (\n <BaseBox as=\"span\" display=\"flex\" flexDirection=\"row\" alignItems=\"flex-start\" gap=\"spacing.2\">\n {children}\n </BaseBox>\n );\n};\n\nexport { FormHintWrapper };\n"],"names":["FormHintWrapper","_ref","children","_jsx","BaseBox","as","display","flexDirection","alignItems","gap"],"mappings":";;;;;AAGA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAAwE;AAAA,EAAA,IAAlEC,QAAQ,GAAAD,IAAA,CAARC,QAAQ,CAAA;EACjC,oBACEC,GAAA,CAACC,OAAO,EAAA;AAACC,IAAAA,EAAE,EAAC,MAAM;AAACC,IAAAA,OAAO,EAAC,MAAM;AAACC,IAAAA,aAAa,EAAC,KAAK;AAACC,IAAAA,UAAU,EAAC,YAAY;AAACC,IAAAA,GAAG,EAAC,WAAW;AAAAP,IAAAA,QAAA,EAC1FA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEd;;;;"}
@@ -45,12 +45,15 @@ var InteractiveItemHeaderBox = /*#__PURE__*/styled.button.withConfig({
45
45
  borderRadius: props.theme.border.radius.medium,
46
46
  width: '100%',
47
47
  transition: "background-color ".concat(props.theme.motion.duration.xquick, " ").concat(props.theme.motion.easing.standard.effective),
48
- ':hover': {
48
+ ':not([disabled]):hover': {
49
49
  backgroundColor: props.isSelected ? props.theme.colors.interactive.background.primary.fadedHighlighted : props.theme.colors.interactive.background.gray.fadedHighlighted
50
50
  },
51
- ':focus-visible': _objectSpread({}, getFocusRingStyles({
51
+ ':not([disabled]):focus-visible': _objectSpread({}, getFocusRingStyles({
52
52
  theme: props.theme
53
- }))
53
+ })),
54
+ '&[disabled]': {
55
+ cursor: 'not-allowed'
56
+ }
54
57
  };
55
58
  });
56
59
  var getStepTypeFromIndex = function getStepTypeFromIndex(_ref) {
@@ -80,6 +83,7 @@ var _StepItem = function _StepItem(_ref2) {
80
83
  marker = _ref2.marker,
81
84
  trailing = _ref2.trailing,
82
85
  isSelected = _ref2.isSelected,
86
+ isDisabled = _ref2.isDisabled,
83
87
  href = _ref2.href,
84
88
  target = _ref2.target,
85
89
  onClick = _ref2.onClick,
@@ -129,18 +133,18 @@ var _StepItem = function _StepItem(_ref2) {
129
133
  children: [/*#__PURE__*/jsxs(Box, {
130
134
  children: [/*#__PURE__*/jsx(Text, {
131
135
  size: stepItemHeaderTokens[size$1].title,
132
- color: "surface.text.gray.subtle",
136
+ color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',
133
137
  weight: "semibold",
134
138
  children: title
135
139
  }), /*#__PURE__*/jsx(Text, {
136
140
  size: stepItemHeaderTokens[size$1].timestamp,
137
141
  marginY: "spacing.2",
138
- color: "surface.text.gray.muted",
142
+ color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted',
139
143
  variant: "caption",
140
144
  children: timestamp
141
145
  }), /*#__PURE__*/jsx(Text, {
142
146
  size: stepItemHeaderTokens[size$1].description,
143
- color: "surface.text.gray.muted",
147
+ color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted',
144
148
  children: description
145
149
  })]
146
150
  }), /*#__PURE__*/jsx(Box, {
@@ -181,6 +185,7 @@ var _StepItem = function _StepItem(_ref2) {
181
185
  target: target,
182
186
  isSelected: isSelected,
183
187
  onClick: onClick,
188
+ disabled: isDisabled,
184
189
  children: stepItemHeaderJSX
185
190
  })) : /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread({}, stepItemHeaderPaddings), {}, {
186
191
  children: stepItemHeaderJSX
@@ -1 +1 @@
1
- {"version":3,"file":"StepItem.web.js","sources":["../../../../../../src/components/StepGroup/StepItem.web.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { StepLine } from './StepLine';\nimport type { StepLineProps } from './StepLine';\nimport { useStepGroup } from './StepGroupContext';\nimport type {\n InteractiveItemHeaderProps,\n StepGroupContextType,\n StepGroupProps,\n StepItemProps,\n} from './types';\nimport { componentIds } from './componentIds';\nimport { itemLineGap, stepItemHeaderTokens } from './tokens';\nimport { Box } from '~components/Box';\nimport { Text } from '~components/Typography';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeSize, makeSpace } from '~utils';\nimport { size as sizeTokens } from '~tokens/global';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport getIn from '~utils/lodashButBetter/get';\nimport { throwBladeError } from '~utils/logger';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\ntype GetStepTypeFromIndexProps = {\n _index: StepItemProps['_index'];\n _nestingLevel: StepGroupProps['_nestingLevel'];\n itemsCount: StepGroupContextType['itemsInGroupCount'];\n};\n\nconst InteractiveItemHeaderBox = styled.button<InteractiveItemHeaderProps>((props) => {\n return {\n padding: `${makeSpace(getIn(props.theme, props.paddingY))} ${makeSpace(\n getIn(props.theme, props.paddingX),\n )}`,\n cursor: 'pointer',\n display: 'inline-block',\n textDecoration: 'none',\n border: 'none',\n textAlign: 'inherit',\n backgroundColor: props.isSelected\n ? props.theme.colors.interactive.background.primary.faded\n : props.theme.colors.transparent,\n borderRadius: props.theme.border.radius.medium,\n width: '100%',\n transition: `background-color ${props.theme.motion.duration.xquick} ${props.theme.motion.easing.standard.effective}`,\n ':hover': {\n backgroundColor: props.isSelected\n ? props.theme.colors.interactive.background.primary.fadedHighlighted\n : props.theme.colors.interactive.background.gray.fadedHighlighted,\n },\n ':focus-visible': {\n ...getFocusRingStyles({ theme: props.theme }),\n },\n };\n});\n\nconst getStepTypeFromIndex = ({\n _index,\n _nestingLevel,\n itemsCount,\n}: GetStepTypeFromIndexProps): StepLineProps['stepType'] => {\n if (_nestingLevel === 0) {\n return 'default';\n }\n\n if (itemsCount === 1) {\n return 'single-item';\n }\n\n if (_index === 0) {\n return 'start';\n }\n\n if (_index === itemsCount - 1) {\n return 'end';\n }\n\n return 'middle';\n};\n\nconst _StepItem = ({\n title,\n timestamp,\n description,\n stepProgress = 'none',\n marker,\n trailing,\n isSelected,\n href,\n target,\n onClick,\n children,\n _index = 0,\n _totalIndex = 0,\n _nestingLevel = 0,\n}: StepItemProps): React.ReactElement => {\n const {\n itemsInGroupCount: itemsCount,\n totalItemsInParentGroupCount,\n orientation,\n size,\n } = useStepGroup();\n const stepType = React.useMemo(\n () => getStepTypeFromIndex({ _index, _nestingLevel, itemsCount }),\n [_index, _nestingLevel, itemsCount],\n );\n\n const itemRef = React.useRef<HTMLDivElement>(null);\n\n const isFirstItem = _totalIndex === 0;\n const isLastItem = _totalIndex === totalItemsInParentGroupCount - 1;\n const isInteractive = Boolean(href) || Boolean(onClick);\n const isVertical = orientation === 'vertical';\n\n if (__DEV__) {\n if (trailing && orientation === 'horizontal') {\n throwBladeError({\n message: 'trailing is not allowed in horizontal StepGroup',\n moduleName: 'StepItem',\n });\n }\n\n if (_nestingLevel >= 1 && orientation === 'horizontal') {\n throwBladeError({\n message: 'Nested StepGroup components are not allowed in horizontal orientation',\n moduleName: 'StepItem',\n });\n }\n }\n\n const stepItemHeaderJSX = (\n <Box display=\"flex\" flexDirection=\"row\" justifyContent=\"space-between\" gap=\"spacing.4\">\n <Box>\n <Text\n size={stepItemHeaderTokens[size].title}\n color=\"surface.text.gray.subtle\"\n weight=\"semibold\"\n >\n {title}\n </Text>\n <Text\n size={stepItemHeaderTokens[size].timestamp}\n marginY=\"spacing.2\"\n color=\"surface.text.gray.muted\"\n variant=\"caption\"\n >\n {timestamp}\n </Text>\n <Text size={stepItemHeaderTokens[size].description} color=\"surface.text.gray.muted\">\n {description}\n </Text>\n </Box>\n <Box>{trailing}</Box>\n </Box>\n );\n\n const stepItemHeaderPaddings: Omit<InteractiveItemHeaderProps, 'isSelected'> = {\n paddingY: 'spacing.3',\n paddingX: 'spacing.4',\n } as const;\n\n return (\n <BaseBox\n display=\"flex\"\n flexDirection={isVertical ? 'row' : 'column'}\n gap={itemLineGap[size]}\n className={`step-item step-index-${_index} step-nesting-level-${_nestingLevel}`}\n textAlign={isVertical ? 'left' : 'center'}\n alignItems={isVertical ? undefined : 'center'}\n minWidth={isVertical ? undefined : `min(${makeSize(sizeTokens['120'])}, 100%)`}\n width={isVertical ? '100%' : undefined}\n flex={isVertical ? undefined : '1'}\n {...metaAttribute({ name: MetaConstants.StepItem })}\n ref={itemRef}\n >\n <StepLine\n shouldShowStartBranch={!isFirstItem}\n shouldShowEndBranch={!isLastItem}\n stepType={stepType}\n marker={marker}\n stepProgress={stepProgress}\n />\n <Box marginTop=\"spacing.3\" flex=\"1\" marginRight={isVertical ? undefined : undefined}>\n {isInteractive ? (\n <InteractiveItemHeaderBox\n {...stepItemHeaderPaddings}\n as={href ? 'a' : 'button'}\n href={href}\n target={target}\n isSelected={isSelected}\n onClick={onClick}\n >\n {stepItemHeaderJSX}\n </InteractiveItemHeaderBox>\n ) : (\n <Box {...stepItemHeaderPaddings}>{stepItemHeaderJSX}</Box>\n )}\n {children ? (\n <Box paddingX=\"spacing.4\" paddingY=\"spacing.3\">\n {children}\n </Box>\n ) : null}\n </Box>\n </BaseBox>\n );\n};\n\n/**\n * ## StepItem\n *\n * Component meant to be used inside the StepGroup parent component\n *\n * ### Usage\n *\n * ```jsx\n * <StepGroup orientation=\"vertical\" size=\"medium\">\n * <StepItem\n * title=\"Personal Details\"\n * timestamp=\"Thu 15th Oct'23 | 12:00pm\"\n * description=\"Fill your personal details here\"\n * marker={<StepItemIndicator color=\"negative\" />}\n * />\n * </StepGroup>\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-stepgroup--docs StepGroup Documentation}\n */\nconst StepItem = assignWithoutSideEffects(_StepItem, {\n componentId: componentIds.StepItem,\n displayName: componentIds.StepItem,\n});\n\nexport { StepLine, StepItem };\n"],"names":["InteractiveItemHeaderBox","styled","button","withConfig","displayName","componentId","props","padding","concat","makeSpace","getIn","theme","paddingY","paddingX","cursor","display","textDecoration","border","textAlign","backgroundColor","isSelected","colors","interactive","background","primary","faded","transparent","borderRadius","radius","medium","width","transition","motion","duration","xquick","easing","standard","effective","fadedHighlighted","gray","_objectSpread","getFocusRingStyles","getStepTypeFromIndex","_ref","_index","_nestingLevel","itemsCount","_StepItem","_ref2","title","timestamp","description","_ref2$stepProgress","stepProgress","marker","trailing","href","target","onClick","children","_ref2$_index","_ref2$_totalIndex","_totalIndex","_ref2$_nestingLevel","_useStepGroup","useStepGroup","itemsInGroupCount","totalItemsInParentGroupCount","orientation","size","stepType","React","useMemo","itemRef","useRef","isFirstItem","isLastItem","isInteractive","Boolean","isVertical","throwBladeError","message","moduleName","stepItemHeaderJSX","_jsxs","Box","flexDirection","justifyContent","gap","_jsx","Text","stepItemHeaderTokens","color","weight","marginY","variant","stepItemHeaderPaddings","BaseBox","itemLineGap","className","alignItems","undefined","minWidth","makeSize","sizeTokens","flex","metaAttribute","name","MetaConstants","StepItem","ref","StepLine","shouldShowStartBranch","shouldShowEndBranch","marginTop","marginRight","as","assignWithoutSideEffects","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAMA,wBAAwB,gBAAGC,MAAM,CAACC,MAAM,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,uCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAA6B,CAAA,CAAA,UAACC,KAAK,EAAK;EACpF,OAAO;AACLC,IAAAA,OAAO,EAAAC,EAAAA,CAAAA,MAAA,CAAKC,SAAS,CAACC,KAAK,CAACJ,KAAK,CAACK,KAAK,EAAEL,KAAK,CAACM,QAAQ,CAAC,CAAC,EAAAJ,GAAAA,CAAAA,CAAAA,MAAA,CAAIC,SAAS,CACpEC,KAAK,CAACJ,KAAK,CAACK,KAAK,EAAEL,KAAK,CAACO,QAAQ,CACnC,CAAC,CAAE;AACHC,IAAAA,MAAM,EAAE,SAAS;AACjBC,IAAAA,OAAO,EAAE,cAAc;AACvBC,IAAAA,cAAc,EAAE,MAAM;AACtBC,IAAAA,MAAM,EAAE,MAAM;AACdC,IAAAA,SAAS,EAAE,SAAS;IACpBC,eAAe,EAAEb,KAAK,CAACc,UAAU,GAC7Bd,KAAK,CAACK,KAAK,CAACU,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,OAAO,CAACC,KAAK,GACvDnB,KAAK,CAACK,KAAK,CAACU,MAAM,CAACK,WAAW;IAClCC,YAAY,EAAErB,KAAK,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EAAE,EAAE5D,IAAI,GAAG,GAAG,GAAG,QAAS;AAC1BA,QAAAA,IAAI,EAAEA,IAAK;AACXC,QAAAA,MAAM,EAAEA,MAAO;AACfrC,QAAAA,UAAU,EAAEA,UAAW;AACvBsC,QAAAA,OAAO,EAAEA,OAAQ;AAAAC,QAAAA,QAAA,EAEhBwB,iBAAAA;OACuB,CAAA,CAAC,gBAE3BM,GAAA,CAACJ,GAAG,EAAA7C,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAKwD,sBAAsB,CAAA,EAAA,EAAA,EAAA;AAAArC,QAAAA,QAAA,EAAGwB,iBAAAA;AAAiB,OAAA,CAAM,CAC1D,EACAxB,QAAQ,gBACP8B,GAAA,CAACJ,GAAG,EAAA;AAACxE,QAAAA,QAAQ,EAAC,WAAW;AAACD,QAAAA,QAAQ,EAAC,WAAW;AAAA+C,QAAAA,QAAA,EAC3CA,QAAAA;OACE,CAAC,GACJ,IAAI,CAAA;AAAA,KACL,CAAC,CAAA;AAAA,GAAA,CACC,CAAC,CAAA;AAEd,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMkD,QAAQ,gBAAGQ,wBAAwB,CAACtE,SAAS,EAAE;EACnD1C,WAAW,EAAEiH,YAAY,CAACT,QAAQ;EAClCzG,WAAW,EAAEkH,YAAY,CAACT,QAAAA;AAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"StepItem.web.js","sources":["../../../../../../src/components/StepGroup/StepItem.web.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { StepLine } from './StepLine';\nimport type { StepLineProps } from './StepLine';\nimport { useStepGroup } from './StepGroupContext';\nimport type {\n InteractiveItemHeaderProps,\n StepGroupContextType,\n StepGroupProps,\n StepItemProps,\n} from './types';\nimport { componentIds } from './componentIds';\nimport { itemLineGap, stepItemHeaderTokens } from './tokens';\nimport { Box } from '~components/Box';\nimport { Text } from '~components/Typography';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeSize, makeSpace } from '~utils';\nimport { size as sizeTokens } from '~tokens/global';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport getIn from '~utils/lodashButBetter/get';\nimport { throwBladeError } from '~utils/logger';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\ntype GetStepTypeFromIndexProps = {\n _index: StepItemProps['_index'];\n _nestingLevel: StepGroupProps['_nestingLevel'];\n itemsCount: StepGroupContextType['itemsInGroupCount'];\n};\n\nconst InteractiveItemHeaderBox = styled.button<InteractiveItemHeaderProps>((props) => {\n return {\n padding: `${makeSpace(getIn(props.theme, props.paddingY))} ${makeSpace(\n getIn(props.theme, props.paddingX),\n )}`,\n cursor: 'pointer',\n display: 'inline-block',\n textDecoration: 'none',\n border: 'none',\n textAlign: 'inherit',\n backgroundColor: props.isSelected\n ? props.theme.colors.interactive.background.primary.faded\n : props.theme.colors.transparent,\n borderRadius: props.theme.border.radius.medium,\n width: '100%',\n transition: `background-color ${props.theme.motion.duration.xquick} ${props.theme.motion.easing.standard.effective}`,\n ':not([disabled]):hover': {\n backgroundColor: props.isSelected\n ? props.theme.colors.interactive.background.primary.fadedHighlighted\n : props.theme.colors.interactive.background.gray.fadedHighlighted,\n },\n ':not([disabled]):focus-visible': {\n ...getFocusRingStyles({ theme: props.theme }),\n },\n '&[disabled]': {\n cursor: 'not-allowed',\n },\n };\n});\n\nconst getStepTypeFromIndex = ({\n _index,\n _nestingLevel,\n itemsCount,\n}: GetStepTypeFromIndexProps): StepLineProps['stepType'] => {\n if (_nestingLevel === 0) {\n return 'default';\n }\n\n if (itemsCount === 1) {\n return 'single-item';\n }\n\n if (_index === 0) {\n return 'start';\n }\n\n if (_index === itemsCount - 1) {\n return 'end';\n }\n\n return 'middle';\n};\n\nconst _StepItem = ({\n title,\n timestamp,\n description,\n stepProgress = 'none',\n marker,\n trailing,\n isSelected,\n isDisabled,\n href,\n target,\n onClick,\n children,\n _index = 0,\n _totalIndex = 0,\n _nestingLevel = 0,\n}: StepItemProps): React.ReactElement => {\n const {\n itemsInGroupCount: itemsCount,\n totalItemsInParentGroupCount,\n orientation,\n size,\n } = useStepGroup();\n const stepType = React.useMemo(\n () => getStepTypeFromIndex({ _index, _nestingLevel, itemsCount }),\n [_index, _nestingLevel, itemsCount],\n );\n\n const itemRef = React.useRef<HTMLDivElement>(null);\n\n const isFirstItem = _totalIndex === 0;\n const isLastItem = _totalIndex === totalItemsInParentGroupCount - 1;\n const isInteractive = Boolean(href) || Boolean(onClick);\n const isVertical = orientation === 'vertical';\n\n if (__DEV__) {\n if (trailing && orientation === 'horizontal') {\n throwBladeError({\n message: 'trailing is not allowed in horizontal StepGroup',\n moduleName: 'StepItem',\n });\n }\n\n if (_nestingLevel >= 1 && orientation === 'horizontal') {\n throwBladeError({\n message: 'Nested StepGroup components are not allowed in horizontal orientation',\n moduleName: 'StepItem',\n });\n }\n }\n\n const stepItemHeaderJSX = (\n <Box display=\"flex\" flexDirection=\"row\" justifyContent=\"space-between\" gap=\"spacing.4\">\n <Box>\n <Text\n size={stepItemHeaderTokens[size].title}\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n weight=\"semibold\"\n >\n {title}\n </Text>\n <Text\n size={stepItemHeaderTokens[size].timestamp}\n marginY=\"spacing.2\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n variant=\"caption\"\n >\n {timestamp}\n </Text>\n <Text\n size={stepItemHeaderTokens[size].description}\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {description}\n </Text>\n </Box>\n <Box>{trailing}</Box>\n </Box>\n );\n\n const stepItemHeaderPaddings: Omit<InteractiveItemHeaderProps, 'isSelected'> = {\n paddingY: 'spacing.3',\n paddingX: 'spacing.4',\n } as const;\n\n return (\n <BaseBox\n display=\"flex\"\n flexDirection={isVertical ? 'row' : 'column'}\n gap={itemLineGap[size]}\n className={`step-item step-index-${_index} step-nesting-level-${_nestingLevel}`}\n textAlign={isVertical ? 'left' : 'center'}\n alignItems={isVertical ? undefined : 'center'}\n minWidth={isVertical ? undefined : `min(${makeSize(sizeTokens['120'])}, 100%)`}\n width={isVertical ? '100%' : undefined}\n flex={isVertical ? undefined : '1'}\n {...metaAttribute({ name: MetaConstants.StepItem })}\n ref={itemRef}\n >\n <StepLine\n shouldShowStartBranch={!isFirstItem}\n shouldShowEndBranch={!isLastItem}\n stepType={stepType}\n marker={marker}\n stepProgress={stepProgress}\n />\n <Box marginTop=\"spacing.3\" flex=\"1\" marginRight={isVertical ? undefined : undefined}>\n {isInteractive ? (\n <InteractiveItemHeaderBox\n {...stepItemHeaderPaddings}\n as={href ? 'a' : 'button'}\n href={href}\n target={target}\n isSelected={isSelected}\n onClick={onClick}\n disabled={isDisabled}\n >\n {stepItemHeaderJSX}\n </InteractiveItemHeaderBox>\n ) : (\n <Box {...stepItemHeaderPaddings}>{stepItemHeaderJSX}</Box>\n )}\n {children ? (\n <Box paddingX=\"spacing.4\" paddingY=\"spacing.3\">\n {children}\n </Box>\n ) : null}\n </Box>\n </BaseBox>\n );\n};\n\n/**\n * ## StepItem\n *\n * Component meant to be used inside the StepGroup parent component\n *\n * ### Usage\n *\n * ```jsx\n * <StepGroup orientation=\"vertical\" size=\"medium\">\n * <StepItem\n * title=\"Personal Details\"\n * timestamp=\"Thu 15th Oct'23 | 12:00pm\"\n * description=\"Fill your personal details here\"\n * marker={<StepItemIndicator color=\"negative\" />}\n * />\n * </StepGroup>\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-stepgroup--docs StepGroup Documentation}\n */\nconst StepItem = assignWithoutSideEffects(_StepItem, {\n componentId: componentIds.StepItem,\n displayName: componentIds.StepItem,\n});\n\nexport { StepLine, StepItem };\n"],"names":["InteractiveItemHeaderBox","styled","button","withConfig","displayName","componentId","props","padding","concat","makeSpace","getIn","theme","paddingY","paddingX","cursor","display","textDecoration","border","textAlign","backgroundColor","isSelected","colors","interactive","background","primary","faded","transparent","borderRadius","radius","medium","width","transition","motion","duration","xquick","easing","standard","effective","fadedHighlighted","gray","_objectSpread","getFocusRingStyles","getStepTypeFromIndex","_ref","_index","_nestingLevel","itemsCount","_StepItem","_ref2","title","timestamp","description","_ref2$stepProgress","stepProgress","marker","trailing","isDisabled","href","target","onClick","children","_ref2$_index","_ref2$_totalIndex","_totalIndex","_ref2$_nestingLevel","_useStepGroup","useStepGroup","itemsInGroupCount","totalItemsInParentGroupCount","orientation","size","stepType","React","useMemo","itemRef","useRef","isFirstItem","isLastItem","isInteractive","Boolean","isVertical","throwBladeError","message","moduleName","stepItemHeaderJSX","_jsxs","Box","flexDirection","justifyContent","gap","_jsx","Text","stepItemHeaderTokens","color","weight","marginY","variant","stepItemHeaderPaddings","BaseBox","itemLineGap","className","alignItems","undefined","minWidth","makeSize","sizeTokens","flex","metaAttribute","name","MetaConstants","StepItem","ref","StepLine","shouldShowStartBranch","shouldShowEndBranch","marginTop","marginRight","as","disabled","assignWithoutSideEffects","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAMA,wBAAwB,gBAAGC,MAAM,CAACC,MAAM,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,uCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAA6B,CAAA,CAAA,UAACC,KAAK,EAAK;EACpF,OAAO;AACLC,IAAAA,OAAO,EAAAC,EAAAA,CAAAA,MAAA,CAAKC,SAAS,CAACC,KAAK,CAACJ,KAAK,CAACK,KAAK,EAAEL,KAAK,CAACM,QAAQ,CAAC,CAAC,EAAAJ,GAAAA,CAAAA,CAAAA,MAAA,CAAIC,SAAS,CACpEC,KAAK,CAACJ,KAAK,CAACK,KAAK,EAAEL,KAAK,CAACO,QAAQ,CACnC,CAAC,CAAE;AAC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AAA;AAEd,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMkD,QAAQ,gBAAGS,wBAAwB,CAACxE,SAAS,EAAE;EACnD1C,WAAW,EAAEmH,YAAY,CAACV,QAAQ;EAClC1G,WAAW,EAAEoH,YAAY,CAACV,QAAAA;AAC5B,CAAC;;;;"}
@@ -1,29 +1,25 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
- import styled from 'styled-components';
2
+ import React__default from 'react';
3
3
  import { useTooltipContext } from './TooltipContext.js';
4
4
  import '../Box/BaseBox/index.js';
5
5
  import '../../utils/metaAttribute/index.js';
6
+ import { jsx } from 'react/jsx-runtime';
6
7
  import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
7
8
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
8
9
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
9
10
 
10
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
- var TooltipInteractiveWrapper = /*#__PURE__*/styled(BaseBox).attrs(function () {
13
- return _objectSpread({
14
- tabIndex: -1
13
+ var TooltipInteractiveWrapper = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
14
+ useTooltipContext();
15
+ return /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
16
+ ref: ref,
17
+ tabIndex: -1,
18
+ display: "inline-block"
15
19
  }, metaAttribute({
16
20
  testID: 'tooltip-interactive-wrapper',
17
21
  name: MetaConstants.TooltipInteractiveWrapper
18
- }));
19
- }).withConfig({
20
- displayName: "TooltipInteractiveWrapperweb__TooltipInteractiveWrapper",
21
- componentId: "y7list-0"
22
- })(function () {
23
- useTooltipContext();
24
- return {
25
- display: 'inline-block'
26
- };
22
+ })), props));
27
23
  });
28
24
 
29
25
  export { TooltipInteractiveWrapper };
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipInteractiveWrapper.web.js","sources":["../../../../../../src/components/Tooltip/TooltipInteractiveWrapper.web.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { useTooltipContext } from './TooltipContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\nconst TooltipInteractiveWrapper = styled(BaseBox).attrs(() => {\n return {\n tabIndex: -1,\n ...metaAttribute({\n testID: 'tooltip-interactive-wrapper',\n name: MetaConstants.TooltipInteractiveWrapper,\n }),\n };\n})(() => {\n useTooltipContext();\n\n return {\n display: 'inline-block',\n };\n});\n\nexport { TooltipInteractiveWrapper };\n"],"names":["TooltipInteractiveWrapper","styled","BaseBox","attrs","_objectSpread","tabIndex","metaAttribute","testID","name","MetaConstants","withConfig","displayName","componentId","useTooltipContext","display"],"mappings":";;;;;;;;;;;AAKMA,IAAAA,yBAAyB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAACC,KAAK,CAAC,YAAM;AAC5D,EAAA,OAAAC,aAAA,CAAA;AACEC,IAAAA,QAAQ,EAAE,CAAC,CAAA;AAAC,GAAA,EACTC,aAAa,CAAC;AACfC,IAAAA,MAAM,EAAE,6BAA6B;IACrCC,IAAI,EAAEC,aAAa,CAACT,yBAAAA;AACtB,GAAC,CAAC,CAAA,CAAA;AAEN,CAAC,CAAC,CAAAU,UAAA,CAAA;EAAAC,WAAA,EAAA,yDAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAAC,YAAM;AACPC,EAAAA,iBAAiB,EAAE,CAAA;EAEnB,OAAO;AACLC,IAAAA,OAAO,EAAE,cAAA;GACV,CAAA;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"TooltipInteractiveWrapper.web.js","sources":["../../../../../../src/components/Tooltip/TooltipInteractiveWrapper.web.tsx"],"sourcesContent":["import React from 'react';\nimport { useTooltipContext } from './TooltipContext';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\nconst TooltipInteractiveWrapper = React.forwardRef<HTMLDivElement, Omit<BaseBoxProps, 'as'>>(\n (props, ref) => {\n useTooltipContext();\n\n return (\n <BaseBox\n ref={ref}\n tabIndex={-1}\n display=\"inline-block\"\n {...metaAttribute({\n testID: 'tooltip-interactive-wrapper',\n name: MetaConstants.TooltipInteractiveWrapper,\n })}\n {...props}\n />\n );\n },\n);\n\nexport { TooltipInteractiveWrapper };\n"],"names":["TooltipInteractiveWrapper","React","forwardRef","props","ref","useTooltipContext","_jsx","BaseBox","_objectSpread","tabIndex","display","metaAttribute","testID","name","MetaConstants"],"mappings":";;;;;;;;;;;;AAMMA,IAAAA,yBAAyB,gBAAGC,cAAK,CAACC,UAAU,CAChD,UAACC,KAAK,EAAEC,GAAG,EAAK;AACdC,EAAAA,iBAAiB,EAAE,CAAA;AAEnB,EAAA,oBACEC,GAAA,CAACC,OAAO,EAAAC,aAAA,CAAAA,aAAA,CAAA;AACNJ,IAAAA,GAAG,EAAEA,GAAI;IACTK,QAAQ,EAAE,CAAC,CAAE;AACbC,IAAAA,OAAO,EAAC,cAAA;AAAc,GAAA,EAClBC,aAAa,CAAC;AAChBC,IAAAA,MAAM,EAAE,6BAA6B;IACrCC,IAAI,EAAEC,aAAa,CAACd,yBAAAA;AACtB,GAAC,CAAC,CAAA,EACEG,KAAK,CACV,CAAC,CAAA;AAEN,CACF;;;;"}