UNPKG

@geekyhawks/react-native-ui-components

Version:

A lightweight and reusable React Native UI components library with customizable Text, TextInput, FloatingLabelTextInput, Button, and more. Built with TypeScript, fully typed, and designed for easy integration into any React Native project.

115 lines 2.71 kB
"use strict"; /** * Theme Definitions * * Provides default light and dark themes with colors, spacing, and fontFamily. * Users can override these themes to create a custom design system for their app. * Supports optional user-defined extensions for colors and spacing. * * Author: Geeky Hawks FZE LLC */ Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultDarkTheme = exports.defaultLightTheme = exports.defaultDarkColors = exports.defaultLightColors = exports.defaultSpacing = exports.defaultFontFamily = void 0; exports.createTheme = createTheme; /** * createTheme * * Helper function to define a theme object with proper TypeScript typing. * Users can pass colors, spacing, fontFamily, and optional custom extensions. * * Example usage: * * const myTheme = createTheme({ * fontFamily: "Inter", * colors: { * background: "#fff", * border: "#dee2e6", * error: "#dc3545", * muted: "#6c757d", * onPrimary: "#ffffff"; * onSecondary: "#ffffff"; * onSurface: "#000000", * primary: "#007bff", * secondary: "#6c757d", * surface: "#f8f9fa", * text: "#111", * }, * spacing: { * none: 0, * xs: 4, * sm: 8, * md: 16, * lg: 24, * xl: 32, * }, * }); */ function createTheme(theme) { return theme; } /** * Default Font Family * Can be overridden per theme if needed. */ exports.defaultFontFamily = "System"; /** * Default spacing scale * Can be overridden per theme if needed. */ exports.defaultSpacing = { none: 0, xs: 4, sm: 8, md: 16, lg: 24, xl: 32, }; /** * Default light colors */ exports.defaultLightColors = { background: "#ffffff", border: "#dee2e6", error: "#dc3545", muted: "#6c757d", onPrimary: "#ffffff", onSecondary: "#ffffff", onSurface: "#111111", primary: "#007bff", secondary: "#6c757d", surface: "#f2f2f7", text: "#212529", }; /** * Default dark colors */ exports.defaultDarkColors = { background: "#000000", border: "#495057", error: "#fa5252", muted: "#9ca3af", onPrimary: "#000000", onSecondary: "#000000", onSurface: "#ffffff", primary: "#339af0", secondary: "#adb5bd", surface: "#1c1c1e", text: "#e5e5e5", }; /** * Default light theme */ exports.defaultLightTheme = createTheme({ fontFamily: exports.defaultFontFamily, colors: exports.defaultLightColors, spacing: exports.defaultSpacing, }); /** * Default dark theme */ exports.defaultDarkTheme = createTheme({ fontFamily: exports.defaultFontFamily, colors: exports.defaultDarkColors, spacing: exports.defaultSpacing, }); //# sourceMappingURL=Theme.js.map