@razorpay/blade 11.3.1 → 11.5.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 (180) hide show
  1. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +3 -1
  2. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  3. package/build/lib/native/components/BottomSheet/BottomSheet.native.js +2 -1
  4. package/build/lib/native/components/BottomSheet/BottomSheet.native.js.map +1 -1
  5. package/build/lib/native/components/Breadcrumb/Breadcrumb.native.js +7 -0
  6. package/build/lib/native/components/Breadcrumb/Breadcrumb.native.js.map +1 -0
  7. package/build/lib/native/components/Breadcrumb/BreadcrumbItem.native.js +7 -0
  8. package/build/lib/native/components/Breadcrumb/BreadcrumbItem.native.js.map +1 -0
  9. package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
  10. package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
  11. package/build/lib/native/components/Drawer/Drawer.native.js +17 -0
  12. package/build/lib/native/components/Drawer/Drawer.native.js.map +1 -0
  13. package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js +17 -0
  14. package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js.map +1 -0
  15. package/build/lib/native/components/Link/BaseLink/BaseLink.js +1 -1
  16. package/build/lib/native/components/Link/BaseLink/BaseLink.js.map +1 -1
  17. package/build/lib/native/components/Popover/Popover.native.js +3 -2
  18. package/build/lib/native/components/Popover/Popover.native.js.map +1 -1
  19. package/build/lib/native/components/Popover/constants.js +2 -2
  20. package/build/lib/native/components/Popover/constants.js.map +1 -1
  21. package/build/lib/native/components/Tag/Tag.js +1 -1
  22. package/build/lib/native/components/Tag/Tag.js.map +1 -1
  23. package/build/lib/native/components/Tooltip/Tooltip.native.js +3 -2
  24. package/build/lib/native/components/Tooltip/Tooltip.native.js.map +1 -1
  25. package/build/lib/native/components/Tooltip/constants.js +2 -2
  26. package/build/lib/native/components/Tooltip/constants.js.map +1 -1
  27. package/build/lib/native/components/index.js +4 -0
  28. package/build/lib/native/components/index.js.map +1 -1
  29. package/build/lib/native/utils/componentZIndices.js +4 -0
  30. package/build/lib/native/utils/componentZIndices.js.map +1 -0
  31. package/build/lib/native/utils/lodashButBetter/get.js.map +1 -1
  32. package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
  33. package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
  34. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +6 -2
  35. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  36. package/build/lib/web/development/components/BladeProvider/BladeProvider.web.js +5 -2
  37. package/build/lib/web/development/components/BladeProvider/BladeProvider.web.js.map +1 -1
  38. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +2 -1
  39. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
  40. package/build/lib/web/development/components/Breadcrumb/Breadcrumb.web.js +104 -0
  41. package/build/lib/web/development/components/Breadcrumb/Breadcrumb.web.js.map +1 -0
  42. package/build/lib/web/development/components/Breadcrumb/BreadcrumbContext.js +9 -0
  43. package/build/lib/web/development/components/Breadcrumb/BreadcrumbContext.js.map +1 -0
  44. package/build/lib/web/development/components/Breadcrumb/BreadcrumbItem.web.js +55 -0
  45. package/build/lib/web/development/components/Breadcrumb/BreadcrumbItem.web.js.map +1 -0
  46. package/build/lib/web/development/components/Breadcrumb/index.js +4 -0
  47. package/build/lib/web/development/components/Breadcrumb/index.js.map +1 -0
  48. package/build/lib/web/development/components/Breadcrumb/types.js +2 -0
  49. package/build/lib/web/development/components/Breadcrumb/types.js.map +1 -0
  50. package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +2 -2
  51. package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
  52. package/build/lib/web/development/components/Button/Button/index.js +1 -1
  53. package/build/lib/web/development/components/Drawer/Drawer.web.js +229 -0
  54. package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -0
  55. package/build/lib/web/development/components/Drawer/DrawerContext.js +9 -0
  56. package/build/lib/web/development/components/Drawer/DrawerContext.js.map +1 -0
  57. package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js +65 -0
  58. package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js.map +1 -0
  59. package/build/lib/web/development/components/Drawer/StackProvider.js +57 -0
  60. package/build/lib/web/development/components/Drawer/StackProvider.js.map +1 -0
  61. package/build/lib/web/development/components/Drawer/drawerComponentIds.js +8 -0
  62. package/build/lib/web/development/components/Drawer/drawerComponentIds.js.map +1 -0
  63. package/build/lib/web/development/components/Drawer/index.js +4 -0
  64. package/build/lib/web/development/components/Drawer/index.js.map +1 -0
  65. package/build/lib/web/development/components/Drawer/types.js +2 -0
  66. package/build/lib/web/development/components/Drawer/types.js.map +1 -0
  67. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +2 -2
  68. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  69. package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +3 -1
  70. package/build/lib/web/development/components/Link/BaseLink/BaseLink.js.map +1 -1
  71. package/build/lib/web/development/components/Link/Link/index.js +1 -1
  72. package/build/lib/web/development/components/Modal/Modal.web.js +3 -2
  73. package/build/lib/web/development/components/Modal/Modal.web.js.map +1 -1
  74. package/build/lib/web/development/components/Modal/ModalHeader.web.js +2 -2
  75. package/build/lib/web/development/components/Modal/ModalHeader.web.js.map +1 -1
  76. package/build/lib/web/development/components/Modal/modalTokens.js +1 -2
  77. package/build/lib/web/development/components/Modal/modalTokens.js.map +1 -1
  78. package/build/lib/web/development/components/Popover/Popover.web.js +3 -2
  79. package/build/lib/web/development/components/Popover/Popover.web.js.map +1 -1
  80. package/build/lib/web/development/components/Popover/constants.js +1 -2
  81. package/build/lib/web/development/components/Popover/constants.js.map +1 -1
  82. package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +2 -2
  83. package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
  84. package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js +3 -2
  85. package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
  86. package/build/lib/web/development/components/SpotlightPopoverTour/tourTokens.js +1 -3
  87. package/build/lib/web/development/components/SpotlightPopoverTour/tourTokens.js.map +1 -1
  88. package/build/lib/web/development/components/Tag/AnimatedTag.web.js +1 -1
  89. package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
  90. package/build/lib/web/development/components/Tag/Tag.js +1 -0
  91. package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
  92. package/build/lib/web/development/components/Tooltip/Tooltip.web.js +3 -2
  93. package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
  94. package/build/lib/web/development/components/Tooltip/constants.js +1 -2
  95. package/build/lib/web/development/components/Tooltip/constants.js.map +1 -1
  96. package/build/lib/web/development/components/index.js +6 -0
  97. package/build/lib/web/development/components/index.js.map +1 -1
  98. package/build/lib/web/development/utils/componentZIndices.js +13 -0
  99. package/build/lib/web/development/utils/componentZIndices.js.map +1 -0
  100. package/build/lib/web/development/utils/lodashButBetter/get.js +1 -1
  101. package/build/lib/web/development/utils/lodashButBetter/get.js.map +1 -1
  102. package/build/lib/web/development/utils/metaAttribute/metaConstants.js +3 -0
  103. package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
  104. package/build/lib/web/development/utils/useVerifyAllowedChildren/index.js +2 -0
  105. package/build/lib/web/development/utils/useVerifyAllowedChildren/index.js.map +1 -0
  106. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +6 -2
  107. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  108. package/build/lib/web/production/components/BladeProvider/BladeProvider.web.js +5 -2
  109. package/build/lib/web/production/components/BladeProvider/BladeProvider.web.js.map +1 -1
  110. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +2 -1
  111. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
  112. package/build/lib/web/production/components/Breadcrumb/Breadcrumb.web.js +104 -0
  113. package/build/lib/web/production/components/Breadcrumb/Breadcrumb.web.js.map +1 -0
  114. package/build/lib/web/production/components/Breadcrumb/BreadcrumbContext.js +9 -0
  115. package/build/lib/web/production/components/Breadcrumb/BreadcrumbContext.js.map +1 -0
  116. package/build/lib/web/production/components/Breadcrumb/BreadcrumbItem.web.js +55 -0
  117. package/build/lib/web/production/components/Breadcrumb/BreadcrumbItem.web.js.map +1 -0
  118. package/build/lib/web/production/components/Breadcrumb/index.js +4 -0
  119. package/build/lib/web/production/components/Breadcrumb/index.js.map +1 -0
  120. package/build/lib/web/production/components/Breadcrumb/types.js +2 -0
  121. package/build/lib/web/production/components/Breadcrumb/types.js.map +1 -0
  122. package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +2 -2
  123. package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
  124. package/build/lib/web/production/components/Button/Button/index.js +1 -1
  125. package/build/lib/web/production/components/Drawer/Drawer.web.js +229 -0
  126. package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -0
  127. package/build/lib/web/production/components/Drawer/DrawerContext.js +9 -0
  128. package/build/lib/web/production/components/Drawer/DrawerContext.js.map +1 -0
  129. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js +65 -0
  130. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -0
  131. package/build/lib/web/production/components/Drawer/StackProvider.js +57 -0
  132. package/build/lib/web/production/components/Drawer/StackProvider.js.map +1 -0
  133. package/build/lib/web/production/components/Drawer/drawerComponentIds.js +8 -0
  134. package/build/lib/web/production/components/Drawer/drawerComponentIds.js.map +1 -0
  135. package/build/lib/web/production/components/Drawer/index.js +4 -0
  136. package/build/lib/web/production/components/Drawer/index.js.map +1 -0
  137. package/build/lib/web/production/components/Drawer/types.js +2 -0
  138. package/build/lib/web/production/components/Drawer/types.js.map +1 -0
  139. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +2 -2
  140. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  141. package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +3 -1
  142. package/build/lib/web/production/components/Link/BaseLink/BaseLink.js.map +1 -1
  143. package/build/lib/web/production/components/Link/Link/index.js +1 -1
  144. package/build/lib/web/production/components/Modal/Modal.web.js +3 -2
  145. package/build/lib/web/production/components/Modal/Modal.web.js.map +1 -1
  146. package/build/lib/web/production/components/Modal/ModalHeader.web.js +2 -2
  147. package/build/lib/web/production/components/Modal/ModalHeader.web.js.map +1 -1
  148. package/build/lib/web/production/components/Modal/modalTokens.js +1 -2
  149. package/build/lib/web/production/components/Modal/modalTokens.js.map +1 -1
  150. package/build/lib/web/production/components/Popover/Popover.web.js +3 -2
  151. package/build/lib/web/production/components/Popover/Popover.web.js.map +1 -1
  152. package/build/lib/web/production/components/Popover/constants.js +1 -2
  153. package/build/lib/web/production/components/Popover/constants.js.map +1 -1
  154. package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +2 -2
  155. package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
  156. package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js +3 -2
  157. package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
  158. package/build/lib/web/production/components/SpotlightPopoverTour/tourTokens.js +1 -3
  159. package/build/lib/web/production/components/SpotlightPopoverTour/tourTokens.js.map +1 -1
  160. package/build/lib/web/production/components/Tag/AnimatedTag.web.js +1 -1
  161. package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
  162. package/build/lib/web/production/components/Tag/Tag.js +1 -0
  163. package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
  164. package/build/lib/web/production/components/Tooltip/Tooltip.web.js +3 -2
  165. package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
  166. package/build/lib/web/production/components/Tooltip/constants.js +1 -2
  167. package/build/lib/web/production/components/Tooltip/constants.js.map +1 -1
  168. package/build/lib/web/production/components/index.js +6 -0
  169. package/build/lib/web/production/components/index.js.map +1 -1
  170. package/build/lib/web/production/utils/componentZIndices.js +13 -0
  171. package/build/lib/web/production/utils/componentZIndices.js.map +1 -0
  172. package/build/lib/web/production/utils/lodashButBetter/get.js +1 -1
  173. package/build/lib/web/production/utils/lodashButBetter/get.js.map +1 -1
  174. package/build/lib/web/production/utils/metaAttribute/metaConstants.js +3 -0
  175. package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
  176. package/build/lib/web/production/utils/useVerifyAllowedChildren/index.js +2 -0
  177. package/build/lib/web/production/utils/useVerifyAllowedChildren/index.js.map +1 -0
  178. package/build/types/components/index.d.ts +332 -140
  179. package/build/types/components/index.native.d.ts +282 -141
  180. package/package.json +9 -57
@@ -1 +1 @@
1
- {"version":3,"file":"BaseLink.js","sources":["../../../../../../src/components/Link/BaseLink/BaseLink.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/prefer-ts-expect-error */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport type { SyntheticEvent } from 'react';\nimport React from 'react';\nimport type { CSSObject } from 'styled-components';\nimport type { GestureResponderEvent } from 'react-native';\nimport StyledBaseLink from './StyledBaseLink';\nimport getIn from '~utils/lodashButBetter/get';\nimport useInteraction from '~utils/useInteraction';\nimport type { IconColors, IconComponent, IconProps } from '~components/Icons';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { BaseText } from '~components/Typography/BaseText';\nimport type {\n DotNotationSpacingStringToken,\n StringChildrenType,\n TestID,\n BladeElementRef,\n} from '~utils/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { DurationString, EasingString, FontSize, Typography } from '~tokens/global';\nimport type {\n BaseTextProps,\n BaseTextSizes,\n TextColors,\n} from '~components/Typography/BaseText/types';\nimport { getStringFromReactText } from '~src/utils/getStringChildren';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeCommonEvents } from '~components/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport type { ActionStates } from '~utils/useInteraction';\n\ntype BaseLinkCommonProps = {\n color?: 'primary' | 'white' | 'positive' | 'negative' | 'notice' | 'information' | 'neutral';\n icon?: IconComponent;\n iconPosition?: 'left' | 'right';\n onClick?: (event: SyntheticEvent) => void;\n onBlur?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.FocusEvent<HTMLButtonElement>) => void;\n }>;\n onMouseLeave?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }>;\n onKeyDown?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.KeyboardEvent<HTMLButtonElement>) => void;\n }>;\n accessibilityProps?: Partial<AccessibilityProps>;\n\n /**\n * Sets the size of the link\n *\n * @default medium\n */\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n /**\n * Defines how far your touch can start away from the link. This is a react-native only prop and has no effect on web.\n */\n hitSlop?:\n | {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n }\n | number;\n /**\n * The title of the link which is displayed as a tooltip. This is a web only prop and has no effect on react-native.\n */\n htmlTitle?: string;\n} & TestID &\n StyledPropsBlade &\n Omit<BladeCommonEvents, 'onBlur' | 'onMouseLeave'>;\n\n/*\n Mandatory children prop when icon is not provided\n*/\ntype BaseLinkWithoutIconProps = BaseLinkCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n*/\ntype BaseLinkWithIconProps = BaseLinkCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\n/*\n BaseLink Props with or without an icon\n*/\ntype BaseLinkPropsWithOrWithoutIcon = BaseLinkWithIconProps | BaseLinkWithoutIconProps;\n\n/*\n BaseLink Props when variant is anchor\n*/\ntype BaseLinkAnchorVariantProps = BaseLinkPropsWithOrWithoutIcon & {\n variant?: 'anchor';\n href?: string;\n target?: string;\n rel?: string;\n isDisabled?: undefined;\n};\n\n/*\n BaseLink Props when variant is button\n*/\ntype BaseLinkButtonVariantProps = BaseLinkPropsWithOrWithoutIcon & {\n variant?: 'button';\n isDisabled?: boolean;\n href?: undefined;\n target?: undefined;\n rel?: undefined;\n};\n\n/*\n BaseLink Props when variant is anchor or button\n*/\nexport type BaseLinkProps = BaseLinkAnchorVariantProps | BaseLinkButtonVariantProps;\n\ntype BaseLinkStyleProps = {\n as: 'a' | 'button';\n textDecorationLine: 'underline' | 'none';\n iconColor: IconProps['color'];\n iconSize: IconProps['size'];\n iconPadding: DotNotationSpacingStringToken;\n textColor: BaseTextProps['color'];\n focusRingColor: string;\n motionDuration: DurationString;\n motionEasing: EasingString;\n cursor: CSSObject['cursor'];\n disabled: boolean;\n role: 'button' | 'link';\n defaultRel: BaseLinkProps['rel'];\n type?: 'button';\n fontSize: BaseTextProps['fontSize'];\n lineHeight: BaseTextProps['lineHeight'];\n};\n\ntype LinkActionStates = ActionStates;\nconst getColorToken = ({\n variant,\n color,\n currentInteraction,\n isDisabled,\n element,\n}: {\n variant: BaseLinkProps['variant'];\n color: BaseLinkProps['color'];\n element: 'icon' | 'text';\n currentInteraction: LinkActionStates;\n isDisabled: boolean;\n}): IconColors | TextColors => {\n let state = currentInteraction;\n const map = {\n default: 'normal',\n hover: 'subtle',\n focus: 'normal',\n disabled: 'disabled',\n } as const;\n\n if (isDisabled && variant == 'button') {\n state = 'disabled';\n }\n\n if (color && color !== 'primary') {\n if (color !== 'white') {\n return `interactive.${element}.${color}.${map[state]}`;\n }\n return `interactive.${element}.staticWhite.${map[state]}`;\n }\n return `interactive.${element}.primary.${map[state]}`;\n};\n\nconst getProps = ({\n theme,\n variant,\n currentInteraction,\n children,\n isDisabled,\n color,\n target,\n size,\n}: {\n theme: Theme;\n variant: NonNullable<BaseLinkProps['variant']>;\n currentInteraction: LinkActionStates;\n children?: string;\n isDisabled: boolean;\n color: BaseLinkProps['color'];\n target: BaseLinkProps['target'];\n size: NonNullable<BaseLinkProps['size']>;\n}): BaseLinkStyleProps => {\n const isButton = variant === 'button';\n const textSizes: {\n fontSize: Record<NonNullable<BaseLinkProps['size']>, keyof FontSize>;\n lineHeight: Record<NonNullable<BaseLinkProps['size']>, keyof Typography['lineHeights']>;\n } = {\n fontSize: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n lineHeight: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n };\n\n const props: BaseLinkStyleProps = {\n as: isButton ? 'button' : 'a',\n textDecorationLine: !isButton && currentInteraction !== 'default' ? 'underline' : 'none',\n iconColor: getColorToken({\n variant,\n color,\n element: 'icon',\n currentInteraction,\n isDisabled,\n }) as IconProps['color'],\n fontSize: textSizes.fontSize[size],\n lineHeight: textSizes.lineHeight[size],\n iconSize: size,\n iconPadding: children?.trim() ? 'spacing.2' : 'spacing.0',\n textColor: getColorToken({\n variant,\n color,\n element: 'text',\n currentInteraction,\n isDisabled,\n }) as BaseTextProps['color'],\n focusRingColor: getIn(theme.colors, 'interactive.background.primary.faded'),\n motionDuration: 'duration.2xquick',\n motionEasing: 'easing.standard.effective',\n cursor: isButton && isDisabled ? 'not-allowed' : 'pointer',\n disabled: isButton && isDisabled,\n role: isButton ? 'button' : 'link',\n defaultRel: target && target === '_blank' ? 'noreferrer noopener' : undefined,\n type: isButton ? 'button' : undefined,\n };\n\n return props;\n};\n\nconst _BaseLink: React.ForwardRefRenderFunction<BladeElementRef, BaseLinkProps> = (\n {\n children,\n icon: Icon,\n iconPosition = 'left',\n isDisabled = false,\n onClick,\n onKeyDown,\n variant = 'anchor',\n href,\n target,\n rel,\n color = 'primary',\n accessibilityProps,\n // @ts-expect-error avoiding exposing to public\n className,\n // @ts-expect-error avoiding exposing to public\n style,\n size = 'medium',\n testID,\n hitSlop,\n htmlTitle,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n ...styledProps\n },\n ref,\n) => {\n const childrenString = getStringFromReactText(children);\n const { currentInteraction, setCurrentInteraction, ...syntheticEvents } = useInteraction();\n const { theme } = useTheme();\n if (__DEV__) {\n if (!Icon && !childrenString?.trim()) {\n throwBladeError({\n message: `At least one of icon or text is required to render a link.`,\n moduleName: 'BaseLink',\n });\n }\n }\n const {\n as,\n textDecorationLine,\n iconColor,\n iconPadding,\n iconSize,\n fontSize,\n textColor,\n focusRingColor,\n motionDuration,\n motionEasing,\n cursor,\n disabled,\n role,\n defaultRel,\n type,\n lineHeight,\n } = getProps({\n theme,\n variant,\n currentInteraction,\n children: childrenString,\n isDisabled,\n color,\n target,\n size,\n });\n\n const handleOnClick = (event: SyntheticEvent): void => {\n if (onClick) {\n onClick(event);\n }\n };\n\n const asProp = isReactNative() ? undefined : 'span';\n return (\n <StyledBaseLink\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.Link, testID })}\n accessibilityProps={{\n ...makeAccessible({\n role,\n disabled,\n ...accessibilityProps,\n }),\n }}\n variant={variant}\n as={as}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n onClick={handleOnClick}\n {...syntheticEvents}\n onBlur={(event: any) => {\n onBlur?.(event);\n syntheticEvents.onBlur();\n }}\n onFocus={(event: any) => {\n onFocus?.(event);\n syntheticEvents.onFocus();\n }}\n onMouseLeave={(event: any) => {\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n syntheticEvents.onMouseLeave();\n }}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={type}\n cursor={cursor}\n focusRingColor={focusRingColor}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n setCurrentInteraction={setCurrentInteraction}\n {...getStyledProps(styledProps)}\n // @ts-ignore Because we avoided exposing className to public\n className={className}\n style={style}\n hitSlop={hitSlop}\n title={htmlTitle}\n >\n <BaseBox\n as={asProp}\n display=\"flex\"\n flexDirection=\"row\"\n className=\"content-container\"\n alignItems=\"center\"\n >\n {Icon && iconPosition == 'left' ? (\n <BaseBox as={asProp} paddingRight={iconPadding} display=\"flex\" alignItems=\"center\">\n <Icon color={iconColor} size={iconSize} />\n </BaseBox>\n ) : null}\n <BaseText\n as={asProp}\n textDecorationLine={textDecorationLine}\n color={textColor}\n fontSize={fontSize}\n lineHeight={lineHeight}\n textAlign=\"center\"\n fontWeight=\"medium\"\n >\n {children}\n </BaseText>\n {Icon && iconPosition == 'right' ? (\n <BaseBox as={asProp} paddingLeft={iconPadding} display=\"flex\" alignItems=\"center\">\n <Icon color={iconColor} size={iconSize} />\n </BaseBox>\n ) : null}\n </BaseBox>\n </StyledBaseLink>\n );\n};\n\nconst BaseLink = assignWithoutSideEffects(React.forwardRef(_BaseLink), {\n displayName: 'BaseLink',\n componentId: 'BaseLink',\n});\n\nexport default BaseLink;\n"],"names":["getColorToken","_ref","variant","color","currentInteraction","isDisabled","element","state","map","default","hover","focus","disabled","getProps","_ref2","theme","children","target","size","isButton","textSizes","fontSize","xsmall","small","medium","large","lineHeight","props","as","textDecorationLine","iconColor","iconSize","iconPadding","trim","textColor","focusRingColor","getIn","colors","motionDuration","motionEasing","cursor","role","defaultRel","undefined","type","_BaseLink","_ref3","ref","Icon","icon","_ref3$iconPosition","iconPosition","_ref3$isDisabled","onClick","onKeyDown","_ref3$variant","href","rel","_ref3$color","accessibilityProps","className","style","_ref3$size","testID","hitSlop","htmlTitle","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","styledProps","_objectWithoutProperties","_excluded","childrenString","getStringFromReactText","_useInteraction","useInteraction","setCurrentInteraction","syntheticEvents","_excluded2","_useTheme","useTheme","__DEV__","throwBladeError","message","moduleName","_getProps","handleOnClick","event","asProp","isReactNative","_jsx","StyledBaseLink","Object","assign","metaAttribute","name","MetaConstants","Link","makeAccessible","getStyledProps","title","_jsxs","BaseBox","display","flexDirection","alignItems","paddingRight","BaseText","textAlign","fontWeight","paddingLeft","BaseLink","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,MAAA,CAAA,cAAA,CAAA,YAAA,CAAA,SAAA,CAAA,WAAA,CAAA,SAAA,CAAA,MAAA,CAAA,QAAA,CAAA,KAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,OAAA,CAAA,MAAA,CAAA,QAAA,CAAA,SAAA,CAAA,WAAA,CAAA,QAAA,CAAA,SAAA,CAAA,cAAA,CAAA,aAAA,CAAA,eAAA,CAAA,gBAAA,CAAA,cAAA,CAAA,YAAA,CAAA,CAAA,UAAA,CAAA,CAAA,oBAAA,CAAA,uBAAA,CAAA,CAoJA,IAAMA,aAAa,CAAG,SAAhBA,aAAaA,CAAAC,IAAA,CAYY,CAAA,IAX7BC,OAAO,CAAAD,IAAA,CAAPC,OAAO,CACPC,KAAK,CAAAF,IAAA,CAALE,KAAK,CACLC,kBAAkB,CAAAH,IAAA,CAAlBG,kBAAkB,CAClBC,UAAU,CAAAJ,IAAA,CAAVI,UAAU,CACVC,OAAO,CAAAL,IAAA,CAAPK,OAAO,CAQP,IAAIC,KAAK,CAAGH,kBAAkB,CAC9B,IAAMI,GAAG,CAAG,CACVC,OAAO,CAAE,QAAQ,C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,CAAC;;;;"}
1
+ {"version":3,"file":"BaseLink.js","sources":["../../../../../../src/components/Link/BaseLink/BaseLink.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/prefer-ts-expect-error */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport type { SyntheticEvent } from 'react';\nimport React from 'react';\nimport type { CSSObject } from 'styled-components';\nimport type { GestureResponderEvent } from 'react-native';\nimport StyledBaseLink from './StyledBaseLink';\nimport getIn from '~utils/lodashButBetter/get';\nimport useInteraction from '~utils/useInteraction';\nimport type { IconColors, IconComponent, IconProps } from '~components/Icons';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { BaseText } from '~components/Typography/BaseText';\nimport type {\n DotNotationSpacingStringToken,\n StringChildrenType,\n TestID,\n BladeElementRef,\n} from '~utils/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { DurationString, EasingString, FontSize, Typography } from '~tokens/global';\nimport type {\n BaseTextProps,\n BaseTextSizes,\n TextColors,\n} from '~components/Typography/BaseText/types';\nimport { getStringFromReactText } from '~src/utils/getStringChildren';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeCommonEvents } from '~components/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport type { ActionStates } from '~utils/useInteraction';\n\ntype BaseLinkCommonProps = {\n color?: 'primary' | 'white' | 'positive' | 'negative' | 'notice' | 'information' | 'neutral';\n icon?: IconComponent;\n iconPosition?: 'left' | 'right';\n onClick?: (event: SyntheticEvent) => void;\n onBlur?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.FocusEvent<HTMLButtonElement>) => void;\n }>;\n onMouseLeave?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }>;\n onKeyDown?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.KeyboardEvent<HTMLButtonElement>) => void;\n }>;\n accessibilityProps?: Partial<AccessibilityProps>;\n\n /**\n * Sets the size of the link\n *\n * @default medium\n */\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n /**\n * Defines how far your touch can start away from the link. This is a react-native only prop and has no effect on web.\n */\n hitSlop?:\n | {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n }\n | number;\n /**\n * The title of the link which is displayed as a tooltip. This is a web only prop and has no effect on react-native.\n */\n htmlTitle?: string;\n opacity?: number;\n} & TestID &\n StyledPropsBlade &\n Omit<BladeCommonEvents, 'onBlur' | 'onMouseLeave'>;\n\n/*\n Mandatory children prop when icon is not provided\n*/\ntype BaseLinkWithoutIconProps = BaseLinkCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n*/\ntype BaseLinkWithIconProps = BaseLinkCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\n/*\n BaseLink Props with or without an icon\n*/\ntype BaseLinkPropsWithOrWithoutIcon = BaseLinkWithIconProps | BaseLinkWithoutIconProps;\n\n/*\n BaseLink Props when variant is anchor\n*/\ntype BaseLinkAnchorVariantProps = BaseLinkPropsWithOrWithoutIcon & {\n variant?: 'anchor';\n href?: string;\n target?: string;\n rel?: string;\n isDisabled?: undefined;\n};\n\n/*\n BaseLink Props when variant is button\n*/\ntype BaseLinkButtonVariantProps = BaseLinkPropsWithOrWithoutIcon & {\n variant?: 'button';\n isDisabled?: boolean;\n href?: undefined;\n target?: undefined;\n rel?: undefined;\n};\n\n/*\n BaseLink Props when variant is anchor or button\n*/\nexport type BaseLinkProps = BaseLinkAnchorVariantProps | BaseLinkButtonVariantProps;\n\ntype BaseLinkStyleProps = {\n as: 'a' | 'button';\n textDecorationLine: 'underline' | 'none';\n iconColor: IconProps['color'];\n iconSize: IconProps['size'];\n iconPadding: DotNotationSpacingStringToken;\n textColor: BaseTextProps['color'];\n focusRingColor: string;\n motionDuration: DurationString;\n motionEasing: EasingString;\n cursor: CSSObject['cursor'];\n disabled: boolean;\n role: 'button' | 'link';\n defaultRel: BaseLinkProps['rel'];\n type?: 'button';\n fontSize: BaseTextProps['fontSize'];\n lineHeight: BaseTextProps['lineHeight'];\n};\n\ntype LinkActionStates = ActionStates;\nconst getColorToken = ({\n variant,\n color,\n currentInteraction,\n isDisabled,\n element,\n}: {\n variant: BaseLinkProps['variant'];\n color: BaseLinkProps['color'];\n element: 'icon' | 'text';\n currentInteraction: LinkActionStates;\n isDisabled: boolean;\n}): IconColors | TextColors => {\n let state = currentInteraction;\n const map = {\n default: 'normal',\n hover: 'subtle',\n focus: 'normal',\n disabled: 'disabled',\n } as const;\n\n if (isDisabled && variant == 'button') {\n state = 'disabled';\n }\n\n if (color && color !== 'primary') {\n if (color !== 'white') {\n return `interactive.${element}.${color}.${map[state]}`;\n }\n return `interactive.${element}.staticWhite.${map[state]}`;\n }\n return `interactive.${element}.primary.${map[state]}`;\n};\n\nconst getProps = ({\n theme,\n variant,\n currentInteraction,\n children,\n isDisabled,\n color,\n target,\n size,\n}: {\n theme: Theme;\n variant: NonNullable<BaseLinkProps['variant']>;\n currentInteraction: LinkActionStates;\n children?: string;\n isDisabled: boolean;\n color: BaseLinkProps['color'];\n target: BaseLinkProps['target'];\n size: NonNullable<BaseLinkProps['size']>;\n}): BaseLinkStyleProps => {\n const isButton = variant === 'button';\n const textSizes: {\n fontSize: Record<NonNullable<BaseLinkProps['size']>, keyof FontSize>;\n lineHeight: Record<NonNullable<BaseLinkProps['size']>, keyof Typography['lineHeights']>;\n } = {\n fontSize: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n lineHeight: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n };\n\n const props: BaseLinkStyleProps = {\n as: isButton ? 'button' : 'a',\n textDecorationLine: !isButton && currentInteraction !== 'default' ? 'underline' : 'none',\n iconColor: getColorToken({\n variant,\n color,\n element: 'icon',\n currentInteraction,\n isDisabled,\n }) as IconProps['color'],\n fontSize: textSizes.fontSize[size],\n lineHeight: textSizes.lineHeight[size],\n iconSize: size,\n iconPadding: children?.trim() ? 'spacing.2' : 'spacing.0',\n textColor: getColorToken({\n variant,\n color,\n element: 'text',\n currentInteraction,\n isDisabled,\n }) as BaseTextProps['color'],\n focusRingColor: getIn(theme.colors, 'interactive.background.primary.faded'),\n motionDuration: 'duration.2xquick',\n motionEasing: 'easing.standard.effective',\n cursor: isButton && isDisabled ? 'not-allowed' : 'pointer',\n disabled: isButton && isDisabled,\n role: isButton ? 'button' : 'link',\n defaultRel: target && target === '_blank' ? 'noreferrer noopener' : undefined,\n type: isButton ? 'button' : undefined,\n };\n\n return props;\n};\n\nconst _BaseLink: React.ForwardRefRenderFunction<BladeElementRef, BaseLinkProps> = (\n {\n children,\n icon: Icon,\n iconPosition = 'left',\n isDisabled = false,\n onClick,\n onKeyDown,\n variant = 'anchor',\n href,\n target,\n rel,\n color = 'primary',\n opacity,\n accessibilityProps,\n // @ts-expect-error avoiding exposing to public\n className,\n // @ts-expect-error avoiding exposing to public\n style,\n size = 'medium',\n testID,\n hitSlop,\n htmlTitle,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n ...styledProps\n },\n ref,\n) => {\n const childrenString = getStringFromReactText(children);\n const { currentInteraction, setCurrentInteraction, ...syntheticEvents } = useInteraction();\n const { theme } = useTheme();\n if (__DEV__) {\n if (!Icon && !childrenString?.trim()) {\n throwBladeError({\n message: `At least one of icon or text is required to render a link.`,\n moduleName: 'BaseLink',\n });\n }\n }\n const {\n as,\n textDecorationLine,\n iconColor,\n iconPadding,\n iconSize,\n fontSize,\n textColor,\n focusRingColor,\n motionDuration,\n motionEasing,\n cursor,\n disabled,\n role,\n defaultRel,\n type,\n lineHeight,\n } = getProps({\n theme,\n variant,\n currentInteraction,\n children: childrenString,\n isDisabled,\n color,\n target,\n size,\n });\n\n const handleOnClick = (event: SyntheticEvent): void => {\n if (onClick) {\n onClick(event);\n }\n };\n\n const asProp = isReactNative() ? undefined : 'span';\n return (\n <StyledBaseLink\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.Link, testID })}\n accessibilityProps={{\n ...makeAccessible({\n role,\n disabled,\n ...accessibilityProps,\n }),\n }}\n variant={variant}\n as={as}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n onClick={handleOnClick}\n {...syntheticEvents}\n onBlur={(event: any) => {\n onBlur?.(event);\n syntheticEvents.onBlur();\n }}\n onFocus={(event: any) => {\n onFocus?.(event);\n syntheticEvents.onFocus();\n }}\n onMouseLeave={(event: any) => {\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n syntheticEvents.onMouseLeave();\n }}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={type}\n cursor={cursor}\n focusRingColor={focusRingColor}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n setCurrentInteraction={setCurrentInteraction}\n {...getStyledProps(styledProps)}\n // @ts-ignore Because we avoided exposing className to public\n className={className}\n style={style}\n hitSlop={hitSlop}\n title={htmlTitle}\n >\n <BaseBox\n as={asProp}\n display=\"flex\"\n flexDirection=\"row\"\n className=\"content-container\"\n alignItems=\"center\"\n opacity={opacity}\n >\n {Icon && iconPosition == 'left' ? (\n <BaseBox as={asProp} paddingRight={iconPadding} display=\"flex\" alignItems=\"center\">\n <Icon color={iconColor} size={iconSize} />\n </BaseBox>\n ) : null}\n <BaseText\n as={asProp}\n textDecorationLine={textDecorationLine}\n color={textColor}\n fontSize={fontSize}\n lineHeight={lineHeight}\n textAlign=\"center\"\n fontWeight=\"medium\"\n >\n {children}\n </BaseText>\n {Icon && iconPosition == 'right' ? (\n <BaseBox as={asProp} paddingLeft={iconPadding} display=\"flex\" alignItems=\"center\">\n <Icon color={iconColor} size={iconSize} />\n </BaseBox>\n ) : null}\n </BaseBox>\n </StyledBaseLink>\n );\n};\n\nconst BaseLink = assignWithoutSideEffects(React.forwardRef(_BaseLink), {\n displayName: 'BaseLink',\n componentId: 'BaseLink',\n});\n\nexport default BaseLink;\n"],"names":["getColorToken","_ref","variant","color","currentInteraction","isDisabled","element","state","map","default","hover","focus","disabled","getProps","_ref2","theme","children","target","size","isButton","textSizes","fontSize","xsmall","small","medium","large","lineHeight","props","as","textDecorationLine","iconColor","iconSize","iconPadding","trim","textColor","focusRingColor","getIn","colors","motionDuration","motionEasing","cursor","role","defaultRel","undefined","type","_BaseLink","_ref3","ref","Icon","icon","_ref3$iconPosition","iconPosition","_ref3$isDisabled","onClick","onKeyDown","_ref3$variant","href","rel","_ref3$color","opacity","accessibilityProps","className","style","_ref3$size","testID","hitSlop","htmlTitle","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","styledProps","_objectWithoutProperties","_excluded","childrenString","getStringFromReactText","_useInteraction","useInteraction","setCurrentInteraction","syntheticEvents","_excluded2","_useTheme","useTheme","__DEV__","throwBladeError","message","moduleName","_getProps","handleOnClick","event","asProp","isReactNative","_jsx","StyledBaseLink","Object","assign","metaAttribute","name","MetaConstants","Link","makeAccessible","getStyledProps","title","_jsxs","BaseBox","display","flexDirection","alignItems","paddingRight","BaseText","textAlign","fontWeight","paddingLeft","BaseLink","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,MAAA,CAAA,cAAA,CAAA,YA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2B,SAAU,CAACZ,IAAI,CAAEa,QAAS,CAAE,CAAC,CACnC,CAAC,CACR,IAAI,CACRiE,GAAA,CAACiB,QAAQ,CACPrF,CAAAA,EAAE,CAAEkE,MAAO,CACXjE,kBAAkB,CAAEA,kBAAmB,CACvC1B,KAAK,CAAE+B,SAAU,CACjBb,QAAQ,CAAEA,QAAS,CACnBK,UAAU,CAAEA,UAAW,CACvBwF,SAAS,CAAC,QAAQ,CAClBC,UAAU,CAAC,QAAQ,CAAAnG,QAAA,CAElBA,QAAQ,CACD,CAAC,CACVgC,IAAI,EAAIG,YAAY,EAAI,OAAO,CAC9B6C,GAAA,CAACY,OAAO,CAAChF,CAAAA,EAAE,CAAEkE,MAAO,CAACsB,WAAW,CAAEpF,WAAY,CAAC6E,OAAO,CAAC,MAAM,CAACE,UAAU,CAAC,QAAQ,CAAA/F,QAAA,CAC/EgF,GAAA,CAAChD,IAAI,CAAC7C,CAAAA,KAAK,CAAE2B,SAAU,CAACZ,IAAI,CAAEa,QAAS,CAAE,CAAC,CACnC,CAAC,CACR,IAAI,CACD,CAAA,CAAC,CACI,CAAA,CAAC,CAErB,CAAC,CAEK,IAAAsF,QAAQ,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAAC3E,SAAS,CAAC,CAAE,CACrE4E,WAAW,CAAE,UAAU,CACvBC,WAAW,CAAE,UACf,CAAC;;;;"}
@@ -3,7 +3,7 @@ import { useFloating, shift, flip, offset, arrow } from '@floating-ui/react-nati
3
3
  import React__default from 'react';
4
4
  import { Modal, TouchableOpacity } from 'react-native';
5
5
  import { PopoverContent } from './PopoverContent.js';
6
- import { ARROW_HEIGHT, ARROW_WIDTH, popoverZIndex } from './constants.js';
6
+ import { ARROW_HEIGHT, ARROW_WIDTH } from './constants.js';
7
7
  import { PopoverContext } from './PopoverContext.js';
8
8
  import 'styled-components/native';
9
9
  import '@gorhom/portal';
@@ -17,8 +17,9 @@ import { mergeProps } from '../../utils/mergeProps.js';
17
17
  import { useControllableState } from '../../utils/useControllable.js';
18
18
  import { PopupArrow } from '../PopupArrow/PopupArrow.native.js';
19
19
  import { getFloatingPlacementParts } from '../../utils/getFloatingPlacementParts.js';
20
+ import { componentZIndices } from '../../utils/componentZIndices.js';
20
21
 
21
- var Popover=function Popover(_ref){var content=_ref.content,children=_ref.children,_ref$placement=_ref.placement,placement=_ref$placement===void 0?'top':_ref$placement,onOpenChange=_ref.onOpenChange,_ref$zIndex=_ref.zIndex,zIndex=_ref$zIndex===void 0?popoverZIndex:_ref$zIndex,title=_ref.title,titleLeading=_ref.titleLeading,footer=_ref.footer,isOpen=_ref.isOpen,defaultIsOpen=_ref.defaultIsOpen;var _useTheme=useTheme(),theme=_useTheme.theme;var defaultInitialFocusRef=React__default.useRef(null);var _useControllableState=useControllableState({value:isOpen,defaultValue:defaultIsOpen,onChange:function onChange(isOpen){return onOpenChange==null?void 0:onOpenChange({isOpen:isOpen});}}),_useControllableState2=_slicedToArray(_useControllableState,2),controllableIsOpen=_useControllableState2[0],controllableSetIsOpen=_useControllableState2[1];var gap=theme.spacing[2];var _getFloatingPlacement=getFloatingPlacementParts(placement),_getFloatingPlacement2=_slicedToArray(_getFloatingPlacement,1),side=_getFloatingPlacement2[0];var isHorizontal=side==='left'||side==='right';var arrowRef=React__default.useRef();var context=useFloating({sameScrollView:false,placement:placement,middleware:[shift({crossAxis:false,padding:gap}),flip({padding:gap,fallbackAxisSideDirection:'start'}),offset(gap+ARROW_HEIGHT),arrow({element:arrowRef,padding:isHorizontal?0:ARROW_WIDTH})]});var refs=context.refs,floatingStyles=context.floatingStyles;var _getFloatingPlacement3=getFloatingPlacementParts(context.placement),_getFloatingPlacement4=_slicedToArray(_getFloatingPlacement3,1),computedSide=_getFloatingPlacement4[0];var handleOpen=React__default.useCallback(function(){controllableSetIsOpen(function(){return true;});onOpenChange==null?void 0:onOpenChange({isOpen:true});},[controllableSetIsOpen,onOpenChange]);var handleClose=React__default.useCallback(function(){controllableSetIsOpen(function(){return false;});onOpenChange==null?void 0:onOpenChange({isOpen:false});},[controllableSetIsOpen,onOpenChange]);var _React$useState=React__default.useState(function(){return controllableIsOpen;}),_React$useState2=_slicedToArray(_React$useState,2),isVisible=_React$useState2[0],setIsVisible=_React$useState2[1];React__default.useEffect(function(){var id=setTimeout(function(){if(!controllableIsOpen){setIsVisible(false);}},theme.motion.duration.gentle);if(controllableIsOpen){setIsVisible(true);}return function(){return clearTimeout(id);};},[controllableIsOpen]);var contextValue=React__default.useMemo(function(){return {close:handleClose,defaultInitialFocusRef:defaultInitialFocusRef,titleId:undefined};},[handleClose]);return jsxs(PopoverContext.Provider,{value:contextValue,children:[React__default.cloneElement(children,Object.assign({},mergeProps({onTouchEnd:children.props.onTouchEnd},{onTouchEnd:handleOpen}),{ref:refs.setReference})),jsxs(Modal,Object.assign({collapsable:false,transparent:true,visible:Boolean(isVisible)},metaAttribute({testID:'popover-modal'}),{children:[jsx(TouchableOpacity,Object.assign({style:{position:'absolute',top:0,bottom:0,left:0,right:0},onPress:handleClose,activeOpacity:1,testID:"popover-modal-backdrop"},metaAttribute({name:MetaConstants.Popover}))),jsx(PopoverContent,{titleLeading:titleLeading,title:title,footer:footer,isVisible:controllableIsOpen,ref:refs.setFloating,side:computedSide,style:Object.assign({},floatingStyles,{zIndex:zIndex}),arrow:jsx(PopupArrow,{ref:arrowRef,context:context,width:ARROW_WIDTH,height:ARROW_HEIGHT,fillColor:theme.colors.popup.background.subtle,strokeColor:theme.colors.popup.border.subtle}),children:content})]}))]});};
22
+ var Popover=function Popover(_ref){var content=_ref.content,children=_ref.children,_ref$placement=_ref.placement,placement=_ref$placement===void 0?'top':_ref$placement,onOpenChange=_ref.onOpenChange,_ref$zIndex=_ref.zIndex,zIndex=_ref$zIndex===void 0?componentZIndices.popover:_ref$zIndex,title=_ref.title,titleLeading=_ref.titleLeading,footer=_ref.footer,isOpen=_ref.isOpen,defaultIsOpen=_ref.defaultIsOpen;var _useTheme=useTheme(),theme=_useTheme.theme;var defaultInitialFocusRef=React__default.useRef(null);var _useControllableState=useControllableState({value:isOpen,defaultValue:defaultIsOpen,onChange:function onChange(isOpen){return onOpenChange==null?void 0:onOpenChange({isOpen:isOpen});}}),_useControllableState2=_slicedToArray(_useControllableState,2),controllableIsOpen=_useControllableState2[0],controllableSetIsOpen=_useControllableState2[1];var gap=theme.spacing[2];var _getFloatingPlacement=getFloatingPlacementParts(placement),_getFloatingPlacement2=_slicedToArray(_getFloatingPlacement,1),side=_getFloatingPlacement2[0];var isHorizontal=side==='left'||side==='right';var arrowRef=React__default.useRef();var context=useFloating({sameScrollView:false,placement:placement,middleware:[shift({crossAxis:false,padding:gap}),flip({padding:gap,fallbackAxisSideDirection:'start'}),offset(gap+ARROW_HEIGHT),arrow({element:arrowRef,padding:isHorizontal?0:ARROW_WIDTH})]});var refs=context.refs,floatingStyles=context.floatingStyles;var _getFloatingPlacement3=getFloatingPlacementParts(context.placement),_getFloatingPlacement4=_slicedToArray(_getFloatingPlacement3,1),computedSide=_getFloatingPlacement4[0];var handleOpen=React__default.useCallback(function(){controllableSetIsOpen(function(){return true;});onOpenChange==null?void 0:onOpenChange({isOpen:true});},[controllableSetIsOpen,onOpenChange]);var handleClose=React__default.useCallback(function(){controllableSetIsOpen(function(){return false;});onOpenChange==null?void 0:onOpenChange({isOpen:false});},[controllableSetIsOpen,onOpenChange]);var _React$useState=React__default.useState(function(){return controllableIsOpen;}),_React$useState2=_slicedToArray(_React$useState,2),isVisible=_React$useState2[0],setIsVisible=_React$useState2[1];React__default.useEffect(function(){var id=setTimeout(function(){if(!controllableIsOpen){setIsVisible(false);}},theme.motion.duration.gentle);if(controllableIsOpen){setIsVisible(true);}return function(){return clearTimeout(id);};},[controllableIsOpen]);var contextValue=React__default.useMemo(function(){return {close:handleClose,defaultInitialFocusRef:defaultInitialFocusRef,titleId:undefined};},[handleClose]);return jsxs(PopoverContext.Provider,{value:contextValue,children:[React__default.cloneElement(children,Object.assign({},mergeProps({onTouchEnd:children.props.onTouchEnd},{onTouchEnd:handleOpen}),{ref:refs.setReference})),jsxs(Modal,Object.assign({collapsable:false,transparent:true,visible:Boolean(isVisible)},metaAttribute({testID:'popover-modal'}),{children:[jsx(TouchableOpacity,Object.assign({style:{position:'absolute',top:0,bottom:0,left:0,right:0},onPress:handleClose,activeOpacity:1,testID:"popover-modal-backdrop"},metaAttribute({name:MetaConstants.Popover}))),jsx(PopoverContent,{titleLeading:titleLeading,title:title,footer:footer,isVisible:controllableIsOpen,ref:refs.setFloating,side:computedSide,style:Object.assign({},floatingStyles,{zIndex:zIndex}),arrow:jsx(PopupArrow,{ref:arrowRef,context:context,width:ARROW_WIDTH,height:ARROW_HEIGHT,fillColor:theme.colors.popup.background.subtle,strokeColor:theme.colors.popup.border.subtle}),children:content})]}))]});};
22
23
 
23
24
  export { Popover };
24
25
  //# sourceMappingURL=Popover.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.native.js","sources":["../../../../../src/components/Popover/Popover.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/restrict-plus-operands */\nimport { arrow, shift, useFloating, flip, offset } from '@floating-ui/react-native';\nimport React from 'react';\nimport { Modal, TouchableOpacity } from 'react-native';\nimport { PopoverContent } from './PopoverContent';\nimport type { PopoverProps } from './types';\nimport { ARROW_HEIGHT, ARROW_WIDTH, popoverZIndex } from './constants';\nimport { PopoverContext } from './PopoverContext';\nimport { useTheme } from '~components/BladeProvider';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { mergeProps } from '~utils/mergeProps';\nimport { useControllableState } from '~utils/useControllable';\nimport { PopupArrow } from '~components/PopupArrow';\nimport { getFloatingPlacementParts } from '~utils/getFloatingPlacementParts';\n\nconst Popover = ({\n content,\n children,\n placement = 'top',\n onOpenChange,\n zIndex = popoverZIndex,\n title,\n titleLeading,\n footer,\n isOpen,\n defaultIsOpen,\n}: PopoverProps): React.ReactElement => {\n const { theme } = useTheme();\n const defaultInitialFocusRef = React.useRef(null);\n const [controllableIsOpen, controllableSetIsOpen] = useControllableState({\n value: isOpen,\n defaultValue: defaultIsOpen,\n onChange: (isOpen) => onOpenChange?.({ isOpen }),\n });\n\n const gap = theme.spacing[2];\n const [side] = getFloatingPlacementParts(placement);\n const isHorizontal = side === 'left' || side === 'right';\n const arrowRef = React.useRef();\n const context = useFloating({\n sameScrollView: false,\n placement,\n middleware: [\n shift({ crossAxis: false, padding: gap }),\n flip({ padding: gap, fallbackAxisSideDirection: 'start' }),\n offset(gap + ARROW_HEIGHT),\n arrow({\n element: arrowRef,\n padding: isHorizontal ? 0 : ARROW_WIDTH,\n }),\n ],\n });\n\n const { refs, floatingStyles } = context;\n const [computedSide] = getFloatingPlacementParts(context.placement);\n\n const handleOpen = React.useCallback(() => {\n controllableSetIsOpen(() => true);\n onOpenChange?.({ isOpen: true });\n }, [controllableSetIsOpen, onOpenChange]);\n\n const handleClose = React.useCallback(() => {\n controllableSetIsOpen(() => false);\n onOpenChange?.({ isOpen: false });\n }, [controllableSetIsOpen, onOpenChange]);\n\n // wait for animation to finish before unmounting modal\n const [isVisible, setIsVisible] = React.useState(() => controllableIsOpen);\n React.useEffect(() => {\n const id = setTimeout(() => {\n if (!controllableIsOpen) {\n setIsVisible(false);\n }\n }, theme.motion.duration.gentle);\n\n if (controllableIsOpen) {\n setIsVisible(true);\n }\n return () => clearTimeout(id);\n }, [controllableIsOpen]);\n\n const contextValue = React.useMemo(() => {\n return {\n close: handleClose,\n defaultInitialFocusRef,\n titleId: undefined,\n };\n }, [handleClose]);\n\n return (\n <PopoverContext.Provider value={contextValue}>\n {/* Cloning the trigger children to enhance it with ref and event handler */}\n {React.cloneElement(children, {\n ...mergeProps(\n {\n onTouchEnd: children.props.onTouchEnd,\n },\n { onTouchEnd: handleOpen },\n ),\n ref: refs.setReference,\n })}\n <Modal\n collapsable={false}\n transparent\n visible={Boolean(isVisible)}\n {...metaAttribute({ testID: 'popover-modal' })}\n >\n <TouchableOpacity\n style={{\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n }}\n onPress={handleClose}\n activeOpacity={1}\n testID=\"popover-modal-backdrop\"\n {...metaAttribute({ name: MetaConstants.Popover })}\n />\n <PopoverContent\n titleLeading={titleLeading}\n title={title}\n footer={footer}\n isVisible={controllableIsOpen}\n ref={refs.setFloating}\n side={computedSide}\n style={{\n ...floatingStyles,\n // TODO: Tokenize zIndex values\n zIndex,\n }}\n arrow={\n <PopupArrow\n ref={arrowRef as never}\n context={context}\n width={ARROW_WIDTH}\n height={ARROW_HEIGHT}\n fillColor={theme.colors.popup.background.subtle}\n strokeColor={theme.colors.popup.border.subtle}\n />\n }\n >\n {content}\n </PopoverContent>\n </Modal>\n </PopoverContext.Provider>\n );\n};\n\nexport { Popover };\n"],"names":["Popover","_ref","content","children","_ref$placement","placement","onOpenChange","_ref$zIndex","zIndex","popoverZIndex","title","titleLeading","footer","isOpen","defaultIsOpen","_useTheme","useTheme","theme","defaultInitialFocusRef","React","useRef","_useControllableState","useControllableState","value","defaultValue","onChange","_useControllableState2","_slicedToArray","controllableIsOpen","controllableSetIsOpen","gap","spacing","_getFloatingPlacement","getFloatingPlacementParts","_getFloatingPlacement2","side","isHorizontal","arrowRef","context","useFloating","sameScrollView","middleware","shift","crossAxis","padding","flip","fallbackAxisSideDirection","offset","ARROW_HEIGHT","arrow","element","ARROW_WIDTH","refs","floatingStyles","_getFloatingPlacement3","_getFloatingPlacement4","computedSide","handleOpen","useCallback","handleClose","_React$useState","useState","_React$useState2","isVisible","setIsVisible","useEffect","id","setTimeout","motion","duration","gentle","clearTimeout","contextValue","useMemo","close","titleId","undefined","_jsxs","PopoverContext","Provider","cloneElement","Object","assign","mergeProps","onTouchEnd","props","ref","setReference","Modal","collapsable","transparent","visible","Boolean","metaAttribute","testID","_jsx","TouchableOpacity","style","position","top","bottom","left","right","onPress","activeOpacity","name","MetaConstants","PopoverContent","setFloating","PopupArrow","width","height","fillColor","colors","popup","background","subtle","strokeColor","border"],"mappings":";;;;;;;;;;;;;;;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AAA,GAAG,CAAEjD,QAAkB,CACvBC,OAAO,CAAEA,OAAQ,CACjBwE,KAAK,CAAE3D,WAAY,CACnB4D,MAAM,CAAE/D,YAAa,CACrBgE,SAAS,CAAE/F,KAAK,CAACgG,MAAM,CAACC,KAAK,CAACC,UAAU,CAACC,MAAO,CAChDC,WAAW,CAAEpG,KAAK,CAACgG,MAAM,CAACC,KAAK,CAACI,MAAM,CAACF,MAAO,CAC/C,CACF,CAAAjH,QAAA,CAEAD,OAAO,CACM,CAAC,GACZ,CAAC,CAAA,CACe,CAAC,CAE9B;;;;"}
1
+ {"version":3,"file":"Popover.native.js","sources":["../../../../../src/components/Popover/Popover.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/restrict-plus-operands */\nimport { arrow, shift, useFloating, flip, offset } from '@floating-ui/react-native';\nimport React from 'react';\nimport { Modal, TouchableOpacity } from 'react-native';\nimport { PopoverContent } from './PopoverContent';\nimport type { PopoverProps } from './types';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './constants';\nimport { PopoverContext } from './PopoverContext';\nimport { useTheme } from '~components/BladeProvider';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { mergeProps } from '~utils/mergeProps';\nimport { useControllableState } from '~utils/useControllable';\nimport { PopupArrow } from '~components/PopupArrow';\nimport { getFloatingPlacementParts } from '~utils/getFloatingPlacementParts';\nimport { componentZIndices } from '~utils/componentZIndices';\n\nconst Popover = ({\n content,\n children,\n placement = 'top',\n onOpenChange,\n zIndex = componentZIndices.popover,\n title,\n titleLeading,\n footer,\n isOpen,\n defaultIsOpen,\n}: PopoverProps): React.ReactElement => {\n const { theme } = useTheme();\n const defaultInitialFocusRef = React.useRef(null);\n const [controllableIsOpen, controllableSetIsOpen] = useControllableState({\n value: isOpen,\n defaultValue: defaultIsOpen,\n onChange: (isOpen) => onOpenChange?.({ isOpen }),\n });\n\n const gap = theme.spacing[2];\n const [side] = getFloatingPlacementParts(placement);\n const isHorizontal = side === 'left' || side === 'right';\n const arrowRef = React.useRef();\n const context = useFloating({\n sameScrollView: false,\n placement,\n middleware: [\n shift({ crossAxis: false, padding: gap }),\n flip({ padding: gap, fallbackAxisSideDirection: 'start' }),\n offset(gap + ARROW_HEIGHT),\n arrow({\n element: arrowRef,\n padding: isHorizontal ? 0 : ARROW_WIDTH,\n }),\n ],\n });\n\n const { refs, floatingStyles } = context;\n const [computedSide] = getFloatingPlacementParts(context.placement);\n\n const handleOpen = React.useCallback(() => {\n controllableSetIsOpen(() => true);\n onOpenChange?.({ isOpen: true });\n }, [controllableSetIsOpen, onOpenChange]);\n\n const handleClose = React.useCallback(() => {\n controllableSetIsOpen(() => false);\n onOpenChange?.({ isOpen: false });\n }, [controllableSetIsOpen, onOpenChange]);\n\n // wait for animation to finish before unmounting modal\n const [isVisible, setIsVisible] = React.useState(() => controllableIsOpen);\n React.useEffect(() => {\n const id = setTimeout(() => {\n if (!controllableIsOpen) {\n setIsVisible(false);\n }\n }, theme.motion.duration.gentle);\n\n if (controllableIsOpen) {\n setIsVisible(true);\n }\n return () => clearTimeout(id);\n }, [controllableIsOpen]);\n\n const contextValue = React.useMemo(() => {\n return {\n close: handleClose,\n defaultInitialFocusRef,\n titleId: undefined,\n };\n }, [handleClose]);\n\n return (\n <PopoverContext.Provider value={contextValue}>\n {/* Cloning the trigger children to enhance it with ref and event handler */}\n {React.cloneElement(children, {\n ...mergeProps(\n {\n onTouchEnd: children.props.onTouchEnd,\n },\n { onTouchEnd: handleOpen },\n ),\n ref: refs.setReference,\n })}\n <Modal\n collapsable={false}\n transparent\n visible={Boolean(isVisible)}\n {...metaAttribute({ testID: 'popover-modal' })}\n >\n <TouchableOpacity\n style={{\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n }}\n onPress={handleClose}\n activeOpacity={1}\n testID=\"popover-modal-backdrop\"\n {...metaAttribute({ name: MetaConstants.Popover })}\n />\n <PopoverContent\n titleLeading={titleLeading}\n title={title}\n footer={footer}\n isVisible={controllableIsOpen}\n ref={refs.setFloating}\n side={computedSide}\n style={{\n ...floatingStyles,\n // TODO: Tokenize zIndex values\n zIndex,\n }}\n arrow={\n <PopupArrow\n ref={arrowRef as never}\n context={context}\n width={ARROW_WIDTH}\n height={ARROW_HEIGHT}\n fillColor={theme.colors.popup.background.subtle}\n strokeColor={theme.colors.popup.border.subtle}\n />\n }\n >\n {content}\n </PopoverContent>\n </Modal>\n </PopoverContext.Provider>\n );\n};\n\nexport { Popover };\n"],"names":["Popover","_ref","content","children","_ref$placement","placement","onOpenChange","_ref$zIndex","zIndex","componentZIndices","popover","title","titleLeading","footer","isOpen","defaultIsOpen","_useTheme","useTheme","theme","defaultInitialFocusRef","React","useRef","_useControllableState","useControllableState","value","defaultValue","onChange","_useControllableState2","_slicedToArray","controllableIsOpen","controllableSetIsOpen","gap","spacing","_getFloatingPlacement","getFloatingPlacementParts","_getFloatingPlacement2","side","isHorizontal","arrowRef","context","useFloating","sameScrollView","middleware","shift","crossAxis","padding","flip","fallbackAxisSideDirection","offset","ARROW_HEIGHT","arrow","element","ARROW_WIDTH","refs","floatingStyles","_getFloatingPlacement3","_getFloatingPlacement4","computedSide","handleOpen","useCallback","handleClose","_React$useState","useState","_React$useState2","isVisible","setIsVisible","useEffect","id","setTimeout","motion","duration","gentle","clearTimeout","contextValue","useMemo","close","titleId","undefined","_jsxs","PopoverContext","Provider","cloneElement","Object","assign","mergeProps","onTouchEnd","props","ref","setReference","Modal","collapsable","transparent","visible","Boolean","metaAttribute","testID","_jsx","TouchableOpacity","style","position","top","bottom","left","right","onPress","activeOpacity","name","MetaConstants","PopoverContent","setFloating","PopupArrow","width","height","fillColor","colors","popup","background","subtle","strokeColor","border"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgBM,IAAAA,OAAO,CAAG,SAAVA,OAAOA,CAAAC,IAAA,CAW2B,KAVtCC,OAAO,CAAAD,IAAA,CAAPC,OAAO,CACPC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAAAC,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AACC,MAAO,CAChDC,WAAW,CAAEpG,KAAK,CAACgG,MAAM,CAACC,KAAK,CAACI,MAAM,CAACF,MAAO,CAC/C,CACF,CAAAlH,QAAA,CAEAD,OAAO,CACM,CAAC,GACZ,CAAC,CAAA,CACe,CAAC,CAE9B;;;;"}
@@ -1,4 +1,4 @@
1
- var ARROW_WIDTH=14;var ARROW_HEIGHT=7;var popoverZIndex=1100;
1
+ var ARROW_WIDTH=14;var ARROW_HEIGHT=7;
2
2
 
3
- export { ARROW_HEIGHT, ARROW_WIDTH, popoverZIndex };
3
+ export { ARROW_HEIGHT, ARROW_WIDTH };
4
4
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/components/Popover/constants.ts"],"sourcesContent":["export const ARROW_WIDTH = 14;\nexport const ARROW_HEIGHT = 7;\nexport const popoverZIndex = 1100;\n"],"names":["ARROW_WIDTH","ARROW_HEIGHT","popoverZIndex"],"mappings":"AAAa,IAAAA,WAAW,CAAG,GACd,IAAAC,YAAY,CAAG,EACf,IAAAC,aAAa,CAAG;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/components/Popover/constants.ts"],"sourcesContent":["export const ARROW_WIDTH = 14;\nexport const ARROW_HEIGHT = 7;\n"],"names":["ARROW_WIDTH","ARROW_HEIGHT"],"mappings":"AAAa,IAAAA,WAAW,CAAG,GACd,IAAAC,YAAY,CAAG;;;;"}
@@ -27,7 +27,7 @@ import '../Typography/Code/Code.js';
27
27
  import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
28
28
  import { useIsMobile } from '../../utils/useIsMobile.js';
29
29
 
30
- var _excluded=["size","icon","onDismiss","children","isDisabled","testID","_isVirtuallyFocused","_isTagInsideInput"];var FocussableTag=styled(BaseBox)(function(props){if(props._isVirtuallyFocused&&!isReactNative()){return {outline:`${makeSize(size['1'])} solid ${props.theme.colors.surface.background.gray.subtle}`,boxShadow:`0px 0px 0px 4px ${props.theme.colors.interactive.background.primary.faded}`};}return {};});var Tag=function Tag(_ref){var _ref$size=_ref.size,size$1=_ref$size===void 0?'medium':_ref$size,Icon=_ref.icon,onDismiss=_ref.onDismiss,children=_ref.children,isDisabled=_ref.isDisabled,testID=_ref.testID,_isVirtuallyFocused=_ref._isVirtuallyFocused,_isTagInsideInput=_ref._isTagInsideInput,styledProps=_objectWithoutProperties(_ref,_excluded);var isMobile=useIsMobile();var textColor=isDisabled?'interactive.text.gray.disabled':'interactive.text.gray.subtle';var iconColor=isDisabled?'interactive.icon.gray.disabled':'interactive.icon.gray.muted';var backgroundColor=isDisabled?'interactive.background.gray.disabled':'interactive.background.gray.default';var mediumPadding={base:['spacing.2','spacing.3','spacing.2','spacing.4'],m:['spacing.1','spacing.2','spacing.1','spacing.3']};var largePadding={base:['spacing.2','spacing.3','spacing.2','spacing.4'],m:['spacing.2','spacing.3','spacing.2','spacing.4']};var assetSize=React__default.useMemo(function(){if(isMobile&&size$1==='large'){return 'medium';}return 'small';},[isMobile,size$1]);return jsx(BaseBox,Object.assign({display:isReactNative()?'flex':'inline-flex'},getStyledProps(styledProps),metaAttribute({name:MetaConstants.Tag,testID:testID}),{children:jsxs(FocussableTag,{display:isReactNative()?'flex':'inline-flex',alignSelf:isReactNative()?'center':undefined,flexDirection:"row",flexWrap:"nowrap",backgroundColor:backgroundColor,borderRadius:"max",padding:size$1==='medium'?mediumPadding:largePadding,_isVirtuallyFocused:_isVirtuallyFocused,children:[Icon?jsx(Box,{display:"flex",flexDirection:"row",alignItems:"center",children:jsx(Icon,{color:iconColor,size:assetSize,marginRight:"spacing.2"})}):null,jsx(Box,{display:"flex",flexDirection:"row",alignItems:"center",maxWidth:makeSize(size['100']),children:jsx(Text,{truncateAfterLines:1,marginRight:"spacing.2",color:textColor,size:assetSize,children:children})}),jsx(Box,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",children:jsx(IconButton,{size:assetSize,icon:CloseIcon,accessibilityLabel:`Close ${children} tag`,isDisabled:isDisabled,_tabIndex:_isTagInsideInput?-1:undefined,onClick:function onClick(e){if(_isTagInsideInput){e.stopPropagation();}onDismiss();}})})]})}));};
30
+ var _excluded=["size","icon","onDismiss","children","isDisabled","testID","_isVirtuallyFocused","_isTagInsideInput"];var FocussableTag=styled(BaseBox)(function(props){if(props._isVirtuallyFocused&&!isReactNative()){return {outline:`${makeSize(size['1'])} solid ${props.theme.colors.surface.background.gray.subtle}`,boxShadow:`0px 0px 0px 4px ${props.theme.colors.interactive.background.primary.faded}`};}return {};});var Tag=function Tag(_ref){var _ref$size=_ref.size,size$1=_ref$size===void 0?'medium':_ref$size,Icon=_ref.icon,onDismiss=_ref.onDismiss,children=_ref.children,isDisabled=_ref.isDisabled,testID=_ref.testID,_isVirtuallyFocused=_ref._isVirtuallyFocused,_isTagInsideInput=_ref._isTagInsideInput,styledProps=_objectWithoutProperties(_ref,_excluded);var isMobile=useIsMobile();var textColor=isDisabled?'interactive.text.gray.disabled':'interactive.text.gray.subtle';var iconColor=isDisabled?'interactive.icon.gray.disabled':'interactive.icon.gray.muted';var backgroundColor=isDisabled?'interactive.background.gray.disabled':'interactive.background.gray.default';var mediumPadding={base:['spacing.2','spacing.3','spacing.2','spacing.4'],m:['spacing.1','spacing.2','spacing.1','spacing.3']};var largePadding={base:['spacing.2','spacing.3','spacing.2','spacing.4'],m:['spacing.2','spacing.3','spacing.2','spacing.4']};var assetSize=React__default.useMemo(function(){if(isMobile&&size$1==='large'){return 'medium';}return 'small';},[isMobile,size$1]);return jsx(BaseBox,Object.assign({display:isReactNative()?'flex':'inline-flex'},getStyledProps(styledProps),metaAttribute({name:MetaConstants.Tag,testID:testID}),{children:jsxs(FocussableTag,{display:isReactNative()?'flex':'inline-flex',alignSelf:isReactNative()?'center':undefined,flexDirection:"row",flexWrap:"nowrap",flexShrink:0,backgroundColor:backgroundColor,borderRadius:"max",padding:size$1==='medium'?mediumPadding:largePadding,_isVirtuallyFocused:_isVirtuallyFocused,children:[Icon?jsx(Box,{display:"flex",flexDirection:"row",alignItems:"center",children:jsx(Icon,{color:iconColor,size:assetSize,marginRight:"spacing.2"})}):null,jsx(Box,{display:"flex",flexDirection:"row",alignItems:"center",maxWidth:makeSize(size['100']),children:jsx(Text,{truncateAfterLines:1,marginRight:"spacing.2",color:textColor,size:assetSize,children:children})}),jsx(Box,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",children:jsx(IconButton,{size:assetSize,icon:CloseIcon,accessibilityLabel:`Close ${children} tag`,isDisabled:isDisabled,_tabIndex:_isTagInsideInput?-1:undefined,onClick:function onClick(e){if(_isTagInsideInput){e.stopPropagation();}onDismiss();}})})]})}));};
31
31
 
32
32
  export { Tag };
33
33
  //# sourceMappingURL=Tag.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","sources":["../../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport type { TagProps } from './types';\nimport { Box } from '~components/Box';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { IconButton } from '~components/Button/IconButton';\nimport { CloseIcon } from '~components/Icons';\nimport { Text } from '~components/Typography';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { isReactNative, makeSize } from '~utils';\nimport { size as globalSizeTokens } from '~tokens/global';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { PaddingProps } from '~components/Box/BaseBox/types/spacingTypes';\nimport { useIsMobile } from '~utils/useIsMobile';\n\nconst FocussableTag = styled(BaseBox)<{ _isVirtuallyFocused: TagProps['_isVirtuallyFocused'] }>(\n (props) => {\n if (props._isVirtuallyFocused && !isReactNative()) {\n return {\n outline: `${makeSize(globalSizeTokens['1'])} solid ${\n props.theme.colors.surface.background.gray.subtle\n }`,\n boxShadow: `0px 0px 0px 4px ${props.theme.colors.interactive.background.primary.faded}`,\n };\n }\n\n return {};\n },\n);\n\n/**\n * ## Tags\n *\n * Tag component can be used to display selected items on UI.\n *\n * ### Usage\n *\n * ***Note:*** _Make sure to handle state when using Tag_\n *\n * ```jsx\n * const [showTag, setShowTag] = React.useState(true);\n *\n * // ...\n *\n * {showTag && (\n * <Tag\n * icon={CheckIcon}\n * onDismiss={() => setShowTag(false)}\n * >\n * Transactions\n * </Tag>\n * )}\n * ```\n *\n * Checkout [Tags Documentation](https://blade.razorpay.com/?path=/story/components-tag--default) for more info.\n *\n */\nconst Tag = ({\n size = 'medium',\n icon: Icon,\n onDismiss,\n children,\n isDisabled,\n testID,\n _isVirtuallyFocused,\n _isTagInsideInput,\n ...styledProps\n}: TagProps): React.ReactElement | null => {\n const isMobile = useIsMobile();\n\n const textColor = isDisabled ? 'interactive.text.gray.disabled' : 'interactive.text.gray.subtle';\n const iconColor = isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted';\n const backgroundColor = isDisabled\n ? 'interactive.background.gray.disabled'\n : 'interactive.background.gray.default';\n\n const mediumPadding: PaddingProps['padding'] = {\n base: ['spacing.2', 'spacing.3', 'spacing.2', 'spacing.4'],\n m: ['spacing.1', 'spacing.2', 'spacing.1', 'spacing.3'],\n };\n\n const largePadding: PaddingProps['padding'] = {\n base: ['spacing.2', 'spacing.3', 'spacing.2', 'spacing.4'],\n m: ['spacing.2', 'spacing.3', 'spacing.2', 'spacing.4'],\n };\n\n const assetSize = React.useMemo((): 'small' | 'medium' => {\n if (isMobile && size === 'large') {\n return 'medium';\n }\n\n return 'small';\n }, [isMobile, size]);\n\n return (\n <BaseBox\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n {...getStyledProps(styledProps)}\n {...metaAttribute({ name: MetaConstants.Tag, testID })}\n >\n <FocussableTag\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n alignSelf={isReactNative() ? 'center' : undefined}\n flexDirection=\"row\"\n flexWrap=\"nowrap\"\n backgroundColor={backgroundColor}\n borderRadius=\"max\"\n padding={size === 'medium' ? mediumPadding : largePadding}\n _isVirtuallyFocused={_isVirtuallyFocused}\n >\n {/* Leading Icon */}\n {Icon ? (\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Icon color={iconColor} size={assetSize} marginRight=\"spacing.2\" />\n </Box>\n ) : null}\n\n {/* Tag Text */}\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n maxWidth={makeSize(globalSizeTokens['100'])}\n >\n <Text truncateAfterLines={1} marginRight=\"spacing.2\" color={textColor} size={assetSize}>\n {children}\n </Text>\n </Box>\n\n {/* Dismiss Icon */}\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <IconButton\n size={assetSize}\n icon={CloseIcon}\n accessibilityLabel={`Close ${children} tag`}\n isDisabled={isDisabled}\n _tabIndex={_isTagInsideInput ? -1 : undefined}\n onClick={(e) => {\n // Inside tag input, we stop propagation to avoid opening dropdown on click of close on tag\n if (_isTagInsideInput) {\n e.stopPropagation();\n }\n onDismiss();\n }}\n />\n </Box>\n </FocussableTag>\n </BaseBox>\n );\n};\n\nexport { Tag };\n"],"names":["FocussableTag","styled","BaseBox","props","_isVirtuallyFocused","isReactNative","outline","makeSize","globalSizeTokens","theme","colors","surface","background","gray","subtle","boxShadow","interactive","primary","faded","Tag","_ref","_ref$size","size","Icon","icon","onDismiss","children","isDisabled","testID","_isTagInsideInput","styledProps","_objectWithoutProperties","_excluded","isMobile","useIsMobile","textColor","iconColor","backgroundColor","mediumPadding","base","m","largePadding","assetSize","React","useMemo","_jsx","Object","assign","display","getStyledProps","metaAttribute","name","MetaConstants","_jsxs","alignSelf","undefined","flexDirection","flexWrap","borderRadius","padding","Box","alignItems","color","marginRight","maxWidth","Text","truncateAfterLines","justifyContent","IconButton","CloseIcon","accessibilityLabel","_tabIndex","onClick","e","stopPropagation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,WAAA,CAAA,UAAA,CAAA,YAAA,CAAA,QAAA,CAAA,qBAAA,CAAA,mBAAA,CAAA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AAE,CACb,CAAE,CACH,CAAC,CACC,CAAC,CACO,CAAA,CAAC,EACT,CAAC,CAEd;;;;"}
1
+ {"version":3,"file":"Tag.js","sources":["../../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport type { TagProps } from './types';\nimport { Box } from '~components/Box';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { IconButton } from '~components/Button/IconButton';\nimport { CloseIcon } from '~components/Icons';\nimport { Text } from '~components/Typography';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { isReactNative, makeSize } from '~utils';\nimport { size as globalSizeTokens } from '~tokens/global';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { PaddingProps } from '~components/Box/BaseBox/types/spacingTypes';\nimport { useIsMobile } from '~utils/useIsMobile';\n\nconst FocussableTag = styled(BaseBox)<{ _isVirtuallyFocused: TagProps['_isVirtuallyFocused'] }>(\n (props) => {\n if (props._isVirtuallyFocused && !isReactNative()) {\n return {\n outline: `${makeSize(globalSizeTokens['1'])} solid ${\n props.theme.colors.surface.background.gray.subtle\n }`,\n boxShadow: `0px 0px 0px 4px ${props.theme.colors.interactive.background.primary.faded}`,\n };\n }\n\n return {};\n },\n);\n\n/**\n * ## Tags\n *\n * Tag component can be used to display selected items on UI.\n *\n * ### Usage\n *\n * ***Note:*** _Make sure to handle state when using Tag_\n *\n * ```jsx\n * const [showTag, setShowTag] = React.useState(true);\n *\n * // ...\n *\n * {showTag && (\n * <Tag\n * icon={CheckIcon}\n * onDismiss={() => setShowTag(false)}\n * >\n * Transactions\n * </Tag>\n * )}\n * ```\n *\n * Checkout [Tags Documentation](https://blade.razorpay.com/?path=/story/components-tag--default) for more info.\n *\n */\nconst Tag = ({\n size = 'medium',\n icon: Icon,\n onDismiss,\n children,\n isDisabled,\n testID,\n _isVirtuallyFocused,\n _isTagInsideInput,\n ...styledProps\n}: TagProps): React.ReactElement | null => {\n const isMobile = useIsMobile();\n\n const textColor = isDisabled ? 'interactive.text.gray.disabled' : 'interactive.text.gray.subtle';\n const iconColor = isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted';\n const backgroundColor = isDisabled\n ? 'interactive.background.gray.disabled'\n : 'interactive.background.gray.default';\n\n const mediumPadding: PaddingProps['padding'] = {\n base: ['spacing.2', 'spacing.3', 'spacing.2', 'spacing.4'],\n m: ['spacing.1', 'spacing.2', 'spacing.1', 'spacing.3'],\n };\n\n const largePadding: PaddingProps['padding'] = {\n base: ['spacing.2', 'spacing.3', 'spacing.2', 'spacing.4'],\n m: ['spacing.2', 'spacing.3', 'spacing.2', 'spacing.4'],\n };\n\n const assetSize = React.useMemo((): 'small' | 'medium' => {\n if (isMobile && size === 'large') {\n return 'medium';\n }\n\n return 'small';\n }, [isMobile, size]);\n\n return (\n <BaseBox\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n {...getStyledProps(styledProps)}\n {...metaAttribute({ name: MetaConstants.Tag, testID })}\n >\n <FocussableTag\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n alignSelf={isReactNative() ? 'center' : undefined}\n flexDirection=\"row\"\n flexWrap=\"nowrap\"\n flexShrink={0}\n backgroundColor={backgroundColor}\n borderRadius=\"max\"\n padding={size === 'medium' ? mediumPadding : largePadding}\n _isVirtuallyFocused={_isVirtuallyFocused}\n >\n {/* Leading Icon */}\n {Icon ? (\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Icon color={iconColor} size={assetSize} marginRight=\"spacing.2\" />\n </Box>\n ) : null}\n\n {/* Tag Text */}\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n maxWidth={makeSize(globalSizeTokens['100'])}\n >\n <Text truncateAfterLines={1} marginRight=\"spacing.2\" color={textColor} size={assetSize}>\n {children}\n </Text>\n </Box>\n\n {/* Dismiss Icon */}\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <IconButton\n size={assetSize}\n icon={CloseIcon}\n accessibilityLabel={`Close ${children} tag`}\n isDisabled={isDisabled}\n _tabIndex={_isTagInsideInput ? -1 : undefined}\n onClick={(e) => {\n // Inside tag input, we stop propagation to avoid opening dropdown on click of close on tag\n if (_isTagInsideInput) {\n e.stopPropagation();\n }\n onDismiss();\n }}\n />\n </Box>\n </FocussableTag>\n </BaseBox>\n );\n};\n\nexport { Tag };\n"],"names":["FocussableTag","styled","BaseBox","props","_isVirtuallyFocused","isReactNative","outline","makeSize","globalSizeTokens","theme","colors","surface","background","gray","subtle","boxShadow","interactive","primary","faded","Tag","_ref","_ref$size","size","Icon","icon","onDismiss","children","isDisabled","testID","_isTagInsideInput","styledProps","_objectWithoutProperties","_excluded","isMobile","useIsMobile","textColor","iconColor","backgroundColor","mediumPadding","base","m","largePadding","assetSize","React","useMemo","_jsx","Object","assign","display","getStyledProps","metaAttribute","name","MetaConstants","_jsxs","alignSelf","undefined","flexDirection","flexWrap","flexShrink","borderRadius","padding","Box","alignItems","color","marginRight","maxWidth","Text","truncateAfterLines","justifyContent","IconButton","CloseIcon","accessibilityLabel","_tabIndex","onClick","e","stopPropagation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,WAAA,CAAA,UAAA,CAAA,YAAA,CAAA,QAAA,CAAA,qBAAA,CAAA,mBAAA,CAAA,CAeA,IAAMA,aAAa,CAAGC,MAAM,CAACC,OAAO,CAAC,CACnC,SAACC,KAAK,CAAK,CACT,GAAIA,KAAK,CAACC,mBAAmB,EAAI,CAACC,aAAa,EAAE,CAAE,CACjD,OAAO,CACLC,OAAO,CAAG,CAAEC,EAAAA,QAAQ,CAACC,IAAgB,CAAC,GAAG,CAAC,CAAE,CAAA,OAAA,EAC1CL,KAAK,CAACM,KAAK,CAACC,MAAM,CAACC,OAAO,CAACC,UAAU,CAACC,IAAI,CAACC,MAC5C,CAAC,CAAA,CACFC,SAAS,CAAG,CAAA,gB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Fb,OAAO,CAAC,MAAM,CACdQ,aAAa,CAAC,KAAK,CACnBM,UAAU,CAAC,QAAQ,CACnBG,QAAQ,CAAE1D,QAAQ,CAACC,IAAgB,CAAC,KAAK,CAAC,CAAE,CAAAkB,QAAA,CAE5CmB,GAAA,CAACqB,IAAI,CAACC,CAAAA,kBAAkB,CAAE,CAAE,CAACH,WAAW,CAAC,WAAW,CAACD,KAAK,CAAE5B,SAAU,CAACb,IAAI,CAAEoB,SAAU,CAAAhB,QAAA,CACpFA,QAAQ,CACL,CAAC,CACJ,CAAC,CAGNmB,GAAA,CAACgB,GAAG,CAACb,CAAAA,OAAO,CAAC,MAAM,CAACQ,aAAa,CAAC,KAAK,CAACM,UAAU,CAAC,QAAQ,CAACM,cAAc,CAAC,QAAQ,CAAA1C,QAAA,CACjFmB,GAAA,CAACwB,UAAU,CACT/C,CAAAA,IAAI,CAAEoB,SAAU,CAChBlB,IAAI,CAAE8C,SAAU,CAChBC,kBAAkB,CAAG,CAAA,MAAA,EAAQ7C,QAAS,CAAM,IAAA,CAAA,CAC5CC,UAAU,CAAEA,UAAW,CACvB6C,SAAS,CAAE3C,iBAAiB,CAAG,CAAC,CAAC,CAAG0B,SAAU,CAC9CkB,OAAO,CAAE,SAAAA,OAAAA,CAACC,CAAC,CAAK,CAEd,GAAI7C,iBAAiB,CAAE,CACrB6C,CAAC,CAACC,eAAe,EAAE,CACrB,CACAlD,SAAS,EAAE,CACb,CAAE,CACH,CAAC,CACC,CAAC,CACO,CAAA,CAAC,EACT,CAAC,CAEd;;;;"}
@@ -3,7 +3,7 @@ import { useFloating, shift, flip, offset, arrow } from '@floating-ui/react-nati
3
3
  import React__default from 'react';
4
4
  import { Modal, TouchableOpacity } from 'react-native';
5
5
  import { TooltipContent } from './TooltipContent.js';
6
- import { ARROW_HEIGHT, ARROW_WIDTH, tooltipZIndex } from './constants.js';
6
+ import { ARROW_HEIGHT, ARROW_WIDTH } from './constants.js';
7
7
  import { TooltipContext } from './TooltipContext.js';
8
8
  import 'styled-components/native';
9
9
  import '@gorhom/portal';
@@ -16,8 +16,9 @@ import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
16
16
  import { mergeProps } from '../../utils/mergeProps.js';
17
17
  import { PopupArrow } from '../PopupArrow/PopupArrow.native.js';
18
18
  import { getFloatingPlacementParts } from '../../utils/getFloatingPlacementParts.js';
19
+ import { componentZIndices } from '../../utils/componentZIndices.js';
19
20
 
20
- var Tooltip=function Tooltip(_ref){var title=_ref.title,content=_ref.content,children=_ref.children,_ref$placement=_ref.placement,placement=_ref$placement===void 0?'left':_ref$placement,onOpenChange=_ref.onOpenChange,_ref$zIndex=_ref.zIndex,zIndex=_ref$zIndex===void 0?tooltipZIndex:_ref$zIndex;var _useTheme=useTheme(),theme=_useTheme.theme;var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isOpen=_React$useState2[0],setIsOpen=_React$useState2[1];var gap=theme.spacing[2];var _getFloatingPlacement=getFloatingPlacementParts(placement),_getFloatingPlacement2=_slicedToArray(_getFloatingPlacement,1),side=_getFloatingPlacement2[0];var isHorizontal=side==='left'||side==='right';var arrowRef=React__default.useRef();var context=useFloating({sameScrollView:false,placement:placement,middleware:[shift({crossAxis:false,padding:gap}),flip({padding:gap}),offset(gap+ARROW_HEIGHT),arrow({element:arrowRef,padding:isHorizontal?0:ARROW_WIDTH})]});var refs=context.refs,floatingStyles=context.floatingStyles;var handleOpen=React__default.useCallback(function(){setIsOpen(true);onOpenChange==null?void 0:onOpenChange({isOpen:true});},[onOpenChange]);var handleClose=React__default.useCallback(function(){setIsOpen(false);onOpenChange==null?void 0:onOpenChange({isOpen:false});},[onOpenChange]);var _React$useState3=React__default.useState(function(){return isOpen;}),_React$useState4=_slicedToArray(_React$useState3,2),isVisible=_React$useState4[0],setIsVisible=_React$useState4[1];React__default.useEffect(function(){var id=setTimeout(function(){if(!isOpen){setIsVisible(false);}},theme.motion.duration.gentle);if(isOpen){setIsVisible(true);}return function(){return clearTimeout(id);};},[isOpen]);return jsxs(TooltipContext.Provider,{value:true,children:[React__default.cloneElement(children,Object.assign({},mergeProps({onTouchEnd:children.props.onTouchEnd},{onTouchEnd:handleOpen}),{ref:refs.setReference})),jsx(Modal,{accessibilityLabel:content,collapsable:false,transparent:true,visible:isVisible,children:jsx(TouchableOpacity,Object.assign({style:{flexShrink:0,flex:1},onPress:handleClose,activeOpacity:1,testID:"tooltip-modal-backdrop"},metaAttribute({name:MetaConstants.Tooltip}),{children:jsx(TooltipContent,{title:title,isVisible:isOpen,ref:refs.setFloating,side:side,style:Object.assign({},floatingStyles,{left:floatingStyles.left||-200,top:floatingStyles.top||-200,zIndex:zIndex}),arrow:jsx(PopupArrow,{ref:arrowRef,context:context,width:ARROW_WIDTH,height:ARROW_HEIGHT,fillColor:theme.colors.popup.background.intense,strokeColor:theme.colors.popup.border.intense}),children:content})}))})]});};
21
+ var Tooltip=function Tooltip(_ref){var title=_ref.title,content=_ref.content,children=_ref.children,_ref$placement=_ref.placement,placement=_ref$placement===void 0?'left':_ref$placement,onOpenChange=_ref.onOpenChange,_ref$zIndex=_ref.zIndex,zIndex=_ref$zIndex===void 0?componentZIndices.tooltip:_ref$zIndex;var _useTheme=useTheme(),theme=_useTheme.theme;var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isOpen=_React$useState2[0],setIsOpen=_React$useState2[1];var gap=theme.spacing[2];var _getFloatingPlacement=getFloatingPlacementParts(placement),_getFloatingPlacement2=_slicedToArray(_getFloatingPlacement,1),side=_getFloatingPlacement2[0];var isHorizontal=side==='left'||side==='right';var arrowRef=React__default.useRef();var context=useFloating({sameScrollView:false,placement:placement,middleware:[shift({crossAxis:false,padding:gap}),flip({padding:gap}),offset(gap+ARROW_HEIGHT),arrow({element:arrowRef,padding:isHorizontal?0:ARROW_WIDTH})]});var refs=context.refs,floatingStyles=context.floatingStyles;var handleOpen=React__default.useCallback(function(){setIsOpen(true);onOpenChange==null?void 0:onOpenChange({isOpen:true});},[onOpenChange]);var handleClose=React__default.useCallback(function(){setIsOpen(false);onOpenChange==null?void 0:onOpenChange({isOpen:false});},[onOpenChange]);var _React$useState3=React__default.useState(function(){return isOpen;}),_React$useState4=_slicedToArray(_React$useState3,2),isVisible=_React$useState4[0],setIsVisible=_React$useState4[1];React__default.useEffect(function(){var id=setTimeout(function(){if(!isOpen){setIsVisible(false);}},theme.motion.duration.gentle);if(isOpen){setIsVisible(true);}return function(){return clearTimeout(id);};},[isOpen]);return jsxs(TooltipContext.Provider,{value:true,children:[React__default.cloneElement(children,Object.assign({},mergeProps({onTouchEnd:children.props.onTouchEnd},{onTouchEnd:handleOpen}),{ref:refs.setReference})),jsx(Modal,{accessibilityLabel:content,collapsable:false,transparent:true,visible:isVisible,children:jsx(TouchableOpacity,Object.assign({style:{flexShrink:0,flex:1},onPress:handleClose,activeOpacity:1,testID:"tooltip-modal-backdrop"},metaAttribute({name:MetaConstants.Tooltip}),{children:jsx(TooltipContent,{title:title,isVisible:isOpen,ref:refs.setFloating,side:side,style:Object.assign({},floatingStyles,{left:floatingStyles.left||-200,top:floatingStyles.top||-200,zIndex:zIndex}),arrow:jsx(PopupArrow,{ref:arrowRef,context:context,width:ARROW_WIDTH,height:ARROW_HEIGHT,fillColor:theme.colors.popup.background.intense,strokeColor:theme.colors.popup.border.intense}),children:content})}))})]});};
21
22
 
22
23
  export { Tooltip };
23
24
  //# sourceMappingURL=Tooltip.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.native.js","sources":["../../../../../src/components/Tooltip/Tooltip.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/restrict-plus-operands */\nimport { arrow, shift, useFloating, flip, offset } from '@floating-ui/react-native';\nimport React from 'react';\nimport { Modal, TouchableOpacity } from 'react-native';\nimport { TooltipContent } from './TooltipContent';\nimport type { TooltipProps } from './types';\nimport { ARROW_HEIGHT, ARROW_WIDTH, tooltipZIndex } from './constants';\nimport { TooltipContext } from './TooltipContext';\nimport { useTheme } from '~components/BladeProvider';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { mergeProps } from '~utils/mergeProps';\nimport { PopupArrow } from '~components/PopupArrow';\nimport { getFloatingPlacementParts } from '~utils/getFloatingPlacementParts';\n\nconst Tooltip = ({\n title,\n content,\n children,\n placement = 'left',\n onOpenChange,\n zIndex = tooltipZIndex,\n}: TooltipProps): React.ReactElement => {\n const { theme } = useTheme();\n const [isOpen, setIsOpen] = React.useState(false);\n\n const gap = theme.spacing[2];\n const [side] = getFloatingPlacementParts(placement);\n const isHorizontal = side === 'left' || side === 'right';\n const arrowRef = React.useRef();\n const context = useFloating({\n sameScrollView: false,\n placement,\n middleware: [\n shift({ crossAxis: false, padding: gap }),\n flip({ padding: gap }),\n offset(gap + ARROW_HEIGHT),\n arrow({\n element: arrowRef,\n padding: isHorizontal ? 0 : ARROW_WIDTH,\n }),\n ],\n });\n\n const { refs, floatingStyles } = context;\n\n const handleOpen = React.useCallback(() => {\n setIsOpen(true);\n onOpenChange?.({ isOpen: true });\n }, [onOpenChange]);\n\n const handleClose = React.useCallback(() => {\n setIsOpen(false);\n onOpenChange?.({ isOpen: false });\n }, [onOpenChange]);\n\n // wait for animation to finish before unmounting modal\n const [isVisible, setIsVisible] = React.useState(() => isOpen);\n React.useEffect(() => {\n const id = setTimeout(() => {\n if (!isOpen) {\n setIsVisible(false);\n }\n }, theme.motion.duration.gentle);\n\n if (isOpen) {\n setIsVisible(true);\n }\n return () => clearTimeout(id);\n }, [isOpen]);\n\n return (\n <TooltipContext.Provider value={true}>\n {/* Cloning the trigger children to enhance it with ref and event handler */}\n {React.cloneElement(children, {\n ...mergeProps(\n {\n onTouchEnd: children.props.onTouchEnd,\n },\n { onTouchEnd: handleOpen },\n ),\n ref: refs.setReference,\n })}\n <Modal accessibilityLabel={content} collapsable={false} transparent visible={isVisible}>\n <TouchableOpacity\n style={{\n flexShrink: 0,\n flex: 1,\n }}\n onPress={handleClose}\n activeOpacity={1}\n testID=\"tooltip-modal-backdrop\"\n {...metaAttribute({ name: MetaConstants.Tooltip })}\n >\n <TooltipContent\n title={title}\n isVisible={isOpen}\n ref={refs.setFloating}\n side={side}\n style={{\n ...floatingStyles,\n // To avoid flash of floating ui content at top, this only happens in RN <70\n // if the position is zero move the floating element outside of the viewport\n // this happens because measure is async and it takes few miliseconds to calculate the positions.\n left: floatingStyles.left || -200,\n top: floatingStyles.top || -200,\n // TODO: Tokenize zIndex values\n zIndex,\n }}\n arrow={\n <PopupArrow\n ref={arrowRef as never}\n context={context}\n width={ARROW_WIDTH}\n height={ARROW_HEIGHT}\n fillColor={theme.colors.popup.background.intense}\n strokeColor={theme.colors.popup.border.intense}\n />\n }\n >\n {content}\n </TooltipContent>\n </TouchableOpacity>\n </Modal>\n </TooltipContext.Provider>\n );\n};\n\nexport { Tooltip };\n"],"names":["Tooltip","_ref","title","content","children","_ref$placement","placement","onOpenChange","_ref$zIndex","zIndex","tooltipZIndex","_useTheme","useTheme","theme","_React$useState","React","useState","_React$useState2","_slicedToArray","isOpen","setIsOpen","gap","spacing","_getFloatingPlacement","getFloatingPlacementParts","_getFloatingPlacement2","side","isHorizontal","arrowRef","useRef","context","useFloating","sameScrollView","middleware","shift","crossAxis","padding","flip","offset","ARROW_HEIGHT","arrow","element","ARROW_WIDTH","refs","floatingStyles","handleOpen","useCallback","handleClose","_React$useState3","_React$useState4","isVisible","setIsVisible","useEffect","id","setTimeout","motion","duration","gentle","clearTimeout","_jsxs","TooltipContext","Provider","value","cloneElement","Object","assign","mergeProps","onTouchEnd","props","ref","setReference","_jsx","Modal","accessibilityLabel","collapsable","transparent","visible","TouchableOpacity","style","flexShrink","flex","onPress","activeOpacity","testID","metaAttribute","name","MetaConstants","TooltipContent","setFloating","left","top","PopupArrow","width","height","fillColor","colors","popup","background","intense","strokeColor","border"],"mappings":";;;;;;;;;;;;;;;;;;;AAcM,IAAAA,OAAO,CAAG,SAAVA,OAAOA,CAAAC,IAAA,CAO2B,KANtCC,KAAK,CAA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C8C,GAAG,EAAI,CAAC,GAAG,CAE/BjF,MAAM,CAANA,MAAM,CACN,CAAA,CACF+B,KAAK,CACH+B,GAAA,CAACoB,UAAU,EACTtB,GAAG,CAAEzC,QAAkB,CACvBE,OAAO,CAAEA,OAAQ,CACjB8D,KAAK,CAAElD,WAAY,CACnBmD,MAAM,CAAEtD,YAAa,CACrBuD,SAAS,CAAEjF,KAAK,CAACkF,MAAM,CAACC,KAAK,CAACC,UAAU,CAACC,OAAQ,CACjDC,WAAW,CAAEtF,KAAK,CAACkF,MAAM,CAACC,KAAK,CAACI,MAAM,CAACF,OAAQ,CAChD,CACF,CAAA9F,QAAA,CAEAD,OAAO,CACM,CAAC,CAAA,CACD,CAAC,CACd,CAAC,CACe,CAAA,CAAC,CAE9B;;;;"}
1
+ {"version":3,"file":"Tooltip.native.js","sources":["../../../../../src/components/Tooltip/Tooltip.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/restrict-plus-operands */\nimport { arrow, shift, useFloating, flip, offset } from '@floating-ui/react-native';\nimport React from 'react';\nimport { Modal, TouchableOpacity } from 'react-native';\nimport { TooltipContent } from './TooltipContent';\nimport type { TooltipProps } from './types';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './constants';\nimport { TooltipContext } from './TooltipContext';\nimport { useTheme } from '~components/BladeProvider';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { mergeProps } from '~utils/mergeProps';\nimport { PopupArrow } from '~components/PopupArrow';\nimport { getFloatingPlacementParts } from '~utils/getFloatingPlacementParts';\nimport { componentZIndices } from '~utils/componentZIndices';\n\nconst Tooltip = ({\n title,\n content,\n children,\n placement = 'left',\n onOpenChange,\n zIndex = componentZIndices.tooltip,\n}: TooltipProps): React.ReactElement => {\n const { theme } = useTheme();\n const [isOpen, setIsOpen] = React.useState(false);\n\n const gap = theme.spacing[2];\n const [side] = getFloatingPlacementParts(placement);\n const isHorizontal = side === 'left' || side === 'right';\n const arrowRef = React.useRef();\n const context = useFloating({\n sameScrollView: false,\n placement,\n middleware: [\n shift({ crossAxis: false, padding: gap }),\n flip({ padding: gap }),\n offset(gap + ARROW_HEIGHT),\n arrow({\n element: arrowRef,\n padding: isHorizontal ? 0 : ARROW_WIDTH,\n }),\n ],\n });\n\n const { refs, floatingStyles } = context;\n\n const handleOpen = React.useCallback(() => {\n setIsOpen(true);\n onOpenChange?.({ isOpen: true });\n }, [onOpenChange]);\n\n const handleClose = React.useCallback(() => {\n setIsOpen(false);\n onOpenChange?.({ isOpen: false });\n }, [onOpenChange]);\n\n // wait for animation to finish before unmounting modal\n const [isVisible, setIsVisible] = React.useState(() => isOpen);\n React.useEffect(() => {\n const id = setTimeout(() => {\n if (!isOpen) {\n setIsVisible(false);\n }\n }, theme.motion.duration.gentle);\n\n if (isOpen) {\n setIsVisible(true);\n }\n return () => clearTimeout(id);\n }, [isOpen]);\n\n return (\n <TooltipContext.Provider value={true}>\n {/* Cloning the trigger children to enhance it with ref and event handler */}\n {React.cloneElement(children, {\n ...mergeProps(\n {\n onTouchEnd: children.props.onTouchEnd,\n },\n { onTouchEnd: handleOpen },\n ),\n ref: refs.setReference,\n })}\n <Modal accessibilityLabel={content} collapsable={false} transparent visible={isVisible}>\n <TouchableOpacity\n style={{\n flexShrink: 0,\n flex: 1,\n }}\n onPress={handleClose}\n activeOpacity={1}\n testID=\"tooltip-modal-backdrop\"\n {...metaAttribute({ name: MetaConstants.Tooltip })}\n >\n <TooltipContent\n title={title}\n isVisible={isOpen}\n ref={refs.setFloating}\n side={side}\n style={{\n ...floatingStyles,\n // To avoid flash of floating ui content at top, this only happens in RN <70\n // if the position is zero move the floating element outside of the viewport\n // this happens because measure is async and it takes few miliseconds to calculate the positions.\n left: floatingStyles.left || -200,\n top: floatingStyles.top || -200,\n // TODO: Tokenize zIndex values\n zIndex,\n }}\n arrow={\n <PopupArrow\n ref={arrowRef as never}\n context={context}\n width={ARROW_WIDTH}\n height={ARROW_HEIGHT}\n fillColor={theme.colors.popup.background.intense}\n strokeColor={theme.colors.popup.border.intense}\n />\n }\n >\n {content}\n </TooltipContent>\n </TouchableOpacity>\n </Modal>\n </TooltipContext.Provider>\n );\n};\n\nexport { Tooltip };\n"],"names":["Tooltip","_ref","title","content","children","_ref$placement","placement","onOpenChange","_ref$zIndex","zIndex","componentZIndices","tooltip","_useTheme","useTheme","theme","_React$useState","React","useState","_React$useState2","_slicedToArray","isOpen","setIsOpen","gap","spacing","_getFloatingPlacement","getFloatingPlacementParts","_getFloatingPlacement2","side","isHorizontal","arrowRef","useRef","context","useFloating","sameScrollView","middleware","shift","crossAxis","padding","flip","offset","ARROW_HEIGHT","arrow","element","ARROW_WIDTH","refs","floatingStyles","handleOpen","useCallback","handleClose","_React$useState3","_React$useState4","isVisible","setIsVisible","useEffect","id","setTimeout","motion","duration","gentle","clearTimeout","_jsxs","TooltipContext","Provider","value","cloneElement","Object","assign","mergeProps","onTouchEnd","props","ref","setReference","_jsx","Modal","accessibilityLabel","collapsable","transparent","visible","TouchableOpacity","style","flexShrink","flex","onPress","activeOpacity","testID","metaAttribute","name","MetaConstants","TooltipContent","setFloating","left","top","PopupArrow","width","height","fillColor","colors","popup","background","intense","strokeColor","border"],"mappings":";;;;;;;;;;;;;;;;;;;;AAeM,IAAAA,OAAO,CAAG,SAAVA,OAAOA,CAAAC,IAAA,CAO2B,KANtCC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,OAAO,CAAAF,IAAA,CAAPE,OAAO,CACPC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CAAAC,cAAA,CAAAJ,IAAA,CACRK,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,MAAM,CAAAA,cAAA,CAClBE,YAAY,CAAAN,IAAA,CAAZM,YAAY,CAAAC,WAAA,CAAAP,IAAA,CACZQ,MAAM,CAANA,MAAM,CAAAD,WAAA,UAAGE,iBAAiB,CAACC,OAAO,CAAAH,WAAA,CAElC,IAAAI,SAAA,CAAkBC,QAAQ,E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ACF,OAAQ,CAChD,CACF,CAAA/F,QAAA,CAEAD,OAAO,CACM,CAAC,CAAA,CACD,CAAC,CACd,CAAC,CACe,CAAA,CAAC,CAE9B;;;;"}
@@ -1,4 +1,4 @@
1
- var ARROW_WIDTH=14;var ARROW_HEIGHT=7;var tooltipZIndex=1100;
1
+ var ARROW_WIDTH=14;var ARROW_HEIGHT=7;
2
2
 
3
- export { ARROW_HEIGHT, ARROW_WIDTH, tooltipZIndex };
3
+ export { ARROW_HEIGHT, ARROW_WIDTH };
4
4
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/components/Tooltip/constants.ts"],"sourcesContent":["export const ARROW_WIDTH = 14;\nexport const ARROW_HEIGHT = 7;\nexport const tooltipZIndex = 1100;\n"],"names":["ARROW_WIDTH","ARROW_HEIGHT","tooltipZIndex"],"mappings":"AAAa,IAAAA,WAAW,CAAG,GACd,IAAAC,YAAY,CAAG,EACf,IAAAC,aAAa,CAAG;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/components/Tooltip/constants.ts"],"sourcesContent":["export const ARROW_WIDTH = 14;\nexport const ARROW_HEIGHT = 7;\n"],"names":["ARROW_WIDTH","ARROW_HEIGHT"],"mappings":"AAAa,IAAAA,WAAW,CAAG,GACd,IAAAC,YAAY,CAAG;;;;"}
@@ -9,6 +9,8 @@ export { Badge } from './Badge/Badge.js';
9
9
  export { BladeProvider } from './BladeProvider/BladeProvider.native.js';
10
10
  export { default as useTheme } from './BladeProvider/useTheme.js';
11
11
  export { BottomSheet } from './BottomSheet/BottomSheet.native.js';
12
+ export { Breadcrumb } from './Breadcrumb/Breadcrumb.native.js';
13
+ export { BreadcrumbItem } from './Breadcrumb/BreadcrumbItem.native.js';
12
14
  export { Box } from './Box/Box.js';
13
15
  export { default as Button } from './Button/Button/Button.js';
14
16
  export { IconButton } from './Button/IconButton/IconButton.js';
@@ -27,6 +29,8 @@ export { CollapsibleButton } from './Collapsible/CollapsibleButton.js';
27
29
  export { CollapsibleBody } from './Collapsible/CollapsibleBody.js';
28
30
  export { Counter } from './Counter/Counter.js';
29
31
  export { Divider } from './Divider/Divider.js';
32
+ export { Drawer } from './Drawer/Drawer.native.js';
33
+ export { DrawerBody, DrawerHeader } from './Drawer/DrawerSubcomponents.native.js';
30
34
  export { Dropdown } from './Dropdown/Dropdown.js';
31
35
  export { DropdownOverlay } from './Dropdown/DropdownOverlay.native.js';
32
36
  export { DropdownButton } from './Dropdown/DropdownButton.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,4 @@
1
+ var componentZIndices={bottomSheet:100,modal:1000,drawer:1001,dropdownOverlay:1002,tourMask:1100,popover:1100,tooltip:1100};
2
+
3
+ export { componentZIndices };
4
+ //# sourceMappingURL=componentZIndices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentZIndices.js","sources":["../../../../src/utils/componentZIndices.ts"],"sourcesContent":["// TODO: Move these properly to tokens at some point\nexport const componentZIndices = {\n bottomSheet: 100,\n modal: 1000,\n drawer: 1001,\n dropdownOverlay: 1002,\n tourMask: 1100,\n popover: 1100,\n tooltip: 1100,\n};\n"],"names":["componentZIndices","bottomSheet","modal","drawer","dropdownOverlay","tourMask","popover","tooltip"],"mappings":"AACa,IAAAA,iBAAiB,CAAG,CAC/BC,WAAW,CAAE,GAAG,CAChBC,KAAK,CAAE,IAAI,CACXC,MAAM,CAAE,IAAI,CACZC,eAAe,CAAE,IAAI,CACrBC,QAAQ,CAAE,IAAI,CACdC,OAAO,CAAE,IAAI,CACbC,OAAO,CAAE,IACX;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sources":["../../../../../src/utils/lodashButBetter/get.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */\nimport type { ElevationStyles } from '~tokens/global/elevation';\nimport type { EasingType } from '~tokens/global/motion';\n\n/**\n * @template TokenType token type generic\n * @description Tokenises objects to dot notation strings, eg: `surface.text.normal.lowContrast`\n */\nexport type DotNotationToken<_TokenType, TokenType = Omit<_TokenType, 'name'>> = {\n [K in keyof TokenType]: TokenType[K] extends string | number | ElevationStyles\n ? `${Extract<K, number | string>}`\n : `${Extract<K, number | string>}.${TokenType[K] extends Record<\n string,\n string | number | boolean | EasingType<string>\n >\n ? Extract<keyof TokenType[K], number | string>\n : DotNotationToken<TokenType[K]>}`;\n}[keyof TokenType];\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nfunction getIn<\n T extends Record<string, any>,\n K extends DotNotationToken<T>,\n Default extends any = any\n>(obj: T, path: K, defaultValue?: Default): any {\n if (!path) {\n return defaultValue;\n }\n\n const keys = path.split('.');\n let result = obj;\n\n for (const key of keys) {\n result = result?.[key];\n if (result === undefined) {\n return defaultValue;\n }\n }\n\n return result !== undefined ? result : defaultValue;\n}\n\nexport default getIn;\n"],"names":["getIn","obj","path","defaultValue","keys","split","result","key","_result","undefined"],"mappings":"AAqBA,SAASA,KAAKA,CAIZC,GAAM,CAAEC,IAAO,CAAEC,YAAsB,CAAO,CAC9C,GAAI,CAACD,IAAI,CAAE,CACT,OAAOC,YAAY,CACrB,CAEA,IAAMC,IAAI,CAAGF,IAAI,CAACG,KAAK,CAAC,GAAG,CAAC,CAC5B,IAAIC,MAAM,CAAGL,GAAG,CAEhB,IAAK,IAAMM,GAAG,IAAIH,IAAI,CAAE,CAAAI,IAAAA,OAAA,CACtBF,MAAM,CAAA,CAAAE,OAAA,CAAGF,MAAM,GAANE,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,OAAA,CAASD,GAAG,CAAC,CACtB,GAAID,MAAM,GAAKG,SAAS,CAAE,CACxB,OAAON,YAAY,CACrB,CACF,CAEA,OAAOG,MAAM,GAAKG,SAAS,CAAGH,MAAM,CAAGH,YAAY,CACrD;;;;"}
1
+ {"version":3,"file":"get.js","sources":["../../../../../src/utils/lodashButBetter/get.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */\nimport type { ElevationStyles } from '~tokens/global/elevation';\nimport type { EasingType } from '~tokens/global/motion';\n\n/**\n * @template TokenType token type generic\n * @description Tokenises objects to dot notation strings, eg: `surface.text.gray.normal`\n */\nexport type DotNotationToken<_TokenType, TokenType = Omit<_TokenType, 'name'>> = {\n [K in keyof TokenType]: TokenType[K] extends string | number | ElevationStyles\n ? `${Extract<K, number | string>}`\n : `${Extract<K, number | string>}.${TokenType[K] extends Record<\n string,\n string | number | boolean | EasingType<string>\n >\n ? Extract<keyof TokenType[K], number | string>\n : DotNotationToken<TokenType[K]>}`;\n}[keyof TokenType];\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nfunction getIn<\n T extends Record<string, any>,\n K extends DotNotationToken<T>,\n Default extends any = any\n>(obj: T, path: K, defaultValue?: Default): any {\n if (!path) {\n return defaultValue;\n }\n\n const keys = path.split('.');\n let result = obj;\n\n for (const key of keys) {\n result = result?.[key];\n if (result === undefined) {\n return defaultValue;\n }\n }\n\n return result !== undefined ? result : defaultValue;\n}\n\nexport default getIn;\n"],"names":["getIn","obj","path","defaultValue","keys","split","result","key","_result","undefined"],"mappings":"AAqBA,SAASA,KAAKA,CAIZC,GAAM,CAAEC,IAAO,CAAEC,YAAsB,CAAO,CAC9C,GAAI,CAACD,IAAI,CAAE,CACT,OAAOC,YAAY,CACrB,CAEA,IAAMC,IAAI,CAAGF,IAAI,CAACG,KAAK,CAAC,GAAG,CAAC,CAC5B,IAAIC,MAAM,CAAGL,GAAG,CAEhB,IAAK,IAAMM,GAAG,IAAIH,IAAI,CAAE,CAAAI,IAAAA,OAAA,CACtBF,MAAM,CAAA,CAAAE,OAAA,CAAGF,MAAM,GAANE,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,OAAA,CAASD,GAAG,CAAC,CACtB,GAAID,MAAM,GAAKG,SAAS,CAAE,CACxB,OAAON,YAAY,CACrB,CACF,CAEA,OAAOG,MAAM,GAAKG,SAAS,CAAGH,MAAM,CAAGH,YAAY,CACrD;;;;"}
@@ -1,4 +1,4 @@
1
- var MetaConstants={Accordion:'accordion',AccordionButton:'accordion-button',AccordionItem:'accordion-item',ActionList:'action-list',ActionListItem:'action-list-item',ActionListSection:'action-list-section',Alert:'alert',Amount:'amount',AutoComplete:'autocomplete',Badge:'badge',Box:'box',BaseBox:'base-box',BaseText:'base-text',Button:'button',Carousel:'carousel',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',CheckboxLabel:'checkbox-label',Chip:'chip',ChipGroup:'chip-group',ChipLabel:'chip-label',Code:'code',Component:'blade-component',Counter:'counter',Display:'display',Divider:'divider',Dropdown:'dropdown',DropdownOverlay:'dropdown-overlay',DropdownFooter:'dropdown-footer',DropdownHeader:'dropdown-header',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',List:'list',ListItem:'list-item',ListItemCode:'list-item-code',ListItemLink:'list-item-link',ListItemText:'list-item-text',OTPInput:'otp-input',PasswordInput:'password-input',TextArea:'textarea',TextInput:'textinput',Toast:'toast',ToastContainer:'toast-container',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',RadioLabel:'radio-label',SkipNav:'skipnav',Spinner:'spinner',SelectInput:'select-input',Tag:'tag',Tooltip:'tooltip',TooltipInteractiveWrapper:'tooltip-interactive-wrapper',Tabs:'tabs',TabList:'tab-list',TabItem:'tab-item',TabPanel:'tab-panel',TabIndicator:'tab-indicator',Table:'table',TableBody:'table-body',TableRow:'table-row',TableCell:'table-cell',TableHeader:'table-header',TableHeaderRow:'table-header-row',TableHeaderCell:'table-header-cell',TableFooter:'table-footer',TableFooterRow:'table-footer-row',TableFooterCell:'table-footer-cell',TableElement:'table-element',TourPopover:'tour-popover',TourMask:'tour-mask',Popover:'popover',PopoverInteractiveWrapper:'popover-interactive-wrapper',BottomSheet:'bottom-sheet',BottomSheetBody:'bottom-sheet-body',BottomSheetHeader:'bottom-sheet-header',BottomSheetFooter:'bottom-sheet-footer',BottomSheetGrabHandle:'bottomsheet-grab-handle',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer',Collapsible:'collapsible',CollapsibleBody:'collapsible-body',CollapsibleButton:'collapsible-button',CollapsibleLink:'collapsible-link',Modal:'modal',ModalBody:'modal-body',ModalHeader:'modal-header',ModalFooter:'modal-footer',ModalBackdrop:'modal-backdrop',ModalScrollOverlay:'modal-scroll-overlay',VisuallyHidden:'visually-hidden',FormLabel:'form-label',Switch:'switch',SwitchLabel:'switch-label',StyledBaseInput:'styled-base-input',Skeleton:'skeleton'};
1
+ var MetaConstants={Accordion:'accordion',AccordionButton:'accordion-button',AccordionItem:'accordion-item',ActionList:'action-list',ActionListItem:'action-list-item',ActionListSection:'action-list-section',Alert:'alert',Amount:'amount',AutoComplete:'autocomplete',Badge:'badge',Box:'box',BaseBox:'base-box',BaseText:'base-text',Button:'button',Breadcrumb:'breadcrumb',BreadcrumbItem:'breadcrumb-item',Carousel:'carousel',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',CheckboxLabel:'checkbox-label',Chip:'chip',ChipGroup:'chip-group',ChipLabel:'chip-label',Code:'code',Component:'blade-component',Counter:'counter',Display:'display',Divider:'divider',Drawer:'drawer',Dropdown:'dropdown',DropdownOverlay:'dropdown-overlay',DropdownFooter:'dropdown-footer',DropdownHeader:'dropdown-header',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',List:'list',ListItem:'list-item',ListItemCode:'list-item-code',ListItemLink:'list-item-link',ListItemText:'list-item-text',OTPInput:'otp-input',PasswordInput:'password-input',TextArea:'textarea',TextInput:'textinput',Toast:'toast',ToastContainer:'toast-container',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',RadioLabel:'radio-label',SkipNav:'skipnav',Spinner:'spinner',SelectInput:'select-input',Tag:'tag',Tooltip:'tooltip',TooltipInteractiveWrapper:'tooltip-interactive-wrapper',Tabs:'tabs',TabList:'tab-list',TabItem:'tab-item',TabPanel:'tab-panel',TabIndicator:'tab-indicator',Table:'table',TableBody:'table-body',TableRow:'table-row',TableCell:'table-cell',TableHeader:'table-header',TableHeaderRow:'table-header-row',TableHeaderCell:'table-header-cell',TableFooter:'table-footer',TableFooterRow:'table-footer-row',TableFooterCell:'table-footer-cell',TableElement:'table-element',TourPopover:'tour-popover',TourMask:'tour-mask',Popover:'popover',PopoverInteractiveWrapper:'popover-interactive-wrapper',BottomSheet:'bottom-sheet',BottomSheetBody:'bottom-sheet-body',BottomSheetHeader:'bottom-sheet-header',BottomSheetFooter:'bottom-sheet-footer',BottomSheetGrabHandle:'bottomsheet-grab-handle',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer',Collapsible:'collapsible',CollapsibleBody:'collapsible-body',CollapsibleButton:'collapsible-button',CollapsibleLink:'collapsible-link',Modal:'modal',ModalBody:'modal-body',ModalHeader:'modal-header',ModalFooter:'modal-footer',ModalBackdrop:'modal-backdrop',ModalScrollOverlay:'modal-scroll-overlay',VisuallyHidden:'visually-hidden',FormLabel:'form-label',Switch:'switch',SwitchLabel:'switch-label',StyledBaseInput:'styled-base-input',Skeleton:'skeleton'};
2
2
 
3
3
  export { MetaConstants };
4
4
  //# sourceMappingURL=metaConstants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"metaConstants.js","sources":["../../../../../src/utils/metaAttribute/metaConstants.ts"],"sourcesContent":["export const MetaConstants = {\n Accordion: 'accordion',\n AccordionButton: 'accordion-button',\n AccordionItem: 'accordion-item',\n ActionList: 'action-list',\n ActionListItem: 'action-list-item',\n ActionListSection: 'action-list-section',\n Alert: 'alert',\n Amount: 'amount',\n AutoComplete: 'autocomplete',\n Badge: 'badge',\n Box: 'box',\n BaseBox: 'base-box',\n BaseText: 'base-text',\n Button: 'button',\n Carousel: 'carousel',\n Checkbox: 'checkbox',\n CheckboxGroup: 'checkbox-group',\n CheckboxLabel: 'checkbox-label',\n Chip: 'chip',\n ChipGroup: 'chip-group',\n ChipLabel: 'chip-label',\n Code: 'code',\n Component: 'blade-component',\n Counter: 'counter',\n Display: 'display',\n Divider: 'divider',\n Dropdown: 'dropdown',\n DropdownOverlay: 'dropdown-overlay',\n DropdownFooter: 'dropdown-footer',\n DropdownHeader: 'dropdown-header',\n Icon: 'icon',\n IconButton: 'icon-button',\n Indicator: 'indicator',\n Link: 'link',\n List: 'list',\n ListItem: 'list-item',\n ListItemCode: 'list-item-code',\n ListItemLink: 'list-item-link',\n ListItemText: 'list-item-text',\n OTPInput: 'otp-input',\n PasswordInput: 'password-input',\n TextArea: 'textarea',\n TextInput: 'textinput',\n Toast: 'toast',\n ToastContainer: 'toast-container',\n ProgressBar: 'progress-bar',\n Radio: 'radio',\n RadioGroup: 'radio-group',\n RadioLabel: 'radio-label',\n SkipNav: 'skipnav',\n Spinner: 'spinner',\n SelectInput: 'select-input',\n Tag: 'tag',\n Tooltip: 'tooltip',\n TooltipInteractiveWrapper: 'tooltip-interactive-wrapper',\n Tabs: 'tabs',\n TabList: 'tab-list',\n TabItem: 'tab-item',\n TabPanel: 'tab-panel',\n TabIndicator: 'tab-indicator',\n Table: 'table',\n TableBody: 'table-body',\n TableRow: 'table-row',\n TableCell: 'table-cell',\n TableHeader: 'table-header',\n TableHeaderRow: 'table-header-row',\n TableHeaderCell: 'table-header-cell',\n TableFooter: 'table-footer',\n TableFooterRow: 'table-footer-row',\n TableFooterCell: 'table-footer-cell',\n TableElement: 'table-element',\n TourPopover: 'tour-popover',\n TourMask: 'tour-mask',\n Popover: 'popover',\n PopoverInteractiveWrapper: 'popover-interactive-wrapper',\n BottomSheet: 'bottom-sheet',\n BottomSheetBody: 'bottom-sheet-body',\n BottomSheetHeader: 'bottom-sheet-header',\n BottomSheetFooter: 'bottom-sheet-footer',\n BottomSheetGrabHandle: 'bottomsheet-grab-handle',\n Card: 'card',\n CardBody: 'card-body',\n CardHeader: 'card-header',\n CardFooter: 'card-footer',\n Collapsible: 'collapsible',\n CollapsibleBody: 'collapsible-body',\n CollapsibleButton: 'collapsible-button',\n CollapsibleLink: 'collapsible-link',\n Modal: 'modal',\n ModalBody: 'modal-body',\n ModalHeader: 'modal-header',\n ModalFooter: 'modal-footer',\n ModalBackdrop: 'modal-backdrop',\n ModalScrollOverlay: 'modal-scroll-overlay',\n VisuallyHidden: 'visually-hidden',\n FormLabel: 'form-label',\n Switch: 'switch',\n SwitchLabel: 'switch-label',\n StyledBaseInput: 'styled-base-input',\n Skeleton: 'skeleton',\n} as const;\n"],"names":["MetaConstants","Accordion","AccordionButton","AccordionItem","ActionList","ActionListItem","ActionListSection","Alert","Amount","AutoComplete","Badge","Box","BaseBox","BaseText","Button","Carousel","Checkbox","CheckboxGroup","CheckboxLabel","Chip","ChipGroup","ChipLabel","Code","Component","Counter","Display","Divider","Dropdown","DropdownOverlay","DropdownFooter","DropdownHeader","Icon","IconButton","Indicator","Link","List","ListItem","ListItemCode","ListItemLink","ListItemText","OTPInput","PasswordInput","TextArea","TextInput","Toast","ToastContainer","ProgressBar","Radio","RadioGroup","RadioLabel","SkipNav","Spinner","SelectInput","Tag","Tooltip","TooltipInteractiveWrapper","Tabs","TabList","TabItem","TabPanel","TabIndicator","Table","TableBody","TableRow","TableCell","TableHeader","TableHeaderRow","TableHeaderCell","TableFooter","TableFooterRow","TableFooterCell","TableElement","TourPopover","TourMask","Popover","PopoverInteractiveWrapper","BottomSheet","BottomSheetBody","BottomSheetHeader","BottomSheetFooter","BottomSheetGrabHandle","Card","CardBody","CardHeader","CardFooter","Collapsible","CollapsibleBody","CollapsibleButton","CollapsibleLink","Modal","ModalBody","ModalHeader","ModalFooter","ModalBackdrop","ModalScrollOverlay","VisuallyHidden","FormLabel","Switch","SwitchLabel","StyledBaseInput","Skeleton"],"mappings":"AAAa,IAAAA,aAAa,CAAG,CAC3BC,SAAS,CAAE,WAAW,CACtBC,eAAe,CAAE,kBAAkB,CACnCC,aAAa,CAAE,gBAAgB,CAC/BC,UAAU,CAAE,aAAa,CACzBC,cAAc,CAAE,kBAAkB,CAClCC,iBAAiB,CAAE,qBAAqB,CACxCC,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,QAAQ,CAChBC,YAAY,CAAE,cAAc,CAC5BC,KAAK,CAAE,OAAO,CACdC,GAAG,CAAE,KAAK,CACVC,OAAO,CAAE,UAAU,CACnBC,QAAQ,CAAE,WAAW,CACrBC,MAAM,CAAE,QAAQ,CAChBC,QAAQ,CAAE,UAAU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C,QAAQ,CAAE,WAAW,CACrBC,SAAS,CAAE,YAAY,CACvBC,WAAW,CAAE,cAAc,CAC3BC,cAAc,CAAE,kBAAkB,CAClCC,eAAe,CAAE,mBAAmB,CACpCC,WAAW,CAAE,cAAc,CAC3BC,cAAc,CAAE,kBAAkB,CAClCC,eAAe,CAAE,mBAAmB,CACpCC,YAAY,CAAE,eAAe,CAC7BC,WAAW,CAAE,cAAc,CAC3BC,QAAQ,CAAE,WAAW,CACrBC,OAAO,CAAE,SAAS,CAClBC,yBAAyB,CAAE,6BAA6B,CACxDC,WAAW,CAAE,cAAc,CAC3BC,eAAe,CAAE,mBAAmB,CACpCC,iBAAiB,CAAE,qBAAqB,CACxCC,iBAAiB,CAAE,qBAAqB,CACxCC,qBAAqB,CAAE,yBAAyB,CAChDC,IAAI,CAAE,MAAM,CACZC,QAAQ,CAAE,WAAW,CACrBC,UAAU,CAAE,aAAa,CACzBC,UAAU,CAAE,aAAa,CACzBC,WAAW,CAAE,aAAa,CAC1BC,eAAe,CAAE,kBAAkB,CACnCC,iBAAiB,CAAE,oBAAoB,CACvCC,eAAe,CAAE,kBAAkB,CACnCC,KAAK,CAAE,OAAO,CACdC,SAAS,CAAE,YAAY,CACvBC,WAAW,CAAE,cAAc,CAC3BC,WAAW,CAAE,cAAc,CAC3BC,aAAa,CAAE,gBAAgB,CAC/BC,kBAAkB,CAAE,sBAAsB,CAC1CC,cAAc,CAAE,iBAAiB,CACjCC,SAAS,CAAE,YAAY,CACvBC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,eAAe,CAAE,mBAAmB,CACpCC,QAAQ,CAAE,UACZ;;;;"}
1
+ {"version":3,"file":"metaConstants.js","sources":["../../../../../src/utils/metaAttribute/metaConstants.ts"],"sourcesContent":["export const MetaConstants = {\n Accordion: 'accordion',\n AccordionButton: 'accordion-button',\n AccordionItem: 'accordion-item',\n ActionList: 'action-list',\n ActionListItem: 'action-list-item',\n ActionListSection: 'action-list-section',\n Alert: 'alert',\n Amount: 'amount',\n AutoComplete: 'autocomplete',\n Badge: 'badge',\n Box: 'box',\n BaseBox: 'base-box',\n BaseText: 'base-text',\n Button: 'button',\n Breadcrumb: 'breadcrumb',\n BreadcrumbItem: 'breadcrumb-item',\n Carousel: 'carousel',\n Checkbox: 'checkbox',\n CheckboxGroup: 'checkbox-group',\n CheckboxLabel: 'checkbox-label',\n Chip: 'chip',\n ChipGroup: 'chip-group',\n ChipLabel: 'chip-label',\n Code: 'code',\n Component: 'blade-component',\n Counter: 'counter',\n Display: 'display',\n Divider: 'divider',\n Drawer: 'drawer',\n Dropdown: 'dropdown',\n DropdownOverlay: 'dropdown-overlay',\n DropdownFooter: 'dropdown-footer',\n DropdownHeader: 'dropdown-header',\n Icon: 'icon',\n IconButton: 'icon-button',\n Indicator: 'indicator',\n Link: 'link',\n List: 'list',\n ListItem: 'list-item',\n ListItemCode: 'list-item-code',\n ListItemLink: 'list-item-link',\n ListItemText: 'list-item-text',\n OTPInput: 'otp-input',\n PasswordInput: 'password-input',\n TextArea: 'textarea',\n TextInput: 'textinput',\n Toast: 'toast',\n ToastContainer: 'toast-container',\n ProgressBar: 'progress-bar',\n Radio: 'radio',\n RadioGroup: 'radio-group',\n RadioLabel: 'radio-label',\n SkipNav: 'skipnav',\n Spinner: 'spinner',\n SelectInput: 'select-input',\n Tag: 'tag',\n Tooltip: 'tooltip',\n TooltipInteractiveWrapper: 'tooltip-interactive-wrapper',\n Tabs: 'tabs',\n TabList: 'tab-list',\n TabItem: 'tab-item',\n TabPanel: 'tab-panel',\n TabIndicator: 'tab-indicator',\n Table: 'table',\n TableBody: 'table-body',\n TableRow: 'table-row',\n TableCell: 'table-cell',\n TableHeader: 'table-header',\n TableHeaderRow: 'table-header-row',\n TableHeaderCell: 'table-header-cell',\n TableFooter: 'table-footer',\n TableFooterRow: 'table-footer-row',\n TableFooterCell: 'table-footer-cell',\n TableElement: 'table-element',\n TourPopover: 'tour-popover',\n TourMask: 'tour-mask',\n Popover: 'popover',\n PopoverInteractiveWrapper: 'popover-interactive-wrapper',\n BottomSheet: 'bottom-sheet',\n BottomSheetBody: 'bottom-sheet-body',\n BottomSheetHeader: 'bottom-sheet-header',\n BottomSheetFooter: 'bottom-sheet-footer',\n BottomSheetGrabHandle: 'bottomsheet-grab-handle',\n Card: 'card',\n CardBody: 'card-body',\n CardHeader: 'card-header',\n CardFooter: 'card-footer',\n Collapsible: 'collapsible',\n CollapsibleBody: 'collapsible-body',\n CollapsibleButton: 'collapsible-button',\n CollapsibleLink: 'collapsible-link',\n Modal: 'modal',\n ModalBody: 'modal-body',\n ModalHeader: 'modal-header',\n ModalFooter: 'modal-footer',\n ModalBackdrop: 'modal-backdrop',\n ModalScrollOverlay: 'modal-scroll-overlay',\n VisuallyHidden: 'visually-hidden',\n FormLabel: 'form-label',\n Switch: 'switch',\n SwitchLabel: 'switch-label',\n StyledBaseInput: 'styled-base-input',\n Skeleton: 'skeleton',\n} as const;\n"],"names":["MetaConstants","Accordion","AccordionButton","AccordionItem","ActionList","ActionListItem","ActionListSection","Alert","Amount","AutoComplete","Badge","Box","BaseBox","BaseText","Button","Breadcrumb","BreadcrumbItem","Carousel","Checkbox","CheckboxGroup","CheckboxLabel","Chip","ChipGroup","ChipLabel","Code","Component","Counter","Display","Divider","Drawer","Dropdown","DropdownOverlay","DropdownFooter","DropdownHeader","Icon","IconButton","Indicator","Link","List","ListItem","ListItemCode","ListItemLink","ListItemText","OTPInput","PasswordInput","TextArea","TextInput","Toast","ToastContainer","ProgressBar","Radio","RadioGroup","RadioLabel","SkipNav","Spinner","SelectInput","Tag","Tooltip","TooltipInteractiveWrapper","Tabs","TabList","TabItem","TabPanel","TabIndicator","Table","TableBody","TableRow","TableCell","TableHeader","TableHeaderRow","TableHeaderCell","TableFooter","TableFooterRow","TableFooterCell","TableElement","TourPopover","TourMask","Popover","PopoverInteractiveWrapper","BottomSheet","BottomSheetBody","BottomSheetHeader","BottomSheetFooter","BottomSheetGrabHandle","Card","CardBody","CardHeader","CardFooter","Collapsible","CollapsibleBody","CollapsibleButton","CollapsibleLink","Modal","ModalBody","ModalHeader","ModalFooter","ModalBackdrop","ModalScrollOverlay","VisuallyHidden","FormLabel","Switch","SwitchLabel","StyledBaseInput","Skeleton"],"mappings":"AAAa,IAAAA,aAAa,CAAG,CAC3BC,SAAS,CAAE,WAAW,CACtBC,eAAe,CAAE,kBAAkB,CACnCC,aAAa,CAAE,gBAAgB,CAC/BC,UAAU,CAAE,aAAa,CACzBC,cAAc,CAAE,kBAAkB,CAClCC,iBAAiB,CAAE,qBAAqB,CACxCC,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,QAAQ,CAChBC,YAAY,CAAE,cAAc,CAC5BC,KAAK,CAAE,OAAO,CACdC,GAAG,CAAE,KAAK,CACVC,OAAO,CAAE,UAAU,CACnBC,QAAQ,CAAE,WAAW,CACrBC,MAAM,CAAE,QAAQ,CAChBC,UAAU,CAAE,YAAY,CACxBC,cAAc,CAAE,iBAAiB,CACjCC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,UAAU,CACpBC,aAAa,CAAE,gBAAgB,CAC/BC,aAAa,CAAE,gBAAgB,CAC/BC,IAAI,CAAE,MAAM,CACZC,SAAS,CAAE,YAAY,CACvBC,SAAS,CAAE,YAAY,CACvBC,IAAI,CAAE,MAAM,CACZC,SAAS,CAAE,iBAAiB,CAC5BC,OAAO,CAAE,SAAS,CAClBC,OAAO,CAAE,SAAS,CAClBC,OAAO,CAAE,SAAS,CAClBC,MAAM,CAAE,QAAQ,CAChBC,QAAQ,CAAE,UAAU,CACpBC,eAAe,CAAE,kBAAkB,CACnCC,cAAc,CAAE,iBAAiB,CACjCC,cAAc,CAAE,iBAAiB,CACjCC,IAAI,CAAE,MAAM,CACZC,UAAU,CAAE,aAAa,CACzBC,SAAS,CAAE,WAAW,CACtBC,IAAI,CAAE,MAAM,CACZC,IAAI,CAAE,MAAM,CACZC,QAAQ,CAAE,WAAW,CACrBC,YAAY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aAAa,CACzBC,UAAU,CAAE,aAAa,CACzBC,WAAW,CAAE,aAAa,CAC1BC,eAAe,CAAE,kBAAkB,CACnCC,iBAAiB,CAAE,oBAAoB,CACvCC,eAAe,CAAE,kBAAkB,CACnCC,KAAK,CAAE,OAAO,CACdC,SAAS,CAAE,YAAY,CACvBC,WAAW,CAAE,cAAc,CAC3BC,WAAW,CAAE,cAAc,CAC3BC,aAAa,CAAE,gBAAgB,CAC/BC,kBAAkB,CAAE,sBAAsB,CAC1CC,cAAc,CAAE,iBAAiB,CACjCC,SAAS,CAAE,YAAY,CACvBC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,eAAe,CAAE,mBAAmB,CACpCC,QAAQ,CAAE,UACZ;;;;"}
@@ -12,6 +12,7 @@ import '../../utils/isValidAllowedChildren/index.js';
12
12
  import '../../utils/index.js';
13
13
  import '../../utils/metaAttribute/index.js';
14
14
  import '../../utils/logger/index.js';
15
+ import '../../tokens/global/index.js';
15
16
  import { jsxs, jsx } from 'react/jsx-runtime';
16
17
  import { getComponentId } from '../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
17
18
  import { throwBladeError, logger } from '../../utils/logger/logger.js';
@@ -22,6 +23,8 @@ import { Box } from '../Box/Box.js';
22
23
  import { IconButton } from '../Button/IconButton/IconButton.js';
23
24
  import ChevronLeftIcon from '../Icons/ChevronLeftIcon/ChevronLeftIcon.js';
24
25
  import { Text } from '../Typography/Text/Text.js';
26
+ import { makeSize } from '../../utils/makeSize/makeSize.js';
27
+ import { size } from '../../tokens/global/size.js';
25
28
  import CloseIcon from '../Icons/CloseIcon/CloseIcon.js';
26
29
  import { Divider } from '../Divider/Divider.js';
27
30
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
@@ -112,6 +115,7 @@ var _BaseHeader = function _BaseHeader(_ref) {
112
115
  onBackButtonClick = _ref.onBackButtonClick,
113
116
  onCloseButtonClick = _ref.onCloseButtonClick,
114
117
  closeButtonRef = _ref.closeButtonRef,
118
+ backButtonRef = _ref.backButtonRef,
115
119
  testID = _ref.testID,
116
120
  onClickCapture = _ref.onClickCapture,
117
121
  onKeyDown = _ref.onKeyDown,
@@ -159,6 +163,7 @@ var _BaseHeader = function _BaseHeader(_ref) {
159
163
  marginRight: "spacing.5",
160
164
  children: /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread({}, centerBoxProps), {}, {
161
165
  children: /*#__PURE__*/jsx(IconButton, {
166
+ ref: backButtonRef,
162
167
  size: "large",
163
168
  icon: ChevronLeftIcon,
164
169
  onClick: function onClick() {
@@ -175,8 +180,6 @@ var _BaseHeader = function _BaseHeader(_ref) {
175
180
  flexDirection: "row",
176
181
  alignItems: "flex-start",
177
182
  children: [leading ? /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
178
- width: "spacing.8",
179
- height: "spacing.8",
180
183
  marginRight: "spacing.3"
181
184
  }, centerBoxProps), {}, {
182
185
  children: leading
@@ -193,6 +196,7 @@ var _BaseHeader = function _BaseHeader(_ref) {
193
196
  flexDirection: "row",
194
197
  children: [title ? /*#__PURE__*/jsx(Text, {
195
198
  size: "large",
199
+ marginTop: makeSize(size['1']),
196
200
  weight: "semibold",
197
201
  color: "surface.text.gray.normal",
198
202
  children: title