@kilivi/payloadcms-theme-management 0.5.6 → 0.5.8

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 (61) hide show
  1. package/README.md +34 -38
  2. package/dist/components/InitTheme.d.ts +3 -0
  3. package/dist/components/InitTheme.d.ts.map +1 -1
  4. package/dist/components/InitTheme.js +9 -7
  5. package/dist/components/InitTheme.js.map +1 -1
  6. package/dist/components/ServerThemeInjector.d.ts.map +1 -1
  7. package/dist/components/ServerThemeInjector.js +1 -11
  8. package/dist/components/ServerThemeInjector.js.map +1 -1
  9. package/dist/components/ThemePreview.d.ts.map +1 -1
  10. package/dist/components/ThemePreview.js +3 -3
  11. package/dist/components/ThemePreview.js.map +1 -1
  12. package/dist/fields/ThemePresetImportField.d.ts +4 -0
  13. package/dist/fields/ThemePresetImportField.d.ts.map +1 -0
  14. package/dist/fields/ThemePresetImportField.js +219 -0
  15. package/dist/fields/ThemePresetImportField.js.map +1 -0
  16. package/dist/fields/ThemePreviewField.d.ts.map +1 -1
  17. package/dist/fields/ThemePreviewField.js +32 -25
  18. package/dist/fields/ThemePreviewField.js.map +1 -1
  19. package/dist/fields/themeConfigurationField.d.ts.map +1 -1
  20. package/dist/fields/themeConfigurationField.js +44 -10
  21. package/dist/fields/themeConfigurationField.js.map +1 -1
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +7 -4
  25. package/dist/index.js.map +1 -1
  26. package/dist/providers/Theme/themeConfig.d.ts.map +1 -1
  27. package/dist/providers/Theme/themeConfig.js +256 -8
  28. package/dist/providers/Theme/themeConfig.js.map +1 -1
  29. package/dist/providers/Theme/types.d.ts +5 -3
  30. package/dist/providers/Theme/types.d.ts.map +1 -1
  31. package/dist/providers/Theme/types.js +34 -13
  32. package/dist/providers/Theme/types.js.map +1 -1
  33. package/dist/server.d.ts +1 -1
  34. package/dist/server.d.ts.map +1 -1
  35. package/dist/server.js +1 -1
  36. package/dist/server.js.map +1 -1
  37. package/dist/utils/customThemePresets.d.ts +5 -0
  38. package/dist/utils/customThemePresets.d.ts.map +1 -0
  39. package/dist/utils/customThemePresets.js +82 -0
  40. package/dist/utils/customThemePresets.js.map +1 -0
  41. package/dist/utils/extendedThemeHelpers.d.ts +1 -1
  42. package/dist/utils/extendedThemeHelpers.d.ts.map +1 -1
  43. package/dist/utils/extendedThemeHelpers.js +16 -16
  44. package/dist/utils/extendedThemeHelpers.js.map +1 -1
  45. package/dist/utils/generateThemeCSS.d.ts +11 -0
  46. package/dist/utils/generateThemeCSS.d.ts.map +1 -0
  47. package/dist/utils/generateThemeCSS.js +309 -0
  48. package/dist/utils/generateThemeCSS.js.map +1 -0
  49. package/dist/utils/resolveThemeConfiguration.d.ts +1 -1
  50. package/dist/utils/resolveThemeConfiguration.d.ts.map +1 -1
  51. package/dist/utils/resolveThemeConfiguration.js +3 -3
  52. package/dist/utils/resolveThemeConfiguration.js.map +1 -1
  53. package/dist/utils/themeAssets.d.ts +7 -0
  54. package/dist/utils/themeAssets.d.ts.map +1 -1
  55. package/dist/utils/themeAssets.js +23 -35
  56. package/dist/utils/themeAssets.js.map +1 -1
  57. package/dist/utils/themeCSS.d.ts +11 -0
  58. package/dist/utils/themeCSS.d.ts.map +1 -0
  59. package/dist/utils/themeCSS.js +32 -0
  60. package/dist/utils/themeCSS.js.map +1 -0
  61. package/package.json +3 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/fields/themeConfigurationField.ts"],"sourcesContent":["import type { Field, TabsField } from 'payload'\nimport {\n BASE_FONT_SIZE_OPTIONS,\n BODY_FONT_OPTIONS,\n HEADING_FONT_OPTIONS,\n LINE_HEIGHT_OPTIONS,\n} from '../constants/themeFonts.js'\nimport type { ThemePreset } from '../index.js'\nimport { darkModeField, lightModeField } from './colorModeFields.js'\n\ninterface ThemeConfigurationFieldOptions {\n themePresets: ThemePreset[]\n defaultTheme: string\n includeColorModeToggle: boolean\n includeCustomCSS: boolean\n includeBrandIdentity: boolean\n enableAdvancedFeatures?: boolean\n}\n\n// Type for a single tab (not the full TabsField)\nexport type ThemeTab = NonNullable<TabsField['tabs']>[number]\n\n/**\n * Theme Configuration Field with Theme Selection as default value setter\n * Theme Selection populates lightMode/darkMode colors automatically\n */\nexport function createThemeConfigurationField(options: ThemeConfigurationFieldOptions): ThemeTab {\n const {\n themePresets,\n defaultTheme,\n includeColorModeToggle,\n includeCustomCSS,\n enableAdvancedFeatures = true,\n } = options\n\n const themeOptions = themePresets.map((preset) => {\n const previewColor = preset.preview?.colors.primary\n const label = previewColor ? `${preset.label} • ${previewColor}` : preset.label\n return {\n label,\n value: preset.name,\n }\n })\n\n const fields: Field[] = [\n {\n name: 'theme',\n type: 'select',\n required: true,\n defaultValue: defaultTheme,\n options: themeOptions,\n label: {\n en: '🎨 Theme Selection',\n cs: '🎨 Výběr tématu',\n },\n admin: {\n description: {\n en: 'Select a theme to auto-populate color values. You can customize colors after selection.',\n cs: 'Vyberte téma pro automatické předvyplnění barev. Po výběru můžete barvy upravit.',\n },\n components: {\n Field: '@kilivi/payloadcms-theme-management/fields/ThemePreviewField',\n },\n },\n },\n ]\n\n // Border Radius Configuration - Always visible\n fields.push({\n type: 'row',\n fields: [\n {\n name: 'borderRadius',\n type: 'select',\n label: {\n en: '📐 Border Radius',\n cs: '📐 Zaoblení rohů',\n },\n defaultValue: 'medium',\n options: [\n { label: { en: 'None (0px)', cs: 'Žádné (0px)' }, value: 'none' },\n { label: { en: 'Small (0.25rem)', cs: 'Malé (0.25rem)' }, value: 'small' },\n { label: { en: 'Medium (0.5rem)', cs: 'Střední (0.5rem)' }, value: 'medium' },\n { label: { en: 'Large (0.75rem)', cs: 'Velké (0.75rem)' }, value: 'large' },\n { label: { en: 'XL (1rem)', cs: 'XL (1rem)' }, value: 'xl' },\n ],\n admin: {\n description: {\n en: 'Default corner rounding for UI elements',\n cs: 'Výchozí zaoblení rohů pro UI prvky',\n },\n width: '50%',\n },\n },\n {\n name: 'spacing',\n type: 'select',\n label: {\n en: '📏 Spacing Scale',\n cs: '📏 Škála rozestupů',\n },\n defaultValue: 'medium',\n options: [\n { label: { en: 'Compact', cs: 'Kompaktní' }, value: 'compact' },\n { label: { en: 'Medium', cs: 'Střední' }, value: 'medium' },\n { label: { en: 'Comfortable', cs: 'Pohodlné' }, value: 'comfortable' },\n ],\n admin: {\n description: {\n en: 'Global spacing between elements',\n cs: 'Globální rozestupy mezi prvky',\n },\n width: '50%',\n },\n },\n ],\n })\n\n // Color Mode Settings\n if (includeColorModeToggle) {\n fields.push({\n type: 'collapsible',\n label: {\n en: '🌗 Color Mode Settings',\n cs: '🌗 Nastavení barevného režimu',\n },\n admin: {\n initCollapsed: false,\n description: {\n en: 'Configure light and dark mode colors. Changes here override theme selection.',\n cs: 'Nakonfigurujte barvy světlého a tmavého režimu. Změny zde přepíší výběr tématu.',\n },\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'colorMode',\n type: 'select',\n label: {\n en: 'Default Color Mode',\n cs: 'Výchozí barevný režim',\n },\n defaultValue: 'auto',\n options: [\n {\n label: {\n en: 'Auto (System)',\n cs: 'Automaticky (Systém)',\n },\n value: 'auto',\n },\n {\n label: { en: 'Light', cs: 'Světlý' },\n value: 'light',\n },\n {\n label: { en: 'Dark', cs: 'Tmavý' },\n value: 'dark',\n },\n ],\n admin: {\n description: {\n en: 'Default color mode for visitors',\n cs: 'Výchozí barevný režim pro návštěvníky',\n },\n width: '50%',\n },\n },\n {\n name: 'allowColorModeToggle',\n type: 'checkbox',\n label: {\n en: 'Enable Mode Toggle',\n cs: 'Povolit přepínač režimu',\n },\n defaultValue: true,\n admin: {\n description: {\n en: 'Let visitors switch modes',\n cs: 'Umožnit návštěvníkům přepínat režimy',\n },\n width: '50%',\n },\n },\n ],\n },\n lightModeField,\n darkModeField,\n ],\n })\n }\n\n // Typography - Always visible\n fields.push({\n type: 'collapsible',\n label: {\n en: '🅰️ Typography',\n cs: '🅰️ Typografie',\n },\n admin: {\n initCollapsed: true,\n description: {\n en: 'Choose font families and base typography settings. Leave fields on \"Use preset\" to inherit the theme defaults.',\n cs: 'Zvolte rodiny písem a základní typografické nastavení. Hodnota \"Použít výchozí\" zachová nastavení motivu.',\n },\n },\n fields: [\n {\n name: 'typography',\n type: 'group',\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'bodyFont',\n type: 'select',\n label: {\n en: 'Body font',\n cs: 'Písmo pro text',\n },\n defaultValue: 'preset',\n // @ts-expect-error - Pass full objects including fontFamily for custom rendering\n options: BODY_FONT_OPTIONS,\n admin: {\n width: '50%',\n components: {\n Field: '@kilivi/payloadcms-theme-management/fields/FontSelectField',\n },\n },\n },\n {\n name: 'headingFont',\n type: 'select',\n label: {\n en: 'Heading font',\n cs: 'Písmo pro nadpisy',\n },\n defaultValue: 'preset',\n // @ts-expect-error - Pass full objects including fontFamily for custom rendering\n options: HEADING_FONT_OPTIONS,\n admin: {\n width: '50%',\n components: {\n Field: '@kilivi/payloadcms-theme-management/fields/FontSelectField',\n },\n },\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'bodyFontCustom',\n type: 'text',\n label: {\n en: 'Custom body font stack',\n cs: 'Vlastní písmo pro text',\n },\n admin: {\n width: '50%',\n placeholder: '\"IBM Plex Sans\", sans-serif',\n description: {\n en: 'Provide full CSS font-family stack when using a custom font.',\n cs: 'Při volbě vlastního písma zadejte celý CSS zápis font-family.',\n },\n condition: (_, siblingData) => siblingData?.bodyFont === 'custom',\n },\n },\n {\n name: 'headingFontCustom',\n type: 'text',\n label: {\n en: 'Custom heading font stack',\n cs: 'Vlastní písmo pro nadpisy',\n },\n admin: {\n width: '50%',\n placeholder: '\"Cormorant Garamond\", serif',\n description: {\n en: 'Provide full CSS font-family stack when using a custom heading font.',\n cs: 'Při volbě vlastního nadpisového písma zadejte celý CSS zápis font-family.',\n },\n condition: (_, siblingData) => siblingData?.headingFont === 'custom',\n },\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'baseFontSize',\n type: 'select',\n label: {\n en: 'Base font size',\n cs: 'Základní velikost písma',\n },\n defaultValue: 'preset',\n options: BASE_FONT_SIZE_OPTIONS.map((option) => ({\n label: option.label,\n value: option.value,\n })),\n admin: {\n width: '50%',\n },\n },\n {\n name: 'lineHeight',\n type: 'select',\n label: {\n en: 'Line height',\n cs: 'Řádkování',\n },\n defaultValue: 'preset',\n options: LINE_HEIGHT_OPTIONS.map((option) => ({\n label: option.label,\n value: option.value,\n })),\n admin: {\n width: '50%',\n },\n },\n ],\n },\n ],\n },\n ],\n })\n\n // Advanced Settings (when using extended theme configuration)\n if (enableAdvancedFeatures) {\n const advancedFields: Field[] = [\n {\n name: 'animationLevel',\n type: 'select',\n label: {\n en: 'Animation Level',\n cs: 'Úroveň animací',\n },\n defaultValue: 'medium',\n options: [\n { label: { en: 'None', cs: 'Žádné' }, value: 'none' },\n { label: { en: 'Reduced', cs: 'Snížené' }, value: 'reduced' },\n { label: { en: 'Medium', cs: 'Střední' }, value: 'medium' },\n { label: { en: 'High', cs: 'Vysoké' }, value: 'high' },\n ],\n admin: {\n description: {\n en: 'Control website animations and transitions',\n cs: 'Kontrola animací a přechodů na webu',\n },\n width: '50%',\n },\n },\n ]\n\n if (includeCustomCSS) {\n advancedFields.push({\n name: 'customCSS',\n type: 'code',\n label: {\n en: 'Custom CSS',\n cs: 'Vlastní CSS',\n },\n admin: {\n language: 'css',\n description: {\n en: 'Add custom CSS to override default styles',\n cs: 'Přidejte vlastní CSS pro přepsání výchozích stylů',\n },\n // placeholder:\n // ':root {\\n --primary: #your-color;\\n --border-radius: 8px;\\n --font-family: \"Your Font\";\\n}\\n\\n.custom-class {\\n /* Your custom styles */\\n}',\n // rows: 8,\n },\n })\n }\n\n fields.push({\n type: 'collapsible',\n label: {\n en: '⚙️ Advanced Settings',\n cs: '⚙️ Pokročilé nastavení',\n },\n admin: {\n initCollapsed: true,\n },\n fields: advancedFields,\n })\n }\n\n // Return as tab configuration to be injected into tabs structure\n return {\n label: {\n en: '🎨 Appearance Settings',\n cs: '🎨 Nastavení vzhledu',\n },\n fields: [\n {\n name: 'themeConfiguration',\n type: 'group',\n admin: {\n description: {\n en: 'Configure website appearance and styling',\n cs: 'Nakonfigurujte vzhled a stylování webu',\n },\n },\n fields,\n },\n ],\n }\n}\n"],"names":["BASE_FONT_SIZE_OPTIONS","BODY_FONT_OPTIONS","HEADING_FONT_OPTIONS","LINE_HEIGHT_OPTIONS","darkModeField","lightModeField","createThemeConfigurationField","options","themePresets","defaultTheme","includeColorModeToggle","includeCustomCSS","enableAdvancedFeatures","themeOptions","map","preset","previewColor","preview","colors","primary","label","value","name","fields","type","required","defaultValue","en","cs","admin","description","components","Field","push","width","initCollapsed","placeholder","condition","_","siblingData","bodyFont","headingFont","option","advancedFields","language"],"mappings":"AACA,SACEA,sBAAsB,EACtBC,iBAAiB,EACjBC,oBAAoB,EACpBC,mBAAmB,QACd,6BAA4B;AAEnC,SAASC,aAAa,EAAEC,cAAc,QAAQ,uBAAsB;AAcpE;;;CAGC,GACD,OAAO,SAASC,8BAA8BC,OAAuC;IACnF,MAAM,EACJC,YAAY,EACZC,YAAY,EACZC,sBAAsB,EACtBC,gBAAgB,EAChBC,yBAAyB,IAAI,EAC9B,GAAGL;IAEJ,MAAMM,eAAeL,aAAaM,GAAG,CAAC,CAACC;QACrC,MAAMC,eAAeD,OAAOE,OAAO,EAAEC,OAAOC;QAC5C,MAAMC,QAAQJ,eAAe,GAAGD,OAAOK,KAAK,CAAC,GAAG,EAAEJ,cAAc,GAAGD,OAAOK,KAAK;QAC/E,OAAO;YACLA;YACAC,OAAON,OAAOO,IAAI;QACpB;IACF;IAEA,MAAMC,SAAkB;QACtB;YACED,MAAM;YACNE,MAAM;YACNC,UAAU;YACVC,cAAcjB;YACdF,SAASM;YACTO,OAAO;gBACLO,IAAI;gBACJC,IAAI;YACN;YACAC,OAAO;gBACLC,aAAa;oBACXH,IAAI;oBACJC,IAAI;gBACN;gBACAG,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F"}
1
+ {"version":3,"sources":["../../src/fields/themeConfigurationField.ts"],"sourcesContent":["import type { Field, TabsField } from 'payload'\nimport {\n BASE_FONT_SIZE_OPTIONS,\n BODY_FONT_OPTIONS,\n HEADING_FONT_OPTIONS,\n LINE_HEIGHT_OPTIONS,\n} from '../constants/themeFonts.js'\nimport type { ThemePreset } from '../index.js'\nimport { darkModeField, lightModeField } from './colorModeFields.js'\n\ninterface ThemeConfigurationFieldOptions {\n themePresets: ThemePreset[]\n defaultTheme: string\n includeColorModeToggle: boolean\n includeCustomCSS: boolean\n includeBrandIdentity: boolean\n enableAdvancedFeatures?: boolean\n}\n\n// Type for a single tab (not the full TabsField)\nexport type ThemeTab = NonNullable<TabsField['tabs']>[number]\n\n/**\n * Theme Configuration Field with Theme Selection as default value setter\n * Theme Selection populates lightMode/darkMode colors automatically\n */\nexport function createThemeConfigurationField(options: ThemeConfigurationFieldOptions): ThemeTab {\n const {\n themePresets,\n defaultTheme,\n includeColorModeToggle,\n includeCustomCSS,\n enableAdvancedFeatures = true,\n } = options\n\n const fields: Field[] = [\n {\n name: 'theme',\n type: 'text',\n required: true,\n defaultValue: defaultTheme,\n label: {\n en: '🎨 Theme Selection',\n cs: '🎨 Výběr tématu',\n },\n validate: (value: unknown) => {\n if (typeof value === 'string' && value.trim().length > 0) {\n return true\n }\n return 'Select a theme'\n },\n admin: {\n description: {\n en: 'Select a theme to auto-populate color values. You can customize colors after selection.',\n cs: 'Vyberte téma pro automatické předvyplnění barev. Po výběru můžete barvy upravit.',\n },\n components: {\n Field: '@kilivi/payloadcms-theme-management/fields/ThemePreviewField',\n },\n custom: {\n themePresets,\n },\n },\n },\n ]\n\n // Border Radius Configuration - Always visible\n fields.push({\n type: 'row',\n fields: [\n {\n name: 'borderRadius',\n type: 'select',\n label: {\n en: '📐 Border Radius',\n cs: '📐 Zaoblení rohů',\n },\n defaultValue: 'medium',\n options: [\n { label: { en: 'None (0px)', cs: 'Žádné (0px)' }, value: 'none' },\n { label: { en: 'Small (0.25rem)', cs: 'Malé (0.25rem)' }, value: 'small' },\n { label: { en: 'Medium (0.5rem)', cs: 'Střední (0.5rem)' }, value: 'medium' },\n { label: { en: 'Large (0.75rem)', cs: 'Velké (0.75rem)' }, value: 'large' },\n { label: { en: 'XL (1rem)', cs: 'XL (1rem)' }, value: 'xl' },\n ],\n admin: {\n description: {\n en: 'Default corner rounding for UI elements',\n cs: 'Výchozí zaoblení rohů pro UI prvky',\n },\n width: '50%',\n },\n },\n {\n name: 'spacing',\n type: 'select',\n label: {\n en: '📏 Spacing Scale',\n cs: '📏 Škála rozestupů',\n },\n defaultValue: 'medium',\n options: [\n { label: { en: 'Compact', cs: 'Kompaktní' }, value: 'compact' },\n { label: { en: 'Medium', cs: 'Střední' }, value: 'medium' },\n { label: { en: 'Comfortable', cs: 'Pohodlné' }, value: 'comfortable' },\n ],\n admin: {\n description: {\n en: 'Global spacing between elements',\n cs: 'Globální rozestupy mezi prvky',\n },\n width: '50%',\n },\n },\n ],\n })\n\n // Color Mode Settings\n if (includeColorModeToggle) {\n fields.push({\n type: 'collapsible',\n label: {\n en: '🌗 Color Mode Settings',\n cs: '🌗 Nastavení barevného režimu',\n },\n admin: {\n initCollapsed: false,\n description: {\n en: 'Configure light and dark mode colors. Changes here override theme selection.',\n cs: 'Nakonfigurujte barvy světlého a tmavého režimu. Změny zde přepíší výběr tématu.',\n },\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'colorMode',\n type: 'select',\n label: {\n en: 'Default Color Mode',\n cs: 'Výchozí barevný režim',\n },\n defaultValue: 'auto',\n options: [\n {\n label: {\n en: 'Auto (System)',\n cs: 'Automaticky (Systém)',\n },\n value: 'auto',\n },\n {\n label: { en: 'Light', cs: 'Světlý' },\n value: 'light',\n },\n {\n label: { en: 'Dark', cs: 'Tmavý' },\n value: 'dark',\n },\n ],\n admin: {\n description: {\n en: 'Default color mode for visitors',\n cs: 'Výchozí barevný režim pro návštěvníky',\n },\n width: '50%',\n },\n },\n {\n name: 'allowColorModeToggle',\n type: 'checkbox',\n label: {\n en: 'Enable Mode Toggle',\n cs: 'Povolit přepínač režimu',\n },\n defaultValue: true,\n admin: {\n description: {\n en: 'Let visitors switch modes',\n cs: 'Umožnit návštěvníkům přepínat režimy',\n },\n width: '50%',\n },\n },\n ],\n },\n lightModeField,\n darkModeField,\n ],\n })\n }\n\n // Typography - Always visible\n fields.push({\n type: 'collapsible',\n label: {\n en: '🅰️ Typography',\n cs: '🅰️ Typografie',\n },\n admin: {\n initCollapsed: true,\n description: {\n en: 'Choose font families and base typography settings. Leave fields on \"Use preset\" to inherit the theme defaults.',\n cs: 'Zvolte rodiny písem a základní typografické nastavení. Hodnota \"Použít výchozí\" zachová nastavení motivu.',\n },\n },\n fields: [\n {\n name: 'typography',\n type: 'group',\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'bodyFont',\n type: 'select',\n label: {\n en: 'Body font',\n cs: 'Písmo pro text',\n },\n defaultValue: 'preset',\n // @ts-expect-error - Pass full objects including fontFamily for custom rendering\n options: BODY_FONT_OPTIONS,\n admin: {\n width: '50%',\n components: {\n Field: '@kilivi/payloadcms-theme-management/fields/FontSelectField',\n },\n },\n },\n {\n name: 'headingFont',\n type: 'select',\n label: {\n en: 'Heading font',\n cs: 'Písmo pro nadpisy',\n },\n defaultValue: 'preset',\n // @ts-expect-error - Pass full objects including fontFamily for custom rendering\n options: HEADING_FONT_OPTIONS,\n admin: {\n width: '50%',\n components: {\n Field: '@kilivi/payloadcms-theme-management/fields/FontSelectField',\n },\n },\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'bodyFontCustom',\n type: 'text',\n label: {\n en: 'Custom body font stack',\n cs: 'Vlastní písmo pro text',\n },\n admin: {\n width: '50%',\n placeholder: '\"IBM Plex Sans\", sans-serif',\n description: {\n en: 'Provide full CSS font-family stack when using a custom font.',\n cs: 'Při volbě vlastního písma zadejte celý CSS zápis font-family.',\n },\n condition: (_, siblingData) => siblingData?.bodyFont === 'custom',\n },\n },\n {\n name: 'headingFontCustom',\n type: 'text',\n label: {\n en: 'Custom heading font stack',\n cs: 'Vlastní písmo pro nadpisy',\n },\n admin: {\n width: '50%',\n placeholder: '\"Cormorant Garamond\", serif',\n description: {\n en: 'Provide full CSS font-family stack when using a custom heading font.',\n cs: 'Při volbě vlastního nadpisového písma zadejte celý CSS zápis font-family.',\n },\n condition: (_, siblingData) => siblingData?.headingFont === 'custom',\n },\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'baseFontSize',\n type: 'select',\n label: {\n en: 'Base font size',\n cs: 'Základní velikost písma',\n },\n defaultValue: 'preset',\n options: BASE_FONT_SIZE_OPTIONS.map((option) => ({\n label: option.label,\n value: option.value,\n })),\n admin: {\n width: '50%',\n },\n },\n {\n name: 'lineHeight',\n type: 'select',\n label: {\n en: 'Line height',\n cs: 'Řádkování',\n },\n defaultValue: 'preset',\n options: LINE_HEIGHT_OPTIONS.map((option) => ({\n label: option.label,\n value: option.value,\n })),\n admin: {\n width: '50%',\n },\n },\n ],\n },\n ],\n },\n ],\n })\n\n // Custom Theme Presets importer\n fields.push({\n type: 'collapsible',\n label: {\n en: '🧩 Custom Theme Presets',\n cs: '🧩 Vlastní motivy',\n },\n admin: {\n initCollapsed: true,\n description: {\n en: 'Import additional theme presets via JSON to extend or override the defaults. These presets become available instantly in the Theme Selection above.',\n 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.',\n },\n },\n fields: [\n {\n name: 'customThemePresets',\n type: 'json',\n label: {\n en: 'Custom Preset JSON',\n cs: 'JSON s vlastními motivy',\n },\n admin: {\n description: {\n 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.',\n 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.',\n },\n components: {\n Field: '@kilivi/payloadcms-theme-management/fields/ThemePresetImportField',\n },\n },\n },\n ],\n })\n\n // Advanced Settings (when using extended theme configuration)\n if (enableAdvancedFeatures) {\n const advancedFields: Field[] = [\n {\n name: 'animationLevel',\n type: 'select',\n label: {\n en: 'Animation Level',\n cs: 'Úroveň animací',\n },\n defaultValue: 'medium',\n options: [\n { label: { en: 'None', cs: 'Žádné' }, value: 'none' },\n { label: { en: 'Reduced', cs: 'Snížené' }, value: 'reduced' },\n { label: { en: 'Medium', cs: 'Střední' }, value: 'medium' },\n { label: { en: 'High', cs: 'Vysoké' }, value: 'high' },\n ],\n admin: {\n description: {\n en: 'Control website animations and transitions',\n cs: 'Kontrola animací a přechodů na webu',\n },\n width: '50%',\n },\n },\n ]\n\n if (includeCustomCSS) {\n advancedFields.push({\n name: 'customCSS',\n type: 'code',\n label: {\n en: 'Custom CSS',\n cs: 'Vlastní CSS',\n },\n admin: {\n language: 'css',\n description: {\n en: 'Add custom CSS to override default styles',\n cs: 'Přidejte vlastní CSS pro přepsání výchozích stylů',\n },\n // placeholder:\n // ':root {\\n --primary: #your-color;\\n --border-radius: 8px;\\n --font-family: \"Your Font\";\\n}\\n\\n.custom-class {\\n /* Your custom styles */\\n}',\n // rows: 8,\n },\n })\n }\n\n fields.push({\n type: 'collapsible',\n label: {\n en: '⚙️ Advanced Settings',\n cs: '⚙️ Pokročilé nastavení',\n },\n admin: {\n initCollapsed: true,\n },\n fields: advancedFields,\n })\n }\n\n // Return as tab configuration to be injected into tabs structure\n return {\n label: {\n en: '🎨 Appearance Settings',\n cs: '🎨 Nastavení vzhledu',\n },\n fields: [\n {\n name: 'themeConfiguration',\n type: 'group',\n admin: {\n description: {\n en: 'Configure website appearance and styling',\n cs: 'Nakonfigurujte vzhled a stylování webu',\n },\n },\n fields,\n },\n ],\n }\n}\n"],"names":["BASE_FONT_SIZE_OPTIONS","BODY_FONT_OPTIONS","HEADING_FONT_OPTIONS","LINE_HEIGHT_OPTIONS","darkModeField","lightModeField","createThemeConfigurationField","options","themePresets","defaultTheme","includeColorModeToggle","includeCustomCSS","enableAdvancedFeatures","fields","name","type","required","defaultValue","label","en","cs","validate","value","trim","length","admin","description","components","Field","custom","push","width","initCollapsed","placeholder","condition","_","siblingData","bodyFont","headingFont","map","option","advancedFields","language"],"mappings":"AACA,SACEA,sBAAsB,EACtBC,iBAAiB,EACjBC,oBAAoB,EACpBC,mBAAmB,QACd,6BAA4B;AAEnC,SAASC,aAAa,EAAEC,cAAc,QAAQ,uBAAsB;AAcpE;;;CAGC,GACD,OAAO,SAASC,8BAA8BC,OAAuC;IACnF,MAAM,EACJC,YAAY,EACZC,YAAY,EACZC,sBAAsB,EACtBC,gBAAgB,EAChBC,yBAAyB,IAAI,EAC9B,GAAGL;IAEJ,MAAMM,SAAkB;QACtB;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;YACVC,cAAcR;YACdS,OAAO;gBACLC,IAAI;gBACJC,IAAI;YACN;YACAC,UAAU,CAACC;gBACT,IAAI,OAAOA,UAAU,YAAYA,MAAMC,IAAI,GAAGC,MAAM,GAAG,GAAG;oBACxD,OAAO;gBACT;gBACA,OAAO;YACT;YACAC,OAAO;gBACLC,aAAa;oBACXP,IAAI;oBACJC,IAAI;gBACN;gBACAO,YAAY;oBACVC,OAAO;gBACT;gBACAC,QAAQ;oBACNrB;gBACF;YACF;QACF;KACD;IAED,+CAA+C;IAC/CK,OAAOiB,IAAI,CAAC;QACVf,MAAM;QACNF,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNG,OAAO;oBACLC,IAAI;oBACJC,IAAI;gBACN;gBACAH,cAAc;gBACdV,SAAS;oBACP;wBAAEW,OAAO;4BAAEC,IAAI;4BAAcC,IAAI;wBAAc;wBAAGE,OAAO;oBAAO;oBAChE;wBAAEJ,OAAO;4BAAEC,IAAI;4BAAmBC,IAAI;wBAAiB;wBAAGE,OAAO;oBAAQ;oBACzE;wBAAEJ,OAAO;4BAAEC,IAAI;4BAAmBC,IAAI;wBAAmB;wBAAG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olvedThemeConfiguration } from './utils/resolveThemeConfigurati
19
19
  export { generateThemeColorsCss, hexToHsl } from './utils/themeColors.js';
20
20
  export { generateThemeCSS, getThemeStyles } from './utils/themeUtils.js';
21
21
  export { getThemeHtmlAttributes } from './utils/themeHtmlAttributes.js';
22
+ export { generateThemeCSS as generatePresetCSS, generateAllThemesCSS, } from './utils/generateThemeCSS.js';
23
+ export { getThemeDynamicCSS, getAllDynamicThemesCSS } from './utils/themeCSS.js';
22
24
  export type { Mode, ThemeDefaults } from './providers/Theme/types.js';
23
25
  export { ThemeProvider } from './providers/Theme/index.js';
24
26
  export { getFontLoaderCode, getThemeFontFamilies, ThemeFontProvider, useThemeFonts, FONT_IMPORT_MAP, } from './providers/font-loader.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmC,MAAM,EAAa,MAAM,SAAS,CAAA;AAGjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAA;AA6F9F,eAAO,MAAM,qBAAqB,GAAI,UAAS,4BAAiC,KAAG,MAmElF,CAAA;AAED,KAAK,iBAAiB,GAAG,MAAM,GAAG,8BAA8B,CAAA;AAEhE,eAAO,MAAM,uBAAuB,GAClC,UAAU,iBAAiB,KAC1B,OAAO,CAAC,sBAAsB,GAAG,IAAI,CA2CvC,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,KAAG,WAAW,GAAG,IAEhE,CAAA;AAED,eAAO,MAAM,wBAAwB,QAAO,WAAW,EAEtD,CAAA;AAED,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnE,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MA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;AACzE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,oBAAoB,GACrB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAEhF,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAG1D,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,eAAe,GAChB,MAAM,4BAA4B,CAAA;AAMnC,eAAO,MAAM,qBAAqB,aAhLa,4BAA4B,KAAQ,MAgLzB,CAAA;AAC1D,oDAAoD;AACpD,eAAO,MAAM,wBAAwB,aAlLU,4BAA4B,KAAQ,MAkLtB,CAAA;AAE7D,eAAe,qBAAqB,CAAA"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createThemeConfigurationField } from './fields/themeConfigurationField.js';
2
- import { defaultThemePresets } from './presets.js';
2
+ import { allThemePresets } from './presets.js';
3
3
  const THEME_FIELD_NAME = 'themeConfiguration';
4
4
  /**
5
5
  * Removes existing theme configuration from a group field (legacy)
@@ -69,7 +69,7 @@ const THEME_FIELD_NAME = 'themeConfiguration';
69
69
  const ensureCollectionsArray = (collections)=>Array.isArray(collections) ? collections : [];
70
70
  export const themeManagementPlugin = (options = {})=>{
71
71
  return (config)=>{
72
- const { enabled = true, targetCollection = 'site-settings', themePresets = defaultThemePresets, defaultTheme = 'cool', includeColorModeToggle = true, includeCustomCSS = true, includeBrandIdentity = false, enableAdvancedFeatures = true, enableLogging = false } = options;
72
+ const { enabled = true, targetCollection = 'site-settings', themePresets = allThemePresets, defaultTheme = 'cool', includeColorModeToggle = true, includeCustomCSS = true, includeBrandIdentity = false, enableAdvancedFeatures = true, enableLogging = false } = options;
73
73
  if (!enabled) {
74
74
  if (enableLogging) {
75
75
  console.log('🎨 Theme Management Plugin: disabled via options, skipping.');
@@ -143,10 +143,10 @@ export const fetchThemeConfiguration = async (options)=>{
143
143
  }
144
144
  };
145
145
  export const getThemePreset = (themeName)=>{
146
- return defaultThemePresets.find((preset)=>preset.name === themeName) || null;
146
+ return allThemePresets.find((preset)=>preset.name === themeName) || null;
147
147
  };
148
148
  export const getAvailableThemePresets = ()=>{
149
- return defaultThemePresets;
149
+ return allThemePresets;
150
150
  };
151
151
  export { defaultThemePresets, allThemePresets } from './presets.js';
152
152
  export { extendedThemePresets, allExtendedThemePresets, extendedThemeToCSSVariables } from './extended-presets.js';
@@ -155,6 +155,9 @@ export { DEFAULT_THEME_CONFIGURATION, resolveThemeConfiguration } from './utils/
155
155
  export { generateThemeColorsCss, hexToHsl } from './utils/themeColors.js';
156
156
  export { generateThemeCSS, getThemeStyles } from './utils/themeUtils.js';
157
157
  export { getThemeHtmlAttributes } from './utils/themeHtmlAttributes.js';
158
+ // Dynamic theme CSS generation
159
+ export { generateThemeCSS as generatePresetCSS, generateAllThemesCSS } from './utils/generateThemeCSS.js';
160
+ export { getThemeDynamicCSS, getAllDynamicThemesCSS } from './utils/themeCSS.js';
158
161
  export { ThemeProvider } from './providers/Theme/index.js';
159
162
  // Font loading utilities for Next.js integration
160
163
  export { getFontLoaderCode, getThemeFontFamilies, ThemeFontProvider, useThemeFonts, FONT_IMPORT_MAP } from './providers/font-loader.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionConfig, Config, Field, Plugin, TabsField } from 'payload'\nimport { createThemeConfigurationField } from './fields/themeConfigurationField.js'\nimport type { ThemeTab } from './fields/themeConfigurationField.js'\nimport type { SiteThemeConfiguration } from './payload-types.js'\nimport type { ThemePreset } from './presets.js'\nimport { defaultThemePresets } from './presets.js'\nimport type { FetchThemeConfigurationOptions, ThemeManagementPluginOptions } from './types.js'\n\nconst THEME_FIELD_NAME = 'themeConfiguration'\n\n/**\n * Removes existing theme configuration from a group field (legacy)\n */\nconst removeExistingThemeField = (fields: Field[] = []): Field[] =>\n fields.filter((field) => {\n const candidate = field as { name?: unknown }\n return candidate?.name !== THEME_FIELD_NAME\n })\n\n/**\n * Finds the tabs field in the collection fields array\n */\nconst findTabsField = (fields: Field[] = []): TabsField | null => {\n for (const field of fields) {\n if (field.type === 'tabs') {\n return field as TabsField\n }\n }\n return null\n}\n\n/**\n * Removes existing Appearance Settings tab if it exists\n */\nconst removeExistingThemeTab = (\n tabs: NonNullable<TabsField['tabs']>,\n): NonNullable<TabsField['tabs']> => {\n return tabs.filter((tab) => {\n const labelEn =\n typeof tab.label === 'object' && tab.label !== null\n ? (tab.label as { en?: string }).en\n : tab.label\n return labelEn !== '🎨 Appearance Settings' && labelEn !== 'Appearance Settings'\n })\n}\n\n/**\n * Injects theme tab into existing tabs field\n */\nconst injectThemeTab = (\n fields: Field[] | undefined,\n themeTab: ThemeTab,\n enableLogging: boolean,\n): Field[] => {\n // First, remove any legacy theme field (group-based)\n const sanitizedFields = removeExistingThemeField(fields ?? [])\n\n // Find the tabs field\n const tabsField = findTabsField(sanitizedFields)\n\n if (!tabsField || !tabsField.tabs) {\n if (enableLogging) {\n console.warn(\n '🎨 Theme Management Plugin: No tabs field found. Creating a new tabs structure.',\n )\n }\n\n // If no tabs exist, create a basic tabs structure with just the theme tab\n const newTabsField: TabsField = {\n type: 'tabs',\n tabs: [themeTab],\n }\n\n return [...sanitizedFields, newTabsField]\n }\n\n // Remove existing theme tab if present\n const sanitizedTabs = removeExistingThemeTab(tabsField.tabs)\n\n // Add theme tab to the end\n const updatedTabs = [...sanitizedTabs, themeTab]\n\n if (enableLogging) {\n console.log('🎨 Theme Management Plugin: injecting Appearance Settings tab')\n }\n\n // Update the tabs field\n const updatedTabsField: TabsField = {\n ...tabsField,\n tabs: updatedTabs,\n }\n\n // Replace the old tabs field with the updated one\n return sanitizedFields.map((field) => (field.type === 'tabs' ? updatedTabsField : field))\n}\n\nconst ensureCollectionsArray = (collections: Config['collections']): CollectionConfig[] =>\n Array.isArray(collections) ? collections : []\n\nexport const themeManagementPlugin = (options: ThemeManagementPluginOptions = {}): Plugin => {\n return (config: Config): Config => {\n const {\n enabled = true,\n targetCollection = 'site-settings',\n themePresets = defaultThemePresets,\n defaultTheme = 'cool',\n includeColorModeToggle = true,\n includeCustomCSS = true,\n includeBrandIdentity = false,\n enableAdvancedFeatures = true,\n enableLogging = false,\n } = options\n\n if (!enabled) {\n if (enableLogging) {\n console.log('🎨 Theme Management Plugin: disabled via options, skipping.')\n }\n return config\n }\n\n const themeTab = createThemeConfigurationField({\n themePresets,\n defaultTheme,\n includeColorModeToggle,\n includeCustomCSS,\n includeBrandIdentity: includeBrandIdentity ?? false,\n enableAdvancedFeatures,\n })\n\n let collectionTouched = false\n\n const collections = ensureCollectionsArray(config.collections).map((collection) => {\n if (collection.slug !== targetCollection) {\n return collection\n }\n\n collectionTouched = true\n\n if (enableLogging) {\n console.log(`🎨 Theme Management Plugin: enhancing collection \"${collection.slug}\"`)\n }\n\n const existingFields = Array.isArray(collection.fields) ? collection.fields : []\n\n const fields = injectThemeTab(existingFields, themeTab, enableLogging)\n\n return {\n ...collection,\n fields,\n }\n })\n\n if (!collectionTouched) {\n if (enableLogging) {\n console.warn(\n `🎨 Theme Management Plugin: collection \"${targetCollection}\" was not found, leaving config untouched.`,\n )\n }\n return config\n }\n\n return {\n ...config,\n collections,\n }\n }\n}\n\ntype FetchOptionsInput = string | FetchThemeConfigurationOptions\n\nexport const fetchThemeConfiguration = async (\n options?: FetchOptionsInput,\n): Promise<SiteThemeConfiguration | null> => {\n const normalizedOptions = typeof options === 'string' ? { tenantSlug: options } : (options ?? {})\n\n const {\n tenantSlug,\n collectionSlug = 'site-settings',\n depth,\n locale,\n draft,\n queryParams = {},\n } = normalizedOptions\n\n const params = new URLSearchParams({ limit: '1' })\n\n if (typeof depth === 'number') params.set('depth', String(depth))\n if (tenantSlug) params.set('tenant', tenantSlug)\n if (locale) params.set('locale', locale)\n if (draft) params.set('draft', 'true')\n\n Object.entries(queryParams).forEach(([key, value]) => {\n if (value === undefined) return\n params.set(key, String(value))\n })\n\n const url = `/api/${collectionSlug}?${params.toString()}`\n\n try {\n const response = await fetch(url)\n if (!response.ok) {\n throw new Error(`Failed to fetch theme configuration (status ${response.status})`)\n }\n\n const data = (await response.json()) as {\n docs?: Array<{ themeConfiguration?: SiteThemeConfiguration }>\n }\n\n const doc = data.docs?.[0]\n\n return doc?.themeConfiguration ?? null\n } catch (error) {\n console.warn('Failed to fetch theme configuration:', error)\n return null\n }\n}\n\nexport const getThemePreset = (themeName: string): ThemePreset | null => {\n return defaultThemePresets.find((preset) => preset.name === themeName) || null\n}\n\nexport const getAvailableThemePresets = (): ThemePreset[] => {\n return defaultThemePresets\n}\n\nexport { defaultThemePresets, allThemePresets } from './presets.js'\nexport type { ThemePreset, ThemeTypographyPreset } from './presets.js'\nexport type { ThemeTab } from './fields/themeConfigurationField.js'\nexport {\n extendedThemePresets,\n allExtendedThemePresets,\n extendedThemeToCSSVariables,\n} from './extended-presets.js'\nexport type { ExtendedThemePreset, ShadcnColorTokens } from './extended-presets.js'\nexport {\n applyExtendedTheme,\n generateExtendedThemeCSS,\n resetExtendedTheme,\n getExtendedThemeTokens,\n createUseExtendedTheme,\n getTailwindVarReferences,\n} from './utils/extendedThemeHelpers.js'\nexport type { ThemeManagementPluginOptions, FetchThemeConfigurationOptions } from './types.js'\nexport {\n DEFAULT_THEME_CONFIGURATION,\n resolveThemeConfiguration,\n} from './utils/resolveThemeConfiguration.js'\nexport type { ResolvedThemeConfiguration } from './utils/resolveThemeConfiguration.js'\nexport { generateThemeColorsCss, hexToHsl } from './utils/themeColors.js'\nexport { generateThemeCSS, getThemeStyles } from './utils/themeUtils.js'\nexport { getThemeHtmlAttributes } from './utils/themeHtmlAttributes.js'\n\nexport type { Mode, ThemeDefaults } from './providers/Theme/types.js'\nexport { ThemeProvider } from './providers/Theme/index.js'\n\n// Font loading utilities for Next.js integration\nexport {\n getFontLoaderCode,\n getThemeFontFamilies,\n ThemeFontProvider,\n useThemeFonts,\n FONT_IMPORT_MAP,\n} from './providers/font-loader.js'\n\n// Note: Do NOT re-export client components from the root entry to avoid\n// server-side evaluation during `payload generate:importmap`.\n// If needed, import directly from subpath: `@kilivi/payloadcms-theme-management/fields/ThemeLivePreview`\n\nexport const ThemeManagementPlugin = themeManagementPlugin\n/** @deprecated use {@link themeManagementPlugin} */\nexport const themeConfigurationPlugin = themeManagementPlugin\n\nexport default themeManagementPlugin\n"],"names":["createThemeConfigurationField","defaultThemePresets","THEME_FIELD_NAME","removeExistingThemeField","fields","filter","field","candidate","name","findTabsField","type","removeExistingThemeTab","tabs","tab","labelEn","label","en","injectThemeTab","themeTab","enableLogging","sanitizedFields","tabsField","console","warn","newTabsField","sanitizedTabs","updatedTabs","log","updatedTabsField","map","ensureCollectionsArray","collections","Array","isArray","themeManagementPlugin","options","config","enabled","targetCollection","themePresets","defaultTheme","includeColorModeToggle","includeCustomCSS","includeBrandIdentity","enableAdvancedFeatures","collectionTouched","collection","slug","existingFields","fetchThemeConfiguration","normalizedOptions","tenantSlug","collectionSlug","depth","locale","draft","queryParams","params","URLSearchParams","limit","set","String","Object","entries","forEach","key","value","undefined","url","toString","response","fetch","ok","Error","status","data","json","doc","docs","themeConfiguration","error","getThemePreset","themeName","find","preset","getAvailableThemePresets","allThemePresets","extendedThemePresets","allExtendedThemePresets","extendedThemeToCSSVariables","applyExtendedTheme","generateExtendedThemeCSS","resetExtendedTheme","getExtendedThemeTokens","createUseExtendedTheme","getTailwindVarReferences","DEFAULT_THEME_CONFIGURATION","resolveThemeConfiguration","generateThemeColorsCss","hexToHsl","generateThemeCSS","getThemeStyles","getThemeHtmlAttributes","ThemeProvider","getFontLoaderCode","getThemeFontFamilies","ThemeFontProvider","useThemeF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C,EAAE,OAAOC,OAAO;QACd1D,QAAQC,IAAI,CAAC,wCAAwCyD;QACrD,OAAO;IACT;AACF,EAAC;AAED,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,OAAOjF,oBAAoBkF,IAAI,CAAC,CAACC,SAAWA,OAAO5E,IAAI,KAAK0E,cAAc;AAC5E,EAAC;AAED,OAAO,MAAMG,2BAA2B;IACtC,OAAOpF;AACT,EAAC;AAED,SAASA,mBAAmB,EAAEqF,eAAe,QAAQ,eAAc;AAGnE,SACEC,oBAAoB,EACpBC,uBAAuB,EACvBC,2BAA2B,QACtB,wBAAuB;AAE9B,SACEC,kBAAkB,EAClBC,wBAAwB,EACxBC,kBAAkB,EAClBC,sBAAsB,EACtBC,sBAAsB,EACtBC,wBAAwB,QACnB,kCAAiC;AAExC,SACEC,2BAA2B,EAC3BC,yBAAyB,QACpB,uCAAsC;AAE7C,SAASC,sBAAsB,EAAEC,QAAQ,QAAQ,yBAAwB;AACzE,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,wBAAuB;AACxE,SAASC,sBAAsB,QAAQ,iCAAgC;AAGvE,SAASC,aAAa,QAAQ,6BAA4B;AAE1D,iDAAiD;AACjD,SACEC,iBAAiB,EACjBC,oBAAoB,EACpBC,iBAAiB,EACjBC,aAAa,EACbC,eAAe,QACV,6BAA4B;AAEnC,wEAAwE;AACxE,8DAA8D;AAC9D,yGAAyG;AAEzG,OAAO,MAAMC,wBAAwB3E,sBAAqB;AAC1D,kDAAkD,GAClD,OAAO,MAAM4E,2BAA2B5E,sBAAqB;AAE7D,eAAeA,sBAAqB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionConfig, Config, Field, Plugin, TabsField } from 'payload'\nimport { createThemeConfigurationField } from './fields/themeConfigurationField.js'\nimport type { ThemeTab } from './fields/themeConfigurationField.js'\nimport type { SiteThemeConfiguration } from './payload-types.js'\nimport type { ThemePreset } from './presets.js'\nimport { allThemePresets } from './presets.js'\nimport type { FetchThemeConfigurationOptions, ThemeManagementPluginOptions } from './types.js'\n\nconst THEME_FIELD_NAME = 'themeConfiguration'\n\n/**\n * Removes existing theme configuration from a group field (legacy)\n */\nconst removeExistingThemeField = (fields: Field[] = []): Field[] =>\n fields.filter((field) => {\n const candidate = field as { name?: unknown }\n return candidate?.name !== THEME_FIELD_NAME\n })\n\n/**\n * Finds the tabs field in the collection fields array\n */\nconst findTabsField = (fields: Field[] = []): TabsField | null => {\n for (const field of fields) {\n if (field.type === 'tabs') {\n return field as TabsField\n }\n }\n return null\n}\n\n/**\n * Removes existing Appearance Settings tab if it exists\n */\nconst removeExistingThemeTab = (\n tabs: NonNullable<TabsField['tabs']>,\n): NonNullable<TabsField['tabs']> => {\n return tabs.filter((tab) => {\n const labelEn =\n typeof tab.label === 'object' && tab.label !== null\n ? (tab.label as { en?: string }).en\n : tab.label\n return labelEn !== '🎨 Appearance Settings' && labelEn !== 'Appearance Settings'\n })\n}\n\n/**\n * Injects theme tab into existing tabs field\n */\nconst injectThemeTab = (\n fields: Field[] | undefined,\n themeTab: ThemeTab,\n enableLogging: boolean,\n): Field[] => {\n // First, remove any legacy theme field (group-based)\n const sanitizedFields = removeExistingThemeField(fields ?? [])\n\n // Find the tabs field\n const tabsField = findTabsField(sanitizedFields)\n\n if (!tabsField || !tabsField.tabs) {\n if (enableLogging) {\n console.warn(\n '🎨 Theme Management Plugin: No tabs field found. Creating a new tabs structure.',\n )\n }\n\n // If no tabs exist, create a basic tabs structure with just the theme tab\n const newTabsField: TabsField = {\n type: 'tabs',\n tabs: [themeTab],\n }\n\n return [...sanitizedFields, newTabsField]\n }\n\n // Remove existing theme tab if present\n const sanitizedTabs = removeExistingThemeTab(tabsField.tabs)\n\n // Add theme tab to the end\n const updatedTabs = [...sanitizedTabs, themeTab]\n\n if (enableLogging) {\n console.log('🎨 Theme Management Plugin: injecting Appearance Settings tab')\n }\n\n // Update the tabs field\n const updatedTabsField: TabsField = {\n ...tabsField,\n tabs: updatedTabs,\n }\n\n // Replace the old tabs field with the updated one\n return sanitizedFields.map((field) => (field.type === 'tabs' ? updatedTabsField : field))\n}\n\nconst ensureCollectionsArray = (collections: Config['collections']): CollectionConfig[] =>\n Array.isArray(collections) ? collections : []\n\nexport const themeManagementPlugin = (options: ThemeManagementPluginOptions = {}): Plugin => {\n return (config: Config): Config => {\n const {\n enabled = true,\n targetCollection = 'site-settings',\n themePresets = allThemePresets,\n defaultTheme = 'cool',\n includeColorModeToggle = true,\n includeCustomCSS = true,\n includeBrandIdentity = false,\n enableAdvancedFeatures = true,\n enableLogging = false,\n } = options\n\n if (!enabled) {\n if (enableLogging) {\n console.log('🎨 Theme Management Plugin: disabled via options, skipping.')\n }\n return config\n }\n\n const themeTab = createThemeConfigurationField({\n themePresets,\n defaultTheme,\n includeColorModeToggle,\n includeCustomCSS,\n includeBrandIdentity: includeBrandIdentity ?? false,\n enableAdvancedFeatures,\n })\n\n let collectionTouched = false\n\n const collections = ensureCollectionsArray(config.collections).map((collection) => {\n if (collection.slug !== targetCollection) {\n return collection\n }\n\n collectionTouched = true\n\n if (enableLogging) {\n console.log(`🎨 Theme Management Plugin: enhancing collection \"${collection.slug}\"`)\n }\n\n const existingFields = Array.isArray(collection.fields) ? collection.fields : []\n\n const fields = injectThemeTab(existingFields, themeTab, enableLogging)\n\n return {\n ...collection,\n fields,\n }\n })\n\n if (!collectionTouched) {\n if (enableLogging) {\n console.warn(\n `🎨 Theme Management Plugin: collection \"${targetCollection}\" was not found, leaving config untouched.`,\n )\n }\n return config\n }\n\n return {\n ...config,\n collections,\n }\n }\n}\n\ntype FetchOptionsInput = string | FetchThemeConfigurationOptions\n\nexport const fetchThemeConfiguration = async (\n options?: FetchOptionsInput,\n): Promise<SiteThemeConfiguration | null> => {\n const normalizedOptions = typeof options === 'string' ? { tenantSlug: options } : (options ?? {})\n\n const {\n tenantSlug,\n collectionSlug = 'site-settings',\n depth,\n locale,\n draft,\n queryParams = {},\n } = normalizedOptions\n\n const params = new URLSearchParams({ limit: '1' })\n\n if (typeof depth === 'number') params.set('depth', String(depth))\n if (tenantSlug) params.set('tenant', tenantSlug)\n if (locale) params.set('locale', locale)\n if (draft) params.set('draft', 'true')\n\n Object.entries(queryParams).forEach(([key, value]) => {\n if (value === undefined) return\n params.set(key, String(value))\n })\n\n const url = `/api/${collectionSlug}?${params.toString()}`\n\n try {\n const response = await fetch(url)\n if (!response.ok) {\n throw new Error(`Failed to fetch theme configuration (status ${response.status})`)\n }\n\n const data = (await response.json()) as {\n docs?: Array<{ themeConfiguration?: SiteThemeConfiguration }>\n }\n\n const doc = data.docs?.[0]\n\n return doc?.themeConfiguration ?? null\n } catch (error) {\n console.warn('Failed to fetch theme configuration:', error)\n return null\n }\n}\n\nexport const getThemePreset = (themeName: string): ThemePreset | null => {\n return allThemePresets.find((preset) => preset.name === themeName) || null\n}\n\nexport const getAvailableThemePresets = (): ThemePreset[] => {\n return allThemePresets\n}\n\nexport { defaultThemePresets, allThemePresets } from './presets.js'\nexport type { ThemePreset, ThemeTypographyPreset } from './presets.js'\nexport type { ThemeTab } from './fields/themeConfigurationField.js'\nexport {\n extendedThemePresets,\n allExtendedThemePresets,\n extendedThemeToCSSVariables,\n} from './extended-presets.js'\nexport type { ExtendedThemePreset, ShadcnColorTokens } from './extended-presets.js'\nexport {\n applyExtendedTheme,\n generateExtendedThemeCSS,\n resetExtendedTheme,\n getExtendedThemeTokens,\n createUseExtendedTheme,\n getTailwindVarReferences,\n} from './utils/extendedThemeHelpers.js'\nexport type { ThemeManagementPluginOptions, FetchThemeConfigurationOptions } from './types.js'\nexport {\n DEFAULT_THEME_CONFIGURATION,\n resolveThemeConfiguration,\n} from './utils/resolveThemeConfiguration.js'\nexport type { ResolvedThemeConfiguration } from './utils/resolveThemeConfiguration.js'\nexport { generateThemeColorsCss, hexToHsl } from './utils/themeColors.js'\nexport { generateThemeCSS, getThemeStyles } from './utils/themeUtils.js'\nexport { getThemeHtmlAttributes } from './utils/themeHtmlAttributes.js'\n\n// Dynamic theme CSS generation\nexport {\n generateThemeCSS as generatePresetCSS,\n generateAllThemesCSS,\n} from './utils/generateThemeCSS.js'\nexport { getThemeDynamicCSS, getAllDynamicThemesCSS } from './utils/themeCSS.js'\n\nexport type { Mode, ThemeDefaults } from './providers/Theme/types.js'\nexport { ThemeProvider } from './providers/Theme/index.js'\n\n// Font loading utilities for Next.js integration\nexport {\n getFontLoaderCode,\n getThemeFontFamilies,\n ThemeFontProvider,\n useThemeFonts,\n FONT_IMPORT_MAP,\n} from './providers/font-loader.js'\n\n// Note: Do NOT re-export client components from the root entry to avoid\n// server-side evaluation during `payload generate:importmap`.\n// If needed, import directly from subpath: `@kilivi/payloadcms-theme-management/fields/ThemeLivePreview`\n\nexport const ThemeManagementPlugin = themeManagementPlugin\n/** @deprecated use {@link themeManagementPlugin} */\nexport const themeConfigurationPlugin = themeManagementPlugin\n\nexport default themeManagementPlugin\n"],"names":["createThemeConfigurationField","allThemePresets","THEME_FIELD_NAME","removeExistingThemeField","fields","filter","field","candidate","name","findTabsField","type","removeExistingThemeTab","tabs","tab","labelEn","label","en","injectThemeTab","themeTab","enableLogging","sanitizedFields","tabsField","console","warn","newTabsField","sanitizedTabs","updatedTabs","log","updatedTabsField","map","ensureCollectionsArray","collections","Array","isArray","themeManagementPlugin","options","config","enabled","targetCollection","themePresets","defaultTheme","includeColorModeToggle","includeCustomCSS","includeBrandIdentity","enableAdvancedFeatures","collectionTouched","collection","slug","existingFields","fetchThemeConfiguration","normalizedOptions","tenantSlug","collectionSlug","depth","locale","draft","queryParams","params","URLSearchParams","limit","set","String","Object","entries","forEach","key","value","undefined","url","toString","response","fetch","ok","Error","status","data","json","doc","docs","themeConfiguration","error","getThemePreset","themeName","find","preset","getAvailableThemePresets","defaultThemePresets","extendedThemePresets","allExtendedThemePresets","extendedThemeToCSSVariables","applyExtendedTheme","generateExtendedThemeCSS","resetExtendedTheme","getExtendedThemeTokens","createUseExtendedTheme","getTailwindVarReferences","DEFAULT_THEME_CONFIGURATION","resolveThemeConfiguration","generateThemeColorsCss","hexToHsl","generateThemeCSS","getThemeStyles","getThemeHtmlAttributes","generatePresetCSS","generateAllThemesCSS","getThemeDynamicCSS","getAllDynamicThemesCSS","ThemeProvider","getFontLoaderCode","getThemeFontFamilies","ThemeFontProvider","useThemeFonts","FONT_IMPORT_MAP","ThemeManagementPlugin","themeConfigurationPlugin"],"mappings":"AACA,SAASA,6BAA6B,QAAQ,sCAAqC;AAInF,SAASC,eAAe,QAAQ,eAAc;AAG9C,MAAMC,mBAAmB;AAEzB;;CAEC,GACD,MAAMC,2BAA2B,CAACC,SAAkB,EAAE,GACpDA,OAAOC,MAAM,CAAC,CAACC;QACb,MAAMC,YAAYD;QAClB,OAAOC,WAAWC,SAASN;IAC7B;AAEF;;CAEC,GACD,MAAMO,gBAAgB,CAACL,SAAkB,EAAE;IACzC,KAAK,MAAME,SAASF,OAAQ;QAC1B,IAAIE,MAAMI,IAAI,KAAK,QAAQ;YACzB,OAAOJ;QACT;IACF;IACA,OAAO;AACT;AAEA;;CAEC,GACD,MAAMK,yBAAyB,CAC7BC;IAEA,OAAOA,KAAKP,MAAM,CAAC,CAACQ;QAClB,MAAMC,UACJ,OAAOD,IAAIE,KAAK,KAAK,YAAYF,IAAIE,KAAK,KAAK,OAC3C,AAACF,IAAIE,KAAK,CAAqBC,EAAE,GACjCH,IAAIE,KAAK;QACf,OAAOD,YAAY,4BAA4BA,YAAY;IAC7D;AACF;AAEA;;CAEC,GACD,MAAMG,iBAAiB,CACrBb,QACAc,UACAC;IAEA,qDAAqD;IACrD,MAAMC,kBAAkBjB,yBAAyBC,UAAU,EAAE;IAE7D,sBAAsB;IACtB,MAAMiB,YAAYZ,cAAcW;IAEhC,IAAI,CAACC,aAAa,CAACA,UAAUT,IAAI,EAAE;QACjC,IAAIO,eAAe;YACjBG,QAAQC,IAAI,CACV;QAEJ;QAEA,0EAA0E;QAC1E,MAAMC,eAA0B;YAC9Bd,MAAM;YACNE,MAAM;gBAACM;aAAS;QA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,OAAO,MAAMgF,2BAA2BhF,sBAAqB;AAE7D,eAAeA,sBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"themeConfig.d.ts","sourceRoot":"","sources":["../../../src/providers/Theme/themeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,aAAa,EAAE,WAAW,CAyG3D,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DtB,CAAA;AAEV,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,WAAW,CAEhE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,OAAO,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE7E"}
1
+ {"version":3,"file":"themeConfig.d.ts","sourceRoot":"","sources":["../../../src/providers/Theme/themeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,aAAa,EAAE,WAAW,CAiW3D,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DtB,CAAA;AAEV,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,WAAW,CAEhE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,OAAO,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE7E"}
@@ -3,7 +3,7 @@ export const themeConfigs = {
3
3
  name: 'cool',
4
4
  label: 'Cool & Professional',
5
5
  borderRadius: 'medium',
6
- cssFile: '/themes/cool.css',
6
+ dynamicCSS: true,
7
7
  preview: {
8
8
  colors: {
9
9
  primary: 'hsl(221 83% 53%)',
@@ -16,7 +16,7 @@ export const themeConfigs = {
16
16
  name: 'brutal',
17
17
  label: 'Modern Brutalism',
18
18
  borderRadius: 'none',
19
- cssFile: '/themes/brutal.css',
19
+ dynamicCSS: true,
20
20
  preview: {
21
21
  colors: {
22
22
  primary: 'hsl(0 0% 0%)',
@@ -29,7 +29,7 @@ export const themeConfigs = {
29
29
  name: 'neon',
30
30
  label: 'Neon Cyberpunk',
31
31
  borderRadius: 'medium',
32
- cssFile: '/themes/neon.css',
32
+ dynamicCSS: true,
33
33
  preview: {
34
34
  colors: {
35
35
  primary: 'hsl(263 90% 51%)',
@@ -42,7 +42,7 @@ export const themeConfigs = {
42
42
  name: 'solar',
43
43
  label: 'Solar',
44
44
  borderRadius: 'large',
45
- cssFile: '/themes/solar.css',
45
+ dynamicCSS: true,
46
46
  preview: {
47
47
  colors: {
48
48
  primary: 'hsl(20 90% 45%)',
@@ -55,7 +55,7 @@ export const themeConfigs = {
55
55
  name: 'dealership',
56
56
  label: 'Dealership',
57
57
  borderRadius: 'medium',
58
- cssFile: '/themes/dealership.css',
58
+ dynamicCSS: true,
59
59
  preview: {
60
60
  colors: {
61
61
  primary: 'hsl(225 25% 25%)',
@@ -68,7 +68,7 @@ export const themeConfigs = {
68
68
  name: 'real-estate',
69
69
  label: 'Real Estate Blue',
70
70
  borderRadius: 'large',
71
- cssFile: '/themes/real-estate.css',
71
+ dynamicCSS: true,
72
72
  preview: {
73
73
  colors: {
74
74
  primary: 'hsl(220 90% 48%)',
@@ -81,7 +81,7 @@ export const themeConfigs = {
81
81
  name: 'real-estate-gold',
82
82
  label: 'Real Estate Gold',
83
83
  borderRadius: 'large',
84
- cssFile: '/themes/real-estate-gold.css',
84
+ dynamicCSS: true,
85
85
  preview: {
86
86
  colors: {
87
87
  primary: 'hsl(38 75% 45%)',
@@ -94,7 +94,7 @@ export const themeConfigs = {
94
94
  name: 'real-estate-neutral',
95
95
  label: 'Real Estate Neutral',
96
96
  borderRadius: 'large',
97
- cssFile: '/themes/real-estate-neutral.css',
97
+ dynamicCSS: true,
98
98
  preview: {
99
99
  colors: {
100
100
  primary: 'hsl(25 35% 25%)',
@@ -102,6 +102,254 @@ export const themeConfigs = {
102
102
  accent: 'hsl(35 25% 45%)'
103
103
  }
104
104
  }
105
+ },
106
+ // Extended 20 color themes (Dynamic CSS generation)
107
+ cyberpunk: {
108
+ name: 'cyberpunk',
109
+ label: 'Cyberpunk Neon',
110
+ borderRadius: 'large',
111
+ dynamicCSS: true,
112
+ preview: {
113
+ colors: {
114
+ primary: 'hsl(320, 25%, 65%)',
115
+ background: 'hsl(180, 2%, 98%)',
116
+ accent: 'hsl(290, 22%, 75%)'
117
+ }
118
+ }
119
+ },
120
+ minimal: {
121
+ name: 'minimal',
122
+ label: 'Minimal Clean',
123
+ borderRadius: 'none',
124
+ dynamicCSS: true,
125
+ preview: {
126
+ colors: {
127
+ primary: 'hsl(0, 0%, 12%)',
128
+ background: 'hsl(0, 0%, 100%)',
129
+ accent: 'hsl(0, 0%, 96%)'
130
+ }
131
+ }
132
+ },
133
+ retro: {
134
+ name: 'retro',
135
+ label: 'Retro Vintage',
136
+ borderRadius: 'small',
137
+ dynamicCSS: true,
138
+ preview: {
139
+ colors: {
140
+ primary: 'hsl(35, 18%, 55%)',
141
+ background: 'hsl(80, 3%, 96%)',
142
+ accent: 'hsl(50, 16%, 68%)'
143
+ }
144
+ }
145
+ },
146
+ pastel: {
147
+ name: 'pastel',
148
+ label: 'Pastel Soft',
149
+ borderRadius: 'xl',
150
+ dynamicCSS: true,
151
+ preview: {
152
+ colors: {
153
+ primary: 'hsl(270, 12%, 70%)',
154
+ background: 'hsl(250, 1%, 98%)',
155
+ accent: 'hsl(300, 8%, 85%)'
156
+ }
157
+ }
158
+ },
159
+ ocean: {
160
+ name: 'ocean',
161
+ label: 'Ocean Deep',
162
+ borderRadius: 'medium',
163
+ dynamicCSS: true,
164
+ preview: {
165
+ colors: {
166
+ primary: 'hsl(230, 18%, 55%)',
167
+ background: 'hsl(220, 2%, 97%)',
168
+ accent: 'hsl(190, 15%, 68%)'
169
+ }
170
+ }
171
+ },
172
+ forest: {
173
+ name: 'forest',
174
+ label: 'Forest Green',
175
+ borderRadius: 'medium',
176
+ dynamicCSS: true,
177
+ preview: {
178
+ colors: {
179
+ primary: 'hsl(145, 16%, 52%)',
180
+ background: 'hsl(145, 2%, 97%)',
181
+ accent: 'hsl(155, 14%, 65%)'
182
+ }
183
+ }
184
+ },
185
+ sunset: {
186
+ name: 'sunset',
187
+ label: 'Sunset Warm',
188
+ borderRadius: 'large',
189
+ dynamicCSS: true,
190
+ preview: {
191
+ colors: {
192
+ primary: 'hsl(35, 20%, 60%)',
193
+ background: 'hsl(50, 3%, 97%)',
194
+ accent: 'hsl(20, 18%, 68%)'
195
+ }
196
+ }
197
+ },
198
+ lavender: {
199
+ name: 'lavender',
200
+ label: 'Lavender Dream',
201
+ borderRadius: 'xl',
202
+ dynamicCSS: true,
203
+ preview: {
204
+ colors: {
205
+ primary: 'hsl(295, 16%, 62%)',
206
+ background: 'hsl(295, 2%, 98%)',
207
+ accent: 'hsl(310, 14%, 72%)'
208
+ }
209
+ }
210
+ },
211
+ neutral: {
212
+ name: 'neutral',
213
+ label: 'Neutral',
214
+ borderRadius: 'medium',
215
+ dynamicCSS: true,
216
+ preview: {
217
+ colors: {
218
+ primary: 'hsl(0, 0%, 0%)',
219
+ background: 'hsl(0, 0%, 99%)',
220
+ accent: 'hsl(0, 0%, 94%)'
221
+ }
222
+ }
223
+ },
224
+ blue: {
225
+ name: 'blue',
226
+ label: 'Blue',
227
+ borderRadius: 'large',
228
+ dynamicCSS: true,
229
+ preview: {
230
+ colors: {
231
+ primary: 'hsl(221, 83%, 53%)',
232
+ background: 'hsl(0, 0%, 100%)',
233
+ accent: 'hsl(0, 0%, 97%)'
234
+ }
235
+ }
236
+ },
237
+ green: {
238
+ name: 'green',
239
+ label: 'Green',
240
+ borderRadius: 'large',
241
+ dynamicCSS: true,
242
+ preview: {
243
+ colors: {
244
+ primary: 'hsl(85, 85%, 35%)',
245
+ background: 'hsl(0, 0%, 100%)',
246
+ accent: 'hsl(0, 0%, 97%)'
247
+ }
248
+ }
249
+ },
250
+ red: {
251
+ name: 'red',
252
+ label: 'Red',
253
+ borderRadius: 'large',
254
+ dynamicCSS: true,
255
+ preview: {
256
+ colors: {
257
+ primary: 'hsl(0, 72%, 51%)',
258
+ background: 'hsl(0, 0%, 100%)',
259
+ accent: 'hsl(0, 0%, 97%)'
260
+ }
261
+ }
262
+ },
263
+ orange: {
264
+ name: 'orange',
265
+ label: 'Orange',
266
+ borderRadius: 'large',
267
+ dynamicCSS: true,
268
+ preview: {
269
+ colors: {
270
+ primary: 'hsl(21, 90%, 48%)',
271
+ background: 'hsl(0, 0%, 100%)',
272
+ accent: 'hsl(0, 0%, 97%)'
273
+ }
274
+ }
275
+ },
276
+ rose: {
277
+ name: 'rose',
278
+ label: 'Rose',
279
+ borderRadius: 'large',
280
+ dynamicCSS: true,
281
+ preview: {
282
+ colors: {
283
+ primary: 'hsl(347, 77%, 50%)',
284
+ background: 'hsl(0, 0%, 100%)',
285
+ accent: 'hsl(0, 0%, 97%)'
286
+ }
287
+ }
288
+ },
289
+ violet: {
290
+ name: 'violet',
291
+ label: 'Violet',
292
+ borderRadius: 'large',
293
+ dynamicCSS: true,
294
+ preview: {
295
+ colors: {
296
+ primary: 'hsl(262, 83%, 58%)',
297
+ background: 'hsl(0, 0%, 100%)',
298
+ accent: 'hsl(0, 0%, 97%)'
299
+ }
300
+ }
301
+ },
302
+ zinc: {
303
+ name: 'zinc',
304
+ label: 'Zinc',
305
+ borderRadius: 'medium',
306
+ dynamicCSS: true,
307
+ preview: {
308
+ colors: {
309
+ primary: 'hsl(286.375, 1%, 14%)',
310
+ background: 'hsl(0, 0%, 100%)',
311
+ accent: 'hsl(286.375, 0%, 96%)'
312
+ }
313
+ }
314
+ },
315
+ slate: {
316
+ name: 'slate',
317
+ label: 'Slate',
318
+ borderRadius: 'medium',
319
+ dynamicCSS: true,
320
+ preview: {
321
+ colors: {
322
+ primary: 'hsl(254.624, 1%, 15%)',
323
+ background: 'hsl(0, 0%, 100%)',
324
+ accent: 'hsl(254.624, 0%, 96%)'
325
+ }
326
+ }
327
+ },
328
+ stone: {
329
+ name: 'stone',
330
+ label: 'Stone',
331
+ borderRadius: 'medium',
332
+ dynamicCSS: true,
333
+ preview: {
334
+ colors: {
335
+ primary: 'hsl(56.365, 1%, 14%)',
336
+ background: 'hsl(0, 0%, 100%)',
337
+ accent: 'hsl(60, 0%, 96%)'
338
+ }
339
+ }
340
+ },
341
+ gray: {
342
+ name: 'gray',
343
+ label: 'Gray',
344
+ borderRadius: 'medium',
345
+ dynamicCSS: true,
346
+ preview: {
347
+ colors: {
348
+ primary: 'hsl(0, 0%, 14%)',
349
+ background: 'hsl(0, 0%, 100%)',
350
+ accent: 'hsl(0, 0%, 96%)'
351
+ }
352
+ }
105
353
  }
106
354
  };
107
355
  export const borderRadiusPresets = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/providers/Theme/themeConfig.ts"],"sourcesContent":["import type { ThemeConfig, ThemeDefaults } from './types.js'\n\nexport const themeConfigs: Record<ThemeDefaults, ThemeConfig> = {\n cool: {\n name: 'cool',\n label: 'Cool & Professional',\n borderRadius: 'medium',\n cssFile: '/themes/cool.css',\n preview: {\n colors: {\n primary: 'hsl(221 83% 53%)',\n background: 'hsl(0 0% 100%)',\n accent: 'hsl(210 40% 95%)',\n },\n },\n },\n brutal: {\n name: 'brutal',\n label: 'Modern Brutalism',\n borderRadius: 'none',\n cssFile: '/themes/brutal.css',\n preview: {\n colors: {\n primary: 'hsl(0 0% 0%)',\n background: 'hsl(0 0% 100%)',\n accent: 'hsl(0 72% 51%)',\n },\n },\n },\n neon: {\n name: 'neon',\n label: 'Neon Cyberpunk',\n borderRadius: 'medium',\n cssFile: '/themes/neon.css',\n preview: {\n colors: {\n primary: 'hsl(263 90% 51%)',\n background: 'hsl(230 25% 5%)',\n accent: 'hsl(180 100% 50%)',\n },\n },\n },\n solar: {\n name: 'solar',\n label: 'Solar',\n borderRadius: 'large',\n cssFile: '/themes/solar.css',\n preview: {\n colors: {\n primary: 'hsl(20 90% 45%)',\n background: 'hsl(40 30% 95%)',\n accent: 'hsl(40 100% 50%)',\n },\n },\n },\n dealership: {\n name: 'dealership',\n label: 'Dealership',\n borderRadius: 'medium',\n cssFile: '/themes/dealership.css',\n preview: {\n colors: {\n primary: 'hsl(225 25% 25%)',\n background: 'hsl(0 0% 98%)',\n accent: 'hsl(15 85% 55%)',\n },\n },\n },\n 'real-estate': {\n name: 'real-estate',\n label: 'Real Estate Blue',\n borderRadius: 'large',\n cssFile: '/themes/real-estate.css',\n preview: {\n colors: {\n primary: 'hsl(220 90% 48%)',\n background: 'hsl(220 40% 98.5%)',\n accent: 'hsl(210 85% 55%)',\n },\n },\n },\n 'real-estate-gold': {\n name: 'real-estate-gold',\n label: 'Real Estate Gold',\n borderRadius: 'large',\n cssFile: '/themes/real-estate-gold.css',\n preview: {\n colors: {\n primary: 'hsl(38 75% 45%)',\n background: 'hsl(45 25% 97%)',\n accent: 'hsl(42 85% 55%)',\n },\n },\n },\n 'real-estate-neutral': {\n name: 'real-estate-neutral',\n label: 'Real Estate Neutral',\n borderRadius: 'large',\n cssFile: '/themes/real-estate-neutral.css',\n preview: {\n colors: {\n primary: 'hsl(25 35% 25%)',\n background: 'hsl(30 8% 98%)',\n accent: 'hsl(35 25% 45%)',\n },\n },\n },\n}\n\nexport const borderRadiusPresets = {\n none: {\n label: 'None',\n value: 'none',\n css: {\n '--radius-xs': '0',\n '--radius-small': '0',\n '--radius-default': '0',\n '--radius-medium': '0',\n '--radius-large': '0',\n '--radius-xl': '0',\n },\n },\n small: {\n label: 'Small',\n value: 'small',\n css: {\n '--radius-xs': '0.125rem',\n '--radius-small': '0.25rem',\n '--radius-default': '0.375rem',\n '--radius-medium': '0.5rem',\n '--radius-large': '0.75rem',\n '--radius-xl': '1rem',\n },\n },\n medium: {\n label: 'Medium',\n value: 'medium',\n css: {\n '--radius-xs': '0.25rem',\n '--radius-small': '0.5rem',\n '--radius-default': '0.75rem',\n '--radius-medium': '1rem',\n '--radius-large': '1.5rem',\n '--radius-xl': '2rem',\n },\n },\n large: {\n label: 'Large',\n value: 'large',\n css: {\n '--radius-xs': '0.5rem',\n '--radius-small': '0.75rem',\n '--radius-default': '1rem',\n '--radius-medium': '1.5rem',\n '--radius-large': '2rem',\n '--radius-xl': '2.5rem',\n },\n },\n xl: {\n label: 'Extra Large',\n value: 'xl',\n css: {\n '--radius-xs': '0.75rem',\n '--radius-small': '1rem',\n '--radius-default': '1.5rem',\n '--radius-medium': '2rem',\n '--radius-large': '2.5rem',\n '--radius-xl': '3rem',\n },\n },\n} as const\n\nexport function getThemeConfig(theme: ThemeDefaults): ThemeConfig {\n return themeConfigs[theme]\n}\n\nexport function getBorderRadiusConfig(preset: keyof typeof borderRadiusPresets) {\n return borderRadiusPresets[preset]\n}\n"],"names":["themeConfigs","cool","name","label","borderRadius","cssFile","preview","colors","primary","background","accent","brutal","neon","solar","dealership","borderRadiusPresets","none","value","css","small","medium","large","xl","getThemeConfig","theme","getBorderRadiusConfig","preset"],"mappings":"AAEA,OAAO,MAAMA,eAAmD;IAC9DC,MAAM;QACJC,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,SAAS;QACTC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV;QACF;IACF;IACAC,QAAQ;QACNT,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,SAAS;QACTC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV;QACF;IACF;IACAE,MAAM;QACJV,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,SAAS;QACTC,SAAS;YACPC,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G,OAAO;QACLlB,OAAO;QACPc,OAAO;QACPC,KAAK;YACH,eAAe;YACf,kBAAkB;YAClB,oBAAoB;YACpB,mBAAmB;YACnB,kBAAkB;YAClB,eAAe;QACjB;IACF;IACAI,IAAI;QACFnB,OAAO;QACPc,OAAO;QACPC,KAAK;YACH,eAAe;YACf,kBAAkB;YAClB,oBAAoB;YACpB,mBAAmB;YACnB,kBAAkB;YAClB,eAAe;QACjB;IACF;AACF,EAAU;AAEV,OAAO,SAASK,eAAeC,KAAoB;IACjD,OAAOxB,YAAY,CAACwB,MAAM;AAC5B;AAEA,OAAO,SAASC,sBAAsBC,MAAwC;IAC5E,OAAOX,mBAAmB,CAACW,OAAO;AACpC"}
1
+ {"version":3,"sources":["../../../src/providers/Theme/themeConfig.ts"],"sourcesContent":["import type { ThemeConfig, ThemeDefaults } from './types.js'\n\nexport const themeConfigs: Record<ThemeDefaults, ThemeConfig> = {\n cool: {\n name: 'cool',\n label: 'Cool & Professional',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(221 83% 53%)',\n background: 'hsl(0 0% 100%)',\n accent: 'hsl(210 40% 95%)',\n },\n },\n },\n brutal: {\n name: 'brutal',\n label: 'Modern Brutalism',\n borderRadius: 'none',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(0 0% 0%)',\n background: 'hsl(0 0% 100%)',\n accent: 'hsl(0 72% 51%)',\n },\n },\n },\n neon: {\n name: 'neon',\n label: 'Neon Cyberpunk',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(263 90% 51%)',\n background: 'hsl(230 25% 5%)',\n accent: 'hsl(180 100% 50%)',\n },\n },\n },\n solar: {\n name: 'solar',\n label: 'Solar',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(20 90% 45%)',\n background: 'hsl(40 30% 95%)',\n accent: 'hsl(40 100% 50%)',\n },\n },\n },\n dealership: {\n name: 'dealership',\n label: 'Dealership',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(225 25% 25%)',\n background: 'hsl(0 0% 98%)',\n accent: 'hsl(15 85% 55%)',\n },\n },\n },\n 'real-estate': {\n name: 'real-estate',\n label: 'Real Estate Blue',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(220 90% 48%)',\n background: 'hsl(220 40% 98.5%)',\n accent: 'hsl(210 85% 55%)',\n },\n },\n },\n 'real-estate-gold': {\n name: 'real-estate-gold',\n label: 'Real Estate Gold',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(38 75% 45%)',\n background: 'hsl(45 25% 97%)',\n accent: 'hsl(42 85% 55%)',\n },\n },\n },\n 'real-estate-neutral': {\n name: 'real-estate-neutral',\n label: 'Real Estate Neutral',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(25 35% 25%)',\n background: 'hsl(30 8% 98%)',\n accent: 'hsl(35 25% 45%)',\n },\n },\n },\n // Extended 20 color themes (Dynamic CSS generation)\n cyberpunk: {\n name: 'cyberpunk',\n label: 'Cyberpunk Neon',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(320, 25%, 65%)',\n background: 'hsl(180, 2%, 98%)',\n accent: 'hsl(290, 22%, 75%)',\n },\n },\n },\n minimal: {\n name: 'minimal',\n label: 'Minimal Clean',\n borderRadius: 'none',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(0, 0%, 12%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(0, 0%, 96%)',\n },\n },\n },\n retro: {\n name: 'retro',\n label: 'Retro Vintage',\n borderRadius: 'small',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(35, 18%, 55%)',\n background: 'hsl(80, 3%, 96%)',\n accent: 'hsl(50, 16%, 68%)',\n },\n },\n },\n pastel: {\n name: 'pastel',\n label: 'Pastel Soft',\n borderRadius: 'xl',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(270, 12%, 70%)',\n background: 'hsl(250, 1%, 98%)',\n accent: 'hsl(300, 8%, 85%)',\n },\n },\n },\n ocean: {\n name: 'ocean',\n label: 'Ocean Deep',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(230, 18%, 55%)',\n background: 'hsl(220, 2%, 97%)',\n accent: 'hsl(190, 15%, 68%)',\n },\n },\n },\n forest: {\n name: 'forest',\n label: 'Forest Green',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(145, 16%, 52%)',\n background: 'hsl(145, 2%, 97%)',\n accent: 'hsl(155, 14%, 65%)',\n },\n },\n },\n sunset: {\n name: 'sunset',\n label: 'Sunset Warm',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(35, 20%, 60%)',\n background: 'hsl(50, 3%, 97%)',\n accent: 'hsl(20, 18%, 68%)',\n },\n },\n },\n lavender: {\n name: 'lavender',\n label: 'Lavender Dream',\n borderRadius: 'xl',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(295, 16%, 62%)',\n background: 'hsl(295, 2%, 98%)',\n accent: 'hsl(310, 14%, 72%)',\n },\n },\n },\n neutral: {\n name: 'neutral',\n label: 'Neutral',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(0, 0%, 0%)',\n background: 'hsl(0, 0%, 99%)',\n accent: 'hsl(0, 0%, 94%)',\n },\n },\n },\n blue: {\n name: 'blue',\n label: 'Blue',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(221, 83%, 53%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(0, 0%, 97%)',\n },\n },\n },\n green: {\n name: 'green',\n label: 'Green',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(85, 85%, 35%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(0, 0%, 97%)',\n },\n },\n },\n red: {\n name: 'red',\n label: 'Red',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(0, 72%, 51%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(0, 0%, 97%)',\n },\n },\n },\n orange: {\n name: 'orange',\n label: 'Orange',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(21, 90%, 48%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(0, 0%, 97%)',\n },\n },\n },\n rose: {\n name: 'rose',\n label: 'Rose',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(347, 77%, 50%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(0, 0%, 97%)',\n },\n },\n },\n violet: {\n name: 'violet',\n label: 'Violet',\n borderRadius: 'large',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(262, 83%, 58%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(0, 0%, 97%)',\n },\n },\n },\n zinc: {\n name: 'zinc',\n label: 'Zinc',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(286.375, 1%, 14%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(286.375, 0%, 96%)',\n },\n },\n },\n slate: {\n name: 'slate',\n label: 'Slate',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(254.624, 1%, 15%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(254.624, 0%, 96%)',\n },\n },\n },\n stone: {\n name: 'stone',\n label: 'Stone',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(56.365, 1%, 14%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(60, 0%, 96%)',\n },\n },\n },\n gray: {\n name: 'gray',\n label: 'Gray',\n borderRadius: 'medium',\n dynamicCSS: true,\n preview: {\n colors: {\n primary: 'hsl(0, 0%, 14%)',\n background: 'hsl(0, 0%, 100%)',\n accent: 'hsl(0, 0%, 96%)',\n },\n },\n },\n}\n\nexport const borderRadiusPresets = {\n none: {\n label: 'None',\n value: 'none',\n css: {\n '--radius-xs': '0',\n '--radius-small': '0',\n '--radius-default': '0',\n '--radius-medium': '0',\n '--radius-large': '0',\n '--radius-xl': '0',\n },\n },\n small: {\n label: 'Small',\n value: 'small',\n css: {\n '--radius-xs': '0.125rem',\n '--radius-small': '0.25rem',\n '--radius-default': '0.375rem',\n '--radius-medium': '0.5rem',\n '--radius-large': '0.75rem',\n '--radius-xl': '1rem',\n },\n },\n medium: {\n label: 'Medium',\n value: 'medium',\n css: {\n '--radius-xs': '0.25rem',\n '--radius-small': '0.5rem',\n '--radius-default': '0.75rem',\n '--radius-medium': '1rem',\n '--radius-large': '1.5rem',\n '--radius-xl': '2rem',\n },\n },\n large: {\n label: 'Large',\n value: 'large',\n css: {\n '--radius-xs': '0.5rem',\n '--radius-small': '0.75rem',\n '--radius-default': '1rem',\n '--radius-medium': '1.5rem',\n '--radius-large': '2rem',\n '--radius-xl': '2.5rem',\n },\n },\n xl: {\n label: 'Extra Large',\n value: 'xl',\n css: {\n '--radius-xs': '0.75rem',\n '--radius-small': '1rem',\n '--radius-default': '1.5rem',\n '--radius-medium': '2rem',\n '--radius-large': '2.5rem',\n '--radius-xl': '3rem',\n },\n },\n} as const\n\nexport function getThemeConfig(theme: ThemeDefaults): ThemeConfig {\n return themeConfigs[theme]\n}\n\nexport function getBorderRadiusConfig(preset: keyof typeof borderRadiusPresets) {\n return borderRadiusPresets[preset]\n}\n"],"names":["themeConfigs","cool","name","label","borderRadius","dynamicCSS","preview","colors","primary","background","accent","brutal","neon","solar","dealership","cyberpunk","minimal","retro","pastel","ocean","forest","sunset","lavender","neutral","blue","green","red","orange","rose","violet","zinc","slate","stone","gray","borderRadiusPresets","none","value","css","small","medium","large","xl","getThemeConfig","theme","getBorderRadiusConfig","preset"],"mappings":"AAEA,OAAO,MAAMA,eAAmD;IAC9DC,MAAM;QACJC,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,YAAY;QACZC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV;QACF;IACF;IACAC,QAAQ;QACNT,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,YAAY;QACZC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV;QACF;IACF;IACAE,MAAM;QACJV,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,YAAY;QACZC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV;QACF;IACF;IACAG,OAAO;QACLX,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,YAAY;QACZC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV;QACF;IACF;IACAI,YAAY;QACVZ,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,YAAY;QACZC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV;QACF;IACF;IACA,eAAe;QACbR,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,YAAY;QACZC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV;QACF;IACF;IACA,oBAAoB;QAClBR,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,YAAY;QACZC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV;QACF;IACF;IACA,uBAAuB;QACrBR,MAAM;QACNC,OAAO;QACPC,cAAc;QACdC,YAAY;QACZC,SAAS;YACPC,QAAQ;gBACNC,SAAS;gBACTC,YAAY;gBACZC,QAAQ;YACV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