@codecanon/next-presets 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +17 -16
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1 } from "next-themes";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp, MonitorCog, Moon, Palette, Sun, XIcon } from "lucide-react";
|
|
6
6
|
import { clsx } from "clsx";
|
|
@@ -118,7 +118,7 @@ const PresetContext = createContext({
|
|
|
118
118
|
});
|
|
119
119
|
function PresetProvider({ children, presetKey = "preset" }) {
|
|
120
120
|
const [preset, setPreset, resetPreset] = useLocalStorage(presetKey, DEFAULT_PRESET);
|
|
121
|
-
|
|
121
|
+
useLayoutEffect(() => {
|
|
122
122
|
const root = document.documentElement;
|
|
123
123
|
if (!root) return;
|
|
124
124
|
if (preset) root.setAttribute("data-preset", preset);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecanon/next-presets",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"description": "Allow your user to choose from a list of shadcn presets",
|
|
6
6
|
"author": "CodeCanon LLC <codecanonllc@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -31,6 +31,21 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build:css": "postcss src/styles.css -o dist/styles.css",
|
|
36
|
+
"build:js": "tsdown",
|
|
37
|
+
"build": "pnpm run build:js && pnpm run build:css",
|
|
38
|
+
"dev:css": "postcss src/styles.css -o dist/styles.css --watch",
|
|
39
|
+
"dev:js": "tsdown --watch",
|
|
40
|
+
"dev": "concurrently \"pnpm run dev:js\" \"pnpm run dev:css\"",
|
|
41
|
+
"play": "vite",
|
|
42
|
+
"test": "vitest",
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"release": "bumpp && pnpm publish",
|
|
45
|
+
"prepublishOnly": "pnpm run build",
|
|
46
|
+
"format": "prettier --write .",
|
|
47
|
+
"knip": "knip"
|
|
48
|
+
},
|
|
34
49
|
"peerDependencies": {
|
|
35
50
|
"react": "^19.2.0",
|
|
36
51
|
"react-dom": "^19.2.0"
|
|
@@ -76,19 +91,5 @@
|
|
|
76
91
|
"inlinedDependencies": {
|
|
77
92
|
"@radix-ui/react-compose-refs": "1.1.2",
|
|
78
93
|
"@radix-ui/react-slot": "1.2.3"
|
|
79
|
-
},
|
|
80
|
-
"scripts": {
|
|
81
|
-
"build:css": "postcss src/styles.css -o dist/styles.css",
|
|
82
|
-
"build:js": "tsdown",
|
|
83
|
-
"build": "pnpm run build:js && pnpm run build:css",
|
|
84
|
-
"dev:css": "postcss src/styles.css -o dist/styles.css --watch",
|
|
85
|
-
"dev:js": "tsdown --watch",
|
|
86
|
-
"dev": "concurrently \"pnpm run dev:js\" \"pnpm run dev:css\"",
|
|
87
|
-
"play": "vite",
|
|
88
|
-
"test": "vitest",
|
|
89
|
-
"typecheck": "tsc --noEmit",
|
|
90
|
-
"release": "bumpp && pnpm publish",
|
|
91
|
-
"format": "prettier --write .",
|
|
92
|
-
"knip": "knip"
|
|
93
94
|
}
|
|
94
|
-
}
|
|
95
|
+
}
|