@razorpay/blade 11.21.9 → 11.23.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.
- package/build/lib/native/components/ActionList/ActionListItem.js +12 -12
- package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseFooter.js +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseFooter.js.map +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/native/components/BaseMenu/BaseMenuContext.js +6 -0
- package/build/lib/native/components/BaseMenu/BaseMenuContext.js.map +1 -0
- package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +22 -0
- package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -0
- package/build/lib/native/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.native.js +12 -0
- package/build/lib/native/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.native.js.map +1 -0
- package/build/lib/native/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js +12 -0
- package/build/lib/native/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js.map +1 -0
- package/build/lib/native/components/Button/BaseButton/BaseButton.js +1 -1
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/Button/Button.js +1 -1
- package/build/lib/native/components/Button/Button/Button.js.map +1 -1
- package/build/lib/native/components/Link/BaseLink/BaseLink.js +1 -1
- package/build/lib/native/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/native/components/Link/Link/Link.js +1 -1
- package/build/lib/native/components/Link/Link/Link.js.map +1 -1
- package/build/lib/native/components/Menu/Menu.native.js +17 -0
- package/build/lib/native/components/Menu/Menu.native.js.map +1 -0
- package/build/lib/native/components/Menu/MenuItem.native.js +17 -0
- package/build/lib/native/components/Menu/MenuItem.native.js.map +1 -0
- package/build/lib/native/components/Menu/MenuOverlay.native.js +17 -0
- package/build/lib/native/components/Menu/MenuOverlay.native.js.map +1 -0
- package/build/lib/native/components/Menu/VisualSubComponents/MenuDivider.native.js +17 -0
- package/build/lib/native/components/Menu/VisualSubComponents/MenuDivider.native.js.map +1 -0
- package/build/lib/native/components/Menu/VisualSubComponents/MenuHeaderFooter.native.js +17 -0
- package/build/lib/native/components/Menu/VisualSubComponents/MenuHeaderFooter.native.js.map +1 -0
- package/build/lib/native/components/SideNav/tokens.js +12 -0
- package/build/lib/native/components/SideNav/tokens.js.map +1 -0
- package/build/lib/native/components/TopNav/TabNav/TabNav.native.js +17 -0
- package/build/lib/native/components/TopNav/TabNav/TabNav.native.js.map +1 -0
- package/build/lib/native/components/TopNav/TabNav/TabNavItem.native.js +17 -0
- package/build/lib/native/components/TopNav/TabNav/TabNavItem.native.js.map +1 -0
- package/build/lib/native/components/TopNav/TopNav.native.js +17 -0
- package/build/lib/native/components/TopNav/TopNav.native.js.map +1 -0
- package/build/lib/native/components/index.js +9 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/tokens/global/size.js +1 -1
- package/build/lib/native/tokens/global/size.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListItem.js +43 -118
- package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/development/components/Avatar/Avatar.web.js +29 -6
- package/build/lib/web/development/components/Avatar/Avatar.web.js.map +1 -1
- package/build/lib/web/development/components/Avatar/AvatarButton.js +25 -3
- package/build/lib/web/development/components/Avatar/AvatarButton.js.map +1 -1
- package/build/lib/web/development/components/BaseHeaderFooter/BaseFooter.js +2 -1
- package/build/lib/web/development/components/BaseHeaderFooter/BaseFooter.js.map +1 -1
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +4 -0
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/development/components/BaseMenu/BaseMenuContext.js +10 -0
- package/build/lib/web/development/components/BaseMenu/BaseMenuContext.js.map +1 -0
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +124 -0
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -0
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js +41 -0
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js.map +1 -0
- package/build/lib/web/development/components/{ActionList/styles/getBaseActionListItemStyles.js → BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js} +10 -9
- package/build/lib/web/development/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js.map +1 -0
- package/build/lib/web/development/components/BaseMenu/index.js +3 -0
- package/build/lib/web/development/components/BaseMenu/index.js.map +1 -0
- package/build/lib/web/development/components/BaseMenu/tokens.js +8 -0
- package/build/lib/web/development/components/BaseMenu/tokens.js.map +1 -0
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +16 -7
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/Button/Button.js +8 -2
- package/build/lib/web/development/components/Button/Button/Button.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/QuickSelection/QuickSelectionItem.web.js +6 -27
- package/build/lib/web/development/components/DatePicker/QuickSelection/QuickSelectionItem.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +3 -2
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +5 -1
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/web/development/components/Link/Link/Link.js +6 -2
- package/build/lib/web/development/components/Link/Link/Link.js.map +1 -1
- package/build/lib/web/development/components/Menu/Menu.web.js +99 -0
- package/build/lib/web/development/components/Menu/Menu.web.js.map +1 -0
- package/build/lib/web/development/components/Menu/MenuItem.web.js +63 -0
- package/build/lib/web/development/components/Menu/MenuItem.web.js.map +1 -0
- package/build/lib/web/development/components/Menu/MenuOverlay.web.js +59 -0
- package/build/lib/web/development/components/Menu/MenuOverlay.web.js.map +1 -0
- package/build/lib/web/development/components/Menu/VisualSubComponents/MenuDivider.web.js +18 -0
- package/build/lib/web/development/components/Menu/VisualSubComponents/MenuDivider.web.js.map +1 -0
- package/build/lib/web/development/components/Menu/VisualSubComponents/MenuHeaderFooter.web.js +65 -0
- package/build/lib/web/development/components/Menu/VisualSubComponents/MenuHeaderFooter.web.js.map +1 -0
- package/build/lib/web/development/components/Menu/index.js +6 -0
- package/build/lib/web/development/components/Menu/index.js.map +1 -0
- package/build/lib/web/development/components/Menu/tokens.js +26 -0
- package/build/lib/web/development/components/Menu/tokens.js.map +1 -0
- package/build/lib/web/development/components/Menu/useMenu.js +178 -0
- package/build/lib/web/development/components/Menu/useMenu.js.map +1 -0
- package/build/lib/web/development/components/SideNav/SideNav.web.js +5 -2
- package/build/lib/web/development/components/SideNav/SideNav.web.js.map +1 -1
- package/build/lib/web/development/components/SideNav/index.js +1 -0
- package/build/lib/web/development/components/SideNav/index.js.map +1 -1
- package/build/lib/web/development/components/SideNav/tokens.js +3 -2
- package/build/lib/web/development/components/SideNav/tokens.js.map +1 -1
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js +1 -3
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/development/components/TopNav/TabNav/TabNav.web.js +172 -0
- package/build/lib/web/development/components/TopNav/TabNav/TabNav.web.js.map +1 -0
- package/build/lib/web/development/components/TopNav/TabNav/TabNavContext.js +18 -0
- package/build/lib/web/development/components/TopNav/TabNav/TabNavContext.js.map +1 -0
- package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js +198 -0
- package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js.map +1 -0
- package/build/lib/web/development/components/TopNav/TabNav/index.js +4 -0
- package/build/lib/web/development/components/TopNav/TabNav/index.js.map +1 -0
- package/build/lib/web/development/components/TopNav/TabNav/types.js +2 -0
- package/build/lib/web/development/components/TopNav/TabNav/types.js.map +1 -0
- package/build/lib/web/development/components/TopNav/TabNav/utils.js +48 -0
- package/build/lib/web/development/components/TopNav/TabNav/utils.js.map +1 -0
- package/build/lib/web/development/components/TopNav/TopNav.web.js +158 -0
- package/build/lib/web/development/components/TopNav/TopNav.web.js.map +1 -0
- package/build/lib/web/development/components/TopNav/TopNavContext.js +13 -0
- package/build/lib/web/development/components/TopNav/TopNavContext.js.map +1 -0
- package/build/lib/web/development/components/TopNav/index.js +3 -0
- package/build/lib/web/development/components/TopNav/index.js.map +1 -0
- package/build/lib/web/development/components/index.js +11 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/tokens/global/size.js +4 -0
- package/build/lib/web/development/tokens/global/size.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +9 -0
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListItem.js +43 -118
- package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/production/components/Avatar/Avatar.web.js +29 -6
- package/build/lib/web/production/components/Avatar/Avatar.web.js.map +1 -1
- package/build/lib/web/production/components/Avatar/AvatarButton.js +25 -3
- package/build/lib/web/production/components/Avatar/AvatarButton.js.map +1 -1
- package/build/lib/web/production/components/BaseHeaderFooter/BaseFooter.js +2 -1
- package/build/lib/web/production/components/BaseHeaderFooter/BaseFooter.js.map +1 -1
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +4 -0
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/production/components/BaseMenu/BaseMenuContext.js +10 -0
- package/build/lib/web/production/components/BaseMenu/BaseMenuContext.js.map +1 -0
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +124 -0
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -0
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js +41 -0
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/StyledMenuItemContainer.web.js.map +1 -0
- package/build/lib/web/production/components/{ActionList/styles/getBaseActionListItemStyles.js → BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js} +10 -9
- package/build/lib/web/production/components/BaseMenu/BaseMenuItem/getBaseMenuItemStyles.js.map +1 -0
- package/build/lib/web/production/components/BaseMenu/index.js +3 -0
- package/build/lib/web/production/components/BaseMenu/index.js.map +1 -0
- package/build/lib/web/production/components/BaseMenu/tokens.js +8 -0
- package/build/lib/web/production/components/BaseMenu/tokens.js.map +1 -0
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +16 -7
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/Button/Button.js +8 -2
- package/build/lib/web/production/components/Button/Button/Button.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/QuickSelection/QuickSelectionItem.web.js +6 -27
- package/build/lib/web/production/components/DatePicker/QuickSelection/QuickSelectionItem.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +3 -2
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +5 -1
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/web/production/components/Link/Link/Link.js +6 -2
- package/build/lib/web/production/components/Link/Link/Link.js.map +1 -1
- package/build/lib/web/production/components/Menu/Menu.web.js +99 -0
- package/build/lib/web/production/components/Menu/Menu.web.js.map +1 -0
- package/build/lib/web/production/components/Menu/MenuItem.web.js +63 -0
- package/build/lib/web/production/components/Menu/MenuItem.web.js.map +1 -0
- package/build/lib/web/production/components/Menu/MenuOverlay.web.js +59 -0
- package/build/lib/web/production/components/Menu/MenuOverlay.web.js.map +1 -0
- package/build/lib/web/production/components/Menu/VisualSubComponents/MenuDivider.web.js +18 -0
- package/build/lib/web/production/components/Menu/VisualSubComponents/MenuDivider.web.js.map +1 -0
- package/build/lib/web/production/components/Menu/VisualSubComponents/MenuHeaderFooter.web.js +65 -0
- package/build/lib/web/production/components/Menu/VisualSubComponents/MenuHeaderFooter.web.js.map +1 -0
- package/build/lib/web/production/components/Menu/index.js +6 -0
- package/build/lib/web/production/components/Menu/index.js.map +1 -0
- package/build/lib/web/production/components/Menu/tokens.js +26 -0
- package/build/lib/web/production/components/Menu/tokens.js.map +1 -0
- package/build/lib/web/production/components/Menu/useMenu.js +178 -0
- package/build/lib/web/production/components/Menu/useMenu.js.map +1 -0
- package/build/lib/web/production/components/SideNav/SideNav.web.js +5 -2
- package/build/lib/web/production/components/SideNav/SideNav.web.js.map +1 -1
- package/build/lib/web/production/components/SideNav/index.js +1 -0
- package/build/lib/web/production/components/SideNav/index.js.map +1 -1
- package/build/lib/web/production/components/SideNav/tokens.js +3 -2
- package/build/lib/web/production/components/SideNav/tokens.js.map +1 -1
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js +1 -3
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/production/components/TopNav/TabNav/TabNav.web.js +172 -0
- package/build/lib/web/production/components/TopNav/TabNav/TabNav.web.js.map +1 -0
- package/build/lib/web/production/components/TopNav/TabNav/TabNavContext.js +18 -0
- package/build/lib/web/production/components/TopNav/TabNav/TabNavContext.js.map +1 -0
- package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js +198 -0
- package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js.map +1 -0
- package/build/lib/web/production/components/TopNav/TabNav/index.js +4 -0
- package/build/lib/web/production/components/TopNav/TabNav/index.js.map +1 -0
- package/build/lib/web/production/components/TopNav/TabNav/types.js +2 -0
- package/build/lib/web/production/components/TopNav/TabNav/types.js.map +1 -0
- package/build/lib/web/production/components/TopNav/TabNav/utils.js +48 -0
- package/build/lib/web/production/components/TopNav/TabNav/utils.js.map +1 -0
- package/build/lib/web/production/components/TopNav/TopNav.web.js +158 -0
- package/build/lib/web/production/components/TopNav/TopNav.web.js.map +1 -0
- package/build/lib/web/production/components/TopNav/TopNavContext.js +13 -0
- package/build/lib/web/production/components/TopNav/TopNavContext.js.map +1 -0
- package/build/lib/web/production/components/TopNav/index.js +3 -0
- package/build/lib/web/production/components/TopNav/index.js.map +1 -0
- package/build/lib/web/production/components/index.js +11 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/tokens/global/size.js +4 -0
- package/build/lib/web/production/tokens/global/size.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +9 -0
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/types/components/index.d.ts +883 -3
- package/build/types/components/index.native.d.ts +253 -2
- package/build/types/tokens/index.d.ts +4 -0
- package/build/types/tokens/index.native.d.ts +4 -0
- package/package.json +1 -1
- package/build/lib/native/components/ActionList/styles/StyledActionListItem.native.js +0 -8
- package/build/lib/native/components/ActionList/styles/StyledActionListItem.native.js.map +0 -1
- package/build/lib/native/components/ActionList/styles/getBaseActionListItemStyles.js +0 -11
- package/build/lib/native/components/ActionList/styles/getBaseActionListItemStyles.js.map +0 -1
- package/build/lib/web/development/components/ActionList/styles/StyledActionListItem.web.js +0 -33
- package/build/lib/web/development/components/ActionList/styles/StyledActionListItem.web.js.map +0 -1
- package/build/lib/web/development/components/ActionList/styles/getBaseActionListItemStyles.js.map +0 -1
- package/build/lib/web/production/components/ActionList/styles/StyledActionListItem.web.js +0 -33
- package/build/lib/web/production/components/ActionList/styles/StyledActionListItem.web.js.map +0 -1
- package/build/lib/web/production/components/ActionList/styles/getBaseActionListItemStyles.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../../../../src/components/Button/Button/Button.tsx"],"sourcesContent":["import type { GestureResponderEvent } from 'react-native';\nimport React from 'react';\nimport BaseButton from '../BaseButton';\nimport type { BaseButtonProps } from '../BaseButton/BaseButton';\nimport type { IconComponent } from '~components/Icons';\nimport type { Platform } from '~utils';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { BladeElementRef, StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeCommonEvents } from '~components/types';\n\ntype ButtonCommonProps = {\n /**\n * Automatically renders button with `a` tag with `href` on web\n */\n href?: BaseButtonProps['href'];\n /**\n * anchor target attribute\n *\n * Should only be used alongside `href`\n */\n target?: BaseButtonProps['target'];\n /**\n * anchor rel attribute\n *\n * Should only be used alongside `href`\n */\n rel?: BaseButtonProps['rel'];\n variant?: 'primary' | 'secondary' | 'tertiary';\n color?: 'primary' | 'white' | 'positive' | 'negative';\n size?: 'xsmall' | 'small' | 'medium' | 'large';\n iconPosition?: 'left' | 'right';\n isDisabled?: boolean;\n isFullWidth?: boolean;\n isLoading?: boolean;\n accessibilityLabel?: string;\n type?: 'button' | 'reset' | 'submit';\n\n /**\n * It is exposed for internal usage with tooltip.\n *\n * @private\n */\n 'aria-describedby'?: string;\n onClick?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }>;\n} & TestID &\n StyledPropsBlade &\n BladeCommonEvents;\n\n/*\n Mandatory children prop when icon is not provided\n */\ntype ButtonWithoutIconProps = ButtonCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n */\ntype ButtonWithIconProps = ButtonCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\nexport type ButtonProps = ButtonWithoutIconProps | ButtonWithIconProps;\n\nconst _Button: React.ForwardRefRenderFunction<BladeElementRef, ButtonProps> = (\n // While adding any prop here, make sure to handle it in DropdownButton as well\n {\n children,\n icon,\n iconPosition = 'left',\n isDisabled = false,\n isFullWidth = false,\n isLoading = false,\n href,\n target,\n rel,\n onClick,\n size = 'medium',\n type = 'button',\n variant = 'primary',\n color = 'primary',\n accessibilityLabel,\n testID,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n ...rest\n },\n ref,\n) => {\n return (\n <BaseButton\n {...(icon ? { icon, children } : { children })}\n {...getStyledProps(rest)}\n ref={ref}\n href={href}\n target={target}\n rel={rel}\n accessibilityProps={{\n label: accessibilityLabel,\n describedBy: rest['aria-describedby'],\n }}\n iconPosition={iconPosition}\n color={color}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n onClick={onClick}\n size={size}\n type={type}\n variant={variant}\n isLoading={isLoading}\n testID={testID}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n />\n );\n};\n\nconst Button = assignWithoutSideEffects(React.forwardRef(_Button), {\n displayName: 'Button',\n componentId: 'Button',\n});\n\nexport default Button;\n"],"names":["_Button","_ref","ref","children","icon","_ref$iconPosition","iconPosition","_ref$isDisabled","isDisabled","_ref$isFullWidth","isFullWidth","_ref$isLoading","isLoading","href","target","rel","onClick","_ref$size","size","_ref$type","type","_ref$variant","variant","_ref$color","color","accessibilityLabel","testID","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","rest","_objectWithoutProperties","_excluded","_jsx","BaseButton","_objectSpread","getStyledProps","accessibilityProps","label","describedBy","Button","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../../../../src/components/Button/Button/Button.tsx"],"sourcesContent":["import type { GestureResponderEvent } from 'react-native';\nimport React from 'react';\nimport BaseButton from '../BaseButton';\nimport type { BaseButtonProps } from '../BaseButton/BaseButton';\nimport type { IconComponent } from '~components/Icons';\nimport type { Platform } from '~utils';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { BladeElementRef, StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { AriaRoles } from '~utils/makeAccessible';\n\ntype ButtonCommonProps = {\n /**\n * Automatically renders button with `a` tag with `href` on web\n */\n href?: BaseButtonProps['href'];\n /**\n * anchor target attribute\n *\n * Should only be used alongside `href`\n */\n target?: BaseButtonProps['target'];\n /**\n * anchor rel attribute\n *\n * Should only be used alongside `href`\n */\n rel?: BaseButtonProps['rel'];\n variant?: 'primary' | 'secondary' | 'tertiary';\n color?: 'primary' | 'white' | 'positive' | 'negative';\n size?: 'xsmall' | 'small' | 'medium' | 'large';\n iconPosition?: 'left' | 'right';\n isDisabled?: boolean;\n isFullWidth?: boolean;\n isLoading?: boolean;\n accessibilityLabel?: string;\n type?: 'button' | 'reset' | 'submit';\n\n /**\n * It is exposed for internal usage with tooltip.\n *\n * @private\n */\n 'aria-describedby'?: string;\n /**\n * It is exposed for internal usage with menu.\n *\n * @private\n */\n 'aria-controls'?: string;\n /**\n * It is exposed for internal usage with menu.\n *\n * @private\n */\n 'aria-expanded'?: boolean;\n /**\n * It is exposed for internal usage with menu.\n *\n * @private\n */\n 'aria-haspopup'?: 'menu';\n /**\n * It is exposed for internal usage with menu.\n *\n * @private\n */\n role?: AriaRoles;\n tabIndex?: BaseButtonProps['tabIndex'];\n onClick?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }>;\n} & TestID &\n StyledPropsBlade &\n BladeCommonEvents;\n\n/*\n Mandatory children prop when icon is not provided\n */\ntype ButtonWithoutIconProps = ButtonCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n */\ntype ButtonWithIconProps = ButtonCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\nexport type ButtonProps = ButtonWithoutIconProps | ButtonWithIconProps;\n\nconst _Button: React.ForwardRefRenderFunction<BladeElementRef, ButtonProps> = (\n // While adding any prop here, make sure to handle it in DropdownButton as well\n {\n children,\n icon,\n iconPosition = 'left',\n isDisabled = false,\n isFullWidth = false,\n isLoading = false,\n href,\n target,\n rel,\n onClick,\n size = 'medium',\n type = 'button',\n variant = 'primary',\n color = 'primary',\n accessibilityLabel,\n role,\n testID,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onMouseDown,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n ...rest\n },\n ref,\n) => {\n return (\n <BaseButton\n {...(icon ? { icon, children } : { children })}\n {...getStyledProps(rest)}\n ref={ref}\n href={href}\n target={target}\n rel={rel}\n accessibilityProps={{\n label: accessibilityLabel,\n describedBy: rest['aria-describedby'],\n expanded: rest['aria-expanded'],\n hasPopup: rest['aria-haspopup'],\n role,\n }}\n iconPosition={iconPosition}\n color={color}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n onClick={onClick}\n size={size}\n type={type}\n variant={variant}\n isLoading={isLoading}\n testID={testID}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onMouseDown={onMouseDown}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n />\n );\n};\n\nconst Button = assignWithoutSideEffects(React.forwardRef(_Button), {\n displayName: 'Button',\n componentId: 'Button',\n});\n\nexport default Button;\n"],"names":["_Button","_ref","ref","children","icon","_ref$iconPosition","iconPosition","_ref$isDisabled","isDisabled","_ref$isFullWidth","isFullWidth","_ref$isLoading","isLoading","href","target","rel","onClick","_ref$size","size","_ref$type","type","_ref$variant","variant","_ref$color","color","accessibilityLabel","role","testID","onBlur","onFocus","onMouseLeave","onMouseMove","onMouseDown","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","rest","_objectWithoutProperties","_excluded","_jsx","BaseButton","_objectSpread","getStyledProps","accessibilityProps","label","describedBy","expanded","hasPopup","Button","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAiGA,IAAMA,OAAqE,GAAG,SAAxEA,OAAqEA;AACzEC,IAAA,EA8BAC,GAAG,EACA;AAAA,EAAA,IA7BDC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IAAAC,iBAAA,GAAAJ,IAAA,CACJK,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,iBAAA;IAAAE,eAAA,GAAAN,IAAA,CACrBO,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;IAAAE,gBAAA,GAAAR,IAAA,CAClBS,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,gBAAA;IAAAE,cAAA,GAAAV,IAAA,CACnBW,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,cAAA;IACjBE,IAAI,GAAAZ,IAAA,CAAJY,IAAI;IACJC,MAAM,GAAAb,IAAA,CAANa,MAAM;IACNC,GAAG,GAAAd,IAAA,CAAHc,GAAG;IACHC,OAAO,GAAAf,IAAA,CAAPe,OAAO;IAAAC,SAAA,GAAAhB,IAAA,CACPiB,IAAI;AAAJA,IA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AO,CAAC,EAAE;AACjEqD,EAAAA,WAAW,EAAE,QAAQ;AACrBC,EAAAA,WAAW,EAAE,QAAA;AACf,CAAC;;;;"}
|
package/build/lib/web/development/components/DatePicker/QuickSelection/QuickSelectionItem.web.js
CHANGED
|
@@ -1,42 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StyledActionListItem } from '../../ActionList/styles/StyledActionListItem.web.js';
|
|
3
|
-
import '../../Typography/index.js';
|
|
1
|
+
import '../../BaseMenu/index.js';
|
|
4
2
|
import '../../../utils/index.js';
|
|
5
|
-
import '../../../utils/makeAccessible/index.js';
|
|
6
|
-
import { useIsMobile } from '../../../utils/useIsMobile.js';
|
|
7
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { BaseMenuItem } from '../../BaseMenu/BaseMenuItem/BaseMenuItem.js';
|
|
8
5
|
import { isReactNative } from '../../../utils/platform/isReactNative.js';
|
|
9
|
-
import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.web.js';
|
|
10
|
-
import { Text } from '../../Typography/Text/Text.js';
|
|
11
6
|
|
|
12
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
7
|
var QuickSelectionItem = function QuickSelectionItem(_ref) {
|
|
15
8
|
var children = _ref.children,
|
|
16
9
|
onClick = _ref.onClick,
|
|
17
10
|
isSelected = _ref.isSelected;
|
|
18
|
-
|
|
19
|
-
return /*#__PURE__*/jsx(StyledActionListItem, _objectSpread(_objectSpread({
|
|
11
|
+
return /*#__PURE__*/jsx(BaseMenuItem, {
|
|
20
12
|
as: !isReactNative() ? 'button' : undefined,
|
|
21
13
|
selectionType: "single",
|
|
22
|
-
hasDescription: true,
|
|
23
|
-
isMobile: isMobile,
|
|
24
|
-
isKeydownPressed: false,
|
|
25
14
|
isSelected: isSelected,
|
|
26
15
|
onClick: onClick,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
current: true,
|
|
31
|
-
role: 'option'
|
|
32
|
-
})), {}, {
|
|
33
|
-
children: /*#__PURE__*/jsx(Text, {
|
|
34
|
-
size: "small",
|
|
35
|
-
weight: "medium",
|
|
36
|
-
color: "interactive.text.gray.normal",
|
|
37
|
-
children: children
|
|
38
|
-
})
|
|
39
|
-
}));
|
|
16
|
+
title: children,
|
|
17
|
+
role: "option"
|
|
18
|
+
});
|
|
40
19
|
};
|
|
41
20
|
|
|
42
21
|
export { QuickSelectionItem };
|
package/build/lib/web/development/components/DatePicker/QuickSelection/QuickSelectionItem.web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickSelectionItem.web.js","sources":["../../../../../../../src/components/DatePicker/QuickSelection/QuickSelectionItem.web.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"QuickSelectionItem.web.js","sources":["../../../../../../../src/components/DatePicker/QuickSelection/QuickSelectionItem.web.tsx"],"sourcesContent":["import { BaseMenuItem } from '~components/BaseMenu';\nimport { isReactNative } from '~utils';\n\ntype QuickSelectionItemProps = {\n children: string;\n isSelected: boolean;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n};\nconst QuickSelectionItem = ({\n children,\n onClick,\n isSelected,\n}: QuickSelectionItemProps): React.ReactElement => {\n return (\n <BaseMenuItem\n as={!isReactNative() ? 'button' : undefined}\n selectionType=\"single\"\n isSelected={isSelected}\n onClick={onClick}\n title={children}\n role=\"option\"\n />\n );\n};\n\nexport { QuickSelectionItem };\n"],"names":["QuickSelectionItem","_ref","children","onClick","isSelected","_jsx","BaseMenuItem","as","isReactNative","undefined","selectionType","title","role"],"mappings":";;;;;;AAQA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAI2B;AAAA,EAAA,IAHjDC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,UAAU,GAAAH,IAAA,CAAVG,UAAU,CAAA;EAEV,oBACEC,GAAA,CAACC,YAAY,EAAA;IACXC,EAAE,EAAE,CAACC,aAAa,EAAE,GAAG,QAAQ,GAAGC,SAAU;AAC5CC,IAAAA,aAAa,EAAC,QAAQ;AACtBN,IAAAA,UAAU,EAAEA,UAAW;AACvBD,IAAAA,OAAO,EAAEA,OAAQ;AACjBQ,IAAAA,KAAK,EAAET,QAAS;AAChBU,IAAAA,IAAI,EAAC,QAAA;AAAQ,GACd,CAAC,CAAA;AAEN;;;;"}
|
|
@@ -12,6 +12,7 @@ import '../../utils/assignWithoutSideEffects/index.js';
|
|
|
12
12
|
import { useBottomSheetAndDropdownGlue } from '../BottomSheet/BottomSheetContext.js';
|
|
13
13
|
import '../Box/BaseBox/index.js';
|
|
14
14
|
import { componentZIndices } from '../../utils/componentZIndices.js';
|
|
15
|
+
import { OVERLAY_OFFSET, OVERLAY_TRANSITION_OFFSET } from '../BaseMenu/tokens.js';
|
|
15
16
|
import { jsx } from 'react/jsx-runtime';
|
|
16
17
|
import { size } from '../../tokens/global/size.js';
|
|
17
18
|
import useTheme from '../BladeProvider/useTheme.js';
|
|
@@ -23,7 +24,6 @@ import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/a
|
|
|
23
24
|
|
|
24
25
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
26
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
|
-
var OVERLAY_OFFSET = size['8'];
|
|
27
27
|
var OVERLAY_PADDING = size['12']; // doesn't have to be exact. Just rough padding for floating ui to decide to show overlay on top or bottom
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -65,6 +65,7 @@ var _DropdownOverlay = function _DropdownOverlay(_ref) {
|
|
|
65
65
|
middleware: [offset({
|
|
66
66
|
mainAxis: OVERLAY_OFFSET
|
|
67
67
|
}), flip({
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
68
69
|
padding: OVERLAY_OFFSET + OVERLAY_PADDING
|
|
69
70
|
}), size$1({
|
|
70
71
|
apply: function apply(_ref3) {
|
|
@@ -91,7 +92,7 @@ var _DropdownOverlay = function _DropdownOverlay(_ref) {
|
|
|
91
92
|
duration: theme.motion.duration.quick,
|
|
92
93
|
initial: function initial() {
|
|
93
94
|
return {
|
|
94
|
-
transform: "translateY(-".concat(makeSize(
|
|
95
|
+
transform: "translateY(-".concat(makeSize(OVERLAY_TRANSITION_OFFSET), ")"),
|
|
95
96
|
opacity: 0
|
|
96
97
|
};
|
|
97
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownOverlay.web.js","sources":["../../../../../../src/components/Dropdown/DropdownOverlay.web.tsx"],"sourcesContent":["import React from 'react';\nimport {\n autoUpdate,\n offset,\n size as sizeMiddleware,\n useFloating,\n useTransitionStyles,\n flip,\n FloatingPortal,\n useDismiss,\n useInteractions,\n} from '@floating-ui/react';\nimport { useDropdown } from './useDropdown';\nimport { StyledDropdownOverlay } from './StyledDropdownOverlay';\nimport type { DropdownOverlayProps } from './types';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport { useTheme } from '~components/BladeProvider';\n// Reading directly because its not possible to get theme object on top level to be used in keyframes\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useBottomSheetAndDropdownGlue } from '~components/BottomSheet/BottomSheetContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { componentZIndices } from '~utils/componentZIndices';\n\nconst OVERLAY_OFFSET: number = size['8'];\nconst OVERLAY_PADDING: number = size['12']; // doesn't have to be exact. Just rough padding for floating ui to decide to show overlay on top or bottom\n\n/**\n * Overlay of dropdown\n *\n * Wrap your ActionList within this component\n */\nconst _DropdownOverlay = ({\n children,\n testID,\n zIndex = componentZIndices.dropdownOverlay,\n width,\n referenceRef,\n defaultPlacement = 'bottom-start',\n}: DropdownOverlayProps): React.ReactElement | null => {\n const { isOpen, triggererRef, triggererWrapperRef, dropdownTriggerer, setIsOpen } = useDropdown();\n const { theme } = useTheme();\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n\n const isMenu =\n dropdownTriggerer !== dropdownComponentIds.triggers.SelectInput &&\n dropdownTriggerer !== dropdownComponentIds.triggers.SearchInput &&\n dropdownTriggerer !== dropdownComponentIds.triggers.AutoComplete &&\n referenceRef == undefined;\n\n const { refs, floatingStyles, context } = useFloating({\n open: isOpen,\n onOpenChange: setIsOpen,\n strategy: 'fixed',\n placement: defaultPlacement,\n elements: {\n // Input triggers have their ref on internal input element but we want width height of overall visible input hence wrapperRef is needed\n // We fallback to use `triggererRef` for triggers like button and link where wrapper is not needed\n // Checkout: https://github.com/razorpay/blade/pull/1559#discussion_r1305438920\n reference: (referenceRef?.current ??\n triggererWrapperRef.current ??\n triggererRef.current) as Element,\n },\n middleware: [\n offset({\n mainAxis: OVERLAY_OFFSET,\n }),\n flip({\n padding: OVERLAY_OFFSET + OVERLAY_PADDING,\n }),\n sizeMiddleware({\n apply({ rects, elements }) {\n Object.assign(elements.floating.style, {\n // in menu, we have flexible width between min and max\n // in input triggers, we just take width of trigger\n width: isMenu ? undefined : makeSize(rects.reference.width),\n minWidth: isMenu ? makeSize(size['240']) : undefined,\n maxWidth: isMenu ? makeSize(size['400']) : undefined,\n });\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n });\n\n const dismiss = useDismiss(context);\n const { getFloatingProps } = useInteractions([dismiss]);\n\n const { isMounted, styles } = useTransitionStyles(context, {\n duration: theme.motion.duration.quick,\n initial: () => ({\n transform: `translateY(-${makeSize(size['8'])})`,\n opacity: 0,\n }),\n });\n\n React.useEffect(() => {\n if (isOpen) {\n // On Safari clicking on a non input element doesn't focuses it https://bugs.webkit.org/show_bug.cgi?id=22261\n triggererRef.current?.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen]);\n\n return (\n <FloatingPortal>\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={refs.setFloating as any}\n style={floatingStyles}\n zIndex={zIndex}\n display={isMounted ? 'flex' : 'none'}\n {...getFloatingProps()}\n >\n <StyledDropdownOverlay\n isInBottomSheet={bottomSheetAndDropdownGlue?.dropdownHasBottomSheet}\n elevation={bottomSheetAndDropdownGlue?.dropdownHasBottomSheet ? undefined : 'midRaised'}\n style={{ ...styles }}\n width={width ? width : '100%'}\n {...metaAttribute({ name: MetaConstants.DropdownOverlay, testID })}\n >\n {children}\n </StyledDropdownOverlay>\n </BaseBox>\n </FloatingPortal>\n );\n};\n\nconst DropdownOverlay = assignWithoutSideEffects(_DropdownOverlay, {\n componentId: dropdownComponentIds.DropdownOverlay,\n});\n\nexport { DropdownOverlay };\n"],"names":["OVERLAY_OFFSET","size","OVERLAY_PADDING","_DropdownOverlay","_ref","_ref2","_referenceRef$current","children","testID","_ref$zIndex","zIndex","componentZIndices","dropdownOverlay","width","referenceRef","_ref$defaultPlacement","defaultPlacement","_useDropdown","useDropdown","isOpen","triggererRef","triggererWrapperRef","dropdownTriggerer","setIsOpen","_useTheme","useTheme","theme","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","isMenu","dropdownComponentIds","triggers","SelectInput","SearchInput","AutoComplete","undefined","_useFloating","useFloating","open","onOpenChange","strategy","placement","elements","reference","current","middleware","offset","mainAxis","flip","padding","sizeMiddleware","apply","_ref3","rects","Object","assign","floating","style","makeSize","minWidth","maxWidth","whileElementsMounted","autoUpdate","refs","floatingStyles","context","dismiss","useDismiss","_useInteractions","useInteractions","getFloatingProps","_useTransitionStyles","useTransitionStyles","duration","motion","quick","initial","transform","concat","opacity","isMounted","styles","React","useEffect","_triggererRef$current","focus","_jsx","FloatingPortal","BaseBox","_objectSpread","ref","setFloating","display","StyledDropdownOverlay","isInBottomSheet","dropdownHasBottomSheet","elevation","metaAttribute","name","MetaConstants","DropdownOverlay","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAMA,cAAsB,GAAGC,IAAI,CAAC,GAAG,CAAC,CAAA;AACxC,IAAMC,eAAuB,GAAGD,IAAI,CAAC,IAAI,CAAC,CAAC;;AAE3C;AACA;AACA;AACA;AACA;AACA,IAAME,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAOiC;EAAA,IAAAC,KAAA,EAAAC,qBAAA,CAAA;AAAA,EAAA,IANrDC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IAAAC,WAAA,GAAAL,IAAA,CACNM,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAA,KAAA,CAAA,GAAGE,iBAAiB,CAACC,eAAe,GAAAH,WAAA;IAC1CI,KAAK,GAAAT,IAAA,CAALS,KAAK;IACLC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tB+E,GAAA,CAACO,qBAAqB,EAAAJ,aAAA,CAAAA,aAAA,CAAA;AACpBK,QAAAA,eAAe,EAAEnE,0BAA0B,KAAA,IAAA,IAA1BA,0BAA0B,KAA1BA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,0BAA0B,CAAEoE,sBAAuB;QACpEC,SAAS,EAAErE,0BAA0B,KAAA,IAAA,IAA1BA,0BAA0B,KAAA,KAAA,CAAA,IAA1BA,0BAA0B,CAAEoE,sBAAsB,GAAG5D,SAAS,GAAG,WAAY;AACxFsB,QAAAA,KAAK,EAAAgC,aAAA,CAAOR,EAAAA,EAAAA,MAAM,CAAG;AACrBpE,QAAAA,KAAK,EAAEA,KAAK,GAAGA,KAAK,GAAG,MAAA;AAAO,OAAA,EAC1BoF,aAAa,CAAC;QAAEC,IAAI,EAAEC,aAAa,CAACC,eAAe;AAAE5F,QAAAA,MAAM,EAANA,MAAAA;AAAO,OAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAD,QAAAA,QAAA,EAEjEA,QAAAA;OACoB,CAAA,CAAA;KAChB,CAAA,CAAA;AAAC,GACI,CAAC,CAAA;AAErB,CAAC,CAAA;AAED,IAAM6F,eAAe,gBAAGC,wBAAwB,CAAClG,gBAAgB,EAAE;EACjEmG,WAAW,EAAExE,oBAAoB,CAACsE,eAAAA;AACpC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"DropdownOverlay.web.js","sources":["../../../../../../src/components/Dropdown/DropdownOverlay.web.tsx"],"sourcesContent":["import React from 'react';\nimport {\n autoUpdate,\n offset,\n size as sizeMiddleware,\n useFloating,\n useTransitionStyles,\n flip,\n FloatingPortal,\n useDismiss,\n useInteractions,\n} from '@floating-ui/react';\nimport { useDropdown } from './useDropdown';\nimport { StyledDropdownOverlay } from './StyledDropdownOverlay';\nimport type { DropdownOverlayProps } from './types';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport { useTheme } from '~components/BladeProvider';\n// Reading directly because its not possible to get theme object on top level to be used in keyframes\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useBottomSheetAndDropdownGlue } from '~components/BottomSheet/BottomSheetContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { OVERLAY_OFFSET, OVERLAY_TRANSITION_OFFSET } from '~components/BaseMenu/tokens';\n\nconst OVERLAY_PADDING: number = size['12']; // doesn't have to be exact. Just rough padding for floating ui to decide to show overlay on top or bottom\n\n/**\n * Overlay of dropdown\n *\n * Wrap your ActionList within this component\n */\nconst _DropdownOverlay = ({\n children,\n testID,\n zIndex = componentZIndices.dropdownOverlay,\n width,\n referenceRef,\n defaultPlacement = 'bottom-start',\n}: DropdownOverlayProps): React.ReactElement | null => {\n const { isOpen, triggererRef, triggererWrapperRef, dropdownTriggerer, setIsOpen } = useDropdown();\n const { theme } = useTheme();\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n\n const isMenu =\n dropdownTriggerer !== dropdownComponentIds.triggers.SelectInput &&\n dropdownTriggerer !== dropdownComponentIds.triggers.SearchInput &&\n dropdownTriggerer !== dropdownComponentIds.triggers.AutoComplete &&\n referenceRef == undefined;\n\n const { refs, floatingStyles, context } = useFloating({\n open: isOpen,\n onOpenChange: setIsOpen,\n strategy: 'fixed',\n placement: defaultPlacement,\n elements: {\n // Input triggers have their ref on internal input element but we want width height of overall visible input hence wrapperRef is needed\n // We fallback to use `triggererRef` for triggers like button and link where wrapper is not needed\n // Checkout: https://github.com/razorpay/blade/pull/1559#discussion_r1305438920\n reference: (referenceRef?.current ??\n triggererWrapperRef.current ??\n triggererRef.current) as Element,\n },\n middleware: [\n offset({\n mainAxis: OVERLAY_OFFSET,\n }),\n flip({\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n padding: OVERLAY_OFFSET + OVERLAY_PADDING,\n }),\n sizeMiddleware({\n apply({ rects, elements }) {\n Object.assign(elements.floating.style, {\n // in menu, we have flexible width between min and max\n // in input triggers, we just take width of trigger\n width: isMenu ? undefined : makeSize(rects.reference.width),\n minWidth: isMenu ? makeSize(size['240']) : undefined,\n maxWidth: isMenu ? makeSize(size['400']) : undefined,\n });\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n });\n\n const dismiss = useDismiss(context);\n const { getFloatingProps } = useInteractions([dismiss]);\n\n const { isMounted, styles } = useTransitionStyles(context, {\n duration: theme.motion.duration.quick,\n initial: () => ({\n transform: `translateY(-${makeSize(OVERLAY_TRANSITION_OFFSET)})`,\n opacity: 0,\n }),\n });\n\n React.useEffect(() => {\n if (isOpen) {\n // On Safari clicking on a non input element doesn't focuses it https://bugs.webkit.org/show_bug.cgi?id=22261\n triggererRef.current?.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen]);\n\n return (\n <FloatingPortal>\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={refs.setFloating as any}\n style={floatingStyles}\n zIndex={zIndex}\n display={isMounted ? 'flex' : 'none'}\n {...getFloatingProps()}\n >\n <StyledDropdownOverlay\n isInBottomSheet={bottomSheetAndDropdownGlue?.dropdownHasBottomSheet}\n elevation={bottomSheetAndDropdownGlue?.dropdownHasBottomSheet ? undefined : 'midRaised'}\n style={{ ...styles }}\n width={width ? width : '100%'}\n {...metaAttribute({ name: MetaConstants.DropdownOverlay, testID })}\n >\n {children}\n </StyledDropdownOverlay>\n </BaseBox>\n </FloatingPortal>\n );\n};\n\nconst DropdownOverlay = assignWithoutSideEffects(_DropdownOverlay, {\n componentId: dropdownComponentIds.DropdownOverlay,\n});\n\nexport { DropdownOverlay };\n"],"names":["OVERLAY_PADDING","size","_DropdownOverlay","_ref","_ref2","_referenceRef$current","children","testID","_ref$zIndex","zIndex","componentZIndices","dropdownOverlay","width","referenceRef","_ref$defaultPlacement","defaultPlacement","_useDropdown","useDropdown","isOpen","triggererRef","triggererWrapperRef","dropdownTriggerer","setIsOpen","_useTheme","useTheme","theme","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","isMenu","dropdownComponentIds","triggers","SelectInput","SearchInput","AutoComplete","undefined","_useFloating","useFloating","open","onOpenChange","strategy","placement","elements","reference","current","middleware","offset","mainAxis","OVERLAY_OFFSET","flip","padding","sizeMiddleware","apply","_ref3","rects","Object","assign","floating","style","makeSize","minWidth","maxWidth","whileElementsMounted","autoUpdate","refs","floatingStyles","context","dismiss","useDismiss","_useInteractions","useInteractions","getFloatingProps","_useTransitionStyles","useTransitionStyles","duration","motion","quick","initial","transform","concat","OVERLAY_TRANSITION_OFFSET","opacity","isMounted","styles","React","useEffect","_triggererRef$current","focus","_jsx","FloatingPortal","BaseBox","_objectSpread","ref","setFloating","display","StyledDropdownOverlay","isInBottomSheet","dropdownHasBottomSheet","elevation","metaAttribute","name","MetaConstants","DropdownOverlay","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAMA,eAAuB,GAAGC,IAAI,CAAC,IAAI,CAAC,CAAC;;AAE3C;AACA;AACA;AACA;AACA;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAOiC;EAAA,IAAAC,KAAA,EAAAC,qBAAA,CAAA;AAAA,EAAA,IANrDC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IAAAC,WAAA,GAAAL,IAAA,CACNM,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAA,KAAA,CAAA,GAAGE,iBAAiB,CAACC,eAAe,GAAAH,WAAA;IAC1CI,KAAK,GAAAT,IAAA,CAALS,KAAK;IACLC,YAAY,GAAAV,IAAA,CAAZU,YAAY;IAAAC,qBAAA,GAAAX,IAAA,CACZY,gBAAgB;AAAhBA,IAAAA,gBAAgB,GAAAD,qBAAA,KAAG,KAA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CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,0BAA0B,CAAEsE,sBAAuB;QACpEC,SAAS,EAAEvE,0BAA0B,KAAA,IAAA,IAA1BA,0BAA0B,KAAA,KAAA,CAAA,IAA1BA,0BAA0B,CAAEsE,sBAAsB,GAAG9D,SAAS,GAAG,WAAY;AACxFuB,QAAAA,KAAK,EAAAiC,aAAA,CAAOR,EAAAA,EAAAA,MAAM,CAAG;AACrBtE,QAAAA,KAAK,EAAEA,KAAK,GAAGA,KAAK,GAAG,MAAA;AAAO,OAAA,EAC1BsF,aAAa,CAAC;QAAEC,IAAI,EAAEC,aAAa,CAACC,eAAe;AAAE9F,QAAAA,MAAM,EAANA,MAAAA;AAAO,OAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAD,QAAAA,QAAA,EAEjEA,QAAAA;OACoB,CAAA,CAAA;KAChB,CAAA,CAAA;AAAC,GACI,CAAC,CAAA;AAErB,CAAC,CAAA;AAED,IAAM+F,eAAe,gBAAGC,wBAAwB,CAACpG,gBAAgB,EAAE;EACjEqG,WAAW,EAAE1E,oBAAoB,CAACwE,eAAAA;AACpC,CAAC;;;;"}
|
|
@@ -27,7 +27,7 @@ import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
|
27
27
|
import { BaseText } from '../../Typography/BaseText/BaseText.web.js';
|
|
28
28
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
29
29
|
|
|
30
|
-
var _excluded = ["children", "icon", "iconPosition", "isDisabled", "onClick", "onKeyDown", "variant", "href", "target", "rel", "color", "opacity", "accessibilityProps", "className", "style", "size", "testID", "hitSlop", "htmlTitle", "onBlur", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "onTouchStart", "onTouchEnd"],
|
|
30
|
+
var _excluded = ["children", "icon", "iconPosition", "isDisabled", "onClick", "onKeyDown", "variant", "href", "target", "rel", "color", "opacity", "accessibilityProps", "className", "style", "size", "testID", "hitSlop", "htmlTitle", "onBlur", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "onTouchStart", "onTouchEnd", "onMouseDown", "onMouseUp"],
|
|
31
31
|
_excluded2 = ["currentInteraction", "setCurrentInteraction"];
|
|
32
32
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
33
33
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -144,6 +144,8 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
144
144
|
onPointerEnter = _ref3.onPointerEnter,
|
|
145
145
|
onTouchStart = _ref3.onTouchStart,
|
|
146
146
|
onTouchEnd = _ref3.onTouchEnd,
|
|
147
|
+
onMouseDown = _ref3.onMouseDown,
|
|
148
|
+
onMouseUp = _ref3.onMouseUp,
|
|
147
149
|
styledProps = _objectWithoutProperties(_ref3, _excluded);
|
|
148
150
|
var childrenString = getStringFromReactText(children);
|
|
149
151
|
var _useInteraction = useInteraction(),
|
|
@@ -229,6 +231,8 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
229
231
|
onTouchStart: onTouchStart,
|
|
230
232
|
onTouchEnd: onTouchEnd,
|
|
231
233
|
onKeyDown: onKeyDown,
|
|
234
|
+
onMouseDown: onMouseDown,
|
|
235
|
+
onMouseUp: onMouseUp,
|
|
232
236
|
disabled: disabled,
|
|
233
237
|
type: type,
|
|
234
238
|
cursor: cursor,
|
|
@@ -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 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","hover","focus","disabled","concat","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","throwBladeError","message","moduleName","_getProps","handleOnClick","event","asProp","isReactNative","_jsx","StyledBaseLink","_objectSpread","metaAttribute","name","MetaConstants","Link","makeAccessible","getStyledProps","title","_jsxs","BaseBox","display","flexDirection","alignItems","paddingRight","BaseText","textAlign","fontWeight","paddingLeft","BaseLink","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyJA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EA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A,QAAS;AACnBK,QAAAA,UAAU,EAAEA,UAAW;AACvBsF,QAAAA,SAAS,EAAC,QAAQ;AAClBC,QAAAA,UAAU,EAAC,QAAQ;AAAAjG,QAAAA,QAAA,EAElBA,QAAAA;OACO,CAAC,EACVgC,IAAI,IAAIG,YAAY,IAAI,OAAO,gBAC9B4C,GAAA,CAACW,OAAO,EAAA;AAAC9E,QAAAA,EAAE,EAAEiE,MAAO;AAACqB,QAAAA,WAAW,EAAElF,WAAY;AAAC2E,QAAAA,OAAO,EAAC,MAAM;AAACE,QAAAA,UAAU,EAAC,QAAQ;QAAA7F,QAAA,eAC/E+E,GAAA,CAAC/C,IAAI,EAAA;AAAC7C,UAAAA,KAAK,EAAE2B,SAAU;AAACZ,UAAAA,IAAI,EAAEa,QAAAA;SAAW,CAAA;OAClC,CAAC,GACR,IAAI,CAAA;KACD,CAAA;AAAC,GAAA,CACI,CAAC,CAAA;AAErB,CAAC,CAAA;AAEKoF,IAAAA,QAAQ,gBAAGC,wBAAwB,eAACC,cAAK,CAACC,UAAU,CAACzE,SAAS,CAAC,EAAE;AACrE0E,EAAAA,WAAW,EAAE,UAAU;AACvBC,EAAAA,WAAW,EAAE,UAAA;AACf,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 onMouseDown,\n onMouseUp,\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 onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\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","hover","focus","disabled","concat","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","onMouseDown","onMouseUp","styledProps","_objectWithoutProperties","_excluded","childrenString","getStringFromReactText","_useInteraction","useInteraction","setCurrentInteraction","syntheticEvents","_excluded2","_useTheme","useTheme","throwBladeError","message","moduleName","_getProps","handleOnClick","event","asProp","isReactNative","_jsx","StyledBaseLink","_objectSpread","metaAttribute","name","MetaConstants","Link","makeAccessible","getStyledProps","title","_jsxs","BaseBox","display","flexDirection","alignItems","paddingRight","BaseText","textAlign","fontWeight","paddingLeft","BaseLink","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyJA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAYY;AAAA,EAAA,IAX7BC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,kBAAkB,GAAAH,IAAA,CAAlBG,kBAAkB;IAClBC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IACVC,OAAO,GAAAL,IAAA,CAAPK,OAAO,CAAA;EAQP,IAAIC,KAAK,GAAGH,kBAAkB,CAAA;AAC9B,EAAA,IAAMI,GAAG,GAAG;AACV,IAAA,SAAA,EAAS,QAAQ;AACjBC,IAAAA,KAAK,EAAE,QAAQ;AACfC,IAAAA,KAAK,EAAE,QAAQ;AACfC,IAAAA,Q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mE,MAAO;AAACqB,QAAAA,WAAW,EAAEpF,WAAY;AAAC6E,QAAAA,OAAO,EAAC,MAAM;AAACE,QAAAA,UAAU,EAAC,QAAQ;QAAA/F,QAAA,eAC/EiF,GAAA,CAACjD,IAAI,EAAA;AAAC7C,UAAAA,KAAK,EAAE2B,SAAU;AAACZ,UAAAA,IAAI,EAAEa,QAAAA;SAAW,CAAA;OAClC,CAAC,GACR,IAAI,CAAA;KACD,CAAA;AAAC,GAAA,CACI,CAAC,CAAA;AAErB,CAAC,CAAA;AAEKsF,IAAAA,QAAQ,gBAAGC,wBAAwB,eAACC,cAAK,CAACC,UAAU,CAAC3E,SAAS,CAAC,EAAE;AACrE4E,EAAAA,WAAW,EAAE,UAAU;AACvBC,EAAAA,WAAW,EAAE,UAAA;AACf,CAAC;;;;"}
|
|
@@ -9,7 +9,7 @@ import BaseLink from '../BaseLink/BaseLink.js';
|
|
|
9
9
|
import { getStyledProps } from '../../Box/styledProps/getStyledProps.js';
|
|
10
10
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
11
11
|
|
|
12
|
-
var _excluded = ["children", "icon", "iconPosition", "isDisabled", "onClick", "variant", "color", "href", "target", "rel", "accessibilityLabel", "size", "testID", "hitSlop", "htmlTitle", "onBlur", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "onTouchStart", "onTouchEnd"];
|
|
12
|
+
var _excluded = ["children", "icon", "iconPosition", "isDisabled", "onClick", "variant", "color", "href", "target", "rel", "accessibilityLabel", "size", "testID", "hitSlop", "htmlTitle", "onBlur", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "onTouchStart", "onTouchEnd", "onMouseDown", "onMouseUp"];
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
var _Link = function _Link(_ref, ref) {
|
|
@@ -41,6 +41,8 @@ var _Link = function _Link(_ref, ref) {
|
|
|
41
41
|
onPointerEnter = _ref.onPointerEnter,
|
|
42
42
|
onTouchStart = _ref.onTouchStart,
|
|
43
43
|
onTouchEnd = _ref.onTouchEnd,
|
|
44
|
+
onMouseDown = _ref.onMouseDown,
|
|
45
|
+
onMouseUp = _ref.onMouseUp,
|
|
44
46
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
45
47
|
return /*#__PURE__*/jsx(BaseLink, _objectSpread(_objectSpread(_objectSpread({}, icon ? {
|
|
46
48
|
icon: icon,
|
|
@@ -75,7 +77,9 @@ var _Link = function _Link(_ref, ref) {
|
|
|
75
77
|
onPointerDown: onPointerDown,
|
|
76
78
|
onPointerEnter: onPointerEnter,
|
|
77
79
|
onTouchStart: onTouchStart,
|
|
78
|
-
onTouchEnd: onTouchEnd
|
|
80
|
+
onTouchEnd: onTouchEnd,
|
|
81
|
+
onMouseDown: onMouseDown,
|
|
82
|
+
onMouseUp: onMouseUp
|
|
79
83
|
}, getStyledProps(rest)));
|
|
80
84
|
};
|
|
81
85
|
var Link = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_Link), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sources":["../../../../../../../src/components/Link/Link/Link.tsx"],"sourcesContent":["import type { ReactElement, SyntheticEvent } from 'react';\nimport React from 'react';\nimport type { BaseLinkProps } from '../BaseLink';\nimport { BaseLink } from '../BaseLink';\nimport type { IconComponent } from '~components/Icons';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StringChildrenType, TestID, BladeElementRef } from '~utils/types';\nimport type { Platform } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeCommonEvents } from '~components/types';\n\ntype LinkCommonProps = {\n variant?: 'anchor' | 'button';\n icon?: IconComponent;\n color?: 'primary' | 'white' | 'neutral';\n iconPosition?: 'left' | 'right';\n isDisabled?: boolean;\n onClick?: (event: SyntheticEvent) => void;\n href?: string;\n target?: string;\n accessibilityLabel?: string;\n\n /**\n * It is exposed for internal usage with tooltip.\n *\n * @private\n */\n 'aria-describedby'?: string;\n\n /**\n * Sets the size of the link\n *\n * @default medium\n */\n size?: BaseLinkProps['size'];\n} & TestID &\n StyledPropsBlade &\n BladeCommonEvents &\n Platform.Select<{\n native: {\n /**\n * Defines how far your touch can start away from the link\n */\n hitSlop?:\n | {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n }\n | number;\n /**\n * This is a web only prop and has no effect on react-native.\n */\n htmlTitle?: undefined;\n };\n web: {\n /**\n * This is a react-native only prop and has no effect on web.\n */\n hitSlop?: undefined;\n /**\n * The title of the link which is displayed as a tooltip.\n */\n htmlTitle?: string;\n };\n }>;\n\n/*\n Mandatory children prop when icon is not provided\n*/\ntype LinkWithoutIconProps = LinkCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n*/\ntype LinkWithIconProps = LinkCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\n/*\n Link Props with or without an icon\n*/\ntype LinkPropsWithOrWithoutIcon = LinkWithIconProps | LinkWithoutIconProps;\n\n/*\n Link Props when variant is anchor\n*/\ntype LinkAnchorVariantProps = LinkPropsWithOrWithoutIcon & {\n variant?: 'anchor';\n href?: string;\n target?: string;\n rel?: string;\n isDisabled?: undefined;\n};\n\n/*\n Link Props when variant is button\n*/\nexport type LinkButtonVariantProps = LinkPropsWithOrWithoutIcon & {\n variant?: 'button';\n isDisabled?: boolean;\n href?: undefined;\n target?: undefined;\n rel?: undefined;\n};\n\n/*\n Link Props when variant is anchor or button\n*/\nexport type LinkProps = LinkAnchorVariantProps | LinkButtonVariantProps;\n\nconst _Link: React.ForwardRefRenderFunction<BladeElementRef, LinkProps> = (\n {\n children,\n icon,\n iconPosition = 'left',\n isDisabled = false,\n onClick,\n variant = 'anchor',\n color = 'primary',\n href,\n target,\n rel,\n accessibilityLabel,\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 ...rest\n },\n ref,\n): ReactElement => {\n return (\n <BaseLink\n {...(icon ? { icon, children } : { children })}\n {...(variant === 'anchor' ? { variant, href, target, rel } : { variant, isDisabled })}\n ref={ref as never}\n iconPosition={iconPosition}\n onClick={onClick}\n accessibilityProps={{ label: accessibilityLabel, describedBy: rest['aria-describedby'] }}\n size={size}\n color={color}\n testID={testID}\n hitSlop={hitSlop}\n htmlTitle={htmlTitle}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n {...getStyledProps(rest)}\n />\n );\n};\n\nconst Link = assignWithoutSideEffects(React.forwardRef(_Link), {\n displayName: 'Link',\n componentId: 'Link',\n});\n\nexport default Link;\n"],"names":["_Link","_ref","ref","children","icon","_ref$iconPosition","iconPosition","_ref$isDisabled","isDisabled","onClick","_ref$variant","variant","_ref$color","color","href","target","rel","accessibilityLabel","_ref$size","size","testID","hitSlop","htmlTitle","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","rest","_objectWithoutProperties","_excluded","_jsx","BaseLink","_objectSpread","accessibilityProps","label","describedBy","getStyledProps","Link","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAqHA,IAAMA,KAAiE,GAAG,SAApEA,KAAiEA,CAAAC,IAAA,
|
|
1
|
+
{"version":3,"file":"Link.js","sources":["../../../../../../../src/components/Link/Link/Link.tsx"],"sourcesContent":["import type { ReactElement, SyntheticEvent } from 'react';\nimport React from 'react';\nimport type { BaseLinkProps } from '../BaseLink';\nimport { BaseLink } from '../BaseLink';\nimport type { IconComponent } from '~components/Icons';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StringChildrenType, TestID, BladeElementRef } from '~utils/types';\nimport type { Platform } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeCommonEvents } from '~components/types';\n\ntype LinkCommonProps = {\n variant?: 'anchor' | 'button';\n icon?: IconComponent;\n color?: 'primary' | 'white' | 'neutral';\n iconPosition?: 'left' | 'right';\n isDisabled?: boolean;\n onClick?: (event: SyntheticEvent) => void;\n href?: string;\n target?: string;\n accessibilityLabel?: string;\n\n /**\n * It is exposed for internal usage with tooltip.\n *\n * @private\n */\n 'aria-describedby'?: string;\n\n /**\n * Sets the size of the link\n *\n * @default medium\n */\n size?: BaseLinkProps['size'];\n} & TestID &\n StyledPropsBlade &\n BladeCommonEvents &\n Platform.Select<{\n native: {\n /**\n * Defines how far your touch can start away from the link\n */\n hitSlop?:\n | {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n }\n | number;\n /**\n * This is a web only prop and has no effect on react-native.\n */\n htmlTitle?: undefined;\n };\n web: {\n /**\n * This is a react-native only prop and has no effect on web.\n */\n hitSlop?: undefined;\n /**\n * The title of the link which is displayed as a tooltip.\n */\n htmlTitle?: string;\n };\n }>;\n\n/*\n Mandatory children prop when icon is not provided\n*/\ntype LinkWithoutIconProps = LinkCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n*/\ntype LinkWithIconProps = LinkCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\n/*\n Link Props with or without an icon\n*/\ntype LinkPropsWithOrWithoutIcon = LinkWithIconProps | LinkWithoutIconProps;\n\n/*\n Link Props when variant is anchor\n*/\ntype LinkAnchorVariantProps = LinkPropsWithOrWithoutIcon & {\n variant?: 'anchor';\n href?: string;\n target?: string;\n rel?: string;\n isDisabled?: undefined;\n};\n\n/*\n Link Props when variant is button\n*/\nexport type LinkButtonVariantProps = LinkPropsWithOrWithoutIcon & {\n variant?: 'button';\n isDisabled?: boolean;\n href?: undefined;\n target?: undefined;\n rel?: undefined;\n};\n\n/*\n Link Props when variant is anchor or button\n*/\nexport type LinkProps = LinkAnchorVariantProps | LinkButtonVariantProps;\n\nconst _Link: React.ForwardRefRenderFunction<BladeElementRef, LinkProps> = (\n {\n children,\n icon,\n iconPosition = 'left',\n isDisabled = false,\n onClick,\n variant = 'anchor',\n color = 'primary',\n href,\n target,\n rel,\n accessibilityLabel,\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 onMouseDown,\n onMouseUp,\n ...rest\n },\n ref,\n): ReactElement => {\n return (\n <BaseLink\n {...(icon ? { icon, children } : { children })}\n {...(variant === 'anchor' ? { variant, href, target, rel } : { variant, isDisabled })}\n ref={ref as never}\n iconPosition={iconPosition}\n onClick={onClick}\n accessibilityProps={{ label: accessibilityLabel, describedBy: rest['aria-describedby'] }}\n size={size}\n color={color}\n testID={testID}\n hitSlop={hitSlop}\n htmlTitle={htmlTitle}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onMouseDown={onMouseDown}\n onMouseUp={onMouseUp}\n {...getStyledProps(rest)}\n />\n );\n};\n\nconst Link = assignWithoutSideEffects(React.forwardRef(_Link), {\n displayName: 'Link',\n componentId: 'Link',\n});\n\nexport default Link;\n"],"names":["_Link","_ref","ref","children","icon","_ref$iconPosition","iconPosition","_ref$isDisabled","isDisabled","onClick","_ref$variant","variant","_ref$color","color","href","target","rel","accessibilityLabel","_ref$size","size","testID","hitSlop","htmlTitle","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","onMouseDown","onMouseUp","rest","_objectWithoutProperties","_excluded","_jsx","BaseLink","_objectSpread","accessibilityProps","label","describedBy","getStyledProps","Link","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAqHA,IAAMA,KAAiE,GAAG,SAApEA,KAAiEA,CAAAC,IAAA,EA6BrEC,GAAG,EACc;AAAA,EAAA,IA5BfC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IAAAC,iBAAA,GAAAJ,IAAA,CACJK,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,iBAAA;IAAAE,eAAA,GAAAN,IAAA,CACrBO,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;IAClBE,OAAO,GAAAR,IAAA,CAAPQ,OAAO;IAAAC,YAAA,GAAAT,IAAA,CACPU,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,YAAA;IAAAE,UAAA,GAAAX,IAAA,CAClBY,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,SAAS,GAAAA,UAAA;IACjBE,IAA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|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import { useMergeRefs, FloatingNode, FloatingList, FloatingPortal, FloatingFocusManager, useFloatingParentNodeId, FloatingTree } from '@floating-ui/react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { useMenu, useFloatingMenuSetup, MenuContext } from './useMenu.js';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
var MenuTree = function MenuTree(_ref) {
|
|
11
|
+
var children = _ref.children,
|
|
12
|
+
_ref$openInteraction = _ref.openInteraction,
|
|
13
|
+
openInteraction = _ref$openInteraction === void 0 ? 'click' : _ref$openInteraction,
|
|
14
|
+
onOpenChange = _ref.onOpenChange,
|
|
15
|
+
isOpenControlled = _ref.isOpen;
|
|
16
|
+
var _React$useState = React.useState(false),
|
|
17
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
18
|
+
hasFocusInside = _React$useState2[0],
|
|
19
|
+
setHasFocusInside = _React$useState2[1];
|
|
20
|
+
var elementsRef = React.useRef([]);
|
|
21
|
+
var labelsRef = React.useRef([]);
|
|
22
|
+
var parent = useMenu();
|
|
23
|
+
var _useFloatingMenuSetup = useFloatingMenuSetup({
|
|
24
|
+
elementsRef: elementsRef,
|
|
25
|
+
openInteraction: openInteraction,
|
|
26
|
+
onOpenChange: onOpenChange,
|
|
27
|
+
isOpen: isOpenControlled
|
|
28
|
+
}),
|
|
29
|
+
getReferenceProps = _useFloatingMenuSetup.getReferenceProps,
|
|
30
|
+
getFloatingProps = _useFloatingMenuSetup.getFloatingProps,
|
|
31
|
+
getItemProps = _useFloatingMenuSetup.getItemProps,
|
|
32
|
+
item = _useFloatingMenuSetup.item,
|
|
33
|
+
refs = _useFloatingMenuSetup.refs,
|
|
34
|
+
floatingStyles = _useFloatingMenuSetup.floatingStyles,
|
|
35
|
+
isOpen = _useFloatingMenuSetup.isOpen,
|
|
36
|
+
nodeId = _useFloatingMenuSetup.nodeId,
|
|
37
|
+
isNested = _useFloatingMenuSetup.isNested,
|
|
38
|
+
context = _useFloatingMenuSetup.context,
|
|
39
|
+
isMounted = _useFloatingMenuSetup.isMounted,
|
|
40
|
+
floatingTransitionStyles = _useFloatingMenuSetup.floatingTransitionStyles;
|
|
41
|
+
var referenceProps = _objectSpread({
|
|
42
|
+
ref: useMergeRefs([refs.setReference, item.ref])
|
|
43
|
+
}, getReferenceProps(parent.getItemProps({
|
|
44
|
+
onFocus: function onFocus() {
|
|
45
|
+
setHasFocusInside(false);
|
|
46
|
+
parent.setHasFocusInside(true);
|
|
47
|
+
}
|
|
48
|
+
})));
|
|
49
|
+
var floatingProps = _objectSpread({
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
|
+
ref: refs.setFloating,
|
|
52
|
+
style: floatingStyles,
|
|
53
|
+
_transitionStyle: floatingTransitionStyles
|
|
54
|
+
}, getFloatingProps());
|
|
55
|
+
var _ref2 = React.Children.toArray(children),
|
|
56
|
+
_ref3 = _slicedToArray(_ref2, 2),
|
|
57
|
+
menuTriggerChild = _ref3[0],
|
|
58
|
+
menuOverlayChild = _ref3[1];
|
|
59
|
+
var triggerWithReferenceProps = /*#__PURE__*/React.cloneElement(menuTriggerChild, _objectSpread(_objectSpread(_objectSpread({}, menuTriggerChild.props), referenceProps), {}, {
|
|
60
|
+
_hasFocusInside: hasFocusInside,
|
|
61
|
+
_isMenuTrigger: true
|
|
62
|
+
}));
|
|
63
|
+
var overlayWithFloatingProps = /*#__PURE__*/React.cloneElement(menuOverlayChild, _objectSpread(_objectSpread({}, menuOverlayChild.props), floatingProps));
|
|
64
|
+
return /*#__PURE__*/jsx(FloatingNode, {
|
|
65
|
+
id: nodeId,
|
|
66
|
+
children: /*#__PURE__*/jsxs(MenuContext.Provider, {
|
|
67
|
+
value: {
|
|
68
|
+
getItemProps: getItemProps,
|
|
69
|
+
setHasFocusInside: setHasFocusInside,
|
|
70
|
+
isOpen: isOpen
|
|
71
|
+
},
|
|
72
|
+
children: [triggerWithReferenceProps, /*#__PURE__*/jsx(FloatingList, {
|
|
73
|
+
elementsRef: elementsRef,
|
|
74
|
+
labelsRef: labelsRef,
|
|
75
|
+
children: isMounted && /*#__PURE__*/jsx(FloatingPortal, {
|
|
76
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
77
|
+
context: context,
|
|
78
|
+
modal: false,
|
|
79
|
+
initialFocus: -1,
|
|
80
|
+
returnFocus: !isNested,
|
|
81
|
+
children: overlayWithFloatingProps
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
})]
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
var Menu = function Menu(props) {
|
|
89
|
+
var parentId = useFloatingParentNodeId();
|
|
90
|
+
if (parentId === null) {
|
|
91
|
+
return /*#__PURE__*/jsx(FloatingTree, {
|
|
92
|
+
children: /*#__PURE__*/jsx(MenuTree, _objectSpread({}, props))
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return /*#__PURE__*/jsx(MenuTree, _objectSpread({}, props));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export { Menu };
|
|
99
|
+
//# sourceMappingURL=Menu.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.web.js","sources":["../../../../../../src/components/Menu/Menu.web.tsx"],"sourcesContent":["import {\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n FloatingTree,\n useFloatingParentNodeId,\n useMergeRefs,\n} from '@floating-ui/react';\nimport * as React from 'react';\nimport { MenuContext, useFloatingMenuSetup, useMenu } from './useMenu';\nimport type { MenuProps } from './types';\n\nconst MenuTree = ({\n children,\n openInteraction = 'click',\n onOpenChange,\n isOpen: isOpenControlled,\n}: MenuProps): React.ReactElement => {\n const [hasFocusInside, setHasFocusInside] = React.useState(false);\n\n const elementsRef = React.useRef<(HTMLButtonElement | null)[]>([]);\n const labelsRef = React.useRef<(string | null)[]>([]);\n const parent = useMenu();\n\n const {\n getReferenceProps,\n getFloatingProps,\n getItemProps,\n item,\n refs,\n floatingStyles,\n isOpen,\n nodeId,\n isNested,\n context,\n isMounted,\n floatingTransitionStyles,\n } = useFloatingMenuSetup({\n elementsRef,\n openInteraction,\n onOpenChange,\n isOpen: isOpenControlled,\n });\n\n const referenceProps = {\n ref: useMergeRefs([refs.setReference, item.ref]),\n ...getReferenceProps(\n parent.getItemProps({\n onFocus() {\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n }),\n ),\n };\n\n const floatingProps = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: refs.setFloating as any,\n style: floatingStyles,\n _transitionStyle: floatingTransitionStyles,\n ...getFloatingProps(),\n };\n\n const [menuTriggerChild, menuOverlayChild] = React.Children.toArray(children) as [\n React.ReactElement,\n React.ReactElement,\n ];\n\n const triggerWithReferenceProps = React.cloneElement(menuTriggerChild, {\n ...menuTriggerChild.props,\n ...referenceProps,\n _hasFocusInside: hasFocusInside,\n _isMenuTrigger: true,\n });\n\n const overlayWithFloatingProps = React.cloneElement(menuOverlayChild, {\n ...menuOverlayChild.props,\n ...floatingProps,\n });\n\n return (\n <FloatingNode id={nodeId}>\n <MenuContext.Provider\n value={{\n getItemProps,\n setHasFocusInside,\n isOpen,\n }}\n >\n {triggerWithReferenceProps}\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isMounted && (\n <FloatingPortal>\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n returnFocus={!isNested}\n >\n {overlayWithFloatingProps}\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n );\n};\n\nconst Menu = (props: MenuProps): React.ReactElement => {\n const parentId = useFloatingParentNodeId();\n\n if (parentId === null) {\n return (\n <FloatingTree>\n <MenuTree {...props} />\n </FloatingTree>\n );\n }\n\n return <MenuTree {...props} />;\n};\n\nexport { Menu };\n"],"names":["MenuTree","_ref","children","_ref$openInteraction","openInteraction","onOpenChange","isOpenControlled","isOpen","_React$useState","React","useState","_React$useState2","_slicedToArray","hasFocusInside","setHasFocusInside","elementsRef","useRef","labelsRef","parent","useMenu","_useFloatingMenuSetup","useFloatingMenuSetup","getReferenceProps","getFloatingProps","getItemProps","item","refs","floatingStyles","nodeId","isNested","context","isMounted","floatingTransitionStyles","referenceProps","_objectSpread","ref","useMergeRefs","setReference","onFocus","floatingProps","setFloating","style","_transitionStyle","_ref2","Children","toArray","_ref3","menuTriggerChild","menuOverlayChild","triggerWithReferenceProps","cloneElement","props","_hasFocusInside","_isMenuTrigger","overlayWithFloatingProps","_jsx","FloatingNode","id","_jsxs","MenuContext","Provider","value","FloatingList","FloatingPortal","FloatingFocusManager","modal","initialFocus","returnFocus","Menu","parentId","useFloatingParentNodeId","FloatingTree"],"mappings":";;;;;;;;;AAaA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAKuB;AAAA,EAAA,IAJnCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,oBAAA,GAAAF,IAAA,CACRG,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,oBAAA;IACzBE,Y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