Skip to content

Commit 23f700c

Browse files
committed
2.0.0
* Forwarding refs on checkbox, radio, and switch * Tweaking coverage report * Adding smoke tests for components * Adding more units tests * Adding exampe of using reakit Rover
1 parent 2e424ad commit 23f700c

File tree

18 files changed

+265
-100
lines changed

18 files changed

+265
-100
lines changed

BREAKING_API_CHANGES.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Dennis Thompson
3+
Copyright (c) 2020 Dennis Thompson
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,30 @@ class Demo extends React.Component {
121121
}
122122
```
123123

124+
## Grouping Controls
125+
126+
To make working with managed form solutions easier, PCR has a generic `Group` component for usage with checkboxes and switches. For radio inputs, however, there is a special `RadioGroup` component.
127+
128+
```jsx
129+
import * as React from 'react';
130+
import { Radio, useRadioState, RadioGroup } from 'pretty-checkbox-react';
131+
132+
function App() {
133+
const radio = useRadioState();
134+
135+
return (
136+
<RadioGroup {...radio}>
137+
<Radio value="yes" name="sub" {...radio}>
138+
Yes! I want emails
139+
</Radio>
140+
<Radio value="no" name="sub" {...radio}>
141+
No, I do not want emails
142+
</Radio>
143+
</RadioGroup>
144+
);
145+
}
146+
```
147+
124148
### Changelog
125149

126150
See the releases page.

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
collectCoverage: true,
44
coverageDirectory: 'coverage',
55
coverageReporters: ['text', 'html', 'text-summary', 'lcov'],
6-
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
6+
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/index.ts'],
77
modulePathIgnorePatterns: ['pkg/', 'resources/', 'playground/'],
88
testPathIgnorePatterns: ['<rootDir>/src/index.ts'],
99
globals: {

playground/package-lock.json

Lines changed: 55 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playground/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"webpack-dev-server": "^3.10.2"
3030
},
3131
"dependencies": {
32-
"pretty-checkbox": "^3.0.3"
32+
"pretty-checkbox": "^3.0.3",
33+
"reakit": "^1.0.0-beta.16"
3334
}
3435
}

0 commit comments

Comments
 (0)