@kilivi/payloadcms-theme-management 1.1.2 → 2.1.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 (214) hide show
  1. package/README.md +318 -847
  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.map +1 -1
  12. package/dist/components/ServerThemeInjector.js +41 -14
  13. package/dist/components/ServerThemeInjector.js.map +1 -1
  14. package/dist/components/ThemeLivePreviewSync.d.ts +1 -0
  15. package/dist/components/ThemeLivePreviewSync.d.ts.map +1 -1
  16. package/dist/components/ThemeLivePreviewSync.js +1 -1
  17. package/dist/components/ThemeLivePreviewSync.js.map +1 -1
  18. package/dist/components/ThemeSwitcher.d.ts +36 -0
  19. package/dist/components/ThemeSwitcher.d.ts.map +1 -0
  20. package/dist/components/ThemeSwitcher.js +89 -0
  21. package/dist/components/ThemeSwitcher.js.map +1 -0
  22. package/dist/components/typographyPreviewUtils.d.ts.map +1 -1
  23. package/dist/components/typographyPreviewUtils.js +8 -1
  24. package/dist/components/typographyPreviewUtils.js.map +1 -1
  25. package/dist/constants/devicePreviews.d.ts +35 -0
  26. package/dist/constants/devicePreviews.d.ts.map +1 -0
  27. package/dist/constants/devicePreviews.js +43 -0
  28. package/dist/constants/devicePreviews.js.map +1 -0
  29. package/dist/constants/themeFonts.js +9 -9
  30. package/dist/constants/themeFonts.js.map +1 -1
  31. package/dist/extended-presets.d.ts +0 -4
  32. package/dist/extended-presets.d.ts.map +1 -1
  33. package/dist/extended-presets.js +1 -18
  34. package/dist/extended-presets.js.map +1 -1
  35. package/dist/extended-themes.d.ts.map +1 -1
  36. package/dist/extended-themes.js +428 -0
  37. package/dist/extended-themes.js.map +1 -1
  38. package/dist/fields/AccessibilityAuditField.d.ts +2 -0
  39. package/dist/fields/AccessibilityAuditField.d.ts.map +1 -0
  40. package/dist/fields/AccessibilityAuditField.js +303 -0
  41. package/dist/fields/AccessibilityAuditField.js.map +1 -0
  42. package/dist/fields/AppearancePreviewField.d.ts +2 -0
  43. package/dist/fields/AppearancePreviewField.d.ts.map +1 -0
  44. package/dist/fields/AppearancePreviewField.js +763 -0
  45. package/dist/fields/AppearancePreviewField.js.map +1 -0
  46. package/dist/fields/ColorPickerField.d.ts.map +1 -1
  47. package/dist/fields/ColorPickerField.js +89 -85
  48. package/dist/fields/ColorPickerField.js.map +1 -1
  49. package/dist/fields/FontSelectField.d.ts +6 -0
  50. package/dist/fields/FontSelectField.d.ts.map +1 -1
  51. package/dist/fields/FontSelectField.js +195 -122
  52. package/dist/fields/FontSelectField.js.map +1 -1
  53. package/dist/fields/PaletteGeneratorField.d.ts +7 -0
  54. package/dist/fields/PaletteGeneratorField.d.ts.map +1 -0
  55. package/dist/fields/PaletteGeneratorField.js +327 -0
  56. package/dist/fields/PaletteGeneratorField.js.map +1 -0
  57. package/dist/fields/StylePresetField.d.ts +3 -0
  58. package/dist/fields/StylePresetField.d.ts.map +1 -0
  59. package/dist/fields/StylePresetField.js +462 -0
  60. package/dist/fields/StylePresetField.js.map +1 -0
  61. package/dist/fields/ThemeColorPickerField.css +115 -35
  62. package/dist/fields/ThemeColorPickerField.d.ts.map +1 -1
  63. package/dist/fields/ThemeColorPickerField.js +204 -70
  64. package/dist/fields/ThemeColorPickerField.js.map +1 -1
  65. package/dist/fields/ThemeExportField.d.ts +6 -0
  66. package/dist/fields/ThemeExportField.d.ts.map +1 -0
  67. package/dist/fields/ThemeExportField.js +202 -0
  68. package/dist/fields/ThemeExportField.js.map +1 -0
  69. package/dist/fields/ThemePresetImportField.d.ts.map +1 -1
  70. package/dist/fields/ThemePresetImportField.js +56 -25
  71. package/dist/fields/ThemePresetImportField.js.map +1 -1
  72. package/dist/fields/ThemePreviewField.css +382 -5
  73. package/dist/fields/ThemePreviewField.d.ts.map +1 -1
  74. package/dist/fields/ThemePreviewField.js +268 -170
  75. package/dist/fields/ThemePreviewField.js.map +1 -1
  76. package/dist/fields/ThemeTokenSelectField.d.ts.map +1 -1
  77. package/dist/fields/ThemeTokenSelectField.js +278 -80
  78. package/dist/fields/ThemeTokenSelectField.js.map +1 -1
  79. package/dist/fields/colorFieldHelpers.d.ts +90 -0
  80. package/dist/fields/colorFieldHelpers.d.ts.map +1 -0
  81. package/dist/fields/colorFieldHelpers.js +133 -0
  82. package/dist/fields/colorFieldHelpers.js.map +1 -0
  83. package/dist/fields/colorModeFields.d.ts +1 -1
  84. package/dist/fields/colorModeFields.d.ts.map +1 -1
  85. package/dist/fields/colorModeFields.js +49 -7
  86. package/dist/fields/colorModeFields.js.map +1 -1
  87. package/dist/fields/themeConfigurationField.d.ts +8 -1
  88. package/dist/fields/themeConfigurationField.d.ts.map +1 -1
  89. package/dist/fields/themeConfigurationField.js +961 -29
  90. package/dist/fields/themeConfigurationField.js.map +1 -1
  91. package/dist/globals/ThemeSettings/FontPicker/FontPreview.d.ts.map +1 -1
  92. package/dist/globals/ThemeSettings/FontPicker/FontPreview.js +8 -4
  93. package/dist/globals/ThemeSettings/FontPicker/FontPreview.js.map +1 -1
  94. package/dist/globals/ThemeSettings/FontPicker/index.d.ts.map +1 -1
  95. package/dist/globals/ThemeSettings/FontPicker/index.js +81 -26
  96. package/dist/globals/ThemeSettings/FontPicker/index.js.map +1 -1
  97. package/dist/globals/ThemeSettings/FontPicker/styles.css +98 -41
  98. package/dist/globals/ThemeSettings/FontPicker/translations.d.ts +6 -0
  99. package/dist/globals/ThemeSettings/FontPicker/translations.d.ts.map +1 -1
  100. package/dist/globals/ThemeSettings/FontPicker/translations.js +14 -2
  101. package/dist/globals/ThemeSettings/FontPicker/translations.js.map +1 -1
  102. package/dist/globals/ThemeSettings/config.d.ts.map +1 -1
  103. package/dist/globals/ThemeSettings/config.js +76 -79
  104. package/dist/globals/ThemeSettings/config.js.map +1 -1
  105. package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.d.ts.map +1 -1
  106. package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.js +63 -62
  107. package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.js.map +1 -1
  108. package/dist/globals/ThemeSettings/fields/TypographyInfoField.d.ts.map +1 -1
  109. package/dist/globals/ThemeSettings/fields/TypographyInfoField.js +22 -25
  110. package/dist/globals/ThemeSettings/fields/TypographyInfoField.js.map +1 -1
  111. package/dist/hooks/useAppearanceSession.d.ts +50 -0
  112. package/dist/hooks/useAppearanceSession.d.ts.map +1 -0
  113. package/dist/hooks/useAppearanceSession.js +91 -0
  114. package/dist/hooks/useAppearanceSession.js.map +1 -0
  115. package/dist/hooks/useThemeTranslations.d.ts +13 -0
  116. package/dist/hooks/useThemeTranslations.d.ts.map +1 -0
  117. package/dist/hooks/useThemeTranslations.js +22 -0
  118. package/dist/hooks/useThemeTranslations.js.map +1 -0
  119. package/dist/i18n.d.ts +53 -0
  120. package/dist/i18n.d.ts.map +1 -0
  121. package/dist/i18n.js +53 -0
  122. package/dist/i18n.js.map +1 -0
  123. package/dist/index.d.ts +10 -4
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +130 -32
  126. package/dist/index.js.map +1 -1
  127. package/dist/payload-types.d.ts +24 -0
  128. package/dist/payload-types.d.ts.map +1 -1
  129. package/dist/payload-types.js.map +1 -1
  130. package/dist/presets.d.ts +8 -0
  131. package/dist/presets.d.ts.map +1 -1
  132. package/dist/presets.js.map +1 -1
  133. package/dist/providers/Theme/index.d.ts.map +1 -1
  134. package/dist/providers/Theme/index.js +75 -11
  135. package/dist/providers/Theme/index.js.map +1 -1
  136. package/dist/providers/Theme/themeConfig.d.ts.map +1 -1
  137. package/dist/providers/Theme/themeConfig.js +104 -0
  138. package/dist/providers/Theme/themeConfig.js.map +1 -1
  139. package/dist/providers/Theme/types.d.ts +1 -1
  140. package/dist/providers/Theme/types.d.ts.map +1 -1
  141. package/dist/providers/Theme/types.js +10 -1
  142. package/dist/providers/Theme/types.js.map +1 -1
  143. package/dist/style-presets.d.ts +66 -0
  144. package/dist/style-presets.d.ts.map +1 -0
  145. package/dist/style-presets.js +556 -0
  146. package/dist/style-presets.js.map +1 -0
  147. package/dist/translations.d.ts +159 -1
  148. package/dist/translations.d.ts.map +1 -1
  149. package/dist/translations.js +310 -9
  150. package/dist/translations.js.map +1 -1
  151. package/dist/tweakcn-special-themes.d.ts.map +1 -1
  152. package/dist/tweakcn-special-themes.js +585 -9
  153. package/dist/tweakcn-special-themes.js.map +1 -1
  154. package/dist/types/css.d.js +3 -0
  155. package/dist/types/css.d.js.map +1 -0
  156. package/dist/types.d.ts +30 -0
  157. package/dist/types.d.ts.map +1 -1
  158. package/dist/types.js +1 -1
  159. package/dist/types.js.map +1 -1
  160. package/dist/utilities/getThemeSettings.d.ts.map +1 -1
  161. package/dist/utilities/getThemeSettings.js +2 -14
  162. package/dist/utilities/getThemeSettings.js.map +1 -1
  163. package/dist/utils/contrast.d.ts +63 -0
  164. package/dist/utils/contrast.d.ts.map +1 -0
  165. package/dist/utils/contrast.js +158 -0
  166. package/dist/utils/contrast.js.map +1 -0
  167. package/dist/utils/exportTokens.d.ts +30 -0
  168. package/dist/utils/exportTokens.d.ts.map +1 -0
  169. package/dist/utils/exportTokens.js +183 -0
  170. package/dist/utils/exportTokens.js.map +1 -0
  171. package/dist/utils/generatePalette.d.ts +46 -0
  172. package/dist/utils/generatePalette.d.ts.map +1 -0
  173. package/dist/utils/generatePalette.js +127 -0
  174. package/dist/utils/generatePalette.js.map +1 -0
  175. package/dist/utils/generateThemeCSS.d.ts.map +1 -1
  176. package/dist/utils/generateThemeCSS.js +2 -40
  177. package/dist/utils/generateThemeCSS.js.map +1 -1
  178. package/dist/utils/livePreviewThemeRuntime.d.ts +16 -2
  179. package/dist/utils/livePreviewThemeRuntime.d.ts.map +1 -1
  180. package/dist/utils/livePreviewThemeRuntime.js +37 -14
  181. package/dist/utils/livePreviewThemeRuntime.js.map +1 -1
  182. package/dist/utils/localizedText.d.ts +8 -0
  183. package/dist/utils/localizedText.d.ts.map +1 -0
  184. package/dist/utils/localizedText.js +21 -0
  185. package/dist/utils/localizedText.js.map +1 -0
  186. package/dist/utils/resolveThemeConfiguration.d.ts +45 -1
  187. package/dist/utils/resolveThemeConfiguration.d.ts.map +1 -1
  188. package/dist/utils/resolveThemeConfiguration.js +12 -5
  189. package/dist/utils/resolveThemeConfiguration.js.map +1 -1
  190. package/dist/utils/themeColors.d.ts +3 -0
  191. package/dist/utils/themeColors.d.ts.map +1 -1
  192. package/dist/utils/themeColors.js +30 -1
  193. package/dist/utils/themeColors.js.map +1 -1
  194. package/dist/utils/themeHtmlAttributes.d.ts +32 -12
  195. package/dist/utils/themeHtmlAttributes.d.ts.map +1 -1
  196. package/dist/utils/themeHtmlAttributes.js +38 -5
  197. package/dist/utils/themeHtmlAttributes.js.map +1 -1
  198. package/dist/utils/themeUtils.d.ts +3 -5
  199. package/dist/utils/themeUtils.d.ts.map +1 -1
  200. package/dist/utils/themeUtils.js +416 -6
  201. package/dist/utils/themeUtils.js.map +1 -1
  202. package/dist/utils/tweakcnConverter.d.ts +1 -3
  203. package/dist/utils/tweakcnConverter.d.ts.map +1 -1
  204. package/dist/utils/tweakcnConverter.js +1 -3
  205. package/dist/utils/tweakcnConverter.js.map +1 -1
  206. package/package.json +11 -5
  207. package/dist/components/ThemePreview.d.ts +0 -3
  208. package/dist/components/ThemePreview.d.ts.map +0 -1
  209. package/dist/components/ThemePreview.js +0 -321
  210. package/dist/components/ThemePreview.js.map +0 -1
  211. package/dist/plugin.d.ts +0 -2
  212. package/dist/plugin.d.ts.map +0 -1
  213. package/dist/plugin.js +0 -3
  214. 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,290 @@
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
+ @container tm-appearance (min-width: 960px) {
434
+ .tm-appearance > .group-field__wrap > .render-fields {
435
+ display: grid;
436
+ grid-template-columns: minmax(0, 1fr) minmax(340px, 42%);
437
+ column-gap: 28px;
438
+ align-items: start;
439
+ }
440
+
441
+ .tm-appearance > .group-field__wrap > .render-fields > * {
442
+ grid-column: 1;
443
+ min-width: 0;
444
+ }
445
+
446
+ .tm-appearance > .group-field__wrap > .render-fields > .tm-live-preview-slot {
447
+ grid-column: 2;
448
+ grid-row: 1 / span 60;
449
+ align-self: stretch;
450
+ margin-bottom: 0;
451
+ }
452
+
453
+ .tm-live-preview {
454
+ position: sticky;
455
+ top: calc(var(--app-header-height, 56px) + var(--doc-controls-height, 64px) + 12px);
456
+ max-height: calc(100vh - var(--app-header-height, 56px) - var(--doc-controls-height, 64px) - 24px);
457
+ overflow-y: auto;
458
+ overscroll-behavior: contain;
459
+ }
460
+ }
461
+
462
+ /* Inside the Appearance tab the merged live preview (right after the theme picker)
463
+ covers colours and type, so the picker drops its own inline preview. */
464
+ .tm-appearance .theme-preview-layout {
465
+ grid-template-columns: minmax(0, 1fr);
466
+ }
467
+
468
+ .tm-appearance .theme-preview-panel,
469
+ .tm-appearance .theme-preview-toggle {
470
+ display: none;
471
+ }
@@ -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;AAIhC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAwRrD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAqftE"}