@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.
Files changed (35) hide show
  1. package/LICENSE +1 -1
  2. package/dist/components/HoneyBox/HoneyBox.d.ts +14 -5
  3. package/dist/components/HoneyContextMenu/HoneyContextMenu.d.ts +3 -2
  4. package/dist/components/HoneyContextMenu/HoneyContextMenuContent.d.ts +3 -2
  5. package/dist/components/HoneyFlexBox.d.ts +11 -1
  6. package/dist/components/HoneyGrid/HoneyGridContext.d.ts +1 -1
  7. package/dist/components/HoneyGrid/HoneyGridStyled.d.ts +13 -2
  8. package/dist/components/HoneyGridColumn/HoneyGridColumn.d.ts +2 -1
  9. package/dist/components/HoneyGridColumn/HoneyGridColumn.types.d.ts +2 -1
  10. package/dist/components/HoneyGridColumn/HoneyGridColumnStyled.d.ts +15 -5
  11. package/dist/components/HoneyList/HoneyList.d.ts +2 -1
  12. package/dist/components/HoneyList/HoneyListStyled.d.ts +11 -1
  13. package/dist/components/HoneyOverlay.d.ts +2 -1
  14. package/dist/components/HoneyPopup/HoneyPopup.d.ts +6 -5
  15. package/dist/components/HoneyPopup/HoneyPopupContext.d.ts +0 -1
  16. package/dist/components/HoneyPopup/HoneyPopupStyled.d.ts +11 -1
  17. package/dist/components/HoneyPopup/hooks/use-honey-popup-interactions.d.ts +7 -6
  18. package/dist/components/HoneyPopup/hooks/use-honey-popup.d.ts +28 -9
  19. package/dist/contexts/HoneyLayoutContext.d.ts +4 -4
  20. package/dist/effects.d.ts +1 -1
  21. package/dist/helpers/helpers.d.ts +13 -12
  22. package/dist/helpers/react.helpers.d.ts +0 -2
  23. package/dist/hooks/use-honey-media-query.d.ts +3 -1
  24. package/dist/index.mjs +5959 -0
  25. package/dist/providers/HoneyLayoutProvider.d.ts +3 -6
  26. package/dist/providers/HoneyLayoutThemeOverride.d.ts +2 -2
  27. package/dist/types/css.types.d.ts +23 -67
  28. package/dist/types/data.types.d.ts +2 -2
  29. package/dist/types/index.d.ts +0 -1
  30. package/dist/utils/utils.d.ts +2 -1
  31. package/package.json +21 -16
  32. package/dist/__mocks__/index.d.ts +0 -1
  33. package/dist/__mocks__/theme-mock.d.ts +0 -2
  34. package/dist/index.js +0 -5486
  35. 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 HoneyLayoutProviderContentProps {
4
+ interface HoneyLayoutProviderProps extends HoneyStyleContextValue {
5
5
  mediaQueryOptions?: UseHoneyMediaQueryOptions;
6
6
  }
7
- interface HoneyLayoutProviderProps extends HoneyLayoutProviderContentProps {
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 { DefaultTheme } from 'styled-components';
2
+ import { HoneyTheme } from '@react-hive/honey-style';
3
3
  interface HoneyLayoutThemeOverrideProps {
4
- theme: DefaultTheme;
4
+ theme: HoneyTheme;
5
5
  }
6
6
  /**
7
7
  * Provides a theme override context to its children.
@@ -1,5 +1,4 @@
1
- import { ExecutionContext } from 'styled-components';
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: ExecutionContext) => CSS.Properties[CSSProperty];
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 ? HoneyCSSColor | HoneyColorKey : CSSProperty extends HoneyCSSShorthandSpacingProperty ? HoneyCSSSpacingValue : CSSProperty extends HoneyCSSSpacingProperty ? number | HoneyCSSDimensionValue | CSS.Globals : CSS.Properties[CSSProperty];
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> = Partial<Record<HoneyBreakpointName, HoneyRawCSSPropertyValue<CSSProperty> | HoneyCSSPropertyValueFn<CSSProperty>>>;
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
- * Options for CSS @media at-rule.
175
+ * Properties for dimension-based media queries
230
176
  */
231
- export interface HoneyCSSMediaRule {
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
- orientation?: HoneyCSSMediaOrientation;
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 { StyleFunction } from 'styled-components';
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> = StyleFunction<Props>;
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';
@@ -2,5 +2,4 @@ export * from './utility.types';
2
2
  export * from './data.types';
3
3
  export * from './state.types';
4
4
  export * from './css.types';
5
- export * from './types';
6
5
  export * from './dom.types';
@@ -1,4 +1,5 @@
1
- import { HoneyCSSMediaRule, HoneyHEXColor } from '../types';
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": "5.6.0-beta",
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
- "type": "module",
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
- "@emotion/is-prop-valid": "1.3.1",
40
- "@floating-ui/react": "0.27.7",
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.24.0",
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/react": "^19.0.0",
58
- "@types/react-dom": "^19.0.0",
59
- "@vitejs/plugin-react": "4.3.4",
60
- "eslint": "9.24.0",
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.30.0",
68
- "vite": "6.2.6",
69
- "vite-plugin-checker": "0.9.1",
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';
@@ -1,2 +0,0 @@
1
- import { HoneyTheme } from '../types';
2
- export declare const themeMock: HoneyTheme;