@kilivi/payloadcms-theme-management 0.3.1 → 0.3.2
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/fields/ColorPickerField.js +1 -1
- package/dist/fields/ColorPickerField.js.map +1 -1
- package/dist/fields/ThemeTokenSelectField.d.ts.map +1 -1
- package/dist/fields/ThemeTokenSelectField.js +1 -1
- package/dist/fields/ThemeTokenSelectField.js.map +1 -1
- package/dist/fields/themeConfigurationField.d.ts.map +1 -1
- package/dist/fields/themeConfigurationField.js +223 -264
- package/dist/fields/themeConfigurationField.js.map +1 -1
- package/package.json +1 -1
- package/dist/fields/ExtendedThemeAutoPopulateField.d.ts +0 -12
- package/dist/fields/ExtendedThemeAutoPopulateField.d.ts.map +0 -1
- package/dist/fields/ExtendedThemeAutoPopulateField.js +0 -176
- package/dist/fields/ExtendedThemeAutoPopulateField.js.map +0 -1
- package/dist/fields/RadiusField.d.ts +0 -3
- package/dist/fields/RadiusField.d.ts.map +0 -1
- package/dist/fields/RadiusField.js +0 -174
- package/dist/fields/RadiusField.js.map +0 -1
- package/dist/fields/ThemeLivePreview.css +0 -190
- package/dist/fields/ThemeLivePreview.d.ts +0 -3
- package/dist/fields/ThemeLivePreview.d.ts.map +0 -1
- package/dist/fields/ThemeLivePreview.js +0 -195
- package/dist/fields/ThemeLivePreview.js.map +0 -1
- package/dist/fields/VISUAL_EXAMPLES.d.ts +0 -153
- package/dist/fields/VISUAL_EXAMPLES.d.ts.map +0 -1
- package/dist/fields/VISUAL_EXAMPLES.js +0 -148
- package/dist/fields/VISUAL_EXAMPLES.js.map +0 -1
- package/dist/fields/extendedThemeFields.d.ts +0 -139
- package/dist/fields/extendedThemeFields.d.ts.map +0 -1
- package/dist/fields/extendedThemeFields.js +0 -489
- package/dist/fields/extendedThemeFields.js.map +0 -1
- package/dist/views/ThemePreviewLoader.d.ts +0 -7
- package/dist/views/ThemePreviewLoader.d.ts.map +0 -1
- package/dist/views/ThemePreviewLoader.js +0 -43
- package/dist/views/ThemePreviewLoader.js.map +0 -1
- package/dist/views/ThemePreviewView.d.ts +0 -10
- package/dist/views/ThemePreviewView.d.ts.map +0 -1
- package/dist/views/ThemePreviewView.js +0 -43
- package/dist/views/ThemePreviewView.js.map +0 -1
- package/dist/views/ThemePreviewViewClient.d.ts +0 -7
- package/dist/views/ThemePreviewViewClient.d.ts.map +0 -1
- package/dist/views/ThemePreviewViewClient.js +0 -12
- package/dist/views/ThemePreviewViewClient.js.map +0 -1
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useField, useForm } from '@payloadcms/ui';
|
|
4
|
-
import { useCallback, useEffect, useRef } from 'react';
|
|
5
|
-
import { allExtendedThemePresets } from '../extended-presets.js';
|
|
6
|
-
/**
|
|
7
|
-
* Extended Theme Field with Auto-Population
|
|
8
|
-
*
|
|
9
|
-
* This component:
|
|
10
|
-
* 1. Shows color swatches for each theme option
|
|
11
|
-
* 2. Auto-populates ALL color fields when a theme is selected
|
|
12
|
-
* 3. Fills in ALL light mode and dark mode colors with preset defaults
|
|
13
|
-
*/ const ExtendedThemeAutoPopulateField = ({ field, path })=>{
|
|
14
|
-
const { value, setValue } = useField({
|
|
15
|
-
path
|
|
16
|
-
});
|
|
17
|
-
const { dispatchFields } = useForm();
|
|
18
|
-
const hasInitializedRef = useRef(false);
|
|
19
|
-
const options = field.options || [];
|
|
20
|
-
const selectedOption = options.find((opt)=>opt.value === value);
|
|
21
|
-
// Auto-populate colors when theme is selected
|
|
22
|
-
const applyThemePreset = useCallback((presetKey)=>{
|
|
23
|
-
const preset = allExtendedThemePresets[presetKey];
|
|
24
|
-
if (!preset) return;
|
|
25
|
-
// Apply all light mode colors
|
|
26
|
-
Object.entries(preset.styles.light).forEach(([key, colorValue])=>{
|
|
27
|
-
dispatchFields({
|
|
28
|
-
type: 'UPDATE',
|
|
29
|
-
path: `themeConfiguration.extendedLightMode.${key}`,
|
|
30
|
-
value: colorValue
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
// Apply all dark mode colors
|
|
34
|
-
Object.entries(preset.styles.dark).forEach(([key, colorValue])=>{
|
|
35
|
-
dispatchFields({
|
|
36
|
-
type: 'UPDATE',
|
|
37
|
-
path: `themeConfiguration.extendedDarkMode.${key}`,
|
|
38
|
-
value: colorValue
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
}, [
|
|
42
|
-
dispatchFields
|
|
43
|
-
]);
|
|
44
|
-
const handleChange = useCallback((newValue)=>{
|
|
45
|
-
setValue(newValue);
|
|
46
|
-
if (newValue) {
|
|
47
|
-
applyThemePreset(newValue);
|
|
48
|
-
}
|
|
49
|
-
}, [
|
|
50
|
-
setValue,
|
|
51
|
-
applyThemePreset
|
|
52
|
-
]);
|
|
53
|
-
// Auto-populate on initial load if value exists
|
|
54
|
-
useEffect(()=>{
|
|
55
|
-
if (!hasInitializedRef.current && value) {
|
|
56
|
-
applyThemePreset(value);
|
|
57
|
-
hasInitializedRef.current = true;
|
|
58
|
-
}
|
|
59
|
-
}, [
|
|
60
|
-
value,
|
|
61
|
-
applyThemePreset
|
|
62
|
-
]);
|
|
63
|
-
// Get color swatches for a preset
|
|
64
|
-
const getPresetColors = (presetValue)=>{
|
|
65
|
-
const preset = allExtendedThemePresets[presetValue];
|
|
66
|
-
if (!preset) return [];
|
|
67
|
-
const colors = [
|
|
68
|
-
preset.styles.light.primary,
|
|
69
|
-
preset.styles.light.secondary,
|
|
70
|
-
preset.styles.light.accent,
|
|
71
|
-
preset.styles.light.background,
|
|
72
|
-
preset.styles.light.foreground
|
|
73
|
-
].filter(Boolean);
|
|
74
|
-
return colors.slice(0, 5);
|
|
75
|
-
};
|
|
76
|
-
const label = typeof field.label === 'string' ? field.label : field.label?.en || field.label?.cs || 'Theme Preset';
|
|
77
|
-
const description = typeof field.admin?.description === 'string' ? field.admin.description : field.admin?.description?.en || field.admin?.description?.cs;
|
|
78
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
79
|
-
style: {
|
|
80
|
-
marginBottom: '16px'
|
|
81
|
-
},
|
|
82
|
-
children: [
|
|
83
|
-
/*#__PURE__*/ _jsx("label", {
|
|
84
|
-
style: {
|
|
85
|
-
display: 'block',
|
|
86
|
-
marginBottom: '6px',
|
|
87
|
-
fontSize: '13px',
|
|
88
|
-
fontWeight: 600,
|
|
89
|
-
color: 'var(--theme-elevation-800)'
|
|
90
|
-
},
|
|
91
|
-
children: label
|
|
92
|
-
}),
|
|
93
|
-
description && /*#__PURE__*/ _jsx("div", {
|
|
94
|
-
style: {
|
|
95
|
-
fontSize: '12px',
|
|
96
|
-
color: 'var(--theme-elevation-500)',
|
|
97
|
-
marginBottom: '8px'
|
|
98
|
-
},
|
|
99
|
-
children: description
|
|
100
|
-
}),
|
|
101
|
-
/*#__PURE__*/ _jsxs("select", {
|
|
102
|
-
value: value || '',
|
|
103
|
-
onChange: (e)=>handleChange(e.target.value),
|
|
104
|
-
style: {
|
|
105
|
-
width: '100%',
|
|
106
|
-
padding: '10px 12px',
|
|
107
|
-
borderRadius: '6px',
|
|
108
|
-
border: '1px solid var(--theme-elevation-200)',
|
|
109
|
-
backgroundColor: 'var(--theme-input-bg)',
|
|
110
|
-
color: 'var(--theme-elevation-800)',
|
|
111
|
-
fontSize: '14px',
|
|
112
|
-
cursor: 'pointer'
|
|
113
|
-
},
|
|
114
|
-
children: [
|
|
115
|
-
/*#__PURE__*/ _jsx("option", {
|
|
116
|
-
value: "",
|
|
117
|
-
children: "Select a theme..."
|
|
118
|
-
}),
|
|
119
|
-
options.map((option)=>/*#__PURE__*/ _jsx("option", {
|
|
120
|
-
value: option.value,
|
|
121
|
-
children: option.label
|
|
122
|
-
}, option.value))
|
|
123
|
-
]
|
|
124
|
-
}),
|
|
125
|
-
selectedOption && /*#__PURE__*/ _jsxs("div", {
|
|
126
|
-
style: {
|
|
127
|
-
marginTop: '12px',
|
|
128
|
-
padding: '12px',
|
|
129
|
-
borderRadius: '8px',
|
|
130
|
-
backgroundColor: 'var(--theme-elevation-50)',
|
|
131
|
-
border: '1px solid var(--theme-elevation-200)'
|
|
132
|
-
},
|
|
133
|
-
children: [
|
|
134
|
-
/*#__PURE__*/ _jsx("div", {
|
|
135
|
-
style: {
|
|
136
|
-
fontSize: '12px',
|
|
137
|
-
fontWeight: 600,
|
|
138
|
-
marginBottom: '8px',
|
|
139
|
-
color: 'var(--theme-elevation-700)'
|
|
140
|
-
},
|
|
141
|
-
children: selectedOption.label
|
|
142
|
-
}),
|
|
143
|
-
/*#__PURE__*/ _jsx("div", {
|
|
144
|
-
style: {
|
|
145
|
-
display: 'flex',
|
|
146
|
-
gap: '8px',
|
|
147
|
-
alignItems: 'center'
|
|
148
|
-
},
|
|
149
|
-
children: getPresetColors(selectedOption.value).map((color, index)=>/*#__PURE__*/ _jsx("div", {
|
|
150
|
-
style: {
|
|
151
|
-
width: '32px',
|
|
152
|
-
height: '32px',
|
|
153
|
-
borderRadius: '6px',
|
|
154
|
-
backgroundColor: color,
|
|
155
|
-
border: '1px solid rgba(0, 0, 0, 0.1)',
|
|
156
|
-
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.05)'
|
|
157
|
-
},
|
|
158
|
-
title: color
|
|
159
|
-
}, `${selectedOption.value}-${index}`))
|
|
160
|
-
}),
|
|
161
|
-
/*#__PURE__*/ _jsx("div", {
|
|
162
|
-
style: {
|
|
163
|
-
marginTop: '8px',
|
|
164
|
-
fontSize: '11px',
|
|
165
|
-
color: 'var(--theme-elevation-500)'
|
|
166
|
-
},
|
|
167
|
-
children: "✅ All colors auto-populated from this theme"
|
|
168
|
-
})
|
|
169
|
-
]
|
|
170
|
-
})
|
|
171
|
-
]
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
export default ExtendedThemeAutoPopulateField;
|
|
175
|
-
|
|
176
|
-
//# sourceMappingURL=ExtendedThemeAutoPopulateField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fields/ExtendedThemeAutoPopulateField.tsx"],"sourcesContent":["'use client'\n\nimport { useField, useForm } from '@payloadcms/ui'\nimport type { SelectFieldClientComponent } from 'payload'\nimport { useCallback, useEffect, useRef } from 'react'\nimport { allExtendedThemePresets } from '../extended-presets.js'\n\n/**\n * Extended Theme Field with Auto-Population\n *\n * This component:\n * 1. Shows color swatches for each theme option\n * 2. Auto-populates ALL color fields when a theme is selected\n * 3. Fills in ALL light mode and dark mode colors with preset defaults\n */\nconst ExtendedThemeAutoPopulateField: SelectFieldClientComponent = ({ field, path }) => {\n const { value, setValue } = useField<string>({ path })\n const { dispatchFields } = useForm()\n const hasInitializedRef = useRef(false)\n\n const options = (field.options as Array<{ label: string; value: string }>) || []\n const selectedOption = options.find((opt) => opt.value === value)\n\n // Auto-populate colors when theme is selected\n const applyThemePreset = useCallback(\n (presetKey: string) => {\n const preset = allExtendedThemePresets[presetKey as keyof typeof allExtendedThemePresets]\n if (!preset) return\n\n // Apply all light mode colors\n Object.entries(preset.styles.light).forEach(([key, colorValue]) => {\n dispatchFields({\n type: 'UPDATE',\n path: `themeConfiguration.extendedLightMode.${key}`,\n value: colorValue,\n })\n })\n\n // Apply all dark mode colors\n Object.entries(preset.styles.dark).forEach(([key, colorValue]) => {\n dispatchFields({\n type: 'UPDATE',\n path: `themeConfiguration.extendedDarkMode.${key}`,\n value: colorValue,\n })\n })\n },\n [dispatchFields],\n )\n\n const handleChange = useCallback(\n (newValue: string) => {\n setValue(newValue)\n if (newValue) {\n applyThemePreset(newValue)\n }\n },\n [setValue, applyThemePreset],\n )\n\n // Auto-populate on initial load if value exists\n useEffect(() => {\n if (!hasInitializedRef.current && value) {\n applyThemePreset(value)\n hasInitializedRef.current = true\n }\n }, [value, applyThemePreset])\n\n // Get color swatches for a preset\n const getPresetColors = (presetValue: string) => {\n const preset = allExtendedThemePresets[presetValue as keyof typeof allExtendedThemePresets]\n if (!preset) return []\n\n const colors = [\n preset.styles.light.primary,\n preset.styles.light.secondary,\n preset.styles.light.accent,\n preset.styles.light.background,\n preset.styles.light.foreground,\n ].filter(Boolean)\n\n return colors.slice(0, 5)\n }\n\n const label =\n typeof field.label === 'string'\n ? field.label\n : field.label?.en || field.label?.cs || 'Theme Preset'\n const description =\n typeof field.admin?.description === 'string'\n ? field.admin.description\n : field.admin?.description?.en || field.admin?.description?.cs\n\n return (\n <div style={{ marginBottom: '16px' }}>\n <label\n style={{\n display: 'block',\n marginBottom: '6px',\n fontSize: '13px',\n fontWeight: 600,\n color: 'var(--theme-elevation-800)',\n }}\n >\n {label}\n </label>\n\n {description && (\n <div\n style={{\n fontSize: '12px',\n color: 'var(--theme-elevation-500)',\n marginBottom: '8px',\n }}\n >\n {description}\n </div>\n )}\n\n <select\n value={value || ''}\n onChange={(e) => handleChange(e.target.value)}\n style={{\n width: '100%',\n padding: '10px 12px',\n borderRadius: '6px',\n border: '1px solid var(--theme-elevation-200)',\n backgroundColor: 'var(--theme-input-bg)',\n color: 'var(--theme-elevation-800)',\n fontSize: '14px',\n cursor: 'pointer',\n }}\n >\n <option value=\"\">Select a theme...</option>\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n\n {/* Show color swatches for selected theme */}\n {selectedOption && (\n <div\n style={{\n marginTop: '12px',\n padding: '12px',\n borderRadius: '8px',\n backgroundColor: 'var(--theme-elevation-50)',\n border: '1px solid var(--theme-elevation-200)',\n }}\n >\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n marginBottom: '8px',\n color: 'var(--theme-elevation-700)',\n }}\n >\n {selectedOption.label}\n </div>\n <div\n style={{\n display: 'flex',\n gap: '8px',\n alignItems: 'center',\n }}\n >\n {getPresetColors(selectedOption.value).map((color, index) => (\n <div\n key={`${selectedOption.value}-${index}`}\n style={{\n width: '32px',\n height: '32px',\n borderRadius: '6px',\n backgroundColor: color,\n border: '1px solid rgba(0, 0, 0, 0.1)',\n boxShadow: '0 2px 4px rgba(0, 0, 0, 0.05)',\n }}\n title={color}\n />\n ))}\n </div>\n <div\n style={{\n marginTop: '8px',\n fontSize: '11px',\n color: 'var(--theme-elevation-500)',\n }}\n >\n ✅ All colors auto-populated from this theme\n </div>\n </div>\n )}\n </div>\n )\n}\n\nexport default ExtendedThemeAutoPopulateField\n"],"names":["useField","useForm","useCallback","useEffect","useRef","allExtendedThemePresets","ExtendedThemeAutoPopulateField","field","path","value","setValue","dispatchFields","hasInitializedRef","options","selectedOption","find","opt","applyThemePreset","presetKey","preset","Object","entries","styles","light","forEach","key","colorValue","type","dark","handleChange","newValue","current","getPresetColors","presetValue","colors","primary","secondary","accent","background","foreground","filter","Boolean","slice","label","en","cs","description","admin","div","style","marginBottom","display","fontSize","fontWeight","color","select","onChange","e","target","width","padding","borderRadius","border","backgroundColor","cursor","option","map","marginTop","gap","alignItems","index","height","boxShadow","title"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,EAAEC,OAAO,QAAQ,iBAAgB;AAElD,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,QAAO;AACtD,SAASC,uBAAuB,QAAQ,yBAAwB;AAEhE;;;;;;;CAOC,GACD,MAAMC,iCAA6D,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE;IACjF,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGV,SAAiB;QAAEQ;IAAK;IACpD,MAAM,EAAEG,cAAc,EAAE,GAAGV;IAC3B,MAAMW,oBAAoBR,OAAO;IAEjC,MAAMS,UAAU,AAACN,MAAMM,OAAO,IAAgD,EAAE;IAChF,MAAMC,iBAAiBD,QAAQE,IAAI,CAAC,CAACC,MAAQA,IAAIP,KAAK,KAAKA;IAE3D,8CAA8C;IAC9C,MAAMQ,mBAAmBf,YACvB,CAACgB;QACC,MAAMC,SAASd,uBAAuB,CAACa,UAAkD;QACzF,IAAI,CAACC,QAAQ;QAEb,8BAA8B;QAC9BC,OAAOC,OAAO,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AOgB,sBACjD,KAACtB;gCAECC,OAAO;oCACLU,OAAO;oCACPY,QAAQ;oCACRV,cAAc;oCACdE,iBAAiBT;oCACjBQ,QAAQ;oCACRU,WAAW;gCACb;gCACAC,OAAOnB;+BATF,GAAGxC,eAAeL,KAAK,CAAC,CAAC,EAAE6D,OAAO;;kCAa7C,KAACtB;wBACCC,OAAO;4BACLkB,WAAW;4BACXf,UAAU;4BACVE,OAAO;wBACT;kCACD;;;;;;AAOX;AAEA,eAAehD,+BAA8B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RadiusField.d.ts","sourceRoot":"","sources":["../../src/fields/RadiusField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAYrD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,+BA2J9E"}
|
|
@@ -1,174 +0,0 @@
|
|
|
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 { borderRadiusPresets } from '../providers/Theme/themeConfig.js';
|
|
6
|
-
export default function RadiusField({ field, ...props }) {
|
|
7
|
-
const { value, setValue } = useField({
|
|
8
|
-
path: props.path
|
|
9
|
-
});
|
|
10
|
-
const label = typeof field.label === 'string' ? field.label : '';
|
|
11
|
-
const radiusOptions = useMemo(()=>{
|
|
12
|
-
const entries = Object.entries(borderRadiusPresets);
|
|
13
|
-
return entries.map(([key, preset])=>({
|
|
14
|
-
key,
|
|
15
|
-
label: preset.label,
|
|
16
|
-
css: preset.css
|
|
17
|
-
}));
|
|
18
|
-
}, []);
|
|
19
|
-
const fallbackKey = radiusOptions[2]?.key ?? radiusOptions[0]?.key ?? 'medium';
|
|
20
|
-
const currentKey = typeof value === 'string' && value in borderRadiusPresets ? value : fallbackKey;
|
|
21
|
-
const description = typeof field.admin?.description === 'string' ? field.admin.description : field.admin?.description?.en || field.admin?.description?.cs || null;
|
|
22
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
23
|
-
className: "field-type",
|
|
24
|
-
children: [
|
|
25
|
-
/*#__PURE__*/ _jsxs("label", {
|
|
26
|
-
className: "field-label",
|
|
27
|
-
htmlFor: props.path,
|
|
28
|
-
children: [
|
|
29
|
-
label,
|
|
30
|
-
field.required && /*#__PURE__*/ _jsx("span", {
|
|
31
|
-
className: "required",
|
|
32
|
-
children: "*"
|
|
33
|
-
})
|
|
34
|
-
]
|
|
35
|
-
}),
|
|
36
|
-
description && /*#__PURE__*/ _jsx("p", {
|
|
37
|
-
style: {
|
|
38
|
-
marginTop: '4px',
|
|
39
|
-
fontSize: '12px',
|
|
40
|
-
lineHeight: 1.5,
|
|
41
|
-
color: 'var(--theme-elevation-600)'
|
|
42
|
-
},
|
|
43
|
-
children: description
|
|
44
|
-
}),
|
|
45
|
-
/*#__PURE__*/ _jsx("div", {
|
|
46
|
-
style: {
|
|
47
|
-
display: 'grid',
|
|
48
|
-
gridTemplateColumns: 'repeat(auto-fit, minmax(160px, 1fr))',
|
|
49
|
-
gap: '16px',
|
|
50
|
-
marginTop: '16px'
|
|
51
|
-
},
|
|
52
|
-
children: radiusOptions.map((option)=>{
|
|
53
|
-
const isSelected = option.key === currentKey;
|
|
54
|
-
const cardRadius = option.css['--radius-large'] ?? option.css['--radius-default'] ?? option.css['--radius-medium'];
|
|
55
|
-
const chipRadius = option.css['--radius-default'] ?? option.css['--radius-small'];
|
|
56
|
-
const pillRadius = option.css['--radius-xl'] ?? option.css['--radius-large'] ?? '999px';
|
|
57
|
-
return /*#__PURE__*/ _jsxs("button", {
|
|
58
|
-
type: "button",
|
|
59
|
-
onClick: ()=>setValue(option.key),
|
|
60
|
-
"aria-pressed": isSelected,
|
|
61
|
-
style: {
|
|
62
|
-
border: isSelected ? '2px solid var(--theme-success-500)' : '1px solid var(--theme-elevation-150)',
|
|
63
|
-
borderRadius: '14px',
|
|
64
|
-
backgroundColor: 'var(--theme-elevation-25)',
|
|
65
|
-
padding: '16px',
|
|
66
|
-
display: 'grid',
|
|
67
|
-
gap: '10px',
|
|
68
|
-
textAlign: 'left',
|
|
69
|
-
cursor: 'pointer',
|
|
70
|
-
transition: 'border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease',
|
|
71
|
-
boxShadow: isSelected ? '0 10px 20px rgba(34, 197, 94, 0.18)' : '0 6px 18px rgba(15, 23, 42, 0.08)',
|
|
72
|
-
transform: isSelected ? 'translateY(-2px)' : 'translateY(0)'
|
|
73
|
-
},
|
|
74
|
-
children: [
|
|
75
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
76
|
-
style: {
|
|
77
|
-
display: 'flex',
|
|
78
|
-
alignItems: 'center',
|
|
79
|
-
justifyContent: 'space-between',
|
|
80
|
-
fontWeight: 600,
|
|
81
|
-
fontSize: '13px',
|
|
82
|
-
color: 'var(--theme-elevation-800)'
|
|
83
|
-
},
|
|
84
|
-
children: [
|
|
85
|
-
/*#__PURE__*/ _jsx("span", {
|
|
86
|
-
children: option.label
|
|
87
|
-
}),
|
|
88
|
-
/*#__PURE__*/ _jsx("span", {
|
|
89
|
-
style: {
|
|
90
|
-
fontSize: '11px',
|
|
91
|
-
opacity: 0.7
|
|
92
|
-
},
|
|
93
|
-
children: option.key
|
|
94
|
-
})
|
|
95
|
-
]
|
|
96
|
-
}),
|
|
97
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
98
|
-
style: {
|
|
99
|
-
display: 'grid',
|
|
100
|
-
gap: '10px'
|
|
101
|
-
},
|
|
102
|
-
children: [
|
|
103
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
104
|
-
style: {
|
|
105
|
-
display: 'flex',
|
|
106
|
-
gap: '8px',
|
|
107
|
-
alignItems: 'center'
|
|
108
|
-
},
|
|
109
|
-
children: [
|
|
110
|
-
/*#__PURE__*/ _jsx("div", {
|
|
111
|
-
style: {
|
|
112
|
-
width: '50px',
|
|
113
|
-
height: '34px',
|
|
114
|
-
backgroundColor: 'var(--theme-elevation-100)',
|
|
115
|
-
border: '1px solid var(--theme-elevation-200)',
|
|
116
|
-
borderRadius: cardRadius ?? '0'
|
|
117
|
-
}
|
|
118
|
-
}),
|
|
119
|
-
/*#__PURE__*/ _jsx("div", {
|
|
120
|
-
style: {
|
|
121
|
-
flex: 1,
|
|
122
|
-
height: '14px',
|
|
123
|
-
backgroundColor: 'var(--theme-primary-500)',
|
|
124
|
-
borderRadius: pillRadius
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
]
|
|
128
|
-
}),
|
|
129
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
130
|
-
style: {
|
|
131
|
-
display: 'flex',
|
|
132
|
-
gap: '6px',
|
|
133
|
-
flexWrap: 'wrap',
|
|
134
|
-
fontSize: '11px',
|
|
135
|
-
color: 'var(--theme-elevation-600)'
|
|
136
|
-
},
|
|
137
|
-
children: [
|
|
138
|
-
/*#__PURE__*/ _jsxs("span", {
|
|
139
|
-
children: [
|
|
140
|
-
"Card ",
|
|
141
|
-
cardRadius ?? '—'
|
|
142
|
-
]
|
|
143
|
-
}),
|
|
144
|
-
/*#__PURE__*/ _jsxs("span", {
|
|
145
|
-
children: [
|
|
146
|
-
"Chip ",
|
|
147
|
-
chipRadius ?? '—'
|
|
148
|
-
]
|
|
149
|
-
}),
|
|
150
|
-
/*#__PURE__*/ _jsxs("span", {
|
|
151
|
-
children: [
|
|
152
|
-
"Pill ",
|
|
153
|
-
pillRadius
|
|
154
|
-
]
|
|
155
|
-
})
|
|
156
|
-
]
|
|
157
|
-
})
|
|
158
|
-
]
|
|
159
|
-
})
|
|
160
|
-
]
|
|
161
|
-
}, option.key);
|
|
162
|
-
})
|
|
163
|
-
}),
|
|
164
|
-
/*#__PURE__*/ _jsx("input", {
|
|
165
|
-
type: "hidden",
|
|
166
|
-
id: props.path,
|
|
167
|
-
value: currentKey,
|
|
168
|
-
readOnly: true
|
|
169
|
-
})
|
|
170
|
-
]
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
//# sourceMappingURL=RadiusField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fields/RadiusField.tsx"],"sourcesContent":["'use client'\n\nimport { useField } from '@payloadcms/ui'\nimport type { SelectFieldClientProps } from 'payload'\nimport { useMemo } from 'react'\nimport { borderRadiusPresets } from '../providers/Theme/themeConfig.js'\n\ntype RadiusPresetKey = Extract<keyof typeof borderRadiusPresets, string>\n\ninterface RadiusOptionCard {\n key: RadiusPresetKey\n label: string\n css: Record<string, string>\n}\n\nexport default function RadiusField({ field, ...props }: SelectFieldClientProps) {\n const { value, setValue } = useField<string>({ path: props.path })\n const label = typeof field.label === 'string' ? field.label : ''\n\n const radiusOptions = useMemo<RadiusOptionCard[]>(() => {\n const entries = Object.entries(borderRadiusPresets) as Array<\n [RadiusPresetKey, (typeof borderRadiusPresets)[RadiusPresetKey]]\n >\n return entries.map(([key, preset]) => ({\n key,\n label: preset.label,\n css: preset.css,\n }))\n }, [])\n\n const fallbackKey: RadiusPresetKey = radiusOptions[2]?.key ?? radiusOptions[0]?.key ?? 'medium'\n const currentKey =\n typeof value === 'string' && value in borderRadiusPresets\n ? (value as RadiusPresetKey)\n : fallbackKey\n\n const description =\n typeof field.admin?.description === 'string'\n ? field.admin.description\n : field.admin?.description?.en || field.admin?.description?.cs || null\n\n return (\n <div className=\"field-type\">\n <label className=\"field-label\" htmlFor={props.path}>\n {label}\n {field.required && <span className=\"required\">*</span>}\n </label>\n\n {description && (\n <p\n style={{\n marginTop: '4px',\n fontSize: '12px',\n lineHeight: 1.5,\n color: 'var(--theme-elevation-600)',\n }}\n >\n {description}\n </p>\n )}\n\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: 'repeat(auto-fit, minmax(160px, 1fr))',\n gap: '16px',\n marginTop: '16px',\n }}\n >\n {radiusOptions.map((option) => {\n const isSelected = option.key === currentKey\n const cardRadius =\n option.css['--radius-large'] ??\n option.css['--radius-default'] ??\n option.css['--radius-medium']\n const chipRadius = option.css['--radius-default'] ?? option.css['--radius-small']\n const pillRadius = option.css['--radius-xl'] ?? option.css['--radius-large'] ?? '999px'\n\n return (\n <button\n key={option.key}\n type=\"button\"\n onClick={() => setValue(option.key)}\n aria-pressed={isSelected}\n style={{\n border: isSelected\n ? '2px solid var(--theme-success-500)'\n : '1px solid var(--theme-elevation-150)',\n borderRadius: '14px',\n backgroundColor: 'var(--theme-elevation-25)',\n padding: '16px',\n display: 'grid',\n gap: '10px',\n textAlign: 'left',\n cursor: 'pointer',\n transition: 'border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease',\n boxShadow: isSelected\n ? '0 10px 20px rgba(34, 197, 94, 0.18)'\n : '0 6px 18px rgba(15, 23, 42, 0.08)',\n transform: isSelected ? 'translateY(-2px)' : 'translateY(0)',\n }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n fontWeight: 600,\n fontSize: '13px',\n color: 'var(--theme-elevation-800)',\n }}\n >\n <span>{option.label}</span>\n <span style={{ fontSize: '11px', opacity: 0.7 }}>{option.key}</span>\n </div>\n\n <div\n style={{\n display: 'grid',\n gap: '10px',\n }}\n >\n <div\n style={{\n display: 'flex',\n gap: '8px',\n alignItems: 'center',\n }}\n >\n <div\n style={{\n width: '50px',\n height: '34px',\n backgroundColor: 'var(--theme-elevation-100)',\n border: '1px solid var(--theme-elevation-200)',\n borderRadius: cardRadius ?? '0',\n }}\n />\n <div\n style={{\n flex: 1,\n height: '14px',\n backgroundColor: 'var(--theme-primary-500)',\n borderRadius: pillRadius,\n }}\n />\n </div>\n\n <div\n style={{\n display: 'flex',\n gap: '6px',\n flexWrap: 'wrap',\n fontSize: '11px',\n color: 'var(--theme-elevation-600)',\n }}\n >\n <span>Card {cardRadius ?? '—'}</span>\n <span>Chip {chipRadius ?? '—'}</span>\n <span>Pill {pillRadius}</span>\n </div>\n </div>\n </button>\n )\n })}\n </div>\n\n <input type=\"hidden\" id={props.path} value={currentKey} readOnly />\n </div>\n )\n}\n"],"names":["useField","useMemo","borderRadiusPresets","RadiusField","field","props","value","setValue","path","label","radiusOptions","entries","Object","map","key","preset","css","fallbackKey","currentKey","description","admin","en","cs","div","className","htmlFor","required","span","p","style","marginTop","fontSize","lineHeight","color","display","gridTemplateColumns","gap","option","isSelected","cardRadius","chipRadius","pillRadius","button","type","onClick","aria-pressed","border","borderRadius","backgroundColor","padding","textAlign","cursor","transition","boxShadow","transform","alignItems","justifyContent","fontWeight","opacity","width","height","flex","flexWrap","input","id","readOnly"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,QAAQ,iBAAgB;AAEzC,SAASC,OAAO,QAAQ,QAAO;AAC/B,SAASC,mBAAmB,QAAQ,oCAAmC;AAUvE,eAAe,SAASC,YAAY,EAAEC,KAAK,EAAE,GAAGC,OAA+B;IAC7E,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGP,SAAiB;QAAEQ,MAAMH,MAAMG,IAAI;IAAC;IAChE,MAAMC,QAAQ,OAAOL,MAAMK,KAAK,KAAK,WAAWL,MAAMK,KAAK,GAAG;IAE9D,MAAMC,gBAAgBT,QAA4B;QAChD,MAAMU,UAAUC,OAAOD,OAAO,CAACT;QAG/B,OAAOS,QAAQE,GAAG,CAAC,CAAC,CAACC,KAAKC,OAAO,GAAM,CAAA;gBACrCD;gBACAL,OAAOM,OAAON,KAAK;gBACnBO,KAAKD,OAAOC,GAAG;YACjB,CAAA;IACF,GAAG,EAAE;IAEL,MAAMC,cAA+BP,aAAa,CAAC,EAAE,EAAEI,OAAOJ,aAAa,CAAC,EAAE,EAAEI,OAAO;IACvF,MAAMI,aACJ,OAAOZ,UAAU,YAAYA,SAASJ,sBACjCI,QACDW;IAEN,MAAME,cACJ,OAAOf,MAAMgB,KAAK,EAAED,gBAAg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gBAAgB;oCAChBC,YAAY;oCACZ1B,UAAU;oCACVE,OAAO;gCACT;;kDAEA,KAACN;kDAAMU,OAAO5B,KAAK;;kDACjB,KAACkB;wCAAKE,OAAO;4CAAEE,UAAU;4CAAQ2B,SAAS;wCAAI;kDAAIrB,OAAOvB,GAAG;;;;0CAGhE,MAACS;gCACCM,OAAO;oCACLK,SAAS;oCACTE,KAAK;gCACP;;kDAEA,MAACb;wCACCM,OAAO;4CACLK,SAAS;4CACTE,KAAK;4CACLmB,YAAY;wCACd;;0DAEA,KAAChC;gDACCM,OAAO;oDACL8B,OAAO;oDACPC,QAAQ;oDACRZ,iBAAiB;oDACjBF,QAAQ;oDACRC,cAAcR,cAAc;gDAC9B;;0DAEF,KAAChB;gDACCM,OAAO;oDACLgC,MAAM;oDACND,QAAQ;oDACRZ,iBAAiB;oDACjBD,cAAcN;gDAChB;;;;kDAIJ,MAAClB;wCACCM,OAAO;4CACLK,SAAS;4CACTE,KAAK;4CACL0B,UAAU;4CACV/B,UAAU;4CACVE,OAAO;wCACT;;0DAEA,MAACN;;oDAAK;oDAAMY,cAAc;;;0DAC1B,MAACZ;;oDAAK;oDAAMa,cAAc;;;0DAC1B,MAACb;;oDAAK;oDAAMc;;;;;;;;uBA/EXJ,OAAOvB,GAAG;gBAoFrB;;0BAGN,KAACiD;gBAAMpB,MAAK;gBAASqB,IAAI3D,MAAMG,IAAI;gBAAEF,OAAOY;gBAAY+C,QAAQ;;;;AAGlE"}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/* Theme Live Preview Styles */
|
|
2
|
-
.theme-live-preview-container {
|
|
3
|
-
position: sticky;
|
|
4
|
-
top: 0;
|
|
5
|
-
height: 100vh;
|
|
6
|
-
overflow-y: auto;
|
|
7
|
-
background: var(--theme-elevation-50);
|
|
8
|
-
border-left: 1px solid var(--theme-elevation-200);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.theme-live-preview-empty {
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
height: 100%;
|
|
16
|
-
padding: 2rem;
|
|
17
|
-
color: var(--theme-elevation-400);
|
|
18
|
-
font-size: 0.875rem;
|
|
19
|
-
text-align: center;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.preview-header {
|
|
23
|
-
position: sticky;
|
|
24
|
-
top: 0;
|
|
25
|
-
z-index: 10;
|
|
26
|
-
background: var(--theme-elevation-0);
|
|
27
|
-
border-bottom: 1px solid var(--theme-elevation-200);
|
|
28
|
-
padding: 1rem;
|
|
29
|
-
display: flex;
|
|
30
|
-
justify-content: space-between;
|
|
31
|
-
align-items: center;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.preview-header h3 {
|
|
35
|
-
margin: 0;
|
|
36
|
-
font-size: 1rem;
|
|
37
|
-
font-weight: 600;
|
|
38
|
-
color: var(--theme-text);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.mode-toggle {
|
|
42
|
-
display: flex;
|
|
43
|
-
gap: 0.5rem;
|
|
44
|
-
background: var(--theme-elevation-100);
|
|
45
|
-
padding: 0.25rem;
|
|
46
|
-
border-radius: 8px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.mode-toggle button {
|
|
50
|
-
padding: 0.5rem 1rem;
|
|
51
|
-
border: none;
|
|
52
|
-
background: transparent;
|
|
53
|
-
color: var(--theme-text);
|
|
54
|
-
font-size: 0.875rem;
|
|
55
|
-
font-weight: 500;
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
border-radius: 6px;
|
|
58
|
-
transition: all 0.2s;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.mode-toggle button.active {
|
|
62
|
-
background: white;
|
|
63
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.preview-content {
|
|
67
|
-
padding: 2rem;
|
|
68
|
-
min-height: calc(100vh - 80px);
|
|
69
|
-
transition: all 0.3s;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.preview-section {
|
|
73
|
-
margin-bottom: 2rem;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.preview-section h1 {
|
|
77
|
-
font-size: 2rem;
|
|
78
|
-
font-weight: 700;
|
|
79
|
-
margin: 0 0 0.5rem 0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.preview-section p {
|
|
83
|
-
font-size: 1rem;
|
|
84
|
-
margin: 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.preview-cards {
|
|
88
|
-
display: grid;
|
|
89
|
-
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
90
|
-
gap: 1.5rem;
|
|
91
|
-
margin-bottom: 2rem;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.preview-card {
|
|
95
|
-
padding: 1.5rem;
|
|
96
|
-
border-radius: 12px;
|
|
97
|
-
border: 2px solid;
|
|
98
|
-
transition: all 0.2s;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.preview-card:hover {
|
|
102
|
-
transform: translateY(-2px);
|
|
103
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.preview-card h3 {
|
|
107
|
-
margin: 0 0 0.5rem 0;
|
|
108
|
-
font-size: 1.25rem;
|
|
109
|
-
font-weight: 600;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.preview-card p {
|
|
113
|
-
margin: 0 0 1rem 0;
|
|
114
|
-
font-size: 0.875rem;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.preview-btn-primary,
|
|
118
|
-
.preview-btn-secondary,
|
|
119
|
-
.preview-btn-destructive {
|
|
120
|
-
padding: 0.625rem 1.25rem;
|
|
121
|
-
border: none;
|
|
122
|
-
border-radius: 8px;
|
|
123
|
-
font-weight: 600;
|
|
124
|
-
font-size: 0.875rem;
|
|
125
|
-
cursor: pointer;
|
|
126
|
-
transition: all 0.2s;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.preview-btn-primary:hover,
|
|
130
|
-
.preview-btn-secondary:hover,
|
|
131
|
-
.preview-btn-destructive:hover {
|
|
132
|
-
opacity: 0.9;
|
|
133
|
-
transform: translateY(-1px);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.preview-ui-elements {
|
|
137
|
-
display: flex;
|
|
138
|
-
gap: 1rem;
|
|
139
|
-
align-items: center;
|
|
140
|
-
flex-wrap: wrap;
|
|
141
|
-
margin-bottom: 2rem;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.preview-input {
|
|
145
|
-
padding: 0.625rem 1rem;
|
|
146
|
-
border: 2px solid;
|
|
147
|
-
border-radius: 8px;
|
|
148
|
-
font-size: 0.875rem;
|
|
149
|
-
min-width: 200px;
|
|
150
|
-
transition: all 0.2s;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.preview-input:focus {
|
|
154
|
-
outline: none;
|
|
155
|
-
border-color: var(--preview-ring, #3b82f6);
|
|
156
|
-
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.preview-badge {
|
|
160
|
-
padding: 0.375rem 0.875rem;
|
|
161
|
-
border-radius: 6px;
|
|
162
|
-
font-size: 0.75rem;
|
|
163
|
-
font-weight: 600;
|
|
164
|
-
text-transform: uppercase;
|
|
165
|
-
letter-spacing: 0.05em;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.preview-muted {
|
|
169
|
-
padding: 1.5rem;
|
|
170
|
-
border-radius: 8px;
|
|
171
|
-
margin-bottom: 2rem;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.preview-muted p {
|
|
175
|
-
margin: 0;
|
|
176
|
-
font-size: 0.875rem;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/* Dark mode adjustments */
|
|
180
|
-
.theme-live-preview-container[data-mode="dark"] .preview-content {
|
|
181
|
-
background: #1a1a1a;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.theme-live-preview-container[data-mode="dark"] .preview-card {
|
|
185
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.theme-live-preview-container[data-mode="dark"] .preview-card:hover {
|
|
189
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
|
190
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeLivePreview.d.ts","sourceRoot":"","sources":["../../src/fields/ThemeLivePreview.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,gBAAgB,mCA6J5B,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|