@react-hive/honey-style 4.2.0 → 5.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.
@@ -1,7 +1,7 @@
1
1
  import * as CSS from 'csstype';
2
2
  import type { ElementType } from 'react';
3
3
  import { HONEY_STYLED_COMPONENT_ID_PROP } from '../constants';
4
- import type { HoneyCSSColor, HoneyCSSDimensionUnit } from '../css';
4
+ import type { HoneyCssColor, HoneyCssDimensionUnit } from '../css';
5
5
  /**
6
6
  * Creates a new type by omitting the specified keys `U` from the object type `T`.
7
7
  *
@@ -54,7 +54,7 @@ export type FastOmit<T extends object, U extends string | number | symbol> = {
54
54
  * @template B - The object type with properties to override in `A`.
55
55
  */
56
56
  export type Override<A extends object, B extends object> = FastOmit<A, keyof B> & B;
57
- export type HoneyHTMLDataAttributes = {
57
+ export type HoneyHtmlDataAttributes = {
58
58
  [key: `data-${string}`]: string | number;
59
59
  };
60
60
  /**
@@ -119,44 +119,44 @@ interface BaseHoneyColors {
119
119
  * Used for elements that require high visibility and emphasis, such as primary buttons, call-to-action elements,
120
120
  * and important elements like headers or titles.
121
121
  */
122
- primary: Record<string, HoneyCSSColor>;
122
+ primary: Record<string, HoneyCssColor>;
123
123
  /**
124
124
  * Used to complement the primary color and add visual interest.
125
125
  * Often used for secondary buttons, borders, and decorative elements to provide contrast and balance within the design.
126
126
  * Helps create a cohesive visual hierarchy by providing variation in color tones.
127
127
  */
128
- secondary: Record<string, HoneyCSSColor>;
128
+ secondary: Record<string, HoneyCssColor>;
129
129
  /**
130
130
  * Used to draw attention to specific elements or interactions.
131
131
  * Often applied to interactive elements like links, icons, or tooltips to indicate their interactive nature.
132
132
  * Can be used sparingly to highlight important information or to create visual focal points.
133
133
  */
134
- accent: Record<string, HoneyCSSColor>;
134
+ accent: Record<string, HoneyCssColor>;
135
135
  /**
136
136
  * Used for backgrounds, text, and other elements where a subtle, non-distracting color is desired.
137
137
  * Provides a versatile palette for elements like backgrounds, borders, text, and icons, allowing other colors to stand
138
138
  * out more prominently. Helps maintain balance and readability without overwhelming the user with too much color.
139
139
  */
140
- neutral: Record<string, HoneyCSSColor>;
140
+ neutral: Record<string, HoneyCssColor>;
141
141
  /**
142
142
  * Used to indicate successful or positive actions or states.
143
143
  * Often applied to elements like success messages, notifications, or icons to convey successful completion of tasks or operations.
144
144
  * Provides visual feedback to users to indicate that their actions were successful.
145
145
  */
146
- success: Record<string, HoneyCSSColor>;
146
+ success: Record<string, HoneyCssColor>;
147
147
  /**
148
148
  * Used to indicate cautionary or potentially risky situations.
149
149
  * Applied to elements like warning messages, alerts, or icons to notify users about potential issues or actions that require attention.
150
150
  * Helps users recognize and address potential problems or risks before they escalate.
151
151
  */
152
- warning: Record<string, HoneyCSSColor>;
152
+ warning: Record<string, HoneyCssColor>;
153
153
  /**
154
154
  * Used to indicate errors, critical issues, or potentially destructive actions.
155
155
  * Applied to elements like error messages, validation indicators, form fields, or delete buttons to alert users about incorrect input,
156
156
  * system errors, or actions that may have irreversible consequences. Provides visual feedback to prompt users to
157
157
  * take corrective actions or seek assistance when encountering errors or potentially risky actions.
158
158
  */
159
- error: Record<string, HoneyCSSColor>;
159
+ error: Record<string, HoneyCssColor>;
160
160
  }
161
161
  /**
162
162
  * Example of augmenting the colors interface.
@@ -196,14 +196,14 @@ export interface HoneyColors extends BaseHoneyColors {
196
196
  export type HoneyColorKey = {
197
197
  [ColorType in keyof HoneyColors]: `${ColorType}.${keyof HoneyColors[ColorType] & string}`;
198
198
  }[keyof HoneyColors];
199
- export type HoneyColor = HoneyCSSColor | HoneyColorKey;
199
+ export type HoneyColor = HoneyCssColor | HoneyColorKey;
200
200
  export interface HoneyContainer {
201
201
  /**
202
202
  * Max container width in any CSS distance value.
203
203
  */
204
- maxWidth: `${number}${HoneyCSSDimensionUnit}`;
204
+ maxWidth: `${number}${HoneyCssDimensionUnit}`;
205
205
  }
206
- export type HoneyDimensionValue = `${number}${HoneyCSSDimensionUnit}`;
206
+ export type HoneyDimensionValue = `${number}${HoneyCssDimensionUnit}`;
207
207
  /**
208
208
  * Represents a map of dimension names to CSS distance values.
209
209
  */
@@ -254,9 +254,9 @@ export interface HoneyStyledComponent extends HoneyInternalStyledComponent {
254
254
  export type HoneyStyledContext<Props extends object> = {
255
255
  theme: HoneyTheme;
256
256
  } & Props;
257
- type HoneyStyledInterpolationCSSProps = {
257
+ type HoneyStyledInterpolationCssProps = {
258
258
  [K in keyof CSS.Properties]?: CSS.Properties[K] | null | false | undefined;
259
259
  };
260
260
  export type HoneyStyledFunction<Props extends object> = (context: HoneyStyledContext<Props>) => HoneyStyledInterpolation<Props>;
261
- export type HoneyStyledInterpolation<Props extends object> = string | number | boolean | null | undefined | HoneyStyledComponent | HoneyStyledInterpolationCSSProps | HoneyStyledFunction<Props> | HoneyStyledInterpolation<Props>[];
261
+ export type HoneyStyledInterpolation<Props extends object> = string | number | boolean | null | undefined | HoneyStyledComponent | HoneyStyledInterpolationCssProps | HoneyStyledFunction<Props> | HoneyStyledInterpolation<Props>[];
262
262
  export {};
package/dist/utils.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import type { HoneyCSSColor, HoneyCSSClassName, HoneyCSSShorthandDimensionOutput, HoneyCSSShorthandTuple, HoneyCSSSpacingValue, HoneyCSSDimensionUnit, HoneyCSSDimensionValue } from './css';
2
- import type { Nullable, HoneyColor, HoneyColorKey, HoneyDimensionName, HoneyFontName, HoneySpacings, HoneyStyledComponent, HoneyStyledContext } from './types';
1
+ import type { HoneyCssClassName, HoneyCssColor, HoneyCssDimensionUnit, HoneyCssDimensionValue, HoneyCssShorthandDimensionOutput, HoneyCssShorthandTuple, HoneyCssSpacingValue } from './css';
2
+ import type { HoneyColor, HoneyColorKey, HoneyDimensionName, HoneyFontName, HoneySpacings, HoneyStyledComponent, HoneyStyledContext, Nullable } from './types';
3
3
  export declare const generateId: (prefix: string) => string;
4
4
  /**
5
5
  * Combines multiple class names into a single space-separated string
6
6
  *
7
7
  * @param classNames - Array of class names to combine
8
8
  */
9
- export declare const combineClassNames: (classNames: HoneyCSSClassName[]) => string;
9
+ export declare const combineClassNames: (classNames: HoneyCssClassName[]) => string;
10
10
  export declare const resolveClassName: (css: string) => string;
11
11
  export declare const isStyledComponent: (component: any) => component is HoneyStyledComponent;
12
12
  /**
@@ -45,7 +45,7 @@ export declare const pxToRem: (px: number, base?: number) => string;
45
45
  *
46
46
  * @returns True if the string value is a theme color value, false otherwise.
47
47
  */
48
- export declare const checkIsThemeColorValue: (propertyValue: string) => propertyValue is HoneyColorKey;
48
+ export declare const isThemeColorValue: (propertyValue: string) => propertyValue is HoneyColorKey;
49
49
  /**
50
50
  * Determines the resolved type for spacing values when processed by `resolveSpacing`.
51
51
  *
@@ -62,7 +62,7 @@ export declare const checkIsThemeColorValue: (propertyValue: string) => property
62
62
  * @template Value - The input spacing value (number, shorthand array, or raw string).
63
63
  * @template Unit - A CSS length unit (e.g., 'px', 'em'), or `null` to skip unit formatting.
64
64
  */
65
- 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>>;
65
+ 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>>;
66
66
  /**
67
67
  * Resolves a spacing value or shorthand spacing array using the theme and optional unit.
68
68
  *
@@ -85,7 +85,7 @@ export type HoneyResolveSpacingResult<Value extends HoneyCSSSpacingValue, Unit e
85
85
  * - A space-separated string (e.g., `'8px 12px'`) if `value` is an array.
86
86
  * - `never` if the input is a raw string (unsupported).
87
87
  */
88
- 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>);
88
+ 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>);
89
89
  /**
90
90
  * Resolves the font styles based on the provided font name from the theme.
91
91
  *
@@ -113,7 +113,7 @@ export declare const resolveFont: (fontName: HoneyFontName) => ({ theme }: Honey
113
113
  * @throws Will throw an error if the provided alpha value is not within the valid range (0 to 1).
114
114
  * @throws Will throw an error if the color format is invalid.
115
115
  */
116
- export declare const resolveColor: (colorInput: HoneyColor, alpha?: number) => ({ theme }: HoneyStyledContext<object>) => HoneyCSSColor;
116
+ export declare const resolveColor: (colorInput: HoneyColor, alpha?: number) => ({ theme }: HoneyStyledContext<object>) => HoneyCssColor;
117
117
  /**
118
118
  * Resolves a specific dimension value from the theme configuration.
119
119
  *
@@ -121,4 +121,4 @@ export declare const resolveColor: (colorInput: HoneyColor, alpha?: number) => (
121
121
  *
122
122
  * @returns A style function that takes the theme and returns the resolved dimension value from the theme.
123
123
  */
124
- export declare const resolveDimension: (dimensionName: HoneyDimensionName) => ({ theme }: HoneyStyledContext<object>) => HoneyCSSDimensionValue;
124
+ export declare const resolveDimension: (dimensionName: HoneyDimensionName) => ({ theme }: HoneyStyledContext<object>) => HoneyCssDimensionValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-hive/honey-style",
3
- "version": "4.2.0",
3
+ "version": "5.1.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "react",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@mdx-js/react": "3.1.1",
41
41
  "@react-hive/honey-css": "1.15.0",
42
- "@react-hive/honey-utils": "3.25.0",
42
+ "@react-hive/honey-utils": "3.26.0",
43
43
  "csstype": "3.2.3"
44
44
  },
45
45
  "devDependencies": {
@@ -52,8 +52,8 @@
52
52
  "@types/node": "22.19.11",
53
53
  "@types/react": "^19.2.14",
54
54
  "@types/react-dom": "^19.2.3",
55
- "copy-webpack-plugin": "13.0.1",
56
- "eslint": "10.0.2",
55
+ "copy-webpack-plugin": "14.0.0",
56
+ "eslint": "10.1.0",
57
57
  "eslint-plugin-react": "7.37.5",
58
58
  "html-webpack-plugin": "5.6.6",
59
59
  "husky": "9.1.7",
@@ -64,9 +64,9 @@
64
64
  "ts-loader": "9.5.4",
65
65
  "tsx": "4.21.0",
66
66
  "typescript": "5.9.3",
67
- "typescript-eslint": "8.56.1",
68
- "webpack": "5.105.3",
69
- "webpack-cli": "6.0.1"
67
+ "typescript-eslint": "8.57.1",
68
+ "webpack": "5.105.4",
69
+ "webpack-cli": "7.0.2"
70
70
  },
71
71
  "jest": {
72
72
  "preset": "ts-jest",