@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,9 +1,105 @@
1
1
  /* Theme Preview Field Styles */
2
2
 
3
- .theme-preset-list {
3
+ /* ─── Layout: preset column + live preview always share one row ────────────
4
+ Grid (not flex-wrap) so the preview panel can never drop below the preset
5
+ list on wide screens; it collapses to a single column only on narrow admin
6
+ viewports.
7
+ ───────────────────────────────────────────────────────────────────────── */
8
+ .theme-preview-layout {
9
+ display: grid;
10
+ grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
11
+ gap: 16px;
12
+ align-items: start;
13
+ }
14
+
15
+ .theme-preview-layout--single {
16
+ grid-template-columns: minmax(0, 1fr);
17
+ }
18
+
19
+ @media (max-width: 1024px) {
20
+ .theme-preview-layout {
21
+ grid-template-columns: minmax(0, 1fr);
22
+ }
23
+ }
24
+
25
+ .theme-preset-column {
4
26
  display: grid;
5
27
  gap: 10px;
6
- max-height: 600px;
28
+ min-width: 0;
29
+ }
30
+
31
+ .theme-preview-panel {
32
+ min-width: 0;
33
+ position: sticky;
34
+ top: 96px;
35
+ align-self: start;
36
+ }
37
+
38
+ /* ─── Collapsible preset picker header ───────────────────────────────────── */
39
+ .theme-preset-summary {
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 10px;
43
+ width: 100%;
44
+ padding: 8px 12px;
45
+ border-radius: 10px;
46
+ border: 1px solid var(--theme-elevation-200, #e2e8f0);
47
+ background-color: var(--theme-elevation-50, #f8fafc);
48
+ color: var(--theme-elevation-800, #1e293b);
49
+ cursor: pointer;
50
+ text-align: left;
51
+ transition: border-color 120ms ease, background-color 120ms ease;
52
+ }
53
+
54
+ .theme-preset-summary:hover {
55
+ border-color: var(--theme-elevation-300, #cbd5e1);
56
+ background-color: var(--theme-elevation-100, #f1f5f9);
57
+ }
58
+
59
+ .theme-preset-summary.is-open {
60
+ border-color: var(--theme-elevation-300, #cbd5e1);
61
+ }
62
+
63
+ .theme-preset-summary__info {
64
+ display: flex;
65
+ flex-direction: column;
66
+ gap: 2px;
67
+ min-width: 0;
68
+ flex: 1 1 auto;
69
+ }
70
+
71
+ .theme-preset-summary .theme-swatches {
72
+ flex: 0 0 auto;
73
+ }
74
+
75
+ .theme-preset-summary .color-swatch {
76
+ width: 16px;
77
+ height: 16px;
78
+ }
79
+
80
+ /* ─── Preview visibility toggle ──────────────────────────────────────────── */
81
+ .theme-preview-toggle {
82
+ display: flex;
83
+ align-items: center;
84
+ gap: 5px;
85
+ font-size: 11px;
86
+ font-weight: 500;
87
+ padding: 3px 10px;
88
+ border-radius: 6px;
89
+ border: 1px solid var(--theme-elevation-200, #e2e8f0);
90
+ background: var(--theme-elevation-50, #f8fafc);
91
+ color: var(--theme-elevation-600, #475569);
92
+ cursor: pointer;
93
+ }
94
+
95
+ .theme-preview-toggle:hover {
96
+ border-color: var(--theme-elevation-300, #cbd5e1);
97
+ }
98
+
99
+ .theme-preset-list {
100
+ display: grid;
101
+ gap: 6px;
102
+ max-height: 420px;
7
103
  overflow-y: auto;
8
104
  padding-right: 8px;
9
105
 
@@ -36,7 +132,7 @@
36
132
  display: flex;
37
133
  align-items: center;
38
134
  justify-content: space-between;
39
- padding: 12px 14px;
135
+ padding: 8px 12px;
40
136
  border-radius: 10px;
41
137
  border: 1px solid var(--theme-elevation-200, #e2e8f0);
42
138
  background-color: var(--theme-input-bg, #ffffff);
@@ -86,9 +182,352 @@
86
182
  }
87
183
 
88
184
  .color-swatch {
89
- width: 26px;
90
- height: 26px;
185
+ width: 20px;
186
+ height: 20px;
91
187
  border-radius: 999px;
92
188
  border: 1px solid rgba(15, 23, 42, 0.12);
93
189
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
94
190
  }
191
+
192
+ /* ─── Section header icons (inlined lucide SVG via mask-image; no CDN, CSP-safe) ──────────────────────
193
+ Payload v3 collapsible structure: .collapsible.{className} > .collapsible__toggle-wrap
194
+ The toggle-wrap is already display:flex so ::before inserts as first flex item.
195
+ ─────────────────────────────────────────────────────────────────────────── */
196
+
197
+ .tm-section-typography .collapsible__toggle-wrap::before,
198
+ .tm-section-effects .collapsible__toggle-wrap::before,
199
+ .tm-section-style-preset .collapsible__toggle-wrap::before,
200
+ .tm-section-custom-presets .collapsible__toggle-wrap::before,
201
+ .tm-section-components .collapsible__toggle-wrap::before,
202
+ .tm-section-advanced .collapsible__toggle-wrap::before {
203
+ content: '';
204
+ display: inline-flex;
205
+ width: 15px;
206
+ height: 15px;
207
+ flex-shrink: 0;
208
+ background-color: currentColor;
209
+ mask-repeat: no-repeat;
210
+ mask-position: center;
211
+ mask-size: contain;
212
+ opacity: 0.55;
213
+ }
214
+
215
+ .tm-section-typography .collapsible__toggle-wrap::before {
216
+ mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%224%207%204%204%2020%204%2020%207%22%3E%3C%2Fpolyline%3E%3Cline%20x1%3D%229%22%20x2%3D%2215%22%20y1%3D%2220%22%20y2%3D%2220%22%3E%3C%2Fline%3E%3Cline%20x1%3D%2212%22%20x2%3D%2212%22%20y1%3D%224%22%20y2%3D%2220%22%3E%3C%2Fline%3E%3C%2Fsvg%3E");
217
+ }
218
+
219
+ .tm-section-effects .collapsible__toggle-wrap::before {
220
+ mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9.937%2015.5A2%202%200%200%200%208.5%2014.063l-6.135-1.582a.5.5%200%200%201%200-.962L8.5%209.936A2%202%200%200%200%209.937%208.5l1.582-6.135a.5.5%200%200%201%20.963%200L14.063%208.5A2%202%200%200%200%2015.5%209.937l6.135%201.581a.5.5%200%200%201%200%20.964L15.5%2014.063a2%202%200%200%200-1.437%201.437l-1.582%206.135a.5.5%200%200%201-.963%200z%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M20%203v4%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M22%205h-4%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M4%2017v2%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M5%2018H3%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E");
221
+ }
222
+
223
+ .tm-section-style-preset .collapsible__toggle-wrap::before {
224
+ mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m21.64%203.64-1.28-1.28a1.21%201.21%200%200%200-1.72%200L2.36%2018.64a1.21%201.21%200%200%200%200%201.72l1.28%201.28a1.2%201.2%200%200%200%201.72%200L21.64%205.36a1.2%201.2%200%200%200%200-1.72%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22m14%207%203%203%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M5%206v4%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M19%2014v4%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M10%202v2%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M7%208H3%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M21%2016h-4%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M11%203H9%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E");
225
+ }
226
+
227
+ .tm-section-custom-presets .collapsible__toggle-wrap::before {
228
+ mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M15.39%204.39a1%201%200%200%200%201.68-.474%202.5%202.5%200%201%201%203.014%203.015%201%201%200%200%200-.474%201.68l1.683%201.682a2.414%202.414%200%200%201%200%203.414L19.61%2015.39a1%201%200%200%201-1.68-.474%202.5%202.5%200%201%200-3.014%203.015%201%201%200%200%201%20.474%201.68l-1.683%201.682a2.414%202.414%200%200%201-3.414%200L8.61%2019.61a1%201%200%200%200-1.68.474%202.5%202.5%200%201%201-3.014-3.015%201%201%200%200%200%20.474-1.68l-1.683-1.682a2.414%202.414%200%200%201%200-3.414L4.39%208.61a1%201%200%200%201%201.68.474%202.5%202.5%200%201%200%203.014-3.015%201%201%200%200%201-.474-1.68l1.683-1.682a2.414%202.414%200%200%201%203.414%200z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E");
229
+ }
230
+
231
+ .tm-section-components .collapsible__toggle-wrap::before {
232
+ mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12.83%202.18a2%202%200%200%200-1.66%200L2.6%206.08a1%201%200%200%200%200%201.83l8.58%203.91a2%202%200%200%200%201.66%200l8.58-3.9a1%201%200%200%200%200-1.83z%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M2%2012a1%201%200%200%200%20.58.91l8.6%203.91a2%202%200%200%200%201.65%200l8.58-3.9A1%201%200%200%200%2022%2012%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M2%2017a1%201%200%200%200%20.58.91l8.6%203.91a2%202%200%200%200%201.65%200l8.58-3.9A1%201%200%200%200%2022%2017%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E");
233
+ }
234
+
235
+ .tm-section-advanced .collapsible__toggle-wrap::before {
236
+ mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%207h-9%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M14%2017H5%22%3E%3C%2Fpath%3E%3Ccircle%20cx%3D%2217%22%20cy%3D%2217%22%20r%3D%223%22%3E%3C%2Fcircle%3E%3Ccircle%20cx%3D%227%22%20cy%3D%227%22%20r%3D%223%22%3E%3C%2Fcircle%3E%3C%2Fsvg%3E");
237
+ }
238
+
239
+
240
+ /* ─── Keyboard focus ─────────────────────────────────────────────────────────
241
+ Custom controls follow Payload's own focus ring so they match native fields. */
242
+ .theme-preset-summary:focus-visible,
243
+ .theme-preset-button:focus-visible,
244
+ .theme-preview-toggle:focus-visible,
245
+ .font-select-trigger:focus-visible,
246
+ .theme-token-select button:focus-visible {
247
+ outline: var(--accessibility-outline, 2px solid var(--theme-text));
248
+ outline-offset: var(--accessibility-outline-offset, 2px);
249
+ }
250
+
251
+ .font-select-listbox:focus-visible,
252
+ .theme-token-select [role='listbox']:focus-visible {
253
+ outline: none; /* the active option carries the visible focus indicator */
254
+ }
255
+
256
+ @media (prefers-reduced-motion: reduce) {
257
+ .theme-preset-summary,
258
+ .theme-preset-button,
259
+ .theme-preview-toggle {
260
+ transition: none;
261
+ }
262
+ }
263
+
264
+ /* ─── Appearance session: locks + one-step undo ─────────────────────────────── */
265
+ .tm-appearance-locks {
266
+ display: grid;
267
+ gap: 6px;
268
+ }
269
+
270
+ .tm-appearance-locks__row {
271
+ display: flex;
272
+ flex-wrap: wrap;
273
+ align-items: center;
274
+ gap: 6px;
275
+ }
276
+
277
+ .tm-appearance-locks__label {
278
+ margin-inline-end: 4px;
279
+ font-size: 13px;
280
+ font-weight: 600;
281
+ color: var(--theme-elevation-800);
282
+ }
283
+
284
+ .tm-appearance-lock {
285
+ display: inline-flex;
286
+ align-items: center;
287
+ gap: 6px;
288
+ min-height: 30px;
289
+ padding: 4px 12px;
290
+ border-radius: 999px;
291
+ border: 1px solid var(--theme-elevation-200);
292
+ background: var(--theme-elevation-0);
293
+ color: var(--theme-elevation-700);
294
+ font: inherit;
295
+ font-size: 13px;
296
+ cursor: pointer;
297
+ transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
298
+ }
299
+
300
+ .tm-appearance-lock:hover {
301
+ border-color: var(--theme-elevation-400);
302
+ color: var(--theme-elevation-900);
303
+ }
304
+
305
+ .tm-appearance-lock.is-locked {
306
+ border-color: var(--theme-elevation-800);
307
+ background: var(--theme-elevation-800);
308
+ color: var(--theme-elevation-0);
309
+ }
310
+
311
+ .tm-appearance-locks__hint {
312
+ margin: 0;
313
+ font-size: 12px;
314
+ line-height: 1.5;
315
+ color: var(--theme-elevation-600);
316
+ }
317
+
318
+ .tm-appearance-undo {
319
+ display: flex;
320
+ align-items: center;
321
+ gap: 8px;
322
+ padding: 6px 6px 6px 12px;
323
+ border-radius: 10px;
324
+ border: 1px solid var(--theme-elevation-200);
325
+ background: var(--theme-elevation-100);
326
+ color: var(--theme-elevation-900);
327
+ font-size: 13px;
328
+ animation: tm-undo-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
329
+ }
330
+
331
+ .tm-appearance-undo__text {
332
+ flex: 1;
333
+ min-width: 0;
334
+ overflow-wrap: anywhere;
335
+ }
336
+
337
+ .tm-appearance-undo__action,
338
+ .tm-appearance-undo__dismiss {
339
+ display: inline-flex;
340
+ align-items: center;
341
+ justify-content: center;
342
+ gap: 6px;
343
+ min-height: 30px;
344
+ border-radius: 8px;
345
+ border: none;
346
+ font: inherit;
347
+ font-size: 13px;
348
+ cursor: pointer;
349
+ }
350
+
351
+ .tm-appearance-undo__action {
352
+ padding: 4px 12px;
353
+ background: var(--theme-elevation-800);
354
+ color: var(--theme-elevation-0);
355
+ font-weight: 600;
356
+ }
357
+
358
+ .tm-appearance-undo__dismiss {
359
+ width: 30px;
360
+ background: transparent;
361
+ color: var(--theme-elevation-600);
362
+ }
363
+
364
+ .tm-appearance-undo__dismiss:hover {
365
+ background: var(--theme-elevation-150);
366
+ color: var(--theme-elevation-900);
367
+ }
368
+
369
+ .tm-appearance-lock:focus-visible,
370
+ .tm-appearance-undo__action:focus-visible,
371
+ .tm-appearance-undo__dismiss:focus-visible {
372
+ outline: var(--accessibility-outline, 2px solid var(--theme-text));
373
+ outline-offset: var(--accessibility-outline-offset, 2px);
374
+ }
375
+
376
+ .tm-locked-note {
377
+ margin: 0 0 12px;
378
+ font-size: 12px;
379
+ line-height: 1.5;
380
+ color: var(--theme-elevation-700);
381
+ }
382
+
383
+ .tm-sr-only {
384
+ position: absolute;
385
+ width: 1px;
386
+ height: 1px;
387
+ padding: 0;
388
+ margin: -1px;
389
+ overflow: hidden;
390
+ clip: rect(0, 0, 0, 0);
391
+ white-space: nowrap;
392
+ border: 0;
393
+ }
394
+
395
+ @keyframes tm-undo-in {
396
+ from {
397
+ opacity: 0;
398
+ transform: translateY(-4px);
399
+ }
400
+ to {
401
+ opacity: 1;
402
+ transform: translateY(0);
403
+ }
404
+ }
405
+
406
+ @media (prefers-reduced-motion: reduce) {
407
+ .tm-appearance-undo {
408
+ animation: none;
409
+ }
410
+
411
+ .tm-appearance-lock {
412
+ transition: none;
413
+ }
414
+ }
415
+
416
+ /* ─── Appearance tab layout: controls left, one sticky live preview right ─────
417
+ The `themeConfiguration` group (className `tm-appearance`) becomes a two-column
418
+ grid once its own container is wide enough. Payload renders each field as a
419
+ direct child of `.render-fields`, so the preview slot can span every row of the
420
+ right column and its inner panel stays pinned while the editor scrolls through
421
+ presets, colours, typography and component settings on the left.
422
+ ───────────────────────────────────────────────────────────────────────── */
423
+ .tm-appearance > .group-field__wrap {
424
+ container-type: inline-size;
425
+ container-name: tm-appearance;
426
+ }
427
+
428
+ .tm-live-preview-slot {
429
+ min-width: 0;
430
+ margin-bottom: 20px;
431
+ }
432
+
433
+ /* Shown instead of the mock preview when Payload's native Live Preview is available. */
434
+ .tm-native-preview-hint {
435
+ display: flex;
436
+ flex-wrap: wrap;
437
+ align-items: center;
438
+ justify-content: space-between;
439
+ gap: 12px;
440
+ margin-bottom: 20px;
441
+ padding: 12px 14px;
442
+ border: 1px solid var(--theme-elevation-150);
443
+ border-radius: var(--style-radius-m, 8px);
444
+ background: var(--theme-elevation-50);
445
+ }
446
+
447
+ .tm-native-preview-hint__text {
448
+ display: grid;
449
+ gap: 2px;
450
+ min-width: 0;
451
+ flex: 1 1 240px;
452
+ }
453
+
454
+ .tm-native-preview-hint__title {
455
+ display: inline-flex;
456
+ align-items: center;
457
+ gap: 6px;
458
+ font-size: 13px;
459
+ font-weight: 600;
460
+ color: var(--theme-elevation-800);
461
+ }
462
+
463
+ .tm-native-preview-hint__body {
464
+ font-size: 12px;
465
+ line-height: 1.5;
466
+ color: var(--theme-elevation-650, var(--theme-elevation-600));
467
+ }
468
+
469
+ .tm-native-preview-hint__action {
470
+ display: inline-flex;
471
+ align-items: center;
472
+ gap: 6px;
473
+ min-height: 32px;
474
+ padding: 6px 12px;
475
+ border: 1px solid var(--theme-elevation-800);
476
+ border-radius: var(--style-radius-s, 6px);
477
+ background: var(--theme-elevation-800);
478
+ color: var(--theme-elevation-0);
479
+ font-size: 13px;
480
+ font-weight: 600;
481
+ cursor: pointer;
482
+ }
483
+
484
+ .tm-native-preview-hint__action:hover {
485
+ background: var(--theme-elevation-900);
486
+ }
487
+
488
+ .tm-native-preview-hint__action:focus-visible {
489
+ outline: var(--accessibility-outline, 2px solid var(--theme-elevation-800));
490
+ outline-offset: 2px;
491
+ }
492
+
493
+ /* Two columns only while the mock preview is actually rendered; with native Live
494
+ Preview the controls take the full width. */
495
+ @container tm-appearance (min-width: 960px) {
496
+ .tm-appearance > .group-field__wrap > .render-fields:has(> .tm-live-preview-slot) {
497
+ display: grid;
498
+ grid-template-columns: minmax(0, 1fr) minmax(340px, 42%);
499
+ column-gap: 28px;
500
+ align-items: start;
501
+ }
502
+
503
+ .tm-appearance > .group-field__wrap > .render-fields > * {
504
+ grid-column: 1;
505
+ min-width: 0;
506
+ }
507
+
508
+ .tm-appearance > .group-field__wrap > .render-fields > .tm-live-preview-slot {
509
+ grid-column: 2;
510
+ grid-row: 1 / span 60;
511
+ align-self: stretch;
512
+ margin-bottom: 0;
513
+ }
514
+
515
+ .tm-live-preview {
516
+ position: sticky;
517
+ top: calc(var(--app-header-height, 56px) + var(--doc-controls-height, 64px) + 12px);
518
+ max-height: calc(100vh - var(--app-header-height, 56px) - var(--doc-controls-height, 64px) - 24px);
519
+ overflow-y: auto;
520
+ overscroll-behavior: contain;
521
+ }
522
+ }
523
+
524
+ /* Inside the Appearance tab the merged live preview (right after the theme picker)
525
+ covers colours and type, so the picker drops its own inline preview. */
526
+ .tm-appearance .theme-preview-layout {
527
+ grid-template-columns: minmax(0, 1fr);
528
+ }
529
+
530
+ .tm-appearance .theme-preview-panel,
531
+ .tm-appearance .theme-preview-toggle {
532
+ display: none;
533
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ThemePreviewField.d.ts","sourceRoot":"","sources":["../../src/fields/ThemePreviewField.tsx"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAwPrD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BA0atE"}
1
+ {"version":3,"file":"ThemePreviewField.d.ts","sourceRoot":"","sources":["../../src/fields/ThemePreviewField.tsx"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAA;AAGhC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AA0QrD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAqftE"}