@nextworks/blocks-core 0.1.0-alpha.0
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 +29 -0
- package/dist/components/AppProviders.server.d.ts +4 -0
- package/dist/components/AppProviders.server.d.ts.map +1 -0
- package/dist/components/AppProviders.server.js +60 -0
- package/dist/components/enhanced-theme-provider.d.ts +25 -0
- package/dist/components/enhanced-theme-provider.d.ts.map +1 -0
- package/dist/components/enhanced-theme-provider.js +105 -0
- package/dist/components/theme-provider.d.ts +12 -0
- package/dist/components/theme-provider.d.ts.map +1 -0
- package/dist/components/theme-provider.js +6 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/lib/themes.d.ts +32 -0
- package/dist/lib/themes.d.ts.map +1 -0
- package/dist/lib/themes.js +396 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +3 -0
- package/dist/ui/alert-dialog.d.ts +15 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert-dialog.js +59 -0
- package/dist/ui/brand-node.d.ts +43 -0
- package/dist/ui/brand-node.d.ts.map +1 -0
- package/dist/ui/brand-node.js +37 -0
- package/dist/ui/button.d.ts +16 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +71 -0
- package/dist/ui/card.d.ts +10 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +46 -0
- package/dist/ui/checkbox.d.ts +5 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +24 -0
- package/dist/ui/cta-button.d.ts +40 -0
- package/dist/ui/cta-button.d.ts.map +1 -0
- package/dist/ui/cta-button.js +47 -0
- package/dist/ui/dropdown-menu.d.ts +28 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +72 -0
- package/dist/ui/feature-card.d.ts +32 -0
- package/dist/ui/feature-card.d.ts.map +1 -0
- package/dist/ui/feature-card.js +14 -0
- package/dist/ui/input.d.ts +5 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +24 -0
- package/dist/ui/label.d.ts +6 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +25 -0
- package/dist/ui/pricing-card.d.ts +50 -0
- package/dist/ui/pricing-card.d.ts.map +1 -0
- package/dist/ui/pricing-card.js +22 -0
- package/dist/ui/select.d.ts +5 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +20 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/skeleton.js +17 -0
- package/dist/ui/switch.d.ts +9 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/switch.js +24 -0
- package/dist/ui/table.d.ts +9 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +39 -0
- package/dist/ui/testimonial-card.d.ts +35 -0
- package/dist/ui/testimonial-card.d.ts.map +1 -0
- package/dist/ui/testimonial-card.js +36 -0
- package/dist/ui/textarea.d.ts +5 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/textarea.js +24 -0
- package/dist/ui/theme-selector.d.ts +9 -0
- package/dist/ui/theme-selector.d.ts.map +1 -0
- package/dist/ui/theme-selector.js +56 -0
- package/dist/ui/theme-toggle.d.ts +15 -0
- package/dist/ui/theme-toggle.d.ts.map +1 -0
- package/dist/ui/theme-toggle.js +19 -0
- package/dist/ui/toaster.d.ts +2 -0
- package/dist/ui/toaster.d.ts.map +1 -0
- package/dist/ui/toaster.js +6 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @nextworks/blocks-core
|
|
2
|
+
|
|
3
|
+
Core UI primitives and theme utilities used by the Nextworks Blocks kits.
|
|
4
|
+
|
|
5
|
+
This package provides:
|
|
6
|
+
|
|
7
|
+
- Base UI components (Button, Input, Card, Checkbox, Select, Switch, etc.)
|
|
8
|
+
- Theme helpers and providers
|
|
9
|
+
- Types and helpers shared by other `@nextworks/blocks-*` packages
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @nextworks/blocks-core
|
|
15
|
+
# or
|
|
16
|
+
pnpm add @nextworks/blocks-core
|
|
17
|
+
# or
|
|
18
|
+
yarn add @nextworks/blocks-core
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
You will typically not use this package directly unless you are composing your own blocks or building on top of `@nextworks/blocks-sections` or `@nextworks/blocks-templates`.
|
|
22
|
+
|
|
23
|
+
For a higher-level experience with copyable files and Next.js app wiring, consider using the `nextworks` CLI:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx nextworks add blocks
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
which copies a curated set of components and templates into your app.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppProviders.server.d.ts","sourceRoot":"","sources":["../../src/components/AppProviders.server.tsx"],"names":[],"mappings":"AAwDA,wBAA8B,YAAY,CAAC,EACzC,QAAQ,GACT,EAAE,QAAQ,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,oDA0CzC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Geist, Geist_Mono, Outfit, Inter, Poppins } from "next/font/google";
|
|
3
|
+
import { EnhancedThemeProvider } from "./enhanced-theme-provider";
|
|
4
|
+
import { cookies } from "next/headers";
|
|
5
|
+
import { themes, darkThemes, } from "../lib/themes";
|
|
6
|
+
const geistSans = Geist({
|
|
7
|
+
variable: "--font-geist-sans",
|
|
8
|
+
subsets: ["latin"],
|
|
9
|
+
});
|
|
10
|
+
const geistMono = Geist_Mono({
|
|
11
|
+
variable: "--font-geist-mono",
|
|
12
|
+
subsets: ["latin"],
|
|
13
|
+
});
|
|
14
|
+
const outfit = Outfit({
|
|
15
|
+
variable: "--font-outfit",
|
|
16
|
+
subsets: ["latin"],
|
|
17
|
+
});
|
|
18
|
+
const inter = Inter({
|
|
19
|
+
variable: "--font-inter",
|
|
20
|
+
subsets: ["latin"],
|
|
21
|
+
});
|
|
22
|
+
const poppins = Poppins({
|
|
23
|
+
variable: "--font-poppins",
|
|
24
|
+
subsets: ["latin"],
|
|
25
|
+
weight: ["100", "200", "300", "400", "500", "600", "700", "800", "900"],
|
|
26
|
+
});
|
|
27
|
+
function toCssVars(colors) {
|
|
28
|
+
return Object.entries(colors)
|
|
29
|
+
.map(([key, value]) => `--${key.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${value};`)
|
|
30
|
+
.join("");
|
|
31
|
+
}
|
|
32
|
+
function safeParseCustomTokens(value) {
|
|
33
|
+
if (!value)
|
|
34
|
+
return null;
|
|
35
|
+
try {
|
|
36
|
+
return JSON.parse(decodeURIComponent(value));
|
|
37
|
+
}
|
|
38
|
+
catch (_a) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export default async function AppProviders({ children, }) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
// Read cookies for SSR: chosen variant and optional custom tokens
|
|
45
|
+
const cookieStore = await cookies();
|
|
46
|
+
const cookieVariant = (_a = cookieStore.get("theme-variant")) === null || _a === void 0 ? void 0 : _a.value;
|
|
47
|
+
const variant = cookieVariant && cookieVariant in themes ? cookieVariant : "default";
|
|
48
|
+
const cookieCustom = variant === "custom"
|
|
49
|
+
? safeParseCustomTokens((_b = cookieStore.get("theme-custom")) === null || _b === void 0 ? void 0 : _b.value)
|
|
50
|
+
: null;
|
|
51
|
+
const baseLight = themes[variant].colors;
|
|
52
|
+
const baseDark = darkThemes[variant].colors;
|
|
53
|
+
const lightMerged = cookieCustom
|
|
54
|
+
? Object.assign(Object.assign({}, baseLight), cookieCustom) : baseLight;
|
|
55
|
+
const darkMerged = cookieCustom ? Object.assign(Object.assign({}, baseDark), cookieCustom) : baseDark;
|
|
56
|
+
const lightVars = toCssVars(lightMerged);
|
|
57
|
+
const darkVars = toCssVars(darkMerged);
|
|
58
|
+
const inlineThemeCss = `:root{${lightVars}}.dark{${darkVars}}`;
|
|
59
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { id: "theme-variant-vars", dangerouslySetInnerHTML: { __html: inlineThemeCss } }), _jsx("div", { className: `${geistSans.variable} ${geistMono.variable} ${outfit.variable} ${inter.variable} ${poppins.variable} antialiased`, children: _jsx(EnhancedThemeProvider, { defaultThemeVariant: variant, children: children }) })] }));
|
|
60
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ThemeProviderProps as NextThemesProviderProps } from "next-themes";
|
|
3
|
+
import { ThemeVariant, type ThemeConfig } from "../lib/themes";
|
|
4
|
+
type ColorTokens = ThemeConfig["colors"];
|
|
5
|
+
interface EnhancedThemeProviderProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
attribute?: NextThemesProviderProps["attribute"];
|
|
8
|
+
defaultTheme?: NextThemesProviderProps["defaultTheme"];
|
|
9
|
+
enableSystem?: NextThemesProviderProps["enableSystem"];
|
|
10
|
+
disableTransitionOnChange?: NextThemesProviderProps["disableTransitionOnChange"];
|
|
11
|
+
defaultThemeVariant?: ThemeVariant;
|
|
12
|
+
defaultCustomTokens?: Partial<ColorTokens> | null;
|
|
13
|
+
}
|
|
14
|
+
interface ThemeContextType {
|
|
15
|
+
themeVariant: ThemeVariant;
|
|
16
|
+
setThemeVariant: (variant: ThemeVariant) => void;
|
|
17
|
+
customTheme: Partial<ColorTokens> | null;
|
|
18
|
+
setCustomTheme: (tokens: Partial<ColorTokens> | null) => void;
|
|
19
|
+
setCustomBrandColors: (tokens: Partial<ColorTokens>) => void;
|
|
20
|
+
applyTheme: (variant: ThemeVariant, isDark?: boolean) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function useThemeVariant(): ThemeContextType;
|
|
23
|
+
export declare function EnhancedThemeProvider({ children, attribute, defaultTheme, enableSystem, disableTransitionOnChange, defaultThemeVariant, defaultCustomTokens, }: EnhancedThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=enhanced-theme-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhanced-theme-provider.d.ts","sourceRoot":"","sources":["../../src/components/enhanced-theme-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EACL,YAAY,EAGZ,KAAK,WAAW,EACjB,MAAM,eAAe,CAAC;AAEvB,KAAK,WAAW,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;AAGzC,UAAU,0BAA0B;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACvD,yBAAyB,CAAC,EAAE,uBAAuB,CAAC,2BAA2B,CAAC,CAAC;IACjF,mBAAmB,CAAC,EAAE,YAAY,CAAC;IAEnC,mBAAmB,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;CACnD;AAED,UAAU,gBAAgB;IACxB,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAEjD,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IACzC,cAAc,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9D,oBAAoB,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAE7D,UAAU,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/D;AAMD,wBAAgB,eAAe,qBAQ9B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,SAAmB,EACnB,YAAuB,EACvB,YAAmB,EACnB,yBAAiC,EACjC,mBAAkC,EAClC,mBAA0B,GAC3B,EAAE,0BAA0B,2CAqI5B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
5
|
+
import { themes, darkThemes, } from "../lib/themes";
|
|
6
|
+
const CUSTOM_STORAGE_KEY = "nxw-theme-custom";
|
|
7
|
+
const ThemeContext = React.createContext(undefined);
|
|
8
|
+
export function useThemeVariant() {
|
|
9
|
+
const context = React.useContext(ThemeContext);
|
|
10
|
+
if (context === undefined) {
|
|
11
|
+
throw new Error("useThemeVariant must be used within an EnhancedThemeProvider");
|
|
12
|
+
}
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
export function EnhancedThemeProvider({ children, attribute = "class", defaultTheme = "system", enableSystem = true, disableTransitionOnChange = false, defaultThemeVariant = "monochrome", defaultCustomTokens = null, }) {
|
|
16
|
+
const [themeVariant, setThemeVariant] = React.useState(defaultThemeVariant);
|
|
17
|
+
const [customTheme, setCustomThemeState] = React.useState(defaultCustomTokens);
|
|
18
|
+
const writeCustomCookies = React.useCallback((tokens) => {
|
|
19
|
+
if (tokens) {
|
|
20
|
+
document.cookie = `theme-variant=custom; Path=/; Max-Age=31536000; SameSite=Lax`;
|
|
21
|
+
document.cookie = `theme-custom=${encodeURIComponent(JSON.stringify(tokens))}; Path=/; Max-Age=31536000; SameSite=Lax`;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
document.cookie = `theme-custom=; Path=/; Max-Age=0; SameSite=Lax`;
|
|
25
|
+
}
|
|
26
|
+
}, []);
|
|
27
|
+
const setCustomTheme = React.useCallback((tokens) => {
|
|
28
|
+
setCustomThemeState(tokens);
|
|
29
|
+
try {
|
|
30
|
+
if (tokens) {
|
|
31
|
+
localStorage.setItem(CUSTOM_STORAGE_KEY, JSON.stringify(tokens));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
localStorage.removeItem(CUSTOM_STORAGE_KEY);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (_a) { }
|
|
38
|
+
writeCustomCookies(tokens !== null && tokens !== void 0 ? tokens : null);
|
|
39
|
+
}, [writeCustomCookies]);
|
|
40
|
+
const setCustomBrandColors = React.useCallback((tokens) => {
|
|
41
|
+
setThemeVariant("custom");
|
|
42
|
+
setCustomTheme(tokens);
|
|
43
|
+
}, [setCustomTheme]);
|
|
44
|
+
const applyTheme = React.useCallback((variant, isDark = false) => {
|
|
45
|
+
const base = isDark ? darkThemes[variant].colors : themes[variant].colors;
|
|
46
|
+
const merged = variant === "custom" && customTheme
|
|
47
|
+
? Object.assign(Object.assign({}, base), customTheme) : base;
|
|
48
|
+
// Apply CSS custom properties to the document root
|
|
49
|
+
const root = document.documentElement;
|
|
50
|
+
// Reflect the current variant for CSS selectors
|
|
51
|
+
root.setAttribute("data-theme-variant", variant);
|
|
52
|
+
Object.entries(merged).forEach(([key, value]) => {
|
|
53
|
+
const cssVar = `--${key.replace(/([A-Z])/g, "-$1").toLowerCase()}`;
|
|
54
|
+
root.style.setProperty(cssVar, value);
|
|
55
|
+
});
|
|
56
|
+
}, [customTheme]);
|
|
57
|
+
// Apply theme when variant or custom tokens change
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
const isDark = document.documentElement.classList.contains("dark");
|
|
60
|
+
applyTheme(themeVariant, isDark);
|
|
61
|
+
}, [themeVariant, customTheme, applyTheme]);
|
|
62
|
+
// Load custom tokens from localStorage on mount (overrides defaultCustomTokens if present)
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
try {
|
|
65
|
+
const raw = localStorage.getItem(CUSTOM_STORAGE_KEY);
|
|
66
|
+
if (raw) {
|
|
67
|
+
const parsed = JSON.parse(raw);
|
|
68
|
+
setCustomThemeState(parsed);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (_a) { }
|
|
72
|
+
}, []);
|
|
73
|
+
// Listen for theme changes from next-themes
|
|
74
|
+
React.useEffect(() => {
|
|
75
|
+
const observer = new MutationObserver((mutations) => {
|
|
76
|
+
mutations.forEach((mutation) => {
|
|
77
|
+
if (mutation.type === "attributes" &&
|
|
78
|
+
mutation.attributeName === "class") {
|
|
79
|
+
const isDark = document.documentElement.classList.contains("dark");
|
|
80
|
+
applyTheme(themeVariant, isDark);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
observer.observe(document.documentElement, {
|
|
85
|
+
attributes: true,
|
|
86
|
+
attributeFilter: ["class"],
|
|
87
|
+
});
|
|
88
|
+
return () => observer.disconnect();
|
|
89
|
+
}, [themeVariant, applyTheme]);
|
|
90
|
+
const contextValue = React.useMemo(() => ({
|
|
91
|
+
themeVariant,
|
|
92
|
+
setThemeVariant,
|
|
93
|
+
customTheme,
|
|
94
|
+
setCustomTheme,
|
|
95
|
+
setCustomBrandColors,
|
|
96
|
+
applyTheme,
|
|
97
|
+
}), [
|
|
98
|
+
themeVariant,
|
|
99
|
+
customTheme,
|
|
100
|
+
setCustomTheme,
|
|
101
|
+
setCustomBrandColors,
|
|
102
|
+
applyTheme,
|
|
103
|
+
]);
|
|
104
|
+
return (_jsx(NextThemesProvider, { attribute: attribute, defaultTheme: defaultTheme, enableSystem: enableSystem, disableTransitionOnChange: disableTransitionOnChange, children: _jsx(ThemeContext.Provider, { value: contextValue, children: children }) }));
|
|
105
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ThemeProviderProps as NextThemesProviderProps } from "next-themes";
|
|
3
|
+
interface ThemeProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
attribute?: NextThemesProviderProps["attribute"];
|
|
6
|
+
defaultTheme?: NextThemesProviderProps["defaultTheme"];
|
|
7
|
+
enableSystem?: NextThemesProviderProps["enableSystem"];
|
|
8
|
+
disableTransitionOnChange?: NextThemesProviderProps["disableTransitionOnChange"];
|
|
9
|
+
}
|
|
10
|
+
export declare function ThemeProvider({ children, attribute, defaultTheme, enableSystem, disableTransitionOnChange, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=theme-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../../src/components/theme-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEjF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACvD,YAAY,CAAC,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACvD,yBAAyB,CAAC,EAAE,uBAAuB,CAAC,2BAA2B,CAAC,CAAC;CAClF;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAmB,EACnB,YAAuB,EACvB,YAAmB,EACnB,yBAAiC,GAClC,EAAE,kBAAkB,2CAWpB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
4
|
+
export function ThemeProvider({ children, attribute = "class", defaultTheme = "system", enableSystem = true, disableTransitionOnChange = false, }) {
|
|
5
|
+
return (_jsx(NextThemesProvider, { attribute: attribute, defaultTheme: defaultTheme, enableSystem: enableSystem, disableTransitionOnChange: disableTransitionOnChange, children: children }));
|
|
6
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
// Auto-generated by scripts/postbuild.js
|
|
3
|
+
export * from "./lib/themes";
|
|
4
|
+
export * from "./lib/utils";
|
|
5
|
+
export * from "./components/enhanced-theme-provider";
|
|
6
|
+
export * from "./components/theme-provider";
|
|
7
|
+
export * from "./ui/alert-dialog";
|
|
8
|
+
export * from "./ui/brand-node";
|
|
9
|
+
export * from "./ui/button";
|
|
10
|
+
export * from "./ui/card";
|
|
11
|
+
export * from "./ui/checkbox";
|
|
12
|
+
export * from "./ui/cta-button";
|
|
13
|
+
export * from "./ui/dropdown-menu";
|
|
14
|
+
export * from "./ui/feature-card";
|
|
15
|
+
export * from "./ui/input";
|
|
16
|
+
export * from "./ui/label";
|
|
17
|
+
export * from "./ui/pricing-card";
|
|
18
|
+
export * from "./ui/select";
|
|
19
|
+
export * from "./ui/skeleton";
|
|
20
|
+
export * from "./ui/switch";
|
|
21
|
+
export * from "./ui/table";
|
|
22
|
+
export * from "./ui/testimonial-card";
|
|
23
|
+
export * from "./ui/textarea";
|
|
24
|
+
export * from "./ui/theme-selector";
|
|
25
|
+
export * from "./ui/theme-toggle";
|
|
26
|
+
export * from "./ui/toaster";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAG5B,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAG5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Public exports for @nextworks/blocks-core
|
|
2
|
+
// NOTE: This entry is safe for client and server usage. Server-only
|
|
3
|
+
// components like AppProviders are exported from a separate entry.
|
|
4
|
+
// Theme data & utilities
|
|
5
|
+
export * from "./lib/themes";
|
|
6
|
+
export * from "./lib/utils";
|
|
7
|
+
// Client-safe providers/hooks
|
|
8
|
+
export * from "./components/enhanced-theme-provider";
|
|
9
|
+
export * from "./components/theme-provider";
|
|
10
|
+
// UI primitives
|
|
11
|
+
export * from "./ui/alert-dialog";
|
|
12
|
+
export * from "./ui/brand-node";
|
|
13
|
+
export * from "./ui/button";
|
|
14
|
+
export * from "./ui/card";
|
|
15
|
+
export * from "./ui/checkbox";
|
|
16
|
+
export * from "./ui/cta-button";
|
|
17
|
+
export * from "./ui/dropdown-menu";
|
|
18
|
+
export * from "./ui/feature-card";
|
|
19
|
+
export * from "./ui/input";
|
|
20
|
+
export * from "./ui/label";
|
|
21
|
+
export * from "./ui/pricing-card";
|
|
22
|
+
export * from "./ui/select";
|
|
23
|
+
export * from "./ui/skeleton";
|
|
24
|
+
export * from "./ui/switch";
|
|
25
|
+
export * from "./ui/table";
|
|
26
|
+
export * from "./ui/testimonial-card";
|
|
27
|
+
export * from "./ui/textarea";
|
|
28
|
+
export * from "./ui/theme-selector";
|
|
29
|
+
export * from "./ui/theme-toggle";
|
|
30
|
+
export * from "./ui/toaster";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type ThemeVariant = "default" | "monochrome" | "blue" | "green" | "purple" | "orange" | "custom";
|
|
2
|
+
export interface ThemeConfig {
|
|
3
|
+
name: string;
|
|
4
|
+
colors: {
|
|
5
|
+
primary: string;
|
|
6
|
+
primaryForeground: string;
|
|
7
|
+
secondary: string;
|
|
8
|
+
secondaryForeground: string;
|
|
9
|
+
accent: string;
|
|
10
|
+
accentForeground: string;
|
|
11
|
+
background: string;
|
|
12
|
+
foreground: string;
|
|
13
|
+
card: string;
|
|
14
|
+
cardForeground: string;
|
|
15
|
+
popover: string;
|
|
16
|
+
popoverForeground: string;
|
|
17
|
+
muted: string;
|
|
18
|
+
mutedForeground: string;
|
|
19
|
+
border: string;
|
|
20
|
+
input: string;
|
|
21
|
+
ring: string;
|
|
22
|
+
destructive: string;
|
|
23
|
+
chart1: string;
|
|
24
|
+
chart2: string;
|
|
25
|
+
chart3: string;
|
|
26
|
+
chart4: string;
|
|
27
|
+
chart5: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare const themes: Record<ThemeVariant, ThemeConfig>;
|
|
31
|
+
export declare const darkThemes: Record<ThemeVariant, ThemeConfig>;
|
|
32
|
+
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/lib/themes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,YAAY,GACZ,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,CAAC;AAEb,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC;QAClB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,MAAM,EAAE,MAAM,CAAC;QACf,gBAAgB,EAAE,MAAM,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,EAAE,MAAM,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC;QACd,eAAe,EAAE,MAAM,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,WAAW,CAqMpD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,YAAY,EAAE,WAAW,CAqMxD,CAAC"}
|