@delmaredigital/payload-puck 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/dist/AccordionClient.js.map +0 -1
- package/dist/AccordionClient.mjs.map +0 -1
- package/dist/AnimatedWrapper.js.map +0 -1
- package/dist/AnimatedWrapper.mjs.map +0 -1
- package/dist/admin/client.js.map +0 -1
- package/dist/admin/client.mjs.map +0 -1
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/index.mjs.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/api/index.mjs.map +0 -1
- package/dist/components/index.css.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs.map +0 -1
- package/dist/config/config.editor.css.map +0 -1
- package/dist/config/config.editor.js.map +0 -1
- package/dist/config/config.editor.mjs.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/index.mjs.map +0 -1
- package/dist/editor/index.js.map +0 -1
- package/dist/editor/index.mjs.map +0 -1
- package/dist/fields/index.css.map +0 -1
- package/dist/fields/index.js.map +0 -1
- package/dist/fields/index.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/layouts/index.js.map +0 -1
- package/dist/layouts/index.mjs.map +0 -1
- package/dist/plugin/index.js.map +0 -1
- package/dist/plugin/index.mjs.map +0 -1
- package/dist/render/index.js.map +0 -1
- package/dist/render/index.mjs.map +0 -1
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/index.mjs.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layouts/defaults.ts","../../src/layouts/utils.ts","../../src/fields/shared.ts","../../src/components/layout/Container.server.tsx","../../src/components/layout/Flex.server.tsx","../../src/components/layout/Grid.server.tsx","../../src/components/layout/Section.server.tsx","../../src/components/layout/Spacer.server.tsx","../../src/components/layout/Template.server.tsx","../../src/components/typography/Heading.server.tsx","../../src/components/typography/Text.server.tsx","../../src/components/typography/RichText.server.tsx","../../src/components/media/Image.server.tsx","../../src/lib/utils.ts","../../src/components/ui/button.tsx","../../src/components/ui/input.tsx","../../src/components/ui/label.tsx","../../src/fields/SizeField.tsx","../../src/theme/defaults.ts","../../src/theme/utils.ts","../../src/components/interactive/Button.server.tsx","../../src/components/interactive/Card.server.tsx","../../src/components/interactive/Divider.server.tsx","../../src/components/interactive/Accordion.server.tsx","../../src/config/merge.ts","../../src/config/index.tsx"],"names":["jsxs","jsx","idCounter","generateUniqueId","defaultProps","AnimatedWrapper","Fragment","cn","React2","cva","React3"],"mappings":";;;;;;;;;;;;;AAYO,IAAM,aAAA,GAAkC;AAAA,EAC7C,KAAA,EAAO,SAAA;AAAA,EACP,KAAA,EAAO,SAAA;AAAA,EACP,WAAA,EAAa,mDAAA;AAAA,EACb,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,EAAA;AAAA,IACT,SAAA,EAAW,8BAAA;AAAA,IACX,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU,QAAA;AAAA,EACV,SAAA,EAAW;AACb,CAAA;AAKO,IAAM,aAAA,GAAkC;AAAA,EAC7C,KAAA,EAAO,SAAA;AAAA,EACP,KAAA,EAAO,SAAA;AAAA,EACP,WAAA,EAAa,0DAAA;AAAA,EACb,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,EAAA;AAAA,IACT,SAAA,EAAW,EAAA;AAAA,IACX,OAAA,EAAS;AAAA,GACX;AAAA,EACA,SAAA,EAAW;AACb,CAAA;AAKO,IAAM,eAAA,GAAoC;AAAA,EAC/C,KAAA,EAAO,YAAA;AAAA,EACP,KAAA,EAAO,YAAA;AAAA,EACP,WAAA,EAAa,uCAAA;AAAA,EACb,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,QAAA;AAAA,IACT,SAAA,EAAW,QAAA;AAAA,IACX,OAAA,EAAS;AAAA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W,WAAW;AAAA;AACvD,KACF;AAAA,IACA,UAAA,EAAY;AAAA;AAAA,MAEV,SAAA,EAAW,eAAA;AAAA,MACX,IAAA,EAAM,UAAA;AAAA,MACN,IAAA,EAAM,UAAA;AAAA,MACN,OAAA,EAAS,aAAA;AAAA,MACT,MAAA,EAAQ,YAAA;AAAA,MACR,QAAA,EAAU,oBAAA;AAAA;AAAA,MAEV,OAAA,EAAS,aAAA;AAAA,MACT,IAAA,EAAM,UAAA;AAAA,MACN,QAAA,EAAU,cAAA;AAAA;AAAA,MAEV,KAAA,EAAO,WAAA;AAAA;AAAA,MAEP,MAAA,EAAQ,YAAA;AAAA,MACR,IAAA,EAAM,UAAA;AAAA,MACN,OAAA,EAAS,aAAA;AAAA,MACT,SAAA,EAAW;AAAA;AACb,GACF;AACF;AAWO,IAAM,UAAA,GAAa,aAAa,eAAe","file":"index.mjs","sourcesContent":["/**\n * Default Layout Definitions\n *\n * These provide sensible defaults for common page layout patterns.\n * Users can override or extend these in their own configuration.\n */\n\nimport type { LayoutDefinition, LayoutConfig } from './types'\n\n/**\n * Default layout - standard content width with padding\n */\nexport const defaultLayout: LayoutDefinition = {\n value: 'default',\n label: 'Default',\n description: 'Standard page layout with contained content width',\n classes: {\n wrapper: '',\n container: 'mx-auto px-4 sm:px-6 lg:px-8',\n content: '',\n },\n maxWidth: '1200px',\n fullWidth: false,\n}\n\n/**\n * Landing layout - optimized for marketing/landing pages\n */\nexport const landingLayout: LayoutDefinition = {\n value: 'landing',\n label: 'Landing',\n description: 'Full-width sections with no global container constraints',\n classes: {\n wrapper: '',\n container: '',\n content: '',\n },\n fullWidth: true,\n}\n\n/**\n * Full width layout - edge-to-edge content\n */\nexport const fullWidthLayout: LayoutDefinition = {\n value: 'full-width',\n label: 'Full Width',\n description: 'Content spans the full viewport width',\n classes: {\n wrapper: 'w-full',\n container: 'w-full',\n content: '',\n },\n maxWidth: '100%',\n fullWidth: true,\n}\n\n/**\n * Narrow layout - ideal for blog posts and articles\n */\nexport const narrowLayout: LayoutDefinition = {\n value: 'narrow',\n label: 'Narrow',\n description: 'Narrow content width for optimal reading experience',\n classes: {\n wrapper: '',\n container: 'mx-auto px-4 sm:px-6',\n content: '',\n },\n maxWidth: '768px',\n fullWidth: false,\n}\n\n/**\n * Wide layout - extra wide content area\n */\nexport const wideLayout: LayoutDefinition = {\n value: 'wide',\n label: 'Wide',\n description: 'Wider content area for dashboards or galleries',\n classes: {\n wrapper: '',\n container: 'mx-auto px-4 sm:px-6 lg:px-8',\n content: '',\n },\n maxWidth: '1440px',\n fullWidth: false,\n}\n\n/**\n * Default layouts included with the plugin\n */\nexport const DEFAULT_LAYOUTS: LayoutDefinition[] = [\n defaultLayout,\n landingLayout,\n fullWidthLayout,\n]\n\n/**\n * Extended layouts for users who want more options\n */\nexport const EXTENDED_LAYOUTS: LayoutDefinition[] = [\n defaultLayout,\n landingLayout,\n fullWidthLayout,\n narrowLayout,\n wideLayout,\n]\n\n/**\n * Default layout configuration\n */\nexport const DEFAULT_LAYOUT_CONFIG: LayoutConfig = {\n layouts: DEFAULT_LAYOUTS,\n defaultLayout: 'default',\n}\n","/**\n * Layout Utilities\n *\n * Functions for working with layout configurations.\n */\n\nimport type { LayoutDefinition, LayoutConfig, LayoutOption } from './types'\nimport { DEFAULT_LAYOUTS, DEFAULT_LAYOUT_CONFIG } from './defaults'\n\n/**\n * Resolves a layout config, merging with defaults if needed\n */\nexport function resolveLayoutConfig(config?: Partial<LayoutConfig>): LayoutConfig {\n if (!config) return DEFAULT_LAYOUT_CONFIG\n\n return {\n layouts: config.layouts ?? DEFAULT_LAYOUTS,\n defaultLayout: config.defaultLayout ?? 'default',\n }\n}\n\n/**\n * Gets a layout definition by value\n */\nexport function getLayout(\n layouts: LayoutDefinition[],\n value: string,\n fallback = 'default'\n): LayoutDefinition | undefined {\n const layout = layouts.find((l) => l.value === value)\n if (layout) return layout\n\n // Try fallback\n if (value !== fallback) {\n return layouts.find((l) => l.value === fallback)\n }\n\n // Return first layout if nothing matches\n return layouts[0]\n}\n\n/**\n * Converts layout definitions to Puck select options\n */\nexport function layoutsToOptions(layouts: LayoutDefinition[]): LayoutOption[] {\n return layouts.map(({ value, label, description }) => ({\n value,\n label,\n description,\n }))\n}\n\n/**\n * Converts layout definitions to Payload select options\n */\nexport function layoutsToPayloadOptions(\n layouts: LayoutDefinition[]\n): Array<{ label: string; value: string }> {\n return layouts.map(({ value, label }) => ({\n label,\n value,\n }))\n}\n\n/**\n * Creates a custom layout definition\n */\nexport function createLayout(\n config: Omit<LayoutDefinition, 'value' | 'label'> & {\n value: string\n label: string\n }\n): LayoutDefinition {\n return {\n ...config,\n }\n}\n\n/**\n * Merges layout configurations\n */\nexport function mergeLayouts(\n base: LayoutDefinition[],\n custom: LayoutDefinition[],\n options?: {\n /** Replace base layouts instead of merging */\n replace?: boolean\n /** Exclude these layout values from base */\n exclude?: string[]\n }\n): LayoutDefinition[] {\n if (options?.replace) {\n return custom\n }\n\n let result = [...base]\n\n // Exclude specified layouts\n if (options?.exclude) {\n result = result.filter((l) => !options.exclude!.includes(l.value))\n }\n\n // Merge/override with custom layouts\n for (const customLayout of custom) {\n const existingIndex = result.findIndex((l) => l.value === customLayout.value)\n if (existingIndex >= 0) {\n result[existingIndex] = customLayout\n } else {\n result.push(customLayout)\n }\n }\n\n return result\n}\n","/**\n * Shared Puck Field Definitions\n *\n * Reusable field configurations and CSS utility maps for Puck components.\n * These ensure consistency across all components.\n */\n\nimport type { Field } from '@measured/puck'\nimport type React from 'react'\n\n// =============================================================================\n// Utility Functions\n// =============================================================================\n\n/**\n * Combines class names, filtering out falsy values\n * A simple alternative to clsx/classnames for bundling purposes\n */\nexport function cn(...classes: (string | boolean | undefined | null)[]): string {\n return classes.filter(Boolean).join(' ')\n}\n\n// =============================================================================\n// Custom Style Types\n// =============================================================================\n\nexport interface ColorValue {\n hex: string\n opacity?: number\n}\n\nexport interface PaddingValue {\n top: number\n right: number\n bottom: number\n left: number\n unit: 'px' | 'rem' | 'em' | '%'\n /** Whether all sides are linked (sync together). Defaults to true if not set. */\n linked?: boolean\n}\n\nexport interface BorderValue {\n style: 'none' | 'solid' | 'dashed' | 'dotted'\n width: number\n color: ColorValue | null\n radius: number\n sides: {\n top: boolean\n right: boolean\n bottom: boolean\n left: boolean\n }\n}\n\nexport interface WidthValue {\n mode: 'full' | 'contained' | 'custom'\n maxWidth: number\n unit: 'px' | 'rem' | '%' | 'vw'\n alignment: 'left' | 'center' | 'right'\n}\n\n// =============================================================================\n// Dimensions Types (Enhanced Width + Height)\n// =============================================================================\n\nexport type DimensionsUnit = 'px' | 'rem' | '%' | 'vw' | 'vh'\nexport type DimensionsMode = 'full' | 'contained' | 'custom'\nexport type ContentAlignment = 'left' | 'center' | 'right'\n\n/**\n * Represents a single dimension constraint (min or max for width or height)\n */\nexport interface DimensionConstraint {\n value: number\n unit: DimensionsUnit\n enabled: boolean\n}\n\n/**\n * Full dimensions configuration value - replaces/extends WidthValue\n * Supports min/max constraints for both width and height\n */\nexport interface DimensionsValue {\n /** Width mode: full (100%), contained (centered max-width), or custom */\n mode: DimensionsMode\n /** Content alignment within the container */\n alignment: ContentAlignment\n /** Minimum width constraint (optional) */\n minWidth?: DimensionConstraint | null\n /** Maximum width constraint (required for backward compat) */\n maxWidth: DimensionConstraint\n /** Minimum height constraint (optional) */\n minHeight?: DimensionConstraint | null\n /** Maximum height constraint (optional) */\n maxHeight?: DimensionConstraint | null\n /** UI state: whether advanced mode is expanded */\n advancedMode?: boolean\n}\n\n/**\n * Type guard to detect legacy WidthValue format\n */\nexport function isLegacyWidthValue(value: unknown): value is WidthValue {\n if (!value || typeof value !== 'object') return false\n const v = value as Record<string, unknown>\n return (\n typeof v.maxWidth === 'number' &&\n typeof v.unit === 'string' &&\n typeof v.mode === 'string' &&\n !('minWidth' in v) &&\n !('minHeight' in v) &&\n !('maxHeight' in v)\n )\n}\n\n/**\n * Migrate legacy WidthValue to new DimensionsValue format\n */\nexport function migrateWidthValue(legacy: WidthValue): DimensionsValue {\n return {\n mode: legacy.mode,\n alignment: legacy.alignment,\n maxWidth: {\n value: legacy.maxWidth,\n unit: legacy.unit,\n enabled: true,\n },\n advancedMode: false,\n }\n}\n\n// =============================================================================\n// Background Types\n// =============================================================================\n\nexport interface GradientStop {\n color: ColorValue\n position: number // 0-100%\n}\n\nexport interface GradientValue {\n type: 'linear' | 'radial'\n angle: number // 0-360 for linear\n stops: GradientStop[]\n radialShape?: 'circle' | 'ellipse'\n radialPosition?: 'center' | 'top' | 'bottom' | 'left' | 'right'\n}\n\n/**\n * Gradient mask for fading images to transparent\n */\nexport interface GradientMask {\n enabled: boolean\n direction:\n | 'to-top'\n | 'to-bottom'\n | 'to-left'\n | 'to-right'\n | 'to-top-left'\n | 'to-top-right'\n | 'to-bottom-left'\n | 'to-bottom-right'\n | 'from-center' // Radial gradient from center outward\n startOpacity: number // 0-100, typically 100 (fully visible)\n endOpacity: number // 0-100, typically 0 (fully transparent)\n startPosition: number // 0-100%, where fade begins\n endPosition: number // 0-100%, where fade ends\n}\n\nexport interface BackgroundImageValue {\n media: import('./MediaField').MediaReference | null\n size: 'cover' | 'contain' | 'auto'\n position:\n | 'center'\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right'\n repeat: 'no-repeat' | 'repeat' | 'repeat-x' | 'repeat-y'\n attachment: 'scroll' | 'fixed'\n /** Overall image opacity 0-100 (default 100) */\n opacity?: number\n /** Gradient mask for fade to transparent effect */\n mask?: GradientMask\n}\n\n/**\n * Overlay layer for images (Divi-style)\n * Renders a color or gradient on top of the background image\n */\nexport interface BackgroundOverlay {\n enabled: boolean\n type: 'solid' | 'gradient'\n solid?: ColorValue | null\n gradient?: GradientValue | null\n}\n\nexport interface BackgroundValue {\n type: 'none' | 'solid' | 'gradient' | 'image'\n solid?: ColorValue | null\n gradient?: GradientValue | null\n image?: BackgroundImageValue | null\n /** Overlay layer, only used when type === 'image' */\n overlay?: BackgroundOverlay | null\n}\n\n// =============================================================================\n// Visibility Field\n// =============================================================================\n\nexport const visibilityField: Field = {\n type: 'select',\n label: 'Visibility',\n options: [\n { label: 'Always Visible', value: 'always' },\n { label: 'Authenticated Users Only', value: 'authenticatedOnly' },\n { label: 'Guests Only', value: 'guestOnly' },\n ],\n}\n\n// =============================================================================\n// Button Style Field\n// =============================================================================\n\nexport const buttonStyleField: Field = {\n type: 'select',\n label: 'Button Style',\n options: [\n { label: 'Primary', value: 'primary' },\n { label: 'Secondary', value: 'secondary' },\n { label: 'Outline', value: 'outline' },\n { label: 'Ghost', value: 'ghost' },\n { label: 'Link', value: 'link' },\n ],\n}\n\n// =============================================================================\n// Button Variant Field\n// =============================================================================\n\nexport const buttonVariantField: Field = {\n type: 'select',\n label: 'Button Variant',\n options: [\n { label: 'Default', value: 'default' },\n { label: 'Destructive', value: 'destructive' },\n { label: 'Outline', value: 'outline' },\n { label: 'Secondary', value: 'secondary' },\n { label: 'Ghost', value: 'ghost' },\n { label: 'Link', value: 'link' },\n ],\n}\n\n// =============================================================================\n// Button Size Field\n// =============================================================================\n\nexport const buttonSizeField: Field = {\n type: 'select',\n label: 'Size',\n options: [\n { label: 'Small', value: 'sm' },\n { label: 'Default', value: 'default' },\n { label: 'Large', value: 'lg' },\n { label: 'Icon', value: 'icon' },\n ],\n}\n\n// =============================================================================\n// Background Color Field (Preset Palette)\n// =============================================================================\n\nexport const backgroundColorField: Field = {\n type: 'select',\n label: 'Background Color',\n options: [\n { label: 'None', value: 'none' },\n { label: 'Background', value: 'background' },\n { label: 'Card', value: 'card' },\n { label: 'Muted', value: 'muted' },\n { label: 'Primary', value: 'primary' },\n { label: 'Secondary', value: 'secondary' },\n { label: 'Accent', value: 'accent' },\n ],\n}\n\n// =============================================================================\n// Text Color Field (Preset Palette)\n// =============================================================================\n\nexport const textColorField: Field = {\n type: 'select',\n label: 'Text Color',\n options: [\n { label: 'Theme (Auto)', value: 'default' },\n { label: 'Foreground', value: 'foreground' },\n { label: 'Muted', value: 'muted-foreground' },\n { label: 'Primary', value: 'primary' },\n { label: 'Secondary', value: 'secondary-foreground' },\n ],\n}\n\n// =============================================================================\n// Gap/Spacing Field\n// =============================================================================\n\nexport const gapField: Field = {\n type: 'select',\n label: 'Gap',\n options: [\n { label: 'None', value: 'none' },\n { label: 'Extra Small', value: 'xs' },\n { label: 'Small', value: 'sm' },\n { label: 'Medium', value: 'md' },\n { label: 'Large', value: 'lg' },\n { label: 'Extra Large', value: 'xl' },\n { label: '2XL', value: '2xl' },\n ],\n}\n\n// =============================================================================\n// Shadow Field\n// =============================================================================\n\nexport const shadowField: Field = {\n type: 'select',\n label: 'Shadow',\n options: [\n { label: 'None', value: 'none' },\n { label: 'Small', value: 'sm' },\n { label: 'Medium', value: 'md' },\n { label: 'Large', value: 'lg' },\n { label: 'Extra Large', value: 'xl' },\n { label: '2XL', value: '2xl' },\n ],\n}\n\n// =============================================================================\n// Spacer Height Field\n// =============================================================================\n\nexport const spacerHeightField: Field = {\n type: 'select',\n label: 'Height',\n options: [\n { label: 'Extra Small (8px)', value: 'xs' },\n { label: 'Small (16px)', value: 'sm' },\n { label: 'Medium (32px)', value: 'md' },\n { label: 'Large (48px)', value: 'lg' },\n { label: 'Extra Large (64px)', value: 'xl' },\n { label: '2XL (96px)', value: '2xl' },\n { label: '3XL (128px)', value: '3xl' },\n ],\n}\n\n// =============================================================================\n// Heading Level Field\n// =============================================================================\n\nexport const headingLevelField: Field = {\n type: 'select',\n label: 'Heading Level',\n options: [\n { label: 'H1', value: 'h1' },\n { label: 'H2', value: 'h2' },\n { label: 'H3', value: 'h3' },\n { label: 'H4', value: 'h4' },\n { label: 'H5', value: 'h5' },\n { label: 'H6', value: 'h6' },\n ],\n}\n\n// =============================================================================\n// Text Size Field\n// =============================================================================\n\nexport const textSizeField: Field = {\n type: 'select',\n label: 'Text Size',\n options: [\n { label: 'Extra Small', value: 'xs' },\n { label: 'Small', value: 'sm' },\n { label: 'Base', value: 'base' },\n { label: 'Large', value: 'lg' },\n { label: 'Extra Large', value: 'xl' },\n { label: '2XL', value: '2xl' },\n ],\n}\n\n// =============================================================================\n// Aspect Ratio Field\n// =============================================================================\n\nexport const aspectRatioField: Field = {\n type: 'select',\n label: 'Aspect Ratio',\n options: [\n { label: 'Auto', value: 'auto' },\n { label: 'Square (1:1)', value: 'square' },\n { label: 'Video (16:9)', value: 'video' },\n { label: 'Portrait (3:4)', value: 'portrait' },\n { label: 'Landscape (4:3)', value: 'landscape' },\n { label: 'Wide (21:9)', value: 'wide' },\n ],\n}\n\n// =============================================================================\n// Divider Style Field\n// =============================================================================\n\nexport const dividerStyleField: Field = {\n type: 'select',\n label: 'Style',\n options: [\n { label: 'Solid', value: 'solid' },\n { label: 'Dashed', value: 'dashed' },\n { label: 'Dotted', value: 'dotted' },\n ],\n}\n\n// =============================================================================\n// Border Radius Field\n// =============================================================================\n\nexport const borderRadiusField: Field = {\n type: 'select',\n label: 'Border Radius',\n options: [\n { label: 'None', value: 'none' },\n { label: 'Small', value: 'sm' },\n { label: 'Medium', value: 'md' },\n { label: 'Large', value: 'lg' },\n { label: 'Extra Large', value: 'xl' },\n { label: '2XL', value: '2xl' },\n { label: 'Full', value: 'full' },\n ],\n}\n\n// =============================================================================\n// Columns Count Field\n// =============================================================================\n\nexport const columnsCountField: Field = {\n type: 'select',\n label: 'Columns',\n options: [\n { label: '1 Column', value: '1' },\n { label: '2 Columns', value: '2' },\n { label: '3 Columns', value: '3' },\n { label: '4 Columns', value: '4' },\n { label: '5 Columns', value: '5' },\n { label: '6 Columns', value: '6' },\n ],\n}\n\n// =============================================================================\n// Flex Direction Field\n// =============================================================================\n\nexport const flexDirectionField: Field = {\n type: 'select',\n label: 'Direction',\n options: [\n { label: 'Row (Horizontal)', value: 'row' },\n { label: 'Column (Vertical)', value: 'column' },\n { label: 'Row Reverse', value: 'row-reverse' },\n { label: 'Column Reverse', value: 'column-reverse' },\n ],\n}\n\n// =============================================================================\n// Flex Wrap Field\n// =============================================================================\n\nexport const flexWrapField: Field = {\n type: 'select',\n label: 'Wrap',\n options: [\n { label: 'No Wrap', value: 'nowrap' },\n { label: 'Wrap', value: 'wrap' },\n { label: 'Wrap Reverse', value: 'wrap-reverse' },\n ],\n}\n\n// =============================================================================\n// CSS Class Mappings\n// =============================================================================\n\n/**\n * Maps alignment values to Tailwind classes\n */\nexport const alignmentMap: Record<string, string> = {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n}\n\n/**\n * Maps background color values to Tailwind classes\n */\nexport const bgColorMap: Record<string, string> = {\n none: '',\n background: 'bg-background',\n card: 'bg-card',\n muted: 'bg-muted',\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n accent: 'bg-accent',\n}\n\n/**\n * Maps text color values to Tailwind classes\n */\nexport const textColorMap: Record<string, string> = {\n default: 'text-inherit',\n foreground: 'text-foreground',\n 'muted-foreground': 'text-muted-foreground',\n primary: 'text-primary',\n 'secondary-foreground': 'text-secondary-foreground',\n}\n\n/**\n * Maps gap values to Tailwind classes\n */\nexport const gapMap: Record<string, string> = {\n none: 'gap-0',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n '2xl': 'gap-12',\n}\n\n/**\n * Maps shadow values to Tailwind classes\n */\nexport const shadowMap: Record<string, string> = {\n none: '',\n sm: 'shadow-sm',\n md: 'shadow-md',\n lg: 'shadow-lg',\n xl: 'shadow-xl',\n '2xl': 'shadow-2xl',\n}\n\n/**\n * Maps spacer height values to Tailwind classes\n */\nexport const spacerHeightMap: Record<string, string> = {\n xs: 'h-2',\n sm: 'h-4',\n md: 'h-8',\n lg: 'h-12',\n xl: 'h-16',\n '2xl': 'h-24',\n '3xl': 'h-32',\n}\n\n/**\n * Maps heading level to Tailwind classes\n */\nexport const headingLevelMap: Record<string, string> = {\n h1: 'text-4xl md:text-5xl lg:text-6xl font-bold tracking-tight',\n h2: 'text-3xl md:text-4xl font-bold tracking-tight',\n h3: 'text-2xl md:text-3xl font-semibold',\n h4: 'text-xl md:text-2xl font-semibold',\n h5: 'text-lg md:text-xl font-medium',\n h6: 'text-base md:text-lg font-medium',\n}\n\n/**\n * Maps text size to Tailwind classes\n */\nexport const textSizeMap: Record<string, string> = {\n xs: 'text-xs',\n sm: 'text-sm',\n base: 'text-base',\n lg: 'text-lg',\n xl: 'text-xl',\n '2xl': 'text-2xl',\n}\n\n/**\n * Maps aspect ratio to Tailwind classes\n */\nexport const aspectRatioMap: Record<string, string> = {\n auto: '',\n square: 'aspect-square',\n video: 'aspect-video',\n portrait: 'aspect-[3/4]',\n landscape: 'aspect-[4/3]',\n wide: 'aspect-[21/9]',\n}\n\n/**\n * Maps divider style to Tailwind classes\n */\nexport const dividerStyleMap: Record<string, string> = {\n solid: 'border-solid',\n dashed: 'border-dashed',\n dotted: 'border-dotted',\n}\n\n/**\n * Maps border radius to Tailwind classes\n */\nexport const borderRadiusMap: Record<string, string> = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n full: 'rounded-full',\n}\n\n/**\n * Maps columns count to Tailwind grid classes (responsive)\n */\nexport const columnsCountMap: Record<string, string> = {\n '1': 'grid-cols-1',\n '2': 'grid-cols-1 md:grid-cols-2',\n '3': 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',\n '4': 'grid-cols-1 md:grid-cols-2 lg:grid-cols-4',\n '5': 'grid-cols-2 md:grid-cols-3 lg:grid-cols-5',\n '6': 'grid-cols-2 md:grid-cols-3 lg:grid-cols-6',\n}\n\n/**\n * Maps flex direction to Tailwind classes\n */\nexport const flexDirectionMap: Record<string, string> = {\n row: 'flex-row',\n column: 'flex-col',\n 'row-reverse': 'flex-row-reverse',\n 'column-reverse': 'flex-col-reverse',\n}\n\n/**\n * Maps justify content to Tailwind classes\n * Supports both short (start) and full (flex-start) values\n */\nexport const justifyContentMap: Record<string, string> = {\n start: 'justify-start',\n 'flex-start': 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n 'flex-end': 'justify-end',\n between: 'justify-between',\n 'space-between': 'justify-between',\n around: 'justify-around',\n 'space-around': 'justify-around',\n evenly: 'justify-evenly',\n 'space-evenly': 'justify-evenly',\n}\n\n/**\n * Maps align items to Tailwind classes\n * Supports both short (start) and full (flex-start) values\n */\nexport const alignItemsMap: Record<string, string> = {\n start: 'items-start',\n 'flex-start': 'items-start',\n center: 'items-center',\n end: 'items-end',\n 'flex-end': 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\n}\n\n/**\n * Maps self-alignment to Tailwind classes (for grid/flex item alignment)\n * Used by components like TextImageSplit for vertical self-alignment\n */\nexport const selfAlignmentMap: Record<string, string> = {\n start: 'self-start',\n 'flex-start': 'self-start',\n center: 'self-center',\n end: 'self-end',\n 'flex-end': 'self-end',\n stretch: 'self-stretch',\n auto: 'self-auto',\n}\n\n/**\n * Maps flex wrap to Tailwind classes\n */\nexport const flexWrapMap: Record<string, string> = {\n nowrap: 'flex-nowrap',\n wrap: 'flex-wrap',\n 'wrap-reverse': 'flex-wrap-reverse',\n}\n\n// =============================================================================\n// Custom Style Value Utilities\n// =============================================================================\n\n/**\n * Convert hex color to RGB components\n */\nfunction hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const clean = hex.replace(/^#/, '')\n if (clean.length !== 6) return null\n\n const r = parseInt(clean.substring(0, 2), 16)\n const g = parseInt(clean.substring(2, 4), 16)\n const b = parseInt(clean.substring(4, 6), 16)\n\n if (isNaN(r) || isNaN(g) || isNaN(b)) return null\n\n return { r, g, b }\n}\n\n/**\n * Convert ColorValue to CSS rgba string\n */\nexport function colorValueToCSS(color: ColorValue | null | undefined): string | undefined {\n if (!color?.hex) return undefined\n\n const rgb = hexToRgb(color.hex)\n if (!rgb) return color.hex\n\n const opacity = (color.opacity ?? 100) / 100\n\n if (opacity === 1) {\n return color.hex\n }\n\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`\n}\n\n/**\n * Convert PaddingValue to CSS padding string\n */\nexport function paddingValueToCSS(padding: PaddingValue | null | undefined): string | undefined {\n if (!padding) return undefined\n\n const { top, right, bottom, left, unit } = padding\n\n if (top === right && right === bottom && bottom === left) {\n return `${top}${unit}`\n }\n\n if (top === bottom && left === right) {\n return `${top}${unit} ${right}${unit}`\n }\n\n if (left === right) {\n return `${top}${unit} ${right}${unit} ${bottom}${unit}`\n }\n\n return `${top}${unit} ${right}${unit} ${bottom}${unit} ${left}${unit}`\n}\n\n/**\n * Convert PaddingValue to CSS margin string (same structure, different property)\n */\nexport function marginValueToCSS(margin: PaddingValue | null | undefined): string | undefined {\n if (!margin) return undefined\n\n const { top, right, bottom, left, unit } = margin\n\n if (top === right && right === bottom && bottom === left) {\n return `${top}${unit}`\n }\n\n if (top === bottom && left === right) {\n return `${top}${unit} ${right}${unit}`\n }\n\n if (left === right) {\n return `${top}${unit} ${right}${unit} ${bottom}${unit}`\n }\n\n return `${top}${unit} ${right}${unit} ${bottom}${unit} ${left}${unit}`\n}\n\n/**\n * Convert BorderValue to CSS properties object\n */\nexport function borderValueToCSS(border: BorderValue | null | undefined): React.CSSProperties | undefined {\n if (!border || border.style === 'none') return undefined\n\n const color = colorValueToCSS(border.color) || '#000000'\n const style: React.CSSProperties = {}\n\n if (border.sides.top) {\n style.borderTopWidth = `${border.width}px`\n style.borderTopStyle = border.style\n style.borderTopColor = color\n }\n\n if (border.sides.right) {\n style.borderRightWidth = `${border.width}px`\n style.borderRightStyle = border.style\n style.borderRightColor = color\n }\n\n if (border.sides.bottom) {\n style.borderBottomWidth = `${border.width}px`\n style.borderBottomStyle = border.style\n style.borderBottomColor = color\n }\n\n if (border.sides.left) {\n style.borderLeftWidth = `${border.width}px`\n style.borderLeftStyle = border.style\n style.borderLeftColor = color\n }\n\n if (border.radius > 0) {\n style.borderRadius = `${border.radius}px`\n }\n\n return Object.keys(style).length > 0 ? style : undefined\n}\n\n/**\n * Convert WidthValue to CSS properties object\n */\nexport function widthValueToCSS(width: WidthValue | null | undefined): React.CSSProperties | undefined {\n if (!width) return undefined\n\n const style: React.CSSProperties = {}\n\n if (width.mode === 'full') {\n style.width = '100%'\n style.maxWidth = '100%'\n } else {\n style.maxWidth = `${width.maxWidth}${width.unit}`\n style.width = '100%'\n }\n\n switch (width.alignment) {\n case 'left':\n style.marginLeft = '0'\n style.marginRight = 'auto'\n break\n case 'center':\n style.marginLeft = 'auto'\n style.marginRight = 'auto'\n break\n case 'right':\n style.marginLeft = 'auto'\n style.marginRight = '0'\n break\n }\n\n return style\n}\n\n/**\n * Convert DimensionsValue to CSS properties object\n * Handles both legacy WidthValue and new DimensionsValue formats\n */\nexport function dimensionsValueToCSS(\n dimensions: DimensionsValue | WidthValue | null | undefined\n): React.CSSProperties | undefined {\n if (!dimensions) return undefined\n\n // Handle legacy WidthValue format\n if (isLegacyWidthValue(dimensions)) {\n return widthValueToCSS(dimensions)\n }\n\n const dim = dimensions as DimensionsValue\n const style: React.CSSProperties = {}\n\n // Width handling based on mode\n if (dim.mode === 'full') {\n style.width = '100%'\n style.maxWidth = '100%'\n } else {\n style.width = '100%'\n\n // Max Width (required)\n if (dim.maxWidth?.enabled !== false && dim.maxWidth?.value > 0) {\n style.maxWidth = `${dim.maxWidth.value}${dim.maxWidth.unit}`\n }\n\n // Min Width (optional)\n if (dim.minWidth?.enabled && dim.minWidth.value > 0) {\n style.minWidth = `${dim.minWidth.value}${dim.minWidth.unit}`\n }\n }\n\n // Height handling (applies to all modes)\n if (dim.minHeight?.enabled && dim.minHeight.value > 0) {\n style.minHeight = `${dim.minHeight.value}${dim.minHeight.unit}`\n }\n\n if (dim.maxHeight?.enabled && dim.maxHeight.value > 0) {\n style.maxHeight = `${dim.maxHeight.value}${dim.maxHeight.unit}`\n }\n\n // Alignment (via margin)\n switch (dim.alignment) {\n case 'left':\n style.marginLeft = '0'\n style.marginRight = 'auto'\n break\n case 'center':\n style.marginLeft = 'auto'\n style.marginRight = 'auto'\n break\n case 'right':\n style.marginLeft = 'auto'\n style.marginRight = '0'\n break\n }\n\n return style\n}\n\n/**\n * Get human-readable summary of dimensions\n */\nexport function getDimensionsSummary(dim: DimensionsValue | null | undefined): string {\n if (!dim) return 'auto'\n\n if (dim.mode === 'full') return '100%'\n\n const parts: string[] = []\n\n if (dim.maxWidth?.enabled && dim.maxWidth.value > 0) {\n parts.push(`max: ${dim.maxWidth.value}${dim.maxWidth.unit}`)\n }\n\n if (dim.minWidth?.enabled && dim.minWidth.value > 0) {\n parts.push(`min: ${dim.minWidth.value}${dim.minWidth.unit}`)\n }\n\n if (dim.maxHeight?.enabled && dim.maxHeight.value > 0) {\n parts.push(`h-max: ${dim.maxHeight.value}${dim.maxHeight.unit}`)\n }\n\n if (dim.minHeight?.enabled && dim.minHeight.value > 0) {\n parts.push(`h-min: ${dim.minHeight.value}${dim.minHeight.unit}`)\n }\n\n return parts.length > 0 ? parts.join(' | ') : 'auto'\n}\n\n/**\n * Combined style generator for layout components\n */\nexport function getCustomStyleObject(options: {\n backgroundColor?: ColorValue | null\n textColor?: ColorValue | null\n padding?: PaddingValue | null\n margin?: PaddingValue | null\n border?: BorderValue | null\n width?: WidthValue | null\n}): React.CSSProperties {\n const style: React.CSSProperties = {}\n\n const bgColor = colorValueToCSS(options.backgroundColor)\n if (bgColor) {\n style.backgroundColor = bgColor\n }\n\n const txtColor = colorValueToCSS(options.textColor)\n if (txtColor) {\n style.color = txtColor\n }\n\n const paddingCSS = paddingValueToCSS(options.padding)\n if (paddingCSS) {\n style.padding = paddingCSS\n }\n\n const marginCSS = marginValueToCSS(options.margin)\n if (marginCSS) {\n style.margin = marginCSS\n }\n\n const borderCSS = borderValueToCSS(options.border)\n if (borderCSS) {\n Object.assign(style, borderCSS)\n }\n\n const widthCSS = widthValueToCSS(options.width)\n if (widthCSS) {\n Object.assign(style, widthCSS)\n }\n\n return style\n}\n\n/**\n * Convert GradientValue to CSS gradient string\n */\nexport function gradientValueToCSS(gradient: GradientValue | null | undefined): string {\n if (!gradient?.stops || gradient.stops.length === 0) {\n return 'transparent'\n }\n\n // Sort stops by position\n const sortedStops = [...gradient.stops].sort((a, b) => a.position - b.position)\n\n // Convert stops to CSS format\n const stopsCSS = sortedStops\n .map((stop) => {\n const color = colorValueToCSS(stop.color) || 'transparent'\n return `${color} ${stop.position}%`\n })\n .join(', ')\n\n if (gradient.type === 'radial') {\n const shape = gradient.radialShape || 'circle'\n const position = gradient.radialPosition || 'center'\n return `radial-gradient(${shape} at ${position}, ${stopsCSS})`\n }\n\n // Linear gradient\n return `linear-gradient(${gradient.angle}deg, ${stopsCSS})`\n}\n\n/**\n * Convert position value to CSS background-position\n */\nfunction positionToCSS(\n position: BackgroundImageValue['position'] | undefined\n): string {\n const positionMap: Record<NonNullable<BackgroundImageValue['position']>, string> = {\n center: 'center',\n top: 'top',\n bottom: 'bottom',\n left: 'left',\n right: 'right',\n 'top-left': 'top left',\n 'top-right': 'top right',\n 'bottom-left': 'bottom left',\n 'bottom-right': 'bottom right',\n }\n return position ? positionMap[position] || 'center' : 'center'\n}\n\n/**\n * Convert GradientMask direction to CSS gradient direction\n */\nfunction maskDirectionToCSS(direction: GradientMask['direction']): string {\n const directionMap: Record<GradientMask['direction'], string> = {\n 'to-top': 'to top',\n 'to-bottom': 'to bottom',\n 'to-left': 'to left',\n 'to-right': 'to right',\n 'to-top-left': 'to top left',\n 'to-top-right': 'to top right',\n 'to-bottom-left': 'to bottom left',\n 'to-bottom-right': 'to bottom right',\n 'from-center': 'radial', // Not used for linear, handled separately in maskToCSS\n }\n return directionMap[direction] || 'to bottom'\n}\n\n/**\n * Convert GradientMask to CSS mask-image string\n */\nfunction maskToCSS(mask: GradientMask): string {\n const startAlpha = (mask.startOpacity ?? 100) / 100\n const endAlpha = (mask.endOpacity ?? 0) / 100\n\n // Handle radial gradient for \"from-center\"\n if (mask.direction === 'from-center') {\n return `radial-gradient(circle at center, rgba(0,0,0,${startAlpha}) ${mask.startPosition}%, rgba(0,0,0,${endAlpha}) ${mask.endPosition}%)`\n }\n\n // Linear gradient for directional fades\n const direction = maskDirectionToCSS(mask.direction)\n return `linear-gradient(${direction}, rgba(0,0,0,${startAlpha}) ${mask.startPosition}%, rgba(0,0,0,${endAlpha}) ${mask.endPosition}%)`\n}\n\n/**\n * Result of background CSS conversion\n * Includes both styles and metadata for consumer components\n */\nexport interface BackgroundCSSResult {\n /** CSS properties to apply directly */\n styles: React.CSSProperties\n /** Image opacity (0-1) - consumer should apply via wrapper if needed */\n imageOpacity?: number\n}\n\n/**\n * Convert BackgroundValue to CSS properties object\n * Returns both styles and metadata for advanced features like image opacity\n */\nexport function backgroundValueToCSS(\n bg: BackgroundValue | null | undefined\n): React.CSSProperties {\n if (!bg || bg.type === 'none') {\n return {}\n }\n\n const style: React.CSSProperties = {}\n\n switch (bg.type) {\n case 'solid':\n if (bg.solid?.hex) {\n style.backgroundColor = colorValueToCSS(bg.solid)\n }\n break\n\n case 'gradient':\n if (bg.gradient && bg.gradient.stops && bg.gradient.stops.length > 0) {\n style.background = gradientValueToCSS(bg.gradient)\n }\n break\n\n case 'image':\n if (bg.image?.media?.url) {\n const imageUrl = bg.image.media.url\n const size = bg.image.size || 'cover'\n const position = positionToCSS(bg.image.position)\n const repeat = bg.image.repeat || 'no-repeat'\n const attachment = bg.image.attachment || 'scroll'\n\n // Check if overlay is enabled\n if (bg.overlay?.enabled) {\n // Layer overlay on top of image using CSS multiple backgrounds\n // Use only backgroundImage to avoid shorthand/longhand conflicts\n const overlayCSS =\n bg.overlay.type === 'solid'\n ? colorValueToCSS(bg.overlay.solid)\n : gradientValueToCSS(bg.overlay.gradient)\n\n // CSS background layering: first layer is on top\n // For solid color overlay, we need to use a gradient to make it a proper layer\n if (bg.overlay.type === 'solid' && overlayCSS) {\n style.backgroundImage = `linear-gradient(${overlayCSS}, ${overlayCSS}), url(${imageUrl})`\n } else {\n style.backgroundImage = `${overlayCSS}, url(${imageUrl})`\n }\n // Use comma-separated values for each layer\n style.backgroundSize = `auto, ${size}`\n style.backgroundPosition = `center, ${position}`\n style.backgroundRepeat = `no-repeat, ${repeat}`\n style.backgroundAttachment = `scroll, ${attachment}`\n } else {\n // No overlay, just the image\n style.backgroundImage = `url(${imageUrl})`\n style.backgroundSize = size\n style.backgroundPosition = position\n style.backgroundRepeat = repeat\n style.backgroundAttachment = attachment\n }\n\n // Apply gradient mask if enabled\n if (bg.image.mask?.enabled) {\n const maskCSS = maskToCSS(bg.image.mask)\n style.maskImage = maskCSS\n // Webkit prefix for Safari support\n ;(style as Record<string, string>).WebkitMaskImage = maskCSS\n }\n }\n break\n }\n\n return style\n}\n\n/**\n * Get image opacity from BackgroundValue (for consumer wrapper components)\n * Returns undefined if no image or opacity is 100%\n */\nexport function getBackgroundImageOpacity(\n bg: BackgroundValue | null | undefined\n): number | undefined {\n if (!bg || bg.type !== 'image' || !bg.image) return undefined\n const opacity = bg.image.opacity ?? 100\n return opacity < 100 ? opacity / 100 : undefined\n}\n\n/**\n * Check if any custom style values are set\n */\nexport function hasCustomStyles(options: {\n backgroundColor?: ColorValue | null\n textColor?: ColorValue | null\n padding?: PaddingValue | null\n margin?: PaddingValue | null\n border?: BorderValue | null\n width?: WidthValue | null\n}): boolean {\n return !!(\n options.backgroundColor?.hex ||\n options.textColor?.hex ||\n options.padding ||\n options.margin ||\n (options.border && options.border.style !== 'none') ||\n options.width\n )\n}\n\n// =============================================================================\n// Transform Types\n// =============================================================================\n\nexport type TransformOrigin =\n | 'center'\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right'\n\nexport interface TransformValue {\n rotate: number // -360 to 360\n scaleX: number // 0.1 to 3\n scaleY: number // 0.1 to 3\n scaleLocked: boolean // When true, X and Y sync\n skewX: number // -45 to 45\n skewY: number // -45 to 45\n translateX: number\n translateY: number\n translateUnit: 'px' | 'rem' | '%'\n origin: TransformOrigin\n\n // Optional 3D\n enable3D: boolean\n perspective?: number // 100-2000px\n rotateX?: number // -180 to 180\n rotateY?: number // -180 to 180\n}\n\n/**\n * Default transform value\n */\nexport const DEFAULT_TRANSFORM: TransformValue = {\n rotate: 0,\n scaleX: 1,\n scaleY: 1,\n scaleLocked: true,\n skewX: 0,\n skewY: 0,\n translateX: 0,\n translateY: 0,\n translateUnit: 'px',\n origin: 'center',\n enable3D: false,\n perspective: 1000,\n rotateX: 0,\n rotateY: 0,\n}\n\n/**\n * Convert TransformOrigin to CSS transform-origin value\n */\nfunction transformOriginToCSS(origin: TransformOrigin): string {\n const originMap: Record<TransformOrigin, string> = {\n center: 'center',\n top: 'top',\n bottom: 'bottom',\n left: 'left',\n right: 'right',\n 'top-left': 'top left',\n 'top-right': 'top right',\n 'bottom-left': 'bottom left',\n 'bottom-right': 'bottom right',\n }\n return originMap[origin] || 'center'\n}\n\n/**\n * Convert TransformValue to CSS properties object\n */\nexport function transformValueToCSS(\n transform: TransformValue | null | undefined\n): React.CSSProperties | undefined {\n if (!transform) return undefined\n\n const style: React.CSSProperties = {}\n const transforms: string[] = []\n\n // Handle 3D perspective\n if (transform.enable3D && transform.perspective) {\n style.perspective = `${transform.perspective}px`\n }\n\n // Build transform string\n // Translate\n if (transform.translateX !== 0 || transform.translateY !== 0) {\n transforms.push(\n `translate(${transform.translateX}${transform.translateUnit}, ${transform.translateY}${transform.translateUnit})`\n )\n }\n\n // Rotate (2D)\n if (transform.rotate !== 0) {\n transforms.push(`rotate(${transform.rotate}deg)`)\n }\n\n // 3D rotations\n if (transform.enable3D) {\n if (transform.rotateX && transform.rotateX !== 0) {\n transforms.push(`rotateX(${transform.rotateX}deg)`)\n }\n if (transform.rotateY && transform.rotateY !== 0) {\n transforms.push(`rotateY(${transform.rotateY}deg)`)\n }\n }\n\n // Scale\n if (transform.scaleX !== 1 || transform.scaleY !== 1) {\n if (transform.scaleX === transform.scaleY) {\n transforms.push(`scale(${transform.scaleX})`)\n } else {\n transforms.push(`scale(${transform.scaleX}, ${transform.scaleY})`)\n }\n }\n\n // Skew\n if (transform.skewX !== 0 || transform.skewY !== 0) {\n if (transform.skewX !== 0 && transform.skewY !== 0) {\n transforms.push(`skew(${transform.skewX}deg, ${transform.skewY}deg)`)\n } else if (transform.skewX !== 0) {\n transforms.push(`skewX(${transform.skewX}deg)`)\n } else {\n transforms.push(`skewY(${transform.skewY}deg)`)\n }\n }\n\n // Apply transform if we have any\n if (transforms.length > 0) {\n style.transform = transforms.join(' ')\n }\n\n // Transform origin\n if (transform.origin !== 'center') {\n style.transformOrigin = transformOriginToCSS(transform.origin)\n }\n\n // Add transform-style for 3D\n if (transform.enable3D) {\n style.transformStyle = 'preserve-3d'\n }\n\n return Object.keys(style).length > 0 ? style : undefined\n}\n\n// =============================================================================\n// Responsive Field Types\n// =============================================================================\n\nexport type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\n/**\n * Responsive value that can have different values at different breakpoints.\n * XS (extra small) is required, other breakpoints are optional overrides.\n */\nexport interface ResponsiveValue<T> {\n xs: T\n sm?: T\n md?: T\n lg?: T\n xl?: T\n}\n\n/**\n * Breakpoint configuration with labels and pixel values\n */\nexport const BREAKPOINTS: Array<{\n key: Breakpoint\n label: string\n minWidth: number | null\n}> = [\n { key: 'xs', label: 'XS', minWidth: null },\n { key: 'sm', label: 'SM', minWidth: 640 },\n { key: 'md', label: 'MD', minWidth: 768 },\n { key: 'lg', label: 'LG', minWidth: 1024 },\n { key: 'xl', label: 'XL', minWidth: 1280 },\n]\n\n// =============================================================================\n// Responsive CSS Helpers\n// =============================================================================\n\n/**\n * Type guard to check if a value is a ResponsiveValue (has breakpoint structure)\n */\nexport function isResponsiveValue<T>(value: unknown): value is ResponsiveValue<T> {\n if (!value || typeof value !== 'object') return false\n return 'xs' in value\n}\n\n/**\n * Converts a camelCase property name to kebab-case CSS property\n */\nfunction camelToKebab(str: string): string {\n return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)\n}\n\n/**\n * Converts React.CSSProperties to a CSS string for use in style tags\n */\nexport function cssPropertiesToString(styles: React.CSSProperties): string {\n return Object.entries(styles)\n .filter(([, value]) => value !== undefined && value !== null && value !== '')\n .map(([key, value]) => `${camelToKebab(key)}: ${value}`)\n .join('; ')\n}\n\n/**\n * Result of converting a responsive value to CSS\n */\nexport interface ResponsiveCSSResult {\n /** Base styles to apply as inline styles */\n baseStyles: React.CSSProperties\n /** CSS media queries to render in a <style> tag */\n mediaQueryCSS: string\n}\n\n/**\n * Converts a ResponsiveValue to CSS with media queries.\n * Works with any value type that has a CSS converter function.\n *\n * @param value - The responsive or non-responsive value\n * @param converter - Function to convert the value type to CSSProperties\n * @param uniqueId - Unique class name for targeting in media queries\n * @returns Object with baseStyles (inline) and mediaQueryCSS (for <style> tag)\n *\n * @example\n * ```tsx\n * const { baseStyles, mediaQueryCSS } = responsiveValueToCSS(\n * dimensions,\n * dimensionsValueToCSS,\n * 'container-abc123'\n * )\n *\n * return (\n * <>\n * {mediaQueryCSS && <style>{mediaQueryCSS}</style>}\n * <div className=\"container-abc123\" style={baseStyles}>...</div>\n * </>\n * )\n * ```\n */\nexport function responsiveValueToCSS<T>(\n value: ResponsiveValue<T> | T | null | undefined,\n converter: (v: T) => React.CSSProperties | undefined,\n uniqueId: string\n): ResponsiveCSSResult {\n // Handle null/undefined\n if (value === null || value === undefined) {\n return { baseStyles: {}, mediaQueryCSS: '' }\n }\n\n // If not responsive (single value), return as base styles only\n if (!isResponsiveValue<T>(value)) {\n const styles = converter(value as T)\n return {\n baseStyles: styles || {},\n mediaQueryCSS: '',\n }\n }\n\n // Generate media queries for each breakpoint\n const mediaQueries: string[] = []\n let baseStyles: React.CSSProperties = {}\n\n BREAKPOINTS.forEach((bp) => {\n const bpValue = value[bp.key]\n if (bpValue === undefined) return\n\n const cssProps = converter(bpValue)\n if (!cssProps) return\n\n if (bp.key === 'xs') {\n baseStyles = cssProps\n } else {\n const styleString = cssPropertiesToString(cssProps)\n if (styleString) {\n mediaQueries.push(\n `@media (min-width: ${bp.minWidth}px) { .${uniqueId} { ${styleString} } }`\n )\n }\n }\n })\n\n return { baseStyles, mediaQueryCSS: mediaQueries.join('\\n') }\n}\n\n/**\n * Visibility value for show/hide per breakpoint\n */\nexport interface VisibilityValue {\n /** XS (extra small) visibility - true = visible, false = hidden (default: true) */\n xs: boolean\n /** Small screens (640px+) */\n sm?: boolean\n /** Override for medium screens (768px+) */\n md?: boolean\n /** Override for large screens (1024px+) */\n lg?: boolean\n /** Override for extra large screens (1280px+) */\n xl?: boolean\n}\n\n/**\n * Default visibility value (visible at all breakpoints)\n */\nexport const DEFAULT_VISIBILITY: VisibilityValue = {\n xs: true,\n sm: true,\n md: true,\n lg: true,\n xl: true,\n}\n\n/**\n * Converts a VisibilityValue to CSS with display: none media queries.\n * Each breakpoint is independent - generates targeted media queries for hidden breakpoints.\n *\n * @param visibility - The visibility settings per breakpoint\n * @param uniqueId - Unique class name for targeting in media queries\n * @returns CSS media queries string for hiding at specific breakpoints\n */\nexport function visibilityValueToCSS(\n visibility: VisibilityValue | null | undefined,\n uniqueId: string\n): string {\n if (!visibility) return ''\n\n const mediaQueries: string[] = []\n\n // Breakpoint min-widths for range calculations\n const breakpointWidths: Record<Breakpoint, number | null> = {\n xs: null, // 0px\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n }\n\n // Get next breakpoint's min-width for max-width calculation\n const getNextBreakpointWidth = (bp: Breakpoint): number | null => {\n const order: Breakpoint[] = ['xs', 'sm', 'md', 'lg', 'xl']\n const index = order.indexOf(bp)\n if (index === -1 || index === order.length - 1) return null\n return breakpointWidths[order[index + 1]]\n }\n\n // XS (0 to 639px)\n if (visibility.xs === false) {\n const nextWidth = getNextBreakpointWidth('xs')\n if (nextWidth) {\n mediaQueries.push(`@media (max-width: ${nextWidth - 1}px) { .${uniqueId} { display: none; } }`)\n } else {\n mediaQueries.push(`.${uniqueId} { display: none; }`)\n }\n }\n\n // Other breakpoints (sm, md, lg, xl)\n BREAKPOINTS.slice(1).forEach((bp) => {\n if (visibility[bp.key] === false) {\n const minWidth = breakpointWidths[bp.key]\n const maxWidth = getNextBreakpointWidth(bp.key)\n\n if (minWidth && maxWidth) {\n // Range query (e.g., sm: 640-767px)\n mediaQueries.push(\n `@media (min-width: ${minWidth}px) and (max-width: ${maxWidth - 1}px) { .${uniqueId} { display: none; } }`\n )\n } else if (minWidth) {\n // Last breakpoint (xl: 1280px+)\n mediaQueries.push(\n `@media (min-width: ${minWidth}px) { .${uniqueId} { display: none; } }`\n )\n }\n }\n })\n\n return mediaQueries.join('\\n')\n}\n\n// =============================================================================\n// Animation Types\n// =============================================================================\n\n/** Standard CSS easing functions */\nexport type EasingFunction = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out'\n\n/** Advanced easing with spring/bounce effects via cubic-bezier approximations */\nexport type AdvancedEasingFunction =\n | EasingFunction\n | 'spring'\n | 'spring-gentle'\n | 'bounce'\n | 'bounce-in'\n | 'bounce-out'\n | 'back-in'\n | 'back-out'\n | 'back-in-out'\n | 'elastic'\n\n/** Map advanced easing to CSS cubic-bezier values */\nexport const EASING_CSS_MAP: Record<AdvancedEasingFunction, string> = {\n linear: 'linear',\n ease: 'ease',\n 'ease-in': 'ease-in',\n 'ease-out': 'ease-out',\n 'ease-in-out': 'ease-in-out',\n spring: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n 'spring-gentle': 'cubic-bezier(0.34, 1.56, 0.64, 1)',\n bounce: 'cubic-bezier(0.68, -0.55, 0.265, 1.55)',\n 'bounce-in': 'cubic-bezier(0.6, -0.28, 0.735, 0.045)',\n 'bounce-out': 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n 'back-in': 'cubic-bezier(0.6, -0.28, 0.735, 0.045)',\n 'back-out': 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n 'back-in-out': 'cubic-bezier(0.68, -0.55, 0.265, 1.55)',\n elastic: 'cubic-bezier(0.68, -0.6, 0.32, 1.6)',\n}\n\n/** Transform origin for animations (3x3 grid) */\nexport type AnimationOrigin =\n | 'center'\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right'\n\n/** Stagger direction for child animations */\nexport type StaggerDirection = 'forward' | 'reverse' | 'center' | 'edges'\n\n/** Configuration for staggered child animations */\nexport interface StaggerConfig {\n enabled: boolean\n /** Delay between each child element (ms) */\n delay: number\n /** Maximum total delay to prevent very long animations */\n maxDelay?: number\n /** Direction of stagger effect */\n direction: StaggerDirection\n}\n\n/** Animation categories for UI organization */\nexport type AnimationCategory =\n | 'fade'\n | 'scale'\n | 'slide'\n | 'blur'\n | 'rotate'\n | 'bounce'\n | 'flip'\n | 'zoom'\n\n/**\n * Extended entrance animation presets (27 total)\n * Organized by category for the UI dropdown\n */\nexport type EntranceAnimation =\n // None\n | 'none'\n // Fade (6)\n | 'fade-in'\n | 'fade-up'\n | 'fade-down'\n | 'fade-left'\n | 'fade-right'\n | 'fade-scale'\n // Scale (4)\n | 'scale-in'\n | 'scale-up'\n | 'scale-down'\n | 'scale-out'\n // Slide (4)\n | 'slide-up'\n | 'slide-down'\n | 'slide-left'\n | 'slide-right'\n // Blur (3)\n | 'blur-in'\n | 'blur-up'\n | 'blur-down'\n // Rotate (3)\n | 'rotate-in'\n | 'rotate-up'\n | 'rotate-down'\n // Bounce (3)\n | 'bounce-in'\n | 'bounce-up'\n | 'bounce-down'\n // Flip (2)\n | 'flip-x'\n | 'flip-y'\n // Zoom (2)\n | 'zoom-in'\n | 'zoom-out'\n\n/**\n * Animation presets organized by category for UI\n */\nexport const ANIMATION_CATEGORIES: Array<{\n category: AnimationCategory | 'none'\n label: string\n animations: EntranceAnimation[]\n}> = [\n { category: 'none', label: 'None', animations: ['none'] },\n { category: 'fade', label: 'Fade', animations: ['fade-in', 'fade-up', 'fade-down', 'fade-left', 'fade-right', 'fade-scale'] },\n { category: 'scale', label: 'Scale', animations: ['scale-in', 'scale-up', 'scale-down', 'scale-out'] },\n { category: 'slide', label: 'Slide', animations: ['slide-up', 'slide-down', 'slide-left', 'slide-right'] },\n { category: 'blur', label: 'Blur', animations: ['blur-in', 'blur-up', 'blur-down'] },\n { category: 'rotate', label: 'Rotate', animations: ['rotate-in', 'rotate-up', 'rotate-down'] },\n { category: 'bounce', label: 'Bounce', animations: ['bounce-in', 'bounce-up', 'bounce-down'] },\n { category: 'flip', label: 'Flip', animations: ['flip-x', 'flip-y'] },\n { category: 'zoom', label: 'Zoom', animations: ['zoom-in', 'zoom-out'] },\n]\n\nexport interface AnimationValue {\n mode: 'preset' | 'custom'\n\n // Preset mode\n entrance?: EntranceAnimation\n entranceDuration?: number // ms\n entranceDelay?: number // ms\n\n // Intensity controls (context-aware based on animation type)\n /** Distance for translate animations (8-200px) */\n distance?: number\n /** Starting scale for scale animations (0.1-2) */\n scaleFrom?: number\n /** Rotation angle for rotate animations (-180 to 180deg) */\n rotateAngle?: number\n /** Blur amount for blur animations (0-50px) */\n blurAmount?: number\n\n // Transform origin (affects scale/rotate)\n origin?: AnimationOrigin\n\n // Advanced easing\n easing?: AdvancedEasingFunction\n\n // Stagger for child elements\n stagger?: StaggerConfig\n\n // Custom transition mode\n duration?: number // 0-2000ms\n delay?: number // 0-2000ms\n\n // Scroll trigger\n triggerOnScroll?: boolean\n triggerThreshold?: number // 0-1\n triggerOnce?: boolean\n /** Margin around viewport for earlier/later triggering (e.g., \"0px 0px -100px 0px\") */\n triggerMargin?: string\n}\n\n// =============================================================================\n// Animation CSS Utilities\n// =============================================================================\n\n/**\n * Convert AnimationOrigin to CSS transform-origin value\n */\nfunction animationOriginToCSS(origin: AnimationOrigin | undefined): string {\n if (!origin) return 'center'\n const originMap: Record<AnimationOrigin, string> = {\n center: 'center',\n top: 'top',\n bottom: 'bottom',\n left: 'left',\n right: 'right',\n 'top-left': 'top left',\n 'top-right': 'top right',\n 'bottom-left': 'bottom left',\n 'bottom-right': 'bottom right',\n }\n return originMap[origin] || 'center'\n}\n\n/**\n * Convert AnimationValue to CSS transition property (for custom mode)\n * Returns undefined for preset mode - use getEntranceAnimationStyles instead\n */\nexport function animationValueToCSS(anim: AnimationValue | null): React.CSSProperties | undefined {\n if (!anim || anim.mode !== 'custom') return undefined\n\n const duration = anim.duration ?? 300\n const delay = anim.delay ?? 0\n const easing = anim.easing ?? 'ease'\n const easingCSS = EASING_CSS_MAP[easing] || 'ease'\n\n return {\n transition: `all ${duration}ms ${easingCSS} ${delay}ms`,\n transitionProperty: 'opacity, transform, filter, background-color, color, border-color, box-shadow',\n }\n}\n\n/**\n * Get initial and animate styles for entrance animations\n * Returns inline CSS style objects that work without Tailwind compilation\n * Supports all 27 animation presets with customizable intensity\n */\nexport function getEntranceAnimationStyles(anim: AnimationValue | null): {\n initial: React.CSSProperties\n animate: React.CSSProperties\n duration: number\n delay: number\n easing: string\n origin: string\n} {\n const defaultResult = {\n initial: {} as React.CSSProperties,\n animate: {} as React.CSSProperties,\n duration: 500,\n delay: 0,\n easing: 'ease',\n origin: 'center',\n }\n\n if (!anim || anim.mode !== 'preset' || anim.entrance === 'none') {\n return defaultResult\n }\n\n const duration = anim.entranceDuration ?? 500\n const delay = anim.entranceDelay ?? 0\n const easing = EASING_CSS_MAP[anim.easing ?? 'ease'] || 'ease'\n const origin = animationOriginToCSS(anim.origin)\n\n // Intensity values with defaults\n const distance = anim.distance ?? 24 // px\n const scaleFrom = anim.scaleFrom ?? 0.9\n const rotateAngle = anim.rotateAngle ?? 15 // degrees\n const blurAmount = anim.blurAmount ?? 8 // px\n\n // Build animation styles based on preset\n const entrance = anim.entrance ?? 'none'\n\n let initial: React.CSSProperties = {}\n let animate: React.CSSProperties = {}\n\n switch (entrance) {\n // ==================== FADE (6) ====================\n case 'fade-in':\n initial = { opacity: 0 }\n animate = { opacity: 1 }\n break\n\n case 'fade-up':\n initial = { opacity: 0, transform: `translateY(${distance}px)` }\n animate = { opacity: 1, transform: 'translateY(0)' }\n break\n\n case 'fade-down':\n initial = { opacity: 0, transform: `translateY(-${distance}px)` }\n animate = { opacity: 1, transform: 'translateY(0)' }\n break\n\n case 'fade-left':\n initial = { opacity: 0, transform: `translateX(${distance}px)` }\n animate = { opacity: 1, transform: 'translateX(0)' }\n break\n\n case 'fade-right':\n initial = { opacity: 0, transform: `translateX(-${distance}px)` }\n animate = { opacity: 1, transform: 'translateX(0)' }\n break\n\n case 'fade-scale':\n initial = { opacity: 0, transform: `scale(${scaleFrom})` }\n animate = { opacity: 1, transform: 'scale(1)' }\n break\n\n // ==================== SCALE (4) ====================\n case 'scale-in':\n initial = { opacity: 0, transform: `scale(${scaleFrom})` }\n animate = { opacity: 1, transform: 'scale(1)' }\n break\n\n case 'scale-up':\n initial = { opacity: 0, transform: `scale(${scaleFrom}) translateY(${distance}px)` }\n animate = { opacity: 1, transform: 'scale(1) translateY(0)' }\n break\n\n case 'scale-down':\n initial = { opacity: 0, transform: `scale(${scaleFrom}) translateY(-${distance}px)` }\n animate = { opacity: 1, transform: 'scale(1) translateY(0)' }\n break\n\n case 'scale-out':\n // Scales from larger to normal\n initial = { opacity: 0, transform: `scale(${2 - scaleFrom})` }\n animate = { opacity: 1, transform: 'scale(1)' }\n break\n\n // ==================== SLIDE (4) ====================\n case 'slide-up':\n initial = { transform: `translateY(${distance}px)` }\n animate = { transform: 'translateY(0)' }\n break\n\n case 'slide-down':\n initial = { transform: `translateY(-${distance}px)` }\n animate = { transform: 'translateY(0)' }\n break\n\n case 'slide-left':\n initial = { transform: `translateX(${distance}px)` }\n animate = { transform: 'translateX(0)' }\n break\n\n case 'slide-right':\n initial = { transform: `translateX(-${distance}px)` }\n animate = { transform: 'translateX(0)' }\n break\n\n // ==================== BLUR (3) ====================\n case 'blur-in':\n initial = { opacity: 0, filter: `blur(${blurAmount}px)` }\n animate = { opacity: 1, filter: 'blur(0)' }\n break\n\n case 'blur-up':\n initial = { opacity: 0, filter: `blur(${blurAmount}px)`, transform: `translateY(${distance}px)` }\n animate = { opacity: 1, filter: 'blur(0)', transform: 'translateY(0)' }\n break\n\n case 'blur-down':\n initial = { opacity: 0, filter: `blur(${blurAmount}px)`, transform: `translateY(-${distance}px)` }\n animate = { opacity: 1, filter: 'blur(0)', transform: 'translateY(0)' }\n break\n\n // ==================== ROTATE (3) ====================\n case 'rotate-in':\n initial = { opacity: 0, transform: `rotate(${rotateAngle}deg) scale(${scaleFrom})` }\n animate = { opacity: 1, transform: 'rotate(0) scale(1)' }\n break\n\n case 'rotate-up':\n initial = { opacity: 0, transform: `rotate(${rotateAngle}deg) translateY(${distance}px)` }\n animate = { opacity: 1, transform: 'rotate(0) translateY(0)' }\n break\n\n case 'rotate-down':\n initial = { opacity: 0, transform: `rotate(-${rotateAngle}deg) translateY(-${distance}px)` }\n animate = { opacity: 1, transform: 'rotate(0) translateY(0)' }\n break\n\n // ==================== BOUNCE (3) ====================\n // These use spring/bounce easing by default for the effect\n case 'bounce-in':\n initial = { opacity: 0, transform: `scale(${scaleFrom * 0.8})` }\n animate = { opacity: 1, transform: 'scale(1)' }\n break\n\n case 'bounce-up':\n initial = { opacity: 0, transform: `translateY(${distance * 1.5}px)` }\n animate = { opacity: 1, transform: 'translateY(0)' }\n break\n\n case 'bounce-down':\n initial = { opacity: 0, transform: `translateY(-${distance * 1.5}px)` }\n animate = { opacity: 1, transform: 'translateY(0)' }\n break\n\n // ==================== FLIP (2) ====================\n // Flip uses perspective in transform for proper 3D effect\n // Starts from -90deg (tilted back) so the flip motion is visible\n case 'flip-x':\n initial = {\n transform: 'perspective(1000px) rotateX(-90deg)',\n opacity: 0.2,\n backfaceVisibility: 'hidden',\n }\n animate = {\n transform: 'perspective(1000px) rotateX(0deg)',\n opacity: 1,\n backfaceVisibility: 'hidden',\n }\n break\n\n case 'flip-y':\n initial = {\n transform: 'perspective(1000px) rotateY(-90deg)',\n opacity: 0.2,\n backfaceVisibility: 'hidden',\n }\n animate = {\n transform: 'perspective(1000px) rotateY(0deg)',\n opacity: 1,\n backfaceVisibility: 'hidden',\n }\n break\n\n // ==================== ZOOM (2) ====================\n case 'zoom-in':\n // Starts small, zooms to full size\n initial = { opacity: 0, transform: `scale(${scaleFrom * 0.5})` }\n animate = { opacity: 1, transform: 'scale(1)' }\n break\n\n case 'zoom-out':\n // Starts large, zooms down to full size\n initial = { opacity: 0, transform: `scale(${2.5 - scaleFrom})` }\n animate = { opacity: 1, transform: 'scale(1)' }\n break\n\n default:\n break\n }\n\n return {\n initial,\n animate,\n duration,\n delay,\n easing,\n origin,\n }\n}\n\n/**\n * Get default easing for animation category\n * Bounce animations default to bounce easing, etc.\n */\nexport function getDefaultEasingForAnimation(entrance: EntranceAnimation): AdvancedEasingFunction {\n if (entrance.startsWith('bounce-')) return 'bounce'\n if (entrance.startsWith('flip-')) return 'back-out'\n if (entrance.startsWith('zoom-')) return 'ease-out'\n return 'ease'\n}\n\n/**\n * Get CSS custom properties for animation timing\n * Useful for CSS-only animations with custom properties\n */\nexport function getAnimationCSSVariables(anim: AnimationValue | null): Record<string, string> {\n if (!anim) return {}\n\n const isPreset = anim.mode === 'preset'\n const duration = isPreset ? (anim.entranceDuration ?? 500) : (anim.duration ?? 300)\n const delay = isPreset ? (anim.entranceDelay ?? 0) : (anim.delay ?? 0)\n const easing = anim.easing ?? 'ease'\n const easingCSS = EASING_CSS_MAP[easing] || 'ease'\n\n return {\n '--animation-duration': `${duration}ms`,\n '--animation-delay': `${delay}ms`,\n '--animation-easing': easingCSS,\n }\n}\n\n/**\n * Generate stagger delay for a specific child index\n * Accounts for direction (forward, reverse, center, edges)\n */\nexport function getStaggerDelay(config: StaggerConfig, index: number, totalChildren: number): number {\n if (!config.enabled || totalChildren <= 1) return 0\n\n let effectiveIndex: number\n\n switch (config.direction) {\n case 'forward':\n effectiveIndex = index\n break\n case 'reverse':\n effectiveIndex = totalChildren - 1 - index\n break\n case 'center': {\n // Center starts from middle, animates outward\n const center = (totalChildren - 1) / 2\n effectiveIndex = Math.abs(index - center)\n break\n }\n case 'edges': {\n // Edges starts from outside, animates inward\n const center = (totalChildren - 1) / 2\n effectiveIndex = center - Math.abs(index - center)\n break\n }\n default:\n effectiveIndex = index\n }\n\n const delay = effectiveIndex * config.delay\n\n // Cap at max delay if specified\n if (config.maxDelay && delay > config.maxDelay) {\n return config.maxDelay\n }\n\n return delay\n}\n\n/**\n * Generate CSS styles for staggered children\n * Returns an object with CSS custom properties for each child\n */\nexport function generateStaggerStyles(\n config: StaggerConfig | undefined,\n totalChildren: number\n): React.CSSProperties[] {\n if (!config?.enabled || totalChildren <= 1) {\n return Array(totalChildren).fill({})\n }\n\n return Array.from({ length: totalChildren }, (_, i) => {\n const delay = getStaggerDelay(config, i, totalChildren)\n return {\n '--stagger-delay': `${delay}ms`,\n transitionDelay: `${delay}ms`,\n } as React.CSSProperties\n })\n}\n\n/**\n * Check which intensity controls are relevant for an animation type\n */\nexport function getRelevantIntensityControls(entrance: EntranceAnimation): {\n showDistance: boolean\n showScale: boolean\n showRotate: boolean\n showBlur: boolean\n} {\n const hasTranslate = [\n 'fade-up', 'fade-down', 'fade-left', 'fade-right',\n 'scale-up', 'scale-down',\n 'slide-up', 'slide-down', 'slide-left', 'slide-right',\n 'blur-up', 'blur-down',\n 'rotate-up', 'rotate-down',\n 'bounce-up', 'bounce-down',\n ].includes(entrance)\n\n const hasScale = [\n 'fade-scale',\n 'scale-in', 'scale-up', 'scale-down', 'scale-out',\n 'rotate-in',\n 'bounce-in',\n 'zoom-in', 'zoom-out',\n ].includes(entrance)\n\n const hasRotate = [\n 'rotate-in', 'rotate-up', 'rotate-down',\n ].includes(entrance)\n\n const hasBlur = [\n 'blur-in', 'blur-up', 'blur-down',\n ].includes(entrance)\n\n return {\n showDistance: hasTranslate,\n showScale: hasScale,\n showRotate: hasRotate,\n showBlur: hasBlur,\n }\n}\n\n/**\n * Default animation value\n */\nexport const DEFAULT_ANIMATION: AnimationValue = {\n mode: 'preset',\n entrance: 'none',\n entranceDuration: 500,\n entranceDelay: 0,\n distance: 24,\n scaleFrom: 0.9,\n rotateAngle: 15,\n blurAmount: 8,\n origin: 'center',\n easing: 'ease',\n triggerOnScroll: true,\n triggerThreshold: 0.1,\n triggerOnce: true,\n}\n\n// =============================================================================\n// Layout Components Disallow List (prevent recursion in slots)\n// =============================================================================\n\nexport const layoutComponentsDisallow = [\n 'Container',\n 'Flex',\n 'Grid',\n 'Section',\n]\n\n","/**\n * Container Component - Server-safe Puck Configuration\n *\n * Content wrapper with max-width and background options.\n * Uses Puck's slot system for nesting other components.\n * Uses Tailwind classes for layout, inline styles for dynamic user values.\n *\n * This is a server-safe version with NO fields property (only slot for content).\n * For the full editor version with fields, use Container.tsx\n *\n * Responsive Controls:\n * - dimensions: Different max-width at different breakpoints\n * - customPadding: Different outer padding at different breakpoints\n * - innerPadding: Different inner padding at different breakpoints\n * - margin: Different margins at different breakpoints\n * - visibility: Show/hide at different breakpoints\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n cn,\n dimensionsValueToCSS,\n borderValueToCSS,\n paddingValueToCSS,\n marginValueToCSS,\n backgroundValueToCSS,\n responsiveValueToCSS,\n visibilityValueToCSS,\n type PaddingValue,\n type BorderValue,\n type DimensionsValue,\n type BackgroundValue,\n type AnimationValue,\n type ResponsiveValue,\n type VisibilityValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\n\n// Simple ID generator for server-side rendering\nlet idCounter = 0\nfunction generateUniqueId(): string {\n return `c${(++idCounter).toString(36)}${Math.random().toString(36).slice(2, 6)}`\n}\n\nexport interface ContainerProps {\n content: unknown\n // Outer (section-level) options\n background: BackgroundValue | null\n customPadding: ResponsiveValue<PaddingValue> | PaddingValue | null\n dimensions: ResponsiveValue<DimensionsValue> | DimensionsValue | null\n border: BorderValue | null\n margin: ResponsiveValue<PaddingValue> | PaddingValue | null\n animation: AnimationValue | null\n // Inner (content container) options\n innerBackground: BackgroundValue | null\n innerPadding: ResponsiveValue<PaddingValue> | PaddingValue | null\n innerBorder: BorderValue | null\n // Responsive visibility\n visibility: VisibilityValue | null\n}\n\nconst defaultProps: ContainerProps = {\n content: [],\n background: null,\n customPadding: null,\n dimensions: null,\n border: null,\n margin: null,\n animation: null,\n innerBackground: null,\n innerPadding: null,\n innerBorder: null,\n visibility: null,\n}\n\nexport const ContainerConfig: ComponentConfig = {\n label: 'Container',\n fields: {\n content: { type: 'slot' },\n },\n defaultProps,\n render: ({\n content: Content,\n background,\n customPadding,\n dimensions,\n border,\n margin,\n animation,\n innerBackground,\n innerPadding,\n innerBorder,\n visibility,\n }) => {\n // Generate unique IDs for CSS targeting (server-safe)\n const uniqueId = generateUniqueId()\n const outerClass = `puck-container-outer-${uniqueId}`\n const innerClass = `puck-container-inner-${uniqueId}`\n\n // Collect all media query CSS\n const mediaQueries: string[] = []\n\n // Generate outer wrapper styles from BackgroundValue\n const outerBackgroundStyles = backgroundValueToCSS(background)\n const outerStyles: React.CSSProperties = {\n ...outerBackgroundStyles,\n }\n\n // Add outer padding with responsive support\n const outerPaddingResult = responsiveValueToCSS(\n customPadding,\n (v) => ({ padding: paddingValueToCSS(v) }),\n outerClass\n )\n Object.assign(outerStyles, outerPaddingResult.baseStyles)\n if (outerPaddingResult.mediaQueryCSS) {\n mediaQueries.push(outerPaddingResult.mediaQueryCSS)\n }\n\n // Add outer border if set\n const outerBorderStyles = borderValueToCSS(border)\n if (outerBorderStyles) {\n Object.assign(outerStyles, outerBorderStyles)\n }\n\n // Add margin with responsive support\n const marginResult = responsiveValueToCSS(\n margin,\n (v) => ({ margin: marginValueToCSS(v) }),\n outerClass\n )\n Object.assign(outerStyles, marginResult.baseStyles)\n if (marginResult.mediaQueryCSS) {\n mediaQueries.push(marginResult.mediaQueryCSS)\n }\n\n // Generate inner container styles\n const innerBackgroundStyles = backgroundValueToCSS(innerBackground)\n const innerStyles: React.CSSProperties = {\n ...innerBackgroundStyles,\n }\n\n // Dimensions with responsive support\n const dimensionsResult = responsiveValueToCSS(\n dimensions,\n dimensionsValueToCSS,\n innerClass\n )\n Object.assign(innerStyles, dimensionsResult.baseStyles)\n if (dimensionsResult.mediaQueryCSS) {\n mediaQueries.push(dimensionsResult.mediaQueryCSS)\n }\n\n // Inner padding with responsive support\n const innerPaddingResult = responsiveValueToCSS(\n innerPadding,\n (v) => ({ padding: paddingValueToCSS(v) }),\n innerClass\n )\n Object.assign(innerStyles, innerPaddingResult.baseStyles)\n if (innerPaddingResult.mediaQueryCSS) {\n mediaQueries.push(innerPaddingResult.mediaQueryCSS)\n }\n\n // Inner border\n const innerBorderStyles = borderValueToCSS(innerBorder)\n if (innerBorderStyles) {\n Object.assign(innerStyles, innerBorderStyles)\n }\n\n // Visibility media queries\n const visibilityCSS = visibilityValueToCSS(visibility, outerClass)\n if (visibilityCSS) {\n mediaQueries.push(visibilityCSS)\n }\n\n const contentClasses = cn('px-4', innerClass)\n\n // Check if we have any inner styling\n const hasInnerStyles = Object.keys(innerStyles).length > 0\n\n // Combine all media queries\n const allMediaQueryCSS = mediaQueries.join('\\n')\n\n // Type assertion for Puck slot content - cast to any to avoid complex React type issues\n const ContentSlot = Content as any\n\n return (\n <AnimatedWrapper animation={animation}>\n {allMediaQueryCSS && <style>{allMediaQueryCSS}</style>}\n <div className={outerClass} style={outerStyles}>\n {hasInnerStyles ? (\n <div className={contentClasses} style={innerStyles}>\n <ContentSlot />\n </div>\n ) : (\n <ContentSlot className={contentClasses} style={innerStyles} />\n )}\n </div>\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * Flex Component - Server-safe Puck Configuration\n *\n * Flexbox layout following official Puck demo patterns.\n * Uses Tailwind classes for layout, inline styles for dynamic user values.\n *\n * This is a server-safe version with NO fields property (only slot for content).\n * For the full editor version with fields, use Flex.tsx\n *\n * Responsive Controls:\n * - dimensions: Different dimensions at different breakpoints\n * - customPadding: Different padding at different breakpoints\n * - margin: Different margins at different breakpoints\n * - visibility: Show/hide at different breakpoints\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n cn,\n dimensionsValueToCSS,\n marginValueToCSS,\n paddingValueToCSS,\n borderValueToCSS,\n backgroundValueToCSS,\n responsiveValueToCSS,\n visibilityValueToCSS,\n justifyContentMap,\n alignItemsMap,\n type PaddingValue,\n type BorderValue,\n type DimensionsValue,\n type BackgroundValue,\n type AnimationValue,\n type ResponsiveValue,\n type VisibilityValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\n\n// Simple ID generator for server-side rendering\nlet idCounter = 0\nfunction generateUniqueId(): string {\n return `f${(++idCounter).toString(36)}${Math.random().toString(36).slice(2, 6)}`\n}\n\n// Inline type definitions to avoid importing from client-only FlexAlignmentField\nexport type JustifyContent = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around'\nexport type AlignItems = 'flex-start' | 'center' | 'flex-end' | 'stretch'\n\n// Tailwind class mappings for flex properties\nconst flexDirectionMap: Record<string, string> = {\n row: 'flex-row',\n column: 'flex-col',\n 'row-reverse': 'flex-row-reverse',\n 'column-reverse': 'flex-col-reverse',\n}\n\nconst flexWrapMap: Record<string, string> = {\n wrap: 'flex-wrap',\n nowrap: 'flex-nowrap',\n 'wrap-reverse': 'flex-wrap-reverse',\n}\n\nexport interface FlexProps {\n content: unknown\n direction: 'row' | 'column'\n justifyContent: JustifyContent | null\n alignItems: AlignItems | null\n gap: number\n wrap: 'wrap' | 'nowrap'\n // Background\n background: BackgroundValue | null\n // Advanced custom options\n customPadding: ResponsiveValue<PaddingValue> | PaddingValue | null\n margin: ResponsiveValue<PaddingValue> | PaddingValue | null\n dimensions: ResponsiveValue<DimensionsValue> | DimensionsValue | null\n border: BorderValue | null\n animation: AnimationValue | null\n // Responsive visibility\n visibility: VisibilityValue | null\n}\n\nconst defaultProps: FlexProps = {\n content: [],\n direction: 'row',\n justifyContent: null,\n alignItems: null,\n gap: 24,\n wrap: 'wrap',\n background: null,\n customPadding: null,\n margin: null,\n dimensions: null,\n border: null,\n animation: null,\n visibility: null,\n}\n\nexport const FlexConfig: ComponentConfig = {\n label: 'Flex',\n fields: {\n content: { type: 'slot' },\n },\n defaultProps,\n render: ({\n content: Content,\n direction,\n justifyContent,\n alignItems,\n gap,\n wrap,\n background,\n customPadding,\n margin,\n dimensions,\n border,\n animation,\n visibility,\n }) => {\n // Generate unique IDs for CSS targeting (server-safe)\n const uniqueId = generateUniqueId()\n const wrapperClass = `puck-flex-${uniqueId}`\n const contentClass = `puck-flex-content-${uniqueId}`\n\n // Collect all media query CSS\n const mediaQueries: string[] = []\n\n // Generate styles from BackgroundValue\n const backgroundStyles = backgroundValueToCSS(background)\n\n // Build wrapper styles\n const wrapperStyles: React.CSSProperties = {\n ...backgroundStyles,\n }\n\n // Add padding with responsive support\n const paddingResult = responsiveValueToCSS(\n customPadding,\n (v) => ({ padding: paddingValueToCSS(v) }),\n wrapperClass\n )\n Object.assign(wrapperStyles, paddingResult.baseStyles)\n if (paddingResult.mediaQueryCSS) {\n mediaQueries.push(paddingResult.mediaQueryCSS)\n }\n\n // Add border if set\n const borderStyles = borderValueToCSS(border)\n if (borderStyles) {\n Object.assign(wrapperStyles, borderStyles)\n }\n\n // Apply margin with responsive support\n const marginResult = responsiveValueToCSS(\n margin,\n (v) => ({ margin: marginValueToCSS(v) }),\n wrapperClass\n )\n Object.assign(wrapperStyles, marginResult.baseStyles)\n if (marginResult.mediaQueryCSS) {\n mediaQueries.push(marginResult.mediaQueryCSS)\n }\n\n // Use dimensions with responsive support\n const dimensionsResult = responsiveValueToCSS(\n dimensions,\n dimensionsValueToCSS,\n contentClass\n )\n\n // Visibility media queries\n const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass)\n if (visibilityCSS) {\n mediaQueries.push(visibilityCSS)\n }\n\n // Build Tailwind classes for flex layout\n // [&>*]:min-w-0 prevents flex children from overflowing (CSS best practice)\n const contentClasses = cn(\n 'flex w-full min-h-[50px]',\n flexDirectionMap[direction],\n justifyContent && justifyContentMap[justifyContent],\n alignItems && alignItemsMap[alignItems],\n flexWrapMap[wrap],\n '[&>*]:min-w-0',\n contentClass,\n )\n\n // Dynamic styles that need inline (user-controlled values)\n const contentStyles: React.CSSProperties = {\n gap,\n ...dimensionsResult.baseStyles,\n }\n if (dimensionsResult.mediaQueryCSS) {\n mediaQueries.push(dimensionsResult.mediaQueryCSS)\n }\n\n // Combine all media queries\n const allMediaQueryCSS = mediaQueries.join('\\n')\n\n // Type assertion for Puck slot content - cast to any to avoid complex React type issues\n const ContentSlot = Content as any\n\n return (\n <AnimatedWrapper animation={animation}>\n {allMediaQueryCSS && <style>{allMediaQueryCSS}</style>}\n <div className={wrapperClass} style={wrapperStyles}>\n <ContentSlot className={contentClasses} style={contentStyles} />\n </div>\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * Grid Component - Server-safe Puck Configuration\n *\n * CSS Grid layout following official Puck demo patterns.\n * Responsive: stacks on mobile (flex column), grid on desktop (md+).\n * Uses Tailwind classes for layout, inline styles for dynamic user values.\n *\n * This is a server-safe version with NO fields property (only slot for content).\n * For the full editor version with fields, use Grid.tsx\n *\n * Responsive Controls:\n * - dimensions: Different dimensions at different breakpoints\n * - customPadding: Different padding at different breakpoints\n * - margin: Different margins at different breakpoints\n * - visibility: Show/hide at different breakpoints\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n cn,\n dimensionsValueToCSS,\n marginValueToCSS,\n paddingValueToCSS,\n borderValueToCSS,\n backgroundValueToCSS,\n responsiveValueToCSS,\n visibilityValueToCSS,\n type PaddingValue,\n type BorderValue,\n type DimensionsValue,\n type BackgroundValue,\n type AnimationValue,\n type ResponsiveValue,\n type VisibilityValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\n\n// Simple ID generator for server-side rendering\nlet idCounter = 0\nfunction generateUniqueId(): string {\n return `g${(++idCounter).toString(36)}${Math.random().toString(36).slice(2, 6)}`\n}\n\nexport interface GridProps {\n content: unknown\n numColumns: number\n gap: number\n // Background\n background: BackgroundValue | null\n // Advanced custom options\n customPadding: ResponsiveValue<PaddingValue> | PaddingValue | null\n dimensions: ResponsiveValue<DimensionsValue> | DimensionsValue | null\n border: BorderValue | null\n margin: ResponsiveValue<PaddingValue> | PaddingValue | null\n animation: AnimationValue | null\n // Responsive visibility\n visibility: VisibilityValue | null\n}\n\nconst defaultProps: GridProps = {\n content: [],\n numColumns: 3,\n gap: 24,\n background: null,\n customPadding: null,\n dimensions: null,\n border: null,\n margin: null,\n animation: null,\n visibility: null,\n}\n\nexport const GridConfig: ComponentConfig = {\n label: 'Grid',\n fields: {\n content: { type: 'slot' },\n },\n defaultProps,\n render: ({\n content: Content,\n numColumns,\n gap,\n background,\n customPadding,\n dimensions,\n border,\n margin,\n animation,\n visibility,\n }) => {\n // Generate unique IDs for CSS targeting (server-safe)\n const uniqueId = generateUniqueId()\n const wrapperClass = `puck-grid-${uniqueId}`\n const contentClass = `puck-grid-content-${uniqueId}`\n\n // Collect all media query CSS\n const mediaQueries: string[] = []\n\n // Generate styles from BackgroundValue\n const backgroundStyles = backgroundValueToCSS(background)\n\n // Build wrapper styles\n const wrapperStyles: React.CSSProperties = {\n ...backgroundStyles,\n }\n\n // Add padding with responsive support\n const paddingResult = responsiveValueToCSS(\n customPadding,\n (v) => ({ padding: paddingValueToCSS(v) }),\n wrapperClass\n )\n Object.assign(wrapperStyles, paddingResult.baseStyles)\n if (paddingResult.mediaQueryCSS) {\n mediaQueries.push(paddingResult.mediaQueryCSS)\n }\n\n // Add border if set\n const borderStyles = borderValueToCSS(border)\n if (borderStyles) {\n Object.assign(wrapperStyles, borderStyles)\n }\n\n // Add margin with responsive support\n const marginResult = responsiveValueToCSS(\n margin,\n (v) => ({ margin: marginValueToCSS(v) }),\n wrapperClass\n )\n Object.assign(wrapperStyles, marginResult.baseStyles)\n if (marginResult.mediaQueryCSS) {\n mediaQueries.push(marginResult.mediaQueryCSS)\n }\n\n // Use dimensions with responsive support\n const dimensionsResult = responsiveValueToCSS(\n dimensions,\n dimensionsValueToCSS,\n contentClass\n )\n\n // Visibility media queries\n const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass)\n if (visibilityCSS) {\n mediaQueries.push(visibilityCSS)\n }\n\n // Tailwind classes for responsive grid: flex column on mobile, grid on md+\n const contentClasses = cn(\n 'flex flex-col w-full',\n 'md:grid',\n contentClass,\n )\n\n // Dynamic styles that need inline (user-controlled values: gap, columns)\n const contentStyles: React.CSSProperties = {\n gap,\n ...dimensionsResult.baseStyles,\n }\n if (dimensionsResult.mediaQueryCSS) {\n mediaQueries.push(dimensionsResult.mediaQueryCSS)\n }\n\n // Grid template columns must be inline since numColumns is dynamic\n const gridStyles: React.CSSProperties = {\n ...contentStyles,\n '--grid-cols': numColumns,\n } as React.CSSProperties\n\n // Combine all media queries\n const allMediaQueryCSS = mediaQueries.join('\\n')\n\n // Type assertion for Puck slot content - cast to any to avoid complex React type issues\n const ContentSlot = Content as any\n\n return (\n <AnimatedWrapper animation={animation}>\n {allMediaQueryCSS && <style>{allMediaQueryCSS}</style>}\n <div className={wrapperClass} style={wrapperStyles}>\n <ContentSlot className={contentClasses} style={gridStyles} />\n <style>{`\n @media (min-width: 768px) {\n .flex.md\\\\:grid {\n grid-template-columns: repeat(var(--grid-cols), 1fr);\n }\n }\n `}</style>\n </div>\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * Section Component - Server-safe Puck Configuration\n *\n * Full-width section with background options and content slot.\n * Used as a top-level page section wrapper.\n * Uses Tailwind classes for layout, inline styles for dynamic user values.\n *\n * This is a server-safe version with NO fields property.\n * For the full editor version with fields, use Section.tsx\n *\n * Responsive Controls:\n * - dimensions: Different dimensions at different breakpoints\n * - customPadding: Different padding at different breakpoints\n * - margin: Different margins at different breakpoints\n * - visibility: Show/hide at different breakpoints\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n cn,\n dimensionsValueToCSS,\n marginValueToCSS,\n paddingValueToCSS,\n borderValueToCSS,\n backgroundValueToCSS,\n responsiveValueToCSS,\n visibilityValueToCSS,\n type PaddingValue,\n type BorderValue,\n type DimensionsValue,\n type BackgroundValue,\n type AnimationValue,\n type ResponsiveValue,\n type VisibilityValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\n\n// Simple ID generator for server-side rendering\nlet idCounter = 0\nfunction generateUniqueId(): string {\n return `s${(++idCounter).toString(36)}${Math.random().toString(36).slice(2, 6)}`\n}\n\nexport interface SectionProps {\n id: string\n content: unknown\n // Background\n background: BackgroundValue | null\n fullWidth: boolean\n // Advanced custom options\n customPadding: ResponsiveValue<PaddingValue> | PaddingValue | null\n dimensions: ResponsiveValue<DimensionsValue> | DimensionsValue | null\n border: BorderValue | null\n margin: ResponsiveValue<PaddingValue> | PaddingValue | null\n animation: AnimationValue | null\n // Responsive visibility\n visibility: VisibilityValue | null\n}\n\nconst defaultProps: SectionProps = {\n id: '',\n content: [],\n background: null,\n fullWidth: false,\n customPadding: null,\n dimensions: null,\n border: null,\n margin: null,\n animation: null,\n visibility: null,\n}\n\nexport const SectionConfig: ComponentConfig = {\n label: 'Section',\n fields: {\n content: { type: 'slot' },\n },\n defaultProps,\n render: ({\n id,\n content: Content,\n background,\n fullWidth,\n customPadding,\n dimensions,\n border,\n margin,\n animation,\n visibility,\n }) => {\n // Generate unique IDs for CSS targeting (server-safe)\n const uniqueId = generateUniqueId()\n const sectionClass = `puck-section-${uniqueId}`\n const contentClass = `puck-section-content-${uniqueId}`\n\n // Collect all media query CSS\n const mediaQueries: string[] = []\n\n // Generate styles from BackgroundValue\n const backgroundStyles = backgroundValueToCSS(background)\n\n // Build section styles\n const sectionStyles: React.CSSProperties = {\n ...backgroundStyles,\n }\n\n // Add padding with responsive support\n const paddingResult = responsiveValueToCSS(\n customPadding,\n (v) => ({ padding: paddingValueToCSS(v) }),\n sectionClass\n )\n Object.assign(sectionStyles, paddingResult.baseStyles)\n if (paddingResult.mediaQueryCSS) {\n mediaQueries.push(paddingResult.mediaQueryCSS)\n }\n\n // Add border if set\n const borderStyles = borderValueToCSS(border)\n if (borderStyles) {\n Object.assign(sectionStyles, borderStyles)\n }\n\n // Add margin with responsive support\n const marginResult = responsiveValueToCSS(\n margin,\n (v) => ({ margin: marginValueToCSS(v) }),\n sectionClass\n )\n Object.assign(sectionStyles, marginResult.baseStyles)\n if (marginResult.mediaQueryCSS) {\n mediaQueries.push(marginResult.mediaQueryCSS)\n }\n\n // Visibility media queries\n const visibilityCSS = visibilityValueToCSS(visibility, sectionClass)\n if (visibilityCSS) {\n mediaQueries.push(visibilityCSS)\n }\n\n const sectionClasses = cn('relative w-full', sectionClass)\n\n // Use dimensions with responsive support\n const dimensionsResult = responsiveValueToCSS(\n dimensions,\n dimensionsValueToCSS,\n contentClass\n )\n if (dimensionsResult.mediaQueryCSS) {\n mediaQueries.push(dimensionsResult.mediaQueryCSS)\n }\n\n const contentClasses = cn(\n 'relative z-10',\n // Only apply preset content width if no dimensions set\n !dimensions && !fullWidth && 'max-w-[1200px] mx-auto px-4',\n contentClass,\n )\n\n // Combine all media queries\n const allMediaQueryCSS = mediaQueries.join('\\n')\n\n // Type assertion for Puck slot content - cast to any to avoid complex React type issues\n const ContentSlot = Content as any\n\n return (\n <AnimatedWrapper animation={animation}>\n {allMediaQueryCSS && <style>{allMediaQueryCSS}</style>}\n <section\n id={id || undefined}\n className={sectionClasses}\n style={sectionStyles}\n >\n <ContentSlot className={contentClasses} style={dimensionsResult.baseStyles} />\n </section>\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * Spacer Component - Server-safe Puck Configuration\n *\n * Simple spacing component for adding vertical or horizontal space.\n * Uses Tailwind classes for layout and sizing from predefined options.\n *\n * This is a server-safe version with NO fields property.\n * For the full editor version with fields, use Spacer.tsx\n *\n * Responsive Controls:\n * - visibility: Show/hide at different breakpoints\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport { cn, visibilityValueToCSS, type VisibilityValue } from '../../fields/shared'\n\n// Simple ID generator for server-side rendering\nlet idCounter = 0\nfunction generateUniqueId(): string {\n return `sp${(++idCounter).toString(36)}${Math.random().toString(36).slice(2, 6)}`\n}\n\n// Tailwind height classes for predefined spacing options\nconst heightMap: Record<string, string> = {\n '8px': 'h-2',\n '16px': 'h-4',\n '24px': 'h-6',\n '32px': 'h-8',\n '48px': 'h-12',\n '64px': 'h-16',\n '80px': 'h-20',\n '96px': 'h-24',\n '128px': 'h-32',\n}\n\n// Tailwind width classes for predefined spacing options\nconst widthMap: Record<string, string> = {\n '8px': 'w-2',\n '16px': 'w-4',\n '24px': 'w-6',\n '32px': 'w-8',\n '48px': 'w-12',\n '64px': 'w-16',\n '80px': 'w-20',\n '96px': 'w-24',\n '128px': 'w-32',\n}\n\nexport interface SpacerProps {\n size: string\n direction: 'vertical' | 'horizontal' | 'both'\n visibility: VisibilityValue | null\n}\n\nconst defaultProps: SpacerProps = {\n size: '24px',\n direction: 'vertical',\n visibility: null,\n}\n\nexport const SpacerConfig: ComponentConfig<SpacerProps> = {\n label: 'Spacer',\n defaultProps,\n render: ({ size, direction, visibility }) => {\n // Generate unique ID for CSS targeting (server-safe)\n const uniqueId = generateUniqueId()\n const wrapperClass = `puck-spacer-${uniqueId}`\n\n // Visibility media queries\n const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass)\n\n const getClasses = (): string => {\n const heightClass = heightMap[size] || 'h-6'\n const widthClass = widthMap[size] || 'w-6'\n\n if (direction === 'vertical') {\n return `block ${heightClass} w-full`\n }\n if (direction === 'horizontal') {\n return `inline-block ${widthClass} h-full`\n }\n // both\n return `block ${heightClass} ${widthClass}`\n }\n\n return (\n <>\n {visibilityCSS && <style>{visibilityCSS}</style>}\n <div className={cn(getClasses(), wrapperClass)} aria-hidden=\"true\" />\n </>\n )\n },\n}\n","/**\n * Template Component - Server-safe Configuration\n *\n * A reusable template container for rendering nested components.\n * This server-safe version excludes the TemplateField (which requires client-side APIs).\n *\n * For the full editor experience with template loading, use Template.tsx\n *\n * Responsive Controls:\n * - dimensions: Different dimensions at different breakpoints\n * - customPadding: Different padding at different breakpoints\n * - margin: Different margins at different breakpoints\n * - visibility: Show/hide at different breakpoints\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n cn,\n dimensionsValueToCSS,\n marginValueToCSS,\n paddingValueToCSS,\n responsiveValueToCSS,\n visibilityValueToCSS,\n type PaddingValue,\n type DimensionsValue,\n type ResponsiveValue,\n type VisibilityValue,\n} from '../../fields/shared'\n\n// Simple ID generator for server-side rendering\nlet idCounter = 0\nfunction generateUniqueId(): string {\n return `t${(++idCounter).toString(36)}${Math.random().toString(36).slice(2, 6)}`\n}\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport interface TemplateProps {\n /** Slot for nested components */\n content: unknown\n /** ID of the currently loaded template (for tracking only) */\n templateId: string | null\n /** Responsive dimensions */\n dimensions: ResponsiveValue<DimensionsValue> | DimensionsValue | null\n /** Responsive padding */\n customPadding: ResponsiveValue<PaddingValue> | PaddingValue | null\n /** Responsive margin */\n margin: ResponsiveValue<PaddingValue> | PaddingValue | null\n /** Responsive visibility */\n visibility: VisibilityValue | null\n}\n\n// =============================================================================\n// Default Props\n// =============================================================================\n\nconst defaultProps: TemplateProps = {\n content: [],\n templateId: null,\n dimensions: null,\n customPadding: null,\n margin: null,\n visibility: null,\n}\n\n// =============================================================================\n// Component Configuration (Server-safe)\n// =============================================================================\n\nexport const TemplateServerConfig: ComponentConfig = {\n label: 'Template',\n fields: {\n // In server config, templateId is just for reference (no loading UI)\n templateId: {\n type: 'text',\n label: 'Template ID',\n },\n content: {\n type: 'slot',\n },\n },\n defaultProps,\n render: ({ content: Content, dimensions, customPadding, margin, visibility }) => {\n // Generate unique IDs for CSS targeting (server-safe)\n const uniqueId = generateUniqueId()\n const wrapperClass = `puck-template-${uniqueId}`\n const contentClass = `puck-template-content-${uniqueId}`\n\n // Collect all media query CSS\n const mediaQueries: string[] = []\n\n // Build wrapper styles\n const wrapperStyles: React.CSSProperties = {}\n\n // Add padding with responsive support\n const paddingResult = responsiveValueToCSS(\n customPadding,\n (v) => ({ padding: paddingValueToCSS(v) }),\n wrapperClass\n )\n Object.assign(wrapperStyles, paddingResult.baseStyles)\n if (paddingResult.mediaQueryCSS) {\n mediaQueries.push(paddingResult.mediaQueryCSS)\n }\n\n // Add margin with responsive support\n const marginResult = responsiveValueToCSS(\n margin,\n (v) => ({ margin: marginValueToCSS(v) }),\n wrapperClass\n )\n Object.assign(wrapperStyles, marginResult.baseStyles)\n if (marginResult.mediaQueryCSS) {\n mediaQueries.push(marginResult.mediaQueryCSS)\n }\n\n // Visibility media queries\n const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass)\n if (visibilityCSS) {\n mediaQueries.push(visibilityCSS)\n }\n\n // Use dimensions with responsive support\n const dimensionsResult = responsiveValueToCSS(\n dimensions,\n dimensionsValueToCSS,\n contentClass\n )\n if (dimensionsResult.mediaQueryCSS) {\n mediaQueries.push(dimensionsResult.mediaQueryCSS)\n }\n\n // Combine all media queries\n const allMediaQueryCSS = mediaQueries.join('\\n')\n\n // Type assertion for Puck slot content\n const ContentSlot = Content as any\n\n // Content is a slot component that Puck provides\n // It renders all the nested components within this template\n return (\n <>\n {allMediaQueryCSS && <style>{allMediaQueryCSS}</style>}\n <div\n className={cn('template-wrapper', wrapperClass)}\n style={Object.keys(wrapperStyles).length > 0 ? wrapperStyles : undefined}\n >\n <ContentSlot className={contentClass} style={dimensionsResult.baseStyles} />\n </div>\n </>\n )\n },\n}\n","/**\n * Heading Component - Server-Safe Puck Configuration\n *\n * H1-H6 headings with customizable styling.\n * This version excludes field definitions for server-side rendering.\n */\n\nimport { createElement } from 'react'\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n headingLevelMap,\n alignmentMap,\n cn,\n marginValueToCSS,\n paddingValueToCSS,\n colorValueToCSS,\n dimensionsValueToCSS,\n type PaddingValue,\n type ColorValue,\n type DimensionsValue,\n type AnimationValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\nimport type { Alignment } from '../../fields/AlignmentField'\n\nexport interface HeadingProps {\n text: string\n level: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n alignment: Alignment | null\n textColor: ColorValue | null\n dimensions: DimensionsValue | null\n animation: AnimationValue | null\n margin: PaddingValue | null\n customPadding: PaddingValue | null\n}\n\nconst defaultProps: HeadingProps = {\n text: 'Heading Text',\n level: 'h2',\n alignment: null,\n textColor: null,\n dimensions: null,\n animation: null,\n margin: null,\n customPadding: null,\n}\n\nexport const HeadingConfig: ComponentConfig<HeadingProps> = {\n label: 'Heading',\n defaultProps,\n render: ({ text, level, alignment, textColor, dimensions, animation, margin, customPadding }) => {\n const tag = level || 'h2'\n const alignmentValue = alignment ?? 'left'\n const classes = cn(\n headingLevelMap[level] || headingLevelMap.h2,\n alignmentMap[alignmentValue] || alignmentMap.left\n )\n\n const dimensionsStyles = dimensions ? dimensionsValueToCSS(dimensions) : undefined\n\n const style: React.CSSProperties = {\n ...dimensionsStyles,\n }\n const marginCSS = marginValueToCSS(margin)\n if (marginCSS) {\n style.margin = marginCSS\n }\n const paddingCSS = paddingValueToCSS(customPadding)\n if (paddingCSS) {\n style.padding = paddingCSS\n }\n // Apply text color from ColorValue\n const colorCSS = colorValueToCSS(textColor)\n if (colorCSS) {\n style.color = colorCSS\n }\n\n const headingElement = createElement(tag, { className: classes, style: Object.keys(style).length > 0 ? style : undefined }, text)\n\n return (\n <AnimatedWrapper animation={animation}>\n {headingElement}\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * Text Component - Server-Safe Puck Configuration\n *\n * Simple paragraph text with customizable styling.\n * This version excludes field definitions for server-side rendering.\n */\n\nimport type React from 'react'\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n textSizeMap,\n alignmentMap,\n cn,\n marginValueToCSS,\n paddingValueToCSS,\n colorValueToCSS,\n dimensionsValueToCSS,\n type PaddingValue,\n type ColorValue,\n type DimensionsValue,\n type AnimationValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\nimport type { Alignment } from '../../fields/AlignmentField'\n\nexport interface TextProps {\n content: string\n size: string\n alignment: Alignment | null\n textColor: ColorValue | null\n dimensions: DimensionsValue | null\n animation: AnimationValue | null\n margin: PaddingValue | null\n customPadding: PaddingValue | null\n}\n\nconst defaultProps: TextProps = {\n content: 'Enter your text here...',\n size: 'base',\n alignment: null,\n textColor: null,\n dimensions: null,\n animation: null,\n margin: null,\n customPadding: null,\n}\n\nexport const TextConfig: ComponentConfig<TextProps> = {\n label: 'Text',\n defaultProps,\n render: ({ content, size, alignment, textColor, dimensions, animation, margin, customPadding }) => {\n const dimensionsStyles = dimensions ? dimensionsValueToCSS(dimensions) : undefined\n\n const style: React.CSSProperties = {\n ...dimensionsStyles,\n }\n const marginCSS = marginValueToCSS(margin)\n if (marginCSS) {\n style.margin = marginCSS\n }\n const paddingCSS = paddingValueToCSS(customPadding)\n if (paddingCSS) {\n style.padding = paddingCSS\n }\n // Apply text color from ColorValue\n const colorCSS = colorValueToCSS(textColor)\n if (colorCSS) {\n style.color = colorCSS\n }\n\n const alignmentValue = alignment ?? 'left'\n\n return (\n <AnimatedWrapper animation={animation}>\n <p\n className={cn(\n textSizeMap[size] || textSizeMap.base,\n alignmentMap[alignmentValue] || alignmentMap.left\n )}\n style={Object.keys(style).length > 0 ? style : undefined}\n >\n {content}\n </p>\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * RichText Component - Server-Safe Puck Configuration\n *\n * Rich text content with customizable styling.\n * This version excludes field definitions for server-side rendering.\n *\n * Requires @tailwindcss/typography - uses the `prose` class for styling.\n */\n\nimport type React from 'react'\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n cn,\n marginValueToCSS,\n paddingValueToCSS,\n dimensionsValueToCSS,\n colorValueToCSS,\n alignmentMap,\n type PaddingValue,\n type DimensionsValue,\n type ColorValue,\n type AnimationValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\nimport type { Alignment } from '../../fields/AlignmentField'\n\nexport interface RichTextProps {\n content: string\n alignment: Alignment | null\n textColor: ColorValue | null\n dimensions: DimensionsValue | null\n animation: AnimationValue | null\n margin: PaddingValue | null\n customPadding: PaddingValue | null\n}\n\nconst defaultProps: RichTextProps = {\n content: '<p>Enter your content here...</p>',\n alignment: null,\n textColor: null,\n dimensions: null,\n animation: null,\n margin: null,\n customPadding: null,\n}\n\nexport const RichTextConfig: ComponentConfig<RichTextProps> = {\n label: 'Rich Text',\n defaultProps,\n render: ({ content, alignment, textColor, dimensions, animation, margin, customPadding }) => {\n const dimensionsStyles = dimensions ? dimensionsValueToCSS(dimensions) : undefined\n\n const style: React.CSSProperties = {\n ...dimensionsStyles,\n }\n const marginCSS = marginValueToCSS(margin)\n if (marginCSS) {\n style.margin = marginCSS\n }\n const customPaddingCSS = paddingValueToCSS(customPadding)\n if (customPaddingCSS) {\n style.padding = customPaddingCSS\n }\n // Apply text color from ColorValue\n const colorCSS = colorValueToCSS(textColor)\n if (colorCSS) {\n style.color = colorCSS\n }\n\n const alignmentValue = alignment ?? 'left'\n const alignmentClass = alignmentMap[alignmentValue] || alignmentMap.left\n\n // Handle empty content\n if (!content || content === '<p></p>') {\n return (\n <AnimatedWrapper animation={animation}>\n <section className={cn('relative overflow-hidden px-4', alignmentClass)} style={Object.keys(style).length > 0 ? style : undefined}>\n <div className=\"prose dark:prose-invert\">\n <p><em>No content available</em></p>\n </div>\n </section>\n </AnimatedWrapper>\n )\n }\n\n return (\n <AnimatedWrapper animation={animation}>\n <section className={cn('relative overflow-hidden px-4', alignmentClass)} style={Object.keys(style).length > 0 ? style : undefined}>\n <div\n className=\"prose dark:prose-invert\"\n dangerouslySetInnerHTML={{ __html: content }}\n />\n </section>\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * Image Component - Server-safe Puck Configuration\n *\n * Standalone image block with optional link wrapper.\n * This version contains only the render function and types - no fields.\n * Safe for use in server components.\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n aspectRatioMap,\n cn,\n marginValueToCSS,\n paddingValueToCSS,\n dimensionsValueToCSS,\n borderValueToCSS,\n transformValueToCSS,\n visibilityValueToCSS,\n type PaddingValue,\n type DimensionsValue,\n type BorderValue,\n type AnimationValue,\n type TransformValue,\n type VisibilityValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\nimport type { MediaReference } from '../../fields/MediaField'\nimport type { Alignment } from '../../fields/AlignmentField'\n\n// Simple ID generator for server-side rendering\nlet idCounter = 0\nfunction generateUniqueId(): string {\n return `i${(++idCounter).toString(36)}${Math.random().toString(36).slice(2, 6)}`\n}\n\nexport interface ImageProps {\n image: MediaReference | null\n alt: string\n aspectRatio: string\n link: string\n openInNewTab: boolean\n margin: PaddingValue | null\n border: BorderValue | null\n dimensions: DimensionsValue | null\n alignment: Alignment | null\n transform: TransformValue | null\n animation: AnimationValue | null\n customPadding: PaddingValue | null\n visibility: VisibilityValue | null\n}\n\nconst defaultProps: ImageProps = {\n image: null,\n alt: '',\n aspectRatio: 'auto',\n link: '',\n openInNewTab: false,\n margin: null,\n border: null,\n dimensions: null,\n alignment: null,\n transform: null,\n animation: null,\n customPadding: null,\n visibility: null,\n}\n\nexport const ImageConfig: ComponentConfig<ImageProps> = {\n label: 'Image',\n defaultProps,\n render: ({ image, alt, aspectRatio, link, openInNewTab, dimensions, alignment, margin, border, transform, animation, customPadding, visibility }) => {\n // Generate unique ID for CSS targeting (server-safe)\n const uniqueId = generateUniqueId()\n const wrapperClass = `puck-image-${uniqueId}`\n\n // Visibility media queries\n const visibilityCSS = visibilityValueToCSS(visibility, wrapperClass)\n const dimensionsStyles = dimensionsValueToCSS(dimensions)\n\n const style: React.CSSProperties = {\n ...dimensionsStyles,\n }\n const marginCSS = marginValueToCSS(margin)\n if (marginCSS) {\n style.margin = marginCSS\n }\n const paddingCSS = paddingValueToCSS(customPadding)\n if (paddingCSS) {\n style.padding = paddingCSS\n }\n const borderStyles = borderValueToCSS(border)\n if (borderStyles) {\n Object.assign(style, borderStyles)\n }\n const transformStyles = transformValueToCSS(transform)\n if (transformStyles) {\n Object.assign(style, transformStyles)\n }\n\n const alignmentValue = alignment ?? 'center'\n const alignmentClasses = cn(\n 'flex',\n alignmentValue === 'left' && 'justify-start',\n alignmentValue === 'center' && 'justify-center',\n alignmentValue === 'right' && 'justify-end'\n )\n\n // Placeholder if no image\n if (!image?.url) {\n return (\n <AnimatedWrapper animation={animation}>\n {visibilityCSS && <style>{visibilityCSS}</style>}\n <div className={cn('py-4 px-4', wrapperClass)} style={Object.keys(style).length > 0 ? style : undefined}>\n <div className={alignmentClasses}>\n <div\n className={cn(\n 'relative overflow-hidden rounded-lg w-full max-w-md bg-muted flex items-center justify-center min-h-[200px]',\n aspectRatioMap[aspectRatio] || ''\n )}\n >\n <span className=\"text-muted-foreground\">No image selected</span>\n </div>\n </div>\n </div>\n </AnimatedWrapper>\n )\n }\n\n // For auto aspect ratio, use natural image dimensions\n // For fixed aspect ratios, use absolute positioning within aspect-ratio container\n // Note: When using aspect ratios in Flex, set a min-width via Dimensions\n const imageElement = aspectRatio === 'auto' ? (\n <div className=\"relative overflow-hidden rounded-lg w-full\">\n {/* eslint-disable-next-line @next/next/no-img-element */}\n <img\n src={image.url}\n alt={alt || image.alt || ''}\n className=\"w-full h-auto object-cover\"\n />\n </div>\n ) : (\n <div className={cn('relative overflow-hidden rounded-lg w-full', aspectRatioMap[aspectRatio])}>\n {/* eslint-disable-next-line @next/next/no-img-element */}\n <img\n src={image.url}\n alt={alt || image.alt || ''}\n className=\"absolute inset-0 w-full h-full object-cover\"\n />\n </div>\n )\n\n const content = link ? (\n <a\n href={link}\n target={openInNewTab ? '_blank' : undefined}\n rel={openInNewTab ? 'noopener noreferrer' : undefined}\n className=\"block transition-opacity hover:opacity-90\"\n >\n {imageElement}\n </a>\n ) : (\n imageElement\n )\n\n return (\n <AnimatedWrapper animation={animation}>\n {visibilityCSS && <style>{visibilityCSS}</style>}\n <div className={cn('py-4 px-4', wrapperClass)} style={Object.keys(style).length > 0 ? style : undefined}>\n <div className={alignmentClasses}>{content}</div>\n </div>\n </AnimatedWrapper>\n )\n },\n}\n","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-8 px-3 text-xs\",\n lg: \"h-11 px-8\",\n icon: \"h-10 w-10 p-2\",\n \"icon-sm\": \"h-8 w-8 p-1.5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport { cn } from \"../../lib/utils\"\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/utils\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n","'use client'\n\n/**\n * SizeField - Custom Puck field for button/element sizing\n *\n * Provides preset size options (sm, default, lg) with a \"custom\" mode\n * that reveals detailed controls for height, padding, and font size.\n */\n\nimport React, { useCallback, memo } from 'react'\nimport type { CustomField } from '@measured/puck'\nimport { X } from 'lucide-react'\nimport { Button } from '../components/ui/button'\nimport { Input } from '../components/ui/input'\nimport { Label } from '../components/ui/label'\nimport { cn } from '../lib/utils'\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport type SizeMode = 'sm' | 'default' | 'lg' | 'custom'\nexport type SizeUnit = 'px' | 'rem'\n\nexport interface SizeValue {\n mode: SizeMode\n /** Height in units (only used when mode === 'custom') */\n height?: number\n /** Horizontal padding in units (only used when mode === 'custom') */\n paddingX?: number\n /** Vertical padding in units (only used when mode === 'custom') */\n paddingY?: number\n /** Font size in units (only used when mode === 'custom') */\n fontSize?: number\n /** Unit for all values */\n unit?: SizeUnit\n}\n\ninterface SizeFieldProps {\n value: SizeValue | null\n onChange: (value: SizeValue | null) => void\n label?: string\n readOnly?: boolean\n /** Show height input (default: true) */\n showHeight?: boolean\n /** Show font size input (default: true) */\n showFontSize?: boolean\n}\n\n// =============================================================================\n// Default Values\n// =============================================================================\n\nconst DEFAULT_VALUE: SizeValue = {\n mode: 'default',\n}\n\nconst CUSTOM_DEFAULTS: Required<Omit<SizeValue, 'mode'>> = {\n height: 40,\n paddingX: 16,\n paddingY: 8,\n fontSize: 14,\n unit: 'px',\n}\n\n// =============================================================================\n// SizeField Component\n// =============================================================================\n\nfunction SizeFieldInner({\n value,\n onChange,\n label = 'Size',\n readOnly,\n showHeight = true,\n showFontSize = true,\n}: SizeFieldProps) {\n const currentValue = value || DEFAULT_VALUE\n\n // Handle mode change\n const handleModeChange = useCallback((mode: SizeMode) => {\n if (mode === 'custom') {\n // Initialize custom values when switching to custom\n onChange({\n mode,\n ...CUSTOM_DEFAULTS,\n })\n } else {\n onChange({ mode })\n }\n }, [onChange])\n\n // Handle numeric value changes\n const handleValueChange = useCallback((\n field: 'height' | 'paddingX' | 'paddingY' | 'fontSize',\n val: number\n ) => {\n onChange({\n ...currentValue,\n [field]: val,\n })\n }, [currentValue, onChange])\n\n // Handle unit change\n const handleUnitChange = useCallback((unit: SizeUnit) => {\n onChange({\n ...currentValue,\n unit,\n })\n }, [currentValue, onChange])\n\n // Handle clear\n const handleClear = useCallback(() => {\n onChange(null)\n }, [onChange])\n\n const presets = [\n { mode: 'sm' as SizeMode, label: 'SM' },\n { mode: 'default' as SizeMode, label: 'Default' },\n { mode: 'lg' as SizeMode, label: 'LG' },\n { mode: 'custom' as SizeMode, label: 'Custom' },\n ]\n\n return (\n <div className=\"puck-field space-y-3\">\n {/* Header with label and clear */}\n <div className=\"flex items-center justify-between\">\n <Label className=\"text-sm font-medium text-foreground\">\n {label}\n </Label>\n {value && !readOnly && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={handleClear}\n className=\"text-muted-foreground hover:text-destructive\"\n title=\"Reset to default\"\n >\n <X className=\"h-4 w-4\" />\n </Button>\n )}\n </div>\n\n {/* Size mode selector */}\n <div className=\"flex flex-wrap gap-1\">\n {presets.map(({ mode, label: modeLabel }) => {\n const isActive = currentValue.mode === mode\n return (\n <Button\n key={mode}\n type=\"button\"\n variant={isActive ? 'default' : 'secondary'}\n size=\"sm\"\n onClick={() => handleModeChange(mode)}\n disabled={readOnly}\n className={cn(\n \"text-xs\",\n isActive && \"bg-primary hover:bg-primary/90\"\n )}\n >\n {modeLabel}\n </Button>\n )\n })}\n </div>\n\n {/* Custom size controls */}\n {currentValue.mode === 'custom' && (\n <div className=\"space-y-3 p-3 bg-muted/50 rounded-md\">\n {/* Unit selector */}\n <div className=\"flex items-center gap-2\">\n <Label className=\"text-[10px] uppercase tracking-wide text-muted-foreground flex-shrink-0\">\n Unit:\n </Label>\n <div className=\"flex gap-1\">\n {(['px', 'rem'] as SizeUnit[]).map((unit) => {\n const isActive = (currentValue.unit || 'px') === unit\n return (\n <Button\n key={unit}\n type=\"button\"\n variant={isActive ? 'default' : 'outline'}\n size=\"sm\"\n onClick={() => handleUnitChange(unit)}\n disabled={readOnly}\n className={cn(\n \"text-xs font-mono h-7 px-2\",\n isActive && \"bg-primary hover:bg-primary/90\"\n )}\n >\n {unit}\n </Button>\n )\n })}\n </div>\n </div>\n\n {/* Numeric inputs */}\n <div className=\"grid grid-cols-2 gap-2\">\n {showHeight && (\n <div className=\"space-y-1\">\n <Label className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">\n Height\n </Label>\n <Input\n type=\"number\"\n min={0}\n value={currentValue.height ?? CUSTOM_DEFAULTS.height}\n onChange={(e) => handleValueChange('height', parseInt(e.target.value, 10) || 0)}\n disabled={readOnly}\n className=\"h-8 text-sm font-mono\"\n />\n </div>\n )}\n\n {showFontSize && (\n <div className=\"space-y-1\">\n <Label className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">\n Font Size\n </Label>\n <Input\n type=\"number\"\n min={0}\n value={currentValue.fontSize ?? CUSTOM_DEFAULTS.fontSize}\n onChange={(e) => handleValueChange('fontSize', parseInt(e.target.value, 10) || 0)}\n disabled={readOnly}\n className=\"h-8 text-sm font-mono\"\n />\n </div>\n )}\n\n <div className=\"space-y-1\">\n <Label className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">\n Padding X\n </Label>\n <Input\n type=\"number\"\n min={0}\n value={currentValue.paddingX ?? CUSTOM_DEFAULTS.paddingX}\n onChange={(e) => handleValueChange('paddingX', parseInt(e.target.value, 10) || 0)}\n disabled={readOnly}\n className=\"h-8 text-sm font-mono\"\n />\n </div>\n\n <div className=\"space-y-1\">\n <Label className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">\n Padding Y\n </Label>\n <Input\n type=\"number\"\n min={0}\n value={currentValue.paddingY ?? CUSTOM_DEFAULTS.paddingY}\n onChange={(e) => handleValueChange('paddingY', parseInt(e.target.value, 10) || 0)}\n disabled={readOnly}\n className=\"h-8 text-sm font-mono\"\n />\n </div>\n </div>\n\n {/* Preview summary */}\n <div className=\"text-xs text-muted-foreground font-mono pt-1 border-t border-border/50\">\n {showHeight && `h: ${currentValue.height ?? CUSTOM_DEFAULTS.height}${currentValue.unit || 'px'}`}\n {showHeight && ' | '}\n {`p: ${currentValue.paddingY ?? CUSTOM_DEFAULTS.paddingY}${currentValue.unit || 'px'} ${currentValue.paddingX ?? CUSTOM_DEFAULTS.paddingX}${currentValue.unit || 'px'}`}\n {showFontSize && ` | font: ${currentValue.fontSize ?? CUSTOM_DEFAULTS.fontSize}${currentValue.unit || 'px'}`}\n </div>\n </div>\n )}\n </div>\n )\n}\n\nexport const SizeField = memo(SizeFieldInner)\n\n// =============================================================================\n// CSS Helper\n// =============================================================================\n\n/**\n * Convert SizeValue to CSS properties object\n *\n * For preset modes, returns undefined (use Tailwind classes instead)\n * For custom mode, returns inline styles\n */\nexport function sizeValueToCSS(size: SizeValue | null | undefined): React.CSSProperties | undefined {\n if (!size || size.mode !== 'custom') return undefined\n\n const unit = size.unit || 'px'\n const style: React.CSSProperties = {}\n\n if (size.height != null) {\n style.height = `${size.height}${unit}`\n }\n\n if (size.paddingX != null || size.paddingY != null) {\n const py = size.paddingY ?? 0\n const px = size.paddingX ?? 0\n style.padding = `${py}${unit} ${px}${unit}`\n }\n\n if (size.fontSize != null) {\n style.fontSize = `${size.fontSize}${unit}`\n }\n\n return Object.keys(style).length > 0 ? style : undefined\n}\n\n/**\n * Get Tailwind classes for preset size modes\n * Returns empty string for custom mode (use inline styles instead)\n */\nexport function getSizeClasses(size: SizeValue | null | undefined, sizeMap: Record<string, string>): string {\n if (!size) return sizeMap.default || ''\n if (size.mode === 'custom') return ''\n return sizeMap[size.mode] || sizeMap.default || ''\n}\n\n// =============================================================================\n// Field Configuration Factory\n// =============================================================================\n\ninterface CreateSizeFieldConfig {\n label?: string\n showHeight?: boolean\n showFontSize?: boolean\n}\n\n/**\n * Creates a Puck field configuration for size control\n *\n * @example\n * ```ts\n * fields: {\n * size: createSizeField({ label: 'Button Size' }),\n * }\n * ```\n */\nexport function createSizeField(\n config: CreateSizeFieldConfig = {}\n): CustomField<SizeValue | null> {\n return {\n type: 'custom',\n label: config.label,\n render: ({ value, onChange, readOnly }) => (\n <SizeField\n value={value}\n onChange={onChange}\n label={config.label}\n readOnly={readOnly}\n showHeight={config.showHeight}\n showFontSize={config.showFontSize}\n />\n ),\n }\n}\n","/**\n * Default Theme Values\n *\n * These defaults ensure backwards compatibility - components render\n * identically to before theming was introduced when no theme is provided.\n */\n\nimport type {\n ButtonVariantStyles,\n BackgroundStyles,\n ColorPreset,\n ResolvedTheme,\n} from './types'\n\n/**\n * Default button variant styles\n * Uses semantic Tailwind classes that map to CSS variables (--primary, --secondary, etc.)\n * This allows consuming apps to customize colors via their theme CSS variables.\n */\nexport const DEFAULT_BUTTON_VARIANTS: ButtonVariantStyles = {\n default: { classes: 'bg-primary text-primary-foreground hover:bg-primary/90' },\n secondary: { classes: 'bg-secondary text-secondary-foreground hover:bg-secondary/80' },\n outline: { classes: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground' },\n ghost: { classes: 'bg-transparent hover:bg-accent hover:text-accent-foreground' },\n destructive: { classes: 'bg-destructive text-destructive-foreground hover:bg-destructive/90' },\n link: { classes: 'text-primary underline-offset-4 hover:underline bg-transparent' },\n}\n\n/**\n * Default CTA button variant styles\n * Uses semantic Tailwind classes that map to CSS variables.\n */\nexport const DEFAULT_CTA_BUTTON_VARIANTS: ButtonVariantStyles = {\n primary: { classes: 'bg-primary text-primary-foreground hover:bg-primary/90' },\n secondary: { classes: 'bg-secondary text-secondary-foreground hover:bg-secondary/80' },\n outline: { classes: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground' },\n ghost: { classes: 'bg-transparent hover:bg-accent hover:text-accent-foreground' },\n link: { classes: 'text-primary underline-offset-4 hover:underline bg-transparent' },\n}\n\n/**\n * Default CTA background styles\n * Uses semantic Tailwind classes that map to CSS variables.\n */\nexport const DEFAULT_CTA_BACKGROUND_STYLES: BackgroundStyles = {\n default: 'bg-muted',\n dark: 'bg-foreground text-background',\n light: 'bg-background',\n}\n\n/**\n * Default color picker presets\n * Matches DEFAULT_PRESETS from ColorPickerField.tsx\n */\nexport const DEFAULT_COLOR_PRESETS: ColorPreset[] = [\n { hex: '#ffffff', label: 'White' },\n { hex: '#f9fafb', label: 'Gray 50' },\n { hex: '#f3f4f6', label: 'Gray 100' },\n { hex: '#1f2937', label: 'Gray 800' },\n { hex: '#111827', label: 'Gray 900' },\n { hex: '#000000', label: 'Black' },\n { hex: '#3b82f6', label: 'Blue' },\n { hex: '#10b981', label: 'Green' },\n { hex: '#f59e0b', label: 'Amber' },\n { hex: '#ef4444', label: 'Red' },\n]\n\n/**\n * Default focus ring color class\n * Uses semantic ring color from CSS variables\n */\nexport const DEFAULT_FOCUS_RING = 'focus:ring-ring'\n\n/**\n * Complete default theme\n * Used when no ThemeProvider is present or no theme config is provided\n */\nexport const DEFAULT_THEME: ResolvedTheme = {\n buttonVariants: DEFAULT_BUTTON_VARIANTS,\n ctaButtonVariants: DEFAULT_CTA_BUTTON_VARIANTS,\n ctaBackgroundStyles: DEFAULT_CTA_BACKGROUND_STYLES,\n colorPresets: DEFAULT_COLOR_PRESETS,\n focusRingColor: DEFAULT_FOCUS_RING,\n}\n","/**\n * Theme Resolution Utilities\n *\n * Functions for merging user-provided theme config with defaults\n * and safely accessing theme values.\n */\n\nimport type {\n ThemeConfig,\n ResolvedTheme,\n ButtonVariantStyles,\n BackgroundStyles,\n} from './types'\nimport {\n DEFAULT_BUTTON_VARIANTS,\n DEFAULT_CTA_BUTTON_VARIANTS,\n DEFAULT_CTA_BACKGROUND_STYLES,\n DEFAULT_COLOR_PRESETS,\n DEFAULT_FOCUS_RING,\n DEFAULT_THEME,\n} from './defaults'\n\n/**\n * Merges user-provided theme config with defaults to create a fully resolved theme\n */\nexport function resolveTheme(config?: ThemeConfig): ResolvedTheme {\n if (!config) return DEFAULT_THEME\n\n return {\n buttonVariants: mergeVariants(DEFAULT_BUTTON_VARIANTS, config.buttonVariants),\n ctaButtonVariants: mergeVariants(DEFAULT_CTA_BUTTON_VARIANTS, config.ctaButtonVariants),\n ctaBackgroundStyles: mergeBackgroundStyles(\n DEFAULT_CTA_BACKGROUND_STYLES,\n config.ctaBackgroundStyles\n ),\n colorPresets: resolveColorPresets(config),\n focusRingColor: config.focusRingColor ?? DEFAULT_FOCUS_RING,\n }\n}\n\n/**\n * Merges variant overrides with defaults\n */\nfunction mergeVariants(\n defaults: ButtonVariantStyles,\n overrides?: Partial<ButtonVariantStyles>\n): ButtonVariantStyles {\n if (!overrides) return defaults\n\n const result: ButtonVariantStyles = { ...defaults }\n for (const key of Object.keys(overrides)) {\n const override = overrides[key]\n if (override) {\n result[key] = override\n }\n }\n return result\n}\n\n/**\n * Merges background style overrides with defaults\n */\nfunction mergeBackgroundStyles(\n defaults: BackgroundStyles,\n overrides?: Partial<BackgroundStyles>\n): BackgroundStyles {\n if (!overrides) return defaults\n return { ...defaults, ...overrides }\n}\n\n/**\n * Resolves color presets based on config\n */\nfunction resolveColorPresets(config: ThemeConfig) {\n if (!config.colorPresets) {\n return DEFAULT_COLOR_PRESETS\n }\n\n if (config.extendColorPresets) {\n return [...DEFAULT_COLOR_PRESETS, ...config.colorPresets]\n }\n\n return config.colorPresets\n}\n\n/**\n * Safely gets variant classes from a variant styles object\n *\n * @param variants - The button variant styles object\n * @param variant - The variant key to look up\n * @param fallback - Fallback variant key if the requested variant doesn't exist\n * @returns The CSS classes string for the variant\n */\nexport function getVariantClasses(\n variants: ButtonVariantStyles,\n variant: string,\n fallback = 'default'\n): string {\n const config = variants[variant]\n if (config?.classes) {\n return config.classes\n }\n\n const fallbackConfig = variants[fallback]\n return fallbackConfig?.classes ?? ''\n}\n\n/**\n * Safely gets background style classes\n *\n * @param styles - The background styles object\n * @param style - The style key to look up\n * @param fallback - Fallback style key if the requested style doesn't exist\n * @returns The CSS classes string for the background\n */\nexport function getBackgroundClasses(\n styles: BackgroundStyles,\n style: string,\n fallback = 'default'\n): string {\n return styles[style] ?? styles[fallback] ?? ''\n}\n","/**\n * Button Component - Server-safe Puck Configuration\n *\n * CTA button with customizable styling and link support.\n * This version contains only the render function and types - no fields.\n * Safe for use in server components.\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n cn,\n marginValueToCSS,\n paddingValueToCSS,\n colorValueToCSS,\n borderValueToCSS,\n transformValueToCSS,\n type PaddingValue,\n type ColorValue,\n type BorderValue,\n type AnimationValue,\n type TransformValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\nimport { sizeValueToCSS, getSizeClasses, type SizeValue } from '../../fields/SizeField'\nimport type { Alignment } from '../../fields/AlignmentField'\nimport { DEFAULT_BUTTON_VARIANTS, DEFAULT_FOCUS_RING } from '../../theme/defaults'\nimport { getVariantClasses } from '../../theme/utils'\n\nexport interface ButtonProps {\n text: string\n link: string\n variant: string\n size: SizeValue | null\n openInNewTab: string\n margin: PaddingValue | null\n customBackgroundColor: ColorValue | null\n customTextColor: ColorValue | null\n customBorder: BorderValue | null\n alignment: Alignment | null\n transform: TransformValue | null\n animation: AnimationValue | null\n customPadding: PaddingValue | null\n}\n\nconst sizeStyles: Record<string, string> = {\n sm: 'h-8 px-3 text-sm',\n default: 'h-10 px-4',\n lg: 'h-12 px-8 text-lg',\n}\n\nconst alignmentWrapperMap: Record<string, string> = {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n}\n\nconst defaultProps: ButtonProps = {\n text: 'Click Me',\n link: '',\n variant: 'default',\n size: null,\n openInNewTab: 'no',\n margin: null,\n customBackgroundColor: null,\n customTextColor: null,\n customBorder: null,\n alignment: null,\n transform: null,\n animation: null,\n customPadding: null,\n}\n\nexport const ButtonConfig: ComponentConfig<ButtonProps> = {\n label: 'Button',\n defaultProps,\n render: ({ text, link, variant, size, openInNewTab, alignment, margin, customBackgroundColor, customTextColor, customBorder, transform, animation, customPadding }) => {\n // Determine if custom styles should override preset variant/size styles\n const hasCustomBackground = customBackgroundColor?.hex\n const hasCustomTextColor = customTextColor?.hex\n const hasCustomPadding = customPadding\n const hasCustomSize = size?.mode === 'custom'\n\n // Get variant classes from defaults (SSR-safe, no hooks)\n const variantClasses = getVariantClasses(DEFAULT_BUTTON_VARIANTS, variant, 'default')\n\n // Get size classes for preset modes, or empty for custom mode\n const sizeClasses = getSizeClasses(size, sizeStyles)\n\n // Build button classes - exclude variant/size classes if custom styles are set\n const buttonClasses = cn(\n 'inline-flex items-center justify-center font-medium transition-colors',\n `focus:outline-none focus:ring-2 focus:ring-offset-2 ${DEFAULT_FOCUS_RING}`,\n 'disabled:opacity-50 disabled:pointer-events-none',\n // Only apply variant styles if no custom background/text color\n !hasCustomBackground && !hasCustomTextColor && variantClasses,\n // Only apply background portion of variant if no custom background\n hasCustomBackground && !hasCustomTextColor && 'hover:opacity-90',\n // Only apply size classes if not using custom size or custom padding\n !hasCustomPadding && !hasCustomSize && sizeClasses,\n // Apply rounded-md unless custom border has radius\n !customBorder?.radius && 'rounded-md'\n )\n\n // Build inline styles for the button\n const buttonStyle: React.CSSProperties = {}\n\n // Apply custom background color\n if (hasCustomBackground) {\n buttonStyle.backgroundColor = colorValueToCSS(customBackgroundColor)\n }\n\n // Apply custom text color\n if (hasCustomTextColor) {\n buttonStyle.color = colorValueToCSS(customTextColor)\n }\n\n // Apply custom border\n const borderStyles = borderValueToCSS(customBorder)\n if (borderStyles) {\n Object.assign(buttonStyle, borderStyles)\n }\n\n // Apply custom size (only if mode is custom)\n const customSizeStyles = sizeValueToCSS(size)\n if (customSizeStyles) {\n Object.assign(buttonStyle, customSizeStyles)\n }\n\n // Apply custom padding (overrides size padding if set)\n const paddingCSS = paddingValueToCSS(customPadding)\n if (paddingCSS) {\n buttonStyle.padding = paddingCSS\n }\n\n // Apply transform\n const transformStyles = transformValueToCSS(transform)\n if (transformStyles) {\n Object.assign(buttonStyle, transformStyles)\n }\n\n const buttonElement = link ? (\n <a\n href={link}\n target={openInNewTab === 'yes' ? '_blank' : undefined}\n rel={openInNewTab === 'yes' ? 'noopener noreferrer' : undefined}\n className={buttonClasses}\n style={buttonStyle}\n >\n {text}\n </a>\n ) : (\n <button type=\"button\" className={buttonClasses} style={buttonStyle}>\n {text}\n </button>\n )\n\n const wrapperStyle: React.CSSProperties = {}\n const marginCSS = marginValueToCSS(margin)\n if (marginCSS) {\n wrapperStyle.margin = marginCSS\n }\n\n // Get alignment value, defaulting to 'left'\n const alignmentValue = alignment ?? 'left'\n\n return (\n <AnimatedWrapper\n animation={animation}\n className={alignmentWrapperMap[alignmentValue] || alignmentWrapperMap.left}\n style={wrapperStyle}\n >\n {buttonElement}\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * Card Component - Server-safe Puck Configuration\n *\n * Content card with image, heading, and text.\n * This version contains only the render function and types - no fields.\n * Safe for use in server components.\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n shadowMap,\n cn,\n marginValueToCSS,\n paddingValueToCSS,\n backgroundValueToCSS,\n borderValueToCSS,\n dimensionsValueToCSS,\n transformValueToCSS,\n type PaddingValue,\n type BackgroundValue,\n type BorderValue,\n type DimensionsValue,\n type AnimationValue,\n type TransformValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\nimport type { MediaReference } from '../../fields/MediaField'\nimport type { Alignment } from '../../fields/AlignmentField'\n\nexport interface CardProps {\n image: MediaReference | null\n heading: string\n text: string\n link: string\n openInNewTab: boolean\n shadow: string\n margin: PaddingValue | null\n background: BackgroundValue | null\n border: BorderValue | null\n dimensions: DimensionsValue | null\n alignment: Alignment | null\n transform: TransformValue | null\n animation: AnimationValue | null\n customPadding: PaddingValue | null\n}\n\nconst defaultProps: CardProps = {\n image: null,\n heading: 'Card Heading',\n text: 'Card description text goes here.',\n link: '',\n openInNewTab: false,\n shadow: 'md',\n margin: null,\n background: null,\n border: null,\n dimensions: null,\n alignment: null,\n transform: null,\n animation: null,\n customPadding: null,\n}\n\nexport const CardConfig: ComponentConfig<CardProps> = {\n label: 'Card',\n defaultProps,\n render: ({ image, heading, text, link, openInNewTab, shadow, background, dimensions, alignment, margin, border, transform, animation, customPadding }) => {\n // Check if border has radius, if so don't apply rounded-lg\n const hasBorderRadius = border?.radius && border.radius > 0\n const cardClasses = cn(\n 'overflow-hidden transition-all bg-card',\n !hasBorderRadius && 'rounded-lg',\n shadowMap[shadow] || '',\n link && 'hover:shadow-lg cursor-pointer'\n )\n\n // Wrapper style for margin, dimensions, alignment, transform, animation\n const wrapperStyle: React.CSSProperties = {}\n const marginCSS = marginValueToCSS(margin)\n if (marginCSS) {\n wrapperStyle.margin = marginCSS\n }\n const dimensionsStyles = dimensionsValueToCSS(dimensions)\n if (dimensionsStyles) {\n Object.assign(wrapperStyle, dimensionsStyles)\n }\n const transformStyles = transformValueToCSS(transform)\n if (transformStyles) {\n Object.assign(wrapperStyle, transformStyles)\n }\n\n // Alignment classes for wrapper\n const alignmentValue = alignment ?? 'left'\n const alignmentClasses = cn(\n 'flex',\n alignmentValue === 'left' && 'justify-start',\n alignmentValue === 'center' && 'justify-center',\n alignmentValue === 'right' && 'justify-end'\n )\n\n // Card background styles from BackgroundValue\n const backgroundStyles = backgroundValueToCSS(background)\n const cardStyle: React.CSSProperties = {\n ...backgroundStyles,\n }\n // Note: bg-card class handles default background (theme-aware)\n // Apply border to card\n const borderStyles = borderValueToCSS(border)\n if (borderStyles) {\n Object.assign(cardStyle, borderStyles)\n }\n // Apply padding to card\n const paddingCSS = paddingValueToCSS(customPadding)\n if (paddingCSS) {\n cardStyle.padding = paddingCSS\n }\n\n const cardContent = (\n <div className={cardClasses} style={cardStyle}>\n {/* Image */}\n {image?.url ? (\n <div className=\"relative aspect-video w-full overflow-hidden\">\n {/* eslint-disable-next-line @next/next/no-img-element */}\n <img\n src={image.url}\n alt={image.alt || heading || ''}\n className=\"w-full h-full object-cover\"\n />\n </div>\n ) : (\n <div className=\"aspect-video w-full bg-muted flex items-center justify-center\">\n <span className=\"text-muted-foreground\">No image</span>\n </div>\n )}\n\n {/* Content */}\n <div className=\"p-4\">\n {heading && (\n <h3 className=\"text-lg font-semibold text-foreground mb-2\">{heading}</h3>\n )}\n {text && <p className=\"text-muted-foreground text-sm\">{text}</p>}\n </div>\n </div>\n )\n\n if (link) {\n return (\n <AnimatedWrapper animation={animation}>\n <div className={alignmentClasses}>\n <a\n href={link}\n target={openInNewTab ? '_blank' : undefined}\n rel={openInNewTab ? 'noopener noreferrer' : undefined}\n className=\"block\"\n style={wrapperStyle}\n >\n {cardContent}\n </a>\n </div>\n </AnimatedWrapper>\n )\n }\n\n return (\n <AnimatedWrapper animation={animation}>\n <div className={alignmentClasses}>\n <div style={wrapperStyle}>{cardContent}</div>\n </div>\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * Divider Component - Server-safe Puck Configuration\n *\n * Horizontal line separator with customizable style.\n * This version contains only the render function and types - no fields.\n * Safe for use in server components.\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport {\n dividerStyleMap,\n cn,\n marginValueToCSS,\n paddingValueToCSS,\n colorValueToCSS,\n dimensionsValueToCSS,\n transformValueToCSS,\n type PaddingValue,\n type ColorValue,\n type DimensionsValue,\n type AnimationValue,\n type TransformValue,\n} from '../../fields/shared'\nimport { AnimatedWrapper } from '../AnimatedWrapper'\n\nexport interface DividerProps {\n style: string\n color: ColorValue | null\n margin: PaddingValue | null\n dimensions: DimensionsValue | null\n transform: TransformValue | null\n animation: AnimationValue | null\n customPadding: PaddingValue | null\n}\n\nconst defaultProps: DividerProps = {\n style: 'solid',\n color: null,\n margin: null,\n dimensions: null,\n transform: null,\n animation: null,\n customPadding: null,\n}\n\nexport const DividerConfig: ComponentConfig<DividerProps> = {\n label: 'Divider',\n defaultProps,\n render: ({ style, color, dimensions, margin, transform, animation, customPadding }) => {\n const dimensionsStyles = dimensionsValueToCSS(dimensions)\n\n const wrapperStyle: React.CSSProperties = {\n ...dimensionsStyles,\n }\n const marginCSS = marginValueToCSS(margin)\n if (marginCSS) {\n wrapperStyle.margin = marginCSS\n }\n const paddingCSS = paddingValueToCSS(customPadding)\n if (paddingCSS) {\n wrapperStyle.padding = paddingCSS\n }\n const transformStyles = transformValueToCSS(transform)\n if (transformStyles) {\n Object.assign(wrapperStyle, transformStyles)\n }\n\n // Only set color if explicitly provided, otherwise use CSS variable\n const customColor = colorValueToCSS(color)\n const hrStyle: React.CSSProperties | undefined = customColor\n ? { borderColor: customColor }\n : undefined\n\n return (\n <AnimatedWrapper animation={animation}>\n <div className=\"px-4\" style={Object.keys(wrapperStyle).length > 0 ? wrapperStyle : undefined}>\n <hr\n className={cn(\n 'border-t border-border',\n dividerStyleMap[style] || dividerStyleMap.solid\n )}\n style={hrStyle}\n />\n </div>\n </AnimatedWrapper>\n )\n },\n}\n","/**\n * Accordion Component - Server-safe Puck Configuration\n *\n * Expandable sections with collapsible content.\n * This version contains only the render function and types - no fields.\n * The render function returns a client component (AccordionClient) that\n * handles the interactive state.\n */\n\nimport type { ComponentConfig } from '@measured/puck'\nimport type {\n PaddingValue,\n DimensionsValue,\n BackgroundValue,\n AnimationValue,\n TransformValue,\n ColorValue,\n} from '../../fields/shared'\nimport { AccordionClient } from '../AccordionClient'\n\ninterface AccordionItemData {\n title: string\n content: string\n defaultOpen: boolean\n}\n\nexport interface AccordionProps {\n items: AccordionItemData[]\n allowMultiple: boolean\n textColor: ColorValue | null\n margin: PaddingValue | null\n background: BackgroundValue | null\n dimensions: DimensionsValue | null\n transform: TransformValue | null\n animation: AnimationValue | null\n customPadding: PaddingValue | null\n}\n\nconst defaultProps: AccordionProps = {\n items: [\n {\n title: 'What is this?',\n content: 'This is an accordion component that can expand and collapse.',\n defaultOpen: false,\n },\n {\n title: 'How do I use it?',\n content: 'Click on each item to expand or collapse it.',\n defaultOpen: false,\n },\n ],\n allowMultiple: false,\n textColor: null,\n margin: null,\n background: null,\n dimensions: null,\n transform: null,\n animation: null,\n customPadding: null,\n}\n\nexport const AccordionConfig: ComponentConfig<AccordionProps> = {\n label: 'Accordion',\n defaultProps,\n render: (props) => (\n <AccordionClient\n items={props.items}\n allowMultiple={props.allowMultiple}\n textColor={props.textColor}\n margin={props.margin}\n background={props.background}\n dimensions={props.dimensions}\n transform={props.transform}\n animation={props.animation}\n customPadding={props.customPadding}\n />\n ),\n}\n","import type { Config as PuckConfig } from '@measured/puck'\nimport type { MergeConfigOptions } from '../types'\n\n/**\n * Merges Puck configurations together\n *\n * @example\n * ```typescript\n * import { mergeConfigs, baseConfig } from '@delmaredigital/payload-puck/config'\n *\n * const customConfig = mergeConfigs({\n * base: baseConfig,\n * components: {\n * CustomHero: myHeroConfig,\n * },\n * categories: {\n * custom: { title: 'Custom', components: ['CustomHero'] },\n * },\n * exclude: ['CallToAction'], // Remove if not needed\n * })\n * ```\n */\nexport function mergeConfigs(options: MergeConfigOptions): PuckConfig {\n const { base, components = {}, categories = {}, root, exclude = [] } = options\n\n // Filter out excluded components from base\n const filteredBaseComponents = Object.fromEntries(\n Object.entries(base.components || {}).filter(([key]) => !exclude.includes(key))\n )\n\n // Merge categories\n const mergedCategories: PuckConfig['categories'] = {}\n\n // First, process base categories (filtering excluded components)\n for (const [key, category] of Object.entries(base.categories || {})) {\n if (category) {\n mergedCategories[key] = {\n ...category,\n components: category.components?.filter((c) => !exclude.includes(String(c))) || [],\n }\n }\n }\n\n // Then, merge in new categories\n for (const [key, category] of Object.entries(categories)) {\n if (category) {\n if (mergedCategories[key]) {\n // Merge with existing category\n mergedCategories[key] = {\n ...mergedCategories[key],\n ...category,\n components: [\n ...(mergedCategories[key]?.components || []),\n ...(category.components || []),\n ],\n }\n } else {\n // Add new category\n mergedCategories[key] = category\n }\n }\n }\n\n // Merge root config\n const mergedRoot = root\n ? {\n ...base.root,\n ...root,\n fields: {\n ...base.root?.fields,\n ...root.fields,\n },\n defaultProps: {\n ...base.root?.defaultProps,\n ...root.defaultProps,\n },\n }\n : base.root\n\n return {\n ...base,\n root: mergedRoot,\n categories: mergedCategories,\n components: {\n ...filteredBaseComponents,\n ...components,\n },\n }\n}\n","/**\n * Server-safe Puck configuration\n *\n * This config is safe for server-side rendering and should be used\n * with the PageRenderer component.\n */\n\nimport type { Config as PuckConfig, ComponentConfig } from '@measured/puck'\nimport type { ReactNode } from 'react'\nimport { DEFAULT_LAYOUTS, layoutsToOptions, type LayoutDefinition } from '../layouts'\n\n// Layout Components (server-safe versions)\nimport { ContainerConfig } from '../components/layout/Container.server'\nimport { FlexConfig } from '../components/layout/Flex.server'\nimport { GridConfig } from '../components/layout/Grid.server'\nimport { SectionConfig } from '../components/layout/Section.server'\nimport { SpacerConfig } from '../components/layout/Spacer.server'\nimport { TemplateServerConfig } from '../components/layout/Template.server'\n\n// Typography Components (server-safe versions)\nimport { HeadingConfig } from '../components/typography/Heading.server'\nimport { TextConfig } from '../components/typography/Text.server'\nimport { RichTextConfig } from '../components/typography/RichText.server'\n\n// Media Components (server-safe versions)\nimport { ImageConfig } from '../components/media/Image.server'\n\n// Interactive Components (server-safe versions)\nimport { ButtonConfig } from '../components/interactive/Button.server'\nimport { CardConfig } from '../components/interactive/Card.server'\nimport { DividerConfig } from '../components/interactive/Divider.server'\nimport { AccordionConfig } from '../components/interactive/Accordion.server'\n\n/**\n * Creates a Puck configuration with custom layouts\n *\n * @param layouts - Custom layout definitions\n * @returns Puck configuration with the specified layouts\n *\n * @example\n * ```tsx\n * import { createConfig, DEFAULT_LAYOUTS, createLayout } from '@delmaredigital/payload-puck/config'\n *\n * const customConfig = createConfig([\n * ...DEFAULT_LAYOUTS,\n * createLayout({\n * value: 'blog',\n * label: 'Blog Post',\n * maxWidth: '720px',\n * }),\n * ])\n * ```\n */\nexport function createConfig(layouts: LayoutDefinition[] = DEFAULT_LAYOUTS): PuckConfig {\n const layoutOptions = layoutsToOptions(layouts)\n\n return {\n root: {\n fields: {\n title: {\n type: 'text',\n label: 'Page Title',\n },\n pageLayout: {\n type: 'select',\n label: 'Page Layout',\n options: layoutOptions.map(({ value, label }) => ({ value, label })),\n },\n },\n defaultProps: {\n title: 'New Page',\n pageLayout: 'default',\n },\n render: ({ children }: { children: ReactNode }) => <>{children}</>,\n },\n categories: {\n layout: {\n title: 'Layout',\n components: ['Container', 'Flex', 'Grid', 'Section', 'Spacer', 'Template'],\n defaultExpanded: true,\n },\n typography: {\n title: 'Typography',\n components: ['Heading', 'Text', 'RichText'],\n },\n media: {\n title: 'Media',\n components: ['Image'],\n },\n interactive: {\n title: 'Interactive',\n components: ['Button', 'Card', 'Divider', 'Accordion'],\n },\n },\n components: {\n // Layout\n Container: ContainerConfig as ComponentConfig<any>,\n Flex: FlexConfig as ComponentConfig<any>,\n Grid: GridConfig as ComponentConfig<any>,\n Section: SectionConfig as ComponentConfig<any>,\n Spacer: SpacerConfig as ComponentConfig<any>,\n Template: TemplateServerConfig as ComponentConfig<any>,\n // Typography\n Heading: HeadingConfig as ComponentConfig<any>,\n Text: TextConfig as ComponentConfig<any>,\n RichText: RichTextConfig as ComponentConfig<any>,\n // Media\n Image: ImageConfig as ComponentConfig<any>,\n // Interactive\n Button: ButtonConfig as ComponentConfig<any>,\n Card: CardConfig as ComponentConfig<any>,\n Divider: DividerConfig as ComponentConfig<any>,\n Accordion: AccordionConfig as ComponentConfig<any>,\n },\n } satisfies PuckConfig\n}\n\n/**\n * Base Puck configuration with server-safe component configs\n *\n * All components have server-safe versions (.server.tsx) that render\n * without client-side interactivity. Use editorConfig from ./config.editor\n * for the full interactive editor experience.\n *\n * For custom layouts, use createConfig() instead.\n */\nexport const baseConfig = createConfig(DEFAULT_LAYOUTS)\n\n// Re-export merge utility and layout helpers\nexport { mergeConfigs } from './merge'\nexport { DEFAULT_LAYOUTS, createLayout, type LayoutDefinition } from '../layouts'\n"]}
|