@react-hive/honey-layout 4.0.0 → 4.2.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/HoneyBox.d.ts +5 -6
- package/dist/components/HoneyFlexBox.d.ts +2 -8
- package/dist/components/HoneyGrid/HoneyGrid.d.ts +3 -25
- package/dist/components/HoneyGrid/HoneyGridStyled.d.ts +4 -10
- package/dist/components/HoneyGridColumn/HoneyGridColumn.types.d.ts +1 -1
- package/dist/components/HoneyGridColumn/HoneyGridColumnStyled.d.ts +4 -10
- package/dist/components/HoneyLazyContent.d.ts +2 -2
- package/dist/components/HoneyList/HoneyList.d.ts +2 -3
- package/dist/components/HoneyList/HoneyList.types.d.ts +6 -10
- package/dist/components/HoneyList/HoneyListStyled.d.ts +4 -16
- package/dist/components/HoneyLoopingList/HoneyLoopingList.d.ts +3 -6
- package/dist/components/HoneyOverlay.d.ts +5 -5
- package/dist/components/HoneyStatusContent.d.ts +2 -2
- package/dist/contexts/HoneyLayoutContext.d.ts +13 -13
- package/dist/effects.d.ts +4 -4
- package/dist/helpers/helpers.d.ts +32 -31
- package/dist/hooks/use-honey-drag.d.ts +11 -11
- package/dist/hooks/use-honey-media-query.d.ts +2 -2
- package/dist/hooks/use-honey-overlay.d.ts +2 -2
- package/dist/hooks/use-honey-synthetic-scrollable-container.d.ts +4 -4
- package/dist/hooks/use-register-honey-overlay.d.ts +3 -3
- package/dist/index.js +350 -349
- package/dist/providers/HoneyLayoutProvider.d.ts +2 -2
- package/dist/providers/HoneyLayoutThemeOverride.d.ts +3 -3
- package/dist/types/css.types.d.ts +2 -2
- package/dist/types/data.types.d.ts +11 -14
- package/dist/types/state.types.d.ts +2 -2
- package/dist/types/types.d.ts +8 -8
- package/dist/utils.d.ts +20 -20
- package/package.json +10 -10
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DefaultTheme } from 'styled-components';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import { UseHoneyMediaQueryOptions } from '../hooks';
|
|
4
|
-
|
|
4
|
+
interface HoneyLayoutProviderContentProps {
|
|
5
5
|
mediaQueryOptions?: UseHoneyMediaQueryOptions;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
type HoneyLayoutProviderProps = HoneyLayoutProviderContentProps & {
|
|
8
8
|
theme: DefaultTheme;
|
|
9
9
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { DefaultTheme } from 'styled-components';
|
|
3
|
-
|
|
3
|
+
interface HoneyLayoutThemeOverrideProps {
|
|
4
4
|
theme: DefaultTheme;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
6
|
/**
|
|
7
7
|
* Provides a theme override context to its children.
|
|
8
8
|
* Merges the provided theme with the existing theme from the `ThemeContext`.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
10
|
+
* @param props - The props for `HoneyLayoutThemeOverride`.
|
|
11
11
|
*
|
|
12
12
|
* @returns The ThemeProvider with the merged theme applied to its children.
|
|
13
13
|
*/
|
|
@@ -119,7 +119,7 @@ export type HoneyPrefixedCSSProperties = {
|
|
|
119
119
|
/**
|
|
120
120
|
* Options for CSS @media at-rule.
|
|
121
121
|
*/
|
|
122
|
-
export
|
|
122
|
+
export interface HoneyCSSMediaRule {
|
|
123
123
|
operator?: 'not' | 'only';
|
|
124
124
|
mediaType?: 'all' | 'print' | 'screen' | 'speech';
|
|
125
125
|
width?: HoneyCSSDimensionValue;
|
|
@@ -133,5 +133,5 @@ export type HoneyCSSMediaRule = {
|
|
|
133
133
|
minResolution?: HoneyCSSResolutionValue;
|
|
134
134
|
maxResolution?: HoneyCSSResolutionValue;
|
|
135
135
|
update?: 'none' | 'slow' | 'fast';
|
|
136
|
-
}
|
|
136
|
+
}
|
|
137
137
|
export {};
|
|
@@ -5,7 +5,7 @@ import { HoneyKeyboardEventCode } from './dom.types';
|
|
|
5
5
|
export type HoneyEffectResultFn<Props extends object> = StyleFunction<Props>;
|
|
6
6
|
export type HoneyEffect<Config = unknown, Props extends object = object> = (config: Config) => HoneyEffectResultFn<Props>;
|
|
7
7
|
export type HoneyOverlayId = string;
|
|
8
|
-
export type
|
|
8
|
+
export type HoneyOverlayEventType = 'keyup';
|
|
9
9
|
/**
|
|
10
10
|
* Handler function for an overlay event listener.
|
|
11
11
|
*
|
|
@@ -17,19 +17,16 @@ export type HoneyOverlayEventListenerHandler = (keyCode: HoneyKeyboardEventCode,
|
|
|
17
17
|
/**
|
|
18
18
|
* A tuple representing an event listener, including the event type and the handler function.
|
|
19
19
|
*/
|
|
20
|
-
export type HoneyOverlayEventListener = [
|
|
21
|
-
HoneyOverlayEventListenerType,
|
|
22
|
-
HoneyOverlayEventListenerHandler
|
|
23
|
-
];
|
|
20
|
+
export type HoneyOverlayEventListener = [HoneyOverlayEventType, HoneyOverlayEventListenerHandler];
|
|
24
21
|
/**
|
|
25
22
|
* Configuration object for an overlay, used to specify the overlay's behavior and event handling.
|
|
26
23
|
*/
|
|
27
|
-
export
|
|
24
|
+
export interface HoneyOverlayConfig {
|
|
28
25
|
/**
|
|
29
26
|
* Custom overlay ID.
|
|
30
27
|
* Automatically generated if not passed.
|
|
31
28
|
*
|
|
32
|
-
* @default generates
|
|
29
|
+
* @default It generates automatically
|
|
33
30
|
*/
|
|
34
31
|
id?: HoneyOverlayId;
|
|
35
32
|
/**
|
|
@@ -44,11 +41,11 @@ export type HoneyOverlayConfig = {
|
|
|
44
41
|
* If `listenKeys` is provided, this will only be triggered for those keys.
|
|
45
42
|
*/
|
|
46
43
|
onKeyUp: HoneyOverlayEventListenerHandler;
|
|
47
|
-
}
|
|
44
|
+
}
|
|
48
45
|
/**
|
|
49
46
|
* Represents an overlay in the layout, allowing the registration of event listeners and notifying them when events occur.
|
|
50
47
|
*/
|
|
51
|
-
export
|
|
48
|
+
export interface HoneyActiveOverlay {
|
|
52
49
|
/**
|
|
53
50
|
* Unique identifier for the overlay.
|
|
54
51
|
*/
|
|
@@ -69,23 +66,23 @@ export type HoneyActiveOverlay = {
|
|
|
69
66
|
* @param type - The type of event to listen for.
|
|
70
67
|
* @param handler - The handler function to execute when the event is triggered.
|
|
71
68
|
*/
|
|
72
|
-
addListener: (type:
|
|
69
|
+
addListener: (type: HoneyOverlayEventType, handler: HoneyOverlayEventListenerHandler) => void;
|
|
73
70
|
/**
|
|
74
71
|
* Removes a specific event listener from the overlay.
|
|
75
72
|
*
|
|
76
73
|
* @param type - The type of event for the listener.
|
|
77
74
|
* @param handler - The handler function to remove.
|
|
78
75
|
*/
|
|
79
|
-
removeListener: (type:
|
|
76
|
+
removeListener: (type: HoneyOverlayEventType, handler: HoneyOverlayEventListenerHandler) => void;
|
|
80
77
|
/**
|
|
81
78
|
* Notifies all listeners of a specific event type.
|
|
82
79
|
*
|
|
83
|
-
* @param
|
|
80
|
+
* @param targetEventType - The type of event that occurred.
|
|
84
81
|
* @param keyCode - The code of the key that triggered the event.
|
|
85
82
|
* @param e - The original keyboard event.
|
|
86
83
|
*/
|
|
87
|
-
notifyListeners: (
|
|
88
|
-
}
|
|
84
|
+
notifyListeners: (targetEventType: HoneyOverlayEventType, keyCode: HoneyKeyboardEventCode, e: KeyboardEvent) => void;
|
|
85
|
+
}
|
|
89
86
|
/**
|
|
90
87
|
* Represents an item that has been flattened from a hierarchical data structure, with additional
|
|
91
88
|
* properties to support tracking its position and relationships within the hierarchy.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents the state of the screen layout.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export interface HoneyScreenState {
|
|
8
8
|
/** Indicates if the screen size is extra-small (xs). */
|
|
9
9
|
isXs: boolean;
|
|
10
10
|
/** Indicates if the screen size is small (sm). */
|
|
@@ -19,4 +19,4 @@ export type HoneyScreenState = {
|
|
|
19
19
|
isPortrait: boolean;
|
|
20
20
|
/** Indicates if the screen orientation is landscape. */
|
|
21
21
|
isLandscape: boolean;
|
|
22
|
-
}
|
|
22
|
+
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -9,20 +9,20 @@ import { HoneyCSSColor, HoneyCSSDimensionValue } from './css.types';
|
|
|
9
9
|
* - `lg`: Large devices
|
|
10
10
|
* - `xl`: Extra large devices
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export interface HoneyBreakpoints {
|
|
13
13
|
xs: number;
|
|
14
14
|
sm: number;
|
|
15
15
|
md: number;
|
|
16
16
|
lg: number;
|
|
17
17
|
xl: number;
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
19
|
export type HoneyBreakpointName = keyof HoneyBreakpoints;
|
|
20
|
-
export
|
|
20
|
+
export interface HoneyContainer {
|
|
21
21
|
/**
|
|
22
22
|
* Max container width in any CSS distance value.
|
|
23
23
|
*/
|
|
24
24
|
maxWidth: HoneyCSSDimensionValue;
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
/**
|
|
27
27
|
* Represents the theme configuration.
|
|
28
28
|
*/
|
|
@@ -61,7 +61,7 @@ declare module 'styled-components' {
|
|
|
61
61
|
/**
|
|
62
62
|
* Defines different spacing sizes available in the theme.
|
|
63
63
|
*/
|
|
64
|
-
export
|
|
64
|
+
export interface HoneySpacings {
|
|
65
65
|
/**
|
|
66
66
|
* The base spacing value in pixels.
|
|
67
67
|
*/
|
|
@@ -69,7 +69,7 @@ export type HoneySpacings = {
|
|
|
69
69
|
small?: number;
|
|
70
70
|
medium?: number;
|
|
71
71
|
large?: number;
|
|
72
|
-
}
|
|
72
|
+
}
|
|
73
73
|
/**
|
|
74
74
|
* Defines the color palette used in the theme.
|
|
75
75
|
*/
|
|
@@ -155,13 +155,13 @@ export interface HoneyColors extends BaseHoneyColors {
|
|
|
155
155
|
export type HoneyColorKey = {
|
|
156
156
|
[ColorType in keyof HoneyColors]: `${ColorType}.${keyof HoneyColors[ColorType] & string}`;
|
|
157
157
|
}[keyof HoneyColors];
|
|
158
|
-
export
|
|
158
|
+
export interface HoneyFont {
|
|
159
159
|
size: number;
|
|
160
160
|
family?: string;
|
|
161
161
|
weight?: number;
|
|
162
162
|
lineHeight?: number;
|
|
163
163
|
letterSpacing?: number;
|
|
164
|
-
}
|
|
164
|
+
}
|
|
165
165
|
/**
|
|
166
166
|
* Example of augmenting the fonts interface.
|
|
167
167
|
*
|
package/dist/utils.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ export declare const camelToDashCase: (inputString: string) => string;
|
|
|
3
3
|
/**
|
|
4
4
|
* Splits a string into an array of filtered from redundant spaces words.
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param inputString - The input string to be split.
|
|
7
7
|
*
|
|
8
|
-
* @returns
|
|
8
|
+
* @returns An array of words from the input string.
|
|
9
9
|
*/
|
|
10
10
|
export declare const splitStringIntoWords: (inputString: string) => string[];
|
|
11
11
|
/**
|
|
@@ -20,30 +20,30 @@ export declare const pxToRem: (px: number, base?: number) => string;
|
|
|
20
20
|
/**
|
|
21
21
|
* Calculates the Euclidean distance between two points in 2D space.
|
|
22
22
|
*
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
23
|
+
* @param startX - The X coordinate of the starting point.
|
|
24
|
+
* @param startY - The Y coordinate of the starting point.
|
|
25
|
+
* @param endX - The X coordinate of the ending point.
|
|
26
|
+
* @param endY - The Y coordinate of the ending point.
|
|
27
27
|
*
|
|
28
|
-
* @returns
|
|
28
|
+
* @returns The Euclidean distance between the two points.
|
|
29
29
|
*/
|
|
30
30
|
export declare const calculateEuclideanDistance: (startX: number, startY: number, endX: number, endY: number) => number;
|
|
31
31
|
/**
|
|
32
32
|
* Calculates the moving speed.
|
|
33
33
|
*
|
|
34
|
-
* @param
|
|
35
|
-
* @param
|
|
34
|
+
* @param delta - The change in position (distance).
|
|
35
|
+
* @param elapsedTime - The time taken to move the distance.
|
|
36
36
|
*
|
|
37
|
-
* @returns
|
|
37
|
+
* @returns The calculated speed, which is the absolute value of delta divided by elapsed time.
|
|
38
38
|
*/
|
|
39
39
|
export declare const calculateMovingSpeed: (delta: number, elapsedTime: number) => number;
|
|
40
40
|
/**
|
|
41
41
|
* Calculates the specified percentage of a given value.
|
|
42
42
|
*
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
43
|
+
* @param value - The value to calculate the percentage of.
|
|
44
|
+
* @param percentage - The percentage to calculate.
|
|
45
45
|
*
|
|
46
|
-
* @returns
|
|
46
|
+
* @returns The calculated percentage of the value.
|
|
47
47
|
*/
|
|
48
48
|
export declare const calculatePercentage: (value: number, percentage: number) => number;
|
|
49
49
|
/**
|
|
@@ -54,27 +54,27 @@ export declare const calculatePercentage: (value: number, percentage: number) =>
|
|
|
54
54
|
*
|
|
55
55
|
* @throws {Error} If alpha value is not between 0 and 1, or if the hex code is invalid.
|
|
56
56
|
*
|
|
57
|
-
* @returns
|
|
57
|
+
* @returns The 8-character HEX with alpha (RRGGBBAA) format color code, or null if input is invalid.
|
|
58
58
|
*/
|
|
59
59
|
export declare const convertHexToHexWithAlpha: (hex: string, alpha: number) => HoneyHEXColor;
|
|
60
60
|
/**
|
|
61
61
|
* Builds a media query string based on the provided options.
|
|
62
62
|
*
|
|
63
|
-
* @param
|
|
63
|
+
* @param rules - Conditions for the media query.
|
|
64
64
|
*
|
|
65
|
-
* @returns
|
|
65
|
+
* @returns The generated media query string.
|
|
66
66
|
*/
|
|
67
67
|
export declare const media: (rules: HoneyCSSMediaRule[]) => string;
|
|
68
|
-
|
|
68
|
+
interface HTMLElementTransformationValues {
|
|
69
69
|
translateX: number;
|
|
70
70
|
translateY: number;
|
|
71
|
-
}
|
|
71
|
+
}
|
|
72
72
|
/**
|
|
73
73
|
* Get various transformation values from the transformation matrix of an element.
|
|
74
74
|
*
|
|
75
|
-
* @param
|
|
75
|
+
* @param element - The element with a transformation applied.
|
|
76
76
|
*
|
|
77
|
-
* @returns
|
|
77
|
+
* @returns An object containing transformation values.
|
|
78
78
|
*/
|
|
79
79
|
export declare const getTransformationValues: (element: HTMLElement) => HTMLElementTransformationValues;
|
|
80
80
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-hive/honey-layout",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"lodash.merge": "4.6.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@eslint/js": "9.
|
|
48
|
+
"@eslint/js": "9.22.0",
|
|
49
49
|
"@mdx-js/rollup": "3.1.0",
|
|
50
50
|
"@testing-library/react": "16.2.0",
|
|
51
51
|
"@types/jest": "29.5.14",
|
|
@@ -55,17 +55,17 @@
|
|
|
55
55
|
"@types/react": "^18.3.18",
|
|
56
56
|
"@types/react-dom": "^18.3.5",
|
|
57
57
|
"@vitejs/plugin-react": "4.3.4",
|
|
58
|
-
"eslint": "9.
|
|
58
|
+
"eslint": "9.22.0",
|
|
59
59
|
"eslint-plugin-react": "7.37.4",
|
|
60
60
|
"jest": "29.7.0",
|
|
61
61
|
"jest-environment-jsdom": "29.7.0",
|
|
62
|
-
"prettier": "3.5.
|
|
63
|
-
"ts-jest": "29.2.
|
|
64
|
-
"typescript": "5.
|
|
65
|
-
"typescript-eslint": "8.
|
|
66
|
-
"vite": "6.
|
|
67
|
-
"vite-plugin-checker": "0.
|
|
68
|
-
"vite-plugin-dts": "4.5.
|
|
62
|
+
"prettier": "3.5.3",
|
|
63
|
+
"ts-jest": "29.2.6",
|
|
64
|
+
"typescript": "5.8.2",
|
|
65
|
+
"typescript-eslint": "8.26.1",
|
|
66
|
+
"vite": "6.2.2",
|
|
67
|
+
"vite-plugin-checker": "0.9.1",
|
|
68
|
+
"vite-plugin-dts": "4.5.3"
|
|
69
69
|
},
|
|
70
70
|
"jest": {
|
|
71
71
|
"preset": "ts-jest",
|