@razorpay/blade 12.37.0 → 12.39.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 (195) hide show
  1. package/build/lib/native/components/Accordion/AccordionItem.js +1 -1
  2. package/build/lib/native/components/Accordion/AccordionItem.js.map +1 -1
  3. package/build/lib/native/components/Alert/Alert.js +2 -1
  4. package/build/lib/native/components/Alert/Alert.js.map +1 -1
  5. package/build/lib/native/components/Card/Card.js +1 -1
  6. package/build/lib/native/components/Card/Card.js.map +1 -1
  7. package/build/lib/native/components/Card/CardContext.js +2 -2
  8. package/build/lib/native/components/Card/CardContext.js.map +1 -1
  9. package/build/lib/native/components/Card/CardFooter.js +2 -1
  10. package/build/lib/native/components/Card/CardFooter.js.map +1 -1
  11. package/build/lib/native/components/Card/CardHeader.js +3 -3
  12. package/build/lib/native/components/Card/CardHeader.js.map +1 -1
  13. package/build/lib/native/components/Chip/Chip.js +1 -1
  14. package/build/lib/native/components/Chip/Chip.js.map +1 -1
  15. package/build/lib/native/components/Form/FormLabel.js +1 -1
  16. package/build/lib/native/components/Form/FormLabel.js.map +1 -1
  17. package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
  18. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  19. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +1 -1
  20. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  21. package/build/lib/native/components/Input/OTPInput/OTPInput.js +1 -1
  22. package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
  23. package/build/lib/native/components/Input/PasswordInput/PasswordInput.js +1 -1
  24. package/build/lib/native/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  25. package/build/lib/native/components/Input/SearchInput/SearchInput.js +1 -1
  26. package/build/lib/native/components/Input/SearchInput/SearchInput.js.map +1 -1
  27. package/build/lib/native/components/Input/TextArea/TextArea.js +1 -1
  28. package/build/lib/native/components/Input/TextArea/TextArea.js.map +1 -1
  29. package/build/lib/native/components/Input/TextInput/TextInput.js +1 -1
  30. package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
  31. package/build/lib/native/components/List/ListItem.js +1 -1
  32. package/build/lib/native/components/List/ListItem.js.map +1 -1
  33. package/build/lib/native/components/QuickFilters/QuickFilter.js +1 -1
  34. package/build/lib/native/components/QuickFilters/QuickFilter.js.map +1 -1
  35. package/build/lib/native/utils/makeAnalyticsAttribute/makeAnalyticsConstants.js +4 -0
  36. package/build/lib/native/utils/makeAnalyticsAttribute/makeAnalyticsConstants.js.map +1 -0
  37. package/build/lib/web/development/components/Accordion/AccordionButton.web.js +5 -7
  38. package/build/lib/web/development/components/Accordion/AccordionButton.web.js.map +1 -1
  39. package/build/lib/web/development/components/Accordion/AccordionItem.js +7 -5
  40. package/build/lib/web/development/components/Accordion/AccordionItem.js.map +1 -1
  41. package/build/lib/web/development/components/Alert/Alert.js +2 -0
  42. package/build/lib/web/development/components/Alert/Alert.js.map +1 -1
  43. package/build/lib/web/development/components/Avatar/AvatarButton.js +3 -0
  44. package/build/lib/web/development/components/Avatar/AvatarButton.js.map +1 -1
  45. package/build/lib/web/development/components/Card/Card.js +4 -1
  46. package/build/lib/web/development/components/Card/Card.js.map +1 -1
  47. package/build/lib/web/development/components/Card/CardContext.js +11 -6
  48. package/build/lib/web/development/components/Card/CardContext.js.map +1 -1
  49. package/build/lib/web/development/components/Card/CardFooter.js +3 -0
  50. package/build/lib/web/development/components/Card/CardFooter.js.map +1 -1
  51. package/build/lib/web/development/components/Card/CardHeader.js +38 -44
  52. package/build/lib/web/development/components/Card/CardHeader.js.map +1 -1
  53. package/build/lib/web/development/components/Chip/Chip.js +5 -5
  54. package/build/lib/web/development/components/Chip/Chip.js.map +1 -1
  55. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +6 -2
  56. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  57. package/build/lib/web/development/components/DatePicker/Calendar.web.js +4 -2
  58. package/build/lib/web/development/components/DatePicker/Calendar.web.js.map +1 -1
  59. package/build/lib/web/development/components/DatePicker/CalendarFooter.web.js +4 -0
  60. package/build/lib/web/development/components/DatePicker/CalendarFooter.web.js.map +1 -1
  61. package/build/lib/web/development/components/DatePicker/DateInput.web.js +10 -4
  62. package/build/lib/web/development/components/DatePicker/DateInput.web.js.map +1 -1
  63. package/build/lib/web/development/components/DatePicker/QuickSelection/PresetSideBar.web.js +1 -0
  64. package/build/lib/web/development/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
  65. package/build/lib/web/development/components/DatePicker/QuickSelection/QuickSelectionItem.web.js +2 -1
  66. package/build/lib/web/development/components/DatePicker/QuickSelection/QuickSelectionItem.web.js.map +1 -1
  67. package/build/lib/web/development/components/FileUpload/FileUploadItem.js +3 -0
  68. package/build/lib/web/development/components/FileUpload/FileUploadItem.js.map +1 -1
  69. package/build/lib/web/development/components/Form/FormLabel.js +24 -4
  70. package/build/lib/web/development/components/Form/FormLabel.js.map +1 -1
  71. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +6 -2
  72. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  73. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +1 -1
  74. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  75. package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +5 -1
  76. package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
  77. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js +5 -1
  78. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  79. package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +5 -1
  80. package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
  81. package/build/lib/web/development/components/Input/SearchInput/SearchInput.js +5 -1
  82. package/build/lib/web/development/components/Input/SearchInput/SearchInput.js.map +1 -1
  83. package/build/lib/web/development/components/Input/TextArea/TextArea.js +5 -1
  84. package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
  85. package/build/lib/web/development/components/Input/TextInput/TextInput.js +5 -1
  86. package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
  87. package/build/lib/web/development/components/List/ListItem.js +1 -1
  88. package/build/lib/web/development/components/List/ListItem.js.map +1 -1
  89. package/build/lib/web/development/components/Modal/Modal.web.js +6 -7
  90. package/build/lib/web/development/components/Modal/Modal.web.js.map +1 -1
  91. package/build/lib/web/development/components/Preview/Preview.web.js +8 -7
  92. package/build/lib/web/development/components/Preview/Preview.web.js.map +1 -1
  93. package/build/lib/web/development/components/QuickFilters/QuickFilter.js +9 -7
  94. package/build/lib/web/development/components/QuickFilters/QuickFilter.js.map +1 -1
  95. package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js +12 -2
  96. package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
  97. package/build/lib/web/development/components/Table/Table.web.js +6 -3
  98. package/build/lib/web/development/components/Table/Table.web.js.map +1 -1
  99. package/build/lib/web/development/components/Table/TableBody.web.js +5 -3
  100. package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
  101. package/build/lib/web/development/components/Table/TableEditableCell.web.js +11 -8
  102. package/build/lib/web/development/components/Table/TableEditableCell.web.js.map +1 -1
  103. package/build/lib/web/development/components/Table/TableHeader.web.js +4 -2
  104. package/build/lib/web/development/components/Table/TableHeader.web.js.map +1 -1
  105. package/build/lib/web/development/components/Table/TablePagination.web.js +12 -6
  106. package/build/lib/web/development/components/Table/TablePagination.web.js.map +1 -1
  107. package/build/lib/web/development/components/Table/TableToolbar.web.js +5 -8
  108. package/build/lib/web/development/components/Table/TableToolbar.web.js.map +1 -1
  109. package/build/lib/web/development/components/Toast/Toast.web.js +2 -0
  110. package/build/lib/web/development/components/Toast/Toast.web.js.map +1 -1
  111. package/build/lib/web/development/utils/makeAnalyticsAttribute/index.js +1 -0
  112. package/build/lib/web/development/utils/makeAnalyticsAttribute/index.js.map +1 -1
  113. package/build/lib/web/development/utils/makeAnalyticsAttribute/makeAnalyticsConstants.js +32 -0
  114. package/build/lib/web/development/utils/makeAnalyticsAttribute/makeAnalyticsConstants.js.map +1 -0
  115. package/build/lib/web/production/components/Accordion/AccordionButton.web.js +5 -7
  116. package/build/lib/web/production/components/Accordion/AccordionButton.web.js.map +1 -1
  117. package/build/lib/web/production/components/Accordion/AccordionItem.js +7 -5
  118. package/build/lib/web/production/components/Accordion/AccordionItem.js.map +1 -1
  119. package/build/lib/web/production/components/Alert/Alert.js +2 -0
  120. package/build/lib/web/production/components/Alert/Alert.js.map +1 -1
  121. package/build/lib/web/production/components/Avatar/AvatarButton.js +3 -0
  122. package/build/lib/web/production/components/Avatar/AvatarButton.js.map +1 -1
  123. package/build/lib/web/production/components/Card/Card.js +4 -1
  124. package/build/lib/web/production/components/Card/Card.js.map +1 -1
  125. package/build/lib/web/production/components/Card/CardContext.js +11 -6
  126. package/build/lib/web/production/components/Card/CardContext.js.map +1 -1
  127. package/build/lib/web/production/components/Card/CardFooter.js +3 -0
  128. package/build/lib/web/production/components/Card/CardFooter.js.map +1 -1
  129. package/build/lib/web/production/components/Card/CardHeader.js +38 -44
  130. package/build/lib/web/production/components/Card/CardHeader.js.map +1 -1
  131. package/build/lib/web/production/components/Chip/Chip.js +5 -5
  132. package/build/lib/web/production/components/Chip/Chip.js.map +1 -1
  133. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +6 -2
  134. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  135. package/build/lib/web/production/components/DatePicker/Calendar.web.js +4 -2
  136. package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -1
  137. package/build/lib/web/production/components/DatePicker/CalendarFooter.web.js +4 -0
  138. package/build/lib/web/production/components/DatePicker/CalendarFooter.web.js.map +1 -1
  139. package/build/lib/web/production/components/DatePicker/DateInput.web.js +10 -4
  140. package/build/lib/web/production/components/DatePicker/DateInput.web.js.map +1 -1
  141. package/build/lib/web/production/components/DatePicker/QuickSelection/PresetSideBar.web.js +1 -0
  142. package/build/lib/web/production/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
  143. package/build/lib/web/production/components/DatePicker/QuickSelection/QuickSelectionItem.web.js +2 -1
  144. package/build/lib/web/production/components/DatePicker/QuickSelection/QuickSelectionItem.web.js.map +1 -1
  145. package/build/lib/web/production/components/FileUpload/FileUploadItem.js +3 -0
  146. package/build/lib/web/production/components/FileUpload/FileUploadItem.js.map +1 -1
  147. package/build/lib/web/production/components/Form/FormLabel.js +24 -4
  148. package/build/lib/web/production/components/Form/FormLabel.js.map +1 -1
  149. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +6 -2
  150. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  151. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +1 -1
  152. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  153. package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +5 -1
  154. package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
  155. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js +5 -1
  156. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  157. package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +5 -1
  158. package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
  159. package/build/lib/web/production/components/Input/SearchInput/SearchInput.js +5 -1
  160. package/build/lib/web/production/components/Input/SearchInput/SearchInput.js.map +1 -1
  161. package/build/lib/web/production/components/Input/TextArea/TextArea.js +5 -1
  162. package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
  163. package/build/lib/web/production/components/Input/TextInput/TextInput.js +5 -1
  164. package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
  165. package/build/lib/web/production/components/List/ListItem.js +1 -1
  166. package/build/lib/web/production/components/List/ListItem.js.map +1 -1
  167. package/build/lib/web/production/components/Modal/Modal.web.js +6 -7
  168. package/build/lib/web/production/components/Modal/Modal.web.js.map +1 -1
  169. package/build/lib/web/production/components/Preview/Preview.web.js +8 -7
  170. package/build/lib/web/production/components/Preview/Preview.web.js.map +1 -1
  171. package/build/lib/web/production/components/QuickFilters/QuickFilter.js +9 -7
  172. package/build/lib/web/production/components/QuickFilters/QuickFilter.js.map +1 -1
  173. package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js +12 -2
  174. package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
  175. package/build/lib/web/production/components/Table/Table.web.js +6 -3
  176. package/build/lib/web/production/components/Table/Table.web.js.map +1 -1
  177. package/build/lib/web/production/components/Table/TableBody.web.js +5 -3
  178. package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
  179. package/build/lib/web/production/components/Table/TableEditableCell.web.js +11 -8
  180. package/build/lib/web/production/components/Table/TableEditableCell.web.js.map +1 -1
  181. package/build/lib/web/production/components/Table/TableHeader.web.js +4 -2
  182. package/build/lib/web/production/components/Table/TableHeader.web.js.map +1 -1
  183. package/build/lib/web/production/components/Table/TablePagination.web.js +12 -6
  184. package/build/lib/web/production/components/Table/TablePagination.web.js.map +1 -1
  185. package/build/lib/web/production/components/Table/TableToolbar.web.js +5 -8
  186. package/build/lib/web/production/components/Table/TableToolbar.web.js.map +1 -1
  187. package/build/lib/web/production/components/Toast/Toast.web.js +2 -0
  188. package/build/lib/web/production/components/Toast/Toast.web.js.map +1 -1
  189. package/build/lib/web/production/utils/makeAnalyticsAttribute/index.js +1 -0
  190. package/build/lib/web/production/utils/makeAnalyticsAttribute/index.js.map +1 -1
  191. package/build/lib/web/production/utils/makeAnalyticsAttribute/makeAnalyticsConstants.js +32 -0
  192. package/build/lib/web/production/utils/makeAnalyticsAttribute/makeAnalyticsConstants.js.map +1 -0
  193. package/build/types/components/index.d.ts +44 -11
  194. package/build/types/components/index.native.d.ts +40 -9
  195. package/package.json +1 -1
@@ -21,7 +21,7 @@ import { getComponentId } from '../../utils/isValidAllowedChildren/isValidAllowe
21
21
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
22
22
  import { jsx, jsxs } from 'react/jsx-runtime';
23
23
 
24
- var _excluded=["title","description","icon","children","isDisabled","_index","testID"];var AccordionItem=function AccordionItem(_ref){var title=_ref.title,description=_ref.description,icon=_ref.icon,children=_ref.children,isDisabled=_ref.isDisabled,_index=_ref._index,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var _useAccordion=useAccordion(),expandedIndex=_useAccordion.expandedIndex,onExpandChange=_useAccordion.onExpandChange,defaultExpandedIndex=_useAccordion.defaultExpandedIndex,variant=_useAccordion.variant,numberOfItems=_useAccordion.numberOfItems;var isExpanded=expandedIndex===_index;var isDefaultExpanded=defaultExpandedIndex===_index;var isDeprecatedAPI=Boolean(title)||Boolean(description)||Boolean(icon);var _React$Children$toArr=React__default.Children.toArray(children),_React$Children$toArr2=_slicedToArray(_React$Children$toArr,2),header=_React$Children$toArr2[0],body=_React$Children$toArr2[1];if(!isDeprecatedAPI){var headerComponentId=getComponentId(header);var bodyComponentId=getComponentId(body);if(headerComponentId!==componentIds.AccordionItemHeader&&bodyComponentId!==componentIds.AccordionItemBody){throwBladeError({message:'AccordionItem only allows AccordionItemHeader as first component and AccordionItemBody as second. Check Accordion documentation',moduleName:'AccordionItem'});}}var isLastItem=_index!==undefined&&_index<numberOfItems-1;var handleExpandChange=function handleExpandChange(_ref2){var isExpanded=_ref2.isExpanded;if(isExpanded&&typeof _index!=='undefined'){onExpandChange(_index);}else {onExpandChange(-1);}};return jsx(AccordionItemContext.Provider,{value:{index:_index,isDisabled:isDisabled},children:jsxs(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.AccordionItem,testID:testID}),makeAnalyticsAttribute(rest),{children:[jsxs(Collapsible,{isExpanded:isExpanded,defaultIsExpanded:isDefaultExpanded,onExpandChange:handleExpandChange,_shouldApplyWidthRestrictions:false,_dangerouslyDisableValidations:true,children:[jsx(AccordionButton,{index:_index,icon:icon,title:title,header:header,isDisabled:isDisabled,isDeprecatedAPI:isDeprecatedAPI}),jsx(CollapsibleBody,{width:isReactNative()||!isDeprecatedAPI?'100%':undefined,children:isDeprecatedAPI?jsx(AccordionItemBody,{_description:description,children:children}):body})]}),isLastItem||variant==='transparent'?jsx(Divider,{}):null]}))});};
24
+ var _excluded=["title","description","icon","children","isDisabled","_index","testID"];var AccordionItem=function AccordionItem(_ref){var title=_ref.title,description=_ref.description,icon=_ref.icon,children=_ref.children,isDisabled=_ref.isDisabled,_index=_ref._index,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var _useAccordion=useAccordion(),expandedIndex=_useAccordion.expandedIndex,onExpandChange=_useAccordion.onExpandChange,defaultExpandedIndex=_useAccordion.defaultExpandedIndex,variant=_useAccordion.variant,numberOfItems=_useAccordion.numberOfItems;var isExpanded=expandedIndex===_index;var isDefaultExpanded=defaultExpandedIndex===_index;var isDeprecatedAPI=Boolean(title)||Boolean(description)||Boolean(icon);var _React$Children$toArr=React__default.Children.toArray(children),_React$Children$toArr2=_slicedToArray(_React$Children$toArr,2),header=_React$Children$toArr2[0],body=_React$Children$toArr2[1];if(!isDeprecatedAPI){var headerComponentId=getComponentId(header);var bodyComponentId=getComponentId(body);if(headerComponentId!==componentIds.AccordionItemHeader&&bodyComponentId!==componentIds.AccordionItemBody){throwBladeError({message:'AccordionItem only allows AccordionItemHeader as first component and AccordionItemBody as second. Check Accordion documentation',moduleName:'AccordionItem'});}}var isLastItem=_index!==undefined&&_index<numberOfItems-1;var handleExpandChange=function handleExpandChange(_ref2){var isExpanded=_ref2.isExpanded;if(isExpanded&&typeof _index!=='undefined'){onExpandChange(_index);}else {onExpandChange(-1);}};return jsx(AccordionItemContext.Provider,{value:{index:_index,isDisabled:isDisabled},children:jsxs(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.AccordionItem,testID:testID}),{children:[jsxs(Collapsible,Object.assign({isExpanded:isExpanded,defaultIsExpanded:isDefaultExpanded,onExpandChange:handleExpandChange,_shouldApplyWidthRestrictions:false,_dangerouslyDisableValidations:true},makeAnalyticsAttribute(rest),{children:[jsx(AccordionButton,{index:_index,icon:icon,title:title,header:header,isDisabled:isDisabled,isDeprecatedAPI:isDeprecatedAPI}),jsx(CollapsibleBody,{width:isReactNative()||!isDeprecatedAPI?'100%':undefined,children:isDeprecatedAPI?jsx(AccordionItemBody,{_description:description,children:children}):body})]})),isLastItem||variant==='transparent'?jsx(Divider,{}):null]}))});};
25
25
 
26
26
  export { AccordionItem };
27
27
  //# sourceMappingURL=AccordionItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.js","sources":["../../../../../src/components/Accordion/AccordionItem.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport { AccordionButton } from './AccordionButton';\nimport { AccordionItemContext, useAccordion } from './AccordionContext';\nimport { AccordionItemBody } from './AccordionItemBody';\nimport { componentIds } from './componentIds';\nimport { Divider } from '~components/Divider';\nimport { BaseBox } from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { isReactNative } from '~utils';\nimport { Collapsible } from '~components/Collapsible/Collapsible';\nimport { CollapsibleBody } from '~components/Collapsible';\nimport type { TestID, DataAnalyticsAttribute } from '~utils/types';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype AccordionItemProps = {\n /**\n * Title text content\n *\n * @deprecated Use AccordionItemHeader and AccordionItemBody\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n title?: string;\n\n /**\n * Body text content\n *\n * @deprecated Use AccordionItemHeader and AccordionItemBody\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n description?: string;\n\n /**\n * Renders a Blade icon as title prefix (requires `showNumberPrefix={false}`)\n *\n * @deprecated Use `leading={<StarIcon size=\"large\" />}` on AccordionItemHeader instead\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n icon?: IconComponent;\n\n /**\n * Slot, renders any custom content\n */\n children?: ReactNode | ReactNode[];\n\n /**\n * Disabled state of the item\n *\n * @default false\n */\n isDisabled?: boolean;\n\n /**\n * **Internal:** used for determining numbering, you don't need to pass this,\n * instead pass `showNumberPrefix` to root `Accordion`\n */\n _index?: number;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst AccordionItem = ({\n title,\n description,\n icon,\n children,\n isDisabled,\n _index,\n testID,\n ...rest\n}: AccordionItemProps): ReactElement => {\n const {\n expandedIndex,\n onExpandChange,\n defaultExpandedIndex,\n variant,\n numberOfItems,\n } = useAccordion();\n const isExpanded = expandedIndex === _index;\n const isDefaultExpanded = defaultExpandedIndex === _index;\n const isDeprecatedAPI = Boolean(title) || Boolean(description) || Boolean(icon);\n const [header, body] = React.Children.toArray(children);\n\n if (!isDeprecatedAPI) {\n // Only doing validation in new API. Deprecated API allows everything as AccordionItem children\n const headerComponentId = getComponentId(header);\n const bodyComponentId = getComponentId(body);\n\n if (\n headerComponentId !== componentIds.AccordionItemHeader &&\n bodyComponentId !== componentIds.AccordionItemBody\n ) {\n throwBladeError({\n message:\n 'AccordionItem only allows AccordionItemHeader as first component and AccordionItemBody as second. Check Accordion documentation',\n moduleName: 'AccordionItem',\n });\n }\n }\n\n const isLastItem = _index !== undefined && _index < numberOfItems - 1;\n\n const handleExpandChange = ({ isExpanded }: { isExpanded: boolean }): void => {\n if (isExpanded && typeof _index !== 'undefined') {\n onExpandChange(_index);\n } else {\n onExpandChange(-1);\n }\n };\n\n return (\n <AccordionItemContext.Provider\n value={{\n index: _index,\n isDisabled,\n }}\n >\n <BaseBox\n {...metaAttribute({ name: MetaConstants.AccordionItem, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <Collapsible\n isExpanded={isExpanded}\n defaultIsExpanded={isDefaultExpanded}\n onExpandChange={handleExpandChange}\n // Accordion has its own width restrictions\n _shouldApplyWidthRestrictions={false}\n _dangerouslyDisableValidations={true}\n >\n <AccordionButton\n index={_index}\n icon={icon}\n title={title}\n header={header}\n isDisabled={isDisabled}\n isDeprecatedAPI={isDeprecatedAPI}\n />\n <CollapsibleBody\n // Just React Native things, need this 100% so collapsed content flows correctly inside Accordion\n // In new API, AccordionItemBody takes 100% width to avoid issues like this - https://github.com/razorpay/blade/pull/1814\n width={isReactNative() || !isDeprecatedAPI ? '100%' : undefined}\n >\n {isDeprecatedAPI ? (\n <AccordionItemBody _description={description}>{children}</AccordionItemBody>\n ) : (\n body\n )}\n </CollapsibleBody>\n </Collapsible>\n {isLastItem || variant === 'transparent' ? <Divider /> : null}\n </BaseBox>\n </AccordionItemContext.Provider>\n );\n};\n\nexport type { AccordionItemProps };\nexport { AccordionItem };\n"],"names":["AccordionItem","_ref","title","description","icon","children","isDisabled","_index","testID","rest","_objectWithoutProperties","_excluded","_useAccordion","useAccordion","expandedIndex","onExpandChange","defaultExpandedIndex","variant","numberOfItems","isExpanded","isDefaultExpanded","isDeprecatedAPI","Boolean","_React$Children$toArr","React","Children","toArray","_React$Children$toArr2","_slicedToArray","header","body","headerComponentId","getComponentId","bodyComponentId","componentIds","AccordionItemHeader","AccordionItemBody","throwBladeError","message","moduleName","isLastItem","undefined","handleExpandChange","_ref2","_jsx","AccordionItemContext","Provider","value","index","_jsxs","BaseBox","Object","assign","metaAttribute","name","MetaConstants","makeAnalyticsAttribute","Collapsible","defaultIsExpanded","_shouldApplyWidthRestrictions","_dangerouslyDisableValidations","AccordionButton","CollapsibleBody","width","isReactNative","_description","Divider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;uFAkEM,IA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,MAAM,CAAEA,MAAO,CACfvB,UAAU,CAAEA,UAAW,CACvBe,eAAe,CAAEA,eAAgB,CAClC,CAAC,CACFuB,GAAA,CAACkB,eAAe,CAAA,CAGdC,KAAK,CAAEC,aAAa,EAAE,EAAI,CAAC3C,eAAe,CAAG,MAAM,CAAGoB,SAAU,CAAApC,QAAA,CAE/DgB,eAAe,CACduB,GAAA,CAACR,iBAAiB,CAAC6B,CAAAA,YAAY,CAAE9D,WAAY,CAAAE,QAAA,CAAEA,QAAQ,CAAoB,CAAC,CAE5EyB,IACD,CACc,CAAC,CACP,CAAA,CAAC,CACbU,UAAU,EAAIvB,OAAO,GAAK,aAAa,CAAG2B,GAAA,CAACsB,OAAO,CAAE,EAAA,CAAC,CAAG,IAAI,CACtD,CAAA,CAAA,CAAC,CACmB,CAAC,CAEpC;;;;"}
1
+ {"version":3,"file":"AccordionItem.js","sources":["../../../../../src/components/Accordion/AccordionItem.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport { AccordionButton } from './AccordionButton';\nimport { AccordionItemContext, useAccordion } from './AccordionContext';\nimport { AccordionItemBody } from './AccordionItemBody';\nimport { componentIds } from './componentIds';\nimport { Divider } from '~components/Divider';\nimport { BaseBox } from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { isReactNative } from '~utils';\nimport { Collapsible } from '~components/Collapsible/Collapsible';\nimport { CollapsibleBody } from '~components/Collapsible';\nimport type { TestID, DataAnalyticsAttribute } from '~utils/types';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype AccordionItemProps = {\n /**\n * Title text content\n *\n * @deprecated Use AccordionItemHeader and AccordionItemBody\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n title?: string;\n\n /**\n * Body text content\n *\n * @deprecated Use AccordionItemHeader and AccordionItemBody\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n description?: string;\n\n /**\n * Renders a Blade icon as title prefix (requires `showNumberPrefix={false}`)\n *\n * @deprecated Use `leading={<StarIcon size=\"large\" />}` on AccordionItemHeader instead\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n icon?: IconComponent;\n\n /**\n * Slot, renders any custom content\n */\n children?: ReactNode | ReactNode[];\n\n /**\n * Disabled state of the item\n *\n * @default false\n */\n isDisabled?: boolean;\n\n /**\n * **Internal:** used for determining numbering, you don't need to pass this,\n * instead pass `showNumberPrefix` to root `Accordion`\n */\n _index?: number;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst AccordionItem = ({\n title,\n description,\n icon,\n children,\n isDisabled,\n _index,\n testID,\n ...rest\n}: AccordionItemProps): ReactElement => {\n const {\n expandedIndex,\n onExpandChange,\n defaultExpandedIndex,\n variant,\n numberOfItems,\n } = useAccordion();\n const isExpanded = expandedIndex === _index;\n const isDefaultExpanded = defaultExpandedIndex === _index;\n const isDeprecatedAPI = Boolean(title) || Boolean(description) || Boolean(icon);\n const [header, body] = React.Children.toArray(children);\n\n if (!isDeprecatedAPI) {\n // Only doing validation in new API. Deprecated API allows everything as AccordionItem children\n const headerComponentId = getComponentId(header);\n const bodyComponentId = getComponentId(body);\n\n if (\n headerComponentId !== componentIds.AccordionItemHeader &&\n bodyComponentId !== componentIds.AccordionItemBody\n ) {\n throwBladeError({\n message:\n 'AccordionItem only allows AccordionItemHeader as first component and AccordionItemBody as second. Check Accordion documentation',\n moduleName: 'AccordionItem',\n });\n }\n }\n\n const isLastItem = _index !== undefined && _index < numberOfItems - 1;\n\n const handleExpandChange = ({ isExpanded }: { isExpanded: boolean }): void => {\n if (isExpanded && typeof _index !== 'undefined') {\n onExpandChange(_index);\n } else {\n onExpandChange(-1);\n }\n };\n\n return (\n <AccordionItemContext.Provider\n value={{\n index: _index,\n isDisabled,\n }}\n >\n <BaseBox {...metaAttribute({ name: MetaConstants.AccordionItem, testID })}>\n <Collapsible\n isExpanded={isExpanded}\n defaultIsExpanded={isDefaultExpanded}\n onExpandChange={handleExpandChange}\n // Accordion has its own width restrictions\n _shouldApplyWidthRestrictions={false}\n _dangerouslyDisableValidations={true}\n // adding analytics attributes to Collapsible section\n {...makeAnalyticsAttribute(rest)}\n >\n <AccordionButton\n index={_index}\n icon={icon}\n title={title}\n header={header}\n isDisabled={isDisabled}\n isDeprecatedAPI={isDeprecatedAPI}\n />\n <CollapsibleBody\n // Just React Native things, need this 100% so collapsed content flows correctly inside Accordion\n // In new API, AccordionItemBody takes 100% width to avoid issues like this - https://github.com/razorpay/blade/pull/1814\n width={isReactNative() || !isDeprecatedAPI ? '100%' : undefined}\n >\n {isDeprecatedAPI ? (\n <AccordionItemBody _description={description}>{children}</AccordionItemBody>\n ) : (\n body\n )}\n </CollapsibleBody>\n </Collapsible>\n {isLastItem || variant === 'transparent' ? <Divider /> : null}\n </BaseBox>\n </AccordionItemContext.Provider>\n );\n};\n\nexport type { AccordionItemProps };\nexport { AccordionItem };\n"],"names":["AccordionItem","_ref","title","description","icon","children","isDisabled","_index","testID","rest","_objectWithoutProperties","_excluded","_useAccordion","useAccordion","expandedIndex","onExpandChange","defaultExpandedIndex","variant","numberOfItems","isExpanded","isDefaultExpanded","isDeprecatedAPI","Boolean","_React$Children$toArr","React","Children","toArray","_React$Children$toArr2","_slicedToArray","header","body","headerComponentId","getComponentId","bodyComponentId","componentIds","AccordionItemHeader","AccordionItemBody","throwBladeError","message","moduleName","isLastItem","undefined","handleExpandChange","_ref2","_jsx","AccordionItemContext","Provider","value","index","_jsxs","BaseBox","Object","assign","metaAttribute","name","MetaConstants","Collapsible","defaultIsExpanded","_shouldApplyWidthRestrictions","_dangerouslyDisableValidations","makeAnalyticsAttribute","AccordionButton","CollapsibleBody","width","isReactNative","_description","Divider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;uF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AEA,IAAK,CACXF,KAAK,CAAEA,KAAM,CACb2B,MAAM,CAAEA,MAAO,CACfvB,UAAU,CAAEA,UAAW,CACvBe,eAAe,CAAEA,eAAgB,CAClC,CAAC,CACFuB,GAAA,CAACkB,eAAe,CAAA,CAGdC,KAAK,CAAEC,aAAa,EAAE,EAAI,CAAC3C,eAAe,CAAG,MAAM,CAAGoB,SAAU,CAAApC,QAAA,CAE/DgB,eAAe,CACduB,GAAA,CAACR,iBAAiB,CAAC6B,CAAAA,YAAY,CAAE9D,WAAY,CAAAE,QAAA,CAAEA,QAAQ,CAAoB,CAAC,CAE5EyB,IACD,CACc,CAAC,CACP,CAAA,CAAA,CAAC,CACbU,UAAU,EAAIvB,OAAO,GAAK,aAAa,CAAG2B,GAAA,CAACsB,OAAO,CAAE,EAAA,CAAC,CAAG,IAAI,CACtD,CAAA,CAAA,CAAC,CACmB,CAAC,CAEpC;;;;"}
@@ -34,8 +34,9 @@ import BaseButton from '../Button/BaseButton/BaseButton.js';
34
34
  import BaseLink from '../Link/BaseLink/BaseLink.js';
35
35
  import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.native.js';
36
36
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
37
+ import { MAKE_ANALYTICS_CONSTANTS } from '../../utils/makeAnalyticsAttribute/makeAnalyticsConstants.js';
37
38
 
38
- var _excluded=["description","title","isDismissible","onDismiss","emphasis","isFullWidth","color","actions","testID","icon"];var isReactNative=getPlatformType()==='react-native';var CloseButtonWrapper=isReactNative?BaseBox:Fragment;var intentIconMap={positive:CheckCircleIcon,negative:AlertOctagonIcon,information:InfoIcon,neutral:InfoIcon,notice:AlertTriangleIcon};var _Alert=function _Alert(_ref,ref){var description=_ref.description,title=_ref.title,_ref$isDismissible=_ref.isDismissible,isDismissible=_ref$isDismissible===void 0?true:_ref$isDismissible,onDismiss=_ref.onDismiss,_ref$emphasis=_ref.emphasis,emphasis=_ref$emphasis===void 0?'subtle':_ref$emphasis,_ref$isFullWidth=_ref.isFullWidth,isFullWidth=_ref$isFullWidth===void 0?false:_ref$isFullWidth,_ref$color=_ref.color,color=_ref$color===void 0?'neutral':_ref$color,actions=_ref.actions,testID=_ref.testID,icon=_ref.icon,rest=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var _useState=useState(true),_useState2=_slicedToArray(_useState,2),isVisible=_useState2[0],setIsVisible=_useState2[1];var isDesktop=matchedDeviceType==='desktop';var isMobile=!isDesktop;var Icon=icon!=null?icon:intentIconMap[color];var iconOffset='spacing.1';if(isReactNative){if(isFullWidth&&!title){iconOffset='spacing.1';}else if(!isFullWidth&&!title){iconOffset='spacing.0';}else if(!isFullWidth&&title){iconOffset='spacing.2';}}else if(isMobile){if(!isFullWidth&&title){iconOffset='spacing.2';}else if(isFullWidth&&!title){iconOffset='spacing.2';}}else if(isFullWidth){iconOffset='spacing.1';}var shouldCenterAlign=isFullWidth&&!title;var alignment='flex-start';if(!isFullWidth)alignment='flex-start';if(shouldCenterAlign)alignment='center';var leadingIcon=jsx(BaseBox,{display:"flex",alignSelf:alignment,marginTop:iconOffset,children:jsx(Icon,{color:emphasis==='intense'?'surface.icon.staticWhite.normal':`feedback.icon.${color}.${emphasis==='subtle'?'intense':'subtle'}`,size:"medium"})});var textColor=emphasis==='intense'?'surface.text.staticWhite.normal':'surface.text.gray.subtle';var _title=title?jsx(BaseBox,{marginBottom:"spacing.2",children:jsx(Text,{color:textColor,size:"medium",weight:"semibold",children:title})}):null;var _description=jsx(BaseBox,{marginTop:title||isReactNative?'spacing.0':'spacing.1',children:jsx(Text,{color:textColor,size:"small",children:description})});var primaryAction=actions!=null&&actions.primary?jsx(BaseBox,{marginRight:"spacing.5",display:isReactNative?castNativeType('flex'):castWebType('inline-flex'),children:jsx(BaseButton,{size:"small",onClick:actions.primary.onClick,color:emphasis==='intense'?'white':color,variant:"secondary",children:actions.primary.text})}):null;var secondaryActionParams=actions!=null&&actions.secondary?{onClick:actions.secondary.onClick}:null;if(actions!=null&&actions.secondary&&secondaryActionParams&&'href'in actions.secondary){secondaryActionParams.href=actions.secondary.href;secondaryActionParams.target=actions.secondary.target;secondaryActionParams.rel=actions.secondary.rel;}var secondaryAction=actions!=null&&actions.secondary?jsx(BaseBox,{marginRight:"spacing.4",display:isReactNative?'flex':'inline-flex',children:jsx(BaseLink,Object.assign({size:"small",color:emphasis==='intense'?'white':color},secondaryActionParams,{children:actions.secondary.text}))}):null;var showActionsHorizontal=isFullWidth&&isDesktop;var actionsHorizontal=showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var actionsVertical=!showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{marginTop:"spacing.4",flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var onClickDismiss=function onClickDismiss(){if(onDismiss){onDismiss();}setIsVisible(false);};var closeButton=isDismissible?jsx(CloseButtonWrapper,{children:jsx(IconButton,{accessibilityLabel:"Dismiss alert",onClick:onClickDismiss,emphasis:emphasis==='intense'?'subtle':'intense',size:"large",icon:CloseIcon})}):null;var a11yProps=makeAccessible(Object.assign({role:isReactNative||color==='negative'||color==='notice'?'alert':'status'},color==='notice'&&{liveRegion:'polite'}));if(!isVisible){return null;}return jsx(BaseBox,Object.assign({ref:ref},a11yProps,metaAttribute({name:MetaConstants.Alert,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsxs(StyledAlert,{color:color,emphasis:emphasis,isFullWidth:isFullWidth,isDesktop:isDesktop,textAlign:'left',children:[leadingIcon,jsxs(BaseBox,{flex:1,paddingLeft:isFullWidth?'spacing.4':'spacing.3',paddingRight:showActionsHorizontal?'spacing.4':'spacing.2',children:[_title,_description,actionsVertical]}),actionsHorizontal,closeButton]})}));};var Alert=forwardRef(_Alert);
39
+ var _excluded=["description","title","isDismissible","onDismiss","emphasis","isFullWidth","color","actions","testID","icon"];var isReactNative=getPlatformType()==='react-native';var CloseButtonWrapper=isReactNative?BaseBox:Fragment;var intentIconMap={positive:CheckCircleIcon,negative:AlertOctagonIcon,information:InfoIcon,neutral:InfoIcon,notice:AlertTriangleIcon};var _Alert=function _Alert(_ref,ref){var description=_ref.description,title=_ref.title,_ref$isDismissible=_ref.isDismissible,isDismissible=_ref$isDismissible===void 0?true:_ref$isDismissible,onDismiss=_ref.onDismiss,_ref$emphasis=_ref.emphasis,emphasis=_ref$emphasis===void 0?'subtle':_ref$emphasis,_ref$isFullWidth=_ref.isFullWidth,isFullWidth=_ref$isFullWidth===void 0?false:_ref$isFullWidth,_ref$color=_ref.color,color=_ref$color===void 0?'neutral':_ref$color,actions=_ref.actions,testID=_ref.testID,icon=_ref.icon,rest=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var _useState=useState(true),_useState2=_slicedToArray(_useState,2),isVisible=_useState2[0],setIsVisible=_useState2[1];var isDesktop=matchedDeviceType==='desktop';var isMobile=!isDesktop;var Icon=icon!=null?icon:intentIconMap[color];var iconOffset='spacing.1';if(isReactNative){if(isFullWidth&&!title){iconOffset='spacing.1';}else if(!isFullWidth&&!title){iconOffset='spacing.0';}else if(!isFullWidth&&title){iconOffset='spacing.2';}}else if(isMobile){if(!isFullWidth&&title){iconOffset='spacing.2';}else if(isFullWidth&&!title){iconOffset='spacing.2';}}else if(isFullWidth){iconOffset='spacing.1';}var shouldCenterAlign=isFullWidth&&!title;var alignment='flex-start';if(!isFullWidth)alignment='flex-start';if(shouldCenterAlign)alignment='center';var leadingIcon=jsx(BaseBox,{display:"flex",alignSelf:alignment,marginTop:iconOffset,children:jsx(Icon,{color:emphasis==='intense'?'surface.icon.staticWhite.normal':`feedback.icon.${color}.${emphasis==='subtle'?'intense':'subtle'}`,size:"medium"})});var textColor=emphasis==='intense'?'surface.text.staticWhite.normal':'surface.text.gray.subtle';var _title=title?jsx(BaseBox,{marginBottom:"spacing.2",children:jsx(Text,{color:textColor,size:"medium",weight:"semibold",children:title})}):null;var _description=jsx(BaseBox,{marginTop:title||isReactNative?'spacing.0':'spacing.1',children:jsx(Text,{color:textColor,size:"small",children:description})});var primaryAction=actions!=null&&actions.primary?jsx(BaseBox,{marginRight:"spacing.5",display:isReactNative?castNativeType('flex'):castWebType('inline-flex'),children:jsx(BaseButton,{size:"small",onClick:actions.primary.onClick,color:emphasis==='intense'?'white':color,variant:"secondary","data-analytics-name":MAKE_ANALYTICS_CONSTANTS.ALERT.PRIMARY_ACTION_BUTTON,children:actions.primary.text})}):null;var secondaryActionParams=actions!=null&&actions.secondary?{onClick:actions.secondary.onClick}:null;if(actions!=null&&actions.secondary&&secondaryActionParams&&'href'in actions.secondary){secondaryActionParams.href=actions.secondary.href;secondaryActionParams.target=actions.secondary.target;secondaryActionParams.rel=actions.secondary.rel;}var secondaryAction=actions!=null&&actions.secondary?jsx(BaseBox,{marginRight:"spacing.4",display:isReactNative?'flex':'inline-flex',children:jsx(BaseLink,Object.assign({size:"small",color:emphasis==='intense'?'white':color},secondaryActionParams,{children:actions.secondary.text}))}):null;var showActionsHorizontal=isFullWidth&&isDesktop;var actionsHorizontal=showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var actionsVertical=!showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{marginTop:"spacing.4",flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var onClickDismiss=function onClickDismiss(){if(onDismiss){onDismiss();}setIsVisible(false);};var closeButton=isDismissible?jsx(CloseButtonWrapper,{children:jsx(IconButton,{accessibilityLabel:"Dismiss alert",onClick:onClickDismiss,emphasis:emphasis==='intense'?'subtle':'intense',size:"large",icon:CloseIcon})}):null;var a11yProps=makeAccessible(Object.assign({role:isReactNative||color==='negative'||color==='notice'?'alert':'status'},color==='notice'&&{liveRegion:'polite'}));if(!isVisible){return null;}return jsx(BaseBox,Object.assign({ref:ref},a11yProps,metaAttribute({name:MetaConstants.Alert,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsxs(StyledAlert,{color:color,emphasis:emphasis,isFullWidth:isFullWidth,isDesktop:isDesktop,textAlign:'left',children:[leadingIcon,jsxs(BaseBox,{flex:1,paddingLeft:isFullWidth?'spacing.4':'spacing.3',paddingRight:showActionsHorizontal?'spacing.4':'spacing.2',children:[_title,_description,actionsVertical]}),actionsHorizontal,closeButton]})}));};var Alert=forwardRef(_Alert);
39
40
 
40
41
  export { Alert };
41
42
  //# sourceMappingURL=Alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import type { ReactChild, ReactElement } from 'react';\nimport React, { Fragment, useState, forwardRef } from 'react';\n\nimport { StyledAlert } from './StyledAlert';\nimport type { IconComponent } from '~components/Icons';\nimport {\n AlertOctagonIcon,\n AlertTriangleIcon,\n CheckCircleIcon,\n CloseIcon,\n InfoIcon,\n} from '~components/Icons';\nimport { castNativeType, castWebType, useBreakpoint, getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport BaseButton from '~components/Button/BaseButton';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport type { FeedbackColors, SubtleOrIntense } from '~tokens/theme/theme';\nimport { useTheme } from '~components/BladeProvider';\nimport type {\n DataAnalyticsAttribute,\n BladeElementRef,\n DotNotationSpacingStringToken,\n TestID,\n} from '~utils/types';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype PrimaryAction = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionButton = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionLinkButton = {\n text: string;\n href: string;\n onClick?: () => void;\n target?: string;\n /**\n * When `target` is set to `_blank` this is automatically set to `noopener noreferrer`\n */\n rel?: string;\n};\n\ntype SecondaryAction = SecondaryActionButton | SecondaryActionLinkButton;\n\ntype AlertProps = {\n /**\n * Body content, pass text or JSX. Avoid passing components except `Link` to customize the content.\n */\n description: ReactChild;\n\n /**\n * A brief heading\n */\n title?: string;\n\n /**\n * Shows a dismiss button\n *\n * @default true\n */\n isDismissible?: boolean;\n\n /**\n * A callback when the dismiss button is clicked\n */\n onDismiss?: () => void;\n\n /**\n * Can be used to render custom icon\n */\n icon?: IconComponent;\n\n /**\n * Can be set to `high` for a more prominent look. Not to be confused with a11y emphasis.\n *\n * @default subtle\n */\n emphasis?: SubtleOrIntense;\n\n /**\n * Makes the Alert span the entire container width, instead of the default max width of `584px`.\n * This also makes the alert borderless, useful for creating full bleed layouts.\n *\n * @default false\n */\n isFullWidth?: boolean;\n\n /**\n * Sets the color tone\n */\n color?: FeedbackColors;\n\n /**\n * Renders a primary action button and a secondary action link button\n */\n actions?: {\n /**\n * Renders a button (should **always** be present if `secondary` action is being used)\n */\n primary?: PrimaryAction;\n /**\n * Renders a Link button\n */\n secondary?: SecondaryAction;\n };\n} & TestID &\n StyledPropsBlade &\n DataAnalyticsAttribute;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n// Need extra wrappers on React Native only for alignment\nconst CloseButtonWrapper = isReactNative ? BaseBox : Fragment;\n\nconst intentIconMap = {\n positive: CheckCircleIcon,\n negative: AlertOctagonIcon,\n information: InfoIcon,\n neutral: InfoIcon,\n notice: AlertTriangleIcon,\n};\n\nconst _Alert = (\n {\n description,\n title,\n isDismissible = true,\n onDismiss,\n emphasis = 'subtle',\n isFullWidth = false,\n color = 'neutral',\n actions,\n testID,\n icon,\n ...rest\n }: AlertProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement | null => {\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const [isVisible, setIsVisible] = useState(true);\n\n const isDesktop = matchedDeviceType === 'desktop';\n const isMobile = !isDesktop;\n\n const Icon = icon ?? intentIconMap[color];\n let iconOffset: DotNotationSpacingStringToken = 'spacing.1';\n\n // certain special cases below needs special care for near perfect alignment\n if (isReactNative) {\n if (isFullWidth && !title) {\n iconOffset = 'spacing.1';\n } else if (!isFullWidth && !title) {\n iconOffset = 'spacing.0';\n } else if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n }\n } else if (isMobile) {\n if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n } else if (isFullWidth && !title) {\n iconOffset = 'spacing.2';\n }\n } else if (isFullWidth) {\n iconOffset = 'spacing.1';\n }\n\n const shouldCenterAlign = isFullWidth && !title;\n let alignment: 'center' | 'flex-start' = 'flex-start';\n if (!isFullWidth) alignment = 'flex-start';\n if (shouldCenterAlign) alignment = 'center';\n\n const leadingIcon = (\n <BaseBox display=\"flex\" alignSelf={alignment} marginTop={iconOffset}>\n <Icon\n color={\n emphasis === 'intense'\n ? 'surface.icon.staticWhite.normal'\n : `feedback.icon.${color}.${emphasis === 'subtle' ? 'intense' : 'subtle'}`\n }\n size=\"medium\"\n />\n </BaseBox>\n );\n\n const textColor =\n emphasis === 'intense' ? 'surface.text.staticWhite.normal' : 'surface.text.gray.subtle';\n const _title = title ? (\n <BaseBox marginBottom=\"spacing.2\">\n <Text color={textColor} size=\"medium\" weight=\"semibold\">\n {title}\n </Text>\n </BaseBox>\n ) : null;\n\n const _description = (\n <BaseBox marginTop={title || isReactNative ? 'spacing.0' : 'spacing.1'}>\n <Text color={textColor} size=\"small\">\n {description}\n </Text>\n </BaseBox>\n );\n\n const primaryAction = actions?.primary ? (\n <BaseBox\n marginRight=\"spacing.5\"\n display={isReactNative ? castNativeType('flex') : castWebType('inline-flex')}\n >\n <BaseButton\n size=\"small\"\n onClick={actions.primary.onClick}\n color={emphasis === 'intense' ? 'white' : color}\n variant=\"secondary\"\n >\n {actions.primary.text}\n </BaseButton>\n </BaseBox>\n ) : null;\n\n const secondaryActionParams: Partial<SecondaryActionLinkButton> | null = actions?.secondary\n ? {\n onClick: actions.secondary.onClick,\n }\n : null;\n\n /**\n * TS assumes only common properties to be present for `SecondaryAction` union type\n * We add a type guard that checks if href is present on secondary action:\n * - If yes, then TS can assume it to be `SecondaryActionLinkButton` (href being a required property)\n * - If no, then it would be `SecondaryActionButton` (and link properties wouldn't be needed)\n */\n if (actions?.secondary && secondaryActionParams && 'href' in actions.secondary) {\n secondaryActionParams.href = actions.secondary.href;\n secondaryActionParams.target = actions.secondary.target;\n secondaryActionParams.rel = actions.secondary.rel;\n }\n\n const secondaryAction = actions?.secondary ? (\n <BaseBox marginRight=\"spacing.4\" display={(isReactNative ? 'flex' : 'inline-flex') as never}>\n <BaseLink\n size=\"small\"\n color={emphasis === 'intense' ? 'white' : color}\n {...secondaryActionParams}\n >\n {actions.secondary.text}\n </BaseLink>\n </BaseBox>\n ) : null;\n\n // For certain cases we wish to render actions inline with text content\n const showActionsHorizontal = isFullWidth && isDesktop;\n\n const actionsHorizontal =\n showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const actionsVertical =\n !showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox marginTop=\"spacing.4\" flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const onClickDismiss = (): void => {\n if (onDismiss) {\n onDismiss();\n }\n setIsVisible(false);\n };\n const closeButton = isDismissible ? (\n <CloseButtonWrapper>\n <IconButton\n accessibilityLabel=\"Dismiss alert\"\n onClick={onClickDismiss}\n emphasis={emphasis === 'intense' ? 'subtle' : 'intense'}\n size=\"large\"\n icon={CloseIcon}\n />\n </CloseButtonWrapper>\n ) : null;\n\n const a11yProps = makeAccessible({\n // React Native doesn't has status as role\n role: isReactNative || color === 'negative' || color === 'notice' ? 'alert' : 'status',\n // override the implicit live region of role `alert`\n ...(color === 'notice' && { liveRegion: 'polite' }),\n });\n\n if (!isVisible) {\n return null;\n }\n\n return (\n <BaseBox\n ref={ref as never}\n {...a11yProps}\n {...metaAttribute({ name: MetaConstants.Alert, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <StyledAlert\n color={color}\n emphasis={emphasis}\n isFullWidth={isFullWidth}\n isDesktop={isDesktop}\n textAlign={'left' as never}\n >\n {leadingIcon}\n <BaseBox\n flex={1}\n paddingLeft={isFullWidth ? 'spacing.4' : 'spacing.3'}\n paddingRight={showActionsHorizontal ? 'spacing.4' : 'spacing.2'}\n >\n {_title}\n {_description}\n {actionsVertical}\n </BaseBox>\n {actionsHorizontal}\n {closeButton}\n </StyledAlert>\n </BaseBox>\n );\n};\n\nconst Alert = forwardRef(_Alert);\n\nexport type { AlertProps };\nexport { Alert };\n"],"names":["isReactNative","getPlatformType","CloseButtonWrapper","BaseBox","Fragment","intentIconMap","positive","CheckCircleIcon","negative","AlertOctagonIcon","information","InfoIcon","neutral","notice","AlertTriangleIcon","_Alert","_ref","ref","description","title","_ref$isDismissible","isDismissible","onDismiss","_ref$emphasis","emphasis","_ref$isFullWidth","isFullWidth","_ref$color","color","actions","testID","icon","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","_useState","useState","_useState2","_slicedToArray","isVisible","setIsVisible","isDesktop","isMobile","Icon","iconOffset","shouldCenterAlign","alignment","leadingIcon","_jsx","display","alignSelf","marginTop","children","size","textColor","_title","marginBottom","Text","weight","_description","primaryAction","primary","marginRight","castNativeType","castWebType","BaseButton","onClick","variant","text","secondaryActionParams","secondary","href","target","rel","secondaryAction","BaseLink","Object","assign","showActionsHorizontal","actionsHorizontal","_jsxs","flexDirection","alignItems","actionsVertical","onClickDismiss","closeButton","IconButton","accessibilityLabel","CloseIcon","a11yProps","makeAccessible","role","liveRegion","metaAttribute","name","MetaConstants","Alert","getStyledProps","makeAnalyticsAttribute","StyledAlert","textAlign","flex","paddingLeft","paddingRight","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,aAAA,CAAA,OAAA,CAAA,eAAA,CAAA,WAAA,CAAA,UAAA,CAAA,aAAA,CAAA,OAAA,CAAA,SAAA,CAAA,QAAA,CAAA,MAAA,CAAA,CAuHA,IAAMA,aAAa,CAAGC,eAAe,EAAE,GAAK,cAAc,CAG1D,IAAMC,kBAAkB,CAAGF,aAAa,CAAGG,OAAO,CAAGC,QAAQ,CAE7D,IAAMC,aAAa,CAAG,CACpBC,QAAQ,CAAEC,eAAe,CACzBC,QAAQ,CAAEC,gBAAgB,CAC1BC,WAAW,CAAEC,QAAQ,CACrBC,OAAO,CAAED,QAAQ,CACjBE,MAAM,CAAEC,iBACV,CAAC,CAED,IAAMC,MAAM,CAAG,SAATA,MAAMA,CAAAC,IAAA,CAcVC,GAA+B,CACP,CAAA,IAbtBC,WAAW,CAAAF,IAAA,CAAXE,WAAW,CACXC,KAAK,CAAAH,IAAA,CAALG,KAAK,CAAAC,kBAAA,CAAAJ,IAAA,CACLK,aAAa,CAAbA,aAAa,CAAAD,kBAAA,GAAG,KAAA,CAAA,CAAA,IAAI,CAAAA,kBAAA,CACpBE,SAAS,CAAAN,IAAA,CAATM,SAAS,CAAAC,aAAA,CAAAP,IAAA,CACTQ,QAAQ,CAARA,QAAQ,CAAAD,aAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,aAAA,CAAAE,gBAAA,CAAAT,IAAA,CACnBU,WAAW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AAW,CAAG,WAAY,CACrDoF,YAAY,CAAEzB,qBAAqB,CAAG,WAAW,CAAG,WAAY,CAAA1B,QAAA,CAAA,CAE/DG,MAAM,CACNI,YAAY,CACZwB,eAAe,CACT,CAAA,CAAC,CACTJ,iBAAiB,CACjBM,WAAW,CAAA,CACD,CAAC,CAAA,CACP,CAAC,CAEd,CAAC,CAEK,IAAAW,KAAK,CAAGQ,UAAU,CAAChG,MAAM;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import type { ReactChild, ReactElement } from 'react';\nimport React, { Fragment, useState, forwardRef } from 'react';\n\nimport { StyledAlert } from './StyledAlert';\nimport type { IconComponent } from '~components/Icons';\nimport {\n AlertOctagonIcon,\n AlertTriangleIcon,\n CheckCircleIcon,\n CloseIcon,\n InfoIcon,\n} from '~components/Icons';\nimport { castNativeType, castWebType, useBreakpoint, getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport BaseButton from '~components/Button/BaseButton';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport type { FeedbackColors, SubtleOrIntense } from '~tokens/theme/theme';\nimport { useTheme } from '~components/BladeProvider';\nimport type {\n DataAnalyticsAttribute,\n BladeElementRef,\n DotNotationSpacingStringToken,\n TestID,\n} from '~utils/types';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { MAKE_ANALYTICS_CONSTANTS, makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype PrimaryAction = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionButton = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionLinkButton = {\n text: string;\n href: string;\n onClick?: () => void;\n target?: string;\n /**\n * When `target` is set to `_blank` this is automatically set to `noopener noreferrer`\n */\n rel?: string;\n};\n\ntype SecondaryAction = SecondaryActionButton | SecondaryActionLinkButton;\n\ntype AlertProps = {\n /**\n * Body content, pass text or JSX. Avoid passing components except `Link` to customize the content.\n */\n description: ReactChild;\n\n /**\n * A brief heading\n */\n title?: string;\n\n /**\n * Shows a dismiss button\n *\n * @default true\n */\n isDismissible?: boolean;\n\n /**\n * A callback when the dismiss button is clicked\n */\n onDismiss?: () => void;\n\n /**\n * Can be used to render custom icon\n */\n icon?: IconComponent;\n\n /**\n * Can be set to `high` for a more prominent look. Not to be confused with a11y emphasis.\n *\n * @default subtle\n */\n emphasis?: SubtleOrIntense;\n\n /**\n * Makes the Alert span the entire container width, instead of the default max width of `584px`.\n * This also makes the alert borderless, useful for creating full bleed layouts.\n *\n * @default false\n */\n isFullWidth?: boolean;\n\n /**\n * Sets the color tone\n */\n color?: FeedbackColors;\n\n /**\n * Renders a primary action button and a secondary action link button\n */\n actions?: {\n /**\n * Renders a button (should **always** be present if `secondary` action is being used)\n */\n primary?: PrimaryAction;\n /**\n * Renders a Link button\n */\n secondary?: SecondaryAction;\n };\n} & TestID &\n StyledPropsBlade &\n DataAnalyticsAttribute;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n// Need extra wrappers on React Native only for alignment\nconst CloseButtonWrapper = isReactNative ? BaseBox : Fragment;\n\nconst intentIconMap = {\n positive: CheckCircleIcon,\n negative: AlertOctagonIcon,\n information: InfoIcon,\n neutral: InfoIcon,\n notice: AlertTriangleIcon,\n};\n\nconst _Alert = (\n {\n description,\n title,\n isDismissible = true,\n onDismiss,\n emphasis = 'subtle',\n isFullWidth = false,\n color = 'neutral',\n actions,\n testID,\n icon,\n ...rest\n }: AlertProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement | null => {\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const [isVisible, setIsVisible] = useState(true);\n\n const isDesktop = matchedDeviceType === 'desktop';\n const isMobile = !isDesktop;\n\n const Icon = icon ?? intentIconMap[color];\n let iconOffset: DotNotationSpacingStringToken = 'spacing.1';\n\n // certain special cases below needs special care for near perfect alignment\n if (isReactNative) {\n if (isFullWidth && !title) {\n iconOffset = 'spacing.1';\n } else if (!isFullWidth && !title) {\n iconOffset = 'spacing.0';\n } else if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n }\n } else if (isMobile) {\n if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n } else if (isFullWidth && !title) {\n iconOffset = 'spacing.2';\n }\n } else if (isFullWidth) {\n iconOffset = 'spacing.1';\n }\n\n const shouldCenterAlign = isFullWidth && !title;\n let alignment: 'center' | 'flex-start' = 'flex-start';\n if (!isFullWidth) alignment = 'flex-start';\n if (shouldCenterAlign) alignment = 'center';\n\n const leadingIcon = (\n <BaseBox display=\"flex\" alignSelf={alignment} marginTop={iconOffset}>\n <Icon\n color={\n emphasis === 'intense'\n ? 'surface.icon.staticWhite.normal'\n : `feedback.icon.${color}.${emphasis === 'subtle' ? 'intense' : 'subtle'}`\n }\n size=\"medium\"\n />\n </BaseBox>\n );\n\n const textColor =\n emphasis === 'intense' ? 'surface.text.staticWhite.normal' : 'surface.text.gray.subtle';\n const _title = title ? (\n <BaseBox marginBottom=\"spacing.2\">\n <Text color={textColor} size=\"medium\" weight=\"semibold\">\n {title}\n </Text>\n </BaseBox>\n ) : null;\n\n const _description = (\n <BaseBox marginTop={title || isReactNative ? 'spacing.0' : 'spacing.1'}>\n <Text color={textColor} size=\"small\">\n {description}\n </Text>\n </BaseBox>\n );\n\n const primaryAction = actions?.primary ? (\n <BaseBox\n marginRight=\"spacing.5\"\n display={isReactNative ? castNativeType('flex') : castWebType('inline-flex')}\n >\n <BaseButton\n size=\"small\"\n onClick={actions.primary.onClick}\n color={emphasis === 'intense' ? 'white' : color}\n variant=\"secondary\"\n data-analytics-name={MAKE_ANALYTICS_CONSTANTS.ALERT.PRIMARY_ACTION_BUTTON}\n >\n {actions.primary.text}\n </BaseButton>\n </BaseBox>\n ) : null;\n\n const secondaryActionParams: Partial<SecondaryActionLinkButton> | null = actions?.secondary\n ? {\n onClick: actions.secondary.onClick,\n }\n : null;\n\n /**\n * TS assumes only common properties to be present for `SecondaryAction` union type\n * We add a type guard that checks if href is present on secondary action:\n * - If yes, then TS can assume it to be `SecondaryActionLinkButton` (href being a required property)\n * - If no, then it would be `SecondaryActionButton` (and link properties wouldn't be needed)\n */\n if (actions?.secondary && secondaryActionParams && 'href' in actions.secondary) {\n secondaryActionParams.href = actions.secondary.href;\n secondaryActionParams.target = actions.secondary.target;\n secondaryActionParams.rel = actions.secondary.rel;\n }\n\n const secondaryAction = actions?.secondary ? (\n <BaseBox marginRight=\"spacing.4\" display={(isReactNative ? 'flex' : 'inline-flex') as never}>\n <BaseLink\n size=\"small\"\n color={emphasis === 'intense' ? 'white' : color}\n {...secondaryActionParams}\n >\n {actions.secondary.text}\n </BaseLink>\n </BaseBox>\n ) : null;\n\n // For certain cases we wish to render actions inline with text content\n const showActionsHorizontal = isFullWidth && isDesktop;\n\n const actionsHorizontal =\n showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const actionsVertical =\n !showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox marginTop=\"spacing.4\" flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const onClickDismiss = (): void => {\n if (onDismiss) {\n onDismiss();\n }\n setIsVisible(false);\n };\n const closeButton = isDismissible ? (\n <CloseButtonWrapper>\n <IconButton\n accessibilityLabel=\"Dismiss alert\"\n onClick={onClickDismiss}\n emphasis={emphasis === 'intense' ? 'subtle' : 'intense'}\n size=\"large\"\n icon={CloseIcon}\n />\n </CloseButtonWrapper>\n ) : null;\n\n const a11yProps = makeAccessible({\n // React Native doesn't has status as role\n role: isReactNative || color === 'negative' || color === 'notice' ? 'alert' : 'status',\n // override the implicit live region of role `alert`\n ...(color === 'notice' && { liveRegion: 'polite' }),\n });\n\n if (!isVisible) {\n return null;\n }\n\n return (\n <BaseBox\n ref={ref as never}\n {...a11yProps}\n {...metaAttribute({ name: MetaConstants.Alert, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <StyledAlert\n color={color}\n emphasis={emphasis}\n isFullWidth={isFullWidth}\n isDesktop={isDesktop}\n textAlign={'left' as never}\n >\n {leadingIcon}\n <BaseBox\n flex={1}\n paddingLeft={isFullWidth ? 'spacing.4' : 'spacing.3'}\n paddingRight={showActionsHorizontal ? 'spacing.4' : 'spacing.2'}\n >\n {_title}\n {_description}\n {actionsVertical}\n </BaseBox>\n {actionsHorizontal}\n {closeButton}\n </StyledAlert>\n </BaseBox>\n );\n};\n\nconst Alert = forwardRef(_Alert);\n\nexport type { AlertProps };\nexport { Alert };\n"],"names":["isReactNative","getPlatformType","CloseButtonWrapper","BaseBox","Fragment","intentIconMap","positive","CheckCircleIcon","negative","AlertOctagonIcon","information","InfoIcon","neutral","notice","AlertTriangleIcon","_Alert","_ref","ref","description","title","_ref$isDismissible","isDismissible","onDismiss","_ref$emphasis","emphasis","_ref$isFullWidth","isFullWidth","_ref$color","color","actions","testID","icon","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","_useState","useState","_useState2","_slicedToArray","isVisible","setIsVisible","isDesktop","isMobile","Icon","iconOffset","shouldCenterAlign","alignment","leadingIcon","_jsx","display","alignSelf","marginTop","children","size","textColor","_title","marginBottom","Text","weight","_description","primaryAction","primary","marginRight","castNativeType","castWebType","BaseButton","onClick","variant","MAKE_ANALYTICS_CONSTANTS","ALERT","PRIMARY_ACTION_BUTTON","text","secondaryActionParams","secondary","href","target","rel","secondaryAction","BaseLink","Object","assign","showActionsHorizontal","actionsHorizontal","_jsxs","flexDirection","alignItems","actionsVertical","onClickDismiss","closeButton","IconButton","accessibilityLabel","CloseIcon","a11yProps","makeAccessible","role","liveRegion","metaAttribute","name","MetaConstants","Alert","getStyledProps","makeAnalyticsAttribute","StyledAlert","textAlign","flex","paddingLeft","paddingRight","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,aAAA,CAAA,OAAA,CAAA,eAAA,CAAA,WAAA,CAAA,UAAA,CAAA,aAAA,CAAA,OAAA,CAAA,SAAA,CAAA,QAAA,CAAA,MAAA,CAAA,CAuHA,IAAMA,aAAa,CAAGC,eAAe,EAAE,GAAK,cAAc,CAG1D,IAAMC,kBAAkB,CAAGF,aAAa,CAAGG,OAAO,CAAGC,QAAQ,CAE7D,IAAMC,aAAa,CAAG,CACpBC,QAAQ,CAAEC,eAAe,CACzBC,QAAQ,CAAEC,gBAAgB,CAC1BC,WAAW,CAAEC,QAAQ,CACrBC,OAAO,CAAED,QAAQ,CACjBE,MAAM,CAAEC,iBACV,CAAC,CAED,IAAMC,MAAM,CAAG,SAATA,MAAMA,CAAAC,IAAA,CAcVC,GAA+B,CACP,KAbtBC,WAAW,CAAAF,IAAA,CAAXE,WAAW,CACXC,KAAK,CAAAH,IAAA,CAALG,KAAK,CAAAC,kBAAA,CAAAJ,IAAA,CACLK,aAAa,CAAbA,aAAa,CAAAD,kBAAA,GAAA,KAAA,CAAA,CAAG,IAAI,CAAAA,kBAAA,CACpBE,SAAS,CAAAN,IAAA,CAATM,SAAS,CAAAC,aAAA,CAAAP,IAAA,CACTQ,QAAQ,CAARA,QAAQ,CAAAD,aAAA,GAAA,KAAA,CAAA,CAAG,QAAQ,CAAAA,aAAA,CAAAE,gBAAA,CAAAT,IAAA,CACnBU,WAAW,CAAXA,WAAW,CAAAD,gBAAA,GAAA,KAAA,CAAA,CAAG,KAAK,CAAAA,gBAAA,CAAAE,UAAA,CAAAX,IAAA,CACnBY,KAAK,CAALA,KAAK,CAA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,YAAY,CACZ2B,eAAe,CACT,CAAA,CAAC,CACTJ,iBAAiB,CACjBM,WAAW,CAAA,CACD,CAAC,CAAA,CACP,CAAC,CAEd,CAAC,CAEK,IAAAW,KAAK,CAAGQ,UAAU,CAACnG,MAAM;;;;"}
@@ -23,7 +23,7 @@ import { useCheckboxGroupContext } from '../Checkbox/CheckboxGroup/CheckboxGroup
23
23
  import { useRadioGroupContext } from '../Radio/RadioGroup/RadioContext.js';
24
24
  import { jsx, jsxs } from 'react/jsx-runtime';
25
25
 
26
- var _excluded=["children","backgroundColor","borderRadius","elevation","testID","padding","width","height","minHeight","minWidth","maxWidth","onClick","isSelected","accessibilityLabel","shouldScaleOnHover","onHover","href","target","rel","as"],_excluded2=["height","children","testID"];var ComponentIds={CardHeader:'CardHeader',CardHeaderTrailing:'CardHeaderTrailing',CardHeaderLeading:'CardHeaderLeading',CardFooter:'CardFooter',CardFooterTrailing:'CardFooterTrailing',CardFooterLeading:'CardFooterLeading',CardBody:'CardBody',CardHeaderIcon:'CardHeaderIcon',CardHeaderCounter:'CardHeaderCounter',CardHeaderBadge:'CardHeaderBadge',CardHeaderAmount:'CardHeaderAmount',CardHeaderText:'CardHeaderText',CardHeaderLink:'CardHeaderLink',CardHeaderIconButton:'CardHeaderIconButton'};var _Card=function _Card(_ref,ref){var children=_ref.children,_ref$backgroundColor=_ref.backgroundColor,backgroundColor=_ref$backgroundColor===void 0?'surface.background.gray.intense':_ref$backgroundColor,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?'medium':_ref$borderRadius,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?'lowRaised':_ref$elevation,testID=_ref.testID,_ref$padding=_ref.padding,padding=_ref$padding===void 0?'spacing.7':_ref$padding,width=_ref.width,height=_ref.height,minHeight=_ref.minHeight,minWidth=_ref.minWidth,maxWidth=_ref.maxWidth,onClick=_ref.onClick,_ref$isSelected=_ref.isSelected,isSelected=_ref$isSelected===void 0?false:_ref$isSelected,accessibilityLabel=_ref.accessibilityLabel,_ref$shouldScaleOnHov=_ref.shouldScaleOnHover,shouldScaleOnHover=_ref$shouldScaleOnHov===void 0?false:_ref$shouldScaleOnHov,onHover=_ref.onHover,href=_ref.href,target=_ref.target,rel=_ref.rel,as=_ref.as,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isFocused=_React$useState2[0],setIsFocused=_React$useState2[1];useVerifyAllowedChildren({children:children,componentName:'Card',allowedComponents:[ComponentIds.CardHeader,ComponentIds.CardBody,ComponentIds.CardFooter]});var linkOverlayProps=Object.assign({},metaAttribute({name:CARD_LINK_OVERLAY_ID}),makeAccessible({label:accessibilityLabel,pressed:href?undefined:isSelected}),{onFocus:function onFocus(){setIsFocused(true);},onBlur:function onBlur(){setIsFocused(false);}});var defaultRel=target&&target==='_blank'?'noreferrer noopener':undefined;var checkboxGroupProps=useCheckboxGroupContext();var radioGroupProps=useRadioGroupContext();var getGroupProps=function getGroupProps(){if(Object.keys(checkboxGroupProps).length>0)return checkboxGroupProps;if(Object.keys(radioGroupProps).length>0)return radioGroupProps;return undefined;};var groupProps=getGroupProps();var _validationState=groupProps==null?void 0:groupProps.validationState;return jsx(CardProvider,{children:jsx(CardRoot,Object.assign({as:as,ref:ref,display:'block',borderRadius:borderRadius,onMouseEnter:onHover,shouldScaleOnHover:shouldScaleOnHover,isSelected:isSelected,isFocused:isFocused,onClick:isReactNative()?onClick:undefined,width:width,height:height,minHeight:minHeight,minWidth:minWidth,maxWidth:maxWidth,href:href,accessibilityLabel:accessibilityLabel,validationState:_validationState},metaAttribute({name:MetaConstants.Card,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsxs(CardSurface,{height:height,minHeight:minHeight,padding:padding,borderRadius:borderRadius,elevation:elevation,textAlign:'left',backgroundColor:backgroundColor,children:[href?jsx(LinkOverlay,Object.assign({onClick:onClick,href:href,target:target,rel:rel!=null?rel:defaultRel},linkOverlayProps)):null,!href&&onClick?jsx(LinkOverlay,Object.assign({as:"button",onClick:onClick},linkOverlayProps)):null,children]})}))});};var _CardBody=function _CardBody(_ref2){var height=_ref2.height,children=_ref2.children,testID=_ref2.testID,rest=_objectWithoutProperties(_ref2,_excluded2);useVerifyInsideCard('CardBody');return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.CardBody,testID:testID}),makeAnalyticsAttribute(rest),{height:height,children:children}));};var Card=React__default.forwardRef(_Card);var CardBody=assignWithoutSideEffects(_CardBody,{componentId:ComponentIds.CardBody});
26
+ var _excluded=["children","backgroundColor","borderRadius","elevation","testID","padding","width","height","minHeight","minWidth","maxWidth","onClick","isSelected","accessibilityLabel","shouldScaleOnHover","onHover","href","target","rel","as","size"],_excluded2=["height","children","testID"];var ComponentIds={CardHeader:'CardHeader',CardHeaderTrailing:'CardHeaderTrailing',CardHeaderLeading:'CardHeaderLeading',CardFooter:'CardFooter',CardFooterTrailing:'CardFooterTrailing',CardFooterLeading:'CardFooterLeading',CardBody:'CardBody',CardHeaderIcon:'CardHeaderIcon',CardHeaderCounter:'CardHeaderCounter',CardHeaderBadge:'CardHeaderBadge',CardHeaderAmount:'CardHeaderAmount',CardHeaderText:'CardHeaderText',CardHeaderLink:'CardHeaderLink',CardHeaderIconButton:'CardHeaderIconButton'};var _Card=function _Card(_ref,ref){var children=_ref.children,_ref$backgroundColor=_ref.backgroundColor,backgroundColor=_ref$backgroundColor===void 0?'surface.background.gray.intense':_ref$backgroundColor,_ref$borderRadius=_ref.borderRadius,borderRadius=_ref$borderRadius===void 0?'medium':_ref$borderRadius,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?'lowRaised':_ref$elevation,testID=_ref.testID,_ref$padding=_ref.padding,padding=_ref$padding===void 0?'spacing.7':_ref$padding,width=_ref.width,height=_ref.height,minHeight=_ref.minHeight,minWidth=_ref.minWidth,maxWidth=_ref.maxWidth,onClick=_ref.onClick,_ref$isSelected=_ref.isSelected,isSelected=_ref$isSelected===void 0?false:_ref$isSelected,accessibilityLabel=_ref.accessibilityLabel,_ref$shouldScaleOnHov=_ref.shouldScaleOnHover,shouldScaleOnHover=_ref$shouldScaleOnHov===void 0?false:_ref$shouldScaleOnHov,onHover=_ref.onHover,href=_ref.href,target=_ref.target,rel=_ref.rel,as=_ref.as,_ref$size=_ref.size,size=_ref$size===void 0?'large':_ref$size,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isFocused=_React$useState2[0],setIsFocused=_React$useState2[1];useVerifyAllowedChildren({children:children,componentName:'Card',allowedComponents:[ComponentIds.CardHeader,ComponentIds.CardBody,ComponentIds.CardFooter]});var linkOverlayProps=Object.assign({},metaAttribute({name:CARD_LINK_OVERLAY_ID}),makeAccessible({label:accessibilityLabel,pressed:href?undefined:isSelected}),{onFocus:function onFocus(){setIsFocused(true);},onBlur:function onBlur(){setIsFocused(false);}});var defaultRel=target&&target==='_blank'?'noreferrer noopener':undefined;var checkboxGroupProps=useCheckboxGroupContext();var radioGroupProps=useRadioGroupContext();var getGroupProps=function getGroupProps(){if(Object.keys(checkboxGroupProps).length>0)return checkboxGroupProps;if(Object.keys(radioGroupProps).length>0)return radioGroupProps;return undefined;};var groupProps=getGroupProps();var _validationState=groupProps==null?void 0:groupProps.validationState;return jsx(CardProvider,{size:size,children:jsx(CardRoot,Object.assign({as:as,ref:ref,display:'block',borderRadius:borderRadius,onMouseEnter:onHover,shouldScaleOnHover:shouldScaleOnHover,isSelected:isSelected,isFocused:isFocused,onClick:isReactNative()?onClick:undefined,width:width,height:height,minHeight:minHeight,minWidth:minWidth,maxWidth:maxWidth,href:href,accessibilityLabel:accessibilityLabel,validationState:_validationState},metaAttribute({name:MetaConstants.Card,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsxs(CardSurface,{height:height,minHeight:minHeight,padding:padding,borderRadius:borderRadius,elevation:elevation,textAlign:'left',backgroundColor:backgroundColor,children:[href?jsx(LinkOverlay,Object.assign({onClick:onClick,href:href,target:target,rel:rel!=null?rel:defaultRel},linkOverlayProps)):null,!href&&onClick?jsx(LinkOverlay,Object.assign({as:"button",onClick:onClick},linkOverlayProps)):null,children]})}))});};var _CardBody=function _CardBody(_ref2){var height=_ref2.height,children=_ref2.children,testID=_ref2.testID,rest=_objectWithoutProperties(_ref2,_excluded2);useVerifyInsideCard('CardBody');return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.CardBody,testID:testID}),makeAnalyticsAttribute(rest),{height:height,children:children}));};var Card=React__default.forwardRef(_Card);var CardBody=assignWithoutSideEffects(_CardBody,{componentId:ComponentIds.CardBody});
27
27
 
28
28
  export { Card, CardBody, ComponentIds };
29
29
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { CardSurface } from './CardSurface';\nimport { CardProvider, useVerifyInsideCard } from './CardContext';\nimport { LinkOverlay } from './LinkOverlay';\nimport { CardRoot } from './CardRoot';\nimport type { CardSpacingValueType, LinkOverlayProps } from './types';\nimport { CARD_LINK_OVERLAY_ID } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { Elevation } from '~tokens/global';\nimport type { BoxProps } from '~components/Box';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useCheckboxGroupContext } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport { useRadioGroupContext } from '~components/Radio/RadioGroup/RadioContext';\nimport type { CheckboxGroupContextType } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport type { RadioGroupContextType } from '~components/Radio/RadioGroup/RadioContext';\n\nexport const ComponentIds = {\n CardHeader: 'CardHeader',\n CardHeaderTrailing: 'CardHeaderTrailing',\n CardHeaderLeading: 'CardHeaderLeading',\n CardFooter: 'CardFooter',\n CardFooterTrailing: 'CardFooterTrailing',\n CardFooterLeading: 'CardFooterLeading',\n CardBody: 'CardBody',\n CardHeaderIcon: 'CardHeaderIcon',\n CardHeaderCounter: 'CardHeaderCounter',\n CardHeaderBadge: 'CardHeaderBadge',\n CardHeaderAmount: 'CardHeaderAmount',\n CardHeaderText: 'CardHeaderText',\n CardHeaderLink: 'CardHeaderLink',\n CardHeaderIconButton: 'CardHeaderIconButton',\n};\n\ntype CardSurfaceBackgroundColors = `surface.background.gray.${DotNotationToken<\n Theme['colors']['surface']['background']['gray']\n>}`;\n\nexport type CardProps = {\n /**\n * Card contents\n */\n children: React.ReactNode;\n /**\n * Sets the background color of the Card\n *\n * @default `surface.background.gray.intense`\n */\n backgroundColor?: CardSurfaceBackgroundColors;\n /**\n * Sets the border radius of the Card\n *\n * @default `medium`\n */\n borderRadius?: Extract<BoxProps['borderRadius'], 'medium' | 'large' | 'xlarge'>;\n /**\n * Sets the elevation for Cards\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n */\n elevation?: keyof Elevation;\n /**\n * Sets the padding equally on all sides. Only few `spacing` tokens are allowed deliberately\n * @default `spacing.7`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-spacing--docs\n */\n padding?: CardSpacingValueType;\n /**\n * Sets the width of the card\n */\n width?: BoxProps['width'];\n /**\n * Sets the height of the card\n */\n height?: BoxProps['height'];\n /**\n * Sets minimum height of the card\n */\n minHeight?: BoxProps['minHeight'];\n /**\n * Sets minimum width of the card\n */\n minWidth?: BoxProps['minWidth'];\n /**\n * Sets maximum width of the card\n */\n maxWidth?: BoxProps['maxWidth'];\n /**\n * If `true`, the card will be in selected state\n * Card will have a primary color border around it.\n *\n * @default false\n */\n isSelected?: boolean;\n /**\n * Makes the Card linkable by setting the `href` prop\n *\n * @default undefined\n */\n href?: string;\n /**\n * Sets the `target` attribute for the linkable card\n */\n target?: string;\n /**\n * Sets the `rel` attribute for the linkable card\n */\n rel?: string;\n /**\n * Sets the accessibility label for the card\n * This is useful when the card has an `href` or `onClick` prop\n * Setting this will announce the label when the card is focused\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the card will scale up on hover\n *\n * On mobile devices it will scale down on press\n *\n * **This prop is deprecated in favour of motion presets released in v12**\n *\n * ### Migration\n *\n * ```diff\n * - <Card\n * - shouldScaleOnHover\n * - />\n *\n * + <Scale motionTriggers={['hover']}>\n * + <Card />\n * + </Scale>\n * ```\n *\n * @default false\n *\n * @deprecated This prop is deprecated in favour of motion presets released in v12\n */\n shouldScaleOnHover?: boolean;\n /**\n * Callback triggered when the card is hovered\n */\n onHover?: () => void;\n /**\n * Callback triggered when the card is clicked\n */\n onClick?: (\n event: Platform.Select<{\n web: React.MouseEvent;\n native: GestureResponderEvent;\n }>,\n ) => void;\n /**\n * Sets the HTML element for the Card\n *\n * When `as` is set to `label`, the card will be rendered as a label element\n * This can be used to create a custom checkbox or radio button using the card\n *\n * @default undefined\n */\n as?: 'label';\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _Card: React.ForwardRefRenderFunction<BladeElementRef, CardProps> = (\n {\n children,\n backgroundColor = 'surface.background.gray.intense',\n borderRadius = 'medium',\n elevation = 'lowRaised',\n testID,\n padding = 'spacing.7',\n width,\n height,\n minHeight,\n minWidth,\n maxWidth,\n onClick,\n isSelected = false,\n accessibilityLabel,\n shouldScaleOnHover = false,\n onHover,\n href,\n target,\n rel,\n as,\n ...rest\n },\n ref,\n): React.ReactElement => {\n const [isFocused, setIsFocused] = React.useState(false);\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Card',\n allowedComponents: [ComponentIds.CardHeader, ComponentIds.CardBody, ComponentIds.CardFooter],\n });\n\n const linkOverlayProps: LinkOverlayProps = {\n ...metaAttribute({ name: CARD_LINK_OVERLAY_ID }),\n ...makeAccessible({ label: accessibilityLabel, pressed: href ? undefined : isSelected }),\n onFocus: () => {\n setIsFocused(true);\n },\n onBlur: () => {\n setIsFocused(false);\n },\n };\n const defaultRel = target && target === '_blank' ? 'noreferrer noopener' : undefined;\n\n const checkboxGroupProps = useCheckboxGroupContext();\n const radioGroupProps = useRadioGroupContext();\n\n const getGroupProps = (): CheckboxGroupContextType | RadioGroupContextType | undefined => {\n if (Object.keys(checkboxGroupProps).length > 0) return checkboxGroupProps;\n if (Object.keys(radioGroupProps).length > 0) return radioGroupProps;\n return undefined;\n };\n\n const groupProps = getGroupProps();\n\n const _validationState = groupProps?.validationState;\n\n return (\n <CardProvider>\n <CardRoot\n as={as}\n ref={ref as never}\n display={'block' as never}\n borderRadius={borderRadius}\n onMouseEnter={onHover as never}\n shouldScaleOnHover={shouldScaleOnHover}\n isSelected={isSelected}\n isFocused={isFocused}\n // on react native we need to pass onClick to root, because we don't need the LinkOverlay in RN\n onClick={isReactNative() ? onClick : undefined}\n width={width}\n height={height}\n minHeight={minHeight}\n minWidth={minWidth}\n maxWidth={maxWidth}\n href={href}\n accessibilityLabel={accessibilityLabel}\n validationState={_validationState}\n {...metaAttribute({ name: MetaConstants.Card, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <CardSurface\n height={height}\n minHeight={minHeight}\n padding={padding}\n borderRadius={borderRadius}\n elevation={elevation}\n textAlign={'left' as never}\n backgroundColor={backgroundColor}\n >\n {href ? (\n <LinkOverlay\n onClick={onClick}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n {...linkOverlayProps}\n />\n ) : null}\n {!href && onClick ? (\n <LinkOverlay as=\"button\" onClick={onClick} {...linkOverlayProps} />\n ) : null}\n {children}\n </CardSurface>\n </CardRoot>\n </CardProvider>\n );\n};\n\ntype CardBodyProps = {\n children: React.ReactNode;\n height?: BoxProps['height'];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardBody = ({ height, children, testID, ...rest }: CardBodyProps): React.ReactElement => {\n useVerifyInsideCard('CardBody');\n\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.CardBody, testID })}\n {...makeAnalyticsAttribute(rest)}\n height={height}\n >\n {children}\n </BaseBox>\n );\n};\n\nconst Card = React.forwardRef(_Card);\nconst CardBody = assignWithoutSideEffects(_CardBody, { componentId: ComponentIds.CardBody });\n\nexport { Card, CardBody };\n"],"names":["ComponentIds","CardHeader","CardHeaderTrailing","CardHeaderLeading","CardFooter","CardFooterTrailing","CardFooterLeading","CardBody","CardHeaderIcon","CardHeaderCounter","CardHeaderBadge","CardHeaderAmount","CardHeaderText","CardHeaderLink","CardHeaderIconButton","_Card","_ref","ref","children","_ref$backgroundColor","backgroundColor","_ref$borderRadius","borderRadius","_ref$elevation","elevation","testID","_ref$padding","padding","width","height","minHeight","minWidth","maxWidth","onClick","_ref$isSelected","isSelected","accessibilityLabel","_ref$shouldScaleOnHov","shouldScaleOnHover","onHover","href","target","rel","as","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isFocused","setIsFocused","useVerifyAllowedChildren","componentName","allowedComponents","linkOverlayProps","Object","assign","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","undefined","onFocus","onBlur","defaultRel","checkboxGroupProps","useCheckboxGroupContext","radioGroupProps","useRadioGroupContext","getGroupProps","keys","length","groupProps","_validationState","validationState","_jsx","CardProvider","CardRoot","display","onMouseEnter","isReactNative","MetaConstants","Card","getStyledProps","makeAnalyticsAttribute","_jsxs","CardSurface","textAlign","LinkOverlay","_CardBody","_ref2","_excluded2","useVerifyInsideCard","BaseBox","forwardRef","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;8RA4Ba,IAAAA,YAAY,CAAG,CAC1BC,UAAU,CAAE,YAAY,CACxBC,kBAAkB,CAAE,oBAAoB,CACxCC,iBAAiB,CAAE,mBAAmB,CACtCC,UAAU,CAAE,YAAY,CACxBC,kBAAkB,CAAE,oBAAoB,CACxCC,iBAAiB,CAAE,mBAAmB,CACtCC,QAAQ,CAAE,UAAU,CACpBC,cAAc,CAAE,gBAAgB,CAChCC,iBAAiB,CAAE,mBAAmB,CACtCC,eAAe,CAAE,iBAAiB,CAClCC,gBAAgB,CAAE,kBAAkB,CACpCC,cAAc,CAAE,gBAAgB,CAChCC,cAAc,CAAE,gBAAgB,CAChCC,oBAAoB,CAAE,sBACxB,EA2IA,IAAMC,KAAiE,CAAG,SAApEA,KAAiEA,CAAAC,IAAA,CAwBrEC,GAAG,CACoB,KAvBrBC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAAAC,oBAAA,CAAAH,IAAA,CACRI,eAAe,CAAfA,eAAe,CAAAD,oBAAA,GAAG,KAAA,CAAA,CAAA,iCAAiC,CAAAA,oBAAA,CAAAE,iBAAA,CAAAL,IAAA,CACnDM,YAAY,CAAZA,YAAY,CAAAD,iBAAA,GAAA,KAAA,CAAA,CAAG,QAAQ,CAAAA,iBAAA,CAAAE,cAAA,CAAAP,IAAA,CACvBQ,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,WAAW,CAAAA,cAAA,CACvBE,MAAM,CAAAT,IAAA,CAANS,MAAM,CAAAC,YAAA,CAAAV,IAAA,CACNW,OAAO,CAAPA,OAAO,CAAAD,YAAA,GAAG,KAAA,CAAA,CAAA,WAAW,CAAAA,YAAA,CACrBE,KAAK,CAA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,IAAI,CACPvC,QAAQ,CACE,CAAA,CAAC,CACN,CAAA,CAAC,CACC,CAAC,CAEnB,CAAC,CAQD,IAAM4E,SAAS,CAAG,SAAZA,SAASA,CAAAC,KAAA,CAAiF,CAA3E,IAAAlE,MAAM,CAAAkE,KAAA,CAANlE,MAAM,CAAEX,QAAQ,CAAA6E,KAAA,CAAR7E,QAAQ,CAAEO,MAAM,CAAAsE,KAAA,CAANtE,MAAM,CAAKmB,IAAI,CAAAC,wBAAA,CAAAkD,KAAA,CAAAC,UAAA,CACpDC,CAAAA,mBAAmB,CAAC,UAAU,CAAC,CAE/B,OACEjB,GAAA,CAACkB,OAAO,CAAAxC,MAAA,CAAAC,MAAA,CACFC,EAAAA,CAAAA,aAAa,CAAC,CAAEC,IAAI,CAAEyB,aAAa,CAAC/E,QAAQ,CAAEkB,MAAM,CAANA,MAAO,CAAC,CAAC,CACvDgE,sBAAsB,CAAC7C,IAAI,CAAC,CAChCf,CAAAA,MAAM,CAAEA,MAAO,CAAAX,QAAA,CAEdA,QAAQ,CAAA,CACF,CAAC,CAEd,CAAC,CAEK,IAAAqE,IAAI,CAAGvC,cAAK,CAACmD,UAAU,CAACpF,KAAK,EAC7B,IAAAR,QAAQ,CAAG6F,wBAAwB,CAACN,SAAS,CAAE,CAAEO,WAAW,CAAErG,YAAY,CAACO,QAAS,CAAC;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { CardSurface } from './CardSurface';\nimport { CardProvider, useVerifyInsideCard } from './CardContext';\nimport { LinkOverlay } from './LinkOverlay';\nimport { CardRoot } from './CardRoot';\nimport type { CardSpacingValueType, LinkOverlayProps } from './types';\nimport { CARD_LINK_OVERLAY_ID } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { Elevation } from '~tokens/global';\nimport type { BoxProps } from '~components/Box';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useCheckboxGroupContext } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport { useRadioGroupContext } from '~components/Radio/RadioGroup/RadioContext';\nimport type { CheckboxGroupContextType } from '~components/Checkbox/CheckboxGroup/CheckboxGroupContext';\nimport type { RadioGroupContextType } from '~components/Radio/RadioGroup/RadioContext';\n\nexport const ComponentIds = {\n CardHeader: 'CardHeader',\n CardHeaderTrailing: 'CardHeaderTrailing',\n CardHeaderLeading: 'CardHeaderLeading',\n CardFooter: 'CardFooter',\n CardFooterTrailing: 'CardFooterTrailing',\n CardFooterLeading: 'CardFooterLeading',\n CardBody: 'CardBody',\n CardHeaderIcon: 'CardHeaderIcon',\n CardHeaderCounter: 'CardHeaderCounter',\n CardHeaderBadge: 'CardHeaderBadge',\n CardHeaderAmount: 'CardHeaderAmount',\n CardHeaderText: 'CardHeaderText',\n CardHeaderLink: 'CardHeaderLink',\n CardHeaderIconButton: 'CardHeaderIconButton',\n};\n\ntype CardSurfaceBackgroundColors = `surface.background.gray.${DotNotationToken<\n Theme['colors']['surface']['background']['gray']\n>}`;\n\nexport type CardProps = {\n /**\n * Card contents\n */\n children: React.ReactNode;\n /**\n * Sets the background color of the Card\n *\n * @default `surface.background.gray.intense`\n */\n backgroundColor?: CardSurfaceBackgroundColors;\n /**\n * Sets the border radius of the Card\n *\n * @default `medium`\n */\n borderRadius?: Extract<BoxProps['borderRadius'], 'medium' | 'large' | 'xlarge'>;\n /**\n * Sets the elevation for Cards\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n */\n elevation?: keyof Elevation;\n /**\n * Sets the padding equally on all sides. Only few `spacing` tokens are allowed deliberately\n * @default `spacing.7`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-spacing--docs\n */\n padding?: CardSpacingValueType;\n /**\n * Sets the width of the card\n */\n width?: BoxProps['width'];\n /**\n * Sets the height of the card\n */\n height?: BoxProps['height'];\n /**\n * Sets minimum height of the card\n */\n minHeight?: BoxProps['minHeight'];\n /**\n * Sets minimum width of the card\n */\n minWidth?: BoxProps['minWidth'];\n /**\n * Sets maximum width of the card\n */\n maxWidth?: BoxProps['maxWidth'];\n /**\n * If `true`, the card will be in selected state\n * Card will have a primary color border around it.\n *\n * @default false\n */\n isSelected?: boolean;\n /**\n * Makes the Card linkable by setting the `href` prop\n *\n * @default undefined\n */\n href?: string;\n /**\n * Sets the `target` attribute for the linkable card\n */\n target?: string;\n /**\n * Sets the `rel` attribute for the linkable card\n */\n rel?: string;\n /**\n * Sets the accessibility label for the card\n * This is useful when the card has an `href` or `onClick` prop\n * Setting this will announce the label when the card is focused\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the card will scale up on hover\n *\n * On mobile devices it will scale down on press\n *\n * **This prop is deprecated in favour of motion presets released in v12**\n *\n * ### Migration\n *\n * ```diff\n * - <Card\n * - shouldScaleOnHover\n * - />\n *\n * + <Scale motionTriggers={['hover']}>\n * + <Card />\n * + </Scale>\n * ```\n *\n * @default false\n *\n * @deprecated This prop is deprecated in favour of motion presets released in v12\n */\n shouldScaleOnHover?: boolean;\n /**\n * Callback triggered when the card is hovered\n */\n onHover?: () => void;\n /**\n * Sets the size of the card header title\n *\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /**\n * Callback triggered when the card is clicked\n */\n onClick?: (\n event: Platform.Select<{\n web: React.MouseEvent;\n native: GestureResponderEvent;\n }>,\n ) => void;\n /**\n * Sets the HTML element for the Card\n *\n * When `as` is set to `label`, the card will be rendered as a label element\n * This can be used to create a custom checkbox or radio button using the card\n *\n * @default undefined\n */\n as?: 'label';\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _Card: React.ForwardRefRenderFunction<BladeElementRef, CardProps> = (\n {\n children,\n backgroundColor = 'surface.background.gray.intense',\n borderRadius = 'medium',\n elevation = 'lowRaised',\n testID,\n padding = 'spacing.7',\n width,\n height,\n minHeight,\n minWidth,\n maxWidth,\n onClick,\n isSelected = false,\n accessibilityLabel,\n shouldScaleOnHover = false,\n onHover,\n href,\n target,\n rel,\n as,\n size = 'large',\n ...rest\n },\n ref,\n): React.ReactElement => {\n const [isFocused, setIsFocused] = React.useState(false);\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Card',\n allowedComponents: [ComponentIds.CardHeader, ComponentIds.CardBody, ComponentIds.CardFooter],\n });\n\n const linkOverlayProps: LinkOverlayProps = {\n ...metaAttribute({ name: CARD_LINK_OVERLAY_ID }),\n ...makeAccessible({ label: accessibilityLabel, pressed: href ? undefined : isSelected }),\n onFocus: () => {\n setIsFocused(true);\n },\n onBlur: () => {\n setIsFocused(false);\n },\n };\n const defaultRel = target && target === '_blank' ? 'noreferrer noopener' : undefined;\n\n const checkboxGroupProps = useCheckboxGroupContext();\n const radioGroupProps = useRadioGroupContext();\n\n const getGroupProps = (): CheckboxGroupContextType | RadioGroupContextType | undefined => {\n if (Object.keys(checkboxGroupProps).length > 0) return checkboxGroupProps;\n if (Object.keys(radioGroupProps).length > 0) return radioGroupProps;\n return undefined;\n };\n\n const groupProps = getGroupProps();\n\n const _validationState = groupProps?.validationState;\n\n return (\n <CardProvider size={size}>\n <CardRoot\n as={as}\n ref={ref as never}\n display={'block' as never}\n borderRadius={borderRadius}\n onMouseEnter={onHover as never}\n shouldScaleOnHover={shouldScaleOnHover}\n isSelected={isSelected}\n isFocused={isFocused}\n // on react native we need to pass onClick to root, because we don't need the LinkOverlay in RN\n onClick={isReactNative() ? onClick : undefined}\n width={width}\n height={height}\n minHeight={minHeight}\n minWidth={minWidth}\n maxWidth={maxWidth}\n href={href}\n accessibilityLabel={accessibilityLabel}\n validationState={_validationState}\n {...metaAttribute({ name: MetaConstants.Card, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <CardSurface\n height={height}\n minHeight={minHeight}\n padding={padding}\n borderRadius={borderRadius}\n elevation={elevation}\n textAlign={'left' as never}\n backgroundColor={backgroundColor}\n >\n {href ? (\n <LinkOverlay\n onClick={onClick}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n {...linkOverlayProps}\n />\n ) : null}\n {!href && onClick ? (\n <LinkOverlay as=\"button\" onClick={onClick} {...linkOverlayProps} />\n ) : null}\n {children}\n </CardSurface>\n </CardRoot>\n </CardProvider>\n );\n};\n\ntype CardBodyProps = {\n children: React.ReactNode;\n height?: BoxProps['height'];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardBody = ({ height, children, testID, ...rest }: CardBodyProps): React.ReactElement => {\n useVerifyInsideCard('CardBody');\n\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.CardBody, testID })}\n {...makeAnalyticsAttribute(rest)}\n height={height}\n >\n {children}\n </BaseBox>\n );\n};\n\nconst Card = React.forwardRef(_Card);\nconst CardBody = assignWithoutSideEffects(_CardBody, { componentId: ComponentIds.CardBody });\n\nexport { Card, CardBody };\n"],"names":["ComponentIds","CardHeader","CardHeaderTrailing","CardHeaderLeading","CardFooter","CardFooterTrailing","CardFooterLeading","CardBody","CardHeaderIcon","CardHeaderCounter","CardHeaderBadge","CardHeaderAmount","CardHeaderText","CardHeaderLink","CardHeaderIconButton","_Card","_ref","ref","children","_ref$backgroundColor","backgroundColor","_ref$borderRadius","borderRadius","_ref$elevation","elevation","testID","_ref$padding","padding","width","height","minHeight","minWidth","maxWidth","onClick","_ref$isSelected","isSelected","accessibilityLabel","_ref$shouldScaleOnHov","shouldScaleOnHover","onHover","href","target","rel","as","_ref$size","size","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isFocused","setIsFocused","useVerifyAllowedChildren","componentName","allowedComponents","linkOverlayProps","Object","assign","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","undefined","onFocus","onBlur","defaultRel","checkboxGroupProps","useCheckboxGroupContext","radioGroupProps","useRadioGroupContext","getGroupProps","keys","length","groupProps","_validationState","validationState","_jsx","CardProvider","CardRoot","display","onMouseEnter","isReactNative","MetaConstants","Card","getStyledProps","makeAnalyticsAttribute","_jsxs","CardSurface","textAlign","LinkOverlay","_CardBody","_ref2","_excluded2","useVerifyInsideCard","BaseBox","forwardRef","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;qSA4Ba,IAAAA,YAAY,CAAG,CAC1BC,UAAU,CAAE,YAAY,CACxBC,kBAAkB,CAAE,oBAAoB,CACxCC,iBAAiB,CAAE,mBAAmB,CACtCC,UAAU,CAAE,YAAY,CACxBC,kBAAkB,CAAE,oBAAoB,CACxCC,iBAAiB,CAAE,mBAAmB,CACtCC,QAAQ,CAAE,UAAU,CACpBC,cAAc,CAAE,gBAAgB,CAChCC,iBAAiB,CAAE,mBAAmB,CACtCC,eAAe,CAAE,iBAAiB,CAClCC,gBAAgB,CAAE,kBAAkB,CACpCC,cAAc,CAAE,gBAAgB,CAChCC,cAAc,CAAE,gBAAgB,CAChCC,oBAAoB,CAAE,sBACxB,EAiJA,IAAMC,KAAiE,CAAG,SAApEA,KAAiEA,CAAAC,IAAA,CAyBrEC,GAAG,CACoB,CAxBrB,IAAAC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAAAC,oBAAA,CAAAH,IAAA,CACRI,eAAe,CAAfA,eAAe,CAAA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,IAAAuE,IAAI,CAAGvC,cAAK,CAACmD,UAAU,CAACtF,KAAK,EAC7B,IAAAR,QAAQ,CAAG+F,wBAAwB,CAACN,SAAS,CAAE,CAAEO,WAAW,CAAEvG,YAAY,CAACO,QAAS,CAAC;;;;"}
@@ -2,7 +2,7 @@ import React__default from 'react';
2
2
  import { throwBladeError } from '../../utils/logger/logger.js';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
5
- var CardContext=React__default.createContext(null);var useVerifyInsideCard=function useVerifyInsideCard(componentName){var context=React__default.useContext(CardContext);if(__DEV__){if(!context){throwBladeError({message:`${componentName} cannot be used outside of Card component`,moduleName:'Card'});}}return true;};var CardProvider=function CardProvider(_ref){var children=_ref.children;return jsx(CardContext.Provider,{value:true,children:children});};
5
+ var CardContext=React__default.createContext({size:undefined});var useVerifyInsideCard=function useVerifyInsideCard(componentName){var context=React__default.useContext(CardContext);if(__DEV__){if(!(context!=null&&context.size)){throwBladeError({message:`${componentName} cannot be used outside of Card component`,moduleName:'Card'});}}return context;};var CardProvider=function CardProvider(_ref){var children=_ref.children,size=_ref.size;return jsx(CardContext.Provider,{value:{size:size},children:children});};
6
6
 
7
- export { CardProvider, useVerifyInsideCard };
7
+ export { CardContext, CardProvider, useVerifyInsideCard };
8
8
  //# sourceMappingURL=CardContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardContext.js","sources":["../../../../../src/components/Card/CardContext.tsx"],"sourcesContent":["import React from 'react';\nimport { throwBladeError } from '~utils/logger';\n\ntype CardContextType = true | null;\nconst CardContext = React.createContext<CardContextType>(null);\n\nconst useVerifyInsideCard = (componentName: string): CardContextType => {\n const context = React.useContext(CardContext);\n if (__DEV__) {\n if (!context) {\n throwBladeError({\n message: `${componentName} cannot be used outside of Card component`,\n moduleName: 'Card',\n });\n }\n }\n return true;\n};\n\ntype CardProviderProps = { children: React.ReactNode };\nconst CardProvider = ({ children }: CardProviderProps): React.ReactElement => {\n return <CardContext.Provider value={true}>{children}</CardContext.Provider>;\n};\n\nexport { useVerifyInsideCard, CardProvider };\n"],"names":["CardContext","React","createContext","useVerifyInsideCard","componentName","context","useContext","__DEV__","throwBladeError","message","moduleName","CardProvider","_ref","children","_jsx","Provider","value"],"mappings":";;;;AAIA,IAAMA,WAAW,CAAGC,cAAK,CAACC,aAAa,CAAkB,IAAI,CAAC,CAExD,IAAAC,mBAAmB,CAAG,SAAtBA,mBAAmBA,CAAIC,aAAqB,CAAsB,CACtE,IAAMC,OAAO,CAAGJ,cAAK,CAACK,UAAU,CAACN,WAAW,CAAC,CAC7C,GAAIO,OAAO,CAAE,CACX,GAAI,CAACF,OAAO,CAAE,CACZG,eAAe,CAAC,CACdC,OAAO,CAAG,CAAEL,EAAAA,aAAc,CAA0C,yCAAA,CAAA,CACpEM,UAAU,CAAE,MACd,CAAC,CAAC,CACJ,CACF,CACA,OAAO,IAAI,CACb,EAGM,IAAAC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAA4D,CAAtD,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAC9B,OAAOC,GAAA,CAACd,WAAW,CAACe,QAAQ,CAACC,CAAAA,KAAK,CAAE,IAAK,CAAAH,QAAA,CAAEA,QAAQ,CAAuB,CAAC,CAC7E;;;;"}
1
+ {"version":3,"file":"CardContext.js","sources":["../../../../../src/components/Card/CardContext.tsx"],"sourcesContent":["import React from 'react';\nimport { throwBladeError } from '~utils/logger';\n\ntype CardContextType = { size: 'large' | 'medium' | undefined };\nconst CardContext = React.createContext<CardContextType>({ size: undefined });\n\nconst useVerifyInsideCard = (componentName: string): CardContextType => {\n const context = React.useContext(CardContext);\n if (__DEV__) {\n if (!context?.size) {\n throwBladeError({\n message: `${componentName} cannot be used outside of Card component`,\n moduleName: 'Card',\n });\n }\n }\n return context;\n};\n\ntype CardProviderProps = { children: React.ReactNode };\nconst CardProvider = ({\n children,\n size,\n}: CardProviderProps & { size: 'large' | 'medium' }): React.ReactElement => {\n return <CardContext.Provider value={{ size }}>{children}</CardContext.Provider>;\n};\n\nexport { useVerifyInsideCard, CardProvider, CardContext };\n"],"names":["CardContext","React","createContext","size","undefined","useVerifyInsideCard","componentName","context","useContext","__DEV__","throwBladeError","message","moduleName","CardProvider","_ref","children","_jsx","Provider","value"],"mappings":";;;;AAIM,IAAAA,WAAW,CAAGC,cAAK,CAACC,aAAa,CAAkB,CAAEC,IAAI,CAAEC,SAAU,CAAC,EAEtE,IAAAC,mBAAmB,CAAG,SAAtBA,mBAAmBA,CAAIC,aAAqB,CAAsB,CACtE,IAAMC,OAAO,CAAGN,cAAK,CAACO,UAAU,CAACR,WAAW,CAAC,CAC7C,GAAIS,OAAO,CAAE,CACX,GAAI,EAACF,OAAO,QAAPA,OAAO,CAAEJ,IAAI,CAAA,CAAE,CAClBO,eAAe,CAAC,CACdC,OAAO,CAAG,CAAA,EAAEL,aAAc,CAAA,yCAAA,CAA0C,CACpEM,UAAU,CAAE,MACd,CAAC,CAAC,CACJ,CACF,CACA,OAAOL,OAAO,CAChB,EAGM,IAAAM,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAG0D,CAF1E,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRZ,IAAI,CAAAW,IAAA,CAAJX,IAAI,CAEJ,OAAOa,GAAA,CAAChB,WAAW,CAACiB,QAAQ,CAAA,CAACC,KAAK,CAAE,CAAEf,IAAI,CAAJA,IAAK,CAAE,CAAAY,QAAA,CAAEA,QAAQ,CAAuB,CAAC,CACjF;;;;"}
@@ -16,9 +16,10 @@ import { useIsMobile } from '../../utils/useIsMobile.js';
16
16
  import { throwBladeError } from '../../utils/logger/logger.js';
17
17
  import { useVerifyAllowedChildren } from '../../utils/useVerifyAllowedChildren/useVerifyAllowedChildren.js';
18
18
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
19
+ import { MAKE_ANALYTICS_CONSTANTS } from '../../utils/makeAnalyticsAttribute/makeAnalyticsConstants.js';
19
20
  import { jsxs, jsx } from 'react/jsx-runtime';
20
21
 
21
- var _excluded=["children","testID","marginTop","paddingTop","showDivider"],_excluded2=["title","subtitle"],_excluded3=["actions"];var _CardFooter=function _CardFooter(_ref){var _footerChildrensArray,_footerChildrensArray2;var children=_ref.children,testID=_ref.testID,_ref$marginTop=_ref.marginTop,marginTop=_ref$marginTop===void 0?'spacing.4':_ref$marginTop,_ref$paddingTop=_ref.paddingTop,paddingTop=_ref$paddingTop===void 0?'spacing.4':_ref$paddingTop,_ref$showDivider=_ref.showDivider,showDivider=_ref$showDivider===void 0?true:_ref$showDivider,props=_objectWithoutProperties(_ref,_excluded);var isMobile=useIsMobile();useVerifyInsideCard('CardFooter');useVerifyAllowedChildren({children:children,componentName:'CardFooter',allowedComponents:[ComponentIds.CardFooterLeading,ComponentIds.CardFooterTrailing]});var footerChildrensArray=React__default.Children.toArray(children);if(__DEV__){if(!React__default.isValidElement(footerChildrensArray[0])){throwBladeError({message:`Invalid React Element ${footerChildrensArray}`,moduleName:'CardFooter'});}}var baseBoxJustifyContent=footerChildrensArray.length===2||!((_footerChildrensArray=footerChildrensArray[0])!=null&&(_footerChildrensArray2=_footerChildrensArray.props)!=null&&_footerChildrensArray2.actions)?'space-between':'flex-end';return jsxs(BaseBox,Object.assign({marginTop:marginTop},metaAttribute({name:MetaConstants.CardFooter,testID:testID}),makeAnalyticsAttribute(props),{children:[showDivider?jsx(Divider,{}):null,jsx(BaseBox,{paddingTop:paddingTop,display:"flex",flexDirection:isMobile?'column':'row',justifyContent:baseBoxJustifyContent,alignItems:isMobile?'stretch':'center',children:children})]}));};var CardFooter=assignWithoutSideEffects(_CardFooter,{componentId:ComponentIds.CardFooter});var _CardFooterLeading=function _CardFooterLeading(_ref2){var title=_ref2.title,subtitle=_ref2.subtitle,rest=_objectWithoutProperties(_ref2,_excluded2);useVerifyInsideCard('CardFooterLeading');return jsxs(BaseBox,Object.assign({textAlign:'left'},makeAnalyticsAttribute(rest),{children:[title&&jsx(Text,{color:"surface.text.gray.normal",size:"medium",weight:"semibold",children:title}),subtitle&&jsx(Text,{color:"surface.text.gray.subtle",size:"small",weight:"regular",children:subtitle})]}));};var CardFooterLeading=assignWithoutSideEffects(_CardFooterLeading,{componentId:ComponentIds.CardFooterLeading});var _CardFooterTrailing=function _CardFooterTrailing(_ref3){var actions=_ref3.actions,rest=_objectWithoutProperties(_ref3,_excluded3);var isMobile=useIsMobile();useVerifyInsideCard('CardFooterTrailing');return jsxs(BaseBox,Object.assign({display:"flex",flexDirection:"row",alignSelf:isMobile?'auto':'center',marginTop:isMobile?'spacing.5':'spacing.0',marginLeft:isMobile?'spacing.0':'spacing.5'},makeAnalyticsAttribute(rest),{children:[jsx(BaseBox,{flexGrow:1,children:actions!=null&&actions.secondary?jsx(Button,Object.assign({isFullWidth:true,size:"medium",variant:"secondary"},actions.secondary,{children:actions.secondary.text})):null}),jsx(BaseBox,{marginLeft:"spacing.5"}),jsx(BaseBox,{flexGrow:1,children:actions!=null&&actions.primary?jsx(Button,Object.assign({isFullWidth:true,size:"medium"},actions.primary,{children:actions.primary.text})):null})]}));};var CardFooterTrailing=assignWithoutSideEffects(_CardFooterTrailing,{componentId:ComponentIds.CardFooterTrailing});
22
+ var _excluded=["children","testID","marginTop","paddingTop","showDivider"],_excluded2=["title","subtitle"],_excluded3=["actions"];var _CardFooter=function _CardFooter(_ref){var _footerChildrensArray,_footerChildrensArray2;var children=_ref.children,testID=_ref.testID,_ref$marginTop=_ref.marginTop,marginTop=_ref$marginTop===void 0?'spacing.4':_ref$marginTop,_ref$paddingTop=_ref.paddingTop,paddingTop=_ref$paddingTop===void 0?'spacing.4':_ref$paddingTop,_ref$showDivider=_ref.showDivider,showDivider=_ref$showDivider===void 0?true:_ref$showDivider,props=_objectWithoutProperties(_ref,_excluded);var isMobile=useIsMobile();useVerifyInsideCard('CardFooter');useVerifyAllowedChildren({children:children,componentName:'CardFooter',allowedComponents:[ComponentIds.CardFooterLeading,ComponentIds.CardFooterTrailing]});var footerChildrensArray=React__default.Children.toArray(children);if(__DEV__){if(!React__default.isValidElement(footerChildrensArray[0])){throwBladeError({message:`Invalid React Element ${footerChildrensArray}`,moduleName:'CardFooter'});}}var baseBoxJustifyContent=footerChildrensArray.length===2||!((_footerChildrensArray=footerChildrensArray[0])!=null&&(_footerChildrensArray2=_footerChildrensArray.props)!=null&&_footerChildrensArray2.actions)?'space-between':'flex-end';return jsxs(BaseBox,Object.assign({marginTop:marginTop},metaAttribute({name:MetaConstants.CardFooter,testID:testID}),makeAnalyticsAttribute(props),{children:[showDivider?jsx(Divider,{}):null,jsx(BaseBox,{paddingTop:paddingTop,display:"flex",flexDirection:isMobile?'column':'row',justifyContent:baseBoxJustifyContent,alignItems:isMobile?'stretch':'center',children:children})]}));};var CardFooter=assignWithoutSideEffects(_CardFooter,{componentId:ComponentIds.CardFooter});var _CardFooterLeading=function _CardFooterLeading(_ref2){var title=_ref2.title,subtitle=_ref2.subtitle,rest=_objectWithoutProperties(_ref2,_excluded2);useVerifyInsideCard('CardFooterLeading');return jsxs(BaseBox,Object.assign({textAlign:'left'},makeAnalyticsAttribute(rest),{children:[title&&jsx(Text,{color:"surface.text.gray.normal",size:"medium",weight:"semibold",children:title}),subtitle&&jsx(Text,{color:"surface.text.gray.subtle",size:"small",weight:"regular",children:subtitle})]}));};var CardFooterLeading=assignWithoutSideEffects(_CardFooterLeading,{componentId:ComponentIds.CardFooterLeading});var _CardFooterTrailing=function _CardFooterTrailing(_ref3){var actions=_ref3.actions,rest=_objectWithoutProperties(_ref3,_excluded3);var isMobile=useIsMobile();useVerifyInsideCard('CardFooterTrailing');return jsxs(BaseBox,Object.assign({display:"flex",flexDirection:"row",alignSelf:isMobile?'auto':'center',marginTop:isMobile?'spacing.5':'spacing.0',marginLeft:isMobile?'spacing.0':'spacing.5'},makeAnalyticsAttribute(rest),{children:[jsx(BaseBox,{flexGrow:1,children:actions!=null&&actions.secondary?jsx(Button,Object.assign({isFullWidth:true,size:"medium",variant:"secondary"},actions.secondary,{"data-analytics-name":MAKE_ANALYTICS_CONSTANTS.CARD.FOOTER_SECONDARY_ACTION_BUTTON,children:actions.secondary.text})):null}),jsx(BaseBox,{marginLeft:"spacing.5"}),jsx(BaseBox,{flexGrow:1,children:actions!=null&&actions.primary?jsx(Button,Object.assign({isFullWidth:true,size:"medium"},actions.primary,{"data-analytics-name":MAKE_ANALYTICS_CONSTANTS.CARD.FOOTER_PRIMARY_ACTION_BUTTON,children:actions.primary.text})):null})]}));};var CardFooterTrailing=assignWithoutSideEffects(_CardFooterTrailing,{componentId:ComponentIds.CardFooterTrailing});
22
23
 
23
24
  export { CardFooter, CardFooterLeading, CardFooterTrailing };
24
25
  //# sourceMappingURL=CardFooter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardFooter.js","sources":["../../../../../src/components/Card/CardFooter.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { useVerifyInsideCard } from './CardContext';\nimport { ComponentIds } from './Card';\nimport type { CardSpacingValueType } from './types';\nimport type { ButtonProps } from '~components/Button';\nimport { Button } from '~components/Button';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useIsMobile } from '~utils/useIsMobile';\nimport { throwBladeError } from '~utils/logger';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nexport type CardFooterAction = Pick<\n ButtonProps,\n 'type' | 'accessibilityLabel' | 'isLoading' | 'isDisabled' | 'icon' | 'iconPosition' | 'onClick'\n> & {\n text: ButtonProps['children'];\n};\n\ntype CardFooterProps = {\n children?: React.ReactNode;\n /**\n * For spacing between divider and footer title\n */\n paddingTop?: CardSpacingValueType;\n /**\n * For spacing between body content and divider\n */\n marginTop?: CardSpacingValueType;\n /**\n * @default true\n */\n showDivider?: boolean;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardFooter = ({\n children,\n testID,\n marginTop = 'spacing.4',\n paddingTop = 'spacing.4',\n showDivider = true,\n ...props\n}: CardFooterProps): React.ReactElement => {\n const isMobile = useIsMobile();\n useVerifyInsideCard('CardFooter');\n useVerifyAllowedChildren({\n children,\n componentName: 'CardFooter',\n allowedComponents: [ComponentIds.CardFooterLeading, ComponentIds.CardFooterTrailing],\n });\n\n const footerChildrensArray = React.Children.toArray(children);\n if (__DEV__) {\n if (!React.isValidElement(footerChildrensArray[0])) {\n throwBladeError({\n message: `Invalid React Element ${footerChildrensArray}`,\n moduleName: 'CardFooter',\n });\n }\n }\n\n // the reason why we are checking for actions here is, because we want the footerTrailing\n // to always be aligned to the right\n // if we don't check for action here, and if we do not have footerTrailing and only footerLeading\n // then the content of footerLeading will be justified to the end.\n const baseBoxJustifyContent =\n footerChildrensArray.length === 2 || !(footerChildrensArray[0] as ReactElement)?.props?.actions\n ? 'space-between'\n : 'flex-end';\n\n return (\n <BaseBox\n marginTop={marginTop}\n {...metaAttribute({ name: MetaConstants.CardFooter, testID })}\n {...makeAnalyticsAttribute(props)}\n >\n {showDivider ? <Divider /> : null}\n <BaseBox\n paddingTop={paddingTop}\n display=\"flex\"\n flexDirection={isMobile ? 'column' : 'row'}\n justifyContent={baseBoxJustifyContent}\n alignItems={isMobile ? 'stretch' : 'center'}\n >\n {children}\n </BaseBox>\n </BaseBox>\n );\n};\nconst CardFooter = assignWithoutSideEffects(_CardFooter, { componentId: ComponentIds.CardFooter });\n\ntype CardFooterLeadingProps = {\n title?: string;\n subtitle?: string;\n} & DataAnalyticsAttribute;\nconst _CardFooterLeading = ({\n title,\n subtitle,\n ...rest\n}: CardFooterLeadingProps): React.ReactElement => {\n useVerifyInsideCard('CardFooterLeading');\n\n return (\n <BaseBox textAlign={'left' as never} {...makeAnalyticsAttribute(rest)}>\n {title && (\n <Text color=\"surface.text.gray.normal\" size=\"medium\" weight=\"semibold\">\n {title}\n </Text>\n )}\n {subtitle && (\n <Text color=\"surface.text.gray.subtle\" size=\"small\" weight=\"regular\">\n {subtitle}\n </Text>\n )}\n </BaseBox>\n );\n};\nconst CardFooterLeading = assignWithoutSideEffects(_CardFooterLeading, {\n componentId: ComponentIds.CardFooterLeading,\n});\n\ntype CardFooterTrailingProps = {\n actions?: {\n primary?: CardFooterAction;\n secondary?: CardFooterAction;\n };\n} & DataAnalyticsAttribute;\nconst _CardFooterTrailing = ({ actions, ...rest }: CardFooterTrailingProps): React.ReactElement => {\n const isMobile = useIsMobile();\n useVerifyInsideCard('CardFooterTrailing');\n\n return (\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n alignSelf={isMobile ? 'auto' : 'center'}\n marginTop={isMobile ? 'spacing.5' : 'spacing.0'}\n marginLeft={isMobile ? 'spacing.0' : 'spacing.5'}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox flexGrow={1}>\n {actions?.secondary ? (\n <Button isFullWidth size=\"medium\" variant=\"secondary\" {...actions.secondary}>\n {actions.secondary.text!}\n </Button>\n ) : null}\n </BaseBox>\n <BaseBox marginLeft=\"spacing.5\" />\n <BaseBox flexGrow={1}>\n {actions?.primary ? (\n <Button isFullWidth size=\"medium\" {...actions.primary}>\n {actions.primary.text!}\n </Button>\n ) : null}\n </BaseBox>\n </BaseBox>\n );\n};\nconst CardFooterTrailing = assignWithoutSideEffects(_CardFooterTrailing, {\n componentId: ComponentIds.CardFooterTrailing,\n});\n\nexport { CardFooter, CardFooterLeading, CardFooterTrailing };\n"],"names":["_CardFooter","_ref","_footerChildrensArray","_footerChildrensArray2","children","testID","_ref$marginTop","marginTop","_ref$paddingTop","paddingTop","_ref$showDivider","showDivider","props","_objectWithoutProperties","_excluded","isMobile","useIsMobile","useVerifyInsideCard","useVerifyAllowedChildren","componentName","allowedComponents","ComponentIds","CardFooterLeading","CardFooterTrailing","footerChildrensArray","React","Children","toArray","__DEV__","isValidElement","throwBladeError","message","moduleName","baseBoxJustifyContent","length","actions","_jsxs","BaseBox","Object","assign","metaAttribute","name","MetaConstants","CardFooter","makeAnalyticsAttribute","_jsx","Divider","display","flexDirection","justifyContent","alignItems","assignWithoutSideEffects","componentId","_CardFooterLeading","_ref2","title","subtitle","rest","_excluded2","textAlign","Text","color","size","weight","_CardFooterTrailing","_ref3","_excluded3","alignSelf","marginLeft","flexGrow","secondary","Button","isFullWidth","variant","text","primary"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,QAAA,CAAA,WAAA,CAAA,YAAA,CAAA,aAAA,CAAA,CAAA,UAAA,CAAA,CAAA,OAAA,CAAA,UAAA,CAAA,CAAA,UAAA,CAAA,CAAA,SAAA,CAAA,CAyCA,IAAMA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAO0B,CAAA,IAAAC,qBAAA,CAAAC,sBAAA,CANzC,IAAAC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CACRC,MAAM,CAAAJ,IAAA,CAANI,MAAM,CAAAC,cAAA,CAAAL,IAAA,CACNM,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,WAAW,CAAAA,cAAA,CAAAE,eAAA,CAAAP,IAAA,CACvBQ,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAA,KAAA,CAAA,CAAG,WAAW,CAAAA,eAAA,CAAAE,gBAAA,CAAAT,IAAA,CACxBU,WAAW,CAAXA,WAAW,CAAAD,gBAAA,GAAA,KAAA,CAAA,CAAG,IAAI,CAAAA,gBAAA,CACfE,KAAK,CAAAC,wBAAA,CAAAZ,IAAA,CAAAa,SAAA,CAER,CAAA,IAAMC,QAAQ,CAAGC,WAAW,EAAE,CAC9BC,mBAAmB,CAAC,YAAY,CAAC,C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CAAA,CACf,CAAC,CACP,IAAI,CACD,CAAC,GACH,CAAC,CAEd,CAAC,CACK,IAAAnD,kBAAkB,CAAG4B,wBAAwB,CAACa,mBAAmB,CAAE,CACvEZ,WAAW,CAAE/B,YAAY,CAACE,kBAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"CardFooter.js","sources":["../../../../../src/components/Card/CardFooter.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { useVerifyInsideCard } from './CardContext';\nimport { ComponentIds } from './Card';\nimport type { CardSpacingValueType } from './types';\nimport type { ButtonProps } from '~components/Button';\nimport { Button } from '~components/Button';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useIsMobile } from '~utils/useIsMobile';\nimport { throwBladeError } from '~utils/logger';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport { MAKE_ANALYTICS_CONSTANTS, makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nexport type CardFooterAction = Pick<\n ButtonProps,\n 'type' | 'accessibilityLabel' | 'isLoading' | 'isDisabled' | 'icon' | 'iconPosition' | 'onClick'\n> & {\n text: ButtonProps['children'];\n};\n\ntype CardFooterProps = {\n children?: React.ReactNode;\n /**\n * For spacing between divider and footer title\n */\n paddingTop?: CardSpacingValueType;\n /**\n * For spacing between body content and divider\n */\n marginTop?: CardSpacingValueType;\n /**\n * @default true\n */\n showDivider?: boolean;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardFooter = ({\n children,\n testID,\n marginTop = 'spacing.4',\n paddingTop = 'spacing.4',\n showDivider = true,\n ...props\n}: CardFooterProps): React.ReactElement => {\n const isMobile = useIsMobile();\n useVerifyInsideCard('CardFooter');\n useVerifyAllowedChildren({\n children,\n componentName: 'CardFooter',\n allowedComponents: [ComponentIds.CardFooterLeading, ComponentIds.CardFooterTrailing],\n });\n\n const footerChildrensArray = React.Children.toArray(children);\n if (__DEV__) {\n if (!React.isValidElement(footerChildrensArray[0])) {\n throwBladeError({\n message: `Invalid React Element ${footerChildrensArray}`,\n moduleName: 'CardFooter',\n });\n }\n }\n\n // the reason why we are checking for actions here is, because we want the footerTrailing\n // to always be aligned to the right\n // if we don't check for action here, and if we do not have footerTrailing and only footerLeading\n // then the content of footerLeading will be justified to the end.\n const baseBoxJustifyContent =\n footerChildrensArray.length === 2 || !(footerChildrensArray[0] as ReactElement)?.props?.actions\n ? 'space-between'\n : 'flex-end';\n\n return (\n <BaseBox\n marginTop={marginTop}\n {...metaAttribute({ name: MetaConstants.CardFooter, testID })}\n {...makeAnalyticsAttribute(props)}\n >\n {showDivider ? <Divider /> : null}\n <BaseBox\n paddingTop={paddingTop}\n display=\"flex\"\n flexDirection={isMobile ? 'column' : 'row'}\n justifyContent={baseBoxJustifyContent}\n alignItems={isMobile ? 'stretch' : 'center'}\n >\n {children}\n </BaseBox>\n </BaseBox>\n );\n};\nconst CardFooter = assignWithoutSideEffects(_CardFooter, { componentId: ComponentIds.CardFooter });\n\ntype CardFooterLeadingProps = {\n title?: string;\n subtitle?: string;\n} & DataAnalyticsAttribute;\nconst _CardFooterLeading = ({\n title,\n subtitle,\n ...rest\n}: CardFooterLeadingProps): React.ReactElement => {\n useVerifyInsideCard('CardFooterLeading');\n\n return (\n <BaseBox textAlign={'left' as never} {...makeAnalyticsAttribute(rest)}>\n {title && (\n <Text color=\"surface.text.gray.normal\" size=\"medium\" weight=\"semibold\">\n {title}\n </Text>\n )}\n {subtitle && (\n <Text color=\"surface.text.gray.subtle\" size=\"small\" weight=\"regular\">\n {subtitle}\n </Text>\n )}\n </BaseBox>\n );\n};\nconst CardFooterLeading = assignWithoutSideEffects(_CardFooterLeading, {\n componentId: ComponentIds.CardFooterLeading,\n});\n\ntype CardFooterTrailingProps = {\n actions?: {\n primary?: CardFooterAction;\n secondary?: CardFooterAction;\n };\n} & DataAnalyticsAttribute;\nconst _CardFooterTrailing = ({ actions, ...rest }: CardFooterTrailingProps): React.ReactElement => {\n const isMobile = useIsMobile();\n useVerifyInsideCard('CardFooterTrailing');\n\n return (\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n alignSelf={isMobile ? 'auto' : 'center'}\n marginTop={isMobile ? 'spacing.5' : 'spacing.0'}\n marginLeft={isMobile ? 'spacing.0' : 'spacing.5'}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox flexGrow={1}>\n {actions?.secondary ? (\n <Button\n isFullWidth\n size=\"medium\"\n variant=\"secondary\"\n {...actions.secondary}\n data-analytics-name={MAKE_ANALYTICS_CONSTANTS.CARD.FOOTER_SECONDARY_ACTION_BUTTON}\n >\n {actions.secondary.text!}\n </Button>\n ) : null}\n </BaseBox>\n <BaseBox marginLeft=\"spacing.5\" />\n <BaseBox flexGrow={1}>\n {actions?.primary ? (\n <Button\n isFullWidth\n size=\"medium\"\n {...actions.primary}\n data-analytics-name={MAKE_ANALYTICS_CONSTANTS.CARD.FOOTER_PRIMARY_ACTION_BUTTON}\n >\n {actions.primary.text!}\n </Button>\n ) : null}\n </BaseBox>\n </BaseBox>\n );\n};\nconst CardFooterTrailing = assignWithoutSideEffects(_CardFooterTrailing, {\n componentId: ComponentIds.CardFooterTrailing,\n});\n\nexport { CardFooter, CardFooterLeading, CardFooterTrailing };\n"],"names":["_CardFooter","_ref","_footerChildrensArray","_footerChildrensArray2","children","testID","_ref$marginTop","marginTop","_ref$paddingTop","paddingTop","_ref$showDivider","showDivider","props","_objectWithoutProperties","_excluded","isMobile","useIsMobile","useVerifyInsideCard","useVerifyAllowedChildren","componentName","allowedComponents","ComponentIds","CardFooterLeading","CardFooterTrailing","footerChildrensArray","React","Children","toArray","__DEV__","isValidElement","throwBladeError","message","moduleName","baseBoxJustifyContent","length","actions","_jsxs","BaseBox","Object","assign","metaAttribute","name","MetaConstants","CardFooter","makeAnalyticsAttribute","_jsx","Divider","display","flexDirection","justifyContent","alignItems","assignWithoutSideEffects","componentId","_CardFooterLeading","_ref2","title","subtitle","rest","_excluded2","textAlign","Text","color","size","weight","_CardFooterTrailing","_ref3","_excluded3","alignSelf","marginLeft","flexGrow","secondary","Button","isFullWidth","variant","MAKE_ANALYTICS_CONSTANTS","CARD","FOOTER_SECONDARY_ACTION_BUTTON","text","primary","FOOTER_PRIMARY_ACTION_BUTTON"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,QAAA,CAAA,WAAA,CAAA,YAAA,CAAA,aAAA,CAAA,CAAA,UAAA,CAAA,CAAA,OAAA,CAAA,UAAA,CAAA,CAAA,UAAA,CAAA,CAAA,SAAA,CAAA,CAyCA,IAAMA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAO0B,CAAAC,IAAAA,qBAAA,CAAAC,sBAAA,CAAA,IANzCC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CACRC,MAAM,CAAAJ,IAAA,CAANI,MAAM,CAAAC,cAAA,CAAAL,IAAA,CACNM,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,WAAW,CAAAA,cAAA,CAAAE,eAAA,CAAAP,IAAA,CACvBQ,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAA,KAAA,CAAA,CAAG,WAAW,CAAAA,eAAA,CAAAE,gBAAA,CAAAT,IAAA,CACxBU,WAAW,CAAXA,WAAW,CAAAD,gBAAA,GAAA,KAAA,CAAA,CAAG,IAAI,CAAAA,gBAAA,CACfE,KAAK,CAAAC,wBAAA,CAAAZ,IAAA,CAAAa,SAAA,CAAA,CAER,IAAMC,QAAQ,CAAGC,WAAW,EAAE,CAC9BC,mBAAmB,CAAC,YAAY,CAAC,CACjCC,wBA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,IAAI,CAACI,4BAA6B,CAAA3E,QAAA,CAE/E+B,OAAO,CAAC2C,OAAO,CAACD,IAAI,EACf,CAAC,CACP,IAAI,CACD,CAAC,GACH,CAAC,CAEd,CAAC,CACK,IAAAtD,kBAAkB,CAAG4B,wBAAwB,CAACa,mBAAmB,CAAE,CACvEZ,WAAW,CAAE/B,YAAY,CAACE,kBAC5B,CAAC;;;;"}
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
- import 'react';
3
- import { useVerifyInsideCard } from './CardContext.js';
2
+ import { useContext } from 'react';
3
+ import { useVerifyInsideCard, CardContext } from './CardContext.js';
4
4
  import { ComponentIds } from './Card.js';
5
5
  import { Badge } from '../Badge/Badge.js';
6
6
  import Link from '../Link/Link/Link.js';
@@ -24,7 +24,7 @@ import { Amount } from '../Amount/Amount.js';
24
24
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
25
25
  import { jsx, jsxs } from 'react/jsx-runtime';
26
26
 
27
- var _excluded=["children","testID","marginBottom","paddingBottom","showDivider"],_excluded2=["title","subtitle","prefix","suffix"];var _CardHeaderIcon=function _CardHeaderIcon(_ref){var Icon=_ref.icon;useVerifyInsideCard('CardHeaderIcon');return jsx(Icon,{color:"surface.icon.gray.normal",size:"large"});};var CardHeaderIcon=assignWithoutSideEffects(_CardHeaderIcon,{componentId:ComponentIds.CardHeaderIcon});var _CardHeaderCounter=function _CardHeaderCounter(props){useVerifyInsideCard('CardHeaderCounter');return jsx(Counter,Object.assign({},props));};var CardHeaderCounter=assignWithoutSideEffects(_CardHeaderCounter,{componentId:ComponentIds.CardHeaderCounter});var _CardHeaderBadge=function _CardHeaderBadge(props){useVerifyInsideCard('CardHeaderBadge');return jsx(Badge,Object.assign({},props));};var CardHeaderBadge=assignWithoutSideEffects(_CardHeaderBadge,{componentId:ComponentIds.CardHeaderBadge});var _CardHeaderAmount=function _CardHeaderAmount(props){useVerifyInsideCard('CardHeaderAmount');return jsx(Amount,Object.assign({},props));};var CardHeaderAmount=assignWithoutSideEffects(_CardHeaderAmount,{componentId:ComponentIds.CardHeaderAmount});var _CardHeaderText=function _CardHeaderText(props){useVerifyInsideCard('CardHeaderText');return jsx(Text,Object.assign({textAlign:"left"},props));};var CardHeaderText=assignWithoutSideEffects(_CardHeaderText,{componentId:ComponentIds.CardHeaderText});var _CardHeaderLink=function _CardHeaderLink(props){useVerifyInsideCard('CardHeaderLink');return jsx(Link,Object.assign({},props));};var CardHeaderLink=assignWithoutSideEffects(_CardHeaderLink,{componentId:ComponentIds.CardHeaderLink});var _CardHeaderIconButton=function _CardHeaderIconButton(props){useVerifyInsideCard('CardHeaderIconButton');return jsx(BaseBox,{width:makeSpace(minHeight.xsmall),children:jsx(Button,Object.assign({},props,{variant:"tertiary",size:"xsmall",iconPosition:"left",isFullWidth:true}))});};var CardHeaderIconButton=assignWithoutSideEffects(_CardHeaderIconButton,{componentId:ComponentIds.CardHeaderIconButton});var _CardHeader=function _CardHeader(_ref2){var children=_ref2.children,testID=_ref2.testID,_ref2$marginBottom=_ref2.marginBottom,marginBottom=_ref2$marginBottom===void 0?'spacing.4':_ref2$marginBottom,_ref2$paddingBottom=_ref2.paddingBottom,paddingBottom=_ref2$paddingBottom===void 0?'spacing.4':_ref2$paddingBottom,_ref2$showDivider=_ref2.showDivider,showDivider=_ref2$showDivider===void 0?true:_ref2$showDivider,rest=_objectWithoutProperties(_ref2,_excluded);useVerifyInsideCard('CardHeader');useVerifyAllowedChildren({children:children,componentName:'CardHeader',allowedComponents:[ComponentIds.CardHeaderLeading,ComponentIds.CardHeaderTrailing]});return jsxs(BaseBox,Object.assign({marginBottom:marginBottom},metaAttribute({name:MetaConstants.CardHeader,testID:testID}),makeAnalyticsAttribute(rest),{children:[jsx(BaseBox,{paddingBottom:paddingBottom,display:"flex",flexDirection:"row",justifyContent:"space-between",children:children}),showDivider?jsx(Divider,{}):null]}));};var CardHeader=assignWithoutSideEffects(_CardHeader,{componentId:ComponentIds.CardHeader});var _CardHeaderLeading=function _CardHeaderLeading(_ref3){var title=_ref3.title,subtitle=_ref3.subtitle,prefix=_ref3.prefix,suffix=_ref3.suffix,rest=_objectWithoutProperties(_ref3,_excluded2);useVerifyInsideCard('CardHeaderLeading');if(__DEV__){if(prefix&&!isValidAllowedChildren(prefix,ComponentIds.CardHeaderIcon)){throwBladeError({message:`Only \`${ComponentIds.CardHeaderIcon}\` component is accepted in prefix`,moduleName:'CardHeaderLeading'});}if(suffix&&!isValidAllowedChildren(suffix,ComponentIds.CardHeaderCounter)){throwBladeError({message:`Only \`${ComponentIds.CardHeaderCounter}\` component is accepted in prefix`,moduleName:'CardHeaderLeading'});}}return jsxs(BaseBox,Object.assign({},makeAnalyticsAttribute(rest),{flex:1,display:"flex",flexDirection:"row",children:[jsx(BaseBox,{marginRight:"spacing.3",alignSelf:"center",display:"flex",children:prefix}),jsxs(BaseBox,{marginRight:"spacing.5",children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"center",flexWrap:"wrap",children:[jsx(Text,{color:"surface.text.gray.normal",size:"large",weight:"semibold",children:title}),jsx(BaseBox,{marginLeft:"spacing.3",children:suffix})]}),subtitle&&jsx(Text,{color:"surface.text.gray.subtle",textAlign:"left",size:"small",children:subtitle})]})]}));};var CardHeaderLeading=assignWithoutSideEffects(_CardHeaderLeading,{componentId:ComponentIds.CardHeaderLeading});var headerTrailingAllowedComponents=[ComponentIds.CardHeaderLink,ComponentIds.CardHeaderText,ComponentIds.CardHeaderIconButton,ComponentIds.CardHeaderBadge,ComponentIds.CardHeaderAmount];var _CardHeaderTrailing=function _CardHeaderTrailing(_ref4){var visual=_ref4.visual;useVerifyInsideCard('CardHeaderTrailing');if(__DEV__){if(visual&&!headerTrailingAllowedComponents.includes(getComponentId(visual))){throwBladeError({message:`Only one of \`${headerTrailingAllowedComponents.join(', ')}\` component is accepted in visual`,moduleName:'CardHeaderTrailing'});}}return jsx(BaseBox,{alignSelf:"center",children:visual});};var CardHeaderTrailing=assignWithoutSideEffects(_CardHeaderTrailing,{componentId:ComponentIds.CardHeaderTrailing});
27
+ var _excluded=["children","testID","marginBottom","paddingBottom","showDivider"],_excluded2=["title","subtitle","prefix","suffix"];var _CardHeaderIcon=function _CardHeaderIcon(_ref){var Icon=_ref.icon;useVerifyInsideCard('CardHeaderIcon');return jsx(Icon,{color:"surface.icon.gray.normal",size:"large"});};var CardHeaderIcon=assignWithoutSideEffects(_CardHeaderIcon,{componentId:ComponentIds.CardHeaderIcon});var _CardHeaderCounter=function _CardHeaderCounter(props){useVerifyInsideCard('CardHeaderCounter');return jsx(Counter,Object.assign({},props));};var CardHeaderCounter=assignWithoutSideEffects(_CardHeaderCounter,{componentId:ComponentIds.CardHeaderCounter});var _CardHeaderBadge=function _CardHeaderBadge(props){useVerifyInsideCard('CardHeaderBadge');return jsx(Badge,Object.assign({},props));};var CardHeaderBadge=assignWithoutSideEffects(_CardHeaderBadge,{componentId:ComponentIds.CardHeaderBadge});var _CardHeaderAmount=function _CardHeaderAmount(props){useVerifyInsideCard('CardHeaderAmount');return jsx(Amount,Object.assign({},props));};var CardHeaderAmount=assignWithoutSideEffects(_CardHeaderAmount,{componentId:ComponentIds.CardHeaderAmount});var _CardHeaderText=function _CardHeaderText(props){useVerifyInsideCard('CardHeaderText');return jsx(Text,Object.assign({textAlign:"left"},props));};var CardHeaderText=assignWithoutSideEffects(_CardHeaderText,{componentId:ComponentIds.CardHeaderText});var _CardHeaderLink=function _CardHeaderLink(props){useVerifyInsideCard('CardHeaderLink');return jsx(Link,Object.assign({},props));};var CardHeaderLink=assignWithoutSideEffects(_CardHeaderLink,{componentId:ComponentIds.CardHeaderLink});var _CardHeaderIconButton=function _CardHeaderIconButton(props){useVerifyInsideCard('CardHeaderIconButton');return jsx(BaseBox,{width:makeSpace(minHeight.xsmall),children:jsx(Button,Object.assign({},props,{variant:"tertiary",size:"xsmall",iconPosition:"left",isFullWidth:true}))});};var CardHeaderIconButton=assignWithoutSideEffects(_CardHeaderIconButton,{componentId:ComponentIds.CardHeaderIconButton});var _CardHeader=function _CardHeader(_ref2){var children=_ref2.children,testID=_ref2.testID,_ref2$marginBottom=_ref2.marginBottom,marginBottom=_ref2$marginBottom===void 0?'spacing.4':_ref2$marginBottom,_ref2$paddingBottom=_ref2.paddingBottom,paddingBottom=_ref2$paddingBottom===void 0?'spacing.4':_ref2$paddingBottom,_ref2$showDivider=_ref2.showDivider,showDivider=_ref2$showDivider===void 0?true:_ref2$showDivider,rest=_objectWithoutProperties(_ref2,_excluded);useVerifyInsideCard('CardHeader');useVerifyAllowedChildren({children:children,componentName:'CardHeader',allowedComponents:[ComponentIds.CardHeaderLeading,ComponentIds.CardHeaderTrailing]});return jsxs(BaseBox,Object.assign({marginBottom:marginBottom},metaAttribute({name:MetaConstants.CardHeader,testID:testID}),makeAnalyticsAttribute(rest),{children:[jsx(BaseBox,{paddingBottom:paddingBottom,display:"flex",flexDirection:"row",justifyContent:"space-between",children:children}),showDivider?jsx(Divider,{}):null]}));};var CardHeader=assignWithoutSideEffects(_CardHeader,{componentId:ComponentIds.CardHeader});var CardHeaderSuffixComponents=[ComponentIds.CardHeaderCounter,ComponentIds.CardHeaderLink];var _CardHeaderLeading=function _CardHeaderLeading(_ref3){var title=_ref3.title,subtitle=_ref3.subtitle,prefix=_ref3.prefix,suffix=_ref3.suffix,rest=_objectWithoutProperties(_ref3,_excluded2);useVerifyInsideCard('CardHeaderLeading');var _useContext=useContext(CardContext),size=_useContext.size;if(__DEV__){if(prefix&&!isValidAllowedChildren(prefix,ComponentIds.CardHeaderIcon)){throwBladeError({message:`Only \`${ComponentIds.CardHeaderIcon}\` component is accepted in prefix`,moduleName:'CardHeaderLeading'});}}var isSuffixACardComponent=CardHeaderSuffixComponents.includes(getComponentId(suffix));return jsx(BaseBox,Object.assign({},makeAnalyticsAttribute(rest),{display:"flex",flexDirection:"column",gap:"spacing.4",children:jsxs(BaseBox,{flex:1,display:"flex",flexDirection:"row",children:[prefix&&jsx(BaseBox,{marginRight:"spacing.3",alignSelf:"center",display:"flex",children:prefix}),jsxs(BaseBox,{marginRight:"spacing.5",children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"center",flexWrap:"wrap",children:[jsx(Text,{color:"surface.text.gray.normal",size:size,weight:"semibold",children:title}),suffix&&isSuffixACardComponent?jsx(BaseBox,{marginLeft:"spacing.3",children:suffix}):suffix]}),subtitle&&jsx(Text,{color:"surface.text.gray.subtle",textAlign:"left",size:"small",children:subtitle})]})]})}));};var CardHeaderLeading=assignWithoutSideEffects(_CardHeaderLeading,{componentId:ComponentIds.CardHeaderLeading});var _CardHeaderTrailing=function _CardHeaderTrailing(_ref4){var visual=_ref4.visual;useVerifyInsideCard('CardHeaderTrailing');return jsx(BaseBox,{alignSelf:"center",children:visual});};var CardHeaderTrailing=assignWithoutSideEffects(_CardHeaderTrailing,{componentId:ComponentIds.CardHeaderTrailing});
28
28
 
29
29
  export { CardHeader, CardHeaderAmount, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing };
30
30
  //# sourceMappingURL=CardHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardHeader.js","sources":["../../../../../src/components/Card/CardHeader.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport { useVerifyInsideCard } from './CardContext';\nimport { ComponentIds } from './Card';\nimport type { CardSpacingValueType } from './types';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport type { LinkProps } from '~components/Link';\nimport { Link } from '~components/Link';\nimport type { ButtonProps } from '~components/Button';\nimport { Button } from '~components/Button';\nimport { Counter } from '~components/Counter';\nimport type { CounterProps } from '~components/Counter';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { TextProps, TextVariant } from '~components/Typography';\nimport { Text } from '~components/Typography';\nimport type { IconComponent } from '~components/Icons';\nimport { minHeight } from '~components/Button/BaseButton/buttonTokens';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSpace } from '~utils/makeSpace';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { AmountProps } from '~components/Amount';\nimport { Amount } from '~components/Amount';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _CardHeaderIcon = ({ icon: Icon }: { icon: IconComponent }): React.ReactElement => {\n useVerifyInsideCard('CardHeaderIcon');\n\n return <Icon color=\"surface.icon.gray.normal\" size=\"large\" />;\n};\nconst CardHeaderIcon = assignWithoutSideEffects(_CardHeaderIcon, {\n componentId: ComponentIds.CardHeaderIcon,\n});\n\nconst _CardHeaderCounter = (props: CounterProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderCounter');\n\n return <Counter {...props} />;\n};\nconst CardHeaderCounter = assignWithoutSideEffects(_CardHeaderCounter, {\n componentId: ComponentIds.CardHeaderCounter,\n});\n\nconst _CardHeaderBadge = (props: BadgeProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderBadge');\n\n return <Badge {...props} />;\n};\nconst CardHeaderBadge = assignWithoutSideEffects(_CardHeaderBadge, {\n componentId: ComponentIds.CardHeaderBadge,\n});\n\nconst _CardHeaderAmount = (props: AmountProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderAmount');\n\n return <Amount {...props} />;\n};\n\nconst CardHeaderAmount = assignWithoutSideEffects(_CardHeaderAmount, {\n componentId: ComponentIds.CardHeaderAmount,\n});\n\nconst _CardHeaderText = (props: TextProps<{ variant: TextVariant }>): React.ReactElement => {\n useVerifyInsideCard('CardHeaderText');\n\n return <Text textAlign=\"left\" {...props} />;\n};\nconst CardHeaderText = assignWithoutSideEffects(_CardHeaderText, {\n componentId: ComponentIds.CardHeaderText,\n});\n\nconst _CardHeaderLink = (props: LinkProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderLink');\n\n return <Link {...props} />;\n};\nconst CardHeaderLink = assignWithoutSideEffects(_CardHeaderLink, {\n componentId: ComponentIds.CardHeaderLink,\n});\n\ntype CardHeaderIconButtonProps = Omit<\n ButtonProps,\n 'variant' | 'size' | 'iconPosition' | 'isFullWidth' | 'children'\n> & {\n icon: IconComponent;\n};\n\nconst _CardHeaderIconButton = (props: CardHeaderIconButtonProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderIconButton');\n\n return (\n <BaseBox width={makeSpace(minHeight.xsmall)}>\n <Button {...props} variant=\"tertiary\" size=\"xsmall\" iconPosition=\"left\" isFullWidth />\n </BaseBox>\n );\n};\nconst CardHeaderIconButton = assignWithoutSideEffects(_CardHeaderIconButton, {\n componentId: ComponentIds.CardHeaderIconButton,\n});\n\ntype CardHeaderProps = {\n children?: React.ReactNode;\n /**\n * For spacing between divider and header title\n */\n paddingBottom?: CardSpacingValueType;\n /**\n * For spacing between body content and divider\n */\n marginBottom?: CardSpacingValueType;\n /**\n * @default true\n */\n showDivider?: boolean;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardHeader = ({\n children,\n testID,\n marginBottom = 'spacing.4',\n paddingBottom = 'spacing.4',\n showDivider = true,\n ...rest\n}: CardHeaderProps): React.ReactElement => {\n useVerifyInsideCard('CardHeader');\n useVerifyAllowedChildren({\n children,\n componentName: 'CardHeader',\n allowedComponents: [ComponentIds.CardHeaderLeading, ComponentIds.CardHeaderTrailing],\n });\n\n return (\n <BaseBox\n marginBottom={marginBottom}\n {...metaAttribute({ name: MetaConstants.CardHeader, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox\n paddingBottom={paddingBottom}\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent=\"space-between\"\n >\n {children}\n </BaseBox>\n {showDivider ? <Divider /> : null}\n </BaseBox>\n );\n};\nconst CardHeader = assignWithoutSideEffects(_CardHeader, { componentId: ComponentIds.CardHeader });\n\ntype CardHeaderLeadingProps = {\n title: string;\n subtitle?: string;\n /**\n * prefix element of Card\n *\n * Accepts: `CardHeaderIcon` component\n */\n prefix?: React.ReactNode;\n /**\n * suffix element of Card\n *\n * Accepts: `CardHeaderCounter` component\n */\n suffix?: React.ReactNode;\n} & DataAnalyticsAttribute;\nconst _CardHeaderLeading = ({\n title,\n subtitle,\n prefix,\n suffix,\n ...rest\n}: CardHeaderLeadingProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderLeading');\n\n if (__DEV__) {\n if (prefix && !isValidAllowedChildren(prefix, ComponentIds.CardHeaderIcon)) {\n throwBladeError({\n message: `Only \\`${ComponentIds.CardHeaderIcon}\\` component is accepted in prefix`,\n moduleName: 'CardHeaderLeading',\n });\n }\n\n if (suffix && !isValidAllowedChildren(suffix, ComponentIds.CardHeaderCounter)) {\n throwBladeError({\n message: `Only \\`${ComponentIds.CardHeaderCounter}\\` component is accepted in prefix`,\n moduleName: 'CardHeaderLeading',\n });\n }\n }\n\n return (\n <BaseBox {...makeAnalyticsAttribute(rest)} flex={1} display=\"flex\" flexDirection=\"row\">\n <BaseBox marginRight=\"spacing.3\" alignSelf=\"center\" display=\"flex\">\n {prefix}\n </BaseBox>\n <BaseBox marginRight=\"spacing.5\">\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"center\" flexWrap=\"wrap\">\n <Text color=\"surface.text.gray.normal\" size=\"large\" weight=\"semibold\">\n {title}\n </Text>\n <BaseBox marginLeft=\"spacing.3\">{suffix}</BaseBox>\n </BaseBox>\n {subtitle && (\n <Text color=\"surface.text.gray.subtle\" textAlign=\"left\" size=\"small\">\n {subtitle}\n </Text>\n )}\n </BaseBox>\n </BaseBox>\n );\n};\nconst CardHeaderLeading = assignWithoutSideEffects(_CardHeaderLeading, {\n componentId: ComponentIds.CardHeaderLeading,\n});\n\ntype CardHeaderTrailingProps = {\n /**\n * Renders a visual ornament in card header trailing section\n *\n * Accepts: `CardHeaderLink`, `CardHeaderText`, `CardHeaderIconButton`, `CardHeaderBadge`\n */\n visual?: React.ReactNode;\n};\n\nconst headerTrailingAllowedComponents = [\n ComponentIds.CardHeaderLink,\n ComponentIds.CardHeaderText,\n ComponentIds.CardHeaderIconButton,\n ComponentIds.CardHeaderBadge,\n ComponentIds.CardHeaderAmount,\n];\n\nconst _CardHeaderTrailing = ({ visual }: CardHeaderTrailingProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderTrailing');\n\n if (__DEV__) {\n if (visual && !headerTrailingAllowedComponents.includes(getComponentId(visual)!)) {\n throwBladeError({\n message: `Only one of \\`${headerTrailingAllowedComponents.join(\n ', ',\n )}\\` component is accepted in visual`,\n moduleName: 'CardHeaderTrailing',\n });\n }\n }\n\n return <BaseBox alignSelf=\"center\">{visual}</BaseBox>;\n};\nconst CardHeaderTrailing = assignWithoutSideEffects(_CardHeaderTrailing, {\n componentId: ComponentIds.CardHeaderTrailing,\n});\n\nexport {\n CardHeader,\n CardHeaderLeading,\n CardHeaderTrailing,\n CardHeaderBadge,\n CardHeaderIcon,\n CardHeaderCounter,\n CardHeaderText,\n CardHeaderLink,\n CardHeaderAmount,\n CardHeaderIconButton,\n};\n"],"names":["_CardHeaderIcon","_ref","Icon","icon","useVerifyInsideCard","_jsx","color","size","CardHeaderIcon","assignWithoutSideEffects","componentId","ComponentIds","_CardHeaderCounter","props","Counter","Object","assign","CardHeaderCounter","_CardHeaderBadge","Badge","CardHeaderBadge","_CardHeaderAmount","Amount","CardHeaderAmount","_CardHeaderText","Text","textAlign","CardHeaderText","_CardHeaderLink","Link","CardHeaderLink","_CardHeaderIconButton","BaseBox","width","makeSpace","minHeight","xsmall","children","Button","variant","iconPosition","isFullWidth","CardHeaderIconButton","_CardHeader","_ref2","testID","_ref2$marginBottom","marginBottom","_ref2$paddingBottom","paddingBottom","_ref2$showDivider","showDivider","rest","_objectWithoutProperties","_excluded","useVerifyAllowedChildren","componentName","allowedComponents","CardHeaderLeading","CardHeaderTrailing","_jsxs","metaAttribute","name","MetaConstants","CardHeader","makeAnalyticsAttribute","display","flexDirection","justifyContent","Divider","_CardHeaderLeading","_ref3","title","subtitle","prefix","suffix","_excluded2","__DEV__","isValidAllowedChildren","throwBladeError","message","moduleName","flex","marginRight","alignSelf","alignItems","flexWrap","weight","marginLeft","headerTrailingAllowedComponents","_CardHeaderTrailing","_ref4","visual","includes","getComponentId","join"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,QAAA,CAAA,cAAA,CAAA,eAAA,CAAA,aAAA,CAAA,CAAA,UAAA,CAAA,CAAA,OAAA,CAAA,UAAA,CAAA,QAAA,CAAA,QAAA,CAAA,CA6BA,IAAMA,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CAAoE,CAAxD,IAAAC,IAAI,CAAAD,IAAA,CAAVE,IAAI,CAC7BC,mBAAmB,CAAC,gBAAgB,CAAC,CAErC,OAAOC,GAAA,CAACH,IAAI,CAAA,CAACI,KAAK,CAAC,0BAA0B,CAACC,IAAI,CAAC,OAAO,CAAE,CAAC,CAC/D,CAAC,CACK,IAAAC,cAAc,CAAGC,wBAAwB,CAACT,eAAe,CAAE,CAC/DU,WAAW,CAAEC,YAAY,CAACH,cAC5B,CAAC,EAED,IAAMI,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAIC,KAAmB,CAAyB,CACtET,mBAAmB,CAAC,mBAAmB,CAAC,CAExC,OAAOC,GAAA,CAACS,OAAO,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CAAKH,KAAK,CAAG,CAAC,CAC/B,CAAC,CACK,IAAAI,iBAAiB,CAAGR,wBAAwB,CAACG,kBAAkB,CAAE,CACrEF,WAAW,CAAEC,YAAY,CAACM,iBAC5B,CAAC,EA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slint-disable @typescript-eslint/no-explicit-any */\nimport React, { useContext } from 'react';\nimport { useVerifyInsideCard, CardContext } from './CardContext';\nimport { ComponentIds } from './Card';\nimport type { CardSpacingValueType } from './types';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport type { LinkProps } from '~components/Link';\nimport { Link } from '~components/Link';\nimport type { ButtonProps } from '~components/Button';\nimport { Button } from '~components/Button';\nimport { Counter } from '~components/Counter';\nimport type { CounterProps } from '~components/Counter';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { TextProps, TextVariant } from '~components/Typography';\nimport { Text } from '~components/Typography';\nimport type { IconComponent } from '~components/Icons';\nimport { minHeight } from '~components/Button/BaseButton/buttonTokens';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSpace } from '~utils/makeSpace';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { AmountProps } from '~components/Amount';\nimport { Amount } from '~components/Amount';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _CardHeaderIcon = ({ icon: Icon }: { icon: IconComponent }): React.ReactElement => {\n useVerifyInsideCard('CardHeaderIcon');\n\n return <Icon color=\"surface.icon.gray.normal\" size=\"large\" />;\n};\nconst CardHeaderIcon = assignWithoutSideEffects(_CardHeaderIcon, {\n componentId: ComponentIds.CardHeaderIcon,\n});\n\nconst _CardHeaderCounter = (props: CounterProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderCounter');\n\n return <Counter {...props} />;\n};\nconst CardHeaderCounter = assignWithoutSideEffects(_CardHeaderCounter, {\n componentId: ComponentIds.CardHeaderCounter,\n});\n\nconst _CardHeaderBadge = (props: BadgeProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderBadge');\n\n return <Badge {...props} />;\n};\nconst CardHeaderBadge = assignWithoutSideEffects(_CardHeaderBadge, {\n componentId: ComponentIds.CardHeaderBadge,\n});\n\nconst _CardHeaderAmount = (props: AmountProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderAmount');\n\n return <Amount {...props} />;\n};\n\nconst CardHeaderAmount = assignWithoutSideEffects(_CardHeaderAmount, {\n componentId: ComponentIds.CardHeaderAmount,\n});\n\nconst _CardHeaderText = (props: TextProps<{ variant: TextVariant }>): React.ReactElement => {\n useVerifyInsideCard('CardHeaderText');\n\n return <Text textAlign=\"left\" {...props} />;\n};\nconst CardHeaderText = assignWithoutSideEffects(_CardHeaderText, {\n componentId: ComponentIds.CardHeaderText,\n});\n\nconst _CardHeaderLink = (props: LinkProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderLink');\n\n return <Link {...props} />;\n};\nconst CardHeaderLink = assignWithoutSideEffects(_CardHeaderLink, {\n componentId: ComponentIds.CardHeaderLink,\n});\n\ntype CardHeaderIconButtonProps = Omit<\n ButtonProps,\n 'variant' | 'size' | 'iconPosition' | 'isFullWidth' | 'children'\n> & {\n icon: IconComponent;\n};\n\nconst _CardHeaderIconButton = (props: CardHeaderIconButtonProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderIconButton');\n\n return (\n <BaseBox width={makeSpace(minHeight.xsmall)}>\n <Button {...props} variant=\"tertiary\" size=\"xsmall\" iconPosition=\"left\" isFullWidth />\n </BaseBox>\n );\n};\nconst CardHeaderIconButton = assignWithoutSideEffects(_CardHeaderIconButton, {\n componentId: ComponentIds.CardHeaderIconButton,\n});\n\ntype CardHeaderProps = {\n children?: React.ReactNode;\n /**\n * For spacing between divider and header title\n */\n paddingBottom?: CardSpacingValueType;\n /**\n * For spacing between body content and divider\n */\n marginBottom?: CardSpacingValueType;\n /**\n * @default true\n */\n showDivider?: boolean;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _CardHeader = ({\n children,\n testID,\n marginBottom = 'spacing.4',\n paddingBottom = 'spacing.4',\n showDivider = true,\n ...rest\n}: CardHeaderProps): React.ReactElement => {\n useVerifyInsideCard('CardHeader');\n useVerifyAllowedChildren({\n children,\n componentName: 'CardHeader',\n allowedComponents: [ComponentIds.CardHeaderLeading, ComponentIds.CardHeaderTrailing],\n });\n\n return (\n <BaseBox\n marginBottom={marginBottom}\n {...metaAttribute({ name: MetaConstants.CardHeader, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox\n paddingBottom={paddingBottom}\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent=\"space-between\"\n >\n {children}\n </BaseBox>\n {showDivider ? <Divider /> : null}\n </BaseBox>\n );\n};\nconst CardHeader = assignWithoutSideEffects(_CardHeader, { componentId: ComponentIds.CardHeader });\n\nconst CardHeaderSuffixComponents = [ComponentIds.CardHeaderCounter, ComponentIds.CardHeaderLink];\ntype CardHeaderLeadingProps = {\n title: string;\n subtitle?: string;\n /**\n * prefix element of Card\n *\n * Accepts: `CardHeaderIcon` component\n */\n prefix?: React.ReactNode;\n /**\n * suffix element of Card\n *\n * it add marginLeft to `CardHeaderCounter`,`CardHeaderLink` components by default.\n */\n suffix?: React.ReactNode;\n} & DataAnalyticsAttribute;\nconst _CardHeaderLeading = ({\n title,\n subtitle,\n prefix,\n suffix,\n ...rest\n}: CardHeaderLeadingProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderLeading');\n const { size } = useContext(CardContext);\n\n if (__DEV__) {\n if (prefix && !isValidAllowedChildren(prefix, ComponentIds.CardHeaderIcon)) {\n throwBladeError({\n message: `Only \\`${ComponentIds.CardHeaderIcon}\\` component is accepted in prefix`,\n moduleName: 'CardHeaderLeading',\n });\n }\n }\n\n const isSuffixACardComponent = CardHeaderSuffixComponents.includes(getComponentId(suffix)!);\n\n return (\n <BaseBox\n {...makeAnalyticsAttribute(rest)}\n display=\"flex\"\n flexDirection=\"column\"\n gap=\"spacing.4\"\n >\n <BaseBox flex={1} display=\"flex\" flexDirection=\"row\">\n {prefix && (\n <BaseBox marginRight=\"spacing.3\" alignSelf=\"center\" display=\"flex\">\n {prefix}\n </BaseBox>\n )}\n\n <BaseBox marginRight=\"spacing.5\">\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"center\" flexWrap=\"wrap\">\n <Text color=\"surface.text.gray.normal\" size={size} weight=\"semibold\">\n {title}\n </Text>\n {/* if we are using CardHeaderSuffixComponents we still need marginLeft for spacing ,\n but if it's not a CardHeaderSuffixComponents we don't need marginLeft for example in case of tooltip */}\n {suffix && isSuffixACardComponent ? (\n <BaseBox marginLeft=\"spacing.3\">{suffix}</BaseBox>\n ) : (\n suffix\n )}\n </BaseBox>\n {subtitle && (\n <Text color=\"surface.text.gray.subtle\" textAlign=\"left\" size=\"small\">\n {subtitle}\n </Text>\n )}\n </BaseBox>\n </BaseBox>\n </BaseBox>\n );\n};\nconst CardHeaderLeading = assignWithoutSideEffects(_CardHeaderLeading, {\n componentId: ComponentIds.CardHeaderLeading,\n});\n\ntype CardHeaderTrailingProps = {\n /**\n * Renders a visual ornament in card header trailing section\n *\n */\n visual?: React.ReactNode;\n};\n\nconst _CardHeaderTrailing = ({ visual }: CardHeaderTrailingProps): React.ReactElement => {\n useVerifyInsideCard('CardHeaderTrailing');\n\n return <BaseBox alignSelf=\"center\">{visual}</BaseBox>;\n};\nconst CardHeaderTrailing = assignWithoutSideEffects(_CardHeaderTrailing, {\n componentId: ComponentIds.CardHeaderTrailing,\n});\n\nexport {\n CardHeader,\n CardHeaderLeading,\n CardHeaderTrailing,\n CardHeaderBadge,\n CardHeaderIcon,\n CardHeaderCounter,\n CardHeaderText,\n CardHeaderLink,\n CardHeaderAmount,\n CardHeaderIconButton,\n};\n"],"names":["_CardHeaderIcon","_ref","Icon","icon","useVerifyInsideCard","_jsx","color","size","CardHeaderIcon","assignWithoutSideEffects","componentId","ComponentIds","_CardHeaderCounter","props","Counter","Object","assign","CardHeaderCounter","_CardHeaderBadge","Badge","CardHeaderBadge","_CardHeaderAmount","Amount","CardHeaderAmount","_CardHeaderText","Text","textAlign","CardHeaderText","_CardHeaderLink","Link","CardHeaderLink","_CardHeaderIconButton","BaseBox","width","makeSpace","minHeight","xsmall","children","Button","variant","iconPosition","isFullWidth","CardHeaderIconButton","_CardHeader","_ref2","testID","_ref2$marginBottom","marginBottom","_ref2$paddingBottom","paddingBottom","_ref2$showDivider","showDivider","rest","_objectWithoutProperties","_excluded","useVerifyAllowedChildren","componentName","allowedComponents","CardHeaderLeading","CardHeaderTrailing","_jsxs","metaAttribute","name","MetaConstants","CardHeader","makeAnalyticsAttribute","display","flexDirection","justifyContent","Divider","CardHeaderSuffixComponents","_CardHeaderLeading","_ref3","title","subtitle","prefix","suffix","_excluded2","_useContext","useContext","CardContext","__DEV__","isValidAllowedChildren","throwBladeError","message","moduleName","isSuffixACardComponent","includes","getComponentId","gap","flex","marginRight","alignSelf","alignItems","flexWrap","weight","marginLeft","_CardHeaderTrailing","_ref4","visual"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,QAAA,CAAA,cAAA,CAAA,eAAA,CAAA,aAAA,CAAA,CAAA,UAAA,CAAA,CAAA,OAAA,CAAA,UAAA,CAAA,QAAA,CAAA,QAAA,CAAA,CA6BA,IAAMA,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CAAoE,CAAA,IAAxDC,IAAI,CAAAD,IAAA,CAAVE,IAAI,CAC7BC,mBAAmB,CAAC,gBAAgB,CAAC,CAErC,OAAOC,GAAA,CAACH,IAAI,CAACI,CAAAA,KAAK,CAAC,0BAA0B,CAACC,IAAI,CAAC,OAAO,CAAE,CAAC,CAC/D,CAAC,CACK,IAAAC,cAAc,CAAGC,wBAAwB,CAACT,eAAe,CAAE,CAC/DU,WAAW,CAAEC,YAAY,CAACH,cAC5B,CAAC,EAED,IAAMI,kBAAkB,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