@kilivi/payloadcms-theme-management 2.0.0 → 2.2.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.
Files changed (235) hide show
  1. package/README.md +346 -845
  2. package/dist/components/AppearanceSessionControls.d.ts +15 -0
  3. package/dist/components/AppearanceSessionControls.d.ts.map +1 -0
  4. package/dist/components/AppearanceSessionControls.js +152 -0
  5. package/dist/components/AppearanceSessionControls.js.map +1 -0
  6. package/dist/components/ColorModeToggle.css +42 -0
  7. package/dist/components/ColorModeToggle.d.ts +40 -0
  8. package/dist/components/ColorModeToggle.d.ts.map +1 -0
  9. package/dist/components/ColorModeToggle.js +111 -0
  10. package/dist/components/ColorModeToggle.js.map +1 -0
  11. package/dist/components/ServerThemeInjector.d.ts +13 -1
  12. package/dist/components/ServerThemeInjector.d.ts.map +1 -1
  13. package/dist/components/ServerThemeInjector.js +65 -15
  14. package/dist/components/ServerThemeInjector.js.map +1 -1
  15. package/dist/components/ThemeLivePreviewSync.d.ts +4 -0
  16. package/dist/components/ThemeLivePreviewSync.d.ts.map +1 -1
  17. package/dist/components/ThemeLivePreviewSync.js +28 -4
  18. package/dist/components/ThemeLivePreviewSync.js.map +1 -1
  19. package/dist/components/ThemeSwitcher.d.ts +36 -0
  20. package/dist/components/ThemeSwitcher.d.ts.map +1 -0
  21. package/dist/components/ThemeSwitcher.js +89 -0
  22. package/dist/components/ThemeSwitcher.js.map +1 -0
  23. package/dist/components/typographyPreviewUtils.d.ts +5 -0
  24. package/dist/components/typographyPreviewUtils.d.ts.map +1 -1
  25. package/dist/components/typographyPreviewUtils.js +24 -11
  26. package/dist/components/typographyPreviewUtils.js.map +1 -1
  27. package/dist/constants/devicePreviews.d.ts +35 -0
  28. package/dist/constants/devicePreviews.d.ts.map +1 -0
  29. package/dist/constants/devicePreviews.js +43 -0
  30. package/dist/constants/devicePreviews.js.map +1 -0
  31. package/dist/constants/themeFonts.d.ts +94 -168
  32. package/dist/constants/themeFonts.d.ts.map +1 -1
  33. package/dist/constants/themeFonts.js +260 -140
  34. package/dist/constants/themeFonts.js.map +1 -1
  35. package/dist/endpoints/themeFonts.d.ts +5 -0
  36. package/dist/endpoints/themeFonts.d.ts.map +1 -0
  37. package/dist/endpoints/themeFonts.js +138 -0
  38. package/dist/endpoints/themeFonts.js.map +1 -0
  39. package/dist/extended-presets.d.ts +0 -4
  40. package/dist/extended-presets.d.ts.map +1 -1
  41. package/dist/extended-presets.js +1 -18
  42. package/dist/extended-presets.js.map +1 -1
  43. package/dist/extended-themes.d.ts.map +1 -1
  44. package/dist/extended-themes.js +428 -0
  45. package/dist/extended-themes.js.map +1 -1
  46. package/dist/fields/AccessibilityAuditField.d.ts +2 -0
  47. package/dist/fields/AccessibilityAuditField.d.ts.map +1 -0
  48. package/dist/fields/AccessibilityAuditField.js +303 -0
  49. package/dist/fields/AccessibilityAuditField.js.map +1 -0
  50. package/dist/fields/AppearancePreviewField.d.ts +2 -0
  51. package/dist/fields/AppearancePreviewField.d.ts.map +1 -0
  52. package/dist/fields/AppearancePreviewField.js +826 -0
  53. package/dist/fields/AppearancePreviewField.js.map +1 -0
  54. package/dist/fields/ColorPickerField.d.ts.map +1 -1
  55. package/dist/fields/ColorPickerField.js +89 -85
  56. package/dist/fields/ColorPickerField.js.map +1 -1
  57. package/dist/fields/FontSelectField.css +155 -0
  58. package/dist/fields/FontSelectField.d.ts +8 -0
  59. package/dist/fields/FontSelectField.d.ts.map +1 -1
  60. package/dist/fields/FontSelectField.js +223 -188
  61. package/dist/fields/FontSelectField.js.map +1 -1
  62. package/dist/fields/PaletteGeneratorField.d.ts +7 -0
  63. package/dist/fields/PaletteGeneratorField.d.ts.map +1 -0
  64. package/dist/fields/PaletteGeneratorField.js +327 -0
  65. package/dist/fields/PaletteGeneratorField.js.map +1 -0
  66. package/dist/fields/StylePresetField.d.ts +3 -0
  67. package/dist/fields/StylePresetField.d.ts.map +1 -0
  68. package/dist/fields/StylePresetField.js +463 -0
  69. package/dist/fields/StylePresetField.js.map +1 -0
  70. package/dist/fields/ThemeColorPickerField.css +115 -35
  71. package/dist/fields/ThemeColorPickerField.d.ts.map +1 -1
  72. package/dist/fields/ThemeColorPickerField.js +204 -70
  73. package/dist/fields/ThemeColorPickerField.js.map +1 -1
  74. package/dist/fields/ThemeExportField.d.ts +6 -0
  75. package/dist/fields/ThemeExportField.d.ts.map +1 -0
  76. package/dist/fields/ThemeExportField.js +202 -0
  77. package/dist/fields/ThemeExportField.js.map +1 -0
  78. package/dist/fields/ThemePresetImportField.d.ts.map +1 -1
  79. package/dist/fields/ThemePresetImportField.js +56 -25
  80. package/dist/fields/ThemePresetImportField.js.map +1 -1
  81. package/dist/fields/ThemePreviewField.css +444 -5
  82. package/dist/fields/ThemePreviewField.d.ts.map +1 -1
  83. package/dist/fields/ThemePreviewField.js +265 -170
  84. package/dist/fields/ThemePreviewField.js.map +1 -1
  85. package/dist/fields/ThemeTokenSelectField.d.ts.map +1 -1
  86. package/dist/fields/ThemeTokenSelectField.js +278 -80
  87. package/dist/fields/ThemeTokenSelectField.js.map +1 -1
  88. package/dist/fields/colorFieldHelpers.d.ts +90 -0
  89. package/dist/fields/colorFieldHelpers.d.ts.map +1 -0
  90. package/dist/fields/colorFieldHelpers.js +133 -0
  91. package/dist/fields/colorFieldHelpers.js.map +1 -0
  92. package/dist/fields/colorModeFields.d.ts +1 -1
  93. package/dist/fields/colorModeFields.d.ts.map +1 -1
  94. package/dist/fields/colorModeFields.js +49 -7
  95. package/dist/fields/colorModeFields.js.map +1 -1
  96. package/dist/fields/themeConfigurationField.d.ts +8 -1
  97. package/dist/fields/themeConfigurationField.d.ts.map +1 -1
  98. package/dist/fields/themeConfigurationField.js +1209 -228
  99. package/dist/fields/themeConfigurationField.js.map +1 -1
  100. package/dist/globals/ThemeSettings/FontPicker/FontPreview.d.ts.map +1 -1
  101. package/dist/globals/ThemeSettings/FontPicker/FontPreview.js +8 -4
  102. package/dist/globals/ThemeSettings/FontPicker/FontPreview.js.map +1 -1
  103. package/dist/globals/ThemeSettings/FontPicker/index.d.ts.map +1 -1
  104. package/dist/globals/ThemeSettings/FontPicker/index.js +81 -26
  105. package/dist/globals/ThemeSettings/FontPicker/index.js.map +1 -1
  106. package/dist/globals/ThemeSettings/FontPicker/styles.css +98 -41
  107. package/dist/globals/ThemeSettings/FontPicker/translations.d.ts +6 -0
  108. package/dist/globals/ThemeSettings/FontPicker/translations.d.ts.map +1 -1
  109. package/dist/globals/ThemeSettings/FontPicker/translations.js +14 -2
  110. package/dist/globals/ThemeSettings/FontPicker/translations.js.map +1 -1
  111. package/dist/globals/ThemeSettings/config.d.ts.map +1 -1
  112. package/dist/globals/ThemeSettings/config.js +76 -79
  113. package/dist/globals/ThemeSettings/config.js.map +1 -1
  114. package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.d.ts.map +1 -1
  115. package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.js +63 -62
  116. package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.js.map +1 -1
  117. package/dist/globals/ThemeSettings/fields/TypographyInfoField.d.ts.map +1 -1
  118. package/dist/globals/ThemeSettings/fields/TypographyInfoField.js +22 -25
  119. package/dist/globals/ThemeSettings/fields/TypographyInfoField.js.map +1 -1
  120. package/dist/hooks/useAppearanceSession.d.ts +50 -0
  121. package/dist/hooks/useAppearanceSession.d.ts.map +1 -0
  122. package/dist/hooks/useAppearanceSession.js +91 -0
  123. package/dist/hooks/useAppearanceSession.js.map +1 -0
  124. package/dist/hooks/useNativeLivePreview.d.ts +15 -0
  125. package/dist/hooks/useNativeLivePreview.d.ts.map +1 -0
  126. package/dist/hooks/useNativeLivePreview.js +18 -0
  127. package/dist/hooks/useNativeLivePreview.js.map +1 -0
  128. package/dist/hooks/useThemeFonts.d.ts +10 -0
  129. package/dist/hooks/useThemeFonts.d.ts.map +1 -0
  130. package/dist/hooks/useThemeFonts.js +36 -0
  131. package/dist/hooks/useThemeFonts.js.map +1 -0
  132. package/dist/hooks/useThemeTranslations.d.ts +13 -0
  133. package/dist/hooks/useThemeTranslations.d.ts.map +1 -0
  134. package/dist/hooks/useThemeTranslations.js +22 -0
  135. package/dist/hooks/useThemeTranslations.js.map +1 -0
  136. package/dist/i18n.d.ts +53 -0
  137. package/dist/i18n.d.ts.map +1 -0
  138. package/dist/i18n.js +53 -0
  139. package/dist/i18n.js.map +1 -0
  140. package/dist/index.d.ts +13 -4
  141. package/dist/index.d.ts.map +1 -1
  142. package/dist/index.js +59 -29
  143. package/dist/index.js.map +1 -1
  144. package/dist/next-fonts.d.ts +3 -0
  145. package/dist/next-fonts.d.ts.map +1 -0
  146. package/dist/next-fonts.js +360 -0
  147. package/dist/next-fonts.js.map +1 -0
  148. package/dist/payload-types.d.ts +34 -6
  149. package/dist/payload-types.d.ts.map +1 -1
  150. package/dist/payload-types.js.map +1 -1
  151. package/dist/presets.d.ts +14 -0
  152. package/dist/presets.d.ts.map +1 -1
  153. package/dist/presets.js.map +1 -1
  154. package/dist/providers/Theme/index.d.ts.map +1 -1
  155. package/dist/providers/Theme/index.js +75 -11
  156. package/dist/providers/Theme/index.js.map +1 -1
  157. package/dist/providers/Theme/themeConfig.d.ts.map +1 -1
  158. package/dist/providers/Theme/themeConfig.js +104 -0
  159. package/dist/providers/Theme/themeConfig.js.map +1 -1
  160. package/dist/providers/Theme/types.d.ts +1 -1
  161. package/dist/providers/Theme/types.d.ts.map +1 -1
  162. package/dist/providers/Theme/types.js +10 -1
  163. package/dist/providers/Theme/types.js.map +1 -1
  164. package/dist/style-presets.d.ts +75 -0
  165. package/dist/style-presets.d.ts.map +1 -0
  166. package/dist/style-presets.js +738 -0
  167. package/dist/style-presets.js.map +1 -0
  168. package/dist/translations.d.ts +164 -1
  169. package/dist/translations.d.ts.map +1 -1
  170. package/dist/translations.js +320 -9
  171. package/dist/translations.js.map +1 -1
  172. package/dist/tweakcn-special-themes.d.ts.map +1 -1
  173. package/dist/tweakcn-special-themes.js +585 -9
  174. package/dist/tweakcn-special-themes.js.map +1 -1
  175. package/dist/types/css.d.js +3 -0
  176. package/dist/types/css.d.js.map +1 -0
  177. package/dist/types.d.ts +26 -0
  178. package/dist/types.d.ts.map +1 -1
  179. package/dist/types.js +1 -1
  180. package/dist/types.js.map +1 -1
  181. package/dist/utilities/getThemeSettings.d.ts.map +1 -1
  182. package/dist/utilities/getThemeSettings.js +2 -14
  183. package/dist/utilities/getThemeSettings.js.map +1 -1
  184. package/dist/utils/contrast.d.ts +63 -0
  185. package/dist/utils/contrast.d.ts.map +1 -0
  186. package/dist/utils/contrast.js +158 -0
  187. package/dist/utils/contrast.js.map +1 -0
  188. package/dist/utils/exportTokens.d.ts +30 -0
  189. package/dist/utils/exportTokens.d.ts.map +1 -0
  190. package/dist/utils/exportTokens.js +183 -0
  191. package/dist/utils/exportTokens.js.map +1 -0
  192. package/dist/utils/generatePalette.d.ts +46 -0
  193. package/dist/utils/generatePalette.d.ts.map +1 -0
  194. package/dist/utils/generatePalette.js +127 -0
  195. package/dist/utils/generatePalette.js.map +1 -0
  196. package/dist/utils/generateThemeCSS.d.ts.map +1 -1
  197. package/dist/utils/generateThemeCSS.js +2 -40
  198. package/dist/utils/generateThemeCSS.js.map +1 -1
  199. package/dist/utils/livePreviewThemeRuntime.d.ts +22 -3
  200. package/dist/utils/livePreviewThemeRuntime.d.ts.map +1 -1
  201. package/dist/utils/livePreviewThemeRuntime.js +48 -15
  202. package/dist/utils/livePreviewThemeRuntime.js.map +1 -1
  203. package/dist/utils/localizedText.d.ts +8 -0
  204. package/dist/utils/localizedText.d.ts.map +1 -0
  205. package/dist/utils/localizedText.js +21 -0
  206. package/dist/utils/localizedText.js.map +1 -0
  207. package/dist/utils/resolveThemeConfiguration.d.ts +60 -1
  208. package/dist/utils/resolveThemeConfiguration.d.ts.map +1 -1
  209. package/dist/utils/resolveThemeConfiguration.js +53 -13
  210. package/dist/utils/resolveThemeConfiguration.js.map +1 -1
  211. package/dist/utils/themeColors.d.ts +3 -0
  212. package/dist/utils/themeColors.d.ts.map +1 -1
  213. package/dist/utils/themeColors.js +30 -1
  214. package/dist/utils/themeColors.js.map +1 -1
  215. package/dist/utils/themeHtmlAttributes.d.ts +32 -12
  216. package/dist/utils/themeHtmlAttributes.d.ts.map +1 -1
  217. package/dist/utils/themeHtmlAttributes.js +38 -5
  218. package/dist/utils/themeHtmlAttributes.js.map +1 -1
  219. package/dist/utils/themeUtils.d.ts +3 -5
  220. package/dist/utils/themeUtils.d.ts.map +1 -1
  221. package/dist/utils/themeUtils.js +474 -6
  222. package/dist/utils/themeUtils.js.map +1 -1
  223. package/dist/utils/tweakcnConverter.d.ts +1 -3
  224. package/dist/utils/tweakcnConverter.d.ts.map +1 -1
  225. package/dist/utils/tweakcnConverter.js +1 -3
  226. package/dist/utils/tweakcnConverter.js.map +1 -1
  227. package/package.json +15 -5
  228. package/dist/components/ThemePreview.d.ts +0 -3
  229. package/dist/components/ThemePreview.d.ts.map +0 -1
  230. package/dist/components/ThemePreview.js +0 -321
  231. package/dist/components/ThemePreview.js.map +0 -1
  232. package/dist/plugin.d.ts +0 -2
  233. package/dist/plugin.d.ts.map +0 -1
  234. package/dist/plugin.js +0 -3
  235. package/dist/plugin.js.map +0 -1
@@ -1,30 +1,33 @@
1
- import { BASE_FONT_SIZE_OPTIONS, BODY_FONT_OPTIONS, HEADING_FONT_OPTIONS, LINE_HEIGHT_OPTIONS } from '../constants/themeFonts.js';
1
+ import { BASE_FONT_SIZE_OPTIONS, BODY_FONT_OPTIONS, HEADING_FONT_OPTIONS, HEADING_WEIGHT_OPTIONS, LETTER_SPACING_OPTIONS, LINE_HEIGHT_OPTIONS } from '../constants/themeFonts.js';
2
+ import { getTranslations } from '../translations.js';
2
3
  import { darkModeField, lightModeField } from './colorModeFields.js';
3
4
  /**
4
5
  * Theme Configuration Field with Theme Selection as default value setter
5
6
  * Theme Selection populates lightMode/darkMode colors automatically
6
7
  */ export function createThemeConfigurationField(options) {
7
- const { themePresets, defaultTheme, includeColorModeToggle, includeCustomCSS, enableAdvancedFeatures = true, useThemePreviewField = true } = options;
8
+ const { themePresets, defaultTheme, includeColorModeToggle, includeCustomCSS, enableAdvancedFeatures = true, useThemePreviewField = true, customThemeConfigurationFields, customThemeConfigurationSections } = options;
8
9
  const fields = [
10
+ // NOTE: the palette generator is rendered *inside* ThemePreviewField (in the
11
+ // preset column, above the preset list) — it is not a separate UI field.
9
12
  {
10
13
  name: 'theme',
11
14
  type: 'text',
12
15
  required: true,
13
16
  defaultValue: defaultTheme,
14
17
  label: {
15
- en: '🎨 Theme Selection',
16
- cs: '🎨 Výběr tématu'
18
+ en: 'Theme Selection',
19
+ cs: 'Výběr motivu'
17
20
  },
18
- validate: (value)=>{
21
+ validate: (value, options)=>{
19
22
  if (typeof value === 'string' && value.trim().length > 0) {
20
23
  return true;
21
24
  }
22
- return 'Select a theme';
25
+ return getTranslations(options?.req?.i18n?.language ?? 'en').ui.selectThemeError;
23
26
  },
24
27
  admin: {
25
28
  description: {
26
- en: 'Select a theme to auto-populate color values. You can customize colors after selection.',
27
- cs: 'Vyberte téma pro automatické předvyplnění barev. Po výběru můžete barvy upravit.'
29
+ en: 'Pick a theme to fill in the colours. You can fine-tune them afterwards.',
30
+ cs: 'Vyberte motiv a barvy se předvyplní. Potom je můžete dál upravovat.'
28
31
  },
29
32
  components: {
30
33
  Field: '@kilivi/payloadcms-theme-management/fields/ThemePreviewField'
@@ -36,206 +39,74 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
36
39
  }
37
40
  }
38
41
  ];
39
- // Border Radius Configuration - Always visible
42
+ // Live preview: colours, fonts and component styles in one place. On wide admins
43
+ // it occupies a sticky right-hand column spanning the whole tab (see
44
+ // ThemePreviewField.css, `.tm-appearance`); on narrow ones it follows the theme picker.
40
45
  fields.push({
41
- type: 'row',
46
+ name: 'appearancePreview',
47
+ type: 'ui',
48
+ admin: {
49
+ components: {
50
+ Field: '@kilivi/payloadcms-theme-management/fields/AppearancePreviewField'
51
+ }
52
+ }
53
+ });
54
+ // Style Preset - visual style selection independent of colors
55
+ fields.push({
56
+ type: 'collapsible',
57
+ label: {
58
+ en: 'Style Preset',
59
+ cs: 'Styl vzhledu'
60
+ },
61
+ admin: {
62
+ initCollapsed: true,
63
+ className: 'tm-section-style-preset',
64
+ description: {
65
+ en: 'Choose a visual style (Brutalism, Swiss, Glassmorphism …) without changing the colour palette.',
66
+ cs: 'Zvolte vizuální styl (Brutalismus, Švýcarský, Glassmorphism …) bez změny barevné palety.'
67
+ }
68
+ },
42
69
  fields: [
43
70
  {
44
- name: 'borderRadius',
45
- type: 'select',
71
+ name: 'stylePreset',
72
+ type: 'text',
46
73
  label: {
47
- en: '📐 Border Radius',
48
- cs: '📐 Zaoblení rohů'
74
+ en: 'Active Style Preset',
75
+ cs: 'Aktivní styl vzhledu'
49
76
  },
50
- defaultValue: 'medium',
51
- options: [
52
- {
53
- label: {
54
- en: 'None (0px)',
55
- cs: 'Žádné (0px)'
56
- },
57
- value: 'none'
58
- },
59
- {
60
- label: {
61
- en: 'Small (0.25rem)',
62
- cs: 'Malé (0.25rem)'
63
- },
64
- value: 'small'
65
- },
66
- {
67
- label: {
68
- en: 'Medium (0.5rem)',
69
- cs: 'Střední (0.5rem)'
70
- },
71
- value: 'medium'
72
- },
73
- {
74
- label: {
75
- en: 'Large (0.75rem)',
76
- cs: 'Velké (0.75rem)'
77
- },
78
- value: 'large'
79
- },
80
- {
81
- label: {
82
- en: 'XL (1rem)',
83
- cs: 'XL (1rem)'
84
- },
85
- value: 'xl'
86
- }
87
- ],
77
+ defaultValue: '',
88
78
  admin: {
89
- description: {
90
- en: 'Default corner rounding for UI elements',
91
- cs: 'Výchozí zaoblení rohů pro UI prvky'
92
- },
93
- width: '50%'
94
- },
95
- dbName: 'border_radius'
96
- },
97
- {
98
- name: 'spacing',
99
- type: 'select',
100
- label: {
101
- en: '📏 Spacing Scale',
102
- cs: '📏 Škála rozestupů'
103
- },
104
- defaultValue: 'medium',
105
- options: [
106
- {
107
- label: {
108
- en: 'Compact',
109
- cs: 'Kompaktní'
110
- },
111
- value: 'compact'
112
- },
113
- {
114
- label: {
115
- en: 'Medium',
116
- cs: 'Střední'
117
- },
118
- value: 'medium'
119
- },
120
- {
121
- label: {
122
- en: 'Comfortable',
123
- cs: 'Pohodlné'
124
- },
125
- value: 'comfortable'
79
+ components: {
80
+ Field: '@kilivi/payloadcms-theme-management/fields/StylePresetField'
126
81
  }
127
- ],
128
- admin: {
129
- description: {
130
- en: 'Global spacing between elements',
131
- cs: 'Globální rozestupy mezi prvky'
132
- },
133
- width: '50%'
134
- },
135
- dbName: 'spacing'
82
+ }
136
83
  }
137
84
  ]
138
85
  });
139
- // Color Mode Settings
140
- if (includeColorModeToggle) {
141
- fields.push({
142
- type: 'collapsible',
143
- label: {
144
- en: '🌗 Color Mode Settings',
145
- cs: '🌗 Nastavení barevného režimu'
146
- },
147
- admin: {
148
- initCollapsed: false,
149
- description: {
150
- en: 'Configure light and dark mode colors. Changes here override theme selection.',
151
- cs: 'Nakonfigurujte barvy světlého a tmavého režimu. Změny zde přepíší výběr tématu.'
152
- }
153
- },
154
- fields: [
155
- {
156
- type: 'row',
157
- fields: [
158
- {
159
- name: 'colorMode',
160
- type: 'select',
161
- label: {
162
- en: 'Default Color Mode',
163
- cs: 'Výchozí barevný režim'
164
- },
165
- defaultValue: 'auto',
166
- options: [
167
- {
168
- label: {
169
- en: 'Auto (System)',
170
- cs: 'Automaticky (Systém)'
171
- },
172
- value: 'auto'
173
- },
174
- {
175
- label: {
176
- en: 'Light',
177
- cs: 'Světlý'
178
- },
179
- value: 'light'
180
- },
181
- {
182
- label: {
183
- en: 'Dark',
184
- cs: 'Tmavý'
185
- },
186
- value: 'dark'
187
- }
188
- ],
189
- admin: {
190
- description: {
191
- en: 'Default color mode for visitors',
192
- cs: 'Výchozí barevný režim pro návštěvníky'
193
- },
194
- width: '50%'
195
- },
196
- dbName: 'color_mode'
197
- },
198
- {
199
- name: 'allowColorModeToggle',
200
- type: 'checkbox',
201
- label: {
202
- en: 'Enable Mode Toggle',
203
- cs: 'Povolit přepínač režimu'
204
- },
205
- defaultValue: true,
206
- admin: {
207
- description: {
208
- en: 'Let visitors switch modes',
209
- cs: 'Umožnit návštěvníkům přepínat režimy'
210
- },
211
- width: '50%'
212
- }
213
- }
214
- ]
215
- },
216
- lightModeField,
217
- darkModeField
218
- ]
219
- });
220
- }
221
86
  // Typography - Always visible
222
87
  fields.push({
223
88
  type: 'collapsible',
224
89
  label: {
225
- en: '🅰️ Typography',
226
- cs: '🅰️ Typografie'
90
+ en: 'Typography',
91
+ cs: 'Typografie'
227
92
  },
228
93
  admin: {
229
94
  initCollapsed: true,
95
+ className: 'tm-section-typography',
230
96
  description: {
231
- en: 'Choose font families and base typography settings. Leave fields on "Use preset" to inherit the theme defaults.',
232
- cs: 'Zvolte rodiny písem a základní typografické nastavení. Hodnota "Použít výchozí" zachová nastavení motivu.'
97
+ en: 'Fonts, text size and the character of headings. "Use theme preset" keeps the colour theme’s defaults.',
98
+ cs: 'Písma, velikost textu a charakter nadpisů. „Podle motivu“ ponechá výchozí nastavení barevného motivu.'
233
99
  }
234
100
  },
235
101
  fields: [
236
102
  {
237
103
  name: 'typography',
238
104
  type: 'group',
105
+ // The collapsible around it already carries the heading.
106
+ label: false,
107
+ admin: {
108
+ hideGutter: true
109
+ },
239
110
  fields: [
240
111
  {
241
112
  type: 'row',
@@ -330,10 +201,7 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
330
201
  cs: 'Základní velikost písma'
331
202
  },
332
203
  defaultValue: 'preset',
333
- options: BASE_FONT_SIZE_OPTIONS.map((option)=>({
334
- label: option.label,
335
- value: option.value
336
- })),
204
+ options: BASE_FONT_SIZE_OPTIONS,
337
205
  admin: {
338
206
  width: '50%'
339
207
  },
@@ -347,55 +215,1166 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
347
215
  cs: 'Řádkování'
348
216
  },
349
217
  defaultValue: 'preset',
350
- options: LINE_HEIGHT_OPTIONS.map((option)=>({
351
- label: option.label,
352
- value: option.value
353
- })),
218
+ options: LINE_HEIGHT_OPTIONS,
354
219
  admin: {
355
220
  width: '50%'
356
221
  },
357
222
  dbName: 'line_height'
358
223
  }
359
224
  ]
225
+ },
226
+ {
227
+ type: 'row',
228
+ fields: [
229
+ {
230
+ name: 'headingWeight',
231
+ type: 'select',
232
+ label: {
233
+ en: 'Heading weight',
234
+ cs: 'Tloušťka nadpisů'
235
+ },
236
+ defaultValue: 'preset',
237
+ options: HEADING_WEIGHT_OPTIONS,
238
+ admin: {
239
+ width: '50%'
240
+ },
241
+ dbName: 'heading_weight'
242
+ },
243
+ {
244
+ name: 'letterSpacing',
245
+ type: 'select',
246
+ label: {
247
+ en: 'Heading letter spacing',
248
+ cs: 'Prostrkání nadpisů'
249
+ },
250
+ defaultValue: 'preset',
251
+ options: LETTER_SPACING_OPTIONS,
252
+ admin: {
253
+ width: '50%',
254
+ description: {
255
+ en: '"Extra wide" also sets headings in capitals.',
256
+ cs: '„Velmi široké“ zároveň převede nadpisy na verzálky.'
257
+ }
258
+ },
259
+ dbName: 'letter_spacing'
260
+ }
261
+ ]
360
262
  }
361
263
  ]
362
264
  }
363
265
  ]
364
266
  });
365
- const customPresetsField = {
366
- type: 'collapsible',
367
- label: {
368
- en: '🧩 Custom Theme Presets',
369
- cs: '🧩 Vlastní motivy'
370
- },
371
- admin: {
372
- initCollapsed: true,
373
- description: {
374
- en: 'Import additional theme presets via JSON to extend or override the defaults. These presets become available instantly in the Theme Selection above.',
375
- cs: 'Importujte další motivy pomocí JSONu a rozšiřte nebo přepište výchozí nabídku. Motivy budou ihned k dispozici ve výběru výše.'
376
- }
377
- },
267
+ // Shape & rhythm — corner rounding and spacing scale
268
+ fields.push({
269
+ type: 'row',
378
270
  fields: [
379
271
  {
380
- name: 'customThemePresets',
381
- type: 'json',
272
+ name: 'borderRadius',
273
+ type: 'select',
382
274
  label: {
383
- en: 'Custom Preset JSON',
384
- cs: 'JSON s vlastními motivy'
275
+ en: 'Border Radius',
276
+ cs: 'Zaoblení rohů'
385
277
  },
386
- admin: {
387
- description: {
388
- en: 'Paste or import an array (or object map) of theme presets. Each entry should include at least a unique "name" and "label" with optional lightMode/darkMode colors.',
389
- cs: 'Vložte nebo importujte pole (či objekt) motivů. Každý motiv musí mít unikátní „name“ a „label“ a volitelně barvy pro světly/tmavý režim.'
278
+ defaultValue: 'medium',
279
+ options: [
280
+ {
281
+ label: {
282
+ en: 'None (0px)',
283
+ cs: 'Žádné (0px)'
284
+ },
285
+ value: 'none'
390
286
  },
391
- components: {
392
- Field: '@kilivi/payloadcms-theme-management/fields/ThemePresetImportField'
393
- }
394
- }
395
- }
396
- ]
397
- };
398
- fields.push(customPresetsField);
287
+ {
288
+ label: {
289
+ en: 'Small (0.25rem)',
290
+ cs: 'Malé (0.25rem)'
291
+ },
292
+ value: 'small'
293
+ },
294
+ {
295
+ label: {
296
+ en: 'Medium (0.5rem)',
297
+ cs: 'Střední (0.5rem)'
298
+ },
299
+ value: 'medium'
300
+ },
301
+ {
302
+ label: {
303
+ en: 'Large (0.75rem)',
304
+ cs: 'Velké (0.75rem)'
305
+ },
306
+ value: 'large'
307
+ },
308
+ {
309
+ label: {
310
+ en: 'XL (1rem)',
311
+ cs: 'XL (1rem)'
312
+ },
313
+ value: 'xl'
314
+ }
315
+ ],
316
+ admin: {
317
+ description: {
318
+ en: 'Default corner rounding for UI elements',
319
+ cs: 'Výchozí zaoblení rohů pro UI prvky'
320
+ },
321
+ width: '50%'
322
+ },
323
+ dbName: 'border_radius'
324
+ },
325
+ {
326
+ name: 'spacing',
327
+ type: 'select',
328
+ label: {
329
+ en: 'Spacing Scale',
330
+ cs: 'Škála rozestupů'
331
+ },
332
+ defaultValue: 'medium',
333
+ options: [
334
+ {
335
+ label: {
336
+ en: 'Compact',
337
+ cs: 'Kompaktní'
338
+ },
339
+ value: 'compact'
340
+ },
341
+ {
342
+ label: {
343
+ en: 'Medium',
344
+ cs: 'Střední'
345
+ },
346
+ value: 'medium'
347
+ },
348
+ {
349
+ label: {
350
+ en: 'Comfortable',
351
+ cs: 'Pohodlné'
352
+ },
353
+ value: 'comfortable'
354
+ }
355
+ ],
356
+ admin: {
357
+ description: {
358
+ en: 'Global spacing between elements',
359
+ cs: 'Globální rozestupy mezi prvky'
360
+ },
361
+ width: '50%'
362
+ },
363
+ dbName: 'spacing'
364
+ }
365
+ ]
366
+ });
367
+ // Visual Effects — glassmorphism, shadows, border style
368
+ fields.push({
369
+ type: 'collapsible',
370
+ label: {
371
+ en: 'Visual Effects',
372
+ cs: 'Vizuální efekty'
373
+ },
374
+ admin: {
375
+ initCollapsed: true,
376
+ className: 'tm-section-effects',
377
+ description: {
378
+ en: 'Configure UI effect style, shadow intensity and border appearance.',
379
+ cs: 'Nastavte styl efektů UI, intenzitu stínů a vzhled okrajů.'
380
+ }
381
+ },
382
+ fields: [
383
+ {
384
+ name: 'visualEffects',
385
+ type: 'group',
386
+ // The collapsible around it already carries the heading.
387
+ label: false,
388
+ admin: {
389
+ hideGutter: true
390
+ },
391
+ fields: [
392
+ {
393
+ type: 'row',
394
+ fields: [
395
+ {
396
+ name: 'effectStyle',
397
+ type: 'select',
398
+ label: {
399
+ en: 'Effect Style',
400
+ cs: 'Styl efektů'
401
+ },
402
+ defaultValue: 'flat',
403
+ options: [
404
+ {
405
+ label: {
406
+ en: 'Flat',
407
+ cs: 'Plochý'
408
+ },
409
+ value: 'flat'
410
+ },
411
+ {
412
+ label: {
413
+ en: 'Elevated (Box shadows)',
414
+ cs: 'Vyvýšený (stíny)'
415
+ },
416
+ value: 'elevated'
417
+ },
418
+ {
419
+ label: {
420
+ en: 'Glassmorphism (Frosted glass)',
421
+ cs: 'Glassmorphism (mléčné sklo)'
422
+ },
423
+ value: 'glass'
424
+ },
425
+ {
426
+ label: {
427
+ en: 'Neumorphism (Soft UI)',
428
+ cs: 'Neumorphism (měkké UI)'
429
+ },
430
+ value: 'neumorphic'
431
+ },
432
+ {
433
+ label: {
434
+ en: 'Claymorphism (Clay-like)',
435
+ cs: 'Claymorphism (hlína)'
436
+ },
437
+ value: 'clay'
438
+ }
439
+ ],
440
+ admin: {
441
+ description: {
442
+ en: 'Visual style applied to cards, panels and interactive elements.',
443
+ cs: 'Vizuální styl karet, panelů a interaktivních prvků.'
444
+ },
445
+ width: '50%'
446
+ },
447
+ dbName: 'effect_style'
448
+ },
449
+ {
450
+ name: 'shadowIntensity',
451
+ type: 'select',
452
+ label: {
453
+ en: 'Shadow Intensity',
454
+ cs: 'Intenzita stínů'
455
+ },
456
+ defaultValue: 'medium',
457
+ options: [
458
+ {
459
+ label: {
460
+ en: 'None',
461
+ cs: 'Žádné'
462
+ },
463
+ value: 'none'
464
+ },
465
+ {
466
+ label: {
467
+ en: 'Subtle',
468
+ cs: 'Jemné'
469
+ },
470
+ value: 'subtle'
471
+ },
472
+ {
473
+ label: {
474
+ en: 'Medium',
475
+ cs: 'Střední'
476
+ },
477
+ value: 'medium'
478
+ },
479
+ {
480
+ label: {
481
+ en: 'Strong',
482
+ cs: 'Silné'
483
+ },
484
+ value: 'strong'
485
+ },
486
+ {
487
+ label: {
488
+ en: 'Dramatic',
489
+ cs: 'Dramatické'
490
+ },
491
+ value: 'dramatic'
492
+ }
493
+ ],
494
+ admin: {
495
+ description: {
496
+ en: 'Global shadow depth for elevated elements.',
497
+ cs: 'Globální hloubka stínů pro vyvýšené prvky.'
498
+ },
499
+ width: '50%'
500
+ },
501
+ dbName: 'shadow_intensity'
502
+ }
503
+ ]
504
+ },
505
+ {
506
+ type: 'row',
507
+ fields: [
508
+ {
509
+ name: 'backdropBlur',
510
+ type: 'select',
511
+ label: {
512
+ en: 'Backdrop Blur',
513
+ cs: 'Rozmazání pozadí'
514
+ },
515
+ defaultValue: 'none',
516
+ options: [
517
+ {
518
+ label: {
519
+ en: 'None',
520
+ cs: 'Žádné'
521
+ },
522
+ value: 'none'
523
+ },
524
+ {
525
+ label: {
526
+ en: 'Slight (4px)',
527
+ cs: 'Jemné (4px)'
528
+ },
529
+ value: 'slight'
530
+ },
531
+ {
532
+ label: {
533
+ en: 'Medium (8px)',
534
+ cs: 'Střední (8px)'
535
+ },
536
+ value: 'medium'
537
+ },
538
+ {
539
+ label: {
540
+ en: 'Strong (16px)',
541
+ cs: 'Silné (16px)'
542
+ },
543
+ value: 'strong'
544
+ },
545
+ {
546
+ label: {
547
+ en: 'Heavy (24px)',
548
+ cs: 'Intenzivní (24px)'
549
+ },
550
+ value: 'heavy'
551
+ }
552
+ ],
553
+ admin: {
554
+ description: {
555
+ en: 'Blur behind translucent glass panels.',
556
+ cs: 'Rozostření za průsvitnými skleněnými panely.'
557
+ },
558
+ width: '50%',
559
+ condition: (_, siblingData)=>siblingData?.effectStyle === 'glass'
560
+ },
561
+ dbName: 'backdrop_blur'
562
+ },
563
+ {
564
+ name: 'glassOpacity',
565
+ type: 'number',
566
+ label: {
567
+ en: 'Glass Opacity (%)',
568
+ cs: 'Průhlednost skla (%)'
569
+ },
570
+ defaultValue: 60,
571
+ min: 0,
572
+ max: 100,
573
+ admin: {
574
+ description: {
575
+ en: 'Card/panel opacity when using glass effect (0 = fully transparent, 100 = opaque).',
576
+ cs: 'Průhlednost karet/panelů při skleněném efektu (0 = plně průhledné, 100 = neprůhledné).'
577
+ },
578
+ width: '50%',
579
+ condition: (_, siblingData)=>siblingData?.effectStyle === 'glass'
580
+ }
581
+ }
582
+ ]
583
+ },
584
+ {
585
+ type: 'row',
586
+ fields: [
587
+ {
588
+ name: 'borderStyle',
589
+ type: 'select',
590
+ label: {
591
+ en: 'Border Style',
592
+ cs: 'Styl okrajů'
593
+ },
594
+ defaultValue: 'solid',
595
+ options: [
596
+ {
597
+ label: {
598
+ en: 'None',
599
+ cs: 'Žádné'
600
+ },
601
+ value: 'none'
602
+ },
603
+ {
604
+ label: {
605
+ en: 'Solid',
606
+ cs: 'Plné'
607
+ },
608
+ value: 'solid'
609
+ },
610
+ {
611
+ label: {
612
+ en: 'Dashed',
613
+ cs: 'Čárkované'
614
+ },
615
+ value: 'dashed'
616
+ },
617
+ {
618
+ label: {
619
+ en: 'Dotted',
620
+ cs: 'Tečkované'
621
+ },
622
+ value: 'dotted'
623
+ },
624
+ {
625
+ label: {
626
+ en: 'Double',
627
+ cs: 'Dvojité'
628
+ },
629
+ value: 'double'
630
+ }
631
+ ],
632
+ admin: {
633
+ description: {
634
+ en: 'Default border style for cards, inputs and dividers.',
635
+ cs: 'Výchozí styl okrajů pro karty, vstupy a oddělovače.'
636
+ },
637
+ width: '50%'
638
+ },
639
+ dbName: 'border_style'
640
+ },
641
+ {
642
+ name: 'borderWidth',
643
+ type: 'select',
644
+ label: {
645
+ en: 'Border Width',
646
+ cs: 'Tloušťka okraje'
647
+ },
648
+ defaultValue: '1px',
649
+ options: [
650
+ {
651
+ label: '0px',
652
+ value: '0px'
653
+ },
654
+ {
655
+ label: '1px',
656
+ value: '1px'
657
+ },
658
+ {
659
+ label: '2px',
660
+ value: '2px'
661
+ },
662
+ {
663
+ label: '3px',
664
+ value: '3px'
665
+ },
666
+ {
667
+ label: '4px',
668
+ value: '4px'
669
+ }
670
+ ],
671
+ admin: {
672
+ width: '50%',
673
+ condition: (_, siblingData)=>siblingData?.borderStyle !== 'none'
674
+ },
675
+ dbName: 'border_width'
676
+ }
677
+ ]
678
+ }
679
+ ]
680
+ }
681
+ ]
682
+ });
683
+ // Component Styles — buttons, cards, images, icons
684
+ fields.push({
685
+ type: 'collapsible',
686
+ label: {
687
+ en: 'Component Styles',
688
+ cs: 'Styly komponent'
689
+ },
690
+ admin: {
691
+ initCollapsed: true,
692
+ className: 'tm-section-components',
693
+ description: {
694
+ en: 'Customize button variant, card style and navbar appearance.',
695
+ cs: 'Přizpůsobte styl tlačítek, karet a navigační lišty.'
696
+ }
697
+ },
698
+ fields: [
699
+ {
700
+ name: 'componentStyles',
701
+ type: 'group',
702
+ // The collapsible around it already carries the heading.
703
+ label: false,
704
+ admin: {
705
+ hideGutter: true
706
+ },
707
+ fields: [
708
+ {
709
+ type: 'row',
710
+ fields: [
711
+ {
712
+ name: 'buttonVariant',
713
+ type: 'select',
714
+ label: {
715
+ en: 'Primary Button Style',
716
+ cs: 'Styl primárního tlačítka'
717
+ },
718
+ defaultValue: 'filled',
719
+ options: [
720
+ {
721
+ label: {
722
+ en: 'Filled (solid)',
723
+ cs: 'Plné (solid)'
724
+ },
725
+ value: 'filled'
726
+ },
727
+ {
728
+ label: {
729
+ en: 'Outlined',
730
+ cs: 'Ohraničené'
731
+ },
732
+ value: 'outlined'
733
+ },
734
+ {
735
+ label: {
736
+ en: 'Ghost (transparent)',
737
+ cs: 'Průhledné'
738
+ },
739
+ value: 'ghost'
740
+ },
741
+ {
742
+ label: {
743
+ en: 'Gradient',
744
+ cs: 'Přechodové'
745
+ },
746
+ value: 'gradient'
747
+ },
748
+ {
749
+ label: {
750
+ en: 'Pill (full rounded)',
751
+ cs: 'Pill (plné zaoblení)'
752
+ },
753
+ value: 'pill'
754
+ },
755
+ {
756
+ label: {
757
+ en: 'Brutalist (thick border)',
758
+ cs: 'Brutalistické (silný okraj)'
759
+ },
760
+ value: 'brutal'
761
+ }
762
+ ],
763
+ admin: {
764
+ description: {
765
+ en: 'Default visual style of primary action buttons.',
766
+ cs: 'Výchozí vizuální styl primárních tlačítek.'
767
+ },
768
+ width: '50%'
769
+ },
770
+ dbName: 'button_variant'
771
+ },
772
+ {
773
+ name: 'buttonSize',
774
+ type: 'select',
775
+ label: {
776
+ en: 'Button Size',
777
+ cs: 'Velikost tlačítka'
778
+ },
779
+ defaultValue: 'medium',
780
+ options: [
781
+ {
782
+ label: {
783
+ en: 'Small',
784
+ cs: 'Malé'
785
+ },
786
+ value: 'small'
787
+ },
788
+ {
789
+ label: {
790
+ en: 'Medium',
791
+ cs: 'Střední'
792
+ },
793
+ value: 'medium'
794
+ },
795
+ {
796
+ label: {
797
+ en: 'Large',
798
+ cs: 'Velké'
799
+ },
800
+ value: 'large'
801
+ },
802
+ {
803
+ label: {
804
+ en: 'XL',
805
+ cs: 'XL'
806
+ },
807
+ value: 'xl'
808
+ }
809
+ ],
810
+ admin: {
811
+ description: {
812
+ en: 'Default padding / font-size of buttons.',
813
+ cs: 'Výchozí odsazení a velikost písma tlačítek.'
814
+ },
815
+ width: '50%'
816
+ },
817
+ dbName: 'button_size'
818
+ }
819
+ ]
820
+ },
821
+ {
822
+ type: 'row',
823
+ fields: [
824
+ {
825
+ name: 'cardStyle',
826
+ type: 'select',
827
+ label: {
828
+ en: 'Card Style',
829
+ cs: 'Styl karet'
830
+ },
831
+ defaultValue: 'elevated',
832
+ options: [
833
+ {
834
+ label: {
835
+ en: 'Elevated (shadow)',
836
+ cs: 'Vyvýšené (stín)'
837
+ },
838
+ value: 'elevated'
839
+ },
840
+ {
841
+ label: {
842
+ en: 'Flat (no shadow)',
843
+ cs: 'Ploché (bez stínu)'
844
+ },
845
+ value: 'flat'
846
+ },
847
+ {
848
+ label: {
849
+ en: 'Bordered',
850
+ cs: 'S okrajem'
851
+ },
852
+ value: 'bordered'
853
+ },
854
+ {
855
+ label: {
856
+ en: 'Glass',
857
+ cs: 'Skleněné'
858
+ },
859
+ value: 'glass'
860
+ },
861
+ {
862
+ label: {
863
+ en: 'Neumorphic',
864
+ cs: 'Neumorfní'
865
+ },
866
+ value: 'neumorphic'
867
+ },
868
+ {
869
+ label: {
870
+ en: 'Gradient border',
871
+ cs: 'Přechodový okraj'
872
+ },
873
+ value: 'gradient-border'
874
+ }
875
+ ],
876
+ admin: {
877
+ description: {
878
+ en: 'Default card/panel visual style across the website.',
879
+ cs: 'Výchozí vizuální styl karet a panelů na webu.'
880
+ },
881
+ width: '50%'
882
+ },
883
+ dbName: 'card_style'
884
+ },
885
+ {
886
+ name: 'cardHoverEffect',
887
+ type: 'select',
888
+ label: {
889
+ en: 'Card Hover Effect',
890
+ cs: 'Efekt při najetí na kartu'
891
+ },
892
+ defaultValue: 'lift',
893
+ options: [
894
+ {
895
+ label: {
896
+ en: 'None',
897
+ cs: 'Žádný'
898
+ },
899
+ value: 'none'
900
+ },
901
+ {
902
+ label: {
903
+ en: 'Lift (translate up)',
904
+ cs: 'Zvednutí (posun nahoru)'
905
+ },
906
+ value: 'lift'
907
+ },
908
+ {
909
+ label: {
910
+ en: 'Scale up',
911
+ cs: 'Zvětšení'
912
+ },
913
+ value: 'scale'
914
+ },
915
+ {
916
+ label: {
917
+ en: 'Shadow grow',
918
+ cs: 'Větší stín'
919
+ },
920
+ value: 'shadow'
921
+ },
922
+ {
923
+ label: {
924
+ en: 'Border glow',
925
+ cs: 'Zářící okraj'
926
+ },
927
+ value: 'glow'
928
+ },
929
+ {
930
+ label: {
931
+ en: 'Tilt 3D',
932
+ cs: '3D náklon'
933
+ },
934
+ value: 'tilt'
935
+ }
936
+ ],
937
+ admin: {
938
+ width: '50%'
939
+ },
940
+ dbName: 'card_hover_effect'
941
+ }
942
+ ]
943
+ },
944
+ {
945
+ type: 'row',
946
+ fields: [
947
+ {
948
+ name: 'navbarStyle',
949
+ type: 'select',
950
+ label: {
951
+ en: 'Navbar Style',
952
+ cs: 'Styl navigace'
953
+ },
954
+ defaultValue: 'solid',
955
+ options: [
956
+ {
957
+ label: {
958
+ en: 'Solid',
959
+ cs: 'Plná'
960
+ },
961
+ value: 'solid'
962
+ },
963
+ {
964
+ label: {
965
+ en: 'Transparent (on hero)',
966
+ cs: 'Průhledná (nad hero)'
967
+ },
968
+ value: 'transparent'
969
+ },
970
+ {
971
+ label: {
972
+ en: 'Blurred glass',
973
+ cs: 'Rozmazané sklo'
974
+ },
975
+ value: 'blur'
976
+ },
977
+ {
978
+ label: {
979
+ en: 'Floating',
980
+ cs: 'Plovoucí'
981
+ },
982
+ value: 'floating'
983
+ },
984
+ {
985
+ label: {
986
+ en: 'Minimal (bottom border only)',
987
+ cs: 'Minimalistická (jen spodní okraj)'
988
+ },
989
+ value: 'minimal'
990
+ }
991
+ ],
992
+ admin: {
993
+ description: {
994
+ en: 'Navigation bar visual style.',
995
+ cs: 'Vizuální styl navigační lišty.'
996
+ },
997
+ width: '50%'
998
+ },
999
+ dbName: 'navbar_style'
1000
+ },
1001
+ {
1002
+ name: 'footerStyle',
1003
+ type: 'select',
1004
+ label: {
1005
+ en: 'Footer Style',
1006
+ cs: 'Styl patičky'
1007
+ },
1008
+ defaultValue: 'standard',
1009
+ options: [
1010
+ {
1011
+ label: {
1012
+ en: 'Standard',
1013
+ cs: 'Standardní'
1014
+ },
1015
+ value: 'standard'
1016
+ },
1017
+ {
1018
+ label: {
1019
+ en: 'Minimal',
1020
+ cs: 'Minimalistická'
1021
+ },
1022
+ value: 'minimal'
1023
+ },
1024
+ {
1025
+ label: {
1026
+ en: 'Dark',
1027
+ cs: 'Tmavá'
1028
+ },
1029
+ value: 'dark'
1030
+ },
1031
+ {
1032
+ label: {
1033
+ en: 'Gradient top edge',
1034
+ cs: 'Gradient horní hrana'
1035
+ },
1036
+ value: 'gradient-top'
1037
+ },
1038
+ {
1039
+ label: {
1040
+ en: 'Full colour',
1041
+ cs: 'Plná barva'
1042
+ },
1043
+ value: 'full-color'
1044
+ }
1045
+ ],
1046
+ admin: {
1047
+ description: {
1048
+ en: 'Footer visual style.',
1049
+ cs: 'Vizuální styl patičky.'
1050
+ },
1051
+ width: '50%'
1052
+ },
1053
+ dbName: 'footer_style'
1054
+ }
1055
+ ]
1056
+ },
1057
+ {
1058
+ type: 'row',
1059
+ fields: [
1060
+ {
1061
+ name: 'imageStyle',
1062
+ type: 'select',
1063
+ label: {
1064
+ en: 'Image Style',
1065
+ cs: 'Styl obrázků'
1066
+ },
1067
+ defaultValue: 'default',
1068
+ options: [
1069
+ {
1070
+ label: {
1071
+ en: 'Default',
1072
+ cs: 'Výchozí'
1073
+ },
1074
+ value: 'default'
1075
+ },
1076
+ {
1077
+ label: {
1078
+ en: 'Rounded',
1079
+ cs: 'Zaoblené'
1080
+ },
1081
+ value: 'rounded'
1082
+ },
1083
+ {
1084
+ label: {
1085
+ en: 'Circle',
1086
+ cs: 'Kruhové'
1087
+ },
1088
+ value: 'circle'
1089
+ },
1090
+ {
1091
+ label: {
1092
+ en: 'Vignette',
1093
+ cs: 'Vinětace'
1094
+ },
1095
+ value: 'vignette'
1096
+ },
1097
+ {
1098
+ label: {
1099
+ en: 'Grayscale',
1100
+ cs: 'Černobílé'
1101
+ },
1102
+ value: 'grayscale'
1103
+ },
1104
+ {
1105
+ label: {
1106
+ en: 'Duotone',
1107
+ cs: 'Duotón'
1108
+ },
1109
+ value: 'duotone'
1110
+ },
1111
+ {
1112
+ label: {
1113
+ en: 'Polaroid',
1114
+ cs: 'Polaroid'
1115
+ },
1116
+ value: 'polaroid'
1117
+ }
1118
+ ],
1119
+ admin: {
1120
+ description: {
1121
+ en: 'How images inside page content are shown.',
1122
+ cs: 'Jak se zobrazují obrázky v obsahu stránek.'
1123
+ },
1124
+ width: '50%'
1125
+ },
1126
+ dbName: 'image_style'
1127
+ },
1128
+ {
1129
+ name: 'linkStyle',
1130
+ type: 'select',
1131
+ label: {
1132
+ en: 'Link Style',
1133
+ cs: 'Styl odkazů'
1134
+ },
1135
+ defaultValue: 'underline-hover',
1136
+ options: [
1137
+ {
1138
+ label: {
1139
+ en: 'Always underlined',
1140
+ cs: 'Vždy podtržené'
1141
+ },
1142
+ value: 'underline'
1143
+ },
1144
+ {
1145
+ label: {
1146
+ en: 'Underline on hover',
1147
+ cs: 'Podtržení při najetí'
1148
+ },
1149
+ value: 'underline-hover'
1150
+ },
1151
+ {
1152
+ label: {
1153
+ en: 'No underline',
1154
+ cs: 'Bez podtržení'
1155
+ },
1156
+ value: 'none'
1157
+ },
1158
+ {
1159
+ label: {
1160
+ en: 'Highlight',
1161
+ cs: 'Zvýraznění'
1162
+ },
1163
+ value: 'highlight'
1164
+ },
1165
+ {
1166
+ label: {
1167
+ en: 'Animated underline',
1168
+ cs: 'Animované podtržení'
1169
+ },
1170
+ value: 'animated'
1171
+ }
1172
+ ],
1173
+ admin: {
1174
+ description: {
1175
+ en: 'How links inside text look.',
1176
+ cs: 'Jak vypadají odkazy v textu.'
1177
+ },
1178
+ width: '50%'
1179
+ },
1180
+ dbName: 'link_style'
1181
+ }
1182
+ ]
1183
+ },
1184
+ {
1185
+ type: 'row',
1186
+ fields: [
1187
+ {
1188
+ name: 'enableScrollReveal',
1189
+ type: 'checkbox',
1190
+ label: {
1191
+ en: 'Scroll reveal animations',
1192
+ cs: 'Animace při scrollování'
1193
+ },
1194
+ defaultValue: true,
1195
+ admin: {
1196
+ description: {
1197
+ en: 'Reveal elements as they enter the viewport.',
1198
+ cs: 'Odhalovat prvky při vstupu do viewportu.'
1199
+ },
1200
+ width: '50%'
1201
+ }
1202
+ },
1203
+ {
1204
+ name: 'enableHoverAnimations',
1205
+ type: 'checkbox',
1206
+ label: {
1207
+ en: 'Hover micro-animations',
1208
+ cs: 'Hover mikro-animace'
1209
+ },
1210
+ defaultValue: true,
1211
+ admin: {
1212
+ description: {
1213
+ en: 'Subtle motion on interactive elements when hovered.',
1214
+ cs: 'Jemný pohyb interaktivních prvků při najetí.'
1215
+ },
1216
+ width: '50%'
1217
+ }
1218
+ }
1219
+ ]
1220
+ }
1221
+ ]
1222
+ }
1223
+ ]
1224
+ });
1225
+ // Color Mode Settings
1226
+ if (includeColorModeToggle) {
1227
+ fields.push({
1228
+ type: 'collapsible',
1229
+ label: {
1230
+ en: 'Color Mode Settings',
1231
+ cs: 'Nastavení barevného režimu'
1232
+ },
1233
+ admin: {
1234
+ className: 'tm-section-colors',
1235
+ // Fine-tuning: collapsed by default so presets and the preview lead the tab.
1236
+ initCollapsed: true,
1237
+ description: {
1238
+ en: 'Individual light and dark mode colours. Edits here take precedence over the theme.',
1239
+ cs: 'Jednotlivé barvy světlého a tmavého režimu. Úpravy zde mají přednost před motivem.'
1240
+ }
1241
+ },
1242
+ fields: [
1243
+ {
1244
+ type: 'row',
1245
+ fields: [
1246
+ {
1247
+ name: 'colorMode',
1248
+ type: 'select',
1249
+ label: {
1250
+ en: 'Default Color Mode',
1251
+ cs: 'Výchozí barevný režim'
1252
+ },
1253
+ defaultValue: 'auto',
1254
+ options: [
1255
+ {
1256
+ label: {
1257
+ en: 'Auto (System)',
1258
+ cs: 'Automaticky (Systém)'
1259
+ },
1260
+ value: 'auto'
1261
+ },
1262
+ {
1263
+ label: {
1264
+ en: 'Light',
1265
+ cs: 'Světlý'
1266
+ },
1267
+ value: 'light'
1268
+ },
1269
+ {
1270
+ label: {
1271
+ en: 'Dark',
1272
+ cs: 'Tmavý'
1273
+ },
1274
+ value: 'dark'
1275
+ }
1276
+ ],
1277
+ admin: {
1278
+ description: {
1279
+ en: 'Default color mode for visitors',
1280
+ cs: 'Výchozí barevný režim pro návštěvníky'
1281
+ },
1282
+ width: '50%'
1283
+ },
1284
+ dbName: 'color_mode'
1285
+ },
1286
+ {
1287
+ name: 'allowColorModeToggle',
1288
+ type: 'checkbox',
1289
+ label: {
1290
+ en: 'Enable Mode Toggle',
1291
+ cs: 'Povolit přepínač režimu'
1292
+ },
1293
+ defaultValue: true,
1294
+ admin: {
1295
+ description: {
1296
+ en: 'Let visitors switch modes',
1297
+ cs: 'Umožnit návštěvníkům přepínat režimy'
1298
+ },
1299
+ width: '50%'
1300
+ }
1301
+ }
1302
+ ]
1303
+ },
1304
+ lightModeField,
1305
+ darkModeField,
1306
+ {
1307
+ name: 'accessibilityAudit',
1308
+ type: 'ui',
1309
+ admin: {
1310
+ components: {
1311
+ Field: '@kilivi/payloadcms-theme-management/fields/AccessibilityAuditField'
1312
+ }
1313
+ }
1314
+ },
1315
+ {
1316
+ name: 'themeExport',
1317
+ type: 'ui',
1318
+ admin: {
1319
+ components: {
1320
+ Field: '@kilivi/payloadcms-theme-management/fields/ThemeExportField'
1321
+ }
1322
+ }
1323
+ }
1324
+ ]
1325
+ });
1326
+ }
1327
+ const customPresetsField = {
1328
+ type: 'collapsible',
1329
+ label: {
1330
+ en: 'Custom Theme Presets',
1331
+ cs: 'Vlastní motivy'
1332
+ },
1333
+ admin: {
1334
+ initCollapsed: true,
1335
+ className: 'tm-section-custom-presets',
1336
+ description: {
1337
+ en: 'For developers: import extra colour themes as JSON. They appear in the theme list at the top straight away.',
1338
+ cs: 'Pro vývojáře: import dalších barevných motivů ve formátu JSON. Hned se objeví v seznamu motivů nahoře.'
1339
+ }
1340
+ },
1341
+ fields: [
1342
+ {
1343
+ name: 'customThemePresets',
1344
+ type: 'json',
1345
+ label: {
1346
+ en: 'Custom Preset JSON',
1347
+ cs: 'JSON s vlastními motivy'
1348
+ },
1349
+ admin: {
1350
+ description: {
1351
+ en: 'Paste or import an array (or object map) of theme presets. Each entry should include at least a unique "name" and "label" with optional lightMode/darkMode colors.',
1352
+ cs: 'Vložte nebo importujte pole (či objekt) motivů. Každý motiv musí mít unikátní „name“ a „label“ a volitelně barvy pro světlý a tmavý režim.'
1353
+ },
1354
+ components: {
1355
+ Field: '@kilivi/payloadcms-theme-management/fields/ThemePresetImportField'
1356
+ }
1357
+ }
1358
+ }
1359
+ ]
1360
+ };
1361
+ fields.push(customPresetsField);
1362
+ if (customThemeConfigurationFields?.length) {
1363
+ fields.push(...customThemeConfigurationFields);
1364
+ }
1365
+ if (customThemeConfigurationSections?.length) {
1366
+ customThemeConfigurationSections.forEach((section)=>{
1367
+ fields.push({
1368
+ type: 'collapsible',
1369
+ label: section.label,
1370
+ admin: {
1371
+ initCollapsed: section.initCollapsed ?? true,
1372
+ description: section.description
1373
+ },
1374
+ fields: section.fields
1375
+ });
1376
+ });
1377
+ }
399
1378
  // Advanced Settings (when using extended theme configuration)
400
1379
  if (enableAdvancedFeatures) {
401
1380
  const advancedFields = [
@@ -467,11 +1446,12 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
467
1446
  fields.push({
468
1447
  type: 'collapsible',
469
1448
  label: {
470
- en: '⚙️ Advanced Settings',
471
- cs: '⚙️ Pokročilé nastavení'
1449
+ en: 'Advanced Settings',
1450
+ cs: 'Pokročilé nastavení'
472
1451
  },
473
1452
  admin: {
474
- initCollapsed: true
1453
+ initCollapsed: true,
1454
+ className: 'tm-section-advanced'
475
1455
  },
476
1456
  fields: advancedFields
477
1457
  });
@@ -479,17 +1459,18 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
479
1459
  // Return as tab configuration to be injected into tabs structure
480
1460
  return {
481
1461
  label: {
482
- en: '🎨 Appearance Settings',
483
- cs: '🎨 Nastavení vzhledu'
1462
+ en: 'Appearance Settings',
1463
+ cs: 'Nastavení vzhledu'
484
1464
  },
485
1465
  fields: [
486
1466
  {
487
1467
  name: 'themeConfiguration',
488
1468
  type: 'group',
489
1469
  admin: {
1470
+ className: 'tm-appearance',
490
1471
  description: {
491
- en: 'Configure website appearance and styling',
492
- cs: 'Nakonfigurujte vzhled a stylování webu'
1472
+ en: 'Appearance and style of the whole website',
1473
+ cs: 'Vzhled a styl celého webu'
493
1474
  }
494
1475
  },
495
1476
  fields