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

nilfalse / ctf / 5752977660

pending completion
5752977660

Pull #298

github

web-flow
Merge b6f7f6972 into da4e6f9f9
Pull Request #298: Update all of jest 27.5.1 → 29.6.2 (major)

0 of 266 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 613 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/packages/runtime/view/components/typography.tsx
1
import { AnchorHTMLAttributes, FC } from 'react';
2

3
import './typography.css';
4

5
interface FactoryParams {
6
  tag: 'p' | 'span' | 'a';
7
  className?: string;
8
}
9

10
interface TypographyProps {
11
  variant?: 'mono' | 'light' | 'handwriting';
12
  size?: 'l' | 's' | 'xs';
13
  className?: string | ReadonlyArray<string>;
14
}
15

16
const typographyFactory = ({
×
17
  tag,
18
  className: componentClassName,
19
}: FactoryParams): FC<TypographyProps> => {
20
  const Component = tag;
×
21

22
  return ({ variant, size, className, children, ...rest }) => {
×
23
    let classNames = ['typography'];
×
24
    if (variant) {
×
25
      classNames.push('typography_' + variant);
×
26
    }
27
    if (size) {
×
28
      classNames.push('typography_' + size);
×
29
    }
30
    if (componentClassName) {
×
31
      classNames.push(componentClassName);
×
32
    }
33
    if (className) {
×
34
      classNames = classNames.concat(className);
×
35
    }
36

37
    return (
×
38
      <Component {...rest} className={classNames.join(' ')}>
39
        {children}
40
      </Component>
41
    );
42
  };
43
};
44

45
export const Paragraph = typographyFactory({ tag: 'p' }) as FC<
×
46
  TypographyProps & AnchorHTMLAttributes<HTMLParagraphElement>
47
>;
48

49
export const Span = typographyFactory({ tag: 'span' }) as FC<
×
50
  TypographyProps & AnchorHTMLAttributes<HTMLParagraphElement>
51
>;
52

53
export const Link = typographyFactory({
×
54
  tag: 'a',
55
  className: 'link',
56
}) as FC<TypographyProps & AnchorHTMLAttributes<HTMLAnchorElement>>;
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