import type { ReactNativeTokens } from '@aws-amplify/ui'; import type { ButtonStyles, CheckboxStyles, DividerStyles, ErrorMessageStyles, HeadingStyles, IconStyles, IconButtonStyles, LabelStyles, PasswordFieldStyles, PhoneNumberFieldStyles, RadioStyles, RadioGroupStyles, TabsStyles, TextFieldStyles } from '../primitives'; type ComponentTheme = Output extends 'output' ? ComponentType : ((tokens: StrictTheme['tokens']) => ComponentType) | ComponentType; export type Components = { button?: ComponentTheme; checkbox?: ComponentTheme; divider?: ComponentTheme; errorMessage?: ComponentTheme; heading?: ComponentTheme; icon?: ComponentTheme; iconButton?: ComponentTheme; label?: ComponentTheme; passwordField?: ComponentTheme; phoneNumberField?: ComponentTheme; radio?: ComponentTheme; radioGroup?: ComponentTheme; tabs?: ComponentTheme; textField?: ComponentTheme; }; export type ColorMode = 'light' | 'dark' | 'system' | null; export type Override = Omit & { colorMode?: ColorMode; }; export type StrictTokens = ReactNativeTokens<'required'>; export type Tokens = ReactNativeTokens<'optional'>; type OmittedComponents = 'checkbox' | 'divider' | 'tabs'; /** * A custom Theme with all properties optional. */ export interface Theme { /** * Custom component styles */ components?: Omit, OmittedComponents>; /** * Component and component agnostic tokens. */ tokens?: Tokens; /** * Overrides allows switching between design tokens in different contexts, * like light and dark mode. */ overrides?: Override[]; spaceModifier?: number; } export interface DefaultTheme { tokens: ReactNativeTokens<'default'>; } /** * Fully built theme that has styling based * on the design tokens and all design tokens have added fields * to be used in Javascript/Typescript. * * `components` remains an optional property, it is only populated * via custom themes. */ export interface StrictTheme { tokens: StrictTokens; components?: Components<'output'>; overrides?: Override[]; spaceModifier?: number; } export {};