• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IQSS / dataverse-frontend / 5533092765

12 Jul 2023 02:49PM UTC coverage: 98.649% (+0.4%) from 98.216%
5533092765

push

github

MellyGray
fix(cypress action): update to v5

99 of 103 branches covered (96.12%)

Branch coverage included in aggregate %.

266 of 267 relevant lines covered (99.63%)

201.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/packages/design-system/src/lib/components/button/Button.tsx
1
import { MouseEvent, ReactNode } from 'react'
798✔
2
import styles from './Button.module.scss'
3
import { Button as ButtonBS } from 'react-bootstrap'
4
import { Icon } from '../Icon.enum'
5

6
type ButtonVariant = 'primary' | 'secondary' | 'link'
7

8
interface ButtonProps {
9
  variant?: ButtonVariant
10
  disabled?: boolean
11
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void
12
  icon?: Icon
13
  withSpacing?: boolean
14
  children: ReactNode
15
}
16

17
export function Button({
114✔
18
  variant = 'primary',
168✔
19
  disabled = false,
198✔
20
  onClick,
21
  icon,
22
  withSpacing,
23
  children
24
}: ButtonProps) {
25
  const spacingClass = withSpacing ? styles.spacing : ''
228✔
26
  const borderClass = variant != 'link' ? styles.border : ''
228!
27

28
  return (
228✔
29
    <ButtonBS
30
      className={`${spacingClass} ${borderClass}`}
31
      variant={variant}
32
      onClick={disabled ? undefined : onClick}
228✔
33
      disabled={disabled}
34
      aria-disabled={disabled}>
35
      {icon && <span className={`${styles.icon} ${icon}`} role="img" aria-label={icon}></span>}
258✔
36
      {children}
37
    </ButtonBS>
38
  )
39
}
114✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc