Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
c716f4c
Create LICENSE
gfazioli Jan 8, 2019
e87e4cc
Merge pull request #3 from gfazioli/add-license-1
gfazioli Jan 8, 2019
cf198f1
chore(example): typo fix
Armanio Mar 3, 2019
f29192c
Merge pull request #6 from Armanio/patch-1
gfazioli Mar 3, 2019
9d0e75b
wip
gfazioli Mar 3, 2019
8e4b414
update props and docs
gfazioli Mar 4, 2019
2aaae79
docs
gfazioli Mar 5, 2019
73a8598
update typedef
gfazioli Mar 5, 2019
f3b854c
build docs
gfazioli Mar 5, 2019
57fa2f9
wip
gfazioli Mar 7, 2019
21a7159
update yarn lack
gfazioli Mar 7, 2019
ab010a7
update docs
gfazioli Mar 7, 2019
3b49a26
Merge branch 'typescript-and-hooks'
gfazioli Mar 7, 2019
c68076a
compile docs
gfazioli Mar 7, 2019
c72c368
fix docs
gfazioli Mar 7, 2019
5ed96e2
fix docs
gfazioli Mar 7, 2019
0b1e20f
fix background
gfazioli Mar 7, 2019
21f0642
wip
gfazioli Mar 7, 2019
f0521d5
fix theme
gfazioli Mar 8, 2019
9ac55f9
ops
gfazioli Mar 8, 2019
fc3b4ad
wip
gfazioli Mar 9, 2019
b3724dd
Update README.md
gfazioli Mar 9, 2019
27bbdf4
fix doc
gfazioli Mar 14, 2019
de476c6
minor fixes
gfazioli Mar 14, 2019
266eb50
Update README.md
gfazioli Mar 23, 2019
8c7b769
Update README.md
gfazioli Mar 23, 2019
848b48d
Update README.md
gfazioli Mar 23, 2019
c72cd9c
add code
gfazioli Mar 26, 2019
cffba80
fix package
gfazioli May 9, 2019
4397faa
update docz
gfazioli May 9, 2019
d3c974c
rollback docz
gfazioli May 9, 2019
c18f391
Create CODE_OF_CONDUCT.md
gfazioli May 27, 2019
7e88dda
Merge pull request #12 from gfazioli/add-code-of-conduct-1
gfazioli May 27, 2019
c210e60
Update issue templates
gfazioli May 27, 2019
ad91340
Added support for updateable checked prop
fxbi-dev Jul 20, 2019
e365b82
Changed defaultSelected for controlled
fxbi-dev Jul 20, 2019
b2c43b4
Resolved tslint conflict
fxbi-dev Jul 20, 2019
5e6b291
Merge pull request #15 from ErizO1/Feature_Value
gfazioli Aug 13, 2019
efa1fca
release
gfazioli Aug 13, 2019
9b287a1
fix security alert
gfazioli Aug 13, 2019
40ddb21
updates
gfazioli Nov 13, 2019
82cb0ca
wip
gfazioli Nov 13, 2019
6112517
updates
gfazioli Nov 13, 2019
0b2813c
updates
gfazioli Nov 13, 2019
2a5421b
updates
gfazioli Nov 13, 2019
c00f206
updates
gfazioli Nov 14, 2019
faf608a
fix: dist
gfazioli Nov 14, 2019
1e96a90
update: docs
gfazioli Nov 14, 2019
e70ad28
fix: package
gfazioli Nov 14, 2019
7b3e1bc
fix: docz pros
gfazioli Nov 15, 2019
1420e02
update: packages
gfazioli Nov 15, 2019
17675a3
Bump acorn from 5.7.3 to 5.7.4
dependabot[bot] Mar 14, 2020
ad3f942
Bump websocket-extensions from 0.1.3 to 0.1.4
dependabot[bot] Jun 6, 2020
c1576e3
Merge pull request #23 from gfazioli/dependabot/npm_and_yarn/websocke…
gfazioli Jun 24, 2020
1d2de67
Merge pull request #21 from gfazioli/dependabot/npm_and_yarn/acorn-5.7.4
gfazioli Jun 24, 2020
d72eb64
Bump lodash from 4.17.15 to 4.17.19
dependabot[bot] Jul 16, 2020
a9b0d18
Merge pull request #24 from gfazioli/dependabot/npm_and_yarn/lodash-4…
gfazioli Jul 17, 2020
c18d9ce
Bump http-proxy from 1.18.0 to 1.18.1
dependabot[bot] Sep 7, 2020
eb54136
Fix typos and grammar in README
bobziroll Oct 1, 2020
dd9ae74
Bump ini from 1.3.5 to 1.3.7
dependabot[bot] Dec 11, 2020
21fac10
Merge pull request #32 from gfazioli/dependabot/npm_and_yarn/ini-1.3.7
gfazioli Mar 3, 2021
57ace03
Merge pull request #31 from bobziroll/patch-1
gfazioli Mar 3, 2021
fd7ae3f
Bump elliptic from 6.5.1 to 6.5.4
dependabot[bot] Mar 9, 2021
c95473f
Merge pull request #30 from gfazioli/dependabot/npm_and_yarn/http-pro…
gfazioli Mar 24, 2021
f485167
Merge pull request #35 from gfazioli/dependabot/npm_and_yarn/elliptic…
gfazioli Mar 24, 2021
960dac6
💸 add buy me coffee
gfazioli Aug 2, 2024
5507c19
Update peer dependencies to React 17
gfazioli Nov 26, 2024
b03ecd9
Merge pull request #61 from gfazioli/update-peer-dependencies
gfazioli Nov 26, 2024
9644a61
Fix event target type in onToggle event
gfazioli Nov 26, 2024
ae909aa
Merge pull request #62 from gfazioli/fix-event-target-type
gfazioli Nov 26, 2024
bebea26
✨ feat(v4): rewrite library for React 18+ with CSS variable theming
gfazioli Apr 28, 2026
27c09ff
🐛 fix(toggle): allow --rt-* CSS variables to inherit from ancestors
gfazioli Apr 28, 2026
e289e77
✨ feat(docs): replace Ladle with custom landing site
gfazioli Apr 28, 2026
281b5c7
🔧 fix(ci): resolve react-toggle-component to source via tsconfig paths
gfazioli Apr 28, 2026
67cec8f
Merge pull request #65 from gfazioli/v4
gfazioli Apr 28, 2026
f03bbfd
🔧 chore(ci): drop master trigger after default branch rename
gfazioli Apr 28, 2026
06c3eca
✨ feat: hero readme, sponsor links, in-site Migrate section
gfazioli Apr 28, 2026
99d1e91
🔧 chore(ci): allow manual workflow_dispatch on release
gfazioli Apr 28, 2026
7345f34
✨ feat(docs): split landing and upgrade into Vite multi-page site
gfazioli Apr 28, 2026
276df5c
📝 Drop UPGRADE.md, point upgrade links to docs site
gfazioli Apr 28, 2026
78bd5ad
🙈 Ignore .claude/ runtime artifacts
gfazioli Apr 28, 2026
90e8509
🖼️ Use PNG for og:image (better social-card support)
gfazioli Apr 28, 2026
5464b23
🔗 Add 'Other Undolog components' cross-link section
gfazioli May 6, 2026
58045b0
feat(site): align background and syntax highlighter with react-tilt
gfazioli May 17, 2026
87ce3cc
Bump vite from 5.4.21 to 6.4.2
dependabot[bot] May 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets).

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: gfazioli
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
name: Typecheck, lint, test, build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Typecheck
run: pnpm typecheck

- name: Lint
run: pnpm lint

- name: Test
run: pnpm test

- name: Build library
run: pnpm build

- name: Build site
run: pnpm site:build
48 changes: 48 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy docs

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm site:build

- uses: actions/configure-pages@v5

- uses: actions/upload-pages-artifact@v3
with:
path: site-dist

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: release-${{ github.ref }}

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
registry-url: https://registry.npmjs.org

- run: pnpm install --frozen-lockfile

- run: pnpm build

- name: Create release PR or publish to npm
uses: changesets/action@v1
with:
publish: pnpm release
version: pnpm changeset version
commit: "chore: release"
title: "chore: release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
103 changes: 101 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,101 @@
node_modules
dist
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

storybook-static
.docz

# Build output
dist/
site-dist/

# Test coverage
coverage/

# pnpm
.pnpm-store/

# IDE
.vscode/
.idea/
.DS_Store

# Claude Code runtime
.claude/
5 changes: 0 additions & 5 deletions .npmignore

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist/
site-dist/
coverage/
node_modules/
pnpm-lock.yaml
CHANGELOG.md
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"printWidth": 120,
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "all"
}
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog

All notable changes to this project will be documented in this file.

This project follows [Semantic Versioning](https://semver.org/). From v4 onwards, releases are managed with [Changesets](https://github.com/changesets/changesets); entries in this file after v4.0.0 are generated automatically.

## 4.0.0

Full rewrite. See the [v3 → v4 guide](https://gfazioli.github.io/react-toggle/upgrade/) for migration steps.

### Breaking

- Drops React 16/17 support. Now requires `react >= 18` (peer).
- Removes the `styled-components` peer dependency. Theming uses standard CSS custom properties; the bundled stylesheet must be imported once: `import "react-toggle-component/styles.css"`.
- Removes `ReactToggleThemeProvider`. Override CSS variables on any selector to scope a theme.
- Removes the `controlled` prop. Pass `checked` for controlled, `defaultChecked` for uncontrolled (matches native React form-input convention).
- Deprecates `onLeft` / `onRight` / `onToggle`. Use `onCheckedChange(checked, event)` (recommended) or the standard `onChange(event)`.

### Added

- `role="switch"` and proper ARIA wiring (`aria-label`, `aria-labelledby`, `aria-describedby`).
- `forwardRef` correctly forwards to the underlying `<input>`.
- Dual ESM + CJS build with full TypeScript declarations.
- `prefers-reduced-motion` is respected.
- Live playground built with [Ladle](https://ladle.dev), deployed to GitHub Pages.

### Changed

- Build output moved from committed `dist/` (TypeScript-compiled CommonJS) to a `tsup`-generated dual-format bundle, no longer committed.
- Documentation site moved from Docz/Gatsby (abandoned) to Ladle.
- Linter switched from tslint (deprecated) to ESLint flat config.

## 3.x

See git history for changes prior to v4.
Loading
Loading