MCPcopy Create free account
hub / github.com/primer/react / isTokenInteractive

Function isTokenInteractive

packages/react/src/Token/TokenBase.tsx:54–65  ·  view source on GitHub ↗
({
  as = 'span',
  onClick,
  onFocus,
  tabIndex = -1,
  disabled,
}: Pick<ComponentProps<typeof TokenBase>, 'disabled' | 'as' | 'onClick' | 'onFocus' | 'tabIndex'>)

Source from the content-addressed store, hash-verified

52}
53
54export const isTokenInteractive = ({
55 as = 'span',
56 onClick,
57 onFocus,
58 tabIndex = -1,
59 disabled,
60}: Pick<ComponentProps<typeof TokenBase>, 'disabled' | 'as' | 'onClick' | 'onFocus' | 'tabIndex'>) => {
61 if (disabled) {
62 return false
63 }
64 return Boolean(onFocus || onClick || tabIndex > -1 || ['a', 'button'].includes(as))
65}
66
67const xlargeVariantStyles = {
68 fontSize: 1,

Callers 3

Token.tsxFile · 0.90
TokenBase.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected