indicator-ui 1.1.44 → 1.1.45

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.
Files changed (39) hide show
  1. package/dist/index.cjs +12 -12
  2. package/dist/index.js +11501 -10919
  3. package/dist/types/src/hooks/index.d.ts +2 -0
  4. package/dist/types/src/hooks/modalsFederation/anchoredModal/assets/animationPresets.d.ts +3 -0
  5. package/dist/types/src/hooks/modalsFederation/anchoredModal/assets/index.d.ts +1 -0
  6. package/dist/types/src/hooks/modalsFederation/anchoredModal/hooks/index.d.ts +1 -0
  7. package/dist/types/src/hooks/modalsFederation/anchoredModal/hooks/useAnchoredModalController.d.ts +22 -0
  8. package/dist/types/src/hooks/modalsFederation/anchoredModal/hooks/useAnchoredPositionCompute.d.ts +4 -0
  9. package/dist/types/src/hooks/modalsFederation/anchoredModal/hooks/useApplyPosition.d.ts +14 -0
  10. package/dist/types/src/hooks/modalsFederation/anchoredModal/hooks/useModalAnimation.d.ts +12 -0
  11. package/dist/types/src/hooks/modalsFederation/anchoredModal/hooks/useModalOutsideClick.d.ts +10 -0
  12. package/dist/types/src/hooks/modalsFederation/anchoredModal/hooks/usePositionOnOptionsChange.d.ts +3 -0
  13. package/dist/types/src/hooks/modalsFederation/anchoredModal/hooks/usePositionOnResize.d.ts +8 -0
  14. package/dist/types/src/hooks/modalsFederation/anchoredModal/hooks/useScrollBehavior.d.ts +12 -0
  15. package/dist/types/src/hooks/modalsFederation/anchoredModal/index.d.ts +2 -0
  16. package/dist/types/src/hooks/modalsFederation/anchoredModal/types/index.d.ts +30 -0
  17. package/dist/types/src/hooks/modalsFederation/context/ModalFederationProvider.d.ts +5 -0
  18. package/dist/types/src/hooks/modalsFederation/context/ModalPortal.d.ts +6 -0
  19. package/dist/types/src/hooks/modalsFederation/context/index.d.ts +3 -0
  20. package/dist/types/src/hooks/modalsFederation/context/main.d.ts +8 -0
  21. package/dist/types/src/hooks/modalsFederation/context/useModalFederationContext.d.ts +4 -0
  22. package/dist/types/src/hooks/modalsFederation/dialogModal/assets/animationPresets.d.ts +3 -0
  23. package/dist/types/src/hooks/modalsFederation/dialogModal/assets/index.d.ts +1 -0
  24. package/dist/types/src/hooks/modalsFederation/dialogModal/hooks/index.d.ts +1 -0
  25. package/dist/types/src/hooks/modalsFederation/dialogModal/hooks/useApplyPosition.d.ts +12 -0
  26. package/dist/types/src/hooks/modalsFederation/dialogModal/hooks/useDialogModalAnimation.d.ts +13 -0
  27. package/dist/types/src/hooks/modalsFederation/dialogModal/hooks/useDialogModalController.d.ts +14 -0
  28. package/dist/types/src/hooks/modalsFederation/dialogModal/hooks/useDialogModalOutsideClick.d.ts +9 -0
  29. package/dist/types/src/hooks/modalsFederation/dialogModal/hooks/useESCControl.d.ts +8 -0
  30. package/dist/types/src/hooks/modalsFederation/dialogModal/hooks/useFocusManager.d.ts +10 -0
  31. package/dist/types/src/hooks/modalsFederation/dialogModal/index.d.ts +2 -0
  32. package/dist/types/src/hooks/modalsFederation/dialogModal/types/index.d.ts +7 -0
  33. package/dist/types/src/hooks/modalsFederation/index.d.ts +3 -0
  34. package/dist/types/src/hooks/scroll/hooks/firstScrollableParent/index.d.ts +1 -0
  35. package/dist/types/src/hooks/scroll/hooks/firstScrollableParent/useFirstScrollableParent.d.ts +4 -0
  36. package/dist/types/src/hooks/scroll/hooks/index.d.ts +1 -0
  37. package/dist/types/src/hooks/useClickOutside.d.ts +9 -0
  38. package/docs/ForDev.md +1 -1
  39. package/package.json +1 -1
@@ -20,7 +20,9 @@ export * from './simpleElement';
20
20
  export * from './placement';
21
21
  export * from './forms';
22
22
  export * from './useScroll';
23
+ export * from './useClickOutside';
23
24
  export * from './scroll';
25
+ export * from './modalsFederation';
24
26
  export * from './utils';
25
27
  export * from './elementsRefsAdapteers';
26
28
  export * from './feed';
@@ -0,0 +1,3 @@
1
+ import { AnchoredModalAnimationFactoryCallback, AnchoredModalEnterAnimationPreset, AnchoredModalLeaveAnimationPreset } from '../types';
2
+ export declare const ENTER_ANIMATION_PRESETS: Record<AnchoredModalEnterAnimationPreset, AnchoredModalAnimationFactoryCallback>;
3
+ export declare const LEAVE_ANIMATION_PRESETS: Record<AnchoredModalLeaveAnimationPreset, AnchoredModalAnimationFactoryCallback>;
@@ -0,0 +1 @@
1
+ export * from './animationPresets';
@@ -0,0 +1 @@
1
+ export * from './useAnchoredModalController';
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { UseAnchoredModalOptions } from '../types';
3
+ import { useModalAnimation } from './useModalAnimation';
4
+ type UseModalAnimationOptions = Parameters<typeof useModalAnimation>[number];
5
+ type PropsType = UseAnchoredModalOptions & Pick<UseModalAnimationOptions, 'enter' | 'leave'> & {
6
+ anchorRef: React.RefObject<HTMLElement | null>;
7
+ modalRef: React.RefObject<HTMLElement | null>;
8
+ };
9
+ export declare function useAnchoredModalController(props: PropsType): {
10
+ open: () => Promise<void>;
11
+ close: () => Promise<unknown>;
12
+ toggle: () => Promise<unknown>;
13
+ applyPosition: (optionsInstance?: import('../../..').AnchoredModalPositionOptions & {
14
+ strategy?: import('../../..').AnchoredModalStrategy;
15
+ scrollableParentBehavior?: import('../../..').AnchoredModalScrollableParentBehavior;
16
+ windowScrollBehavior?: import('../../..').AnchoredModalWindowScrollBehavior;
17
+ closeOnClickOutside?: boolean;
18
+ } & {
19
+ zIndex?: number;
20
+ }) => void;
21
+ };
22
+ export {};
@@ -0,0 +1,4 @@
1
+ import { AnchoredModalPositionOptions, AnchoredModalPositionRect } from '../types';
2
+ export declare function useAnchoredPositionCompute(): {
3
+ calcAnchoredPosition: (element: HTMLElement, anchor: HTMLElement, options: AnchoredModalPositionOptions) => AnchoredModalPositionRect;
4
+ };
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { UseAnchoredModalOptions } from '../types';
3
+ type ApplyPositionOptions = UseAnchoredModalOptions & {
4
+ zIndex?: number;
5
+ };
6
+ type PropsType = {
7
+ anchorRef: React.RefObject<HTMLElement | null>;
8
+ modalRef: React.RefObject<HTMLElement | null>;
9
+ options: ApplyPositionOptions;
10
+ };
11
+ export declare function useApplyPosition(props: PropsType): {
12
+ applyPosition: (optionsInstance?: ApplyPositionOptions) => void;
13
+ };
14
+ export {};
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { AnchoredModalAnimationFactoryCallback, AnchoredModalEnterAnimationPreset, AnchoredModalLeaveAnimationPreset } from '../types';
3
+ type PropsType = {
4
+ modalRef: React.RefObject<HTMLElement | null>;
5
+ leave?: AnchoredModalAnimationFactoryCallback | AnchoredModalLeaveAnimationPreset;
6
+ enter?: AnchoredModalAnimationFactoryCallback | AnchoredModalEnterAnimationPreset;
7
+ };
8
+ export declare function useModalAnimation(props: PropsType): {
9
+ onLeave: () => Promise<unknown>;
10
+ onEnter: () => Promise<unknown>;
11
+ };
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ type PropsType = {
3
+ modalRef: React.RefObject<HTMLElement | null>;
4
+ anchorRef: React.RefObject<HTMLElement | null>;
5
+ isOpenRef: React.RefObject<boolean>;
6
+ closeOnClickOutside: boolean;
7
+ closeModal: () => void;
8
+ };
9
+ export declare function useModalOutsideClick(props: PropsType): void;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ type Callback<T> = (options: T) => void;
2
+ export declare function usePositionOnOptionsChange<T>(callback: Callback<T>, options: T): void;
3
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ type Callback = () => void;
3
+ type OptionsType = {
4
+ anchorRef: React.RefObject<HTMLElement | null>;
5
+ elementRef: React.RefObject<HTMLElement | null>;
6
+ };
7
+ export declare function usePositionOnResize(callback: Callback, opt: OptionsType): void;
8
+ export {};
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { useApplyPosition } from './useApplyPosition';
3
+ import { AnchoredModalScrollableParentBehavior, AnchoredModalWindowScrollBehavior } from '../types';
4
+ type PropsType = Pick<ReturnType<typeof useApplyPosition>, 'applyPosition'> & {
5
+ closeModal: () => void;
6
+ isOpenedRef: React.RefObject<boolean>;
7
+ windowScrollBehavior?: AnchoredModalWindowScrollBehavior;
8
+ scrollableParentBehavior?: AnchoredModalScrollableParentBehavior;
9
+ anchorRef: React.RefObject<HTMLElement | null>;
10
+ };
11
+ export declare function useScrollBehavior(props: PropsType): void;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './hooks';
2
+ export * from './types';
@@ -0,0 +1,30 @@
1
+ export type OffsetExtend = number;
2
+ export type ShiftExtend = number;
3
+ export type Placement = "top" | "bottom" | "left" | "right";
4
+ export type Align = 'start' | 'center' | 'end';
5
+ export type Boundary = 'viewport' | Element;
6
+ export type AnchoredModalEnterAnimationPreset = 'fade-in' | 'scale-in' | 'slide-in-top' | 'slide-in-bottom' | 'slide-in-left' | 'slide-in-right';
7
+ export type AnchoredModalLeaveAnimationPreset = 'fade-out' | 'scale-out' | 'slide-out-top' | 'slide-out-bottom' | 'slide-out-left' | 'slide-out-right';
8
+ export type AnchoredModalAnimationFactoryCallback = (el: HTMLElement) => gsap.core.Tween;
9
+ export type AnchoredModalPositionOptions = {
10
+ placement?: Placement;
11
+ align?: Align;
12
+ offset?: OffsetExtend;
13
+ shift?: ShiftExtend;
14
+ boundary?: Boundary;
15
+ };
16
+ export type AnchoredModalPositionRect = {
17
+ top: number;
18
+ bottom: number;
19
+ left: number;
20
+ right: number;
21
+ };
22
+ export type AnchoredModalScrollableParentBehavior = 'lock' | 'close' | 'none';
23
+ export type AnchoredModalWindowScrollBehavior = 'close' | 'reposition' | 'none';
24
+ export type AnchoredModalStrategy = 'absolute' | 'fixed';
25
+ export type UseAnchoredModalOptions = AnchoredModalPositionOptions & {
26
+ strategy?: AnchoredModalStrategy;
27
+ scrollableParentBehavior?: AnchoredModalScrollableParentBehavior;
28
+ windowScrollBehavior?: AnchoredModalWindowScrollBehavior;
29
+ closeOnClickOutside?: boolean;
30
+ };
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { ModalFederationContext } from './main';
3
+ type PropsType = Pick<React.ComponentProps<typeof ModalFederationContext.Provider>, 'children'>;
4
+ export declare function ModalFederationProvider(props: PropsType): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ type PropsType = {
3
+ children?: React.ReactNode;
4
+ };
5
+ export declare function ModalPortal(props: PropsType): React.ReactNode;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './useModalFederationContext';
2
+ export * from './ModalFederationProvider';
3
+ export * from './ModalPortal';
@@ -0,0 +1,8 @@
1
+ type ModalFederationContextType = {
2
+ portalNode: HTMLElement;
3
+ requestZIndex: () => number;
4
+ releaseZIndex: (z: number) => void;
5
+ };
6
+ export declare const ModalFederationContext: import('react').Context<ModalFederationContextType | null>;
7
+ export declare const START_Z_INDEX = 100;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare function useModalFederationContext(): {
2
+ requestZIndex: () => number;
3
+ releaseZIndex: (z: number) => void;
4
+ };
@@ -0,0 +1,3 @@
1
+ import { DialogModalAnimationFactoryCallback, DialogModalEnterAnimationPreset, DialogModalLeaveAnimationPreset } from '../types';
2
+ export declare const ENTER_ANIMATION_PRESETS: Record<DialogModalEnterAnimationPreset, DialogModalAnimationFactoryCallback>;
3
+ export declare const LEAVE_ANIMATION_PRESETS: Record<DialogModalLeaveAnimationPreset, DialogModalAnimationFactoryCallback>;
@@ -0,0 +1 @@
1
+ export * from './animationPresets';
@@ -0,0 +1 @@
1
+ export * from './useDialogModalController';
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ type ApplyPositionOptions = {
3
+ zIndex?: number;
4
+ };
5
+ type PropsType = {
6
+ backdropRef: React.RefObject<HTMLElement | null>;
7
+ options: ApplyPositionOptions;
8
+ };
9
+ export declare function useApplyPosition(props: PropsType): {
10
+ applyPosition: (optionsInstance?: ApplyPositionOptions) => void;
11
+ };
12
+ export {};
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { DialogModalAnimationFactoryCallback, DialogModalEnterAnimationPreset, DialogModalLeaveAnimationPreset } from '../types';
3
+ type PropsType = {
4
+ backdropRef: React.RefObject<HTMLElement | null>;
5
+ panelRef: React.RefObject<HTMLElement | null>;
6
+ leave?: DialogModalAnimationFactoryCallback | DialogModalLeaveAnimationPreset;
7
+ enter?: DialogModalAnimationFactoryCallback | DialogModalEnterAnimationPreset;
8
+ };
9
+ export declare function useDialogModalAnimation(props: PropsType): {
10
+ onLeave: () => Promise<unknown>;
11
+ onEnter: () => Promise<unknown>;
12
+ };
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { UseDialogModalOptions } from '../types';
3
+ import { useDialogModalAnimation } from './useDialogModalAnimation';
4
+ type UseDialogModalAnimationProps = Parameters<typeof useDialogModalAnimation>[number];
5
+ type PropsType = UseDialogModalOptions & Pick<UseDialogModalAnimationProps, 'enter' | 'leave'> & {
6
+ backdropRef: React.RefObject<HTMLElement | null>;
7
+ panelRef: React.RefObject<HTMLElement | null>;
8
+ };
9
+ export declare function useDialogModalController(props: PropsType): {
10
+ open: () => Promise<void>;
11
+ close: () => Promise<unknown>;
12
+ toggle: () => Promise<unknown>;
13
+ };
14
+ export {};
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ type PropsType = {
3
+ panelRef: React.RefObject<HTMLElement | null>;
4
+ closeModal: () => void;
5
+ isOpenRef?: React.RefObject<boolean>;
6
+ closeOnClickOutside: boolean;
7
+ };
8
+ export declare function useDialogModalOutsideClick(props: PropsType): void;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ type PropsType = {
3
+ backdropRef: React.RefObject<HTMLElement | null>;
4
+ closeModal: () => void;
5
+ closeOnEscKeyDown: boolean;
6
+ };
7
+ export declare function useESCControl(props: PropsType): void;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ type PropsType = {
3
+ isOpenRef: React.RefObject<boolean>;
4
+ panelRef: React.RefObject<HTMLElement | null>;
5
+ };
6
+ export declare function useFocusManager(props: PropsType): {
7
+ onOpen: () => void;
8
+ onClose: () => void;
9
+ };
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './hooks';
2
+ export * from './types';
@@ -0,0 +1,7 @@
1
+ export type DialogModalEnterAnimationPreset = 'fade' | 'scale' | 'slide-up' | 'slide-down';
2
+ export type DialogModalLeaveAnimationPreset = 'fade' | 'scale' | 'slide-up' | 'slide-down';
3
+ export type DialogModalAnimationFactoryCallback = (panel: HTMLElement, backdrop: HTMLElement) => gsap.core.Animation;
4
+ export type UseDialogModalOptions = {
5
+ closeOnClickOutside?: boolean;
6
+ closeOnEscKeyDown?: boolean;
7
+ };
@@ -0,0 +1,3 @@
1
+ export * from './anchoredModal';
2
+ export * from './dialogModal';
3
+ export * from './context';
@@ -0,0 +1 @@
1
+ export * from './useFirstScrollableParent';
@@ -0,0 +1,4 @@
1
+ export declare function useFirstScrollableParent(): {
2
+ getFirstScrollableParent: (element: HTMLElement) => HTMLElement | null;
3
+ isScrollableElement: (element: HTMLElement) => boolean;
4
+ };
@@ -6,3 +6,4 @@ export * from './scrollSync';
6
6
  export * from './scrollToAsync';
7
7
  export * from './elementScrollPosition';
8
8
  export * from './scrollMaster';
9
+ export * from './firstScrollableParent';
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ type RefElement = React.RefObject<HTMLElement | null>;
3
+ type PropsType = {
4
+ refs: Array<RefElement>;
5
+ callback: () => void;
6
+ isEnableRef?: React.RefObject<boolean>;
7
+ };
8
+ export declare function useClickOutside(props: PropsType): void;
9
+ export {};
package/docs/ForDev.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  В проекте есть два ключевых входа для модулей — **js/ts** и **scss**.
10
10
 
11
- #### 📂 `src/index.ts` (js/ts модули)
11
+ #### 📂 `src/index.tsx` (js/ts модули)
12
12
 
13
13
  Добавляем сюда все модули, которые должны быть доступны через:
14
14
 
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "react-components",
12
12
  "ui-kit"
13
13
  ],
14
- "version": "1.1.44",
14
+ "version": "1.1.45",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./dist/types/index.d.ts",