@razorpay/blade 11.6.3 → 11.8.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 (118) hide show
  1. package/build/lib/native/components/Accordion/Accordion.js +2 -2
  2. package/build/lib/native/components/Accordion/Accordion.js.map +1 -1
  3. package/build/lib/native/components/Accordion/AccordionButton.native.js +2 -2
  4. package/build/lib/native/components/Accordion/AccordionButton.native.js.map +1 -1
  5. package/build/lib/native/components/Accordion/AccordionContext.js +2 -2
  6. package/build/lib/native/components/Accordion/AccordionContext.js.map +1 -1
  7. package/build/lib/native/components/Accordion/AccordionItem.js +11 -14
  8. package/build/lib/native/components/Accordion/AccordionItem.js.map +1 -1
  9. package/build/lib/native/components/Accordion/AccordionItemBody.js +24 -0
  10. package/build/lib/native/components/Accordion/AccordionItemBody.js.map +1 -0
  11. package/build/lib/native/components/Accordion/AccordionItemHeader.js +24 -0
  12. package/build/lib/native/components/Accordion/AccordionItemHeader.js.map +1 -0
  13. package/build/lib/native/components/Accordion/commonStyles.js +1 -1
  14. package/build/lib/native/components/Accordion/commonStyles.js.map +1 -1
  15. package/build/lib/native/components/Accordion/componentIds.js +4 -0
  16. package/build/lib/native/components/Accordion/componentIds.js.map +1 -0
  17. package/build/lib/native/components/ActionList/ActionListBox.native.js +1 -4
  18. package/build/lib/native/components/ActionList/ActionListBox.native.js.map +1 -1
  19. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +1 -1
  20. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  21. package/build/lib/native/components/Button/BaseButton/AnimatedButtonContent.native.js +16 -0
  22. package/build/lib/native/components/Button/BaseButton/AnimatedButtonContent.native.js.map +1 -0
  23. package/build/lib/native/components/Button/BaseButton/BaseButton.js +7 -5
  24. package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
  25. package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js +1 -1
  26. package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js.map +1 -1
  27. package/build/lib/native/components/ButtonGroup/ButtonGroup.native.js +7 -0
  28. package/build/lib/native/components/ButtonGroup/ButtonGroup.native.js.map +1 -0
  29. package/build/lib/native/components/ButtonGroup/ButtonGroupContext.js +6 -0
  30. package/build/lib/native/components/ButtonGroup/ButtonGroupContext.js.map +1 -0
  31. package/build/lib/native/components/Collapsible/CollapsibleBodyContent.native.js.map +1 -1
  32. package/build/lib/native/components/index.js +3 -0
  33. package/build/lib/native/components/index.js.map +1 -1
  34. package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
  35. package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
  36. package/build/lib/web/development/components/Accordion/Accordion.js +57 -6
  37. package/build/lib/web/development/components/Accordion/Accordion.js.map +1 -1
  38. package/build/lib/web/development/components/Accordion/AccordionButton.web.js +21 -25
  39. package/build/lib/web/development/components/Accordion/AccordionButton.web.js.map +1 -1
  40. package/build/lib/web/development/components/Accordion/AccordionContext.js +16 -1
  41. package/build/lib/web/development/components/Accordion/AccordionContext.js.map +1 -1
  42. package/build/lib/web/development/components/Accordion/AccordionItem.js +66 -66
  43. package/build/lib/web/development/components/Accordion/AccordionItem.js.map +1 -1
  44. package/build/lib/web/development/components/Accordion/AccordionItemBody.js +84 -0
  45. package/build/lib/web/development/components/Accordion/AccordionItemBody.js.map +1 -0
  46. package/build/lib/web/development/components/Accordion/AccordionItemHeader.js +71 -0
  47. package/build/lib/web/development/components/Accordion/AccordionItemHeader.js.map +1 -0
  48. package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js +3 -2
  49. package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js.map +1 -1
  50. package/build/lib/web/development/components/Accordion/commonStyles.js +8 -6
  51. package/build/lib/web/development/components/Accordion/commonStyles.js.map +1 -1
  52. package/build/lib/web/development/components/Accordion/componentIds.js +8 -0
  53. package/build/lib/web/development/components/Accordion/componentIds.js.map +1 -0
  54. package/build/lib/web/development/components/Accordion/index.js +2 -0
  55. package/build/lib/web/development/components/Accordion/index.js.map +1 -1
  56. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +131 -68
  57. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  58. package/build/lib/web/development/components/Button/BaseButton/AnimatedButtonContent.web.js +18 -0
  59. package/build/lib/web/development/components/Button/BaseButton/AnimatedButtonContent.web.js.map +1 -0
  60. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +116 -66
  61. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
  62. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js +158 -0
  63. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js.map +1 -0
  64. package/build/lib/web/development/components/ButtonGroup/ButtonGroupContext.js +11 -0
  65. package/build/lib/web/development/components/ButtonGroup/ButtonGroupContext.js.map +1 -0
  66. package/build/lib/web/development/components/ButtonGroup/StyledButtonGroup.js +47 -0
  67. package/build/lib/web/development/components/ButtonGroup/StyledButtonGroup.js.map +1 -0
  68. package/build/lib/web/development/components/ButtonGroup/index.js +2 -0
  69. package/build/lib/web/development/components/ButtonGroup/index.js.map +1 -0
  70. package/build/lib/web/development/components/Collapsible/CollapsibleBodyContent.web.js +3 -1
  71. package/build/lib/web/development/components/Collapsible/CollapsibleBodyContent.web.js.map +1 -1
  72. package/build/lib/web/development/components/index.js +4 -0
  73. package/build/lib/web/development/components/index.js.map +1 -1
  74. package/build/lib/web/development/utils/metaAttribute/metaConstants.js +3 -0
  75. package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
  76. package/build/lib/web/production/components/Accordion/Accordion.js +57 -6
  77. package/build/lib/web/production/components/Accordion/Accordion.js.map +1 -1
  78. package/build/lib/web/production/components/Accordion/AccordionButton.web.js +21 -25
  79. package/build/lib/web/production/components/Accordion/AccordionButton.web.js.map +1 -1
  80. package/build/lib/web/production/components/Accordion/AccordionContext.js +16 -1
  81. package/build/lib/web/production/components/Accordion/AccordionContext.js.map +1 -1
  82. package/build/lib/web/production/components/Accordion/AccordionItem.js +66 -66
  83. package/build/lib/web/production/components/Accordion/AccordionItem.js.map +1 -1
  84. package/build/lib/web/production/components/Accordion/AccordionItemBody.js +84 -0
  85. package/build/lib/web/production/components/Accordion/AccordionItemBody.js.map +1 -0
  86. package/build/lib/web/production/components/Accordion/AccordionItemHeader.js +71 -0
  87. package/build/lib/web/production/components/Accordion/AccordionItemHeader.js.map +1 -0
  88. package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js +3 -2
  89. package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js.map +1 -1
  90. package/build/lib/web/production/components/Accordion/commonStyles.js +8 -6
  91. package/build/lib/web/production/components/Accordion/commonStyles.js.map +1 -1
  92. package/build/lib/web/production/components/Accordion/componentIds.js +8 -0
  93. package/build/lib/web/production/components/Accordion/componentIds.js.map +1 -0
  94. package/build/lib/web/production/components/Accordion/index.js +2 -0
  95. package/build/lib/web/production/components/Accordion/index.js.map +1 -1
  96. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +131 -68
  97. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  98. package/build/lib/web/production/components/Button/BaseButton/AnimatedButtonContent.web.js +18 -0
  99. package/build/lib/web/production/components/Button/BaseButton/AnimatedButtonContent.web.js.map +1 -0
  100. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +116 -66
  101. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
  102. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js +158 -0
  103. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js.map +1 -0
  104. package/build/lib/web/production/components/ButtonGroup/ButtonGroupContext.js +11 -0
  105. package/build/lib/web/production/components/ButtonGroup/ButtonGroupContext.js.map +1 -0
  106. package/build/lib/web/production/components/ButtonGroup/StyledButtonGroup.js +47 -0
  107. package/build/lib/web/production/components/ButtonGroup/StyledButtonGroup.js.map +1 -0
  108. package/build/lib/web/production/components/ButtonGroup/index.js +2 -0
  109. package/build/lib/web/production/components/ButtonGroup/index.js.map +1 -0
  110. package/build/lib/web/production/components/Collapsible/CollapsibleBodyContent.web.js +3 -1
  111. package/build/lib/web/production/components/Collapsible/CollapsibleBodyContent.web.js.map +1 -1
  112. package/build/lib/web/production/components/index.js +4 -0
  113. package/build/lib/web/production/components/index.js.map +1 -1
  114. package/build/lib/web/production/utils/metaAttribute/metaConstants.js +3 -0
  115. package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
  116. package/build/types/components/index.d.ts +1120 -965
  117. package/build/types/components/index.native.d.ts +1091 -962
  118. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"BaseHeader.js","sources":["../../../../../src/components/BaseHeaderFooter/BaseHeader.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { ReactDOMAttributes } from '@use-gesture/react/dist/declarations/src/types';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { IconButton } from '~components/Button/IconButton';\nimport { ChevronLeftIcon, CloseIcon } from '~components/Icons';\nimport type { TestID } from '~utils/types';\nimport type { BoxProps } from '~components/Box';\nimport { Box } from '~components/Box';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { isReactNative, makeSize } from '~utils';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\nimport { size } from '~tokens/global';\n\ntype BaseHeaderProps = {\n title?: string;\n subtitle?: string;\n /**\n * Leading part of the header placed at the left most side of the header\n */\n leading?: React.ReactNode;\n /**\n * Trailing part of the header placed at the right most side of the header\n */\n trailing?: React.ReactNode;\n /**\n * Placed adjacent to the title text\n */\n titleSuffix?: React.ReactNode;\n /**\n * @default true\n */\n showDivider?: boolean;\n /**\n * @default false\n */\n showBackButton?: boolean;\n /**\n * @default true\n */\n showCloseButton?: boolean;\n onCloseButtonClick?: () => void;\n onBackButtonClick?: () => void;\n closeButtonRef?: React.MutableRefObject<any>;\n backButtonRef?: React.MutableRefObject<any>;\n metaComponentName?: string;\n /**\n * inner child of BottomSheetHeader. Meant to be used for AutoComplete only\n */\n children?: React.ReactElement;\n} & Pick<\n ReactDOMAttributes,\n | 'onClickCapture'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onLostPointerCapture'\n | 'onPointerCancel'\n | 'onPointerDown'\n | 'onPointerMove'\n | 'onPointerUp'\n> &\n TestID;\n\ntype TrailingComponents = 'Button' | 'Badge' | 'Link' | 'Text' | 'Amount';\n\nconst centerBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n // We want to align title, icon, titleSuffix, trailing, closeButton to baseline\n // But we also want to keep them center aligned to each other\n // So we add a virtual Box around these slots with 28px and center align them to that box\n // We have done similar thing in figma as well (which is where this 28px comes from)\n height: '28px',\n};\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'medium',\n },\n Link: {\n size: 'medium',\n },\n Text: {\n size: 'medium',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'medium',\n },\n} as const;\n\nconst useTrailingRestriction = (trailing: React.ReactNode): React.ReactNode => {\n const [\n validatedTrailingComponent,\n setValidatedTrailingComponent,\n ] = React.useState<React.ReactElement | null>(null);\n\n // validate and restrict sub component props in trailing prop\n React.useEffect(() => {\n if (React.isValidElement(trailing)) {\n const trailingComponentType = getComponentId(trailing) as TrailingComponents;\n const restrictedProps = propRestrictionMap[trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap);\n if (__DEV__) {\n if (!restrictedProps) {\n throwBladeError({\n message: `Only one of \\`${allowedComponents.join(\n ', ',\n )}\\` component is accepted as trailing`,\n moduleName: 'Header',\n });\n }\n }\n\n const restrictedPropKeys = Object.keys(propRestrictionMap[trailingComponentType]);\n for (const prop of restrictedPropKeys) {\n if (trailing?.props?.hasOwnProperty(prop)) {\n logger({\n message: `Do not pass \"${prop}\" to \"${trailingComponentType}\" while inside Header trailing, because we override it.`,\n moduleName: 'Header',\n type: 'warn',\n });\n }\n }\n setValidatedTrailingComponent(\n React.cloneElement(trailing as React.ReactElement, restrictedProps),\n );\n }\n }, [trailing]);\n\n return validatedTrailingComponent;\n};\n\nconst _BaseHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n showDivider = true,\n showBackButton = false,\n showCloseButton = true,\n onBackButtonClick,\n onCloseButtonClick,\n closeButtonRef,\n backButtonRef,\n testID,\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n metaComponentName,\n children,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction(trailing);\n const shouldWrapTitle = titleSuffix && trailing && showBackButton && showCloseButton;\n\n const webOnlyEventHandlers: Record<string, any> = isReactNative()\n ? {}\n : {\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n };\n\n return (\n <BaseBox {...metaAttribute({ name: metaComponentName, testID })}>\n <BaseBox\n marginY={{ base: 'spacing.5', m: 'spacing.6' }}\n paddingX={{ base: 'spacing.5', m: 'spacing.6' }}\n touchAction=\"none\"\n {...webOnlyEventHandlers}\n >\n <BaseBox display=\"flex\" flexDirection=\"row\" userSelect=\"none\">\n {showBackButton ? (\n <BaseBox overflow=\"visible\" marginRight=\"spacing.5\">\n <Box {...centerBoxProps}>\n <IconButton\n ref={backButtonRef}\n size=\"large\"\n icon={ChevronLeftIcon}\n onClick={() => onBackButtonClick?.()}\n accessibilityLabel=\"Back\"\n />\n </Box>\n </BaseBox>\n ) : null}\n <BaseBox\n paddingRight=\"spacing.5\"\n marginRight=\"auto\"\n flex=\"auto\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"flex-start\"\n >\n {leading ? (\n <BaseBox marginRight=\"spacing.3\" {...centerBoxProps}>\n {leading}\n </BaseBox>\n ) : null}\n <BaseBox flex=\"auto\">\n <BaseBox\n // Explicitly setting maxWidth in React Native because text is not being wrapped properly when multiple fix width components are rendered in header\n // In web, flex containers seem to work a expected\n // @todo: resolve this if we figure out some better solution later\n maxWidth={isReactNative() && shouldWrapTitle ? '100px' : undefined}\n flexShrink={0}\n display=\"flex\"\n flexDirection=\"row\"\n >\n {title ? (\n <Text\n size=\"large\"\n marginTop={makeSize(size['1'])}\n weight=\"semibold\"\n color=\"surface.text.gray.normal\"\n >\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text variant=\"body\" size=\"small\" weight=\"regular\" color=\"surface.text.gray.muted\">\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n </BaseBox>\n {children}\n </BaseBox>\n {showDivider ? <Divider /> : null}\n </BaseBox>\n );\n};\n\nconst BaseHeader = assignWithoutSideEffects(_BaseHeader, {\n componentId: 'BaseHeader',\n});\n\nexport type { BaseHeaderProps };\nexport { BaseHeader };\n"],"names":["centerBoxProps","display","alignItems","justifyContent","height","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","trailing","_React$useState","React","useState","_React$useState2","_slicedToArray","validatedTrailingComponent","setValidatedTrailingComponent","useEffect","isValidElement","trailingComponentType","getComponentId","restrictedProps","allowedComponents","Object","keys","__DEV__","throwBladeError","message","join","moduleName","restrictedPropKeys","prop","_trailing$props","props","hasOwnProperty","logger","cloneElement","_BaseHeader","_ref","title","subtitle","leading","titleSuffix","_ref$showDivider","showDivider","_ref$showBackButton","showBackButton","_ref$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","children","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","assign","metaAttribute","name","marginY","base","m","paddingX","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","undefined","flexShrink","marginTop","makeSize","weight","color","marginLeft","CloseIcon","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,IAAMA,cAAwB,CAAG,CAC/BC,OAAO,CAAE,MAAM,CACfC,UAAU,CAAE,QAAQ,CACpBC,cAAc,CAAE,QAAQ,CAKxBC,MAAM,CAAE,MACV,CAAC,CAGD,IAAMC,kBAAkB,CAAG,CACzBC,MAAM,CAAE,CACNC,IAAI,CAAE,QAAQ,CACdC,OAAO,CAAE,UACX,CAAC,CACDC,KAAK,CAAE,CACLF,IAAI,CAAE,QACR,CAAC,CACDG,IAAI,CAAE,CACJH,IAAI,CAAE,QACR,CAAC,CACDI,IAAI,CAAE,CACJJ,IAAI,CAAE,QAAQ,CACdC,OAAO,CAAE,MACX,CAAC,CACDI,MAAM,CAAE,CACNC,IAAI,CAAE,MAAM,CACZN,IAAI,CAAE,QACR,CACF,CAAU,CAEV,IAAMO,sBAAsB,CAAG,SAAzBA,sBAAsBA,CAAIC,QAAyB,CA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AAAA,CAAAA,kBAAkB,EAAI,CAAC,CAAA,CACvC,CAAC,CAAA,CACC,CAAC,CACJ,IAAI,CAAA,CACD,CAAC,CACTa,QAAQ,CACF,CAAA,CAAA,CAAC,CACTnB,WAAW,CAAGmC,GAAA,CAACqB,OAAO,CAAE,EAAA,CAAC,CAAG,IAAI,CAC1B,CAAA,CAAA,CAAC,CAEd,CAAC,CAEK,IAAAC,UAAU,CAAGC,wBAAwB,CAACjE,WAAW,CAAE,CACvDkE,WAAW,CAAE,YACf,CAAC;;;;"}
1
+ {"version":3,"file":"BaseHeader.js","sources":["../../../../../src/components/BaseHeaderFooter/BaseHeader.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { ReactDOMAttributes } from '@use-gesture/react/dist/declarations/src/types';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { IconButton } from '~components/Button/IconButton';\nimport { ChevronLeftIcon, CloseIcon } from '~components/Icons';\nimport type { TestID } from '~utils/types';\nimport type { BoxProps } from '~components/Box';\nimport { Box } from '~components/Box';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { isReactNative, makeSize } from '~utils';\nimport { metaAttribute } from '~utils/metaAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\nimport { size as sizeToken } from '~tokens/global';\n\ntype BaseHeaderProps = {\n title?: string;\n subtitle?: string;\n /**\n * Leading part of the header placed at the left most side of the header\n */\n leading?: React.ReactNode;\n /**\n * Trailing part of the header placed at the right most side of the header\n */\n trailing?: React.ReactNode;\n /**\n * Placed adjacent to the title text\n */\n titleSuffix?: React.ReactNode;\n /**\n * @default true\n */\n showDivider?: boolean;\n /**\n * @default false\n */\n showBackButton?: boolean;\n\n /**\n * Slot for rendering any trailing interaction element into BaseHeader.\n *\n * E.g. Used in accordion to render CollapsibleChevronIcon\n */\n trailingInteractionElement?: React.ReactNode;\n\n /**\n * Decides size of the Header\n */\n size?: 'large' | 'medium';\n /**\n * @default true\n */\n showCloseButton?: boolean;\n\n /**\n * Disabled state of BaseHeader\n *\n * @default false\n */\n isDisabled?: boolean;\n\n paddingX?: BoxProps['paddingX'];\n marginY?: BoxProps['marginY'];\n onCloseButtonClick?: () => void;\n onBackButtonClick?: () => void;\n closeButtonRef?: React.MutableRefObject<any>;\n backButtonRef?: React.MutableRefObject<any>;\n metaComponentName?: string;\n /**\n * inner child of BottomSheetHeader. Meant to be used for AutoComplete only\n */\n children?: React.ReactElement | React.ReactElement[];\n} & Pick<\n ReactDOMAttributes,\n | 'onClickCapture'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onLostPointerCapture'\n | 'onPointerCancel'\n | 'onPointerDown'\n | 'onPointerMove'\n | 'onPointerUp'\n> &\n TestID;\n\ntype TrailingComponents = 'Button' | 'Badge' | 'Link' | 'Text' | 'Amount';\n\nconst commonCenterBoxProps: BoxProps = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n};\n\nconst centerBoxProps: { large: BoxProps; medium: BoxProps } = {\n large: {\n ...commonCenterBoxProps,\n // We want to align title, icon, titleSuffix, trailing, closeButton to baseline\n // But we also want to keep them center aligned to each other\n // So we add a virtual Box around these slots with 28px and center align them to that box\n // We have done similar thing in figma as well (which is where this 28px comes from)\n height: '28px',\n },\n medium: {\n ...commonCenterBoxProps,\n height: '20px',\n },\n};\n\nconst sizeTokensMapping = {\n large: {\n title: 'large',\n },\n medium: {\n title: 'medium',\n },\n} as const;\n\n// prop restriction map for corresponding sub components\nconst propRestrictionMap = {\n large: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'medium',\n },\n Link: {\n size: 'medium',\n },\n Text: {\n size: 'medium',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'medium',\n },\n },\n medium: {\n Button: {\n size: 'xsmall',\n variant: 'tertiary',\n },\n Badge: {\n size: 'small',\n },\n Link: {\n size: 'small',\n },\n Text: {\n size: 'small',\n variant: 'body',\n },\n Amount: {\n type: 'body',\n size: 'small',\n },\n },\n} as const;\n\nconst useTrailingRestriction = ({\n trailing,\n size,\n}: {\n size: NonNullable<BaseHeaderProps['size']>;\n trailing: BaseHeaderProps['trailing'];\n}): React.ReactNode => {\n const [\n validatedTrailingComponent,\n setValidatedTrailingComponent,\n ] = React.useState<React.ReactElement | null>(null);\n\n // validate and restrict sub component props in trailing prop\n React.useEffect(() => {\n if (React.isValidElement(trailing)) {\n const trailingComponentType = getComponentId(trailing) as TrailingComponents;\n const restrictedProps = propRestrictionMap[size][trailingComponentType];\n const allowedComponents = Object.keys(propRestrictionMap[size]);\n if (__DEV__) {\n if (!restrictedProps) {\n throwBladeError({\n message: `Only one of \\`${allowedComponents.join(\n ', ',\n )}\\` component is accepted as trailing`,\n moduleName: 'Header',\n });\n }\n }\n\n const restrictedPropKeys = Object.keys(propRestrictionMap[size][trailingComponentType]);\n for (const prop of restrictedPropKeys) {\n if (trailing?.props?.hasOwnProperty(prop)) {\n logger({\n message: `Do not pass \"${prop}\" to \"${trailingComponentType}\" while inside Header trailing, because we override it.`,\n moduleName: 'Header',\n type: 'warn',\n });\n }\n }\n setValidatedTrailingComponent(\n React.cloneElement(trailing as React.ReactElement, restrictedProps),\n );\n }\n }, [trailing, size]);\n\n return validatedTrailingComponent;\n};\n\nconst _BaseHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n showDivider = true,\n showBackButton = false,\n showCloseButton = true,\n onBackButtonClick,\n onCloseButtonClick,\n closeButtonRef,\n backButtonRef,\n testID,\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n metaComponentName,\n paddingX,\n marginY,\n size = 'large',\n isDisabled,\n children,\n trailingInteractionElement,\n}: BaseHeaderProps): React.ReactElement => {\n const validatedTrailingComponent = useTrailingRestriction({ trailing, size });\n const shouldWrapTitle = titleSuffix && trailing && showBackButton && showCloseButton;\n\n const webOnlyEventHandlers: Record<string, any> = isReactNative()\n ? {}\n : {\n onClickCapture,\n onKeyDown,\n onKeyUp,\n onLostPointerCapture,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n };\n\n return (\n <BaseBox {...metaAttribute({ name: metaComponentName, testID })}>\n <BaseBox\n marginY={marginY ?? { base: 'spacing.5', m: 'spacing.6' }}\n paddingX={paddingX ?? { base: 'spacing.5', m: 'spacing.6' }}\n touchAction=\"none\"\n {...webOnlyEventHandlers}\n >\n <BaseBox display=\"flex\" flexDirection=\"row\" userSelect=\"none\">\n {showBackButton ? (\n <BaseBox overflow=\"visible\" marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={backButtonRef}\n size=\"large\"\n icon={ChevronLeftIcon}\n onClick={() => onBackButtonClick?.()}\n accessibilityLabel=\"Back\"\n />\n </Box>\n </BaseBox>\n ) : null}\n <BaseBox\n paddingRight=\"spacing.5\"\n marginRight=\"auto\"\n flex=\"auto\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"flex-start\"\n >\n {leading ? (\n <BaseBox marginRight=\"spacing.3\" {...centerBoxProps[size]}>\n {leading}\n </BaseBox>\n ) : null}\n <BaseBox flex=\"auto\">\n <BaseBox\n // Explicitly setting maxWidth in React Native because text is not being wrapped properly when multiple fix width components are rendered in header\n // In web, flex containers seem to work a expected\n // @todo: resolve this if we figure out some better solution later\n maxWidth={isReactNative() && shouldWrapTitle ? '100px' : undefined}\n flexShrink={0}\n display=\"flex\"\n flexDirection=\"row\"\n >\n {title ? (\n <Text\n size={sizeTokensMapping[size].title}\n marginTop={makeSize(sizeToken['1'])}\n weight=\"semibold\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.normal'}\n >\n {title}\n </Text>\n ) : null}\n {titleSuffix && (\n <BaseBox marginLeft=\"spacing.3\">\n <Box {...centerBoxProps[size]}>{titleSuffix}</Box>\n </BaseBox>\n )}\n </BaseBox>\n {subtitle ? (\n <Text\n variant=\"body\"\n size=\"small\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.muted'}\n >\n {subtitle}\n </Text>\n ) : null}\n </BaseBox>\n </BaseBox>\n {validatedTrailingComponent ? (\n <BaseBox marginRight=\"spacing.5\">\n <Box {...centerBoxProps[size]}>{validatedTrailingComponent}</Box>\n </BaseBox>\n ) : null}\n {showCloseButton ? (\n <Box {...centerBoxProps[size]}>\n <IconButton\n ref={closeButtonRef}\n size=\"large\"\n icon={CloseIcon}\n accessibilityLabel=\"Close\"\n onClick={() => onCloseButtonClick?.()}\n />\n </Box>\n ) : null}\n {trailingInteractionElement && !children ? (\n <Box {...centerBoxProps[size]}>{trailingInteractionElement}</Box>\n ) : null}\n </BaseBox>\n <BaseBox\n display=\"flex\"\n width=\"100%\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n >\n <Box>{children}</Box>\n {trailingInteractionElement && children ? (\n <Box alignSelf=\"flex-start\" {...centerBoxProps[size]}>\n {trailingInteractionElement}\n </Box>\n ) : null}\n </BaseBox>\n </BaseBox>\n {showDivider ? <Divider /> : null}\n </BaseBox>\n );\n};\n\nconst BaseHeader = assignWithoutSideEffects(_BaseHeader, {\n componentId: 'BaseHeader',\n});\n\nexport type { BaseHeaderProps };\nexport { BaseHeader };\n"],"names":["commonCenterBoxProps","display","alignItems","justifyContent","centerBoxProps","large","Object","assign","height","medium","sizeTokensMapping","title","propRestrictionMap","Button","size","variant","Badge","Link","Text","Amount","type","useTrailingRestriction","_ref","trailing","_React$useState","React","useState","_React$useState2","_slicedToArray","validatedTrailingComponent","setValidatedTrailingComponent","useEffect","isValidElement","trailingComponentType","getComponentId","restrictedProps","allowedComponents","keys","__DEV__","throwBladeError","message","join","moduleName","restrictedPropKeys","prop","_trailing$props","props","hasOwnProperty","logger","cloneElement","_BaseHeader","_ref2","subtitle","leading","titleSuffix","_ref2$showDivider","showDivider","_ref2$showBackButton","showBackButton","_ref2$showCloseButton","showCloseButton","onBackButtonClick","onCloseButtonClick","closeButtonRef","backButtonRef","testID","onClickCapture","onKeyDown","onKeyUp","onLostPointerCapture","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","metaComponentName","paddingX","marginY","_ref2$size","isDisabled","children","trailingInteractionElement","shouldWrapTitle","webOnlyEventHandlers","isReactNative","_jsxs","BaseBox","metaAttribute","name","base","m","touchAction","flexDirection","userSelect","_jsx","overflow","marginRight","Box","IconButton","ref","icon","ChevronLeftIcon","onClick","accessibilityLabel","paddingRight","flex","maxWidth","undefined","flexShrink","marginTop","makeSize","sizeToken","weight","color","marginLeft","CloseIcon","width","alignSelf","Divider","BaseHeader","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,IAAMA,oBAA8B,CAAG,CACrCC,OAAO,CAAE,MAAM,CACfC,UAAU,CAAE,QAAQ,CACpBC,cAAc,CAAE,QAClB,CAAC,CAED,IAAMC,cAAqD,CAAG,CAC5DC,KAAK,CAAAC,MAAA,CAAAC,MAAA,CACAP,EAAAA,CAAAA,oBAAoB,EAKvBQ,MAAM,CAAE,MAAM,CAAA,CACf,CACDC,MAAM,CAAAH,MAAA,CAAAC,MAAA,IACDP,oBAAoB,CAAA,CACvBQ,MAAM,CAAE,MAAM,CAElB,CAAA,CAAC,CAED,IAAME,iBAAiB,CAAG,CACxBL,KAAK,CAAE,CACLM,KAAK,CAAE,OACT,CAAC,CACDF,MAAM,CAAE,CACNE,KAAK,CAAE,QACT,CACF,CAAU,CAGV,IAAMC,kBAAkB,CAAG,CACzBP,KAAK,CAAE,CACLQ,MAAM,CAAE,CACNC,IAAI,CAAE,QAAQ,CACdC,OAAO,CAAE,UACX,CAAC,CACDC,KAAK,CAAE,CACLF,IAAI,CAAE,QACR,CAAC,CACDG,IAAI,CAAE,CACJH,IAAI,CAAE,QACR,CAAC,CAC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,0BAA0B,EAAI,CAACD,QAAQ,CACtCc,GAAA,CAACG,GAAG,CAAA1F,MAAA,CAAAC,MAAA,IAAKH,cAAc,CAACU,MAAI,CAAC,CAAA,CAAAiE,QAAA,CAAGC,0BAA0B,CAAM,CAAA,CAAC,CAC/D,IAAI,CAAA,CACD,CAAC,CACVI,IAAA,CAACC,OAAO,CAAA,CACNpF,OAAO,CAAC,MAAM,CACdkH,KAAK,CAAC,MAAM,CACZxB,aAAa,CAAC,KAAK,CACnBzF,UAAU,CAAC,QAAQ,CACnBC,cAAc,CAAC,eAAe,CAAA4E,QAAA,CAE9Bc,CAAAA,GAAA,CAACG,GAAG,CAAA,CAAAjB,QAAA,CAAEA,QAAQ,CAAM,CAAC,CACpBC,0BAA0B,EAAID,QAAQ,CACrCc,GAAA,CAACG,GAAG,CAAA1F,MAAA,CAAAC,MAAA,CAAC6G,CAAAA,SAAS,CAAC,YAAY,CAAA,CAAKhH,cAAc,CAACU,MAAI,CAAC,CAAAiE,CAAAA,QAAA,CACjDC,0BAA0B,EACxB,CAAC,CACJ,IAAI,CAAA,CACD,CAAC,CACH,CAAA,CAAA,CAAC,CACTxB,WAAW,CAAGqC,GAAA,CAACwB,OAAO,CAAE,EAAA,CAAC,CAAG,IAAI,CAAA,CAAA,CAC1B,CAAC,CAEd,CAAC,CAEK,IAAAC,UAAU,CAAGC,wBAAwB,CAACrE,WAAW,CAAE,CACvDsE,WAAW,CAAE,YACf,CAAC;;;;"}
@@ -0,0 +1,16 @@
1
+ import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';
2
+ import 'react';
3
+ import getIn from '../../../utils/lodashButBetter/get.js';
4
+ import 'styled-components/native';
5
+ import '@gorhom/portal';
6
+ import 'react-native-gesture-handler';
7
+ import useTheme from '../../BladeProvider/useTheme.js';
8
+ import 'react-native';
9
+ import '@babel/runtime/helpers/slicedToArray';
10
+ import '../../BottomSheet/BottomSheetStack.js';
11
+ import { jsx } from 'react/jsx-runtime';
12
+
13
+ var AnimatedButtonContent=function AnimatedButtonContent(_ref){var motionDuration=_ref.motionDuration,motionEasing=_ref.motionEasing,children=_ref.children,isPressed=_ref.isPressed;var _useTheme=useTheme(),theme=_useTheme.theme;var duration=getIn(theme.motion,motionDuration);var easing=getIn(theme.motion,motionEasing);var animatedStyles=useAnimatedStyle(function(){return {transform:[{scale:withTiming(isPressed?0.95:1,{duration:duration,easing:easing})}]};},[isPressed]);return jsx(Animated.View,{style:animatedStyles,children:children});};
14
+
15
+ export { AnimatedButtonContent as default };
16
+ //# sourceMappingURL=AnimatedButtonContent.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimatedButtonContent.native.js","sources":["../../../../../../src/components/Button/BaseButton/AnimatedButtonContent.native.tsx"],"sourcesContent":["import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';\nimport React from 'react';\nimport type { TextInput } from 'react-native';\nimport type { AnimatedButtonContentProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useTheme } from '~components/BladeProvider';\n\nconst AnimatedButtonContent: React.ForwardRefRenderFunction<\n TextInput,\n AnimatedButtonContentProps\n> = ({ motionDuration, motionEasing, children, isPressed }) => {\n const { theme } = useTheme();\n const duration = getIn(theme.motion, motionDuration);\n const easing = getIn(theme.motion, motionEasing);\n\n const animatedStyles = useAnimatedStyle(() => {\n return {\n transform: [\n {\n scale: withTiming(isPressed ? 0.95 : 1, {\n duration,\n easing,\n }),\n },\n ],\n };\n }, [isPressed]);\n\n return <Animated.View style={animatedStyles}>{children}</Animated.View>;\n};\n\nexport default AnimatedButtonContent;\n"],"names":["AnimatedButtonContent","_ref","motionDuration","motionEasing","children","isPressed","_useTheme","useTheme","theme","duration","getIn","motion","easing","animatedStyles","useAnimatedStyle","transform","scale","withTiming","_jsx","Animated","View","style"],"mappings":";;;;;;;;;;;;AAOM,IAAAA,qBAGL,CAAG,SAHEA,qBAGLA,CAAAC,IAAA,CAA8D,CAAA,IAAxDC,cAAc,CAAAD,IAAA,CAAdC,cAAc,CAAEC,YAAY,CAAAF,IAAA,CAAZE,YAAY,CAAEC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CAAEC,SAAS,CAAAJ,IAAA,CAATI,SAAS,CACtD,IAAAC,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CACb,IAAMC,QAAQ,CAAGC,KAAK,CAACF,KAAK,CAACG,MAAM,CAAET,cAAc,CAAC,CACpD,IAAMU,MAAM,CAAGF,KAAK,CAACF,KAAK,CAACG,MAAM,CAAER,YAAY,CAAC,CAEhD,IAAMU,cAAc,CAAGC,gBAAgB,CAAC,UAAM,CAC5C,OAAO,CACLC,SAAS,CAAE,CACT,CACEC,KAAK,CAAEC,UAAU,CAACZ,SAAS,CAAG,IAAI,CAAG,CAAC,CAAE,CACtCI,QAAQ,CAARA,QAAQ,CACRG,MAAM,CAANA,MACF,CAAC,CACH,CAAC,CAEL,CAAC,CACH,CAAC,CAAE,CAACP,SAAS,CAAC,CAAC,CAEf,OAAOa,GAAA,CAACC,QAAQ,CAACC,IAAI,EAACC,KAAK,CAAER,cAAe,CAAAT,QAAA,CAAEA,QAAQ,CAAgB,CAAC,CACzE;;;;"}
@@ -1,11 +1,12 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
1
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
3
  import React__default from 'react';
3
4
  import styled from 'styled-components/native';
4
5
  import StyledBaseButton from './StyledBaseButton.native.js';
5
- import { buttonIconOnlySizeToIconSizeMap, buttonSizeToIconSizeMap, buttonSizeToSpinnerSizeMap, minHeight, buttonIconPadding, buttonIconOnlyPadding, buttonPadding, typography, backgroundColor, textColor } from './buttonTokens.js';
6
+ import { typography, buttonIconOnlySizeToIconSizeMap, buttonSizeToIconSizeMap, buttonSizeToSpinnerSizeMap, minHeight, buttonIconPadding, buttonIconOnlyPadding, buttonPadding, backgroundColor, textColor } from './buttonTokens.js';
7
+ import AnimatedButtonContent from './AnimatedButtonContent.native.js';
6
8
  import getIn from '../../../utils/lodashButBetter/get.js';
7
9
  import 'react-native';
8
- import '@babel/runtime/helpers/slicedToArray';
9
10
  import { throwBladeError } from '../../../utils/logger/logger.js';
10
11
  import { isReactNative } from '../../../utils/platform/isReactNative.js';
11
12
  import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js';
@@ -13,6 +14,7 @@ import { makeSpace } from '../../../utils/makeSpace/makeSpace.js';
13
14
  import { makeSize } from '../../../utils/makeSize/makeSize.js';
14
15
  import { usePrevious } from '../../../utils/usePrevious/usePrevious.js';
15
16
  import useTheme from '../../BladeProvider/useTheme.js';
17
+ import { useButtonGroupContext } from '../../ButtonGroup/ButtonGroupContext.js';
16
18
  import { getStyledProps } from '../../Box/styledProps/getStyledProps.js';
17
19
  import '../../../tokens/global/typography.js';
18
20
  import '../../../tokens/global/motion.js';
@@ -20,7 +22,7 @@ import { BaseText } from '../../Typography/BaseText/BaseText.native.js';
20
22
  import '@gorhom/portal';
21
23
  import 'react-native-gesture-handler';
22
24
  import '../../BottomSheet/BottomSheetStack.js';
23
- import { jsxs, jsx } from 'react/jsx-runtime';
25
+ import { jsx, jsxs } from 'react/jsx-runtime';
24
26
  import { announce } from '../../LiveAnnouncer/LiveAnnouncer.native.js';
25
27
  import { BaseSpinner } from '../../Spinner/BaseSpinner/BaseSpinner.js';
26
28
  import { BaseBox } from '../../Box/BaseBox/BaseBox.native.js';
@@ -30,7 +32,7 @@ import { metaAttribute } from '../../../utils/metaAttribute/metaAttribute.native
30
32
  import { MetaConstants } from '../../../utils/metaAttribute/metaConstants.js';
31
33
  import { getStringFromReactText } from '../../../utils/getStringChildren/getStringChildren.js';
32
34
 
33
- var _excluded=["href","target","rel","variant","color","size","icon","iconPosition","isDisabled","isFullWidth","isLoading","onClick","onBlur","onKeyDown","type","children","testID","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","accessibilityProps","onTouchEnd","onTouchStart"];var getRenderElement=function getRenderElement(href){if(isReactNative()){return undefined;}if(href){return 'a';}return 'button';};var getBackgroundColorToken=function getBackgroundColorToken(_ref){var property=_ref.property,variant=_ref.variant,state=_ref.state,color=_ref.color;var _state=state==='focus'||state==='hover'?'highlighted':state;var tokens=backgroundColor(property);if(color==='white'){return tokens.white[variant][_state];}if(color&&color!=='primary'){if(variant==='tertiary'){throw new Error(`Tertiary variant can only be used with color: "primary" or "white" but received "${color}"`);}return tokens.color(color)[variant][_state];}return tokens.base[variant][_state];};var getTextColorToken=function getTextColorToken(_ref2){var property=_ref2.property,variant=_ref2.variant,state=_ref2.state,color=_ref2.color;var tokens=textColor(property);var _state=state==='focus'||state==='hover'?'highlighted':state;if(color==='white'){return tokens.white[variant][_state];}if(color&&color!=='primary'){if(variant==='tertiary'){throw new Error(`Tertiary variant can only be used with color: "primary" or "white" but received "${color}"`);}return tokens.color(color)[variant][_state];}return tokens.base[variant][_state];};var getProps=function getProps(_ref3){var buttonTypographyTokens=_ref3.buttonTypographyTokens,children=_ref3.children,isDisabled=_ref3.isDisabled,size=_ref3.size,theme=_ref3.theme,variant=_ref3.variant,color=_ref3.color,hasIcon=_ref3.hasIcon;if(variant==='tertiary'&&color!=='primary'&&color!=='white'){throwBladeError({moduleName:'BaseButton',message:`Tertiary variant can only be used with color: "default" or "white" but received "${color}"`});}var isIconOnly=hasIcon&&(!children||(children==null?void 0:children.trim().length)===0);var props={iconSize:isIconOnly?buttonIconOnlySizeToIconSizeMap[size]:buttonSizeToIconSizeMap[size],spinnerSize:buttonSizeToSpinnerSizeMap[size],fontSize:buttonTypographyTokens.fonts.size[size],lineHeight:buttonTypographyTokens.lineHeights[size],minHeight:makeSize(minHeight[size]),iconPadding:hasIcon&&children!=null&&children.trim()?`spacing.${buttonIconPadding[size]}`:undefined,iconColor:getTextColorToken({property:'icon',variant:variant,color:color,state:'default'}),textColor:getTextColorToken({property:'text',variant:variant,color:color,state:'default'}),buttonPaddingTop:isIconOnly?makeSpace(theme.spacing[buttonIconOnlyPadding[size].top]):makeSpace(theme.spacing[buttonPadding[size].top]),buttonPaddingBottom:isIconOnly?makeSpace(theme.spacing[buttonIconOnlyPadding[size].bottom]):makeSpace(theme.spacing[buttonPadding[size].bottom]),buttonPaddingLeft:isIconOnly?makeSpace(theme.spacing[buttonIconOnlyPadding[size].left]):makeSpace(theme.spacing[buttonPadding[size].left]),buttonPaddingRight:isIconOnly?makeSpace(theme.spacing[buttonIconOnlyPadding[size].right]):makeSpace(theme.spacing[buttonPadding[size].right]),text:size==='xsmall'?children==null?void 0:children.trim().toUpperCase():children==null?void 0:children.trim(),defaultBackgroundColor:getIn(theme.colors,getBackgroundColorToken({property:'background',variant:variant,color:color,state:'default'})),defaultBorderColor:getIn(theme.colors,getBackgroundColorToken({property:'border',variant:variant,color:color,state:'default'})),hoverBackgroundColor:getIn(theme.colors,getBackgroundColorToken({property:'background',variant:variant,color:color,state:'hover'})),hoverBorderColor:getIn(theme.colors,getBackgroundColorToken({property:'border',variant:variant,color:color,state:'hover'})),focusBackgroundColor:getIn(theme.colors,getBackgroundColorToken({property:'background',variant:variant,color:color,state:'focus'})),focusBorderColor:getIn(theme.colors,getBackgroundColorToken({property:'border',variant:variant,color:color,state:'focus'})),focusRingColor:getIn(theme.colors,'surface.border.primary.muted'),borderWidth:variant=='secondary'?makeBorderSize(theme.border.width.thin):'0px',borderRadius:makeBorderSize(theme.border.radius.medium),motionDuration:'duration.xquick',motionEasing:'easing.standard.effective'};if(isDisabled){var disabledBackgroundColor=getIn(theme.colors,getBackgroundColorToken({property:'background',variant:variant,color:color,state:'disabled'}));var disabledBorderColor=getIn(theme.colors,getBackgroundColorToken({property:'border',variant:variant,color:color,state:'disabled'}));props.iconColor=getTextColorToken({property:'icon',variant:variant,color:color,state:'disabled'});props.textColor=getTextColorToken({property:'text',variant:variant,color:color,state:'disabled'});props.defaultBackgroundColor=disabledBackgroundColor;props.defaultBorderColor=disabledBorderColor;props.hoverBackgroundColor=disabledBackgroundColor;props.hoverBorderColor=disabledBorderColor;props.focusBackgroundColor=disabledBackgroundColor;props.focusBorderColor=disabledBorderColor;}return props;};var ButtonContent=styled(BaseBox)(function(_ref4){var isHidden=_ref4.isHidden;return {opacity:isHidden?0:1};});var _BaseButton=function _BaseButton(_ref5,ref){var href=_ref5.href,target=_ref5.target,rel=_ref5.rel,_ref5$variant=_ref5.variant,variant=_ref5$variant===void 0?'primary':_ref5$variant,_ref5$color=_ref5.color,color=_ref5$color===void 0?'primary':_ref5$color,_ref5$size=_ref5.size,size=_ref5$size===void 0?'medium':_ref5$size,Icon=_ref5.icon,_ref5$iconPosition=_ref5.iconPosition,iconPosition=_ref5$iconPosition===void 0?'left':_ref5$iconPosition,_ref5$isDisabled=_ref5.isDisabled,isDisabled=_ref5$isDisabled===void 0?false:_ref5$isDisabled,_ref5$isFullWidth=_ref5.isFullWidth,isFullWidth=_ref5$isFullWidth===void 0?false:_ref5$isFullWidth,_ref5$isLoading=_ref5.isLoading,isLoading=_ref5$isLoading===void 0?false:_ref5$isLoading,onClick=_ref5.onClick,onBlur=_ref5.onBlur,onKeyDown=_ref5.onKeyDown,_ref5$type=_ref5.type,type=_ref5$type===void 0?'button':_ref5$type,children=_ref5.children,testID=_ref5.testID,onFocus=_ref5.onFocus,onMouseLeave=_ref5.onMouseLeave,onMouseMove=_ref5.onMouseMove,onPointerDown=_ref5.onPointerDown,onPointerEnter=_ref5.onPointerEnter,accessibilityProps=_ref5.accessibilityProps,onTouchEnd=_ref5.onTouchEnd,onTouchStart=_ref5.onTouchStart,rest=_objectWithoutProperties(_ref5,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var isLink=Boolean(href);var childrenString=getStringFromReactText(children);var disabled=isLoading||isDisabled&&!isLink;if(__DEV__){if(!Icon&&!(childrenString!=null&&childrenString.trim())){throwBladeError({message:'At least one of icon or text is required to render a button.',moduleName:'BaseButton'});}}var prevLoading=usePrevious(isLoading);React__default.useEffect(function(){if(isLoading)announce('Started loading');if(!isLoading&&prevLoading)announce('Stopped loading');},[isLoading,prevLoading]);var _getProps=getProps({buttonTypographyTokens:typography,children:childrenString,isDisabled:disabled,size:size,variant:variant,theme:theme,color:color,hasIcon:Boolean(Icon)}),defaultBorderColor=_getProps.defaultBorderColor,defaultBackgroundColor=_getProps.defaultBackgroundColor,minHeight=_getProps.minHeight,buttonPaddingTop=_getProps.buttonPaddingTop,buttonPaddingBottom=_getProps.buttonPaddingBottom,buttonPaddingLeft=_getProps.buttonPaddingLeft,buttonPaddingRight=_getProps.buttonPaddingRight,focusBorderColor=_getProps.focusBorderColor,focusBackgroundColor=_getProps.focusBackgroundColor,focusRingColor=_getProps.focusRingColor,fontSize=_getProps.fontSize,hoverBorderColor=_getProps.hoverBorderColor,hoverBackgroundColor=_getProps.hoverBackgroundColor,iconColor=_getProps.iconColor,iconSize=_getProps.iconSize,iconPadding=_getProps.iconPadding,spinnerSize=_getProps.spinnerSize,lineHeight=_getProps.lineHeight,text=_getProps.text,textColor=_getProps.textColor,borderWidth=_getProps.borderWidth,borderRadius=_getProps.borderRadius,motionDuration=_getProps.motionDuration,motionEasing=_getProps.motionEasing;var renderElement=React__default.useMemo(function(){return getRenderElement(href);},[href]);var defaultRel=target==='_blank'?'noreferrer noopener':undefined;return jsxs(StyledBaseButton,Object.assign({ref:ref,as:renderElement,href:href,target:target,rel:rel!=null?rel:defaultRel,accessibilityProps:Object.assign({},makeAccessible(Object.assign({role:isLink?'link':'button'},accessibilityProps))),variant:variant,isLoading:isLoading,disabled:disabled,defaultBorderColor:defaultBorderColor,minHeight:minHeight,buttonPaddingTop:buttonPaddingTop,buttonPaddingBottom:buttonPaddingBottom,buttonPaddingLeft:buttonPaddingLeft,buttonPaddingRight:buttonPaddingRight,defaultBackgroundColor:defaultBackgroundColor,focusBorderColor:focusBorderColor,focusBackgroundColor:focusBackgroundColor,focusRingColor:focusRingColor,hoverBorderColor:hoverBorderColor,hoverBackgroundColor:hoverBackgroundColor,isFullWidth:isFullWidth,onClick:onClick,onBlur:onBlur,onFocus:onFocus,onMouseLeave:onMouseLeave,onMouseMove:onMouseMove,onPointerDown:onPointerDown,onPointerEnter:onPointerEnter,onKeyDown:onKeyDown,onTouchStart:onTouchStart,onTouchEnd:onTouchEnd,type:type,borderWidth:borderWidth,borderRadius:borderRadius,motionDuration:motionDuration,motionEasing:motionEasing},metaAttribute({name:MetaConstants.Button,testID:testID}),getStyledProps(rest),{children:[isLoading?jsx(BaseBox,{display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:"0px",left:"0px",bottom:"0px",right:"0px",zIndex:1,children:jsx(BaseSpinner,{accessibilityLabel:"Loading",size:spinnerSize,color:color})}):null,jsxs(ButtonContent,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",flex:1,isHidden:isLoading,zIndex:1,children:[Icon&&iconPosition=='left'?jsx(BaseBox,{paddingRight:iconPadding,display:"flex",justifyContent:"center",alignItems:"center",children:jsx(Icon,{size:iconSize,color:iconColor})}):null,text?jsx(BaseText,{lineHeight:lineHeight,fontSize:fontSize,fontWeight:"medium",textAlign:"center",color:textColor,children:text}):null,Icon&&iconPosition=='right'?jsx(BaseBox,{paddingLeft:iconPadding,display:"flex",justifyContent:"center",alignItems:"center",children:jsx(Icon,{size:iconSize,color:iconColor})}):null]})]}));};var BaseButton=assignWithoutSideEffects(React__default.forwardRef(_BaseButton),{displayName:'BaseButton'});
35
+ var _excluded=["href","target","rel","variant","color","size","icon","iconPosition","isDisabled","isFullWidth","isLoading","onClick","onBlur","onKeyDown","type","children","testID","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","accessibilityProps","onTouchEnd","onTouchStart"];var getRenderElement=function getRenderElement(href){if(isReactNative()){return undefined;}if(href){return 'a';}return 'button';};var getBackgroundColorToken=function getBackgroundColorToken(_ref){var property=_ref.property,variant=_ref.variant,state=_ref.state,color=_ref.color;var _state=state==='focus'||state==='hover'?'highlighted':state;var tokens=backgroundColor(property);if(color==='white'){return tokens.white[variant][_state];}if(color&&color!=='primary'){if(variant==='tertiary'){throw new Error(`Tertiary variant can only be used with color: "primary" or "white" but received "${color}"`);}return tokens.color(color)[variant][_state];}return tokens.base[variant][_state];};var getTextColorToken=function getTextColorToken(_ref2){var property=_ref2.property,variant=_ref2.variant,state=_ref2.state,color=_ref2.color;var tokens=textColor(property);var _state=state==='focus'||state==='hover'?'highlighted':state;if(color==='white'){return tokens.white[variant][_state];}if(color&&color!=='primary'){if(variant==='tertiary'){throw new Error(`Tertiary variant can only be used with color: "primary" or "white" but received "${color}"`);}return tokens.color(color)[variant][_state];}return tokens.base[variant][_state];};var getProps=function getProps(_ref3){var buttonTypographyTokens=_ref3.buttonTypographyTokens,children=_ref3.children,isDisabled=_ref3.isDisabled,size=_ref3.size,theme=_ref3.theme,variant=_ref3.variant,color=_ref3.color,hasIcon=_ref3.hasIcon;if(variant==='tertiary'&&color!=='primary'&&color!=='white'){throwBladeError({moduleName:'BaseButton',message:`Tertiary variant can only be used with color: "primary" or "white" but received "${color}"`});}var isIconOnly=hasIcon&&(!children||(children==null?void 0:children.trim().length)===0);var props={iconSize:isIconOnly?buttonIconOnlySizeToIconSizeMap[size]:buttonSizeToIconSizeMap[size],spinnerSize:buttonSizeToSpinnerSizeMap[size],fontSize:buttonTypographyTokens.fonts.size[size],lineHeight:buttonTypographyTokens.lineHeights[size],minHeight:makeSize(minHeight[size]),iconPadding:hasIcon&&children!=null&&children.trim()?`spacing.${buttonIconPadding[size]}`:undefined,iconColor:getTextColorToken({property:'icon',variant:variant,color:color,state:'default'}),textColor:getTextColorToken({property:'text',variant:variant,color:color,state:'default'}),buttonPaddingTop:isIconOnly?makeSpace(theme.spacing[buttonIconOnlyPadding[size].top]):makeSpace(theme.spacing[buttonPadding[size].top]),buttonPaddingBottom:isIconOnly?makeSpace(theme.spacing[buttonIconOnlyPadding[size].bottom]):makeSpace(theme.spacing[buttonPadding[size].bottom]),buttonPaddingLeft:isIconOnly?makeSpace(theme.spacing[buttonIconOnlyPadding[size].left]):makeSpace(theme.spacing[buttonPadding[size].left]),buttonPaddingRight:isIconOnly?makeSpace(theme.spacing[buttonIconOnlyPadding[size].right]):makeSpace(theme.spacing[buttonPadding[size].right]),text:size==='xsmall'?children==null?void 0:children.trim().toUpperCase():children==null?void 0:children.trim(),defaultBackgroundColor:getIn(theme.colors,getBackgroundColorToken({property:'background',variant:variant,color:color,state:'default'})),defaultBorderColor:getIn(theme.colors,getBackgroundColorToken({property:'border',variant:variant,color:color,state:'default'})),hoverBackgroundColor:getIn(theme.colors,getBackgroundColorToken({property:'background',variant:variant,color:color,state:'hover'})),hoverBorderColor:getIn(theme.colors,getBackgroundColorToken({property:'border',variant:variant,color:color,state:'hover'})),focusBackgroundColor:getIn(theme.colors,getBackgroundColorToken({property:'background',variant:variant,color:color,state:'focus'})),focusBorderColor:getIn(theme.colors,getBackgroundColorToken({property:'border',variant:variant,color:color,state:'focus'})),focusRingColor:getIn(theme.colors,'surface.border.primary.muted'),borderWidth:variant=='secondary'?makeBorderSize(theme.border.width.thin):'0px',borderRadius:makeBorderSize(theme.border.radius.medium),motionDuration:'duration.xquick',motionEasing:'easing.standard.effective'};if(isDisabled){var disabledBackgroundColor=getIn(theme.colors,getBackgroundColorToken({property:'background',variant:variant,color:color,state:'disabled'}));var disabledBorderColor=getIn(theme.colors,getBackgroundColorToken({property:'border',variant:variant,color:color,state:'disabled'}));props.iconColor=getTextColorToken({property:'icon',variant:variant,color:color,state:'disabled'});props.textColor=getTextColorToken({property:'text',variant:variant,color:color,state:'disabled'});props.defaultBackgroundColor=disabledBackgroundColor;props.defaultBorderColor=disabledBorderColor;props.hoverBackgroundColor=disabledBackgroundColor;props.hoverBorderColor=disabledBorderColor;props.focusBackgroundColor=disabledBackgroundColor;props.focusBorderColor=disabledBorderColor;}return props;};var ButtonContent=styled(BaseBox)(function(_ref4){var isHidden=_ref4.isHidden;return {opacity:isHidden?0:1};});var _BaseButton=function _BaseButton(_ref5,ref){var _buttonGroupProps$isD,_buttonGroupProps$siz,_buttonGroupProps$var,_buttonGroupProps$col,_buttonGroupProps$isF;var href=_ref5.href,target=_ref5.target,rel=_ref5.rel,_ref5$variant=_ref5.variant,variant=_ref5$variant===void 0?'primary':_ref5$variant,_ref5$color=_ref5.color,color=_ref5$color===void 0?'primary':_ref5$color,_ref5$size=_ref5.size,size=_ref5$size===void 0?'medium':_ref5$size,Icon=_ref5.icon,_ref5$iconPosition=_ref5.iconPosition,iconPosition=_ref5$iconPosition===void 0?'left':_ref5$iconPosition,_ref5$isDisabled=_ref5.isDisabled,isDisabled=_ref5$isDisabled===void 0?false:_ref5$isDisabled,_ref5$isFullWidth=_ref5.isFullWidth,isFullWidth=_ref5$isFullWidth===void 0?false:_ref5$isFullWidth,_ref5$isLoading=_ref5.isLoading,isLoading=_ref5$isLoading===void 0?false:_ref5$isLoading,onClick=_ref5.onClick,onBlur=_ref5.onBlur,_onKeyDown=_ref5.onKeyDown,_ref5$type=_ref5.type,type=_ref5$type===void 0?'button':_ref5$type,children=_ref5.children,testID=_ref5.testID,onFocus=_ref5.onFocus,onMouseLeave=_ref5.onMouseLeave,onMouseMove=_ref5.onMouseMove,onPointerDown=_ref5.onPointerDown,onPointerEnter=_ref5.onPointerEnter,accessibilityProps=_ref5.accessibilityProps,_onTouchEnd=_ref5.onTouchEnd,_onTouchStart=_ref5.onTouchStart,rest=_objectWithoutProperties(_ref5,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var buttonGroupProps=useButtonGroupContext();var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isPressed=_React$useState2[0],setIsPressed=_React$useState2[1];var isLink=Boolean(href);var childrenString=getStringFromReactText(children);var disabled=(_buttonGroupProps$isD=buttonGroupProps.isDisabled)!=null?_buttonGroupProps$isD:isLoading||isDisabled&&!isLink;if(__DEV__){if(!Icon&&!(childrenString!=null&&childrenString.trim())){throwBladeError({message:'At least one of icon or text is required to render a button.',moduleName:'BaseButton'});}}var prevLoading=usePrevious(isLoading);React__default.useEffect(function(){if(isLoading)announce('Started loading');if(!isLoading&&prevLoading)announce('Stopped loading');},[isLoading,prevLoading]);var _getProps=getProps({buttonTypographyTokens:typography,children:childrenString,isDisabled:disabled,size:(_buttonGroupProps$siz=buttonGroupProps.size)!=null?_buttonGroupProps$siz:size,variant:(_buttonGroupProps$var=buttonGroupProps.variant)!=null?_buttonGroupProps$var:variant,theme:theme,color:(_buttonGroupProps$col=buttonGroupProps.color)!=null?_buttonGroupProps$col:color,hasIcon:Boolean(Icon)}),defaultBorderColor=_getProps.defaultBorderColor,defaultBackgroundColor=_getProps.defaultBackgroundColor,minHeight=_getProps.minHeight,buttonPaddingTop=_getProps.buttonPaddingTop,buttonPaddingBottom=_getProps.buttonPaddingBottom,buttonPaddingLeft=_getProps.buttonPaddingLeft,buttonPaddingRight=_getProps.buttonPaddingRight,focusBorderColor=_getProps.focusBorderColor,focusBackgroundColor=_getProps.focusBackgroundColor,focusRingColor=_getProps.focusRingColor,fontSize=_getProps.fontSize,hoverBorderColor=_getProps.hoverBorderColor,hoverBackgroundColor=_getProps.hoverBackgroundColor,iconColor=_getProps.iconColor,iconSize=_getProps.iconSize,iconPadding=_getProps.iconPadding,spinnerSize=_getProps.spinnerSize,lineHeight=_getProps.lineHeight,text=_getProps.text,textColor=_getProps.textColor,borderWidth=_getProps.borderWidth,borderRadius=_getProps.borderRadius,motionDuration=_getProps.motionDuration,motionEasing=_getProps.motionEasing;var renderElement=React__default.useMemo(function(){return getRenderElement(href);},[href]);var defaultRel=target==='_blank'?'noreferrer noopener':undefined;var handlePointerPressedIn=React__default.useCallback(function(){if(disabled)return;setIsPressed(true);},[disabled]);var handlePointerPressedOut=React__default.useCallback(function(){if(disabled)return;setIsPressed(false);},[disabled]);var handleKeyboardPressedIn=React__default.useCallback(function(e){if(disabled)return;if(e.key===' '||e.key==='Enter'){setIsPressed(true);}},[disabled]);var handleKeyboardPressedOut=React__default.useCallback(function(e){if(disabled)return;if(e.key===' '||e.key==='Enter'){setIsPressed(false);}},[disabled]);return jsx(StyledBaseButton,Object.assign({ref:ref,as:renderElement,href:href,target:target,rel:rel!=null?rel:defaultRel,accessibilityProps:Object.assign({},makeAccessible(Object.assign({role:isLink?'link':'button'},accessibilityProps))),variant:variant,isLoading:isLoading,disabled:disabled,defaultBorderColor:defaultBorderColor,minHeight:minHeight,buttonPaddingTop:buttonPaddingTop,buttonPaddingBottom:buttonPaddingBottom,buttonPaddingLeft:buttonPaddingLeft,buttonPaddingRight:buttonPaddingRight,defaultBackgroundColor:defaultBackgroundColor,focusBorderColor:focusBorderColor,focusBackgroundColor:focusBackgroundColor,focusRingColor:focusRingColor,hoverBorderColor:hoverBorderColor,hoverBackgroundColor:hoverBackgroundColor,isFullWidth:(_buttonGroupProps$isF=buttonGroupProps.isFullWidth)!=null?_buttonGroupProps$isF:isFullWidth,onClick:onClick,onBlur:onBlur,onFocus:onFocus,onMouseLeave:onMouseLeave,onMouseMove:onMouseMove,onPointerDown:onPointerDown,onPointerEnter:onPointerEnter,onKeyDown:function onKeyDown(event){handleKeyboardPressedIn(event);_onKeyDown==null?void 0:_onKeyDown(event);},onTouchStart:function onTouchStart(event){handlePointerPressedIn();_onTouchStart==null?void 0:_onTouchStart(event);},onTouchEnd:function onTouchEnd(event){handlePointerPressedOut();_onTouchEnd==null?void 0:_onTouchEnd(event);},type:type,borderWidth:borderWidth,borderRadius:borderRadius,motionDuration:motionDuration,motionEasing:motionEasing,isPressed:isPressed,onMouseDown:handlePointerPressedIn,onMouseUp:handlePointerPressedOut,onMouseOut:handlePointerPressedOut,onKeyUp:handleKeyboardPressedOut},metaAttribute({name:MetaConstants.Button,testID:testID}),getStyledProps(rest),{children:jsxs(AnimatedButtonContent,{motionDuration:motionDuration,motionEasing:motionEasing,isPressed:isPressed,children:[isLoading?jsx(BaseBox,{display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:"0px",left:"0px",bottom:"0px",right:"0px",zIndex:1,children:jsx(BaseSpinner,{accessibilityLabel:"Loading",size:spinnerSize,color:color})}):null,jsxs(ButtonContent,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",flex:1,isHidden:isLoading,zIndex:1,children:[Icon&&iconPosition=='left'?jsx(BaseBox,{paddingRight:iconPadding,display:"flex",justifyContent:"center",alignItems:"center",children:jsx(Icon,{size:iconSize,color:iconColor})}):null,text?jsx(BaseText,{lineHeight:lineHeight,fontSize:fontSize,fontWeight:"medium",textAlign:"center",color:textColor,children:text}):null,Icon&&iconPosition=='right'?jsx(BaseBox,{paddingLeft:iconPadding,display:"flex",justifyContent:"center",alignItems:"center",children:jsx(Icon,{size:iconSize,color:iconColor})}):null]})]})}));};var BaseButton=assignWithoutSideEffects(React__default.forwardRef(_BaseButton),{displayName:'BaseButton'});
34
36
 
35
- export { BaseButton as default };
37
+ export { BaseButton as default, getBackgroundColorToken };
36
38
  //# sourceMappingURL=BaseButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseButton.js","sources":["../../../../../../src/components/Button/BaseButton/BaseButton.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { GestureResponderEvent } from 'react-native';\nimport StyledBaseButton from './StyledBaseButton';\nimport type { ButtonTypography, ButtonMinHeight } from './buttonTokens';\nimport {\n textColor,\n backgroundColor,\n buttonIconOnlyPadding,\n buttonIconOnlySizeToIconSizeMap,\n typography as buttonTypography,\n minHeight as buttonMinHeight,\n buttonSizeToIconSizeMap,\n buttonSizeToSpinnerSizeMap,\n buttonIconPadding,\n buttonPadding,\n} from './buttonTokens';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { BaseLinkProps } from '~components/Link/BaseLink';\nimport type { Theme } from '~components/BladeProvider';\nimport type { IconComponent, IconProps, IconSize } from '~components/Icons';\nimport type { DurationString, EasingString } from '~tokens/global';\nimport type { BorderRadiusValues, BorderWidthValues, SpacingValues } from '~tokens/theme/theme';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { useTheme } from '~components/BladeProvider';\nimport { announce } from '~components/LiveAnnouncer';\nimport type { BaseSpinnerProps } from '~components/Spinner/BaseSpinner';\nimport { BaseSpinner } from '~components/Spinner/BaseSpinner';\nimport BaseBox from '~components/Box/BaseBox';\nimport type {\n BladeElementRef,\n DotNotationSpacingStringToken,\n StringChildrenType,\n TestID,\n} from '~utils/types';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { usePrevious } from '~utils/usePrevious';\nimport { makeSize } from '~utils/makeSize';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeSpace } from '~utils/makeSpace';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStringFromReactText } from '~src/utils/getStringChildren';\nimport type { BladeCommonEvents } from '~components/types';\nimport { throwBladeError } from '~utils/logger';\n\ntype BaseButtonCommonProps = {\n href?: BaseLinkProps['href'];\n target?: BaseLinkProps['target'];\n rel?: BaseLinkProps['rel'];\n size?: 'xsmall' | 'small' | 'medium' | 'large';\n iconPosition?: 'left' | 'right';\n isDisabled?: boolean;\n isFullWidth?: boolean;\n onKeyDown?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.KeyboardEvent<HTMLButtonElement>) => void;\n }>;\n onClick?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }>;\n type?: 'button' | 'reset' | 'submit';\n isLoading?: boolean;\n accessibilityProps?: Partial<AccessibilityProps>;\n variant?: 'primary' | 'secondary' | 'tertiary';\n color?: 'primary' | 'white' | 'positive' | 'negative' | 'notice' | 'information' | 'neutral';\n} & TestID &\n StyledPropsBlade &\n BladeCommonEvents;\n\n/*\nMandatory children prop when icon is not provided\n*/\ntype BaseButtonWithoutIconProps = BaseButtonCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n*/\ntype BaseButtonWithIconProps = BaseButtonCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\n/*\n With or without icon prop. We need at least an icon or a children prop present.\n*/\nexport type BaseButtonProps = BaseButtonWithIconProps | BaseButtonWithoutIconProps;\n\ntype BaseButtonColorTokenModifiers = {\n variant: NonNullable<BaseButtonProps['variant']>;\n state: 'default' | 'hover' | 'focus' | 'disabled';\n color: BaseButtonProps['color'];\n};\n\n/**\n * All possible icon colors, derived from `IconProps` minus `currentColor` because possible values should only be from tokens\n */\ntype IconColor = Exclude<IconProps['color'], 'currentColor'>;\n\nconst getRenderElement = (href?: string): 'a' | 'button' | undefined => {\n if (isReactNative()) {\n return undefined; // as property doesn't work with react native\n }\n\n if (href) {\n return 'a';\n }\n\n return 'button';\n};\n\nconst getBackgroundColorToken = ({\n property,\n variant,\n state,\n color,\n}: BaseButtonColorTokenModifiers & {\n property: 'background' | 'border';\n}): DotNotationToken<Theme['colors']> => {\n const _state = state === 'focus' || state === 'hover' ? 'highlighted' : state;\n const tokens = backgroundColor(property);\n\n if (color === 'white') {\n return tokens.white[variant][_state];\n }\n\n if (color && color !== 'primary') {\n if (variant === 'tertiary') {\n throw new Error(\n `Tertiary variant can only be used with color: \"primary\" or \"white\" but received \"${color}\"`,\n );\n }\n return tokens.color(color)[variant][_state];\n }\n\n return tokens.base[variant][_state];\n};\n\nconst getTextColorToken = ({\n property,\n variant,\n state,\n color,\n}: BaseButtonColorTokenModifiers & {\n property: 'icon' | 'text';\n}): DotNotationToken<Theme['colors']> => {\n const tokens = textColor(property);\n const _state = state === 'focus' || state === 'hover' ? 'highlighted' : state;\n\n if (color === 'white') {\n return tokens.white[variant][_state];\n }\n\n if (color && color !== 'primary') {\n if (variant === 'tertiary') {\n throw new Error(\n `Tertiary variant can only be used with color: \"primary\" or \"white\" but received \"${color}\"`,\n );\n }\n return tokens.color(color)[variant][_state];\n }\n\n return tokens.base[variant][_state];\n};\n\ntype BaseButtonStyleProps = {\n iconSize: IconSize;\n spinnerSize: BaseSpinnerProps['size'];\n fontSize: keyof Theme['typography']['fonts']['size'];\n lineHeight: keyof Theme['typography']['lineHeights'];\n minHeight: `${ButtonMinHeight}px`;\n iconPadding?: DotNotationSpacingStringToken;\n iconColor: IconColor;\n textColor: BaseTextProps['color'];\n buttonPaddingTop: SpacingValues;\n buttonPaddingBottom: SpacingValues;\n buttonPaddingLeft: SpacingValues;\n buttonPaddingRight: SpacingValues;\n text?: string;\n defaultBackgroundColor: string;\n defaultBorderColor: string;\n hoverBackgroundColor: string;\n hoverBorderColor: string;\n focusBackgroundColor: string;\n focusBorderColor: string;\n focusRingColor: string;\n motionDuration: DurationString;\n motionEasing: EasingString;\n borderWidth: BorderWidthValues;\n borderRadius: BorderRadiusValues;\n};\n\nconst getProps = ({\n buttonTypographyTokens,\n children,\n isDisabled,\n size,\n theme,\n variant,\n color,\n hasIcon,\n}: {\n buttonTypographyTokens: ButtonTypography;\n children?: string;\n isDisabled: boolean;\n hasIcon: boolean;\n theme: Theme;\n size: NonNullable<BaseButtonProps['size']>;\n variant: NonNullable<BaseButtonProps['variant']>;\n color: BaseButtonProps['color'];\n}): BaseButtonStyleProps => {\n if (variant === 'tertiary' && color !== 'primary' && color !== 'white') {\n throwBladeError({\n moduleName: 'BaseButton',\n message: `Tertiary variant can only be used with color: \"default\" or \"white\" but received \"${color}\"`,\n });\n }\n\n const isIconOnly = hasIcon && (!children || children?.trim().length === 0);\n const props: BaseButtonStyleProps = {\n iconSize: isIconOnly ? buttonIconOnlySizeToIconSizeMap[size] : buttonSizeToIconSizeMap[size],\n spinnerSize: buttonSizeToSpinnerSizeMap[size],\n fontSize: buttonTypographyTokens.fonts.size[size],\n lineHeight: buttonTypographyTokens.lineHeights[size],\n minHeight: makeSize(buttonMinHeight[size]),\n iconPadding: hasIcon && children?.trim() ? `spacing.${buttonIconPadding[size]}` : undefined,\n iconColor: getTextColorToken({\n property: 'icon',\n variant,\n color,\n state: 'default',\n }) as IconColor,\n textColor: getTextColorToken({\n property: 'text',\n variant,\n color,\n state: 'default',\n }) as BaseTextProps['color'],\n buttonPaddingTop: isIconOnly\n ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].top])\n : makeSpace(theme.spacing[buttonPadding[size].top]),\n buttonPaddingBottom: isIconOnly\n ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].bottom])\n : makeSpace(theme.spacing[buttonPadding[size].bottom]),\n buttonPaddingLeft: isIconOnly\n ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].left])\n : makeSpace(theme.spacing[buttonPadding[size].left]),\n buttonPaddingRight: isIconOnly\n ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].right])\n : makeSpace(theme.spacing[buttonPadding[size].right]),\n text: size === 'xsmall' ? children?.trim().toUpperCase() : children?.trim(),\n defaultBackgroundColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'background', variant, color, state: 'default' }),\n ),\n defaultBorderColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'border', variant, color, state: 'default' }),\n ),\n hoverBackgroundColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'background', variant, color, state: 'hover' }),\n ),\n hoverBorderColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'border', variant, color, state: 'hover' }),\n ),\n focusBackgroundColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'background', variant, color, state: 'focus' }),\n ),\n focusBorderColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'border', variant, color, state: 'focus' }),\n ),\n focusRingColor: getIn(theme.colors, 'surface.border.primary.muted'),\n borderWidth: variant == 'secondary' ? makeBorderSize(theme.border.width.thin) : '0px',\n borderRadius: makeBorderSize(theme.border.radius.medium),\n motionDuration: 'duration.xquick',\n motionEasing: 'easing.standard.effective',\n };\n\n if (isDisabled) {\n const disabledBackgroundColor = getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'background', variant, color, state: 'disabled' }),\n );\n const disabledBorderColor = getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'border', variant, color, state: 'disabled' }),\n );\n props.iconColor = getTextColorToken({\n property: 'icon',\n variant,\n color,\n state: 'disabled',\n }) as IconColor;\n props.textColor = getTextColorToken({\n property: 'text',\n variant,\n color,\n state: 'disabled',\n }) as BaseTextProps['color'];\n props.defaultBackgroundColor = disabledBackgroundColor;\n props.defaultBorderColor = disabledBorderColor;\n props.hoverBackgroundColor = disabledBackgroundColor;\n props.hoverBorderColor = disabledBorderColor;\n props.focusBackgroundColor = disabledBackgroundColor;\n props.focusBorderColor = disabledBorderColor;\n }\n\n return props;\n};\n\nconst ButtonContent = styled(BaseBox)<{ isHidden: boolean }>(({ isHidden }) => ({\n opacity: isHidden ? 0 : 1,\n}));\n\nconst _BaseButton: React.ForwardRefRenderFunction<BladeElementRef, BaseButtonProps> = (\n {\n href,\n target,\n rel,\n variant = 'primary',\n color = 'primary',\n size = 'medium',\n icon: Icon,\n iconPosition = 'left',\n isDisabled = false,\n isFullWidth = false,\n isLoading = false,\n onClick,\n onBlur,\n onKeyDown,\n type = 'button',\n children,\n testID,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n accessibilityProps,\n onTouchEnd,\n onTouchStart,\n ...rest\n },\n ref,\n) => {\n const { theme } = useTheme();\n const isLink = Boolean(href);\n const childrenString = getStringFromReactText(children);\n // Button cannot be disabled when its rendered as Link\n const disabled = isLoading || (isDisabled && !isLink);\n\n if (__DEV__) {\n if (!Icon && !childrenString?.trim()) {\n throwBladeError({\n message: 'At least one of icon or text is required to render a button.',\n moduleName: 'BaseButton',\n });\n }\n }\n\n const prevLoading = usePrevious(isLoading);\n\n React.useEffect(() => {\n if (isLoading) announce('Started loading');\n\n if (!isLoading && prevLoading) announce('Stopped loading');\n }, [isLoading, prevLoading]);\n\n const {\n defaultBorderColor,\n defaultBackgroundColor,\n minHeight,\n buttonPaddingTop,\n buttonPaddingBottom,\n buttonPaddingLeft,\n buttonPaddingRight,\n focusBorderColor,\n focusBackgroundColor,\n focusRingColor,\n fontSize,\n hoverBorderColor,\n hoverBackgroundColor,\n iconColor,\n iconSize,\n iconPadding,\n spinnerSize,\n lineHeight,\n text,\n textColor,\n borderWidth,\n borderRadius,\n motionDuration,\n motionEasing,\n } = getProps({\n buttonTypographyTokens: buttonTypography,\n children: childrenString,\n isDisabled: disabled,\n size,\n variant,\n theme,\n color,\n hasIcon: Boolean(Icon),\n });\n\n const renderElement = React.useMemo(() => getRenderElement(href), [href]);\n const defaultRel = target === '_blank' ? 'noreferrer noopener' : undefined;\n\n return (\n <StyledBaseButton\n ref={ref as any}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: On React Native it will always be undefined but TS doesn't understand that\n as={renderElement}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n accessibilityProps={{\n ...makeAccessible({\n role: isLink ? 'link' : 'button',\n ...accessibilityProps,\n }),\n }}\n variant={variant}\n isLoading={isLoading}\n disabled={disabled}\n defaultBorderColor={defaultBorderColor}\n minHeight={minHeight}\n buttonPaddingTop={buttonPaddingTop}\n buttonPaddingBottom={buttonPaddingBottom}\n buttonPaddingLeft={buttonPaddingLeft}\n buttonPaddingRight={buttonPaddingRight}\n defaultBackgroundColor={defaultBackgroundColor}\n focusBorderColor={focusBorderColor}\n focusBackgroundColor={focusBackgroundColor}\n focusRingColor={focusRingColor}\n hoverBorderColor={hoverBorderColor}\n hoverBackgroundColor={hoverBackgroundColor}\n isFullWidth={isFullWidth}\n onClick={onClick}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onKeyDown={onKeyDown}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n type={type}\n borderWidth={borderWidth}\n borderRadius={borderRadius}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n {...metaAttribute({ name: MetaConstants.Button, testID })}\n {...getStyledProps(rest)}\n >\n {isLoading ? (\n <BaseBox\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n position=\"absolute\"\n top=\"0px\"\n left=\"0px\"\n bottom=\"0px\"\n right=\"0px\"\n zIndex={1}\n >\n <BaseSpinner accessibilityLabel=\"Loading\" size={spinnerSize} color={color} />\n </BaseBox>\n ) : null}\n <ButtonContent\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n flex={1}\n isHidden={isLoading}\n zIndex={1}\n >\n {Icon && iconPosition == 'left' ? (\n <BaseBox\n paddingRight={iconPadding}\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n >\n <Icon size={iconSize} color={iconColor} />\n </BaseBox>\n ) : null}\n {text ? (\n <BaseText\n lineHeight={lineHeight}\n fontSize={fontSize}\n // figma and web have different font-smoothing properties\n // which causes web version of button text to look much bolder\n // than figma version. To fix this we are changing font-weight from 600 to 500\n // https://forum.figma.com/t/why-does-a-font-weight-in-figma-seem-lighter-than-the-same-weight-in-the-browser/2207\n fontWeight=\"medium\"\n textAlign=\"center\"\n color={textColor}\n >\n {text}\n </BaseText>\n ) : null}\n {Icon && iconPosition == 'right' ? (\n <BaseBox\n paddingLeft={iconPadding}\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n >\n <Icon size={iconSize} color={iconColor} />\n </BaseBox>\n ) : null}\n </ButtonContent>\n </StyledBaseButton>\n );\n};\n\nconst BaseButton = assignWithoutSideEffects(React.forwardRef(_BaseButton), {\n displayName: 'BaseButton',\n});\n\nexport default BaseButton;\n"],"names":["getRenderElement","href","isReactNative","undefined","getBackgroundColorToken","_ref","property","variant","state","color","_state","tokens","backgroundColor","white","Error","base","getTextColorToken","_ref2","textColor","getProps","_ref3","buttonTypographyTokens","children","isDisabled","size","theme","hasIcon","throwBladeError","moduleName","message","isIconOnly","trim","length","props","iconSize","buttonIconOnlySizeToIconSizeMap","buttonSizeToIconSizeMap","spinnerSize","buttonSizeToSpinnerSizeMap","fontSize","fonts","lineHeight","lineHeights","minHeight","makeSize","buttonMinHeight","iconPadding","buttonIconPadding","iconColor","buttonPaddingTop","makeSpace","spacing","buttonIconOnlyPadding","top","buttonPadding","buttonPaddingBottom","bottom","buttonPaddingLeft","left","buttonPaddingRight","right","text","toUpperCase","defaultBackgroundColor","getIn","colors","defaultBorderColor","hoverBackgroundColor","hoverBorderColor","focusBackgroundColor","focusBorderColor","focusRingColor","borderWidth","makeBorderSize","border","width","thin","borderRadius","radius","medium","motionDuration","motionEasing","disabledBackgroundColor","disabledBorderColor","ButtonContent","styled","BaseBox","_ref4","isHidden","opacity","_BaseButton","_ref5","ref","target","rel","_ref5$variant","_ref5$color","_ref5$size","Icon","icon","_ref5$iconPosition","iconPosition","_ref5$isDisabled","_ref5$isFullWidth","isFullWidth","_ref5$isLoading","isLoading","onClick","onBlur","onKeyDown","_ref5$type","type","testID","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","accessibilityProps","onTouchEnd","onTouchStart","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","isLink","Boolean","childrenString","getStringFromReactText","disabled","__DEV__","prevLoading","usePrevious","React","useEffect","announce","_getProps","buttonTypography","renderElement","useMemo","defaultRel","_jsxs","StyledBaseButton","Object","assign","as","makeAccessible","role","metaAttribute","name","MetaConstants","Button","getStyledProps","_jsx","display","justifyContent","alignItems","position","zIndex","BaseSpinner","accessibilityLabel","flexDirection","flex","paddingRight","BaseText","fontWeight","textAlign","paddingLeft","BaseButton","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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ACdC,cAAc,CAAC,QAAQ,CACvBC,UAAU,CAAC,QAAQ,CAAAvI,QAAA,CAEnBoI,GAAA,CAACxD,IAAI,CAAC1E,CAAAA,IAAI,CAAEU,QAAS,CAACzB,KAAK,CAAEuC,SAAU,CAAE,CAAC,CACnC,CAAC,CACR,IAAI,CAAA,CACK,CAAC,CACA,CAAA,CAAA,CAAC,CAEvB,CAAC,CAEK,IAAAyH,UAAU,CAAGC,wBAAwB,CAACpC,cAAK,CAACqC,UAAU,CAACjF,WAAW,CAAC,CAAE,CACzEkF,WAAW,CAAE,YACf,CAAC;;;;"}
1
+ {"version":3,"file":"BaseButton.js","sources":["../../../../../../src/components/Button/BaseButton/BaseButton.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { GestureResponderEvent } from 'react-native';\nimport StyledBaseButton from './StyledBaseButton';\nimport type { ButtonTypography, ButtonMinHeight } from './buttonTokens';\nimport {\n textColor,\n backgroundColor,\n buttonIconOnlyPadding,\n buttonIconOnlySizeToIconSizeMap,\n typography as buttonTypography,\n minHeight as buttonMinHeight,\n buttonSizeToIconSizeMap,\n buttonSizeToSpinnerSizeMap,\n buttonIconPadding,\n buttonPadding,\n} from './buttonTokens';\nimport AnimatedButtonContent from './AnimatedButtonContent';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { BaseLinkProps } from '~components/Link/BaseLink';\nimport type { Theme } from '~components/BladeProvider';\nimport type { IconComponent, IconProps, IconSize } from '~components/Icons';\nimport type { DurationString, EasingString } from '~tokens/global';\nimport type { BorderRadiusValues, BorderWidthValues, SpacingValues } from '~tokens/theme/theme';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { useButtonGroupContext } from '~components/ButtonGroup/ButtonGroupContext';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { useTheme } from '~components/BladeProvider';\nimport { announce } from '~components/LiveAnnouncer';\nimport type { BaseSpinnerProps } from '~components/Spinner/BaseSpinner';\nimport { BaseSpinner } from '~components/Spinner/BaseSpinner';\nimport BaseBox from '~components/Box/BaseBox';\nimport type {\n BladeElementRef,\n DotNotationSpacingStringToken,\n StringChildrenType,\n TestID,\n} from '~utils/types';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { usePrevious } from '~utils/usePrevious';\nimport { makeSize } from '~utils/makeSize';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeSpace } from '~utils/makeSpace';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStringFromReactText } from '~src/utils/getStringChildren';\nimport type { BladeCommonEvents } from '~components/types';\nimport { throwBladeError } from '~utils/logger';\n\ntype BaseButtonCommonProps = {\n href?: BaseLinkProps['href'];\n target?: BaseLinkProps['target'];\n rel?: BaseLinkProps['rel'];\n size?: 'xsmall' | 'small' | 'medium' | 'large';\n iconPosition?: 'left' | 'right';\n isDisabled?: boolean;\n isFullWidth?: boolean;\n onKeyDown?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.KeyboardEvent<HTMLButtonElement>) => void;\n }>;\n onClick?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }>;\n type?: 'button' | 'reset' | 'submit';\n isLoading?: boolean;\n accessibilityProps?: Partial<AccessibilityProps>;\n variant?: 'primary' | 'secondary' | 'tertiary';\n color?: 'primary' | 'white' | 'positive' | 'negative' | 'notice' | 'information' | 'neutral';\n} & TestID &\n StyledPropsBlade &\n BladeCommonEvents;\n\n/*\nMandatory children prop when icon is not provided\n*/\ntype BaseButtonWithoutIconProps = BaseButtonCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n*/\ntype BaseButtonWithIconProps = BaseButtonCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\n/*\n With or without icon prop. We need at least an icon or a children prop present.\n*/\nexport type BaseButtonProps = BaseButtonWithIconProps | BaseButtonWithoutIconProps;\n\ntype BaseButtonColorTokenModifiers = {\n variant: NonNullable<BaseButtonProps['variant']>;\n state: 'default' | 'hover' | 'focus' | 'disabled';\n color: BaseButtonProps['color'];\n};\n\n/**\n * All possible icon colors, derived from `IconProps` minus `currentColor` because possible values should only be from tokens\n */\ntype IconColor = Exclude<IconProps['color'], 'currentColor'>;\n\nconst getRenderElement = (href?: string): 'a' | 'button' | undefined => {\n if (isReactNative()) {\n return undefined; // as property doesn't work with react native\n }\n\n if (href) {\n return 'a';\n }\n\n return 'button';\n};\n\nexport const getBackgroundColorToken = ({\n property,\n variant,\n state,\n color,\n}: BaseButtonColorTokenModifiers & {\n property: 'background' | 'border';\n}): DotNotationToken<Theme['colors']> => {\n const _state = state === 'focus' || state === 'hover' ? 'highlighted' : state;\n const tokens = backgroundColor(property);\n\n if (color === 'white') {\n return tokens.white[variant][_state];\n }\n\n if (color && color !== 'primary') {\n if (variant === 'tertiary') {\n throw new Error(\n `Tertiary variant can only be used with color: \"primary\" or \"white\" but received \"${color}\"`,\n );\n }\n return tokens.color(color)[variant][_state];\n }\n\n return tokens.base[variant][_state];\n};\n\nconst getTextColorToken = ({\n property,\n variant,\n state,\n color,\n}: BaseButtonColorTokenModifiers & {\n property: 'icon' | 'text';\n}): DotNotationToken<Theme['colors']> => {\n const tokens = textColor(property);\n const _state = state === 'focus' || state === 'hover' ? 'highlighted' : state;\n\n if (color === 'white') {\n return tokens.white[variant][_state];\n }\n\n if (color && color !== 'primary') {\n if (variant === 'tertiary') {\n throw new Error(\n `Tertiary variant can only be used with color: \"primary\" or \"white\" but received \"${color}\"`,\n );\n }\n return tokens.color(color)[variant][_state];\n }\n\n return tokens.base[variant][_state];\n};\n\ntype BaseButtonStyleProps = {\n iconSize: IconSize;\n spinnerSize: BaseSpinnerProps['size'];\n fontSize: keyof Theme['typography']['fonts']['size'];\n lineHeight: keyof Theme['typography']['lineHeights'];\n minHeight: `${ButtonMinHeight}px`;\n iconPadding?: DotNotationSpacingStringToken;\n iconColor: IconColor;\n textColor: BaseTextProps['color'];\n buttonPaddingTop: SpacingValues;\n buttonPaddingBottom: SpacingValues;\n buttonPaddingLeft: SpacingValues;\n buttonPaddingRight: SpacingValues;\n text?: string;\n defaultBackgroundColor: string;\n defaultBorderColor: string;\n hoverBackgroundColor: string;\n hoverBorderColor: string;\n focusBackgroundColor: string;\n focusBorderColor: string;\n focusRingColor: string;\n motionDuration: DurationString;\n motionEasing: EasingString;\n borderWidth: BorderWidthValues;\n borderRadius: BorderRadiusValues;\n};\n\nconst getProps = ({\n buttonTypographyTokens,\n children,\n isDisabled,\n size,\n theme,\n variant,\n color,\n hasIcon,\n}: {\n buttonTypographyTokens: ButtonTypography;\n children?: string;\n isDisabled: boolean;\n hasIcon: boolean;\n theme: Theme;\n size: NonNullable<BaseButtonProps['size']>;\n variant: NonNullable<BaseButtonProps['variant']>;\n color: BaseButtonProps['color'];\n}): BaseButtonStyleProps => {\n if (variant === 'tertiary' && color !== 'primary' && color !== 'white') {\n throwBladeError({\n moduleName: 'BaseButton',\n message: `Tertiary variant can only be used with color: \"primary\" or \"white\" but received \"${color}\"`,\n });\n }\n\n const isIconOnly = hasIcon && (!children || children?.trim().length === 0);\n const props: BaseButtonStyleProps = {\n iconSize: isIconOnly ? buttonIconOnlySizeToIconSizeMap[size] : buttonSizeToIconSizeMap[size],\n spinnerSize: buttonSizeToSpinnerSizeMap[size],\n fontSize: buttonTypographyTokens.fonts.size[size],\n lineHeight: buttonTypographyTokens.lineHeights[size],\n minHeight: makeSize(buttonMinHeight[size]),\n iconPadding: hasIcon && children?.trim() ? `spacing.${buttonIconPadding[size]}` : undefined,\n iconColor: getTextColorToken({\n property: 'icon',\n variant,\n color,\n state: 'default',\n }) as IconColor,\n textColor: getTextColorToken({\n property: 'text',\n variant,\n color,\n state: 'default',\n }) as BaseTextProps['color'],\n buttonPaddingTop: isIconOnly\n ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].top])\n : makeSpace(theme.spacing[buttonPadding[size].top]),\n buttonPaddingBottom: isIconOnly\n ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].bottom])\n : makeSpace(theme.spacing[buttonPadding[size].bottom]),\n buttonPaddingLeft: isIconOnly\n ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].left])\n : makeSpace(theme.spacing[buttonPadding[size].left]),\n buttonPaddingRight: isIconOnly\n ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].right])\n : makeSpace(theme.spacing[buttonPadding[size].right]),\n text: size === 'xsmall' ? children?.trim().toUpperCase() : children?.trim(),\n defaultBackgroundColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'background', variant, color, state: 'default' }),\n ),\n defaultBorderColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'border', variant, color, state: 'default' }),\n ),\n hoverBackgroundColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'background', variant, color, state: 'hover' }),\n ),\n hoverBorderColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'border', variant, color, state: 'hover' }),\n ),\n focusBackgroundColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'background', variant, color, state: 'focus' }),\n ),\n focusBorderColor: getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'border', variant, color, state: 'focus' }),\n ),\n focusRingColor: getIn(theme.colors, 'surface.border.primary.muted'),\n borderWidth: variant == 'secondary' ? makeBorderSize(theme.border.width.thin) : '0px',\n borderRadius: makeBorderSize(theme.border.radius.medium),\n motionDuration: 'duration.xquick',\n motionEasing: 'easing.standard.effective',\n };\n\n if (isDisabled) {\n const disabledBackgroundColor = getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'background', variant, color, state: 'disabled' }),\n );\n const disabledBorderColor = getIn(\n theme.colors,\n getBackgroundColorToken({ property: 'border', variant, color, state: 'disabled' }),\n );\n props.iconColor = getTextColorToken({\n property: 'icon',\n variant,\n color,\n state: 'disabled',\n }) as IconColor;\n props.textColor = getTextColorToken({\n property: 'text',\n variant,\n color,\n state: 'disabled',\n }) as BaseTextProps['color'];\n props.defaultBackgroundColor = disabledBackgroundColor;\n props.defaultBorderColor = disabledBorderColor;\n props.hoverBackgroundColor = disabledBackgroundColor;\n props.hoverBorderColor = disabledBorderColor;\n props.focusBackgroundColor = disabledBackgroundColor;\n props.focusBorderColor = disabledBorderColor;\n }\n\n return props;\n};\n\nconst ButtonContent = styled(BaseBox)<{ isHidden: boolean }>(({ isHidden }) => ({\n opacity: isHidden ? 0 : 1,\n}));\n\nconst _BaseButton: React.ForwardRefRenderFunction<BladeElementRef, BaseButtonProps> = (\n {\n href,\n target,\n rel,\n variant = 'primary',\n color = 'primary',\n size = 'medium',\n icon: Icon,\n iconPosition = 'left',\n isDisabled = false,\n isFullWidth = false,\n isLoading = false,\n onClick,\n onBlur,\n onKeyDown,\n type = 'button',\n children,\n testID,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n accessibilityProps,\n onTouchEnd,\n onTouchStart,\n ...rest\n },\n ref,\n) => {\n const { theme } = useTheme();\n const buttonGroupProps = useButtonGroupContext();\n const [isPressed, setIsPressed] = React.useState(false);\n const isLink = Boolean(href);\n const childrenString = getStringFromReactText(children);\n // Button cannot be disabled when its rendered as Link\n const disabled = buttonGroupProps.isDisabled ?? (isLoading || (isDisabled && !isLink));\n\n if (__DEV__) {\n if (!Icon && !childrenString?.trim()) {\n throwBladeError({\n message: 'At least one of icon or text is required to render a button.',\n moduleName: 'BaseButton',\n });\n }\n }\n\n const prevLoading = usePrevious(isLoading);\n\n React.useEffect(() => {\n if (isLoading) announce('Started loading');\n\n if (!isLoading && prevLoading) announce('Stopped loading');\n }, [isLoading, prevLoading]);\n\n const {\n defaultBorderColor,\n defaultBackgroundColor,\n minHeight,\n buttonPaddingTop,\n buttonPaddingBottom,\n buttonPaddingLeft,\n buttonPaddingRight,\n focusBorderColor,\n focusBackgroundColor,\n focusRingColor,\n fontSize,\n hoverBorderColor,\n hoverBackgroundColor,\n iconColor,\n iconSize,\n iconPadding,\n spinnerSize,\n lineHeight,\n text,\n textColor,\n borderWidth,\n borderRadius,\n motionDuration,\n motionEasing,\n } = getProps({\n buttonTypographyTokens: buttonTypography,\n children: childrenString,\n isDisabled: disabled,\n size: buttonGroupProps.size ?? size,\n variant: buttonGroupProps.variant ?? variant,\n theme,\n color: buttonGroupProps.color ?? color,\n hasIcon: Boolean(Icon),\n });\n\n const renderElement = React.useMemo(() => getRenderElement(href), [href]);\n const defaultRel = target === '_blank' ? 'noreferrer noopener' : undefined;\n\n const handlePointerPressedIn = React.useCallback(() => {\n if (disabled) return;\n setIsPressed(true);\n }, [disabled]);\n\n const handlePointerPressedOut = React.useCallback(() => {\n if (disabled) return;\n setIsPressed(false);\n }, [disabled]);\n\n const handleKeyboardPressedIn = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) return;\n if (e.key === ' ' || e.key === 'Enter') {\n setIsPressed(true);\n }\n },\n [disabled],\n );\n\n const handleKeyboardPressedOut = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) return;\n if (e.key === ' ' || e.key === 'Enter') {\n setIsPressed(false);\n }\n },\n [disabled],\n );\n\n return (\n <StyledBaseButton\n ref={ref as any}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: On React Native it will always be undefined but TS doesn't understand that\n as={renderElement}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n accessibilityProps={{\n ...makeAccessible({\n role: isLink ? 'link' : 'button',\n ...accessibilityProps,\n }),\n }}\n variant={variant}\n isLoading={isLoading}\n disabled={disabled}\n defaultBorderColor={defaultBorderColor}\n minHeight={minHeight}\n buttonPaddingTop={buttonPaddingTop}\n buttonPaddingBottom={buttonPaddingBottom}\n buttonPaddingLeft={buttonPaddingLeft}\n buttonPaddingRight={buttonPaddingRight}\n defaultBackgroundColor={defaultBackgroundColor}\n focusBorderColor={focusBorderColor}\n focusBackgroundColor={focusBackgroundColor}\n focusRingColor={focusRingColor}\n hoverBorderColor={hoverBorderColor}\n hoverBackgroundColor={hoverBackgroundColor}\n isFullWidth={buttonGroupProps.isFullWidth ?? isFullWidth}\n onClick={onClick}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n // Setting type for web fails it on native typecheck and vice versa\n onKeyDown={(event: any) => {\n handleKeyboardPressedIn(event);\n onKeyDown?.(event);\n }}\n onTouchStart={(event: React.TouchEvent) => {\n handlePointerPressedIn();\n onTouchStart?.(event);\n }}\n onTouchEnd={(event: React.TouchEvent) => {\n handlePointerPressedOut();\n onTouchEnd?.(event);\n }}\n type={type}\n borderWidth={borderWidth}\n borderRadius={borderRadius}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n isPressed={isPressed}\n onMouseDown={handlePointerPressedIn}\n onMouseUp={handlePointerPressedOut}\n onMouseOut={handlePointerPressedOut}\n onKeyUp={handleKeyboardPressedOut}\n {...metaAttribute({ name: MetaConstants.Button, testID })}\n {...getStyledProps(rest)}\n >\n <AnimatedButtonContent\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n isPressed={isPressed}\n >\n {isLoading ? (\n <BaseBox\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n position=\"absolute\"\n top=\"0px\"\n left=\"0px\"\n bottom=\"0px\"\n right=\"0px\"\n zIndex={1}\n >\n <BaseSpinner accessibilityLabel=\"Loading\" size={spinnerSize} color={color} />\n </BaseBox>\n ) : null}\n <ButtonContent\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n flex={1}\n isHidden={isLoading}\n zIndex={1}\n >\n {Icon && iconPosition == 'left' ? (\n <BaseBox\n paddingRight={iconPadding}\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n >\n <Icon size={iconSize} color={iconColor} />\n </BaseBox>\n ) : null}\n {text ? (\n <BaseText\n lineHeight={lineHeight}\n fontSize={fontSize}\n // figma and web have different font-smoothing properties\n // which causes web version of button text to look much bolder\n // than figma version. To fix this we are changing font-weight from 600 to 500\n // https://forum.figma.com/t/why-does-a-font-weight-in-figma-seem-lighter-than-the-same-weight-in-the-browser/2207\n fontWeight=\"medium\"\n textAlign=\"center\"\n color={textColor}\n >\n {text}\n </BaseText>\n ) : null}\n {Icon && iconPosition == 'right' ? (\n <BaseBox\n paddingLeft={iconPadding}\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n >\n <Icon size={iconSize} color={iconColor} />\n </BaseBox>\n ) : null}\n </ButtonContent>\n </AnimatedButtonContent>\n </StyledBaseButton>\n );\n};\n\nconst BaseButton = assignWithoutSideEffects(React.forwardRef(_BaseButton), {\n displayName: 'BaseButton',\n});\n\nexport default BaseButton;\n"],"names":["getRenderElement","href","isReactNative","undefined","getBackgroundColorToken","_ref","property","variant","state","color","_state","tokens","backgroundColor","white","Error","base","getTextColorToken","_ref2","textColor","getProps","_ref3","buttonTypographyTokens","children","isDisabled","size","theme","hasIcon","throwBladeError","moduleName","message","isIconOnly","trim","length","props","iconSize","buttonIconOnlySizeToIconSizeMap","buttonSizeToIconSizeMap","spinnerSize","buttonSizeToSpinnerSizeMap","fontSize","fonts","lineHeight","lineHeights","minHeight","makeSize","buttonMinHeight","iconPadding","buttonIconPadding","iconColor","buttonPaddingTop","makeSpace","spacing","buttonIconOnlyPadding","top","buttonPadding","buttonPaddingBottom","bottom","buttonPaddingLeft","left","buttonPaddingRight","right","text","toUpperCase","defaultBackgroundColor","getIn","colors","defaultBorderColor","hoverBackgroundColor","hoverBorderColor","focusBackgroundColor","focusBorderColor","focusRingColor","borderWidth","makeBorderSize","border","width","thin","borderRadius","radius","medium","motionDuration","motionEasing","disabledBackgroundColor","disabledBorderColor","ButtonContent","styled","BaseBox","_ref4","isHidden","opacity","_BaseButton","_ref5","ref","_buttonGroupProps$isD","_buttonGroupProps$siz","_buttonGroupProps$var","_buttonGroupProps$col","_buttonGroupProps$isF","target","rel","_ref5$variant","_ref5$color","_ref5$size","Icon","icon","_ref5$iconPosition","iconPosition","_ref5$isDisabled","_ref5$isFullWidth","isFullWidth","_ref5$isLoading","isLoading","onClick","onBlur","onKeyDown","_ref5$type","type","testID","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","accessibilityProps","onTouchEnd","onTouchStart","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","buttonGroupProps","useButtonGroupContext","_React$useState","React","useState","_React$useState2","_slicedToArray","isPressed","setIsPressed","isLink","Boolean","childrenString","getStringFromReactText","disabled","__DEV__","prevLoading","usePrevious","useEffect","announce","_getProps","buttonTypography","renderElement","useMemo","defaultRel","handlePointerPressedIn","useCallback","handlePointerPressedOut","handleKeyboardPressedIn","e","key","handleKeyboardPressedOut","_jsx","StyledBaseButton","Object","assign","as","makeAccessible","role","event","onMouseDown","onMouseUp","onMouseOut","onKeyUp","metaAttribute","name","MetaConstants","Button","getStyledProps","_jsxs","AnimatedButtonContent","display","justifyContent","alignItems","position","zIndex","BaseSpinner","accessibilityLabel","flexDirection","flex","paddingRight","BaseText","fontWeight","textAlign","paddingLeft","BaseButton","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,MAAA,CAAA,QAAA,CAAA,KAAA,CAAA,SAAA,CAAA,OAAA,CAAA,MAAA,CAAA,MAAA,CAAA,cAAA,CAAA,YAAA,CAAA,aAAA,CAAA,WAAA,CAAA,SAAA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SideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
19
19
 
20
- var _excluded=["onClick","href","onBlur","onKeyDown","children","variant","minHeight","buttonPaddingTop","buttonPaddingBottom","buttonPaddingLeft","buttonPaddingRight","isFullWidth","disabled","defaultBackgroundColor","defaultBorderColor","hoverBackgroundColor","focusBackgroundColor","focusRingColor","hoverBorderColor","focusBorderColor","borderWidth","borderRadius","motionDuration","motionEasing","isLoading","accessibilityProps","testID","onTouchStart","onTouchEnd","onPointerEnter","onPointerDown","onFocus"];var StyledPressable=styled(Animated.createAnimatedComponent(Pressable))(function(props){var styledPropsCSSObject=useStyledProps(props);return Object.assign({},getBaseButtonStyles(props),{alignSelf:'center',display:'flex'},styledPropsCSSObject);});var openURL=function(){var _ref=_asyncToGenerator(function*(href){try{var canOpen=yield Linking.canOpenURL(href);if(canOpen){yield Linking.openURL(href);}}catch(_unused){if(__DEV__){logger({type:'warn',message:`Could not open the link "href=${href}"`,moduleName:'BaseButton'});}}});return function openURL(_x){return _ref.apply(this,arguments);};}();var _StyledBaseButton=function _StyledBaseButton(_ref2,ref){var onClick=_ref2.onClick,href=_ref2.href;_ref2.onBlur;_ref2.onKeyDown;var _children=_ref2.children,variant=_ref2.variant,minHeight=_ref2.minHeight,buttonPaddingTop=_ref2.buttonPaddingTop,buttonPaddingBottom=_ref2.buttonPaddingBottom,buttonPaddingLeft=_ref2.buttonPaddingLeft,buttonPaddingRight=_ref2.buttonPaddingRight,isFullWidth=_ref2.isFullWidth,disabled=_ref2.disabled,defaultBackgroundColor=_ref2.defaultBackgroundColor,defaultBorderColor=_ref2.defaultBorderColor,hoverBackgroundColor=_ref2.hoverBackgroundColor,focusBackgroundColor=_ref2.focusBackgroundColor,focusRingColor=_ref2.focusRingColor,hoverBorderColor=_ref2.hoverBorderColor,focusBorderColor=_ref2.focusBorderColor,borderWidth=_ref2.borderWidth,borderRadius=_ref2.borderRadius,motionDuration=_ref2.motionDuration,motionEasing=_ref2.motionEasing,isLoading=_ref2.isLoading,accessibilityProps=_ref2.accessibilityProps,testID=_ref2.testID,onTouchStart=_ref2.onTouchStart,onTouchEnd=_ref2.onTouchEnd,onPointerEnter=_ref2.onPointerEnter,onPointerDown=_ref2.onPointerDown,onFocus=_ref2.onFocus,styledProps=_objectWithoutProperties(_ref2,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var isPressed=useSharedValue(false);var duration=getIn(theme.motion,motionDuration);var easing=getIn(theme.motion,motionEasing);var animatedStyles=useAnimatedStyle(function(){return Object.assign({backgroundColor:withTiming(isPressed.value?focusBackgroundColor:defaultBackgroundColor,{duration:duration,easing:easing})},variant!=='tertiary'&&{borderColor:withTiming(isPressed.value?focusBorderColor:defaultBorderColor,{duration:duration,easing:easing})});});var handleOnPress=function handleOnPress(event){if(href){void openURL(href);}if(onClick){onClick(event);}};return jsx(StyledPressable,Object.assign({},styledProps,accessibilityProps,{ref:ref,role:"button",onTouchStart:castNativeType(onTouchStart),onTouchEnd:castNativeType(onTouchEnd),onPointerEnter:castNativeType(onPointerEnter),onPointerDown:castNativeType(onPointerDown),onFocus:castNativeType(onFocus),isLoading:isLoading,onPress:handleOnPress,style:animatedStyles,minHeight:minHeight,buttonPaddingTop:buttonPaddingTop,buttonPaddingBottom:buttonPaddingBottom,buttonPaddingLeft:buttonPaddingLeft,buttonPaddingRight:buttonPaddingRight,isFullWidth:isFullWidth,disabled:disabled,defaultBackgroundColor:defaultBackgroundColor,defaultBorderColor:defaultBorderColor,hoverBackgroundColor:hoverBackgroundColor,focusBackgroundColor:focusBackgroundColor,focusRingColor:focusRingColor,hoverBorderColor:hoverBorderColor,focusBorderColor:focusBorderColor,borderWidth:borderWidth,borderRadius:borderRadius,motionDuration:motionDuration,motionEasing:motionEasing,testID:testID,children:function children(_ref3){var pressed=_ref3.pressed;isPressed.value=pressed;return _children;}}));};var StyledBaseButton=assignWithoutSideEffects(React__default.forwardRef(_StyledBaseButton),{displayName:'StyledBaseButton'});
20
+ var _excluded=["onClick","href","onBlur","onKeyDown","children","variant","minHeight","buttonPaddingTop","buttonPaddingBottom","buttonPaddingLeft","buttonPaddingRight","isFullWidth","disabled","defaultBackgroundColor","defaultBorderColor","hoverBackgroundColor","focusBackgroundColor","focusRingColor","hoverBorderColor","focusBorderColor","borderWidth","borderRadius","motionDuration","motionEasing","isLoading","accessibilityProps","testID","onTouchStart","onTouchEnd","onPointerEnter","onPointerDown","onFocus"];var StyledPressable=styled(Animated.createAnimatedComponent(Pressable))(function(props){var styledPropsCSSObject=useStyledProps(props);return Object.assign({},getBaseButtonStyles(props),{alignSelf:'center',display:'flex',flexDirection:'row'},styledPropsCSSObject);});var openURL=function(){var _ref=_asyncToGenerator(function*(href){try{var canOpen=yield Linking.canOpenURL(href);if(canOpen){yield Linking.openURL(href);}}catch(_unused){if(__DEV__){logger({type:'warn',message:`Could not open the link "href=${href}"`,moduleName:'BaseButton'});}}});return function openURL(_x){return _ref.apply(this,arguments);};}();var _StyledBaseButton=function _StyledBaseButton(_ref2,ref){var onClick=_ref2.onClick,href=_ref2.href;_ref2.onBlur;_ref2.onKeyDown;var _children=_ref2.children,variant=_ref2.variant,minHeight=_ref2.minHeight,buttonPaddingTop=_ref2.buttonPaddingTop,buttonPaddingBottom=_ref2.buttonPaddingBottom,buttonPaddingLeft=_ref2.buttonPaddingLeft,buttonPaddingRight=_ref2.buttonPaddingRight,isFullWidth=_ref2.isFullWidth,disabled=_ref2.disabled,defaultBackgroundColor=_ref2.defaultBackgroundColor,defaultBorderColor=_ref2.defaultBorderColor,hoverBackgroundColor=_ref2.hoverBackgroundColor,focusBackgroundColor=_ref2.focusBackgroundColor,focusRingColor=_ref2.focusRingColor,hoverBorderColor=_ref2.hoverBorderColor,focusBorderColor=_ref2.focusBorderColor,borderWidth=_ref2.borderWidth,borderRadius=_ref2.borderRadius,motionDuration=_ref2.motionDuration,motionEasing=_ref2.motionEasing,isLoading=_ref2.isLoading,accessibilityProps=_ref2.accessibilityProps,testID=_ref2.testID,onTouchStart=_ref2.onTouchStart,onTouchEnd=_ref2.onTouchEnd,onPointerEnter=_ref2.onPointerEnter,onPointerDown=_ref2.onPointerDown,onFocus=_ref2.onFocus,styledProps=_objectWithoutProperties(_ref2,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var isPressed=useSharedValue(false);var duration=getIn(theme.motion,motionDuration);var easing=getIn(theme.motion,motionEasing);var animatedStyles=useAnimatedStyle(function(){return Object.assign({backgroundColor:withTiming(isPressed.value?focusBackgroundColor:defaultBackgroundColor,{duration:duration,easing:easing})},variant!=='tertiary'&&{borderColor:withTiming(isPressed.value?focusBorderColor:defaultBorderColor,{duration:duration,easing:easing})});});var handleOnPress=function handleOnPress(event){if(href){void openURL(href);}if(onClick){onClick(event);}};return jsx(StyledPressable,Object.assign({},styledProps,accessibilityProps,{ref:ref,role:"button",onTouchStart:castNativeType(onTouchStart),onTouchEnd:castNativeType(onTouchEnd),onPointerEnter:castNativeType(onPointerEnter),onPointerDown:castNativeType(onPointerDown),onFocus:castNativeType(onFocus),isLoading:isLoading,onPress:handleOnPress,style:animatedStyles,minHeight:minHeight,buttonPaddingTop:buttonPaddingTop,buttonPaddingBottom:buttonPaddingBottom,buttonPaddingLeft:buttonPaddingLeft,buttonPaddingRight:buttonPaddingRight,isFullWidth:isFullWidth,disabled:disabled,defaultBackgroundColor:defaultBackgroundColor,defaultBorderColor:defaultBorderColor,hoverBackgroundColor:hoverBackgroundColor,focusBackgroundColor:focusBackgroundColor,focusRingColor:focusRingColor,hoverBorderColor:hoverBorderColor,focusBorderColor:focusBorderColor,borderWidth:borderWidth,borderRadius:borderRadius,motionDuration:motionDuration,motionEasing:motionEasing,testID:testID,children:function children(_ref3){var pressed=_ref3.pressed;isPressed.value=pressed;return _children;}}));};var StyledBaseButton=assignWithoutSideEffects(React__default.forwardRef(_StyledBaseButton),{displayName:'StyledBaseButton'});
21
21
 
22
22
  export { StyledBaseButton as default };
23
23
  //# sourceMappingURL=StyledBaseButton.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StyledBaseButton.native.js","sources":["../../../../../../src/components/Button/BaseButton/StyledBaseButton.native.tsx"],"sourcesContent":["import { Linking, Pressable } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport styled from 'styled-components/native';\nimport React from 'react';\nimport type { TextInput, GestureResponderEvent } from 'react-native';\nimport getStyledBaseButtonStyles from './getStyledBaseButtonStyles';\nimport type { StyledBaseButtonProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useStyledProps } from '~components/Box/styledProps';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { logger } from '~utils/logger';\nimport { castNativeType } from '~utils';\n\nconst StyledPressable = styled(Animated.createAnimatedComponent(Pressable))<\n Omit<StyledBaseButtonProps, 'accessibilityProps'>\n>((props) => {\n const styledPropsCSSObject = useStyledProps(props);\n\n return {\n ...getStyledBaseButtonStyles(props),\n alignSelf: 'center',\n display: 'flex',\n ...styledPropsCSSObject,\n };\n});\n\nconst openURL = async (href: string): Promise<void> => {\n try {\n const canOpen = await Linking.canOpenURL(href);\n if (canOpen) {\n await Linking.openURL(href);\n }\n } catch {\n if (__DEV__) {\n logger({\n type: 'warn',\n message: `Could not open the link \"href=${href}\"`,\n moduleName: 'BaseButton',\n });\n }\n }\n};\n\nconst _StyledBaseButton: React.ForwardRefRenderFunction<TextInput, StyledBaseButtonProps> = (\n {\n onClick,\n href,\n onBlur,\n onKeyDown,\n children,\n variant,\n minHeight,\n buttonPaddingTop,\n buttonPaddingBottom,\n buttonPaddingLeft,\n buttonPaddingRight,\n isFullWidth,\n disabled,\n defaultBackgroundColor,\n defaultBorderColor,\n hoverBackgroundColor,\n focusBackgroundColor,\n focusRingColor,\n hoverBorderColor,\n focusBorderColor,\n borderWidth,\n borderRadius,\n motionDuration,\n motionEasing,\n isLoading,\n accessibilityProps,\n testID,\n onTouchStart,\n onTouchEnd,\n onPointerEnter,\n onPointerDown,\n onFocus,\n ...styledProps\n },\n ref,\n) => {\n const { theme } = useTheme();\n const isPressed = useSharedValue(false);\n const duration = getIn(theme.motion, motionDuration);\n const easing = getIn(theme.motion, motionEasing);\n\n const animatedStyles = useAnimatedStyle(() => {\n return {\n backgroundColor: withTiming(isPressed.value ? focusBackgroundColor : defaultBackgroundColor, {\n duration,\n easing,\n }),\n ...(variant !== 'tertiary' && {\n borderColor: withTiming(isPressed.value ? focusBorderColor : defaultBorderColor, {\n duration,\n easing,\n }),\n }),\n };\n });\n\n const handleOnPress = (event: GestureResponderEvent): void => {\n if (href) {\n void openURL(href);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n return (\n <StyledPressable\n {...styledProps}\n {...accessibilityProps}\n ref={ref}\n role=\"button\"\n onTouchStart={castNativeType(onTouchStart)}\n onTouchEnd={castNativeType(onTouchEnd)}\n onPointerEnter={castNativeType(onPointerEnter)}\n onPointerDown={castNativeType(onPointerDown)}\n onFocus={castNativeType(onFocus)}\n isLoading={isLoading}\n onPress={handleOnPress}\n style={animatedStyles}\n minHeight={minHeight}\n buttonPaddingTop={buttonPaddingTop}\n buttonPaddingBottom={buttonPaddingBottom}\n buttonPaddingLeft={buttonPaddingLeft}\n buttonPaddingRight={buttonPaddingRight}\n isFullWidth={isFullWidth}\n disabled={disabled}\n defaultBackgroundColor={defaultBackgroundColor}\n defaultBorderColor={defaultBorderColor}\n hoverBackgroundColor={hoverBackgroundColor}\n focusBackgroundColor={focusBackgroundColor}\n focusRingColor={focusRingColor}\n hoverBorderColor={hoverBorderColor}\n focusBorderColor={focusBorderColor}\n borderWidth={borderWidth}\n borderRadius={borderRadius}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n testID={testID}\n >\n {({ pressed }): React.ReactNode => {\n isPressed.value = pressed;\n return children;\n }}\n </StyledPressable>\n );\n};\n\nconst StyledBaseButton = assignWithoutSideEffects(React.forwardRef(_StyledBaseButton), {\n displayName: 'StyledBaseButton',\n});\n\nexport default StyledBaseButton;\n"],"names":["StyledPressable","styled","Animated","createAnimatedComponent","Pressable","props","styledPropsCSSObject","useStyledProps","Object","assign","getStyledBaseButtonStyles","alignSelf","display","openURL","_ref","_asyncToGenerator","href","canOpen","Linking","canOpenURL","_unused","__DEV__","logger","type","message","moduleName","_x","apply","arguments","_StyledBaseButton","_ref2","ref","onClick","onBlur","onKeyDown","children","variant","minHeight","buttonPaddingTop","buttonPaddingBottom","buttonPaddingLeft","buttonPaddingRight","isFullWidth","disabled","defaultBackgroundColor","defaultBorderColor","hoverBackgroundColor","focusBackgroundColor","focusRingColor","hoverBorderColor","focusBorderColor","borderWidth","borderRadius","motionDuration","motionEasing","isLoading","accessibilityProps","testID","onTouchStart","onTouchEnd","onPointerEnter","onPointerDown","onFocus","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","isPressed","useSharedValue","duration","getIn","motion","easing","animatedStyles","useAnimatedStyle","backgroundColor","withTiming","value","borderColor","handleOnPress","event","_jsx","role","castNativeType","onPress","style","_ref3","pressed","StyledBaseButton","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,SAAA,CAAA,MAAA,CAAA,QAAA,CAAA,WAAA,CAAA,UAAA,CAAA,SAAA,CAAA,WAAA,CAAA,kBAAA,CAAA,qBAAA,CAAA,mBAAA,CAAA,oBAAA,CAAA,aAAA,CAAA,UAAA,CAAA,wBAAA,CAAA,oBAAA,CAAA,sBAAA,CAAA,sBAAA,CAAA,gBAAA,CAAA,kBAAA,CAAA,kBAAA,CAAA,aAAA,CAAA,cAAA,CAAA,gBAAA,CAAA,cAAA,CAAA,WAAA,CAAA,oBAAA,CAAA,QAAA,CAAA,cAAA,CAAA,YAAA,CAAA,gBAAA,CAAA,eAAA,CAAA,SAAA,CAAA,CAcA,IAAMA,eAAe,CAAGC,MAAM,CAACC,QAAQ,CAACC,uBAAuB,CAACC,SAAS,CAAC,CAAC,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,CAAEL,aAAc,CACvBM,KAAK,CAAEZ,cAAe,CACtBtC,SAAS,CAAEA,SAAU,CACrBC,gBAAgB,CAAEA,gBAAiB,CACnCC,mBAAmB,CAAEA,mBAAoB,CACzCC,iBAAiB,CAAEA,iBAAkB,CACrCC,kBAAkB,CAAEA,kBAAmB,CACvCC,WAAW,CAAEA,WAAY,CACzBC,QAAQ,CAAEA,QAAS,CACnBC,sBAAsB,CAAEA,sBAAuB,CAC/CC,kBAAkB,CAAEA,kBAAmB,CACvCC,oBAAoB,CAAEA,oBAAqB,CAC3CC,oBAAoB,CAAEA,oBAAqB,CAC3CC,cAAc,CAAEA,cAAe,CAC/BC,gBAAgB,CAAEA,gBAAiB,CACnCC,gBAAgB,CAAEA,gBAAiB,CACnCC,WAAW,CAAEA,WAAY,CACzBC,YAAY,CAAEA,YAAa,CAC3BC,cAAc,CAAEA,cAAe,CAC/BC,YAAY,CAAEA,YAAa,CAC3BG,MAAM,CAAEA,MAAO,CAAAtB,QAAA,CAEd,SAAAA,SAAAqD,KAAA,CAAkC,KAA/BC,OAAO,CAAAD,KAAA,CAAPC,OAAO,CACTpB,SAAS,CAACU,KAAK,CAAGU,OAAO,CACzB,OAAOtD,SAAQ,CACjB,CAAC,CACc,CAAA,CAAC,CAEtB,CAAC,CAEK,IAAAuD,gBAAgB,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAAChE,iBAAiB,CAAC,CAAE,CACrFiE,WAAW,CAAE,kBACf,CAAC;;;;"}
1
+ {"version":3,"file":"StyledBaseButton.native.js","sources":["../../../../../../src/components/Button/BaseButton/StyledBaseButton.native.tsx"],"sourcesContent":["import { Linking, Pressable } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport styled from 'styled-components/native';\nimport React from 'react';\nimport type { TextInput, GestureResponderEvent } from 'react-native';\nimport getStyledBaseButtonStyles from './getStyledBaseButtonStyles';\nimport type { StyledBaseButtonProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useStyledProps } from '~components/Box/styledProps';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { logger } from '~utils/logger';\nimport { castNativeType } from '~utils';\n\nconst StyledPressable = styled(Animated.createAnimatedComponent(Pressable))<\n Omit<StyledBaseButtonProps, 'accessibilityProps'>\n>((props) => {\n const styledPropsCSSObject = useStyledProps(props);\n\n return {\n ...getStyledBaseButtonStyles(props),\n alignSelf: 'center',\n display: 'flex',\n flexDirection: 'row',\n ...styledPropsCSSObject,\n };\n});\n\nconst openURL = async (href: string): Promise<void> => {\n try {\n const canOpen = await Linking.canOpenURL(href);\n if (canOpen) {\n await Linking.openURL(href);\n }\n } catch {\n if (__DEV__) {\n logger({\n type: 'warn',\n message: `Could not open the link \"href=${href}\"`,\n moduleName: 'BaseButton',\n });\n }\n }\n};\n\nconst _StyledBaseButton: React.ForwardRefRenderFunction<TextInput, StyledBaseButtonProps> = (\n {\n onClick,\n href,\n onBlur,\n onKeyDown,\n children,\n variant,\n minHeight,\n buttonPaddingTop,\n buttonPaddingBottom,\n buttonPaddingLeft,\n buttonPaddingRight,\n isFullWidth,\n disabled,\n defaultBackgroundColor,\n defaultBorderColor,\n hoverBackgroundColor,\n focusBackgroundColor,\n focusRingColor,\n hoverBorderColor,\n focusBorderColor,\n borderWidth,\n borderRadius,\n motionDuration,\n motionEasing,\n isLoading,\n accessibilityProps,\n testID,\n onTouchStart,\n onTouchEnd,\n onPointerEnter,\n onPointerDown,\n onFocus,\n ...styledProps\n },\n ref,\n) => {\n const { theme } = useTheme();\n const isPressed = useSharedValue(false);\n const duration = getIn(theme.motion, motionDuration);\n const easing = getIn(theme.motion, motionEasing);\n\n const animatedStyles = useAnimatedStyle(() => {\n return {\n backgroundColor: withTiming(isPressed.value ? focusBackgroundColor : defaultBackgroundColor, {\n duration,\n easing,\n }),\n ...(variant !== 'tertiary' && {\n borderColor: withTiming(isPressed.value ? focusBorderColor : defaultBorderColor, {\n duration,\n easing,\n }),\n }),\n };\n });\n\n const handleOnPress = (event: GestureResponderEvent): void => {\n if (href) {\n void openURL(href);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n return (\n <StyledPressable\n {...styledProps}\n {...accessibilityProps}\n ref={ref}\n role=\"button\"\n onTouchStart={castNativeType(onTouchStart)}\n onTouchEnd={castNativeType(onTouchEnd)}\n onPointerEnter={castNativeType(onPointerEnter)}\n onPointerDown={castNativeType(onPointerDown)}\n onFocus={castNativeType(onFocus)}\n isLoading={isLoading}\n onPress={handleOnPress}\n style={animatedStyles}\n minHeight={minHeight}\n buttonPaddingTop={buttonPaddingTop}\n buttonPaddingBottom={buttonPaddingBottom}\n buttonPaddingLeft={buttonPaddingLeft}\n buttonPaddingRight={buttonPaddingRight}\n isFullWidth={isFullWidth}\n disabled={disabled}\n defaultBackgroundColor={defaultBackgroundColor}\n defaultBorderColor={defaultBorderColor}\n hoverBackgroundColor={hoverBackgroundColor}\n focusBackgroundColor={focusBackgroundColor}\n focusRingColor={focusRingColor}\n hoverBorderColor={hoverBorderColor}\n focusBorderColor={focusBorderColor}\n borderWidth={borderWidth}\n borderRadius={borderRadius}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n testID={testID}\n >\n {({ pressed }): React.ReactNode => {\n isPressed.value = pressed;\n return children;\n }}\n </StyledPressable>\n );\n};\n\nconst StyledBaseButton = assignWithoutSideEffects(React.forwardRef(_StyledBaseButton), {\n displayName: 'StyledBaseButton',\n});\n\nexport default StyledBaseButton;\n"],"names":["StyledPressable","styled","Animated","createAnimatedComponent","Pressable","props","styledPropsCSSObject","useStyledProps","Object","assign","getStyledBaseButtonStyles","alignSelf","display","flexDirection","openURL","_ref","_asyncToGenerator","href","canOpen","Linking","canOpenURL","_unused","__DEV__","logger","type","message","moduleName","_x","apply","arguments","_StyledBaseButton","_ref2","ref","onClick","onBlur","onKeyDown","children","variant","minHeight","buttonPaddingTop","buttonPaddingBottom","buttonPaddingLeft","buttonPaddingRight","isFullWidth","disabled","defaultBackgroundColor","defaultBorderColor","hoverBackgroundColor","focusBackgroundColor","focusRingColor","hoverBorderColor","focusBorderColor","borderWidth","borderRadius","motionDuration","motionEasing","isLoading","accessibilityProps","testID","onTouchStart","onTouchEnd","onPointerEnter","onPointerDown","onFocus","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","isPressed","useSharedValue","duration","getIn","motion","easing","animatedStyles","useAnimatedStyle","backgroundColor","withTiming","value","borderColor","handleOnPress","event","_jsx","role","castNativeType","onPress","style","_ref3","pressed","StyledBaseButton","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,SAAA,CAAA,MAAA,CAAA,QAAA,CAAA,WAAA,CAAA,UAAA,CAAA,SAAA,CAAA,WAAA,CAAA,kBAAA,CAAA,qBAAA,CAAA,mBAAA,CAAA,oBAAA,CAAA,aAAA,CAAA,UAAA,CAAA,wBAAA,CAAA,oBAAA,CAAA,sBAAA,CAAA,sBAAA,CAAA,gBAAA,CAAA,kBAAA,CAAA,kBAAA,CAAA,aAAA,CAAA,cAAA,CAAA,gBAAA,CAAA,cAAA,CAAA,WAAA,CAAA,oBAAA,CAAA,QAAA,CAAA,cAAA,CAAA,YAAA,CAAA,gBAAA,CAAA,eAAA,CAAA,SAAA,CAAA,CAcA,IAAMA,eAAe,CAAGC,MAAM,CAACC,QAAQ,CAACC,uBAAuB,CAACC,SAAS,CAAC,CAAC,CAEzE,SAACC,KAAK,CAAK,CACX,IAAMC,oBAAoB,CAAGC,cAAc,CAACF,KAAK,CAAC,CAElD,OAAAG,MAAA,CAAAC,MAAA,CAAA,EAAA,CACKC,mBAAyB,CAACL,KAAK,CAAC,CAAA,CACnCM,SAAS,CAAE,QAAQ,CACnBC,OAAO,CAAE,MAAM,CACfC,aAAa,CAAE,KAAK,CAAA,CACjBP,oBAAoB,CAE3B,CAAA,CAAC,CAAC,CAE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Q,CAAEA,QAAS,CACnBC,sBAAsB,CAAEA,sBAAuB,CAC/CC,kBAAkB,CAAEA,kBAAmB,CACvCC,oBAAoB,CAAEA,oBAAqB,CAC3CC,oBAAoB,CAAEA,oBAAqB,CAC3CC,cAAc,CAAEA,cAAe,CAC/BC,gBAAgB,CAAEA,gBAAiB,CACnCC,gBAAgB,CAAEA,gBAAiB,CACnCC,WAAW,CAAEA,WAAY,CACzBC,YAAY,CAAEA,YAAa,CAC3BC,cAAc,CAAEA,cAAe,CAC/BC,YAAY,CAAEA,YAAa,CAC3BG,MAAM,CAAEA,MAAO,CAAAtB,QAAA,CAEd,SAAAA,SAAAqD,KAAA,CAAkC,KAA/BC,OAAO,CAAAD,KAAA,CAAPC,OAAO,CACTpB,SAAS,CAACU,KAAK,CAAGU,OAAO,CACzB,OAAOtD,SAAQ,CACjB,CAAC,CACc,CAAA,CAAC,CAEtB,CAAC,CAEK,IAAAuD,gBAAgB,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAAChE,iBAAiB,CAAC,CAAE,CACrFiE,WAAW,CAAE,kBACf,CAAC;;;;"}
@@ -0,0 +1,7 @@
1
+ import { throwBladeError } from '../../utils/logger/logger.js';
2
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
+
4
+ var ButtonGroup=function ButtonGroup(_props){throwBladeError({message:'ButtonGroup is not yet implemented for React Native',moduleName:'ButtonGroup'});return jsx(Fragment,{});};
5
+
6
+ export { ButtonGroup };
7
+ //# sourceMappingURL=ButtonGroup.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonGroup.native.js","sources":["../../../../../src/components/ButtonGroup/ButtonGroup.native.tsx"],"sourcesContent":["import type { ButtonGroupProps } from './types';\nimport { throwBladeError } from '~utils/logger';\n\nconst ButtonGroup = (_props: ButtonGroupProps): React.ReactElement => {\n throwBladeError({\n message: 'ButtonGroup is not yet implemented for React Native',\n moduleName: 'ButtonGroup',\n });\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <></>;\n};\n\nexport { ButtonGroup };\n"],"names":["ButtonGroup","_props","throwBladeError","message","moduleName","_jsx","_Fragment"],"mappings":";;;AAGM,IAAAA,WAAW,CAAG,SAAdA,WAAWA,CAAIC,MAAwB,CAAyB,CACpEC,eAAe,CAAC,CACdC,OAAO,CAAE,qDAAqD,CAC9DC,UAAU,CAAE,aACd,CAAC,CAAC,CAGF,OAAOC,GAAA,CAAAC,QAAA,CAAA,EAAI,CAAC,CACd;;;;"}
@@ -0,0 +1,6 @@
1
+ import React__default from 'react';
2
+
3
+ var ButtonGroupContext=React__default.createContext({});ButtonGroupContext.Provider;var useButtonGroupContext=function useButtonGroupContext(){var context=React__default.useContext(ButtonGroupContext);return context;};
4
+
5
+ export { useButtonGroupContext };
6
+ //# sourceMappingURL=ButtonGroupContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonGroupContext.js","sources":["../../../../../src/components/ButtonGroup/ButtonGroupContext.tsx"],"sourcesContent":["import React from 'react';\nimport type { ButtonGroupContextType } from './types';\n\nconst ButtonGroupContext = React.createContext<ButtonGroupContextType>({});\nconst ButtonGroupProvider = ButtonGroupContext.Provider;\n\nconst useButtonGroupContext = (): ButtonGroupContextType => {\n const context = React.useContext(ButtonGroupContext);\n return context;\n};\n\nexport { useButtonGroupContext, ButtonGroupProvider };\n"],"names":["ButtonGroupContext","React","createContext","Provider","useButtonGroupContext","context","useContext"],"mappings":";;AAGA,IAAMA,kBAAkB,CAAGC,cAAK,CAACC,aAAa,CAAyB,EAAE,CAAC,CAC9CF,kBAAkB,CAACG,SAEzC,IAAAC,qBAAqB,CAAG,SAAxBA,qBAAqBA,EAAiC,CAC1D,IAAMC,OAAO,CAAGJ,cAAK,CAACK,UAAU,CAACN,kBAAkB,CAAC,CACpD,OAAOK,OAAO,CAChB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleBodyContent.native.js","sources":["../../../../../src/components/Collapsible/CollapsibleBodyContent.native.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useCallback, useEffect, useState } from 'react';\nimport styled from 'styled-components/native';\nimport Animated, {\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\nimport type { CollapsibleBodyContentProps } from './types';\nimport { useCollapsible } from './CollapsibleContext';\nimport {\n getCollapsibleBodyContentBoxProps,\n getOpacity,\n getTransitionDuration,\n getTransitionEasing,\n} from './commonStyles';\nimport { nativeStyles } from './styles.native';\nimport { Box } from '~components/Box';\nimport { useTheme } from '~components/BladeProvider';\nimport { castNativeType } from '~utils';\n\ntype AnimatedStyledCollapsibleBodyContentProps = {\n isExpanded: boolean;\n};\n\nconst AnimatedStyledCollapsibleBodyContent = styled(\n Animated.View,\n)<AnimatedStyledCollapsibleBodyContentProps>(() => {\n return {\n overflow: 'hidden',\n };\n});\n\nconst CollapsibleBodyContent = ({ children }: CollapsibleBodyContentProps): ReactElement => {\n const { isExpanded, direction } = useCollapsible();\n const { theme } = useTheme();\n\n const opacity = useSharedValue(getOpacity({ isExpanded }));\n\n // `undefined` implies no height restrictions which is analogous to `auto` on web\n const height = useSharedValue(isExpanded ? undefined : 0);\n const [layoutHeight, setLayoutHeight] = useState(0);\n\n // Keeps track of running animation to control absolute / relative positioning and handling layout event\n const [isAnimating, setIsAnimating] = useState(false);\n const onAnimationComplete = useCallback((): void => {\n // Only mark the animation complete before the next repaint, otherwise, sometimes leads to state update delays when you try to quickly toggle multiple times\n requestAnimationFrame(() => setIsAnimating(false));\n }, []);\n\n const duration = castNativeType(getTransitionDuration(theme));\n const easing = castNativeType(getTransitionEasing(theme));\n\n useEffect(() => {\n setIsAnimating(true);\n\n opacity.value = withTiming(getOpacity({ isExpanded }), { duration, easing });\n height.value = withTiming(\n // Animates the height to the measured value\n isExpanded && layoutHeight ? layoutHeight : 0,\n { duration, easing },\n (isComplete) => {\n // Only run this if the animation ran uninterrupted, for eg collapsing the content before it expanded fully\n if (isComplete) {\n // The callback `onAnimationComplete` has to be declared outside this, on JS thread\n runOnJS(onAnimationComplete)();\n }\n },\n );\n }, [isExpanded, opacity, duration, easing, height, layoutHeight, onAnimationComplete]);\n\n const animatedStyles = useAnimatedStyle(() => {\n return {\n opacity: opacity.value,\n height: height.value,\n };\n });\n\n /**\n * Tracks the height of content so we can animate height to and from 0 to the content's height.\n * **Note:** We can't animate height from 0 to auto or vice-versa.\n */\n const onLayout: (event: LayoutChangeEvent) => void = useCallback(\n (event) => {\n if (isAnimating) {\n if (event.nativeEvent.layout.height > layoutHeight) {\n /**\n * During animation, we set `layoutHeight` if the native event's layout height is larger.\n *\n * The greater than comparison is needed because sometimes the native event's layout height is smaller than actual content height 🤯\n * For example, this happens if you try to render a lengthy `Text` that wraps onto multiple lines.\n * In this case the initial native event's layout height only counts height of `Text` as if it were single line.\n * So, when the `Text` actually renders on screen and wraps, another `nativeEvent` is triggered which gives us the actual content height.\n * `nativeEvent` is triggered multiple times during animation but we only set `layoutHeight` if the height value is greater, hence the check.\n */\n setLayoutHeight(event.nativeEvent.layout.height);\n }\n } else if (event.nativeEvent.layout.height !== layoutHeight) {\n /**\n * When not animating, we set `layoutHeight` anytime `nativeEvent` layout height changes.\n * This handles userland dynamic content inside the slot.\n */\n setLayoutHeight(event.nativeEvent.layout.height);\n }\n },\n [layoutHeight, isAnimating],\n );\n\n return (\n <AnimatedStyledCollapsibleBodyContent isExpanded={isExpanded} style={animatedStyles}>\n <View\n onLayout={onLayout}\n /**\n * This View is positioned absolute in collapsed state so `onLayout` can capture the height of the content.\n * During animation, it's positioned relative so height related animation can happen, pushing adjacent content down or up.\n */\n style={\n isExpanded || isAnimating\n ? nativeStyles.collapsibleBodyExpanded\n : nativeStyles.collapsibleBodyCollapsed\n }\n >\n <Box {...getCollapsibleBodyContentBoxProps({ direction })}>{children}</Box>\n </View>\n </AnimatedStyledCollapsibleBodyContent>\n );\n};\n\nexport { CollapsibleBodyContent };\n"],"names":["AnimatedStyledCollapsibleBodyContent","styled","Animated","View","overflow","CollapsibleBodyContent","_ref","children","_useCollapsible","useCollapsible","isExpanded","direction","_useTheme","useTheme","theme","opacity","useSharedValue","getOpacity","height","undefined","_useState","useState","_useState2","_slicedToArray","layoutHeight","setLayoutHeight","_useState3","_useState4","isAnimating","setIsAnimating","onAnimationComplete","useCallback","requestAnimationFrame","duration","castNativeType","getTransitionDuration","easing","getTransitionEasing","useEffect","value","withTiming","isComplete","runOnJS","animatedStyles","useAnimatedStyle","onLayout","event","nativeEvent","layout","_jsx","style","nativeStyles","collapsibleBodyExpanded","collapsibleBodyCollapsed","Box","Object","assign","getCollapsibleBodyContentBoxProps"],"mappings":";;;;;;;;;;;;;;;;AA4BA,IAAMA,oCAAoC,CAAGC,MAAM,CACjDC,QAAQ,CAACC,IACX,CAAC,CAA4C,UAAM,CACjD,OAAO,CACLC,QAAQ,CAAE,QACZ,CAAC,CACH,CAAC,CAAC,CAEI,IAAAC,sBAAsB,CAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,CAAgE,CAAA,IAA1DC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACxC,IAAAC,eAAA,CAAkCC,cAAc,EAAE,CAA1CC,UAAU,CAAAF,eAAA,CAAVE,UAAU,CAAEC,SAAS,CAAAH,eAAA,CAATG,SAAS,CAC7B,IAAAC,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CAEb,IAAMC,OAAO,CAAGC,cAAc,CAACC,UAAU,CAAC,CAAEP,UAAU,CAAVA,UAAW,CAAC,CAAC,CAAC,CAG1D,IAAMQ,MAAM,CAAGF,cAAc,CAACN,UAAU,CAAGS,SAAS,CAAG,CAAC,CAAC,CACzD,IAAAC,SAAA,CAAwCC,QAAQ,CAAC,CAAC,CAAC,CAAAC,UAAA,CAAAC,cAAA,CAAAH,SAAA,CAA5CI,CAAAA,CAAAA,CAAAA,YAAY,CAAAF,UAAA,CAA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UAAM,CAC5C,OAAO,CACL7B,OAAO,CAAEA,OAAO,CAACwB,KAAK,CACtBrB,MAAM,CAAEA,MAAM,CAACqB,KACjB,CAAC,CACH,CAAC,CAAC,CAMF,IAAMM,QAA4C,CAAGd,WAAW,CAC9D,SAACe,KAAK,CAAK,CACT,GAAIlB,WAAW,CAAE,CACf,GAAIkB,KAAK,CAACC,WAAW,CAACC,MAAM,CAAC9B,MAAM,CAAGM,YAAY,CAAE,CAUlDC,eAAe,CAACqB,KAAK,CAACC,WAAW,CAACC,MAAM,CAAC9B,MAAM,CAAC,CAClD,CACF,CAAC,KAAM,GAAI4B,KAAK,CAACC,WAAW,CAACC,MAAM,CAAC9B,MAAM,GAAKM,YAAY,CAAE,CAK3DC,eAAe,CAACqB,KAAK,CAACC,WAAW,CAACC,MAAM,CAAC9B,MAAM,CAAC,CAClD,CACF,CAAC,CACD,CAACM,YAAY,CAAEI,WAAW,CAC5B,CAAC,CAED,OACEqB,GAAA,CAACjD,oCAAoC,CAAA,CAACU,UAAU,CAAEA,UAAW,CAACwC,KAAK,CAAEP,cAAe,CAAApC,QAAA,CAClF0C,GAAA,CAAC9C,IAAI,CAAA,CACH0C,QAAQ,CAAEA,QAAS,CAKnBK,KAAK,CACHxC,UAAU,EAAIkB,WAAW,CACrBuB,YAAY,CAACC,uBAAuB,CACpCD,YAAY,CAACE,wBAClB,CAAA9C,QAAA,CAED0C,GAAA,CAACK,GAAG,CAAAC,MAAA,CAAAC,MAAA,CAAKC,EAAAA,CAAAA,iCAAiC,CAAC,CAAE9C,SAAS,CAATA,SAAU,CAAC,CAAC,CAAA,CAAAJ,QAAA,CAAGA,QAAQ,CAAA,CAAM,CAAC,CACvE,CAAC,CAC6B,CAAC,CAE3C;;;;"}
1
+ {"version":3,"file":"CollapsibleBodyContent.native.js","sources":["../../../../../src/components/Collapsible/CollapsibleBodyContent.native.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useCallback, useEffect, useState } from 'react';\nimport styled from 'styled-components/native';\nimport Animated, {\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport type { LayoutChangeEvent, ViewStyle } from 'react-native';\nimport { View } from 'react-native';\nimport type { CollapsibleBodyContentProps } from './types';\nimport { useCollapsible } from './CollapsibleContext';\nimport {\n getCollapsibleBodyContentBoxProps,\n getOpacity,\n getTransitionDuration,\n getTransitionEasing,\n} from './commonStyles';\nimport { nativeStyles } from './styles.native';\nimport { Box } from '~components/Box';\nimport { useTheme } from '~components/BladeProvider';\nimport { castNativeType } from '~utils';\n\ntype AnimatedStyledCollapsibleBodyContentProps = {\n isExpanded: boolean;\n};\n\nconst AnimatedStyledCollapsibleBodyContent = styled(\n Animated.View,\n)<AnimatedStyledCollapsibleBodyContentProps>(() => {\n return {\n overflow: 'hidden',\n };\n});\n\nconst CollapsibleBodyContent = ({ children }: CollapsibleBodyContentProps): ReactElement => {\n const { isExpanded, direction } = useCollapsible();\n const { theme } = useTheme();\n\n const opacity = useSharedValue(getOpacity({ isExpanded }));\n\n // `undefined` implies no height restrictions which is analogous to `auto` on web\n const height = useSharedValue(isExpanded ? undefined : 0);\n const [layoutHeight, setLayoutHeight] = useState(0);\n\n // Keeps track of running animation to control absolute / relative positioning and handling layout event\n const [isAnimating, setIsAnimating] = useState(false);\n const onAnimationComplete = useCallback((): void => {\n // Only mark the animation complete before the next repaint, otherwise, sometimes leads to state update delays when you try to quickly toggle multiple times\n requestAnimationFrame(() => setIsAnimating(false));\n }, []);\n\n const duration = castNativeType(getTransitionDuration(theme));\n const easing = castNativeType(getTransitionEasing(theme));\n\n useEffect(() => {\n setIsAnimating(true);\n\n opacity.value = withTiming(getOpacity({ isExpanded }), { duration, easing });\n height.value = withTiming(\n // Animates the height to the measured value\n isExpanded && layoutHeight ? layoutHeight : 0,\n { duration, easing },\n (isComplete) => {\n // Only run this if the animation ran uninterrupted, for eg collapsing the content before it expanded fully\n if (isComplete) {\n // The callback `onAnimationComplete` has to be declared outside this, on JS thread\n runOnJS(onAnimationComplete)();\n }\n },\n );\n }, [isExpanded, opacity, duration, easing, height, layoutHeight, onAnimationComplete]);\n\n const animatedStyles = useAnimatedStyle(\n (): ViewStyle => {\n return {\n opacity: opacity.value,\n height: height.value,\n };\n },\n );\n\n /**\n * Tracks the height of content so we can animate height to and from 0 to the content's height.\n * **Note:** We can't animate height from 0 to auto or vice-versa.\n */\n const onLayout: (event: LayoutChangeEvent) => void = useCallback(\n (event) => {\n if (isAnimating) {\n if (event.nativeEvent.layout.height > layoutHeight) {\n /**\n * During animation, we set `layoutHeight` if the native event's layout height is larger.\n *\n * The greater than comparison is needed because sometimes the native event's layout height is smaller than actual content height 🤯\n * For example, this happens if you try to render a lengthy `Text` that wraps onto multiple lines.\n * In this case the initial native event's layout height only counts height of `Text` as if it were single line.\n * So, when the `Text` actually renders on screen and wraps, another `nativeEvent` is triggered which gives us the actual content height.\n * `nativeEvent` is triggered multiple times during animation but we only set `layoutHeight` if the height value is greater, hence the check.\n */\n setLayoutHeight(event.nativeEvent.layout.height);\n }\n } else if (event.nativeEvent.layout.height !== layoutHeight) {\n /**\n * When not animating, we set `layoutHeight` anytime `nativeEvent` layout height changes.\n * This handles userland dynamic content inside the slot.\n */\n setLayoutHeight(event.nativeEvent.layout.height);\n }\n },\n [layoutHeight, isAnimating],\n );\n\n return (\n <AnimatedStyledCollapsibleBodyContent isExpanded={isExpanded} style={animatedStyles}>\n <View\n onLayout={onLayout}\n /**\n * This View is positioned absolute in collapsed state so `onLayout` can capture the height of the content.\n * During animation, it's positioned relative so height related animation can happen, pushing adjacent content down or up.\n */\n style={\n isExpanded || isAnimating\n ? nativeStyles.collapsibleBodyExpanded\n : nativeStyles.collapsibleBodyCollapsed\n }\n >\n <Box {...getCollapsibleBodyContentBoxProps({ direction })}>{children}</Box>\n </View>\n </AnimatedStyledCollapsibleBodyContent>\n );\n};\n\nexport { CollapsibleBodyContent };\n"],"names":["AnimatedStyledCollapsibleBodyContent","styled","Animated","View","overflow","CollapsibleBodyContent","_ref","children","_useCollapsible","useCollapsible","isExpanded","direction","_useTheme","useTheme","theme","opacity","useSharedValue","getOpacity","height","undefined","_useState","useState","_useState2","_slicedToArray","layoutHeight","setLayoutHeight","_useState3","_useState4","isAnimating","setIsAnimating","onAnimationComplete","useCallback","requestAnimationFrame","duration","castNativeType","getTransitionDuration","easing","getTransitionEasing","useEffect","value","withTiming","isComplete","runOnJS","animatedStyles","useAnimatedStyle","onLayout","event","nativeEvent","layout","_jsx","style","nativeStyles","collapsibleBodyExpanded","collapsibleBodyCollapsed","Box","Object","assign","getCollapsibleBodyContentBoxProps"],"mappings":";;;;;;;;;;;;;;;;AA4BA,IAAMA,oCAAoC,CAAGC,MAAM,CACjDC,QAAQ,CAACC,IACX,CAAC,CAA4C,UAAM,CACjD,OAAO,CACLC,QAAQ,CAAE,QACZ,CAAC,CACH,CAAC,CAAC,CAEI,IAAAC,sBAAsB,CAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,CAAgE,CAAA,IAA1DC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACxC,IAAAC,eAAA,CAAkCC,cAAc,EAAE,CAA1CC,UAAU,CAAAF,eAAA,CAAVE,UAAU,CAAEC,SAAS,CAAAH,eAAA,CAATG,SAAS,CAC7B,IAAAC,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CAEb,IAAMC,OAAO,CAAGC,cAAc,CAACC,UAAU,CAAC,CAAEP,UAAU,CAAVA,UAAW,CAAC,CAAC,CAAC,CAG1D,IAAMQ,MAAM,CAAGF,cAAc,CAACN,UAAU,CAAGS,SAAS,CAAG,CAAC,CAAC,CACzD,IAAAC,SAAA,CAAwCC,QAAQ,CAAC,CAAC,CAAC,CAAAC,UAAA,CAAAC,cAAA,CAAAH,SAAA,CAA5CI,CAAAA,CAAAA,CAAAA,YAAY,CAAAF,UAAA,CAAEG,CAAAA,CAAAA,CAAAA,eAAe,CAAAH,UAAA,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