@vaneui/ui 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,9 +12,11 @@ import { ColTheme } from '../ui/theme/colTheme';
12
12
  import { StackTheme } from '../ui/theme/stackTheme';
13
13
  import { SectionTheme } from "../ui/theme/sectionTheme";
14
14
  import { GridTheme } from "../ui/theme/gridTheme";
15
- import { ButtonProps, GridProps, TypographyComponentProps, CardProps, RowProps, ColProps, StackProps, BadgeProps, ChipProps, DividerProps, ContainerProps, SectionProps } from "../ui/props/props";
15
+ import { BadgeProps, ButtonProps, CardProps, ChipProps, ColProps, ContainerProps, DividerProps, GridProps, RowProps, SectionProps, StackProps, TypographyComponentProps } from "../ui/props/props";
16
16
  import { DeepPartial } from "../utils/deepPartial";
17
- export interface ThemeProps {
17
+ export declare const COMPONENT_KEYS: readonly ["button", "badge", "chip", "card", "divider", "row", "col", "stack", "section", "grid3", "grid4", "pageTitle", "sectionTitle", "title", "text", "link", "list", "listItem"];
18
+ export type ComponentKey = typeof COMPONENT_KEYS[number];
19
+ export interface ThemeProps extends Record<ComponentKey, ComponentTheme<object, object>> {
18
20
  button: ComponentTheme<ButtonProps, ButtonTheme<ButtonProps>>;
19
21
  badge: ComponentTheme<BadgeProps, BadgeTheme<BadgeProps>>;
20
22
  chip: ComponentTheme<ChipProps, ChipTheme<ChipProps>>;
@@ -32,15 +34,17 @@ export interface ThemeProps {
32
34
  title: ComponentTheme<TypographyComponentProps, TypographyComponentTheme<TypographyComponentProps>>;
33
35
  text: ComponentTheme<TypographyComponentProps, TypographyComponentTheme<TypographyComponentProps>>;
34
36
  link: ComponentTheme<TypographyComponentProps, TypographyComponentTheme<TypographyComponentProps>>;
35
- listItem: ComponentTheme<TypographyComponentProps, TypographyComponentTheme<TypographyComponentProps>>;
36
37
  list: ComponentTheme<TypographyComponentProps, TypographyComponentTheme<TypographyComponentProps>>;
38
+ listItem: ComponentTheme<TypographyComponentProps, TypographyComponentTheme<TypographyComponentProps>>;
37
39
  }
38
40
  export type PartialTheme = DeepPartial<ThemeProps>;
39
41
  export declare const defaultTheme: ThemeProps;
42
+ export type ThemeDefaults = Partial<Record<ComponentKey, Record<string, boolean>>>;
40
43
  export interface ThemeProviderProps {
41
44
  children: React.ReactNode;
42
45
  theme?: PartialTheme;
46
+ themeDefaults?: ThemeDefaults;
43
47
  themeOverride?: (theme: ThemeProps) => ThemeProps;
44
48
  }
45
- export declare function ThemeProvider({ children, theme: themeObject, themeOverride }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
49
+ export declare function ThemeProvider({ children, theme: themeObject, themeDefaults, themeOverride }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
46
50
  export declare function useTheme(): ThemeProps;
@@ -4,9 +4,9 @@ import { HideTheme } from "../layout/hideTheme";
4
4
  import { ItemsTheme } from "../layout/itemsTheme";
5
5
  import { JustifyTheme } from "../layout/justifyTheme";
6
6
  import { PositionTheme } from "../layout/positionTheme";
7
+ import { FontStyleTheme } from "../typography/fontStyleTheme";
7
8
  import { FontFamilyTheme } from "../typography/fontFamilyTheme";
8
9
  import { FontWeightTheme } from "../typography/fontWeightTheme";
9
- import { FontStyleTheme } from "../typography/fontStyleTheme";
10
10
  import { TextDecorationTheme } from "../typography/textDecorationTheme";
11
11
  import { TextTransformTheme } from "../typography/textTransformTheme";
12
12
  import { TextAlignTheme } from "../typography/textAlignTheme";
@@ -36,8 +36,8 @@ export interface BaseComponentTheme<P> {
36
36
  export declare class ComponentTheme<P extends object, TThemes extends object> {
37
37
  readonly tag: React.ElementType;
38
38
  readonly base: string;
39
- readonly defaults: Partial<P>;
40
39
  readonly themes: TThemes;
40
+ defaults: Partial<P>;
41
41
  constructor(tag: React.ElementType, base: string, subThemes: DeepPartial<TThemes>, defaults?: Partial<P>);
42
42
  getClasses(props: P, defaults?: Partial<P>): string[];
43
43
  }
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Pick the first truthy key from props, then from defaults, then fallback.
3
3
  */
4
- export declare function pickKey<P, K extends keyof P>(props: Partial<P>, defaults: Partial<P>, keys: readonly K[], fallback?: K): K | undefined;
4
+ export declare function pickFirstTruthyKey<P, K extends keyof P>(props: Partial<P>, defaults: Partial<P>, keys: readonly K[]): K | undefined;