@codecanon/next-presets 0.0.1

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/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @codecanon/next-presets
2
+
3
+ Allow your user to choose from a list of shadcn presets.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bun add @codecanon/next-presets
9
+ ```
10
+
11
+ ```css
12
+ /* Then add to your global css file */
13
+ @import "@codecanon/next-presets/styles.css";
14
+ ```
15
+
16
+ ## Development
17
+
18
+ - Install dependencies:
19
+
20
+ ```bash
21
+ npm install
22
+ ```
23
+
24
+ - Run the playground:
25
+
26
+ ```bash
27
+ npm run play
28
+ ```
29
+
30
+ - Run the unit tests:
31
+
32
+ ```bash
33
+ npm run test
34
+ ```
35
+
36
+ - Build the library:
37
+
38
+ ```bash
39
+ npm run build
40
+ ```
@@ -0,0 +1,112 @@
1
+ import { ThemeProviderProps as ThemeProviderProps$1 } from "next-themes";
2
+ import * as React$1 from "react";
3
+ import { PropsWithChildren, ReactNode } from "react";
4
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
+ import { Dialog } from "radix-ui";
6
+
7
+ //#region src/presets/index.d.ts
8
+ declare const PRESETS: [["nuteral", "Nuteral"], ["nuteral-accent", "Nuteral (Accent)"], ["new", "Anew"], ["red", "Red"], ["rose", "Rose"], ["orange", "Orange"], ["green", "Green"], ["blue", "Blue"], ["yellow", "Yellow"], ["violet", "Violet"], ["modern-minimal", "Modern Minimal"], ["violet-bloom", "Violet Bloom"], ["t3-chat", "T3 Chat"], ["twitter", "Twitter"], ["mocha-mousse", "Mocha Mousse"], ["bubblegum", "Bubblegum"], ["amethyst-haze", "Amethyst Haze"], ["notebook", "Notebook"], ["doom-64", "Doom 64"], ["catppuccin", "Catppuccin"], ["graphite", "Graphite"], ["perpetuity", "Perpetuity"], ["kodama-grove", "Kodama Grove"], ["cosmic-night", "Cosmic Night"], ["tangerine", "Tangerine"], ["quantum-rose", "Quantum Rose"], ["nature", "Nature"], ["bold-tech", "Bold Tech"], ["elegant-luxury", "Elegant Luxury"], ["amber-minimal", "Amber Minimal"], ["supabase", "Supabase"], ["neo-brutalism", "Neo Brutalism"], ["solar-dusk", "Solar Dusk"], ["claymorphism", "Claymorphism"], ["cyberpunk", "Cyberpunk"], ["pastel-dreams", "Pastel Dreams"], ["clean-slate", "Clean Slate"], ["caffeine", "Caffeine"], ["ocean-breeze", "Ocean Breeze"], ["retro-arcade", "Retro Arcade"], ["midnight-bloom", "Midnight Bloom"], ["candyland", "Candyland"], ["northern-lights", "Northern Lights"], ["vintage-paper", "Vintage Paper"], ["sunset-horizon", "Sunset Horizon"], ["starry-night", "Starry Night"], ["claude", "Claude"], ["vercel", "Vercel"], ["darkmatter", "Darkmatter"], ["mono", "Mono"], ["soft-pop", "Soft Pop"], ["sage-garden", "Sage Garden"]];
9
+ type PresetKeys = (typeof PRESETS)[number][0];
10
+ declare const DEFAULT_PRESET: PresetKeys;
11
+ //#endregion
12
+ //#region src/providers.d.ts
13
+ type ColorScheme = "dark" | "light";
14
+ type Theme = ColorScheme | "system";
15
+ type PresetProviderProps = {
16
+ children: ReactNode;
17
+ defaultPreset?: PresetKeys;
18
+ presetKey?: string;
19
+ };
20
+ type PresetState = {
21
+ preset?: PresetKeys;
22
+ resetPreset: () => void;
23
+ setPreset: (preset: PresetKeys) => void;
24
+ };
25
+ declare function PresetProvider({
26
+ children,
27
+ presetKey
28
+ }: PresetProviderProps): _$react_jsx_runtime0.JSX.Element;
29
+ declare function usePreset(): PresetState;
30
+ type ThemeProviderProps = ThemeProviderProps$1 & {
31
+ defaultTheme?: Theme;
32
+ themeKey?: string;
33
+ };
34
+ declare function ThemeProvider({
35
+ children,
36
+ defaultTheme,
37
+ themeKey,
38
+ ...nextThemeProps
39
+ }: ThemeProviderProps): _$react_jsx_runtime0.JSX.Element;
40
+ declare function useTheme(): {
41
+ colorScheme: ColorScheme;
42
+ isDarkTheme: boolean; /** List of all available theme names */
43
+ themes: Theme[]; /** Forced theme name for the current page */
44
+ forcedTheme?: Theme | undefined; /** Update the theme */
45
+ setTheme: React.Dispatch<React.SetStateAction<Theme>>; /** Active theme name */
46
+ theme?: Theme | undefined; /** If `enableSystem` is true and the active theme is "system", this returns whether the system preference resolved to "dark" or "light". Otherwise, identical to `theme` */
47
+ resolvedTheme?: ColorScheme | undefined; /** If enableSystem is true, returns the System theme preference ("dark" or "light"), regardless what the active theme is */
48
+ systemTheme?: ColorScheme | undefined;
49
+ };
50
+ //#endregion
51
+ //#region src/components/ui/sheet.d.ts
52
+ declare function Sheet({
53
+ ...props
54
+ }: React$1.ComponentProps<typeof Dialog.Root>): _$react_jsx_runtime0.JSX.Element;
55
+ //#endregion
56
+ //#region src/components/ui/card.d.ts
57
+ declare function Card({
58
+ className,
59
+ size,
60
+ ...props
61
+ }: React$1.ComponentProps<"div"> & {
62
+ size?: "default" | "sm";
63
+ }): _$react_jsx_runtime0.JSX.Element;
64
+ //#endregion
65
+ //#region src/components/default-app-preview-card.d.ts
66
+ declare function DefaultAppPreviewCard({
67
+ presetKey,
68
+ label,
69
+ active,
70
+ showDock,
71
+ highlighted,
72
+ className,
73
+ ref,
74
+ ...props
75
+ }: {
76
+ showDock?: boolean;
77
+ label?: string;
78
+ presetKey?: PresetKeys;
79
+ active?: boolean;
80
+ highlighted?: boolean;
81
+ ref?: React.Ref<HTMLDivElement>;
82
+ } & React.ComponentProps<typeof Card>): _$react_jsx_runtime0.JSX.Element;
83
+ //#endregion
84
+ //#region src/components/preset-picker.d.ts
85
+ type PresetPickerState = {
86
+ open: boolean;
87
+ setOpen: React.Dispatch<React.SetStateAction<boolean>>;
88
+ toggleOpen: () => void;
89
+ };
90
+ declare function PresetPicker({
91
+ children
92
+ }: PropsWithChildren): _$react_jsx_runtime0.JSX.Element;
93
+ declare function usePresetPicker(caller?: string): PresetPickerState;
94
+ declare function PresetPickerThemeToggleGroup({
95
+ className,
96
+ ...props
97
+ }: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
98
+ declare function PresetPickerContent({
99
+ showDock,
100
+ previewCard: AppPreviewCard,
101
+ className,
102
+ ...props
103
+ }: {
104
+ showDock?: boolean;
105
+ previewCard?: typeof DefaultAppPreviewCard;
106
+ } & React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
107
+ declare function PresetPickerSheet({
108
+ children,
109
+ ...props
110
+ }: React.ComponentProps<typeof Sheet>): _$react_jsx_runtime0.JSX.Element;
111
+ //#endregion
112
+ export { type ColorScheme, DEFAULT_PRESET, DefaultAppPreviewCard, PRESETS, PresetKeys, PresetPicker, PresetPickerContent, PresetPickerSheet, PresetPickerThemeToggleGroup, PresetProvider, type PresetProviderProps, type Theme, ThemeProvider, type ThemeProviderProps, usePreset, usePresetPicker, useTheme };