Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage #21

Merged
merged 7 commits into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.formatOnSave": true,
"editor.formatOnPaste": true
}
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,43 @@ This project was originally inspired by next-themes. Next-themes is an awesome p
- ✅ Documented with [Typedoc](https://react18-tools.github.io/nextjs-themes) ([Docs](https://react18-tools.github.io/nextjs-themes))
- ✅ Use combinations of [data-th=""] and [data-color-scheme=""] for dark/light varients of themes
- ✅ Use [data-csp=""] to style based on colorSchemePreference.
- ✅ Want to avoid cookies (Not recommended), set storage prop to `localStorage` or `sessionStorage` (to avoid persistance)

Check out the [live example](https://nextjs-themes.vercel.app/).

## Install

```bash
$ pnpm add nextjs-themes
# or
```

**OR**

```bash
$ npm install nextjs-themes
# or
```

**OR**

```bash
$ yarn add nextjs-themes
```

## Want Lite Version? [![npm bundle size](https://img.shields.io/bundlephobia/minzip/nextjs-themes-lite)](https://www.npmjs.com/package/nextjs-themes-lite) [![Version](https://img.shields.io/npm/v/nextjs-themes-lite.svg?colorB=green)](https://www.npmjs.com/package/nextjs-themes-lite) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/dt/nextjs-themes-lite.svg)](https://www.npmjs.com/package/nextjs-themes-lite)

```bash
$ pnpm add nextjs-themes-lite
# or
```

**or**

```bash
$ npm install nextjs-themes-lite
# or
```

**or**

```bash
$ yarn add nextjs-themes-lite
```

Expand Down
8 changes: 8 additions & 0 deletions examples/app-router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# app-router

## 0.0.16

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## 0.0.15

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions examples/app-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app-router",
"version": "0.0.15",
"version": "0.0.16",
"private": true,
"scripts": {
"dev": "next dev --port 3002",
Expand All @@ -18,9 +18,9 @@
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.0.4",
"@types/node": "^20.10.4",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*",
"typescript": "^5.3.3"
Expand Down
8 changes: 8 additions & 0 deletions examples/pages-router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# nextjs-pages-router

## 1.0.11

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## 1.0.10

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions examples/pages-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pages-router",
"version": "1.0.10",
"version": "1.0.11",
"private": true,
"scripts": {
"dev": "next dev --port 3003",
Expand All @@ -16,9 +16,9 @@
"shared-ui": "workspace:*"
},
"devDependencies": {
"@types/node": "^20.10.4",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*",
"typescript": "^5.3.3"
Expand Down
8 changes: 8 additions & 0 deletions examples/simple-multi-theme/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# simple-multi-theme

## 1.0.11

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## 1.0.10

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions examples/simple-multi-theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-multi-theme",
"version": "1.0.10",
"version": "1.0.11",
"private": true,
"scripts": {
"dev": "next dev --port 3001",
Expand All @@ -16,9 +16,9 @@
"shared-ui": "workspace:*"
},
"devDependencies": {
"@types/node": "^20.10.4",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*",
"typescript": "^5.3.3"
Expand Down
7 changes: 7 additions & 0 deletions examples/tailwind/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# tailwind

## 0.1.5

### Patch Changes

- Updated dependencies
- [email protected]

## 0.1.4

### Patch Changes
Expand Down
12 changes: 6 additions & 6 deletions examples/tailwind/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tailwind",
"version": "0.1.4",
"version": "0.1.5",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -16,14 +16,14 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^20.10.4",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"autoprefixer": "^10.4.16",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-config-custom": "workspace:*",
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
"tailwindcss": "^3.4.0",
"tsconfig": "workspace:*",
"typescript": "^5.3.3"
}
Expand Down
8 changes: 8 additions & 0 deletions examples/vite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# vite-example

## 0.0.16

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## 0.0.15

### Patch Changes
Expand Down
16 changes: 8 additions & 8 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vite-example",
"private": true,
"version": "0.0.15",
"version": "0.0.16",
"type": "module",
"scripts": {
"dev": "vite --port 3001",
Expand All @@ -14,19 +14,19 @@
"nextjs-themes": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.20.1",
"react-router-dom": "^6.21.1",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"typescript": "^5.3.3",
"vite": "^5.0.7"
"vite": "^5.0.10"
}
}
6 changes: 6 additions & 0 deletions lib/nextjs-themes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# nextjs-themes

## 2.1.0

### Minor Changes

- Add support for changing storage

## 2.0.1

### Patch Changes
Expand Down
18 changes: 9 additions & 9 deletions lib/nextjs-themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nextjs-themes",
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
"private": false,
"version": "2.0.1",
"version": "2.1.0",
"description": "Unleash the Power of React Server Components! Use multiple themes on your site with confidence, without losing any advantages of React Server Components.",
"main": "./index.ts",
"types": "./index.ts",
Expand All @@ -25,12 +25,12 @@
},
"devDependencies": {
"@testing-library/react": "^14.1.2",
"@turbo/gen": "^1.11.1",
"@types/node": "^20.10.4",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@turbo/gen": "^1.11.2",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.0.2",
"@vitest/coverage-v8": "^1.1.0",
"esbuild-plugin-ignoretests": "^0.0.7",
"esbuild-plugin-react18": "^0.0.6",
"esbuild-plugin-removetestid": "^0.0.5",
Expand All @@ -44,11 +44,11 @@
"tsup": "^8.0.1",
"typedoc": "^0.25.4",
"typescript": "5.3.3",
"vite-tsconfig-paths": "^4.2.2",
"vitest": "^1.0.2"
"vite-tsconfig-paths": "^4.2.3",
"vitest": "^1.1.0"
},
"dependencies": {
"persist-and-sync": "^1.1.1",
"persist-and-sync": "^1.2.0",
"zustand": "^4.4.7"
},
"peerDependencies": {
Expand Down
Loading