{"version":3,"file":"registries-CqeHZXeS.cjs","names":["Ban"],"sources":["../../core/src/registries/property-schema-types.ts","../../core/src/registries/field-helpers.ts"],"sourcesContent":["import type { LucideIcon } from \"lucide-react\";\nimport type {\n  WidgetType,\n  WidgetSchema,\n  AlignOptions,\n  ColorOptions,\n  FontSizeOptions,\n  SectionLayoutType,\n  StrictOmit,\n  BorderRadiusOptions,\n} from \"../types\";\n\n/**\n * Tab configuration for organizing properties\n */\nexport interface TabConfig {\n  /** Unique identifier for the tab */\n  id: string;\n  /** Display label for the tab */\n  label: string;\n}\n\n// ============================================================================\n// Property Field Types - Derive from constant for single source of truth\n// ============================================================================\n\n/**\n * Property field type constant - single source of truth for field types.\n * Use PROPERTY_FIELD_TYPES.text instead of \"text\" for type-safe comparisons.\n */\nexport const PROPERTY_FIELD_TYPES = {\n  text: \"text\",\n  textarea: \"textarea\",\n  number: \"number\",\n  boolean: \"boolean\",\n  select: \"select\",\n  /** @deprecated Use `colorSelect` for semantic portal-theme colors. */\n  color: \"color\",\n  range: \"range\",\n  dataSource: \"dataSource\",\n  resource: \"resource\",\n  image: \"image\",\n  alignment: \"alignment\",\n  slider: \"slider\",\n  colorPicker: \"colorPicker\",\n  sectionHeader: \"sectionHeader\",\n  separator: \"separator\",\n  buttonGroup: \"buttonGroup\",\n  colorSelect: \"colorSelect\",\n  sectionLayoutSelect: \"sectionLayoutSelect\",\n  background: \"background\",\n  contentPosition: \"contentPosition\",\n  textSizeSelect: \"textSizeSelect\",\n  cssUnit: \"cssUnit\",\n  fontPicker: \"fontPicker\",\n  stringArray: \"stringArray\",\n  quoteList: \"quoteList\",\n  borderRadius: \"borderRadius\",\n  screenPicker: \"screenPicker\",\n} as const;\n\n/**\n * Union type of all property field types, derived from PROPERTY_FIELD_TYPES constant.\n * @see deriving-typeof-for-object-keys pattern\n */\nexport type PropertyFieldType =\n  (typeof PROPERTY_FIELD_TYPES)[keyof typeof PROPERTY_FIELD_TYPES];\n\n/**\n * Runtime validation for property field types.\n * @param value - The value to check\n * @returns true if value is a valid PropertyFieldType\n */\nexport function isPropertyFieldType(value: string): value is PropertyFieldType {\n  return Object.values(PROPERTY_FIELD_TYPES).includes(\n    value as PropertyFieldType,\n  );\n}\n\n/**\n * Group label for fields that override theme-derived styling.\n * Rendered last within a tab and collapsed by default so the primary\n * configuration surface stays clean.\n */\nexport const CUSTOM_STYLING_GROUP = \"Custom styling\";\n\n/**\n * Base schema for a property field\n */\nexport interface PropertyFieldSchema {\n  /** Property key in the widget props */\n  key: string;\n  /** Display label for the field */\n  label: string;\n  /** Field type determines the input control */\n  type: PropertyFieldType;\n  /** Optional description/help text */\n  description?: string;\n  /** Optional default value */\n  defaultValue?: unknown;\n  /** Optional tab ID (must match a TabConfig id if widget has tabsConfig) */\n  tab?: string;\n  /** Optional group for organizing fields within a tab */\n  group?: string;\n  /**\n   * When true, this field is treated as an override of a value that can\n   * otherwise be inherited from the active theme (e.g. border radius,\n   * padding, border width). Advanced fields are automatically bucketed\n   * into the `CUSTOM_STYLING_GROUP` at the bottom of their tab and\n   * rendered collapsed by default so the default surface area stays\n   * minimal.\n   */\n  advanced?: boolean;\n  /**\n   * @deprecated Use requiresKeyValue instead\n   */\n  requiresKeyToBeTrue?: string;\n  /** Optional requires a specific key to have a specific value. Supports single condition or array (AND logic). */\n  requiresKeyValue?:\n    | { key: string; value: unknown }\n    | Array<{ key: string; value: unknown }>;\n}\n\n/**\n * Text field schema\n */\nexport interface TextFieldSchema extends PropertyFieldSchema {\n  type: \"text\";\n  placeholder?: string;\n  maxLength?: number;\n  /**\n   * Optional quick-insert chips rendered below the input. Clicking a chip\n   * inserts `{{value}}` at the caret. Used for URL template tokens\n   * (e.g. `{{username}}`, `{{replicated_url || /signup}}`) so admins\n   * don't have to remember the exact spelling.\n   */\n  tokenSuggestions?: ReadonlyArray<{\n    /** Chip label shown to the admin (e.g. `username`). */\n    label: string;\n    /** Token body inserted between `{{` and `}}` (e.g. `username || /signup`). */\n    value: string;\n  }>;\n}\n\n/**\n * Textarea field schema\n */\nexport interface TextareaFieldSchema extends PropertyFieldSchema {\n  type: \"textarea\";\n  placeholder?: string;\n  rows?: number;\n  maxLength?: number;\n}\n\n/**\n * Number field schema\n */\nexport interface NumberFieldSchema extends PropertyFieldSchema {\n  type: \"number\";\n  min?: number;\n  max?: number;\n  step?: number;\n}\n\n/**\n * Boolean field schema\n */\nexport interface BooleanFieldSchema extends PropertyFieldSchema {\n  type: \"boolean\";\n}\n\n/**\n * Select field schema with type-safe option values.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface SelectFieldSchema<\n  T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n  type: \"select\";\n  options: Array<{ label: string; value: T }>;\n  defaultValue?: T;\n}\n\n/**\n * Legacy free-form color field schema.\n *\n * @deprecated Use {@link ColorSelectFieldSchema} (`type: \"colorSelect\"`) so\n * widget authors select a semantic color token supplied by the portal theme.\n */\nexport interface ColorFieldSchema extends PropertyFieldSchema {\n  type: \"color\";\n}\n\n/**\n * Range slider field schema\n */\nexport interface RangeFieldSchema extends PropertyFieldSchema {\n  type: \"range\";\n  min: number;\n  max: number;\n  step?: number;\n}\n\n/**\n * Data source field schema for configuring widget data sources\n */\nexport interface DataSourceFieldSchema extends PropertyFieldSchema {\n  /** Identifies this field as the data-source editor. */\n  type: \"dataSource\";\n  /** Widget props that this data-source editor can populate. */\n  targetProps?: ReadonlyArray<{\n    /** Widget prop key populated with the resolved data-source result. */\n    key: string;\n    /** Description emitted for this prop in the portal JSON Schema and types. */\n    description: string;\n  }>;\n}\n\n/**\n * Resource field schema for selecting a single resource from the selection modal\n */\nexport interface ResourceFieldSchema extends PropertyFieldSchema {\n  type: \"resource\";\n  /** Optional filter to specific shareable types */\n  allowedTypes?: string[];\n}\n\n/**\n * Image field schema for selecting a single asset (image or video) from the\n * image picker. Despite the legacy \"image\" name, this field supports video\n * picking via the `accept` parameter — `VideoWidget`, `ListWidget` Featured\n * Asset, and `NestedWidget` Primary Media all use it for video-or-mixed\n * content.\n */\nexport interface ImageFieldSchema extends PropertyFieldSchema {\n  type: \"image\";\n  /**\n   * Restricts which MIME categories the picker offers. Defaults to \"image\".\n   */\n  accept?: \"image\" | \"video\" | \"any\";\n}\n\n/**\n * Alignment field schema\n */\nexport interface AlignmentFieldSchema extends PropertyFieldSchema {\n  type: \"alignment\";\n  options: {\n    verticalEnabled: boolean;\n    horizontalEnabled: boolean;\n  };\n  defaultValue?: AlignOptions;\n}\n\n/**\n * Slider field schema with optional unit suffix (e.g., \"rem\", \"px\")\n */\nexport interface SliderFieldSchema extends PropertyFieldSchema {\n  type: \"slider\";\n  min: number;\n  max: number;\n  step?: number;\n  unit?: string;\n}\n\n/**\n * Color picker field schema with optional swatches\n */\nexport interface ColorPickerFieldSchema extends PropertyFieldSchema {\n  type: \"colorPicker\";\n  swatches?: string[];\n}\n\n/**\n * Section header field schema for visual grouping\n */\nexport interface SectionHeaderFieldSchema extends PropertyFieldSchema {\n  type: \"sectionHeader\";\n  subtitle?: string;\n}\n\n/**\n * Separator field schema for visual separation\n */\nexport interface SeparatorFieldSchema extends PropertyFieldSchema {\n  type: \"separator\";\n}\n\n/**\n * Button group field schema.\n * Uses StrictOmit to ensure \"defaultValue\" key exists on PropertyFieldSchema.\n */\nexport interface ButtonGroupFieldSchema<\n  T extends string | number = string | number,\n> extends StrictOmit<PropertyFieldSchema, \"defaultValue\"> {\n  type: \"buttonGroup\";\n  options: Array<{\n    label?: string;\n    ariaLabel?: string;\n    icon?: LucideIcon;\n    value: T;\n  }>;\n  defaultValue?: T;\n}\n\n/**\n * Semantic theme-color token selector. Prefer this field over free-form color\n * controls so widgets continue to work across portal themes and color modes.\n */\nexport interface ColorSelectFieldSchema extends PropertyFieldSchema {\n  type: \"colorSelect\";\n  defaultValue?: ColorOptions;\n  excludeColors?: ColorOptions[];\n}\n\n/**\n * Section layout select field schema for visual masonry layout selector\n */\nexport interface SectionLayoutSelectFieldSchema extends PropertyFieldSchema {\n  type: \"sectionLayoutSelect\";\n  defaultValue?: SectionLayoutType;\n}\n\n/**\n * Background field combines resource selection and color properties.\n * Uses StrictOmit to exclude conflicting \"type\" discriminant from parents.\n */\nexport interface BackgroundFieldSchema\n  extends\n    StrictOmit<ResourceFieldSchema, \"type\">,\n    StrictOmit<ColorFieldSchema, \"type\"> {\n  type: \"background\";\n}\n\n/**\n * Content position field schema for 3x3 grid position picker\n */\nexport interface ContentPositionFieldSchema extends PropertyFieldSchema {\n  type: \"contentPosition\";\n  defaultValue?: string;\n}\n\n/**\n * Text size select field schema for visual font size selector\n */\nexport interface TextSizeSelectFieldSchema extends PropertyFieldSchema {\n  type: \"textSizeSelect\";\n  defaultValue?: FontSizeOptions;\n}\n\n/**\n * CSS unit type for height/width fields\n */\nexport type CssUnit = \"px\" | \"rem\" | \"vh\" | \"%\";\n\n/**\n * CSS unit field schema for numeric values with selectable units (px, rem, vh, %)\n */\nexport interface CssUnitFieldSchema extends PropertyFieldSchema {\n  type: \"cssUnit\";\n  minByUnit?: Partial<Record<CssUnit, number>>;\n  maxByUnit?: Partial<Record<CssUnit, number>>;\n  stepByUnit?: Partial<Record<CssUnit, number>>;\n  allowedUnits?: CssUnit[];\n  defaultUnit?: CssUnit;\n}\n\n/**\n * Font picker field schema for Google Fonts selection\n */\nexport interface FontPickerFieldSchema extends PropertyFieldSchema {\n  type: \"fontPicker\";\n  placeholder?: string;\n}\n\n/**\n * String array field schema for managing lists of text items\n */\nexport interface StringArrayFieldSchema extends PropertyFieldSchema {\n  type: \"stringArray\";\n  placeholder?: string;\n  defaultValue?: string[];\n}\n\n/**\n * A single quote in a QuoteList: the text plus optional attribution + role.\n */\nexport interface QuoteListItem {\n  quote: string;\n  attribution?: string;\n  role?: string;\n}\n\n/**\n * An editable list of quotes (add / remove / edit inline in the panel). Powers\n * the Quote widget's one-or-many quotes.\n */\nexport interface QuoteListFieldSchema extends PropertyFieldSchema {\n  type: \"quoteList\";\n  defaultValue?: QuoteListItem[];\n}\n\n/**\n * Border radius composite field schema for controlling 4 corners with a single field.\n * Maps to 4 individual widget prop keys (topLeft, topRight, bottomLeft, bottomRight).\n */\nexport interface BorderRadiusFieldSchema extends PropertyFieldSchema {\n  type: \"borderRadius\";\n  keys: {\n    topLeft: string;\n    topRight: string;\n    bottomLeft: string;\n    bottomRight: string;\n  };\n  defaultValue?: BorderRadiusOptions;\n}\n\n/**\n * Screen picker field schema for selecting a portal screen (navigation, system, or available)\n */\nexport interface ScreenPickerFieldSchema extends PropertyFieldSchema {\n  type: \"screenPicker\";\n  /** Whether to include system navigation items in the picker */\n  includeSystemItems?: boolean;\n}\n\n/**\n * Union of all field schema types\n */\nexport type PropertyField =\n  | TextFieldSchema\n  | TextareaFieldSchema\n  | NumberFieldSchema\n  | BooleanFieldSchema\n  | SelectFieldSchema<string | number>\n  | ColorFieldSchema\n  | RangeFieldSchema\n  | DataSourceFieldSchema\n  | ResourceFieldSchema\n  | ImageFieldSchema\n  | AlignmentFieldSchema\n  | SliderFieldSchema\n  | ColorPickerFieldSchema\n  | SectionHeaderFieldSchema\n  | SeparatorFieldSchema\n  | ButtonGroupFieldSchema<string | number>\n  | ColorSelectFieldSchema\n  | SectionLayoutSelectFieldSchema\n  | BackgroundFieldSchema\n  | ContentPositionFieldSchema\n  | TextSizeSelectFieldSchema\n  | CssUnitFieldSchema\n  | FontPickerFieldSchema\n  | StringArrayFieldSchema\n  | QuoteListFieldSchema\n  | BorderRadiusFieldSchema\n  | ScreenPickerFieldSchema;\n\n/**\n * Schema for per-item configuration in custom data sources.\n * Widgets can define this to allow users to configure widget-specific\n * settings for each selected item (e.g., title, description, button).\n */\nexport interface ItemConfigSchema {\n  /** Fields available for per-item configuration */\n  fields: PropertyField[];\n  /** Optional description shown at top of item config panel */\n  description?: string;\n}\n\n/**\n * Schema for a widget's editable properties\n */\nexport interface WidgetPropertySchema {\n  /** Widget type this schema applies to */\n  widgetType: WidgetType;\n  /** Display name for the widget */\n  displayName: string;\n  /** Optional tab configuration - if present, tabs are enabled */\n  tabsConfig?: TabConfig[];\n  /** Editable property fields */\n  fields: PropertyField[];\n  /** Optional custom validator function */\n  validate?: (props: Record<string, unknown>) => string | null;\n  /** Props that can be populated from data sources */\n  dataSourceTargetProps?: string[];\n  /** Optional schema for per-item configurations in custom data sources */\n  itemConfigSchema?: ItemConfigSchema;\n}\n\n/**\n * Registry mapping widget types to their property schemas\n */\nexport type PropertySchemaRegistry = Record<WidgetType, WidgetPropertySchema>;\n\n/**\n * Group property fields by their group property.\n *\n * Fields flagged with `advanced: true` are collected into the\n * `CUSTOM_STYLING_GROUP` bucket regardless of their declared `group`,\n * and that bucket is always placed last so it renders at the bottom of\n * the tab. Non-advanced fields keep their author-declared group and\n * their relative insertion order, including fields that explicitly use\n * `CUSTOM_STYLING_GROUP`.\n */\nexport function groupPropertyFields(\n  fields: readonly PropertyField[],\n): Record<string, PropertyField[]> {\n  const grouped: Record<string, PropertyField[]> = {};\n  const advancedFields: PropertyField[] = [];\n\n  fields.forEach((field) => {\n    if (field.advanced) {\n      advancedFields.push(field);\n      return;\n    }\n    const group = field.group || \"General\";\n    if (!grouped[group]) {\n      grouped[group] = [];\n    }\n    grouped[group].push(field);\n  });\n\n  if (advancedFields.length > 0) {\n    const customStylingFields = grouped[CUSTOM_STYLING_GROUP] ?? [];\n    delete grouped[CUSTOM_STYLING_GROUP];\n    grouped[CUSTOM_STYLING_GROUP] = [...customStylingFields, ...advancedFields];\n  }\n\n  return grouped;\n}\n\n/**\n * Extract current values from widget props based on property fields\n */\nexport function extractPropertyValues(\n  widget: Readonly<WidgetSchema>,\n  fields: readonly PropertyField[],\n): Record<string, unknown> {\n  const values: Record<string, unknown> = {};\n\n  fields.forEach((field) => {\n    // For borderRadius composite fields, skip the top-level key —\n    // it is a schema grouping identifier, not a real widget prop.\n    if (field.type === \"borderRadius\") {\n      for (const subKey of Object.values(field.keys)) {\n        const subValue = widget.props[subKey];\n        values[subKey] = subValue !== undefined ? subValue : field.defaultValue;\n      }\n      return;\n    }\n\n    // dataSource config is stored at widget.dataSource (top-level),\n    // not in widget.props. Surface it under the field key so schema\n    // visibility checks (requiresKeyValue) can gate on its presence.\n    if (field.type === \"dataSource\") {\n      values[field.key] = widget.dataSource;\n      return;\n    }\n\n    const value = widget.props[field.key];\n    values[field.key] = value !== undefined ? value : field.defaultValue;\n  });\n\n  return values;\n}\n\n/**\n * Apply property values to widget props\n */\nexport function applyPropertyValues(\n  widget: Readonly<WidgetSchema>,\n  values: Readonly<Record<string, unknown>>,\n): WidgetSchema {\n  return {\n    ...widget,\n    props: {\n      ...widget.props,\n      ...values,\n    },\n  };\n}\n","import type {\n  BorderRadiusFieldSchema,\n  ButtonGroupFieldSchema,\n  ColorSelectFieldSchema,\n  CssUnitFieldSchema,\n  TextSizeSelectFieldSchema,\n} from \"./property-schema-types\";\nimport type {\n  BorderRadiusOptions,\n  BorderWidthOptions,\n  ColorOptions,\n  FontWeightOptions,\n  PaddingOptions,\n  ButtonSizeOptions,\n  GapOptions,\n} from \"../types\";\nimport { Ban } from \"lucide-react\";\n\nexport const getColorField = (\n  props: Readonly<Omit<ColorSelectFieldSchema, \"type\">>,\n): ColorSelectFieldSchema => {\n  return {\n    ...props,\n    type: \"colorSelect\",\n  };\n};\n\nexport const getBorderRadiusField = (\n  props: Readonly<\n    Omit<ButtonGroupFieldSchema<BorderRadiusOptions>, \"options\" | \"type\">\n  >,\n): ButtonGroupFieldSchema<BorderRadiusOptions> => {\n  return {\n    // Border radius inherits from the active theme by default. Mark as\n    // advanced so widget-level overrides collapse into the \"Custom\n    // styling\" disclosure.\n    //\n    // Note: `groupPropertyFields` ignores `field.group` whenever\n    // `field.advanced` is true. If a widget explicitly wants this\n    // control to live in its own group, pass `advanced: false`\n    // alongside `group: \"...\"` to opt out.\n    advanced: true,\n    ...props,\n    type: \"buttonGroup\",\n    options: [\n      { icon: Ban, ariaLabel: \"No radius\", value: \"none\" },\n      { label: \"SM\", value: \"sm\" },\n      { label: \"MD\", value: \"md\" },\n      { label: \"LG\", value: \"lg\" },\n      { label: \"XL\", value: \"xl\" },\n      { label: \"FULL\", value: \"full\" },\n    ],\n  };\n};\n\nexport const getPaddingField = (\n  props: Readonly<\n    Omit<ButtonGroupFieldSchema<PaddingOptions>, \"options\" | \"type\">\n  >,\n): ButtonGroupFieldSchema<PaddingOptions> => {\n  return {\n    // Padding follows the theme's global spacing scale by default.\n    // Mark as advanced so widget-level overrides collapse into the\n    // \"Custom styling\" disclosure. To keep this field in a different\n    // group, pass `advanced: false` alongside `group: \"...\"`.\n    advanced: true,\n    ...props,\n    type: \"buttonGroup\",\n    options: [\n      { icon: Ban, ariaLabel: \"No padding\", value: 0 },\n      { label: \"SM\", value: 2 },\n      { label: \"MD\", value: 4 },\n      { label: \"LG\", value: 6 },\n      { label: \"XL\", value: 8 },\n      { label: \"FULL\", value: 10 },\n    ],\n  };\n};\n\nexport const getButtonSizeField = (\n  props: Readonly<\n    Omit<ButtonGroupFieldSchema<ButtonSizeOptions>, \"options\" | \"type\">\n  >,\n): ButtonGroupFieldSchema<ButtonSizeOptions> => {\n  return {\n    ...props,\n    type: \"buttonGroup\",\n    options: [\n      { label: \"SM\", value: \"sm\" },\n      { label: \"MD\", value: \"default\" },\n      { label: \"LG\", value: \"lg\" },\n      { label: \"XL\", value: \"xl\" },\n    ],\n  };\n};\n\nexport const getFontWeightField = (\n  props: Readonly<\n    Omit<ButtonGroupFieldSchema<FontWeightOptions>, \"options\" | \"type\">\n  >,\n): ButtonGroupFieldSchema<FontWeightOptions> => {\n  return {\n    ...props,\n    type: \"buttonGroup\",\n    options: [\n      { label: \"Normal\", value: \"normal\" },\n      { label: \"Medium\", value: \"medium\" },\n      { label: \"Semibold\", value: \"semibold\" },\n      { label: \"Bold\", value: \"bold\" },\n    ],\n  };\n};\n\nexport const getFontSizeField = (\n  props: Readonly<Omit<TextSizeSelectFieldSchema, \"type\">>,\n): TextSizeSelectFieldSchema => {\n  return {\n    ...props,\n    type: \"textSizeSelect\",\n  };\n};\n\nexport const getGapField = (\n  props: Readonly<Omit<ButtonGroupFieldSchema<GapOptions>, \"options\" | \"type\">>,\n): ButtonGroupFieldSchema<GapOptions> => {\n  return {\n    ...props,\n    type: \"buttonGroup\",\n    options: [\n      { icon: Ban, ariaLabel: \"No gap\", value: \"none\" },\n      { label: \"XS\", value: \"xs\" },\n      { label: \"SM\", value: \"sm\" },\n      { label: \"MD\", value: \"md\" },\n      { label: \"LG\", value: \"lg\" },\n      { label: \"XL\", value: \"xl\" },\n    ],\n  };\n};\n\nexport const getHeightField = (\n  props: Readonly<\n    Omit<\n      CssUnitFieldSchema,\n      \"type\" | \"minByUnit\" | \"maxByUnit\" | \"stepByUnit\" | \"allowedUnits\"\n    >\n  >,\n): CssUnitFieldSchema => {\n  return {\n    ...props,\n    type: \"cssUnit\",\n    allowedUnits: [\"px\", \"vh\", \"rem\"],\n    minByUnit: { px: 10, vh: 1, rem: 1 },\n    maxByUnit: { px: 1200, vh: 100, rem: 75 },\n    stepByUnit: { px: 10, vh: 1, rem: 1 },\n  };\n};\n\nexport const getBorderRadiusCompositeField = (\n  props: Readonly<\n    Omit<BorderRadiusFieldSchema, \"type\" | \"keys\"> & {\n      keys?: BorderRadiusFieldSchema[\"keys\"];\n    }\n  >,\n): BorderRadiusFieldSchema => {\n  return {\n    // Per-corner radius controls are theme-derivable in the same way as\n    // the simpler `getBorderRadiusField`. Pass `advanced: false`\n    // alongside `group: \"...\"` to opt out of Custom Styling.\n    advanced: true,\n    ...props,\n    type: \"borderRadius\",\n    keys: props.keys ?? {\n      topLeft: \"borderRadiusTL\",\n      topRight: \"borderRadiusTR\",\n      bottomLeft: \"borderRadiusBL\",\n      bottomRight: \"borderRadiusBR\",\n    },\n  };\n};\n\n/**\n * Gap value mapping - use `as const satisfies` for compile-time validation\n * with literal type preservation.\n */\nexport const gapValues: {\n  readonly none: 0;\n  readonly xs: 1;\n  readonly sm: 2;\n  readonly md: 4;\n  readonly lg: 6;\n  readonly xl: 8;\n} = {\n  none: 0,\n  xs: 1,\n  sm: 2,\n  md: 4,\n  lg: 6,\n  xl: 8,\n} as const satisfies Record<GapOptions, number>;\n\nexport const getBorderWidthField = (\n  props: Readonly<\n    Omit<ButtonGroupFieldSchema<BorderWidthOptions>, \"options\" | \"type\">\n  >,\n): ButtonGroupFieldSchema<BorderWidthOptions> => ({\n  // Border width is a styling override of a theme-derivable decision.\n  // Pass `advanced: false` alongside `group: \"...\"` to opt out of\n  // Custom Styling.\n  advanced: true,\n  ...props,\n  type: \"buttonGroup\",\n  options: [\n    { icon: Ban, ariaLabel: \"No border\", value: \"none\" },\n    { label: \"THIN\", value: \"thin\" },\n    { label: \"MD\", value: \"medium\" },\n    { label: \"THICK\", value: \"thick\" },\n  ],\n});\n\nexport const getBorderColorField: (\n  props: Readonly<Omit<ColorSelectFieldSchema, \"type\">>,\n) => ColorSelectFieldSchema = getColorField;\n\n/**\n * Border width class mapping - full literal Tailwind classes for scanner.\n */\nexport const borderWidthClasses: {\n  readonly none: \"border-0\";\n  readonly thin: \"border\";\n  readonly medium: \"border-2\";\n  readonly thick: \"border-4\";\n} = {\n  none: \"border-0\",\n  thin: \"border\",\n  medium: \"border-2\",\n  thick: \"border-4\",\n} as const satisfies Record<BorderWidthOptions, string>;\n\n/**\n * Border color class mapping - full literal Tailwind classes for scanner.\n */\nexport const borderColorClasses: {\n  readonly background: \"border-background\";\n  readonly foreground: \"border-foreground\";\n  readonly primary: \"border-primary\";\n  readonly secondary: \"border-secondary\";\n  readonly accent: \"border-accent\";\n  readonly border: \"border-border\";\n  readonly muted: \"border-muted\";\n  readonly destructive: \"border-destructive\";\n  readonly transparent: \"border-transparent\";\n} = {\n  background: \"border-background\",\n  foreground: \"border-foreground\",\n  primary: \"border-primary\",\n  secondary: \"border-secondary\",\n  accent: \"border-accent\",\n  border: \"border-border\",\n  muted: \"border-muted\",\n  destructive: \"border-destructive\",\n  transparent: \"border-transparent\",\n} as const satisfies Record<ColorOptions, string>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