@react-hive/honey-layout 2.4.1 → 2.6.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/dist/components/HoneyOverlay.d.ts +28 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/HoneyLayoutContext.d.ts +4 -4
- package/dist/helpers/dom.helpers.d.ts +1 -0
- package/dist/{helpers.d.ts → helpers/helpers.d.ts} +1 -1
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/react.helpers.d.ts +2 -0
- package/dist/hooks/use-honey-overlay.d.ts +1 -1
- package/dist/hooks/use-register-honey-overlay.d.ts +10 -2
- package/dist/index.js +1263 -1204
- package/dist/providers/hooks/use-honey-overlays.d.ts +3 -3
- package/dist/types/types.d.ts +16 -3
- package/package.json +6 -5
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { HoneyActiveOverlay, HoneyOverlayId, Nullable } from '../types';
|
|
3
|
+
import { HoneyBoxProps } from './HoneyBox';
|
|
4
|
+
type HoneyOverlayProps = HTMLAttributes<HTMLDivElement> & HoneyBoxProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The content of the overlay, either as static nodes or a function that receives the active overlay object.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode | ((overlay: Nullable<HoneyActiveOverlay>) => ReactNode);
|
|
9
|
+
/**
|
|
10
|
+
* Determines whether the overlay is currently active.
|
|
11
|
+
*/
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* An optional unique identifier for the overlay.
|
|
15
|
+
*/
|
|
16
|
+
overlayId?: HoneyOverlayId;
|
|
17
|
+
/**
|
|
18
|
+
* Callback invoked when the overlay is closed.
|
|
19
|
+
*/
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Component for creating overlays that can handle active states and keyboard interactions.
|
|
24
|
+
*
|
|
25
|
+
* @param {HoneyOverlayProps} props - The properties for configuring the overlay.
|
|
26
|
+
*/
|
|
27
|
+
export declare const HoneyOverlay: ({ children, isActive, overlayId, onClose, ...props }: HoneyOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DefaultTheme, Interpolation } from 'styled-components';
|
|
2
|
-
import { HoneyColorKey, HoneyCSSColor, HoneyDimensionName, HoneyFontName, HoneyOverlayConfig, HoneySpacings, Nullable, HoneyScreenState, HoneyCSSDimensionUnit, HoneyCSSDimensionValue, HoneyCSSMultiValue, HoneyOverlayId,
|
|
2
|
+
import { HoneyColorKey, HoneyCSSColor, HoneyDimensionName, HoneyFontName, HoneyOverlayConfig, HoneySpacings, Nullable, HoneyScreenState, HoneyCSSDimensionUnit, HoneyCSSDimensionValue, HoneyCSSMultiValue, HoneyOverlayId, HoneyActiveOverlay } from '../types';
|
|
3
3
|
import { ResolveSpacingResult } from '../helpers';
|
|
4
4
|
/**
|
|
5
5
|
* Function to unregister a previously registered overlay.
|
|
@@ -10,7 +10,7 @@ export type HoneyUnregisterOverlay = (targetOverlayId: HoneyOverlayId) => void;
|
|
|
10
10
|
*
|
|
11
11
|
* @param {HoneyOverlayConfig} overlayConfig - Configuration object for the overlay.
|
|
12
12
|
*/
|
|
13
|
-
export type HoneyRegisterOverlay = (overlayConfig: HoneyOverlayConfig) =>
|
|
13
|
+
export type HoneyRegisterOverlay = (overlayConfig: HoneyOverlayConfig) => HoneyActiveOverlay;
|
|
14
14
|
export type HoneyLayoutContextValue = {
|
|
15
15
|
/**
|
|
16
16
|
* Represents the theme object.
|
|
@@ -21,9 +21,9 @@ export type HoneyLayoutContextValue = {
|
|
|
21
21
|
*/
|
|
22
22
|
screenState: HoneyScreenState;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Active overlays.
|
|
25
25
|
*/
|
|
26
|
-
overlays:
|
|
26
|
+
overlays: HoneyActiveOverlay[];
|
|
27
27
|
/**
|
|
28
28
|
* Function to register a new overlay.
|
|
29
29
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getFocusableHTMLElements: (container: HTMLElement, selectors?: string[]) => NodeListOf<HTMLElement>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { ExecutionContext, StyleFunction, css } from 'styled-components';
|
|
3
|
-
import { Nullable, HoneyBreakpointName, HoneyCSSArrayValue, HoneyCSSDimensionShortHandValue, HoneyCSSDimensionUnit, HoneyCSSMultiValue, HoneyCSSMediaRule, HoneySpacings, HoneyColorKey, HoneyFontName, HoneyCSSColor, HoneyDimensionName, HoneyPrefixedCSSProperties, HoneyBreakpoints, HoneyScreenState, HoneyCSSDimensionValue } from '
|
|
3
|
+
import { Nullable, HoneyBreakpointName, HoneyCSSArrayValue, HoneyCSSDimensionShortHandValue, HoneyCSSDimensionUnit, HoneyCSSMultiValue, HoneyCSSMediaRule, HoneySpacings, HoneyColorKey, HoneyFontName, HoneyCSSColor, HoneyDimensionName, HoneyPrefixedCSSProperties, HoneyBreakpoints, HoneyScreenState, HoneyCSSDimensionValue } from '../types';
|
|
4
4
|
export declare const generateUniqueId: () => string;
|
|
5
5
|
/**
|
|
6
6
|
* Conditional type to determine the return type of the `resolveSpacing` function.
|
|
@@ -21,5 +21,5 @@ type UseHoneyOverlayOptions = {
|
|
|
21
21
|
* });
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
export declare const useHoneyOverlay: (targetOverlayId: HoneyOverlayId, { onKeyUp }?: UseHoneyOverlayOptions) => import('../types').
|
|
24
|
+
export declare const useHoneyOverlay: (targetOverlayId: HoneyOverlayId, { onKeyUp }?: UseHoneyOverlayOptions) => import('../types').HoneyActiveOverlay | undefined;
|
|
25
25
|
export {};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HoneyActiveOverlay, HoneyOverlayConfig, Nullable } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* A hook for registering and managing an overlay in the layout system.
|
|
4
|
+
*
|
|
5
|
+
* @param {boolean} isRegister - A flag indicating whether the overlay should be registered.
|
|
6
|
+
* @param {HoneyOverlayConfig} overlayConfig - Configuration object specifying overlay behavior.
|
|
7
|
+
*
|
|
8
|
+
* @returns {Nullable<HoneyActiveOverlay>} - The registered overlay instance, or null if not registered.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useRegisterHoneyOverlay: (isRegister: boolean, overlayConfig: HoneyOverlayConfig) => Nullable<HoneyActiveOverlay>;
|