@metamatopoeia/liquid-glass-core
v1.4.0
Published
Shared types, tokens, and utilities for Liquid Glass UI.
Readme
@metamatopoeia/liquid-glass-core
Shared types, design tokens, and utilities for the Liquid Glass UI component ecosystem.
Purpose
This package contains platform-agnostic artifacts consumed by both the web (@metamatopoeia/liquid-glass-ui) and future React Native (@metamatopoeia/liquid-glass-ui-native) packages:
- Type definitions —
LiquidGlassThemeInput,ResolvedThemeTokens,ThemePalette,GlassTokens, slot types, and all supporting interfaces. - Default tokens —
defaultLightTokensanddarkOverridescontaining the full default color palette, glass physics, typography, spacing, and z-index values. createTheme()— Pure token-merging function that deep-merges user overrides with defaults and resolves light/dark mode token sets. Returns aResolvedThemeTokensobject with no CSS or DOM dependencies.deepMerge()— Generic recursive object merge utility.
Installation
npm install @metamatopoeia/liquid-glass-coreZero runtime dependencies. This package is pure TypeScript — types, constants, and utility functions only.
API
createTheme(options?)
Deep-merges partial theme overrides with the default tokens and returns a resolved theme object containing both light and dark token sets.
import { createTheme } from '@metamatopoeia/liquid-glass-core';
const theme = createTheme({
palette: {
primary: { main: '#6366f1', dark: '#4338ca', light: '#818cf8' },
},
});
// theme.palette, theme.glass, theme.light, theme.dark, etc.deepMerge(target, ...sources)
Recursively merges plain objects. Arrays and non-object values are replaced, not merged.
defaultLightTokens / darkOverrides
The full default token set and dark mode overrides. Useful for inspecting defaults or building custom theme logic.
Types
All theme-related types are exported:
LiquidGlassThemeInput, ResolvedThemeTokens, ThemePalette, PaletteColor, StatusColor, GlassTokens, ThemeTypography, ThemeRadius, ThemeShadows, ThemeTransitions, ThemeSpacing, CallableSpacing, ThemeZIndex, ComponentName, DeepPartial, and all per-component slot types.
Platform Agnosticism
This package contains zero imports from react, react-dom, react-native, or any DOM/Node API. It compiles and runs in any JavaScript environment.
