/**
 * The theme as the app should consume it.
 *
 * `astryx theme build` serialises tokens into loyaly.js but CANNOT serialise
 * the icon registry — those are React components. So the generated module
 * ships with `icons: undefined`, and every `<Icon icon="search"/>` silently
 * falls back to Astryx's built-in default glyphs instead of the theme's Lucide
 * set. Worse, if the two environments disagree about what has been registered,
 * it surfaces as a hydration mismatch on the SVG path data.
 *
 * Re-attaching `icons` here fixes both: <Theme> calls registerIcons() during
 * its own render, which runs top-down in BOTH the SSR pass and the client
 * hydration pass — so the registry is populated before any <Icon> descendant
 * renders, and the two passes agree.
 *
 * Consume the theme from '@/theme', never from '@/theme/loyaly' directly.
 */

import type {DefinedTheme} from '@astryxdesign/core/theme';
import {neutralIconRegistry} from '@astryxdesign/theme-neutral';
import {loyalyTheme as builtTheme} from './loyaly';

export const loyalyTheme: DefinedTheme = {
  ...builtTheme,
  icons: neutralIconRegistry,
};

export {neutralIconRegistry as loyalyIconRegistry};
