@react-hive/honey-layout 6.5.2 → 8.1.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/HoneyBox.d.ts +3 -3
- package/dist/components/HoneyFlexBox.d.ts +1 -1
- package/dist/components/HoneyGrid/HoneyGrid.d.ts +2 -2
- package/dist/components/HoneyGrid/HoneyGridContext.d.ts +1 -1
- package/dist/components/HoneyGrid/HoneyGridStyled.d.ts +1 -1
- package/dist/components/HoneyGridColumn/HoneyGridColumnStyled.d.ts +1 -1
- package/dist/components/HoneyList/HoneyListStyled.d.ts +1 -1
- package/dist/components/HoneyPopup/HoneyPopupStyled.d.ts +1 -1
- package/dist/contexts/HoneyLayoutContext.d.ts +2 -41
- package/dist/helpers/helpers.d.ts +3 -94
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1280 -1392
- package/dist/providers/HoneyLayoutProvider.d.ts +3 -3
- package/dist/types/css.types.d.ts +4 -77
- package/dist/utils/index.d.ts +0 -1
- package/package.json +15 -14
- package/dist/constants.d.ts +0 -3
- package/dist/utils/utils.d.ts +0 -72
|
@@ -1,99 +1,8 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { FastOmit,
|
|
3
|
-
import {
|
|
4
|
-
export declare const noop: () => void;
|
|
5
|
-
export declare function assert(condition: any, message: string): asserts condition;
|
|
2
|
+
import { FastOmit, HoneyStyledFunction, HoneyBreakpointName, HoneyBreakpoints, HoneyMediaQueryRule } from '@react-hive/honey-style';
|
|
3
|
+
import { HoneyScreenState, Honey$PrefixedCSSProperties } from '../types';
|
|
6
4
|
export declare const generateUniqueId: () => string;
|
|
7
|
-
|
|
8
|
-
* Invokes the given input if it is a function, passing the provided arguments.
|
|
9
|
-
* Otherwise, returns the input as-is.
|
|
10
|
-
*
|
|
11
|
-
* @template Args - Tuple of argument types to pass to the function.
|
|
12
|
-
* @template Result - Return type of the function or the value.
|
|
13
|
-
*
|
|
14
|
-
* @param input - A function to invoke with `args`, or a direct value of type `Result`.
|
|
15
|
-
* @param args - Arguments to pass if `input` is a function.
|
|
16
|
-
*
|
|
17
|
-
* @returns The result of invoking the function, or the original value if it's not a function.
|
|
18
|
-
*/
|
|
19
|
-
export declare const invokeIfFunction: <Args extends any[], Result>(input: ((...args: Args) => Result) | Result, ...args: Args) => Result;
|
|
20
|
-
/**
|
|
21
|
-
* Determines the resolved type for spacing values when processed by `resolveSpacing`.
|
|
22
|
-
*
|
|
23
|
-
* The return type adapts based on the shape of the `Value` and presence of a CSS `Unit`:
|
|
24
|
-
*
|
|
25
|
-
* - If `Value` is a `string` (e.g., raw `'10px'` or `'auto'`), it is returned as-is.
|
|
26
|
-
* - If `Unit` is `null`, the original value is returned (either number or shorthand array).
|
|
27
|
-
* - If `Unit` is provided and `Value` is a shorthand array (e.g., `[1, 2, 3, 4]`),
|
|
28
|
-
* it is resolved to a space-separated dimension string (e.g., `'8px 16px 24px 32px'`).
|
|
29
|
-
* - If `Unit` is provided and `Value` is a number, it is resolved to a single dimension string (e.g., `'16px'`).
|
|
30
|
-
*
|
|
31
|
-
* This type helps enforce correct resolution behavior depending on user input and configuration.
|
|
32
|
-
*
|
|
33
|
-
* @template Value - The input spacing value (number, shorthand array, or raw string).
|
|
34
|
-
* @template Unit - A CSS length unit (e.g., 'px', 'em'), or `null` to skip unit formatting.
|
|
35
|
-
*/
|
|
36
|
-
export type HoneyResolveSpacingResult<Value extends HoneyCSSSpacingValue, Unit extends Nullable<HoneyCSSDimensionUnit>> = Value extends HoneyCSSDimensionValue ? Value : Unit extends null ? Value : Value extends HoneyCSSShorthandTuple<number | HoneyCSSDimensionValue> ? HoneyCSSShorthandDimensionOutput<Value, NonNullable<Unit>> : HoneyCSSDimensionValue<NonNullable<Unit>>;
|
|
37
|
-
/**
|
|
38
|
-
* Resolves a spacing value or shorthand spacing array using the theme and optional unit.
|
|
39
|
-
*
|
|
40
|
-
* This function takes spacing multipliers and converts them into pixel or unit-based values
|
|
41
|
-
* using a theme spacing scale (e.g., `theme.spacings.base`). Useful for applying consistent
|
|
42
|
-
* layout spacing with theming and token support.
|
|
43
|
-
*
|
|
44
|
-
* @template Value - The spacing value(s) to resolve. Can be:
|
|
45
|
-
* - A number (e.g., `1`) representing a multiplier.
|
|
46
|
-
* - An array of numbers (e.g., `[1, 2, 3, 4]`) for shorthand spacing.
|
|
47
|
-
* - A dimension string (e.g., `'10px'`) will be returned as `never`.
|
|
48
|
-
* @template Unit - Optional CSS unit (`'px'`, `'em'`, etc.), or `null` to skip units.
|
|
49
|
-
*
|
|
50
|
-
* @param value - Spacing multiplier(s) to apply.
|
|
51
|
-
* @param [unit='px'] - The CSS unit to append. If `null`, values remain numeric.
|
|
52
|
-
* @param [type='base'] - The spacing type to use from the theme (e.g., `'base'`, `'small'`).
|
|
53
|
-
*
|
|
54
|
-
* @returns A function that takes a theme context and returns:
|
|
55
|
-
* - A single resolved value (e.g., `'16px'`) if `value` is a number.
|
|
56
|
-
* - A space-separated string (e.g., `'8px 12px'`) if `value` is an array.
|
|
57
|
-
* - `never` if the input is a raw string (unsupported).
|
|
58
|
-
*/
|
|
59
|
-
export declare const resolveSpacing: <Value extends HoneyCSSSpacingValue, Unit extends Nullable<HoneyCSSDimensionUnit> = "px">(value: Value, unit?: Unit, type?: keyof HoneySpacings) => ((context: HoneyStyledContext<object>) => HoneyResolveSpacingResult<Value, Unit>);
|
|
60
|
-
/**
|
|
61
|
-
* Resolves a color value from the theme or returns the input color directly if it's a standalone color name or HEX value.
|
|
62
|
-
*
|
|
63
|
-
* @param colorInput - A string representing the color to resolve.
|
|
64
|
-
* This can be:
|
|
65
|
-
* - A theme key in the format 'colorType.colorName'.
|
|
66
|
-
* - A standalone color name (e.g., "red", "blue").
|
|
67
|
-
* - A HEX color value (e.g., "#RRGGBB").
|
|
68
|
-
* @param [alpha] - The alpha transparency value between 0 (fully transparent) and 1 (fully opaque).
|
|
69
|
-
* Default to `undefined`.
|
|
70
|
-
*
|
|
71
|
-
* @returns A function that takes an `ExecutionContext` with a `theme` and resolves the color value:
|
|
72
|
-
* - A HEX color string from the theme (e.g., "#RRGGBB").
|
|
73
|
-
* - A HEX color string with alpha (e.g., "#RRGGBBAA") if `alpha` is provided.
|
|
74
|
-
* - The input `colorKey` value directly if it's a standalone color name or HEX value.
|
|
75
|
-
*
|
|
76
|
-
* @throws Will throw an error if the provided alpha value is not within the valid range (0 to 1).
|
|
77
|
-
* @throws Will throw an error if the color format is invalid.
|
|
78
|
-
*/
|
|
79
|
-
export declare const resolveColor: (colorInput: HoneyColor, alpha?: number) => ({ theme }: HoneyStyledContext<object>) => HoneyCSSColor;
|
|
80
|
-
/**
|
|
81
|
-
* Resolves the font styles based on the provided font name from the theme.
|
|
82
|
-
*
|
|
83
|
-
* @param fontName - The name of the font to be resolved from the theme.
|
|
84
|
-
*
|
|
85
|
-
* @returns A style function that takes a theme object and returns the CSS styles for the specified font.
|
|
86
|
-
*/
|
|
87
|
-
export declare const resolveFont: (fontName: HoneyFontName) => ({ theme }: HoneyStyledContext<object>) => (context: HoneyStyledContext<object>) => string;
|
|
88
|
-
/**
|
|
89
|
-
* Resolves a specific dimension value from the theme configuration.
|
|
90
|
-
*
|
|
91
|
-
* @param dimensionName - The name of the dimension to resolve.
|
|
92
|
-
*
|
|
93
|
-
* @returns A style function that takes the theme and returns the resolved dimension value from the theme.
|
|
94
|
-
*/
|
|
95
|
-
export declare const resolveDimension: (dimensionName: HoneyDimensionName) => ({ theme }: HoneyStyledContext<object>) => HoneyCSSDimensionValue;
|
|
96
|
-
export type HoneyStyledBoxProps = HTMLAttributes<HTMLElement> & HoneyPrefixedCSSProperties;
|
|
5
|
+
export type HoneyStyledBoxProps = HTMLAttributes<HTMLElement> & Honey$PrefixedCSSProperties;
|
|
97
6
|
/**
|
|
98
7
|
* Generates CSS styles based on the provided breakpoint and properties.
|
|
99
8
|
* Filters the properties to include only those that match the specified breakpoint.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Please, use import from `@react-hive/honey-style`
|
|
3
|
+
*/
|
|
4
|
+
declare const resolveSpacing: <Value extends import('@react-hive/honey-style').HoneyCSSSpacingValue, Unit extends import('@react-hive/honey-style').Nullable<import('@react-hive/honey-style').HoneyCSSDimensionUnit> = "px">(value: Value, unit?: Unit, type?: keyof import('@react-hive/honey-style').HoneySpacings) => ((context: import('@react-hive/honey-style').HoneyStyledContext<object>) => import('@react-hive/honey-style').HoneyResolveSpacingResult<Value, Unit>);
|
|
5
|
+
export { resolveSpacing };
|
|
1
6
|
export * from './types';
|
|
2
7
|
export * from './components';
|
|
3
8
|
export * from './providers';
|