anu-verzum 1.9.0 → 1.10.0

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.
package/README.md CHANGED
@@ -121,6 +121,8 @@ The following types are exported from `anu-verzum` for use in consumer projects:
121
121
  |------|-------------|
122
122
  | `AnuElement` | The virtual-DOM element descriptor (return type of `createElement`) |
123
123
  | `AnuChild` | Union of all valid JSX child types: `AnuElement \| string \| number \| boolean \| null \| undefined` |
124
+ | `AnuNode` | Recursive child tree type used by `Props.children` — `AnuChild \| AnuNode[]`; accepts single children, arrays, and nested arrays (e.g. from `.map()`) |
125
+ | `AnuCSSProperties` | Style object type used by `Props.style` — `Partial<Record<keyof CSSStyleDeclaration, string \| number>>`; allows numeric values for unitless CSS properties such as `flexShrink`, `zIndex`, `opacity` |
124
126
  | `Props` | Base props type — all component prop objects should extend this |
125
127
  | `Ref<T>` | Reference object created by `Anu.createRef<T>()` |
126
128
  | `Component<P, S>` | Abstract base class for class components |
@@ -6,12 +6,12 @@ export type ContextValue<T> = {
6
6
  value: T;
7
7
  };
8
8
  };
9
- export type ConsumerProps<T> = {
9
+ export type ConsumerProps<T> = Props & {
10
10
  children: (ctx: ContextValue<T>) => AnuElement | null;
11
11
  };
12
12
  export type Context<T extends Record<string, any> = Record<string, any>> = {
13
13
  Provider: new (props: Props & Partial<T>) => Component;
14
- Consumer: new (props: ConsumerProps<T>) => Component;
14
+ Consumer: new (props: ConsumerProps<T>) => Component<ConsumerProps<T>>;
15
15
  ContextProvider: new (props: Props) => Component;
16
16
  ContextConsumer: new (props: Props) => Component;
17
17
  };
@@ -2,12 +2,10 @@ import { AnuElement, Props } from '../elements';
2
2
  type FeaturesMap = Record<string, boolean>;
3
3
  export interface FeatureProviderProps extends Props {
4
4
  features: FeaturesMap;
5
- children?: AnuElement[];
6
5
  }
7
6
  export interface FeatureToggleProps extends Props {
8
7
  name: string;
9
8
  defaultComponent?: AnuElement | null;
10
- children?: AnuElement[];
11
9
  }
12
10
  declare const Feature: {
13
11
  Provider: new (props: Props) => import("./Component").Component;
@@ -17,7 +17,6 @@ export interface HistoryLinkProps extends Props {
17
17
  to: string;
18
18
  replace?: boolean;
19
19
  ariaLabel?: string;
20
- children?: AnuElement[];
21
20
  }
22
21
  export interface HistoryRedirectProps extends Props {
23
22
  to: string;
@@ -3,7 +3,6 @@ export interface IntlProviderProps extends Props {
3
3
  locale: string | null;
4
4
  messages: Record<string, Record<string, string>>;
5
5
  defaultLocale?: string;
6
- children?: AnuElement[];
7
6
  }
8
7
  export interface FormattedMessageProps extends Props {
9
8
  id: string;
@@ -1,10 +1,12 @@
1
1
  export declare const TEXT_ELEMENT: "TEXT_ELEMENT";
2
2
  export type AnuChild = AnuElement | string | number | boolean | null | undefined;
3
+ export type AnuNode = AnuChild | AnuNode[];
4
+ export type AnuCSSProperties = Partial<Record<keyof CSSStyleDeclaration, string | number>>;
3
5
  export type Props = {
4
- children?: AnuChild | AnuChild[];
6
+ children?: AnuNode;
5
7
  ref?: Ref<any>;
6
8
  key?: string | number;
7
- style?: Partial<CSSStyleDeclaration & Record<string, string>>;
9
+ style?: AnuCSSProperties;
8
10
  [key: string]: any;
9
11
  };
10
12
  export type Ref<T> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anu-verzum",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "A \"React-like\" UI library that supports JSX syntax, Redux-like state management, array-rendering, i18n, routing and many more.",
5
5
  "keywords": [
6
6
  "anu-verzum",