@kilivi/payloadcms-theme-management 0.1.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 +97 -0
- package/dist/components/ServerThemeInjector.d.ts +11 -0
- package/dist/components/ServerThemeInjector.d.ts.map +1 -0
- package/dist/components/ServerThemeInjector.js +73 -0
- package/dist/components/ServerThemeInjector.js.map +1 -0
- package/dist/components/ThemePreview.d.ts +2 -0
- package/dist/components/ThemePreview.d.ts.map +1 -0
- package/dist/components/ThemePreview.js +153 -0
- package/dist/components/ThemePreview.js.map +1 -0
- package/dist/components/typographyPreviewUtils.d.ts +18 -0
- package/dist/components/typographyPreviewUtils.d.ts.map +1 -0
- package/dist/components/typographyPreviewUtils.js +80 -0
- package/dist/components/typographyPreviewUtils.js.map +1 -0
- package/dist/constants/themeFonts.d.ts +75 -0
- package/dist/constants/themeFonts.d.ts.map +1 -0
- package/dist/constants/themeFonts.js +45 -0
- package/dist/constants/themeFonts.js.map +1 -0
- package/dist/fields/ColorPickerField.d.ts +3 -0
- package/dist/fields/ColorPickerField.d.ts.map +1 -0
- package/dist/fields/ColorPickerField.js +153 -0
- package/dist/fields/ColorPickerField.js.map +1 -0
- package/dist/fields/RadiusField.d.ts +3 -0
- package/dist/fields/RadiusField.d.ts.map +1 -0
- package/dist/fields/RadiusField.js +91 -0
- package/dist/fields/RadiusField.js.map +1 -0
- package/dist/fields/ThemeColorPickerField.d.ts +5 -0
- package/dist/fields/ThemeColorPickerField.d.ts.map +1 -0
- package/dist/fields/ThemeColorPickerField.js +84 -0
- package/dist/fields/ThemeColorPickerField.js.map +1 -0
- package/dist/fields/ThemePreviewField.d.ts +3 -0
- package/dist/fields/ThemePreviewField.d.ts.map +1 -0
- package/dist/fields/ThemePreviewField.js +336 -0
- package/dist/fields/ThemePreviewField.js.map +1 -0
- package/dist/fields/ThemeTokenSelectField.d.ts +3 -0
- package/dist/fields/ThemeTokenSelectField.d.ts.map +1 -0
- package/dist/fields/ThemeTokenSelectField.js +128 -0
- package/dist/fields/ThemeTokenSelectField.js.map +1 -0
- package/dist/fields/colorModeFields.d.ts +10 -0
- package/dist/fields/colorModeFields.d.ts.map +1 -0
- package/dist/fields/colorModeFields.js +241 -0
- package/dist/fields/colorModeFields.js.map +1 -0
- package/dist/fields/themeConfigurationField.d.ts +17 -0
- package/dist/fields/themeConfigurationField.d.ts.map +1 -0
- package/dist/fields/themeConfigurationField.js +389 -0
- package/dist/fields/themeConfigurationField.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -0
- package/dist/payload-types.d.ts +83 -0
- package/dist/payload-types.d.ts.map +1 -0
- package/dist/payload-types.js +6 -0
- package/dist/payload-types.js.map +1 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +2 -0
- package/dist/plugin.js.map +1 -0
- package/dist/presets.d.ts +43 -0
- package/dist/presets.d.ts.map +1 -0
- package/dist/presets.js +580 -0
- package/dist/presets.js.map +1 -0
- package/dist/providers/Theme/themeConfig.d.ts +4 -0
- package/dist/providers/Theme/themeConfig.d.ts.map +1 -0
- package/dist/providers/Theme/themeConfig.js +66 -0
- package/dist/providers/Theme/themeConfig.js.map +1 -0
- package/dist/providers/Theme/types.d.ts +16 -0
- package/dist/providers/Theme/types.d.ts.map +1 -0
- package/dist/providers/Theme/types.js +14 -0
- package/dist/providers/Theme/types.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +3 -0
- package/dist/server.js.map +1 -0
- package/dist/types.d.ts +36 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/resolveThemeConfiguration.d.ts +40 -0
- package/dist/utils/resolveThemeConfiguration.d.ts.map +1 -0
- package/dist/utils/resolveThemeConfiguration.js +148 -0
- package/dist/utils/resolveThemeConfiguration.js.map +1 -0
- package/dist/utils/themeAssets.d.ts +6 -0
- package/dist/utils/themeAssets.d.ts.map +1 -0
- package/dist/utils/themeAssets.js +67 -0
- package/dist/utils/themeAssets.js.map +1 -0
- package/dist/utils/themeColors.d.ts +36 -0
- package/dist/utils/themeColors.d.ts.map +1 -0
- package/dist/utils/themeColors.js +111 -0
- package/dist/utils/themeColors.js.map +1 -0
- package/dist/utils/themeUtils.d.ts +16 -0
- package/dist/utils/themeUtils.d.ts.map +1 -0
- package/dist/utils/themeUtils.js +260 -0
- package/dist/utils/themeUtils.js.map +1 -0
- package/package.json +68 -0
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Theme Configuration Plugin for Payload CMS
|
|
2
|
+
|
|
3
|
+
A flexible theme configuration plugin for Payload CMS v3 that allows you to manage theme settings through the admin UI.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎨 **Theme Management** - Configure primary and secondary colors
|
|
8
|
+
- 🔤 **Typography Control** - Set custom font families
|
|
9
|
+
- 📐 **Layout Settings** - Adjust header height and other layout properties
|
|
10
|
+
- 🌓 **Theme Switcher** - Optional theme switching capability (light/dark/auto)
|
|
11
|
+
- ⚙️ **Configurable** - Exclude specific collections or globals as needed
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @payloadcms-plugins/theme-management
|
|
17
|
+
# or
|
|
18
|
+
yarn add @payloadcms-plugins/theme-management
|
|
19
|
+
# or
|
|
20
|
+
pnpm add @payloadcms-plugins/theme-management
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Add the plugin to your Payload config:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { buildConfig } from 'payload';
|
|
29
|
+
import { ThemeConfigurationPlugin } from '@payloadcms-plugins/theme-management';
|
|
30
|
+
|
|
31
|
+
export default buildConfig({
|
|
32
|
+
// ... other config
|
|
33
|
+
plugins: [
|
|
34
|
+
ThemeConfigurationPlugin({
|
|
35
|
+
enableThemeSwitcher: true,
|
|
36
|
+
defaultTheme: 'auto',
|
|
37
|
+
excludedCollections: [], // Collections to exclude
|
|
38
|
+
excludedGlobals: [], // Globals to exclude
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Configuration Options
|
|
45
|
+
|
|
46
|
+
### `ThemeConfigurationPluginConfig`
|
|
47
|
+
|
|
48
|
+
| Option | Type | Default | Description |
|
|
49
|
+
|--------|------|---------|-------------|
|
|
50
|
+
| `excludedCollections` | `string[]` | `[]` | Array of collection slugs to exclude |
|
|
51
|
+
| `excludedGlobals` | `string[]` | `[]` | Array of global slugs to exclude |
|
|
52
|
+
| `enableThemeSwitcher` | `boolean` | `true` | Enable theme switcher in admin UI |
|
|
53
|
+
| `defaultTheme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Default theme |
|
|
54
|
+
|
|
55
|
+
## Theme Configuration Fields
|
|
56
|
+
|
|
57
|
+
The plugin adds a global called `theme-management` with the following fields:
|
|
58
|
+
|
|
59
|
+
- **Primary Color** - Main theme color (e.g., #3B82F6)
|
|
60
|
+
- **Secondary Color** - Secondary theme color (e.g., #10B981)
|
|
61
|
+
- **Font Family** - Primary font family for the site
|
|
62
|
+
- **Header Height** - Height of the site header in pixels
|
|
63
|
+
|
|
64
|
+
## Accessing Theme Configuration
|
|
65
|
+
|
|
66
|
+
You can access the theme configuration in your application:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
const payload = await getPayloadClient();
|
|
70
|
+
|
|
71
|
+
const themeConfig = await payload.findGlobal({
|
|
72
|
+
slug: 'theme-management',
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
console.log(themeConfig.primaryColor); // e.g., "#3B82F6"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Development
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Install dependencies
|
|
82
|
+
pnpm install
|
|
83
|
+
|
|
84
|
+
# Build the plugin
|
|
85
|
+
pnpm build
|
|
86
|
+
|
|
87
|
+
# Watch mode for development
|
|
88
|
+
pnpm dev
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
Apache-2.0
|
|
94
|
+
|
|
95
|
+
## Contributing
|
|
96
|
+
|
|
97
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SiteSetting } from '@/payload-types';
|
|
2
|
+
interface ServerThemeInjectorProps {
|
|
3
|
+
siteSettings: SiteSetting | null;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Server-side theme CSS injector to prevent FOUC
|
|
7
|
+
* This component injects critical theme CSS directly into the HTML head during SSR
|
|
8
|
+
*/
|
|
9
|
+
export declare function ServerThemeInjector({ siteSettings }: Readonly<ServerThemeInjectorProps>): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ServerThemeInjector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerThemeInjector.d.ts","sourceRoot":"","sources":["../../src/components/ServerThemeInjector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAalD,UAAU,wBAAwB;IAChC,YAAY,EAAE,WAAW,GAAG,IAAI,CAAA;CACjC;AAMD;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,YAAY,EAAE,EAAE,QAAQ,CAAC,wBAAwB,CAAC,oDA2F7F"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getBorderRadiusConfig } from '@/providers/Theme/themeConfig';
|
|
3
|
+
import { resolveThemeConfiguration } from '../utils/resolveThemeConfiguration';
|
|
4
|
+
import { createFallbackCriticalCSS, getThemeCriticalCSS, getThemeCSSPath, } from '../utils/themeAssets';
|
|
5
|
+
import { generateThemeColorsCss } from '../utils/themeColors';
|
|
6
|
+
import { generateThemeCSS } from '../utils/themeUtils';
|
|
7
|
+
/**
|
|
8
|
+
* Server-side theme CSS injector to prevent FOUC
|
|
9
|
+
* This component injects critical theme CSS directly into the HTML head during SSR
|
|
10
|
+
*/
|
|
11
|
+
export async function ServerThemeInjector({ siteSettings }) {
|
|
12
|
+
const resolvedConfiguration = resolveThemeConfiguration(siteSettings?.themeConfiguration);
|
|
13
|
+
const { theme, borderRadius, customCSS, lightMode, darkMode, fontScale, spacing, animationLevel, allowColorModeToggle, colorMode, typography, } = resolvedConfiguration;
|
|
14
|
+
const baseThemeConfiguration = { ...(siteSettings?.themeConfiguration ?? {}) };
|
|
15
|
+
if ('typography' in baseThemeConfiguration) {
|
|
16
|
+
delete baseThemeConfiguration.typography;
|
|
17
|
+
}
|
|
18
|
+
const normalizedThemeConfiguration = {
|
|
19
|
+
...baseThemeConfiguration,
|
|
20
|
+
theme,
|
|
21
|
+
colorMode,
|
|
22
|
+
allowColorModeToggle,
|
|
23
|
+
borderRadius,
|
|
24
|
+
fontScale,
|
|
25
|
+
spacing,
|
|
26
|
+
animationLevel,
|
|
27
|
+
customCSS: customCSS ?? undefined,
|
|
28
|
+
lightMode,
|
|
29
|
+
darkMode,
|
|
30
|
+
typography: typography ?? undefined,
|
|
31
|
+
};
|
|
32
|
+
let criticalCSS = await getThemeCriticalCSS(theme);
|
|
33
|
+
criticalCSS ?? (criticalCSS = createFallbackCriticalCSS(theme));
|
|
34
|
+
const borderRadiusMap = {
|
|
35
|
+
none: 'none',
|
|
36
|
+
small: 'small',
|
|
37
|
+
medium: 'medium',
|
|
38
|
+
large: 'large',
|
|
39
|
+
full: 'full',
|
|
40
|
+
xl: 'xl',
|
|
41
|
+
};
|
|
42
|
+
const mappedBorderRadius = borderRadiusMap[borderRadius ?? 'medium'] || 'medium';
|
|
43
|
+
const borderRadiusConfig = getBorderRadiusConfig(mappedBorderRadius);
|
|
44
|
+
const cssRecord = typeof borderRadiusConfig?.css === 'string'
|
|
45
|
+
? { '--radius-default': borderRadiusConfig.css }
|
|
46
|
+
: borderRadiusConfig?.css ?? {};
|
|
47
|
+
const borderRadiusCSS = Object.entries(cssRecord)
|
|
48
|
+
.map(([property, value]) => ` ${property}: ${value};`)
|
|
49
|
+
.join('\n');
|
|
50
|
+
const borderRadiusBlock = borderRadiusCSS
|
|
51
|
+
? `:root {
|
|
52
|
+
${borderRadiusCSS}
|
|
53
|
+
}`
|
|
54
|
+
: '';
|
|
55
|
+
const themeConfigurationCSS = generateThemeCSS(normalizedThemeConfiguration);
|
|
56
|
+
const colorModesCSS = generateThemeColorsCss({ themeName: theme, lightMode, darkMode });
|
|
57
|
+
const customCSSBlock = typeof customCSS === 'string' ? customCSS.trim() : '';
|
|
58
|
+
const combinedCSS = [
|
|
59
|
+
criticalCSS,
|
|
60
|
+
borderRadiusBlock,
|
|
61
|
+
themeConfigurationCSS,
|
|
62
|
+
colorModesCSS,
|
|
63
|
+
customCSSBlock,
|
|
64
|
+
]
|
|
65
|
+
.filter((block) => Boolean(block?.trim?.().length))
|
|
66
|
+
.join('\n\n');
|
|
67
|
+
const themeCSSPath = getThemeCSSPath(theme);
|
|
68
|
+
console.log('<<< themeCSSPath >>>', themeCSSPath, '<<< combinedCSS', combinedCSS);
|
|
69
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { id: "theme-critical-css", dangerouslySetInnerHTML: {
|
|
70
|
+
__html: combinedCSS,
|
|
71
|
+
} }), _jsx("link", { rel: "preload", href: themeCSSPath, as: "style" }), _jsx("link", { rel: "stylesheet", href: themeCSSPath })] }));
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=ServerThemeInjector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerThemeInjector.js","sourceRoot":"","sources":["../../src/components/ServerThemeInjector.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAGrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAA;AAC9E,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAUtD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EAAE,YAAY,EAAsC;IAC5F,MAAM,qBAAqB,GAAG,yBAAyB,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAA;IACzF,MAAM,EACJ,KAAK,EACL,YAAY,EACZ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,UAAU,GACX,GAAG,qBAAqB,CAAA;IAEzB,MAAM,sBAAsB,GAAG,EAAE,GAAG,CAAC,YAAY,EAAE,kBAAkB,IAAI,EAAE,CAAC,EAAE,CAAA;IAC9E,IAAI,YAAY,IAAI,sBAAsB,EAAE,CAAC;QAC3C,OAAQ,sBAAkD,CAAC,UAAU,CAAA;IACvE,CAAC;IAED,MAAM,4BAA4B,GAA8B;QAC9D,GAAG,sBAAsB;QACzB,KAAK;QACL,SAAS;QACT,oBAAoB;QACpB,YAAY;QACZ,SAAS;QACT,OAAO;QACP,cAAc;QACd,SAAS,EAAE,SAAS,IAAI,SAAS;QACjC,SAAS;QACT,QAAQ;QACR,UAAU,EAAE,UAAU,IAAI,SAAS;KACpC,CAAA;IAED,IAAI,WAAW,GAAG,MAAM,mBAAmB,CAAC,KAAoB,CAAC,CAAA;IACjE,WAAW,KAAX,WAAW,GAAK,yBAAyB,CAAC,KAAoB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AC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;SAClD,IAAI,CAAC,MAAM,CAAC,CAAA;IAEf,MAAM,YAAY,GAAG,eAAe,CAAC,KAAoB,CAAC,CAAA;IAC1D,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAA;IACjF,OAAO,CACL,8BACE,gBACE,EAAE,EAAC,oBAAoB,EACvB,uBAAuB,EAAE;oBACvB,MAAM,EAAE,WAAW;iBACpB,GACD,EACF,eAAM,GAAG,EAAC,SAAS,EAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC,OAAO,GAAG,EACrD,eAAM,GAAG,EAAC,YAAY,EAAC,IAAI,EAAE,YAAY,GAAI,IAC5C,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemePreview.d.ts","sourceRoot":"","sources":["../../src/components/ThemePreview.tsx"],"names":[],"mappings":"AAuBA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA8PnC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useField } from '@payloadcms/ui';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { themeIsValid } from '@/providers/Theme/types';
|
|
6
|
+
import { defaultThemePresets } from '../presets';
|
|
7
|
+
const DEFAULT_THEME_KEY = 'cool';
|
|
8
|
+
const basePresetMap = defaultThemePresets.reduce((accumulator, preset) => {
|
|
9
|
+
accumulator[preset.name] = preset;
|
|
10
|
+
return accumulator;
|
|
11
|
+
}, {});
|
|
12
|
+
const fallbackPreset = basePresetMap[DEFAULT_THEME_KEY] ?? defaultThemePresets[0];
|
|
13
|
+
const fallbackLightMode = fallbackPreset?.lightMode ?? {
|
|
14
|
+
primary: '#3b82f6',
|
|
15
|
+
accent: '#06b6d4',
|
|
16
|
+
background: '#ffffff',
|
|
17
|
+
foreground: '#1f2937',
|
|
18
|
+
};
|
|
19
|
+
export default function ThemePreview() {
|
|
20
|
+
// Get individual field values using useField hooks
|
|
21
|
+
const { value: selectedTheme } = useField({ path: 'themeConfiguration.theme' });
|
|
22
|
+
const { value: primaryColor } = useField({
|
|
23
|
+
path: 'themeConfiguration.customization.primaryColor',
|
|
24
|
+
});
|
|
25
|
+
const { value: accentColor } = useField({
|
|
26
|
+
path: 'themeConfiguration.customization.accentColor',
|
|
27
|
+
});
|
|
28
|
+
const { value: backgroundColor } = useField({
|
|
29
|
+
path: 'themeConfiguration.customization.backgroundColor',
|
|
30
|
+
});
|
|
31
|
+
const { value: textColor } = useField({
|
|
32
|
+
path: 'themeConfiguration.customization.textColor',
|
|
33
|
+
});
|
|
34
|
+
// Determine current theme and if overrides are active
|
|
35
|
+
const currentTheme = themeIsValid(selectedTheme)
|
|
36
|
+
? selectedTheme
|
|
37
|
+
: (fallbackPreset?.name ?? 'cool');
|
|
38
|
+
const hasOverrides = Boolean(primaryColor || accentColor || backgroundColor || textColor);
|
|
39
|
+
const themeColors = useMemo(() => {
|
|
40
|
+
const preset = basePresetMap[currentTheme] ?? fallbackPreset;
|
|
41
|
+
const lightMode = preset?.lightMode ?? fallbackLightMode;
|
|
42
|
+
return {
|
|
43
|
+
primary: lightMode?.primary ?? fallbackLightMode.primary,
|
|
44
|
+
accent: lightMode?.accent ??
|
|
45
|
+
lightMode?.secondary ??
|
|
46
|
+
fallbackLightMode.accent ??
|
|
47
|
+
fallbackLightMode.primary,
|
|
48
|
+
background: lightMode?.background ?? fallbackLightMode.background,
|
|
49
|
+
text: lightMode?.foreground ?? fallbackLightMode.foreground,
|
|
50
|
+
};
|
|
51
|
+
}, [currentTheme]);
|
|
52
|
+
const currentColors = useMemo(() => ({
|
|
53
|
+
primary: primaryColor || themeColors.primary,
|
|
54
|
+
accent: accentColor || themeColors.accent,
|
|
55
|
+
background: backgroundColor || themeColors.background,
|
|
56
|
+
text: textColor || themeColors.text,
|
|
57
|
+
}), [primaryColor, accentColor, backgroundColor, textColor, themeColors]);
|
|
58
|
+
return (_jsxs("div", { className: "theme-preview", style: { marginTop: '20px' }, children: [_jsx("div", { style: {
|
|
59
|
+
fontSize: '16px',
|
|
60
|
+
fontWeight: '600',
|
|
61
|
+
marginBottom: '16px',
|
|
62
|
+
color: '#374151',
|
|
63
|
+
}, children: "\uD83C\uDFA8 Live Theme Preview" }), _jsxs("div", { className: "preview-container", style: {
|
|
64
|
+
border: '2px solid #e5e7eb',
|
|
65
|
+
borderRadius: '12px',
|
|
66
|
+
overflow: 'hidden',
|
|
67
|
+
backgroundColor: currentColors.background,
|
|
68
|
+
color: currentColors.text,
|
|
69
|
+
minHeight: '300px',
|
|
70
|
+
}, children: [_jsxs("div", { style: {
|
|
71
|
+
backgroundColor: currentColors.primary,
|
|
72
|
+
color: currentColors.background,
|
|
73
|
+
padding: '16px 24px',
|
|
74
|
+
display: 'flex',
|
|
75
|
+
justifyContent: 'space-between',
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
}, children: [_jsx("div", { style: { fontSize: '20px', fontWeight: '700' }, children: "Your Website" }), _jsxs("nav", { style: { display: 'flex', gap: '24px', fontSize: '14px' }, children: [_jsx("span", { children: "Home" }), _jsx("span", { children: "About" }), _jsx("span", { children: "Services" }), _jsx("span", { children: "Contact" })] })] }), _jsxs("div", { style: { padding: '32px 24px' }, children: [_jsx("h1", { style: {
|
|
78
|
+
fontSize: '32px',
|
|
79
|
+
fontWeight: '800',
|
|
80
|
+
marginBottom: '16px',
|
|
81
|
+
color: currentColors.text,
|
|
82
|
+
}, children: "Welcome to Your Site" }), _jsx("p", { style: {
|
|
83
|
+
fontSize: '16px',
|
|
84
|
+
lineHeight: '1.6',
|
|
85
|
+
marginBottom: '24px',
|
|
86
|
+
color: currentColors.text,
|
|
87
|
+
opacity: 0.8,
|
|
88
|
+
}, children: "This is how your content will look with the selected theme. The colors and styling will be applied across your entire website." }), _jsxs("div", { style: { display: 'flex', gap: '12px', marginBottom: '32px' }, children: [_jsx("button", { style: {
|
|
89
|
+
backgroundColor: currentColors.primary,
|
|
90
|
+
color: currentColors.background,
|
|
91
|
+
border: 'none',
|
|
92
|
+
padding: '12px 24px',
|
|
93
|
+
borderRadius: '6px',
|
|
94
|
+
fontSize: '14px',
|
|
95
|
+
fontWeight: '600',
|
|
96
|
+
cursor: 'pointer',
|
|
97
|
+
}, children: "Primary Button" }), _jsx("button", { style: {
|
|
98
|
+
backgroundColor: 'transparent',
|
|
99
|
+
color: currentColors.primary,
|
|
100
|
+
border: `2px solid ${currentColors.primary}`,
|
|
101
|
+
padding: '10px 24px',
|
|
102
|
+
borderRadius: '6px',
|
|
103
|
+
fontSize: '14px',
|
|
104
|
+
fontWeight: '600',
|
|
105
|
+
cursor: 'pointer',
|
|
106
|
+
}, children: "Secondary Button" })] }), _jsx("div", { style: {
|
|
107
|
+
backgroundColor: currentColors.text,
|
|
108
|
+
color: currentColors.background,
|
|
109
|
+
padding: '24px',
|
|
110
|
+
borderRadius: '8px',
|
|
111
|
+
opacity: 0.05,
|
|
112
|
+
marginBottom: '16px',
|
|
113
|
+
} }), _jsxs("div", { style: {
|
|
114
|
+
border: `1px solid ${currentColors.text}`,
|
|
115
|
+
padding: '20px',
|
|
116
|
+
borderRadius: '8px',
|
|
117
|
+
opacity: 0.1,
|
|
118
|
+
}, children: [_jsx("h3", { style: {
|
|
119
|
+
fontSize: '18px',
|
|
120
|
+
fontWeight: '600',
|
|
121
|
+
marginBottom: '12px',
|
|
122
|
+
color: currentColors.text,
|
|
123
|
+
}, children: "Sample Card" }), _jsx("p", { style: {
|
|
124
|
+
fontSize: '14px',
|
|
125
|
+
color: currentColors.text,
|
|
126
|
+
opacity: 0.7,
|
|
127
|
+
}, children: "This shows how cards and content blocks will appear." })] })] }), _jsx("div", { style: {
|
|
128
|
+
backgroundColor: currentColors.accent,
|
|
129
|
+
color: currentColors.background,
|
|
130
|
+
padding: '16px 24px',
|
|
131
|
+
textAlign: 'center',
|
|
132
|
+
fontSize: '14px',
|
|
133
|
+
marginTop: 'auto',
|
|
134
|
+
}, children: "\u00A9 2025 Your Website. Powered by PayloadCMS." })] }), _jsxs("div", { style: {
|
|
135
|
+
marginTop: '12px',
|
|
136
|
+
fontSize: '12px',
|
|
137
|
+
color: '#6b7280',
|
|
138
|
+
display: 'grid',
|
|
139
|
+
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
140
|
+
gap: '8px',
|
|
141
|
+
}, children: [_jsxs("div", { children: [_jsx("strong", { children: "Active Theme:" }), " ", currentTheme] }), _jsxs("div", { children: [_jsx("strong", { children: "Primary:" }), " ", currentColors.primary] }), _jsxs("div", { children: [_jsx("strong", { children: "Accent:" }), " ", currentColors.accent] }), _jsxs("div", { children: [_jsx("strong", { children: "Background:" }), " ", currentColors.background] })] }), hasOverrides && (_jsxs("div", { style: {
|
|
142
|
+
marginTop: '8px',
|
|
143
|
+
padding: '8px 12px',
|
|
144
|
+
backgroundColor: '#fef3c7',
|
|
145
|
+
borderRadius: '6px',
|
|
146
|
+
fontSize: '11px',
|
|
147
|
+
color: '#92400e',
|
|
148
|
+
display: 'flex',
|
|
149
|
+
alignItems: 'center',
|
|
150
|
+
gap: '6px',
|
|
151
|
+
}, children: [_jsx("span", { children: "\u26A1" }), _jsxs("span", { children: [_jsx("strong", { children: "Custom colors applied" }), " - overriding theme defaults"] })] }))] }));
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=ThemePreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemePreview.js","sourceRoot":"","sources":["../../src/components/ThemePreview.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,E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AAK,EAAE;4BACL,eAAe,EAAE,aAAa,CAAC,MAAM;4BACrC,KAAK,EAAE,aAAa,CAAC,UAAU;4BAC/B,OAAO,EAAE,WAAW;4BACpB,SAAS,EAAE,QAAQ;4BACnB,QAAQ,EAAE,MAAM;4BAChB,SAAS,EAAE,MAAM;yBAClB,iEAGG,IACF,EAGN,eACE,KAAK,EAAE;oBACL,SAAS,EAAE,MAAM;oBACjB,QAAQ,EAAE,MAAM;oBAChB,KAAK,EAAE,SAAS;oBAChB,OAAO,EAAE,MAAM;oBACf,mBAAmB,EAAE,gBAAgB;oBACrC,GAAG,EAAE,KAAK;iBACX,aAED,0BACE,6CAA8B,OAAE,YAAY,IACxC,EACN,0BACE,wCAAyB,OAAE,aAAa,CAAC,OAAO,IAC5C,EACN,0BACE,uCAAwB,OAAE,aAAa,CAAC,MAAM,IAC1C,EACN,0BACE,2CAA4B,OAAE,aAAa,CAAC,UAAU,IAClD,IACF,EAGL,YAAY,IAAI,CACf,eACE,KAAK,EAAE;oBACL,SAAS,EAAE,KAAK;oBAChB,OAAO,EAAE,UAAU;oBACnB,eAAe,EAAE,SAAS;oBAC1B,YAAY,EAAE,KAAK;oBACnB,QAAQ,EAAE,MAAM;oBAChB,KAAK,EAAE,SAAS;oBAChB,OAAO,EAAE,MAAM;oBACf,UAAU,EAAE,QAAQ;oBACpB,GAAG,EAAE,KAAK;iBACX,aAED,oCAAc,EACd,2BACE,qDAAsC,oCACjC,IACH,CACP,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TypographySelection {
|
|
2
|
+
bodyFont?: string | null;
|
|
3
|
+
headingFont?: string | null;
|
|
4
|
+
bodyFontCustom?: string | null;
|
|
5
|
+
headingFontCustom?: string | null;
|
|
6
|
+
baseFontSize?: string | null;
|
|
7
|
+
lineHeight?: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface ResolvedTypographyPreview {
|
|
10
|
+
bodyFont: string;
|
|
11
|
+
headingFont: string;
|
|
12
|
+
baseFontSize: string;
|
|
13
|
+
lineHeight: string;
|
|
14
|
+
bodyLabel: string;
|
|
15
|
+
headingLabel: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function resolveTypographyPreview(selection: TypographySelection | null | undefined, themeName?: string): ResolvedTypographyPreview;
|
|
18
|
+
//# sourceMappingURL=typographyPreviewUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typographyPreviewUtils.d.ts","sourceRoot":"","sources":["../../src/components/typographyPreviewUtils.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;CACrB;AAyED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,EACjD,SAAS,CAAC,EAAE,MAAM,GACjB,yBAAyB,CAmC3B"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { BODY_FONT_OPTIONS, FONT_VALUE_TO_CSS, HEADING_FONT_OPTIONS } from '@/constants/themeFonts';
|
|
2
|
+
import { defaultThemePresets } from '../presets';
|
|
3
|
+
const FALLBACK_THEME = defaultThemePresets[0]?.name ?? 'cool';
|
|
4
|
+
const fallbackPreset = defaultThemePresets.find((preset) => preset.name === FALLBACK_THEME) ?? defaultThemePresets[0];
|
|
5
|
+
const FONT_VAR_FALLBACK = {
|
|
6
|
+
'var(--font-geist-sans)': '"Geist Sans", system-ui, sans-serif',
|
|
7
|
+
'var(--font-geist-mono)': '"Geist Mono", SFMono-Regular, ui-monospace, monospace',
|
|
8
|
+
'var(--font-inter)': '"Inter", system-ui, sans-serif',
|
|
9
|
+
'var(--font-outfit)': '"Outfit", system-ui, sans-serif',
|
|
10
|
+
'var(--font-playfair)': '"Playfair Display", "Times New Roman", serif',
|
|
11
|
+
'var(--font-lora)': '"Lora", "Times New Roman", serif',
|
|
12
|
+
'var(--font-manrope)': '"Manrope", system-ui, sans-serif',
|
|
13
|
+
'var(--font-urbanist)': '"Urbanist", system-ui, sans-serif',
|
|
14
|
+
};
|
|
15
|
+
function withFallback(fontFamily, fallback) {
|
|
16
|
+
if (!fontFamily)
|
|
17
|
+
return fallback;
|
|
18
|
+
if (fontFamily.startsWith('var(')) {
|
|
19
|
+
const mappedFallback = FONT_VAR_FALLBACK[fontFamily] ?? fallback;
|
|
20
|
+
return `${fontFamily}, ${mappedFallback}`;
|
|
21
|
+
}
|
|
22
|
+
return fontFamily;
|
|
23
|
+
}
|
|
24
|
+
function getPresetTypography(themeName) {
|
|
25
|
+
const preset = defaultThemePresets.find((item) => item.name === themeName) ?? fallbackPreset;
|
|
26
|
+
return preset?.typography;
|
|
27
|
+
}
|
|
28
|
+
function resolveFontFamily(value, customValue, fallback) {
|
|
29
|
+
if (!value || value === 'preset') {
|
|
30
|
+
return withFallback(fallback, fallbackPreset?.typography?.fontFamily ?? 'system-ui, sans-serif');
|
|
31
|
+
}
|
|
32
|
+
if (value === 'custom') {
|
|
33
|
+
if (customValue && customValue.trim().length > 0) {
|
|
34
|
+
return customValue.trim();
|
|
35
|
+
}
|
|
36
|
+
return withFallback(fallback, fallbackPreset?.typography?.fontFamily ?? 'system-ui, sans-serif');
|
|
37
|
+
}
|
|
38
|
+
const preconfigured = FONT_VALUE_TO_CSS[value];
|
|
39
|
+
if (preconfigured) {
|
|
40
|
+
return withFallback(preconfigured, fallbackPreset?.typography?.fontFamily ?? 'system-ui, sans-serif');
|
|
41
|
+
}
|
|
42
|
+
return withFallback(fallback, fallbackPreset?.typography?.fontFamily ?? 'system-ui, sans-serif');
|
|
43
|
+
}
|
|
44
|
+
function resolveOptionLabel(options, value, locale = 'en') {
|
|
45
|
+
const option = options.find((item) => item.value === value);
|
|
46
|
+
if (!option)
|
|
47
|
+
return value ?? '';
|
|
48
|
+
if (typeof option.label === 'string') {
|
|
49
|
+
return option.label;
|
|
50
|
+
}
|
|
51
|
+
return option.label?.[locale] ?? Object.values(option.label)[0] ?? option.value;
|
|
52
|
+
}
|
|
53
|
+
export function resolveTypographyPreview(selection, themeName) {
|
|
54
|
+
const presetTypography = getPresetTypography(themeName);
|
|
55
|
+
const fallbackBody = presetTypography?.fontFamily ?? 'system-ui, sans-serif';
|
|
56
|
+
const fallbackHeading = presetTypography?.headingFamily ?? fallbackBody;
|
|
57
|
+
const fallbackSize = presetTypography?.baseFontSize ?? '16px';
|
|
58
|
+
const fallbackLineHeight = presetTypography?.lineHeight ?? '1.6';
|
|
59
|
+
const bodyFontValue = selection?.bodyFont ?? 'preset';
|
|
60
|
+
const headingFontValue = selection?.headingFont ?? 'preset';
|
|
61
|
+
const bodyFontCustom = selection?.bodyFontCustom ?? undefined;
|
|
62
|
+
const headingFontCustom = selection?.headingFontCustom ?? undefined;
|
|
63
|
+
const resolvedBodyFont = resolveFontFamily(bodyFontValue, bodyFontCustom, fallbackBody);
|
|
64
|
+
const resolvedHeadingFont = resolveFontFamily(headingFontValue, headingFontCustom, fallbackHeading);
|
|
65
|
+
const baseFontSize = selection?.baseFontSize && selection.baseFontSize !== 'preset'
|
|
66
|
+
? selection.baseFontSize
|
|
67
|
+
: fallbackSize;
|
|
68
|
+
const lineHeight = selection?.lineHeight && selection.lineHeight !== 'preset'
|
|
69
|
+
? selection.lineHeight
|
|
70
|
+
: fallbackLineHeight;
|
|
71
|
+
return {
|
|
72
|
+
bodyFont: resolvedBodyFont,
|
|
73
|
+
headingFont: resolvedHeadingFont,
|
|
74
|
+
baseFontSize,
|
|
75
|
+
lineHeight,
|
|
76
|
+
bodyLabel: resolveOptionLabel(BODY_FONT_OPTIONS, bodyFontValue),
|
|
77
|
+
headingLabel: resolveOptionLabel(HEADING_FONT_OPTIONS, headingFontValue),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=typographyPreviewUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typographyPreviewUtils.js","sourceRoot":"","sources":["../../src/components/typographyPreviewUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AACnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAoBhD,MAAM,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,MAAM,CAAA;AAC7D,MAAM,cAAc,GAClB,mBAAmB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAA;AAEhG,MAAM,iBAAiB,GAA2B;IAChD,wBAAwB,EAAE,qCAAqC;IAC/D,wBAAwB,EAAE,uDAAuD;IACjF,mBAAmB,EAAE,gCAAgC;IACrD,oBAAoB,EAAE,iCAAiC;IACvD,sBAAsB,EAAE,8CAA8C;IACtE,kBAAkB,EAAE,kCAAkC;IACtD,qBAAqB,EAAE,kCAAkC;IACzD,sBAAsB,EAAE,mCAAmC;CAC5D,CAAA;AAED,SAAS,YAAY,CAAC,UAAkB,EAAE,QAAgB;IACxD,IAAI,CAAC,UAAU;QAAE,OAAO,QAAQ,CAAA;IAE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YAAY,CAAC,CAAA;IACvF,MAAM,mBAAmB,GAAG,iBAAiB,CAC3C,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,CAChB,CAAA;IAED,MAAM,YAAY,GAChB,SAAS,EAAE,YAAY,IAAI,SAAS,CAAC,YAAY,KAAK,QAAQ;QAC5D,CAAC,CAAC,SAAS,CAAC,YAAY;QACxB,CAAC,CAAC,YAAY,CAAA;IAClB,MAAM,UAAU,GACd,SAAS,EAAE,UAAU,IAAI,SAAS,CAAC,UAAU,KAAK,QAAQ;QACxD,CAAC,CAAC,SAAS,CAAC,UAAU;QACtB,CAAC,CAAC,kBAAkB,CAAA;IAExB,OAAO;QACL,QAAQ,EAAE,gBAAgB;QAC1B,WAAW,EAAE,mBAAmB;QAChC,YAAY;QACZ,UAAU;QACV,SAAS,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,aAAa,CAAC;QAC/D,YAAY,EAAE,kBAAkB,CAAC,oBAAoB,EAAE,gBAAgB,CAAC;KACzE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare const BODY_FONT_OPTIONS: readonly [{
|
|
2
|
+
readonly label: "System";
|
|
3
|
+
readonly value: "system-ui";
|
|
4
|
+
}, {
|
|
5
|
+
readonly label: "Inter";
|
|
6
|
+
readonly value: "Inter";
|
|
7
|
+
}, {
|
|
8
|
+
readonly label: "Roboto";
|
|
9
|
+
readonly value: "Roboto";
|
|
10
|
+
}, {
|
|
11
|
+
readonly label: "Open Sans";
|
|
12
|
+
readonly value: "Open Sans";
|
|
13
|
+
}, {
|
|
14
|
+
readonly label: "Lato";
|
|
15
|
+
readonly value: "Lato";
|
|
16
|
+
}, {
|
|
17
|
+
readonly label: "Montserrat";
|
|
18
|
+
readonly value: "Montserrat";
|
|
19
|
+
}, {
|
|
20
|
+
readonly label: "Poppins";
|
|
21
|
+
readonly value: "Poppins";
|
|
22
|
+
}];
|
|
23
|
+
export declare const HEADING_FONT_OPTIONS: readonly [{
|
|
24
|
+
readonly label: "System";
|
|
25
|
+
readonly value: "system-ui";
|
|
26
|
+
}, {
|
|
27
|
+
readonly label: "Inter";
|
|
28
|
+
readonly value: "Inter";
|
|
29
|
+
}, {
|
|
30
|
+
readonly label: "Playfair Display";
|
|
31
|
+
readonly value: "Playfair Display";
|
|
32
|
+
}, {
|
|
33
|
+
readonly label: "Merriweather";
|
|
34
|
+
readonly value: "Merriweather";
|
|
35
|
+
}, {
|
|
36
|
+
readonly label: "Montserrat";
|
|
37
|
+
readonly value: "Montserrat";
|
|
38
|
+
}, {
|
|
39
|
+
readonly label: "Raleway";
|
|
40
|
+
readonly value: "Raleway";
|
|
41
|
+
}];
|
|
42
|
+
export declare const BASE_FONT_SIZE_OPTIONS: readonly [{
|
|
43
|
+
readonly label: "14px";
|
|
44
|
+
readonly value: "14";
|
|
45
|
+
}, {
|
|
46
|
+
readonly label: "15px";
|
|
47
|
+
readonly value: "15";
|
|
48
|
+
}, {
|
|
49
|
+
readonly label: "16px";
|
|
50
|
+
readonly value: "16";
|
|
51
|
+
}, {
|
|
52
|
+
readonly label: "17px";
|
|
53
|
+
readonly value: "17";
|
|
54
|
+
}, {
|
|
55
|
+
readonly label: "18px";
|
|
56
|
+
readonly value: "18";
|
|
57
|
+
}];
|
|
58
|
+
export declare const LINE_HEIGHT_OPTIONS: readonly [{
|
|
59
|
+
readonly label: "1.4";
|
|
60
|
+
readonly value: "1.4";
|
|
61
|
+
}, {
|
|
62
|
+
readonly label: "1.5";
|
|
63
|
+
readonly value: "1.5";
|
|
64
|
+
}, {
|
|
65
|
+
readonly label: "1.6";
|
|
66
|
+
readonly value: "1.6";
|
|
67
|
+
}, {
|
|
68
|
+
readonly label: "1.7";
|
|
69
|
+
readonly value: "1.7";
|
|
70
|
+
}, {
|
|
71
|
+
readonly label: "1.8";
|
|
72
|
+
readonly value: "1.8";
|
|
73
|
+
}];
|
|
74
|
+
export declare const FONT_VALUE_TO_CSS: Record<string, string>;
|
|
75
|
+
//# sourceMappingURL=themeFonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeFonts.d.ts","sourceRoot":"","sources":["../../src/constants/themeFonts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EAQpB,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAOvB,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAMzB,CAAC;AAEX,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAMtB,CAAC;AAEX,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWpD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Theme font constants for the plugin
|
|
2
|
+
export const BODY_FONT_OPTIONS = [
|
|
3
|
+
{ label: 'System', value: 'system-ui' },
|
|
4
|
+
{ label: 'Inter', value: 'Inter' },
|
|
5
|
+
{ label: 'Roboto', value: 'Roboto' },
|
|
6
|
+
{ label: 'Open Sans', value: 'Open Sans' },
|
|
7
|
+
{ label: 'Lato', value: 'Lato' },
|
|
8
|
+
{ label: 'Montserrat', value: 'Montserrat' },
|
|
9
|
+
{ label: 'Poppins', value: 'Poppins' },
|
|
10
|
+
];
|
|
11
|
+
export const HEADING_FONT_OPTIONS = [
|
|
12
|
+
{ label: 'System', value: 'system-ui' },
|
|
13
|
+
{ label: 'Inter', value: 'Inter' },
|
|
14
|
+
{ label: 'Playfair Display', value: 'Playfair Display' },
|
|
15
|
+
{ label: 'Merriweather', value: 'Merriweather' },
|
|
16
|
+
{ label: 'Montserrat', value: 'Montserrat' },
|
|
17
|
+
{ label: 'Raleway', value: 'Raleway' },
|
|
18
|
+
];
|
|
19
|
+
export const BASE_FONT_SIZE_OPTIONS = [
|
|
20
|
+
{ label: '14px', value: '14' },
|
|
21
|
+
{ label: '15px', value: '15' },
|
|
22
|
+
{ label: '16px', value: '16' },
|
|
23
|
+
{ label: '17px', value: '17' },
|
|
24
|
+
{ label: '18px', value: '18' },
|
|
25
|
+
];
|
|
26
|
+
export const LINE_HEIGHT_OPTIONS = [
|
|
27
|
+
{ label: '1.4', value: '1.4' },
|
|
28
|
+
{ label: '1.5', value: '1.5' },
|
|
29
|
+
{ label: '1.6', value: '1.6' },
|
|
30
|
+
{ label: '1.7', value: '1.7' },
|
|
31
|
+
{ label: '1.8', value: '1.8' },
|
|
32
|
+
];
|
|
33
|
+
export const FONT_VALUE_TO_CSS = {
|
|
34
|
+
'system-ui': 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
35
|
+
'Inter': '"Inter", sans-serif',
|
|
36
|
+
'Roboto': '"Roboto", sans-serif',
|
|
37
|
+
'Open Sans': '"Open Sans", sans-serif',
|
|
38
|
+
'Lato': '"Lato", sans-serif',
|
|
39
|
+
'Montserrat': '"Montserrat", sans-serif',
|
|
40
|
+
'Poppins': '"Poppins", sans-serif',
|
|
41
|
+
'Playfair Display': '"Playfair Display", serif',
|
|
42
|
+
'Merriweather': '"Merriweather", serif',
|
|
43
|
+
'Raleway': '"Raleway", sans-serif',
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=themeFonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeFonts.js","sourceRoot":"","sources":["../../src/constants/themeFonts.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE;IACvC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IAC1C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,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