indicator-ui 0.1.40 → 0.1.41

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.
@@ -4,6 +4,7 @@ export * from './useDebouncedAccumulator';
4
4
  export * from './useDeepCompareEffect';
5
5
  export * from './useElementFixedOffset';
6
6
  export * from './useSyncedStateRef';
7
+ export * from './useAsyncState';
7
8
  export * from './useResettableTimeout';
8
9
  export * from './useDebouncedInvoker';
9
10
  export * from './useDidUpdateEffect';
@@ -28,7 +28,7 @@ type PropsType<T extends HTMLElement = HTMLElement> = [ref: SmartRefType<T>, opt
28
28
  export declare function useBackdropModal(...args: PropsType): {
29
29
  isShow: boolean;
30
30
  getIsShow: () => boolean;
31
- open: () => void;
31
+ open: () => Promise<void>;
32
32
  close: () => void;
33
33
  switching: () => void;
34
34
  reinit: () => void;
@@ -1,5 +1,5 @@
1
1
  import { RefObject } from "react";
2
- export type SmartRefType<T extends HTMLElement> = RefObject<T | null> | T | null | undefined;
2
+ export type SmartRefType<T extends HTMLElement> = RefObject<T | null> | T | null | undefined | (() => T | null | undefined);
3
3
  type SimpleRefElementWorkPropsType<T extends HTMLElement> = [
4
4
  ref?: SmartRefType<T>
5
5
  ];
@@ -0,0 +1,17 @@
1
+ import { SetStateAction } from "react";
2
+ /** Сеттеры состояния, возвращают примененное состояние */
3
+ type SettersType<T> = {
4
+ /** Решает промис после применения состояния и отрисовки `layout` и `paint` */
5
+ asyncEffect: (value: SetStateAction<T>) => Promise<T>;
6
+ /** Решает промис после применения состояния и отрисовки `layout` */
7
+ asyncLayout: (value: SetStateAction<T>) => Promise<T>;
8
+ /** Решает промис после применения состояния и изменения в `DOM` */
9
+ asyncDom: (value: SetStateAction<T>) => Promise<T>;
10
+ };
11
+ type ReturnType<T> = [
12
+ state: T,
13
+ set: SettersType<T>,
14
+ getState: () => T
15
+ ];
16
+ export declare function useAsyncState<T>(initialValue: T): ReturnType<T>;
17
+ export {};
@@ -34,4 +34,5 @@ export type InputFieldWrapperPropsType = {
34
34
  * Добавочные имена стилей. ```className="main-style addition-style-1 addition-style-2..."```
35
35
  * */
36
36
  additionStyle?: InputFieldWrapperAdditionStyleType;
37
+ theme?: "light" | "dark";
37
38
  };
@@ -1,2 +1,2 @@
1
1
  import { InputFieldWrapperPropsType } from '../types';
2
- export default function InputFieldWrapper({ children, labelText, hintText, name, isErrorHintText, helperLink, isError, viewRequired, additionStyle, display, }: InputFieldWrapperPropsType): JSX.Element;
2
+ export default function InputFieldWrapper({ children, labelText, hintText, name, isErrorHintText, helperLink, isError, viewRequired, additionStyle, display, theme, }: InputFieldWrapperPropsType): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indicator-ui",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/types/src/index.d.ts",
6
6
  "style": "dist/index.css",