@react-hive/honey-layout 5.6.0-beta → 6.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/LICENSE +1 -1
- package/dist/components/HoneyBox/HoneyBox.d.ts +14 -5
- package/dist/components/HoneyContextMenu/HoneyContextMenu.d.ts +3 -2
- package/dist/components/HoneyContextMenu/HoneyContextMenuContent.d.ts +3 -2
- package/dist/components/HoneyFlexBox.d.ts +11 -1
- package/dist/components/HoneyGrid/HoneyGridContext.d.ts +1 -1
- package/dist/components/HoneyGrid/HoneyGridStyled.d.ts +13 -2
- package/dist/components/HoneyGridColumn/HoneyGridColumn.d.ts +2 -1
- package/dist/components/HoneyGridColumn/HoneyGridColumn.types.d.ts +2 -1
- package/dist/components/HoneyGridColumn/HoneyGridColumnStyled.d.ts +15 -5
- package/dist/components/HoneyList/HoneyList.d.ts +2 -1
- package/dist/components/HoneyList/HoneyListStyled.d.ts +11 -1
- package/dist/components/HoneyOverlay.d.ts +2 -1
- package/dist/components/HoneyPopup/HoneyPopup.d.ts +6 -5
- package/dist/components/HoneyPopup/HoneyPopupContext.d.ts +0 -1
- package/dist/components/HoneyPopup/HoneyPopupStyled.d.ts +11 -1
- package/dist/components/HoneyPopup/hooks/use-honey-popup-interactions.d.ts +7 -6
- package/dist/components/HoneyPopup/hooks/use-honey-popup.d.ts +28 -9
- package/dist/contexts/HoneyLayoutContext.d.ts +4 -4
- package/dist/effects.d.ts +1 -1
- package/dist/helpers/helpers.d.ts +13 -12
- package/dist/helpers/react.helpers.d.ts +0 -2
- package/dist/hooks/use-honey-media-query.d.ts +3 -1
- package/dist/index.mjs +5959 -0
- package/dist/providers/HoneyLayoutProvider.d.ts +3 -6
- package/dist/providers/HoneyLayoutThemeOverride.d.ts +2 -2
- package/dist/types/css.types.d.ts +23 -67
- package/dist/types/data.types.d.ts +2 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/utils/utils.d.ts +2 -1
- package/package.json +21 -16
- package/dist/__mocks__/index.d.ts +0 -1
- package/dist/__mocks__/theme-mock.d.ts +0 -2
- package/dist/index.js +0 -5486
- package/dist/types/types.d.ts +0 -189
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { DefaultTheme } from 'styled-components';
|
|
2
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { HoneyStyleContextValue } from '@react-hive/honey-style';
|
|
3
3
|
import { UseHoneyMediaQueryOptions } from '../hooks';
|
|
4
|
-
interface
|
|
4
|
+
interface HoneyLayoutProviderProps extends HoneyStyleContextValue {
|
|
5
5
|
mediaQueryOptions?: UseHoneyMediaQueryOptions;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
theme: DefaultTheme;
|
|
9
|
-
}
|
|
10
|
-
export declare const HoneyLayoutProvider: ({ theme, ...props }: PropsWithChildren<HoneyLayoutProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const HoneyLayoutProvider: ({ children, theme, mediaQueryOptions, }: PropsWithChildren<HoneyLayoutProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
11
8
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { HoneyTheme } from '@react-hive/honey-style';
|
|
3
3
|
interface HoneyLayoutThemeOverrideProps {
|
|
4
|
-
theme:
|
|
4
|
+
theme: HoneyTheme;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Provides a theme override context to its children.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { HoneyBreakpointName, HoneyColorKey } from './types';
|
|
1
|
+
import { HoneyCSSDimensionUnit, HoneyBreakpointName, HoneyCSSDimensionValue, HoneyStyledContext, HoneyColor } from '@react-hive/honey-style';
|
|
3
2
|
/**
|
|
4
3
|
* The types for handling CSS properties and values, focusing on dimensions, colors, media queries, and other essential CSS concepts.
|
|
5
4
|
*/
|
|
@@ -13,51 +12,6 @@ import * as CSS from 'csstype';
|
|
|
13
12
|
* - `'portrait'` – Height is greater than width.
|
|
14
13
|
*/
|
|
15
14
|
export type HoneyCSSMediaOrientation = 'landscape' | 'portrait';
|
|
16
|
-
/**
|
|
17
|
-
* Represents a hexadecimal color value.
|
|
18
|
-
*
|
|
19
|
-
* Examples:
|
|
20
|
-
* - `'#ffffff'`
|
|
21
|
-
* - `'#123abc'`
|
|
22
|
-
* - `'#000'`
|
|
23
|
-
*/
|
|
24
|
-
export type HoneyHEXColor = `#${string}`;
|
|
25
|
-
/**
|
|
26
|
-
* Represents any valid CSS color, either a named color (like `'red'`, `'blue'`)
|
|
27
|
-
* or a hexadecimal color code (like `'#ff0000'`).
|
|
28
|
-
*/
|
|
29
|
-
export type HoneyCSSColor = CSS.DataType.NamedColor | HoneyHEXColor;
|
|
30
|
-
/**
|
|
31
|
-
* Represents absolute CSS dimension units.
|
|
32
|
-
*
|
|
33
|
-
* These units are fixed in physical measurements.
|
|
34
|
-
*
|
|
35
|
-
* - `'px'` — pixels
|
|
36
|
-
* - `'cm'` — centimeters
|
|
37
|
-
* - `'mm'` — millimeters
|
|
38
|
-
* - `'in'` — inches
|
|
39
|
-
* - `'pt'` — points
|
|
40
|
-
* - `'pc'` — picas
|
|
41
|
-
*/
|
|
42
|
-
type HoneyCSSAbsoluteDimensionUnit = 'px' | 'cm' | 'mm' | 'in' | 'pt' | 'pc';
|
|
43
|
-
/**
|
|
44
|
-
* Represents relative CSS dimension units.
|
|
45
|
-
*
|
|
46
|
-
* These units scale depending on the context.
|
|
47
|
-
*
|
|
48
|
-
* - `'em'` — relative to the font-size of the element
|
|
49
|
-
* - `'rem'` — relative to the font-size of the root element
|
|
50
|
-
* - `'%'` — percentage of the parent element
|
|
51
|
-
* - `'vh'` — 1% of the viewport height
|
|
52
|
-
* - `'vw'` — 1% of the viewport width
|
|
53
|
-
* - `'vmin'` — 1% of the smaller dimension of the viewport
|
|
54
|
-
* - `'vmax'` — 1% of the larger dimension of the viewport
|
|
55
|
-
*/
|
|
56
|
-
type HoneyCSSRelativeDimensionUnit = 'em' | 'rem' | '%' | 'vh' | 'vw' | 'vmin' | 'vmax';
|
|
57
|
-
/**
|
|
58
|
-
* Represents any valid CSS dimension unit, including both absolute and relative types.
|
|
59
|
-
*/
|
|
60
|
-
export type HoneyCSSDimensionUnit = HoneyCSSAbsoluteDimensionUnit | HoneyCSSRelativeDimensionUnit;
|
|
61
15
|
/**
|
|
62
16
|
* Represents CSS resolution units typically used in media queries.
|
|
63
17
|
*
|
|
@@ -123,17 +77,6 @@ export type HoneyCSSShorthandSpacingProperty = keyof Pick<CSS.Properties, 'margi
|
|
|
123
77
|
* Represents a subset of CSS properties that define color-related styles.
|
|
124
78
|
*/
|
|
125
79
|
export type HoneyCSSColorProperty = keyof Pick<CSS.Properties, 'color' | 'backgroundColor' | 'borderColor' | 'borderTopColor' | 'borderRightColor' | 'borderBottomColor' | 'borderLeftColor' | 'outlineColor' | 'textDecorationColor' | 'fill' | 'stroke'>;
|
|
126
|
-
/**
|
|
127
|
-
* Represents a numeric CSS dimension value with an optional specific unit.
|
|
128
|
-
*
|
|
129
|
-
* This type can represent:
|
|
130
|
-
* - A value with a specific CSS unit, such as `'8px'`, `'1.5rem'`, or `'100%'`.
|
|
131
|
-
* - A number without a unit, such as `'16'` (representing a unitless value).
|
|
132
|
-
* - The special value `'auto'` commonly used for flexible layout values.
|
|
133
|
-
*
|
|
134
|
-
* @template Unit - The CSS unit to use (e.g., `'px'`, `'em'`, `'rem'`).
|
|
135
|
-
*/
|
|
136
|
-
export type HoneyCSSDimensionValue<Unit extends HoneyCSSDimensionUnit = HoneyCSSDimensionUnit> = `${number}${Unit}` | `${number}` | 'auto';
|
|
137
80
|
/**
|
|
138
81
|
* Represents a spacing value used in layout-related CSS properties.
|
|
139
82
|
*
|
|
@@ -167,7 +110,8 @@ export type HoneyCSSShorthandDimensionOutput<Tuple extends HoneyCSSShorthandTupl
|
|
|
167
110
|
*
|
|
168
111
|
* @template CSSProperty - The CSS property this function will generate a value for.
|
|
169
112
|
*/
|
|
170
|
-
type HoneyCSSPropertyValueFn<CSSProperty extends keyof CSS.Properties> = (context:
|
|
113
|
+
type HoneyCSSPropertyValueFn<CSSProperty extends keyof CSS.Properties> = (context: HoneyStyledContext<object>) => CSS.Properties[CSSProperty];
|
|
114
|
+
type HoneyRawCSSSpacingValue = number | HoneyCSSDimensionValue | CSS.Globals;
|
|
171
115
|
/**
|
|
172
116
|
* Represents a non-responsive (raw) CSS property value for a specific CSS property.
|
|
173
117
|
*
|
|
@@ -180,7 +124,7 @@ type HoneyCSSPropertyValueFn<CSSProperty extends keyof CSS.Properties> = (contex
|
|
|
180
124
|
*
|
|
181
125
|
* @template CSSProperty - The name of the CSS property.
|
|
182
126
|
*/
|
|
183
|
-
type HoneyRawCSSPropertyValue<CSSProperty extends keyof CSS.Properties> = CSSProperty extends HoneyCSSColorProperty ?
|
|
127
|
+
type HoneyRawCSSPropertyValue<CSSProperty extends keyof CSS.Properties> = CSSProperty extends HoneyCSSColorProperty ? HoneyColor : CSSProperty extends HoneyCSSShorthandSpacingProperty ? HoneyCSSSpacingValue : CSSProperty extends HoneyCSSSpacingProperty ? HoneyRawCSSSpacingValue : CSS.Properties[CSSProperty];
|
|
184
128
|
/**
|
|
185
129
|
* Represents a responsive CSS property value for a specific CSS property.
|
|
186
130
|
*
|
|
@@ -192,7 +136,9 @@ type HoneyRawCSSPropertyValue<CSSProperty extends keyof CSS.Properties> = CSSPro
|
|
|
192
136
|
*
|
|
193
137
|
* @template CSSProperty - The key of a CSS property for which values are defined.
|
|
194
138
|
*/
|
|
195
|
-
type HoneyResponsiveCSSPropertyValue<CSSProperty extends keyof CSS.Properties> =
|
|
139
|
+
type HoneyResponsiveCSSPropertyValue<CSSProperty extends keyof CSS.Properties> = {
|
|
140
|
+
[K in HoneyBreakpointName]?: HoneyRawCSSPropertyValue<CSSProperty> | HoneyCSSPropertyValueFn<CSSProperty>;
|
|
141
|
+
};
|
|
196
142
|
/**
|
|
197
143
|
* Represents a CSS property value that can be either a single value or a responsive value.
|
|
198
144
|
*
|
|
@@ -212,7 +158,7 @@ export type HoneyCSSPropertyValue<CSSProperty extends keyof CSS.Properties> = Ho
|
|
|
212
158
|
*/
|
|
213
159
|
export type HoneyPrefixedCSSProperty<CSSProperty extends keyof CSS.Properties = keyof CSS.Properties> = `$${CSSProperty}`;
|
|
214
160
|
/**
|
|
215
|
-
* Represents an object where each key is a prefixed CSS property (with a `$` prefix)
|
|
161
|
+
* Represents an object where each key is a prefixed CSS property (with a `$` prefix).
|
|
216
162
|
*
|
|
217
163
|
* Example:
|
|
218
164
|
* ```
|
|
@@ -226,21 +172,31 @@ export type HoneyPrefixedCSSProperties = {
|
|
|
226
172
|
[CSSProperty in keyof CSS.Properties as HoneyPrefixedCSSProperty<CSSProperty>]?: HoneyCSSPropertyValue<CSSProperty>;
|
|
227
173
|
};
|
|
228
174
|
/**
|
|
229
|
-
*
|
|
175
|
+
* Properties for dimension-based media queries
|
|
230
176
|
*/
|
|
231
|
-
|
|
232
|
-
operator?: 'not' | 'only';
|
|
233
|
-
mediaType?: 'all' | 'print' | 'screen' | 'speech';
|
|
177
|
+
interface HoneyCSSMediaDimensionProperties {
|
|
234
178
|
width?: HoneyCSSDimensionValue;
|
|
235
179
|
minWidth?: HoneyCSSDimensionValue;
|
|
236
180
|
maxWidth?: HoneyCSSDimensionValue;
|
|
237
181
|
height?: HoneyCSSDimensionValue;
|
|
238
182
|
minHeight?: HoneyCSSDimensionValue;
|
|
239
183
|
maxHeight?: HoneyCSSDimensionValue;
|
|
240
|
-
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Properties for resolution-based media queries
|
|
187
|
+
*/
|
|
188
|
+
interface HoneyCSSMediaResolutionProperties {
|
|
241
189
|
resolution?: HoneyCSSResolutionValue;
|
|
242
190
|
minResolution?: HoneyCSSResolutionValue;
|
|
243
191
|
maxResolution?: HoneyCSSResolutionValue;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Options for CSS @media at-rule.
|
|
195
|
+
*/
|
|
196
|
+
export interface HoneyCSSMediaRule extends HoneyCSSMediaDimensionProperties, HoneyCSSMediaResolutionProperties {
|
|
197
|
+
operator?: 'not' | 'only';
|
|
198
|
+
mediaType?: 'all' | 'print' | 'screen' | 'speech';
|
|
199
|
+
orientation?: HoneyCSSMediaOrientation;
|
|
244
200
|
update?: 'none' | 'slow' | 'fast';
|
|
245
201
|
}
|
|
246
202
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { HoneyStyledFunction } from '@react-hive/honey-style';
|
|
3
3
|
import { KeysWithNonArrayValues, Nullable } from './utility.types';
|
|
4
4
|
import { HoneyKeyboardEventCode } from './dom.types';
|
|
5
|
-
export type HoneyEffectResultFn<Props extends object> =
|
|
5
|
+
export type HoneyEffectResultFn<Props extends object> = HoneyStyledFunction<Props>;
|
|
6
6
|
export type HoneyEffect<Config = unknown, Props extends object = object> = (config: Config) => HoneyEffectResultFn<Props>;
|
|
7
7
|
export type HoneyOverlayId = string;
|
|
8
8
|
export type HoneyOverlayEventType = 'keyup';
|
package/dist/types/index.d.ts
CHANGED
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HoneyHEXColor } from '@react-hive/honey-style';
|
|
2
|
+
import { HoneyCSSMediaRule } from '../types';
|
|
2
3
|
export declare const camelToDashCase: (inputString: string) => string;
|
|
3
4
|
/**
|
|
4
5
|
* Splits a string into an array of filtered from redundant spaces words.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-hive/honey-layout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -19,26 +19,28 @@
|
|
|
19
19
|
"author": "Mykhailo Aliinyk <m.aliynik@gmail.com>",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"scripts": {
|
|
22
|
+
"prepare": "husky",
|
|
23
|
+
"clean": "rm -rf dist",
|
|
22
24
|
"start": "vite serve --config vite-docs.config.ts",
|
|
23
25
|
"test": "jest --collect-coverage",
|
|
24
26
|
"build:lib": "vite build --config vite-lib.config.ts",
|
|
25
|
-
"build:docs": "vite build --config vite-docs.config.ts"
|
|
27
|
+
"build:docs": "vite build --config vite-docs.config.ts",
|
|
28
|
+
"diagnostics": "tsx scripts/collect-diagnostics.ts"
|
|
26
29
|
},
|
|
27
|
-
"
|
|
28
|
-
"main": "dist/index.js",
|
|
30
|
+
"main": "dist/index.mjs",
|
|
29
31
|
"types": "dist/index.d.ts",
|
|
30
32
|
"files": [
|
|
31
33
|
"dist"
|
|
32
34
|
],
|
|
33
35
|
"peerDependencies": {
|
|
34
36
|
"react": "^19.0.0",
|
|
35
|
-
"react-dom": "^19.0.0"
|
|
36
|
-
"styled-components": "^6.0.0"
|
|
37
|
+
"react-dom": "^19.0.0"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@floating-ui/react": "0.27.
|
|
40
|
+
"@floating-ui/dom": "1.7.0",
|
|
41
|
+
"@floating-ui/react": "0.27.8",
|
|
41
42
|
"@mdx-js/react": "3.1.0",
|
|
43
|
+
"@react-hive/honey-style": "1.3.0",
|
|
42
44
|
"csstype": "3.1.3",
|
|
43
45
|
"highlight.js": "11.11.1",
|
|
44
46
|
"lodash.merge": "4.6.2",
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
"react-router-dom": "6.30.0"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
49
|
-
"@eslint/js": "9.
|
|
51
|
+
"@eslint/js": "9.26.0",
|
|
50
52
|
"@mdx-js/rollup": "3.1.0",
|
|
51
53
|
"@testing-library/jest-dom": "6.6.3",
|
|
52
54
|
"@testing-library/react": "16.3.0",
|
|
@@ -54,19 +56,22 @@
|
|
|
54
56
|
"@types/lodash.merge": "4.6.9",
|
|
55
57
|
"@types/lodash.throttle": "4.1.9",
|
|
56
58
|
"@types/mdx": "2.0.13",
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/react
|
|
59
|
-
"@
|
|
60
|
-
"
|
|
59
|
+
"@types/node": "22.15.17",
|
|
60
|
+
"@types/react": "^19.1.4",
|
|
61
|
+
"@types/react-dom": "^19.1.4",
|
|
62
|
+
"@vitejs/plugin-react": "4.4.1",
|
|
63
|
+
"eslint": "9.26.0",
|
|
61
64
|
"eslint-plugin-react": "7.37.5",
|
|
65
|
+
"husky": "9.1.7",
|
|
62
66
|
"jest": "29.7.0",
|
|
63
67
|
"jest-environment-jsdom": "29.7.0",
|
|
64
68
|
"prettier": "3.5.3",
|
|
65
69
|
"ts-jest": "29.3.2",
|
|
70
|
+
"tsx": "4.19.4",
|
|
66
71
|
"typescript": "5.8.3",
|
|
67
|
-
"typescript-eslint": "8.
|
|
68
|
-
"vite": "6.
|
|
69
|
-
"vite-plugin-checker": "0.9.
|
|
72
|
+
"typescript-eslint": "8.32.1",
|
|
73
|
+
"vite": "6.3.5",
|
|
74
|
+
"vite-plugin-checker": "0.9.3",
|
|
70
75
|
"vite-plugin-dts": "4.5.3"
|
|
71
76
|
},
|
|
72
77
|
"jest": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './theme-mock';
|