@fastkit/color-scheme
Advanced tools
Comparing version 0.12.8 to 0.12.9
@@ -1,5 +0,4 @@ | ||
import { Color } from '@fastkit/color'; | ||
import { ColorSource } from '@fastkit/color'; | ||
import { ColorSource, Color } from '@fastkit/color'; | ||
declare interface Bucket<RN, T, G, C, J> { | ||
interface Bucket<RN, T, G, C, J> { | ||
/** | ||
@@ -101,19 +100,23 @@ * Returns the index of the first occurrence of a value in an array, or -1 if it is not present. | ||
export declare const BULTIN_COLOR_VARIANTS: readonly ["contained", "outlined", "inverted", "plain"]; | ||
export declare type BultinColorVariant = typeof BULTIN_COLOR_VARIANTS[number]; | ||
export declare const COLOR_SCOPE_DEFAULTS_KEYS: readonly ["default", "disabled"]; | ||
export declare interface ColorPaletteBucket<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T = ColorPaletteItem<TN, PN, SN, VN, OK>, C = ColorPaletteContext<TN, PN, SN, VN, OK>, J = ColorPaletteItemJSON<PN>[]> extends Bucket<PN, T, Color, C, J> { | ||
sources: ColorPaletteContext<TN, PN, SN, VN, OK>[]; | ||
ctx: C; | ||
type ColorScopeOptionalKey<T extends string | readonly string[] = string> = T extends string ? T : T[number]; | ||
interface ColorPaletteItemContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
readonly theme: ColorTheme<TN, PN, SN, VN, OK>; | ||
readonly palette: ColorPaletteBucket<TN, PN, SN, VN, OK>; | ||
} | ||
export declare interface ColorPaletteContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
type ColorPaletteItemResolver<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = (ctx: ColorPaletteItemContext<TN, PN, SN, VN, OK>) => ColorSource; | ||
type ColorPaletteItemSource<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = [PN, ColorSource | ColorPaletteItemResolver<TN, PN, SN, VN, OK>]; | ||
type ColorPaletteItemJSON<PN extends string = string> = { | ||
name: PN; | ||
value: string; | ||
}; | ||
interface ColorPaletteContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
readonly theme: ColorTheme<TN, PN, SN, VN, OK>; | ||
} | ||
export declare type ColorPaletteItem<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
interface ColorPaletteBucket<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T = ColorPaletteItem<TN, PN, SN, VN, OK>, C = ColorPaletteContext<TN, PN, SN, VN, OK>, J = ColorPaletteItemJSON<PN>[]> extends Bucket<PN, T, Color, C, J> { | ||
sources: ColorPaletteContext<TN, PN, SN, VN, OK>[]; | ||
ctx: C; | ||
} | ||
type ColorPaletteItem<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
readonly source: ColorPaletteItemSource<TN, PN, SN, VN, OK>; | ||
@@ -128,4 +131,3 @@ readonly name: PN; | ||
}; | ||
export declare interface ColorPaletteItemContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
interface ColorScopesContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
@@ -135,48 +137,35 @@ readonly theme: ColorTheme<TN, PN, SN, VN, OK>; | ||
} | ||
export declare type ColorPaletteItemJSON<PN extends string = string> = { | ||
name: PN; | ||
value: string; | ||
}; | ||
export declare type ColorPaletteItemResolver<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = (ctx: ColorPaletteItemContext<TN, PN, SN, VN, OK>) => ColorSource; | ||
export declare type ColorPaletteItemSource<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = [PN, ColorSource | ColorPaletteItemResolver<TN, PN, SN, VN, OK>]; | ||
export declare interface ColorScheme<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> extends ColorSchemeInfo<TN, PN, SN, VN> { | ||
readonly variantSources: ColorVariantSource<VN>[]; | ||
readonly optionals: OK[]; | ||
readonly source: ColorSchemeSource<TN, PN, SN, VN, OK>; | ||
readonly themes: ColorThemeBucket<TN, PN, SN, VN, OK>; | ||
readonly scopeResolvers: ColorScopeResolvers<TN, PN, SN, VN, OK>; | ||
toJSON(): ColorSchemeJSON<TN, PN, SN, VN, OK>; | ||
interface ColorScopesBucket<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T = ColorScope<TN, PN, SN, VN, OK>, C = ColorScopesContext<TN, PN, SN, VN, OK>, J = ColorScopeJSON<SN, OK>[]> extends Bucket<SN, T, T, C, J> { | ||
sources: ColorScopeSource<TN, PN, SN, VN, OK>[]; | ||
ctx: C; | ||
} | ||
export declare interface ColorSchemeInfo<TN extends string, PN extends string, SN extends string, VN extends string> { | ||
readonly defaultTheme: TN; | ||
readonly themeNames: TN[]; | ||
readonly paletteNames: PN[]; | ||
readonly scopeNames: SN[]; | ||
readonly variants: VN[]; | ||
interface ColorScopeContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
readonly theme: ColorTheme<TN, PN, SN, VN, OK>; | ||
readonly palette: ColorPaletteBucket<TN, PN, SN, VN, OK>; | ||
readonly scopes: ColorScopesBucket<TN, PN, SN, VN, OK>; | ||
} | ||
export declare function colorSchemeInfoByScheme<TN extends string, PN extends string, SN extends string, VN extends string>(scheme: ColorScheme<TN, PN, SN, VN, string>): ColorSchemeInfo<TN, PN, SN, VN>; | ||
export declare interface ColorSchemeJSON<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
optionals?: OK[]; | ||
themeNames: TN[]; | ||
paletteNames: PN[]; | ||
scopeNames: SN[]; | ||
variants: VN[]; | ||
themes: ColorThemeJSON<TN, PN, SN, VN, OK>[]; | ||
} | ||
export declare interface ColorSchemeSource<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly variants?: readonly RawColorVariantSource<VN>[]; | ||
readonly optionals?: readonly OK[]; | ||
readonly scopeResolvers?: ColorScopeResolvers<TN, PN, SN, VN, OK> | (() => ColorScopeResolvers<TN, PN, SN, VN, OK>); | ||
readonly themes: ColorThemeSource<TN, PN, SN, VN, OK>[]; | ||
} | ||
export declare type ColorScope<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
type ColorScopeResolverResult = ColorSource | void | null | false; | ||
type ColorScopeResolver<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = (ctx: ColorScopeContext<TN, PN, SN, VN, OK> & ColorScope<TN, PN, SN, VN, OK>) => ColorScopeResolverResult; | ||
type ColorScopeResolvers<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
[K in OK]?: ColorScopeResolver<TN, PN, SN, VN, OK> | null | false; | ||
}; | ||
type ColorScopeOptionalValueMap<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T extends ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK> = ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK>> = { | ||
readonly [K in OK]?: T; | ||
}; | ||
type ColorScopeSource<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = [SN, ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK>] | [ | ||
SN, | ||
ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK>, | ||
ColorScopeOptionalValueMap<TN, PN, SN, VN, OK, ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK>> | ||
]; | ||
type ColorScopeJSON<SN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
name: SN; | ||
main: string; | ||
} & { | ||
[K in OK]?: string; | ||
}; | ||
type ColorScopeOptionals<OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
readonly [K in OK]?: Color; | ||
}; | ||
type ColorScope<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
@@ -193,11 +182,14 @@ readonly theme: ColorTheme<TN, PN, SN, VN, OK>; | ||
} & ColorScopeOptionals<OK>; | ||
export declare interface ColorScopeContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
readonly theme: ColorTheme<TN, PN, SN, VN, OK>; | ||
readonly palette: ColorPaletteBucket<TN, PN, SN, VN, OK>; | ||
readonly scopes: ColorScopesBucket<TN, PN, SN, VN, OK>; | ||
} | ||
export declare type ColorScopeDefault<TN extends string, PN extends string, SN extends string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
type ColorScopeDefaultSource<OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T extends ColorSource = ColorSource> = [T] | [ | ||
T, | ||
{ | ||
readonly [K in OK]?: T; | ||
} | ||
]; | ||
type ColorScopeDefaultJSON<OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
main: string; | ||
} & { | ||
[K in OK]?: string; | ||
}; | ||
type ColorScopeDefault<TN extends string, PN extends string, SN extends string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
theme: ColorTheme<TN, PN, SN, VN, OK>; | ||
@@ -211,82 +203,38 @@ palette: ColorPaletteBucket<TN, PN, SN, VN, OK>; | ||
}; | ||
export declare type ColorScopeDefaultJSON<OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
main: string; | ||
} & { | ||
[K in OK]?: string; | ||
}; | ||
export declare type ColorScopeDefaultResolver<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = (ctx: ColorScopeDefault<TN, PN, SN, VN, OK>) => ColorScopeDefaultSource<OK> | null | false | void; | ||
export declare type ColorScopeDefaults<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
[K in ColorScopeDefaultsKey]?: ColorScopeDefault<TN, PN, SN, VN, OK>; | ||
} & { | ||
toJSON(): ColorScopeDefaultsJSON<OK>; | ||
}; | ||
export declare type ColorScopeDefaultsJSON<OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
[K in ColorScopeDefaultsKey]?: ColorScopeDefaultJSON<OK>; | ||
}; | ||
export declare type ColorScopeDefaultsKey = typeof COLOR_SCOPE_DEFAULTS_KEYS[number]; | ||
export declare type ColorScopeDefaultSource<OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T extends ColorSource = ColorSource> = [T] | [ | ||
T, | ||
{ | ||
readonly [K in OK]?: T; | ||
} | ||
]; | ||
export declare type ColorScopeDefaultsResolver<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = (ctx: { | ||
type ColorScopeDefaultResolver<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = (ctx: ColorScopeDefault<TN, PN, SN, VN, OK>) => ColorScopeDefaultSource<OK> | null | false | void; | ||
type ColorScopeDefaultsResolver<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = (ctx: { | ||
theme: ColorTheme<TN, PN, SN, VN, OK>; | ||
palette: ColorPaletteBucket<TN, PN, SN, VN, OK>; | ||
}) => ColorScopeDefaultsSource<TN, PN, SN, VN, OK> | null | false | void; | ||
export declare type ColorScopeDefaultsSource<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
declare const COLOR_SCOPE_DEFAULTS_KEYS: readonly ["default", "disabled"]; | ||
type ColorScopeDefaultsKey = (typeof COLOR_SCOPE_DEFAULTS_KEYS)[number]; | ||
type ColorScopeDefaultsSource<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
[K in ColorScopeDefaultsKey]?: ColorScopeDefaultSource<OK> | ColorScopeDefaultResolver<TN, PN, SN, VN, OK>; | ||
}; | ||
export declare type ColorScopeJSON<SN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
name: SN; | ||
main: string; | ||
type ColorScopeDefaultsJSON<OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
[K in ColorScopeDefaultsKey]?: ColorScopeDefaultJSON<OK>; | ||
}; | ||
type ColorScopeDefaults<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
[K in ColorScopeDefaultsKey]?: ColorScopeDefault<TN, PN, SN, VN, OK>; | ||
} & { | ||
[K in OK]?: string; | ||
toJSON(): ColorScopeDefaultsJSON<OK>; | ||
}; | ||
export declare type ColorScopeOptionalKey<T extends string | readonly string[] = string> = T extends string ? T : T[number]; | ||
export declare type ColorScopeOptionals<OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
readonly [K in OK]?: Color; | ||
interface ColorThemeSource<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly name: TN; | ||
readonly palette?: ColorPaletteItemSource<TN, PN, SN, VN, OK>[]; | ||
readonly scopes?: ColorScopeSource<TN, PN, SN, VN, OK>[]; | ||
readonly scopeDefaults?: ColorScopeDefaultsSource<TN, PN, SN, VN, OK> | ColorScopeDefaultsResolver<TN, PN, SN, VN, OK>; | ||
readonly scopeResolvers?: ColorScopeResolvers<TN, PN, SN, VN, OK> | (() => ColorScopeResolvers<TN, PN, SN, VN, OK>); | ||
} | ||
type ColorThemeJSON<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
name: TN; | ||
palette: ColorPaletteItemJSON<PN>[]; | ||
scopes: ColorScopeJSON<SN, OK>[]; | ||
scopeDefaults?: ColorScopeDefaultsJSON<OK>; | ||
}; | ||
export declare type ColorScopeOptionalValueMap<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T extends ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK> = ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK>> = { | ||
readonly [K in OK]?: T; | ||
}; | ||
export declare type ColorScopeResolver<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = (ctx: ColorScopeContext<TN, PN, SN, VN, OK> & ColorScope<TN, PN, SN, VN, OK>) => ColorScopeResolverResult; | ||
export declare type ColorScopeResolverResult = ColorSource | void | null | false; | ||
export declare type ColorScopeResolvers<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
[K in OK]?: ColorScopeResolver<TN, PN, SN, VN, OK> | null | false; | ||
}; | ||
export declare interface ColorScopesBucket<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T = ColorScope<TN, PN, SN, VN, OK>, C = ColorScopesContext<TN, PN, SN, VN, OK>, J = ColorScopeJSON<SN, OK>[]> extends Bucket<SN, T, T, C, J> { | ||
sources: ColorScopeSource<TN, PN, SN, VN, OK>[]; | ||
ctx: C; | ||
} | ||
export declare interface ColorScopesContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
interface ColorThemeContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
readonly theme: ColorTheme<TN, PN, SN, VN, OK>; | ||
readonly palette: ColorPaletteBucket<TN, PN, SN, VN, OK>; | ||
readonly themes: ColorThemeBucket<TN, PN, SN, VN, OK>; | ||
} | ||
export declare type ColorScopeSource<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = [SN, ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK>] | [ | ||
SN, | ||
ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK>, | ||
ColorScopeOptionalValueMap<TN, PN, SN, VN, OK, ColorSource | ColorScopeResolver<TN, PN, SN, VN, OK>> | ||
]; | ||
export declare type ColorTheme<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
type ColorTheme<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
readonly source: ColorThemeSource<TN, PN, SN, VN, OK>; | ||
@@ -306,60 +254,61 @@ readonly ctx: ColorThemeContext<TN, PN, SN, VN, OK>; | ||
}; | ||
export declare interface ColorThemeBucket<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T = ColorTheme<TN, PN, SN, VN, OK>, C = ColorThemesContext<TN, PN, SN, VN, OK>, J = ColorThemeJSON<TN, PN, SN, VN, OK>[]> extends Bucket<TN, T, T, C, J> { | ||
interface ColorThemesContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
} | ||
interface ColorThemeBucket<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey, T = ColorTheme<TN, PN, SN, VN, OK>, C = ColorThemesContext<TN, PN, SN, VN, OK>, J = ColorThemeJSON<TN, PN, SN, VN, OK>[]> extends Bucket<TN, T, T, C, J> { | ||
sources: ColorThemeSource<TN, PN, SN, VN, OK>[]; | ||
ctx: C; | ||
} | ||
export declare interface ColorThemeContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
readonly themes: ColorThemeBucket<TN, PN, SN, VN, OK>; | ||
declare const BULTIN_COLOR_VARIANTS: readonly ["contained", "outlined", "inverted", "plain"]; | ||
type BultinColorVariant = (typeof BULTIN_COLOR_VARIANTS)[number]; | ||
interface ColorVariantSource<VN extends string> { | ||
readonly name: VN; | ||
from?: BultinColorVariant; | ||
scss?: string | Promise<string> | ((scope: TemplateScope) => string | Promise<string>); | ||
} | ||
export declare type ColorThemeJSON<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> = { | ||
name: TN; | ||
palette: ColorPaletteItemJSON<PN>[]; | ||
scopes: ColorScopeJSON<SN, OK>[]; | ||
scopeDefaults?: ColorScopeDefaultsJSON<OK>; | ||
}; | ||
export declare interface ColorThemesContext<TN extends string = string, PN extends string = string, SN extends string = string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly scheme: ColorScheme<TN, PN, SN, VN, OK>; | ||
} | ||
export declare interface ColorThemeSource<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly name: TN; | ||
readonly palette?: ColorPaletteItemSource<TN, PN, SN, VN, OK>[]; | ||
readonly scopes?: ColorScopeSource<TN, PN, SN, VN, OK>[]; | ||
readonly scopeDefaults?: ColorScopeDefaultsSource<TN, PN, SN, VN, OK> | ColorScopeDefaultsResolver<TN, PN, SN, VN, OK>; | ||
type RawColorVariantSource<VN extends string> = VN | ColorVariantSource<VN>; | ||
interface ColorSchemeSource<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
readonly variants?: readonly RawColorVariantSource<VN>[]; | ||
readonly optionals?: readonly OK[]; | ||
readonly scopeResolvers?: ColorScopeResolvers<TN, PN, SN, VN, OK> | (() => ColorScopeResolvers<TN, PN, SN, VN, OK>); | ||
readonly themes: ColorThemeSource<TN, PN, SN, VN, OK>[]; | ||
} | ||
export declare type ColorVariant = ExtractKeys<ColorVariantSettings, '__ColorVariant__'>; | ||
export declare interface ColorVariantSettings { | ||
interface ColorSchemeJSON<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> { | ||
optionals?: OK[]; | ||
themeNames: TN[]; | ||
paletteNames: PN[]; | ||
scopeNames: SN[]; | ||
variants: VN[]; | ||
themes: ColorThemeJSON<TN, PN, SN, VN, OK>[]; | ||
} | ||
export declare interface ColorVariantSource<VN extends string> { | ||
readonly name: VN; | ||
from?: BultinColorVariant; | ||
scss?: string | Promise<string> | ((scope: TemplateScope) => string | Promise<string>); | ||
interface ColorSchemeInfo<TN extends string, PN extends string, SN extends string, VN extends string> { | ||
readonly defaultTheme: TN; | ||
readonly themeNames: TN[]; | ||
readonly paletteNames: PN[]; | ||
readonly scopeNames: SN[]; | ||
readonly variants: VN[]; | ||
} | ||
export declare function createColorScheme<TN extends string, PN extends string, SN extends string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey>(source: ColorSchemeSource<TN, PN, SN, VN, OK>): ColorScheme<TN, PN, SN, VN, OK>; | ||
declare type ExtractKeys<T extends object, D> = keyof T extends never ? D : keyof T; | ||
export declare type PaletteName = ExtractKeys<PaletteSettings, '__PaletteName__'>; | ||
export declare interface PaletteSettings { | ||
declare function colorSchemeInfoByScheme<TN extends string, PN extends string, SN extends string, VN extends string>(scheme: ColorScheme<TN, PN, SN, VN, string>): ColorSchemeInfo<TN, PN, SN, VN>; | ||
interface ColorScheme<TN extends string, PN extends string, SN extends string, VN extends string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey> extends ColorSchemeInfo<TN, PN, SN, VN> { | ||
readonly variantSources: ColorVariantSource<VN>[]; | ||
readonly optionals: OK[]; | ||
readonly source: ColorSchemeSource<TN, PN, SN, VN, OK>; | ||
readonly themes: ColorThemeBucket<TN, PN, SN, VN, OK>; | ||
readonly scopeResolvers: ColorScopeResolvers<TN, PN, SN, VN, OK>; | ||
toJSON(): ColorSchemeJSON<TN, PN, SN, VN, OK>; | ||
} | ||
export declare type RawColorVariantSource<VN extends string> = VN | ColorVariantSource<VN>; | ||
export declare type ScopeName = ExtractKeys<ScopeSettings, '__ScopeName__'>; | ||
export declare interface ScopeSettings { | ||
interface ThemeSettings { | ||
} | ||
export declare interface TemplateScope { | ||
interface PaletteSettings { | ||
} | ||
interface ScopeSettings { | ||
} | ||
interface ColorVariantSettings { | ||
} | ||
type ExtractKeys<T extends object, D> = keyof T extends never ? D : keyof T; | ||
type ThemeName = ExtractKeys<ThemeSettings, '__ThemeName__'>; | ||
type PaletteName = ExtractKeys<PaletteSettings, '__PaletteName__'>; | ||
type ScopeName = ExtractKeys<ScopeSettings, '__ScopeName__'>; | ||
type ColorVariant = ExtractKeys<ColorVariantSettings, '__ColorVariant__'>; | ||
interface TemplateScope { | ||
scheme: ColorScheme<any, any, any, any>; | ||
@@ -373,7 +322,4 @@ scssValues: string; | ||
export declare type ThemeName = ExtractKeys<ThemeSettings, '__ThemeName__'>; | ||
declare function createColorScheme<TN extends string, PN extends string, SN extends string, VN extends string = string, OK extends ColorScopeOptionalKey = ColorScopeOptionalKey>(source: ColorSchemeSource<TN, PN, SN, VN, OK>): ColorScheme<TN, PN, SN, VN, OK>; | ||
export declare interface ThemeSettings { | ||
} | ||
export { } | ||
export { BULTIN_COLOR_VARIANTS, BultinColorVariant, COLOR_SCOPE_DEFAULTS_KEYS, ColorPaletteBucket, ColorPaletteContext, ColorPaletteItem, ColorPaletteItemContext, ColorPaletteItemJSON, ColorPaletteItemResolver, ColorPaletteItemSource, ColorScheme, ColorSchemeInfo, ColorSchemeJSON, ColorSchemeSource, ColorScope, ColorScopeContext, ColorScopeDefault, ColorScopeDefaultJSON, ColorScopeDefaultResolver, ColorScopeDefaultSource, ColorScopeDefaults, ColorScopeDefaultsJSON, ColorScopeDefaultsKey, ColorScopeDefaultsResolver, ColorScopeDefaultsSource, ColorScopeJSON, ColorScopeOptionalKey, ColorScopeOptionalValueMap, ColorScopeOptionals, ColorScopeResolver, ColorScopeResolverResult, ColorScopeResolvers, ColorScopeSource, ColorScopesBucket, ColorScopesContext, ColorTheme, ColorThemeBucket, ColorThemeContext, ColorThemeJSON, ColorThemeSource, ColorThemesContext, ColorVariant, ColorVariantSettings, ColorVariantSource, PaletteName, PaletteSettings, RawColorVariantSource, ScopeName, ScopeSettings, TemplateScope, ThemeName, ThemeSettings, colorSchemeInfoByScheme, createColorScheme }; |
{ | ||
"name": "@fastkit/color-scheme", | ||
"version": "0.12.8", | ||
"version": "0.12.9", | ||
"description": "An implementation to control the schema associated with \"color\".", | ||
"keywords": [ | ||
"fastkit", | ||
"color" | ||
], | ||
"homepage": "https://github.com/dadajam4/fastkit/tree/main/packages/color-scheme#readme", | ||
"bugs": { | ||
"url": "https://github.com/dadajam4/fastkit/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/dadajam4/fastkit.git" | ||
}, | ||
"license": "MIT", | ||
"author": "dadajam4", | ||
"type": "module", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"types": "./dist/color-scheme.d.ts", | ||
"import": { | ||
"default": "./dist/color-scheme.mjs" | ||
} | ||
}, | ||
"./plugboy-dts-preserve": { | ||
"types": "./dist/plugboy-dts-preserve.d.ts", | ||
"import": { | ||
"default": "./dist/plugboy-dts-preserve.mjs" | ||
} | ||
}, | ||
"./*": "./dist/*" | ||
}, | ||
"main": "./dist/color-scheme.mjs", | ||
"types": "./dist/color-scheme.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
".": [ | ||
"./dist/color-scheme.d.ts" | ||
], | ||
"plugboy-dts-preserve": [ | ||
"./dist/plugboy-dts-preserve.d.ts" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"dependencies": { | ||
"@fastkit/color": "0.12.9", | ||
"@fastkit/tiny-logger": "0.12.9" | ||
}, | ||
"devDependencies": { | ||
"@fastkit/plugboy": "0.0.1" | ||
}, | ||
"peerDependencies": { | ||
"@fastkit/plugboy": "0.0.1" | ||
}, | ||
"buildOptions": { | ||
@@ -16,30 +72,13 @@ "name": "ColorScheme" | ||
}, | ||
"main": "./dist/color-scheme.mjs", | ||
"exports": { | ||
".": "./dist/color-scheme.mjs", | ||
"./dist/*": "./dist/*", | ||
"./package.json": "./package.json" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"types": "dist/color-scheme.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/dadajam4/fastkit.git" | ||
}, | ||
"keywords": [ | ||
"fastkit", | ||
"color" | ||
], | ||
"author": "dadajam4", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/dadajam4/fastkit/issues" | ||
}, | ||
"homepage": "https://github.com/dadajam4/fastkit/tree/main/packages/color-scheme#readme", | ||
"dependencies": { | ||
"@fastkit/color": "0.12.8", | ||
"@fastkit/tiny-logger": "0.12.8" | ||
"scripts": { | ||
"build": "plugboy build", | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", | ||
"eslint": "eslint . --ext ts,tsx,js,vue,html,yaml", | ||
"eslint:fix": "eslint . --ext ts,tsx,js,vue,html,yaml --fix", | ||
"format": "pnpm run eslint:fix", | ||
"lint": "pnpm run eslint", | ||
"stub": "plugboy stub", | ||
"test": "vitest run", | ||
"typecheck": "tsc --noEmit" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101167
10
1481
Yes
3
1
+ Added@esbuild/android-arm@0.17.19(transitive)
+ Added@esbuild/android-arm64@0.17.19(transitive)
+ Added@esbuild/android-x64@0.17.19(transitive)
+ Added@esbuild/darwin-arm64@0.17.19(transitive)
+ Added@esbuild/darwin-x64@0.17.19(transitive)
+ Added@esbuild/freebsd-arm64@0.17.19(transitive)
+ Added@esbuild/freebsd-x64@0.17.19(transitive)
+ Added@esbuild/linux-arm@0.17.19(transitive)
+ Added@esbuild/linux-arm64@0.17.19(transitive)
+ Added@esbuild/linux-ia32@0.17.19(transitive)
+ Added@esbuild/linux-loong64@0.17.19(transitive)
+ Added@esbuild/linux-mips64el@0.17.19(transitive)
+ Added@esbuild/linux-ppc64@0.17.19(transitive)
+ Added@esbuild/linux-riscv64@0.17.19(transitive)
+ Added@esbuild/linux-s390x@0.17.19(transitive)
+ Added@esbuild/linux-x64@0.17.19(transitive)
+ Added@esbuild/netbsd-x64@0.17.19(transitive)
+ Added@esbuild/openbsd-x64@0.17.19(transitive)
+ Added@esbuild/sunos-x64@0.17.19(transitive)
+ Added@esbuild/win32-arm64@0.17.19(transitive)
+ Added@esbuild/win32-ia32@0.17.19(transitive)
+ Added@esbuild/win32-x64@0.17.19(transitive)
+ Added@fastkit/color@0.12.9(transitive)
+ Added@fastkit/helpers@0.12.9(transitive)
+ Added@fastkit/plugboy@0.0.1(transitive)
+ Added@fastkit/tiny-logger@0.12.9(transitive)
+ Added@inquirer/figures@1.0.8(transitive)
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@jridgewell/gen-mapping@0.3.8(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedacorn@8.14.0(transitive)
+ Addedansi-escapes@4.3.2(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedany-promise@1.3.0(transitive)
+ Addedanymatch@3.1.3(transitive)
+ Addedarray-union@2.1.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedbundle-require@4.2.1(transitive)
+ Addedcac@6.7.14(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedchardet@0.7.0(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedcli-cursor@3.1.0(transitive)
+ Addedcli-spinners@2.9.2(transitive)
+ Addedcli-width@4.1.0(transitive)
+ Addedclone@1.0.4(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcommander@4.1.1(transitive)
+ Addedconfbox@0.1.8(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addeddefaults@1.0.4(transitive)
+ Addeddetect-indent@7.0.1(transitive)
+ Addeddetect-newline@4.0.1(transitive)
+ Addeddir-glob@3.0.1(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedesbuild@0.17.19(transitive)
+ Addedexeca@5.1.17.2.0(transitive)
+ Addedexternal-editor@3.1.0(transitive)
+ Addedfast-glob@3.3.2(transitive)
+ Addedfastq@1.17.1(transitive)
+ Addedfdir@6.4.2(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedget-stdin@9.0.0(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedgit-hooks-list@3.1.0(transitive)
+ Addedglob@10.4.59.3.5(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedglobby@11.1.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhuman-signals@2.1.04.3.1(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinquirer@9.3.7(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-interactive@1.0.0(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-plain-obj@4.1.0(transitive)
+ Addedis-stream@2.0.13.0.0(transitive)
+ Addedis-unicode-supported@0.1.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedjoycon@3.1.1(transitive)
+ Addedlilconfig@2.1.0(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedload-tsconfig@0.2.5(transitive)
+ Addedlodash.sortby@4.7.0(transitive)
+ Addedlog-symbols@4.1.0(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedmimic-fn@2.1.04.0.0(transitive)
+ Addedminimatch@8.0.49.0.5(transitive)
+ Addedminipass@4.2.87.1.2(transitive)
+ Addedmlly@1.7.3(transitive)
+ Addedms@2.1.3(transitive)
+ Addedmute-stream@1.0.0(transitive)
+ Addedmz@2.7.0(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addednpm-run-path@4.0.15.3.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonetime@5.1.26.0.0(transitive)
+ Addedora@5.4.1(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.14.0.0(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpathe@1.1.2(transitive)
+ Addedpicomatch@2.3.14.0.2(transitive)
+ Addedpirates@4.0.6(transitive)
+ Addedpkg-types@1.2.1(transitive)
+ Addedpostcss-load-config@3.1.4(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedresolve-from@5.0.0(transitive)
+ Addedrestore-cursor@3.1.0(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrollup@3.29.5(transitive)
+ Addedrun-async@3.0.0(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedrxjs@7.8.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.74.1.0(transitive)
+ Addedslash@3.0.0(transitive)
+ Addedsort-object-keys@1.1.3(transitive)
+ Addedsort-package-json@2.12.0(transitive)
+ Addedsource-map@0.8.0-beta.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedstrip-final-newline@2.0.03.0.0(transitive)
+ Addedsucrase@3.35.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedthenify@3.3.1(transitive)
+ Addedthenify-all@1.6.0(transitive)
+ Addedtinyglobby@0.2.10(transitive)
+ Addedtmp@0.0.33(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtr46@1.0.1(transitive)
+ Addedtree-kill@1.2.2(transitive)
+ Addedts-interface-checker@0.1.13(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtsup@6.7.0(transitive)
+ Addedtype-fest@0.21.3(transitive)
+ Addedufo@1.5.4(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwcwidth@1.0.1(transitive)
+ Addedwebidl-conversions@4.0.2(transitive)
+ Addedwhatwg-url@7.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@6.2.07.0.08.1.0(transitive)
+ Addedyaml@1.10.2(transitive)
+ Addedyoctocolors-cjs@2.1.2(transitive)
- Removed@fastkit/color@0.12.8(transitive)
- Removed@fastkit/helpers@0.12.8(transitive)
- Removed@fastkit/tiny-logger@0.12.8(transitive)
Updated@fastkit/color@0.12.9
Updated@fastkit/tiny-logger@0.12.9