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

atomicpages / pretty-checkbox-react / 10812249919

11 Sep 2024 01:04PM UTC coverage: 100.0%. Remained the same
10812249919

Pull #1165

github

web-flow
build(deps-dev): bump @commitlint/config-conventional

Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-conventional) from 17.0.2 to 19.5.0.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/commits/v19.5.0/@commitlint/config-conventional)

---
updated-dependencies:
- dependency-name: "@commitlint/config-conventional"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #1165: build(deps-dev): bump @commitlint/config-conventional from 17.0.2 to 19.5.0

67 of 67 branches covered (100.0%)

Branch coverage included in aggregate %.

172 of 172 relevant lines covered (100.0%)

9.99 hits per line

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

100.0
/src/components/checkbox/Checkbox.tsx
1
import * as React from 'react';
2✔
2
import clsx from 'clsx';
2✔
3
import mergeRefs from 'react-merge-refs';
2✔
4

5
import { useCheckboxState, UseCheckboxState } from './useCheckboxState';
2✔
6
import { useLocked } from '../../hooks/utility/useLocked';
2✔
7
import { useIcon } from '../../hooks/useIcon';
2✔
8
import { useClassNames } from '../../hooks/utility/useClassNames';
2✔
9
import { useControlled } from '../../hooks/utility/useControlled';
2✔
10

11
import { useCheckboxRadioProps } from '../../hooks/utility/useCheckboxRadioProps';
2✔
12
import { PCRCheckboxRadioProps } from '../../typings/PCRCheckboxRadioProps';
13
import { State } from '../state/State';
2✔
14
import { useIndeterminate } from './useIndeterminate';
2✔
15

16
export type CheckboxProps = PCRCheckboxRadioProps<UseCheckboxState['state']> & {
17
  /**
18
   * Mark the underlying HTML input checkbox as `indeterminate`. This prop doesn't change
19
   * icons for you, it just ensures we have the correct `aria-checked` value
20
   * and the checkbox has indeterminate status.
21
   */
22
  indeterminate?: boolean;
23
};
24

25
export const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
2✔
26
  (props, ref) => {
27
    const { checked, value, state, ...rest } = useControlled<
22✔
28
      UseCheckboxState['state'],
29
      CheckboxProps
30
    >(props);
31

32
    const {
33
      children,
34
      locked,
35
      color,
36
      id,
37
      className,
38
      style,
39
      indeterminate,
40
      icon: propsIcon,
41
      htmlProps,
42
    } = useCheckboxRadioProps<UseCheckboxState['state'], CheckboxProps>(rest);
22✔
43

44
    const { ref: intRef, ...aria } = useIndeterminate({
22✔
45
      state,
46
      checked,
47
      indeterminate,
48
    });
49

50
    const styles = useLocked({ locked, style });
22✔
51
    const { icon, iconType } = useIcon(propsIcon);
22✔
52

53
    return (
22✔
54
      <div
55
        style={styles}
56
        className={clsx(
57
          'pretty',
58
          useClassNames({
59
            ...props,
60
            iconType,
61
          }),
62
          className
63
        )}
64
      >
65
        <input
66
          ref={mergeRefs([ref, intRef])}
67
          value={value}
68
          type="checkbox"
69
          id={id}
70
          checked={checked}
71
          {...aria}
72
          {...htmlProps}
73
        />
74
        <State id={id} icon={icon} color={color}>
75
          {children}
76
        </State>
77
      </div>
78
    );
79
  }
80
);
81

82
Checkbox.displayName = 'Checkbox';
2✔
83

84
export { useCheckboxState, UseCheckboxState };
10✔
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