-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b006604
commit 42793ee
Showing
107 changed files
with
10,236 additions
and
4,942 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@collapsed/solid": patch | ||
--- | ||
|
||
New implementation of collapsed as a Solid component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@collapsed/lit": patch | ||
--- | ||
|
||
New implementation of collapsed as a Lit web component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@collapsed/react": major | ||
--- | ||
|
||
NOTE: See `packages/react-collapsed` for stable API. | ||
|
||
Complete rewrite using rewritten `@collapsed/core`. API remains the same. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@collapsed/core": major | ||
--- | ||
|
||
Full rewrite to narrow API to collapse animation and remove internal state. Inteded for use with framework wrappers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 🙈 Collapsed | ||
|
||
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/roginfarrer/collapsed/main.yml) | ||
![npm bundle size (version)][minzipped-badge] | ||
[![npm version][npm-badge]][npm-version] | ||
[![Netlify Status](https://api.netlify.com/api/v1/badges/5a5b0e80-d15e-4983-976d-37fe6bdada7a/deploy-status)](https://app.netlify.com/sites/react-collapsed/deploys) | ||
|
||
Headless UI for building flexible and accessible animating expand/collapse sections or disclosures. Animates the height of elements to `auto`. | ||
|
||
```bash | ||
npm install react-collapsed | ||
``` | ||
|
||
## [—> View installation and usage docs here! <—](/packages/react-collapsed) | ||
|
||
### Experimental Framework Adapters | ||
|
||
[react-collapsed][react-collapsed] is stable and ready to use. I've also been exploring a rewrite with a framework-agnostic core that's also available with a few different framework adapters (indicated with the `@collapsed/` namespace). Here's a breakdown to clarify what's available and their stability: | ||
|
||
| Package | Stable | | ||
| ---------------------------------- | ------ | | ||
| [react-collapsed][react-collapsed] | ✅ | | ||
| [@collapsed/core](packages/core) | 🚧 | | ||
| [@collapsed/react](packages/react) | 🚧 | | ||
| [@collapsed/solid](packages/solid) | 🚧 | | ||
| [@collapsed/lit](packages/lit) | 🚧 | | ||
|
||
[react-collapsed]: /packages/react-collapsed | ||
[minzipped-badge]: https://img.shields.io/bundlephobia/minzip/react-collapsed/latest | ||
[npm-badge]: http://img.shields.io/npm/v/react-collapsed.svg?style=flat | ||
[npm-version]: https://npmjs.org/package/react-collapsed "View this project on npm" | ||
[netlify]: https://app.netlify.com/sites/react-collapsed/deploys | ||
[netlify-badge]: https://api.netlify.com/api/v1/badges/4d285ffc-aa4f-4d32-8549-eb58e00dd2d1/deploy-status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
|
||
## Learn More | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "next-app", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"@collapsed/react": "workspace:*", | ||
"next": "14.2.3", | ||
"react": "^18", | ||
"react-collapsed": "workspace:*", | ||
"react-dom": "^18" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18", | ||
"eslint-config-next": "14.2.4", | ||
"typescript": "^5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"use client"; | ||
|
||
import { useCollapse as useCollapsedReact } from "@collapsed/react"; | ||
import { useCollapse as useReactCollapsed } from "react-collapsed"; | ||
|
||
export function CollapsedReact() { | ||
const { getCollapseProps, getToggleProps, isExpanded } = useCollapsedReact(); | ||
|
||
return ( | ||
<div> | ||
<button {...getToggleProps()}>{isExpanded ? "Hide" : "Show"}</button> | ||
<div {...getCollapseProps()}> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export function ReactCollapsed() { | ||
const { getCollapseProps, getToggleProps, isExpanded } = useReactCollapsed(); | ||
|
||
return ( | ||
<div> | ||
<button {...getToggleProps()}>{isExpanded ? "Hide" : "Show"}</button> | ||
<div {...getCollapseProps()}> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
<p>Hey there</p> | ||
</div> | ||
</div> | ||
); | ||
} |
Binary file not shown.
Oops, something went wrong.