@react-hive/honey-style 6.0.1 → 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.
@@ -391,6 +391,7 @@ __webpack_require__.r(__webpack_exports__);
391
391
  /* harmony export */ HONEY_BREAKPOINTS: () => (/* binding */ HONEY_BREAKPOINTS),
392
392
  /* harmony export */ HONEY_GLOBAL_STYLE_ATTR: () => (/* binding */ HONEY_GLOBAL_STYLE_ATTR),
393
393
  /* harmony export */ HONEY_STYLED_COMPONENT_ID_PROP: () => (/* binding */ HONEY_STYLED_COMPONENT_ID_PROP),
394
+ /* harmony export */ HONEY_STYLED_COMPOSITION_DEPTH_PROP: () => (/* binding */ HONEY_STYLED_COMPOSITION_DEPTH_PROP),
394
395
  /* harmony export */ HONEY_STYLE_ATTR: () => (/* binding */ HONEY_STYLE_ATTR),
395
396
  /* harmony export */ HONEY_STYLE_PRIORITY_ATTR: () => (/* binding */ HONEY_STYLE_PRIORITY_ATTR),
396
397
  /* harmony export */ HONEY_STYLE_REGISTRY_SYMBOL: () => (/* binding */ HONEY_STYLE_REGISTRY_SYMBOL),
@@ -398,13 +399,14 @@ __webpack_require__.r(__webpack_exports__);
398
399
  /* harmony export */ __DEV__: () => (/* binding */ __DEV__)
399
400
  /* harmony export */ });
400
401
  const ENV = "development" || 0;
401
- const __DEV__ = ENV !== 'production' && typeof window !== 'undefined' && !process.env.JEST_WORKER_ID;
402
+ const __DEV__ = ENV !== 'production' && typeof window !== 'undefined' && !process.env.VITEST_WORKER_ID;
402
403
  if (__DEV__) {
403
404
  console.info('[@react-hive/honey-style]: You are running in development mode. ' +
404
405
  'This build is not optimized for production and may include extra checks or logs.');
405
406
  }
406
407
  const HONEY_STYLE_REGISTRY_SYMBOL = Symbol.for('honey-style-registry');
407
408
  const HONEY_STYLED_COMPONENT_ID_PROP = '$$ComponentId';
409
+ const HONEY_STYLED_COMPOSITION_DEPTH_PROP = '__compositionDepth';
408
410
  const HONEY_GLOBAL_STYLE_ATTR = 'data-honey-global-style';
409
411
  const HONEY_STYLE_ATTR = 'data-honey-style';
410
412
  const HONEY_STYLE_PRIORITY_ATTR = 'data-priority';
@@ -1114,14 +1116,40 @@ const createSpacingTransformer = ({ theme }) => {
1114
1116
  __webpack_require__.r(__webpack_exports__);
1115
1117
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1116
1118
  /* harmony export */ createCssRule: () => (/* binding */ createCssRule),
1117
- /* harmony export */ css: () => (/* binding */ css)
1119
+ /* harmony export */ css: () => (/* binding */ css),
1120
+ /* harmony export */ isCssColorProperty: () => (/* binding */ isCssColorProperty),
1121
+ /* harmony export */ isCssSpacingProperty: () => (/* binding */ isCssSpacingProperty)
1118
1122
  /* harmony export */ });
1119
1123
  /* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@4.0.0/node_modules/@react-hive/honey-utils/dist/index.mjs");
1120
1124
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ "./src/constants.ts");
1121
1125
  /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./src/utils.ts");
1126
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./src/css/constants.ts");
1122
1127
 
1123
1128
 
1124
1129
 
1130
+
1131
+ /**
1132
+ * Checks whether a CSS property is spacing-related.
1133
+ *
1134
+ * Spacing properties include margins, paddings, positional offsets,
1135
+ * and layout gaps, such as `margin`, `paddingLeft`, `top`, and `gap`.
1136
+ *
1137
+ * @param propertyName - The CSS property name to check.
1138
+ *
1139
+ * @returns Returns true if the property is spacing-related.
1140
+ */
1141
+ const isCssSpacingProperty = (propertyName) => _constants__WEBPACK_IMPORTED_MODULE_3__.CSS_SPACING_PROPERTIES.includes(propertyName);
1142
+ /**
1143
+ * Checks whether a CSS property is color-related.
1144
+ *
1145
+ * Color properties include properties that directly define text, background,
1146
+ * border, outline, decoration, shadow, or SVG colors.
1147
+ *
1148
+ * @param propertyName - The CSS property name to check.
1149
+ *
1150
+ * @returns Returns true if the property is color-related.
1151
+ */
1152
+ const isCssColorProperty = (propertyName) => _constants__WEBPACK_IMPORTED_MODULE_3__.CSS_COLOR_PROPERTIES.includes(propertyName);
1125
1153
  const resolveCssInterpolation = (value, context) => {
1126
1154
  if (value === false || (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__.isNilOrEmptyString)(value)) {
1127
1155
  return '';
@@ -1239,6 +1267,8 @@ __webpack_require__.r(__webpack_exports__);
1239
1267
  /* harmony export */ CSS_SPACING_PROPERTIES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.CSS_SPACING_PROPERTIES),
1240
1268
  /* harmony export */ createCssRule: () => (/* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_3__.createCssRule),
1241
1269
  /* harmony export */ css: () => (/* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_3__.css),
1270
+ /* harmony export */ isCssColorProperty: () => (/* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_3__.isCssColorProperty),
1271
+ /* harmony export */ isCssSpacingProperty: () => (/* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_3__.isCssSpacingProperty),
1242
1272
  /* harmony export */ mediaQuery: () => (/* reexport safe */ _at_rules__WEBPACK_IMPORTED_MODULE_4__.mediaQuery),
1243
1273
  /* harmony export */ processCss: () => (/* reexport safe */ _process_css__WEBPACK_IMPORTED_MODULE_2__.processCss)
1244
1274
  /* harmony export */ });
@@ -1895,7 +1925,7 @@ const styled = (target, defaultProps, { omitProps } = {}) => {
1895
1925
  return (strings, ...interpolations) => {
1896
1926
  const componentId = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.generateId)('hsc');
1897
1927
  const computeCss = (0,_css__WEBPACK_IMPORTED_MODULE_2__.css)(strings, ...interpolations);
1898
- const StyledComponent = ({ as, className, __compositionDepth = 0, ...props }) => {
1928
+ const StyledComponentImpl = ({ as, className, __compositionDepth = 0, ...props }) => {
1899
1929
  const { theme } = (0,_hooks__WEBPACK_IMPORTED_MODULE_6__.useHoneyStyle)();
1900
1930
  const cleanedProps = (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.definedProps)(props);
1901
1931
  const resolvedDefaultProps = {
@@ -1951,10 +1981,11 @@ const styled = (target, defaultProps, { omitProps } = {}) => {
1951
1981
  ...finalProps,
1952
1982
  ...(as && { as }),
1953
1983
  ...((0,_utils__WEBPACK_IMPORTED_MODULE_4__.isStyledComponent)(target) && {
1954
- __compositionDepth: __compositionDepth - 1,
1984
+ [_constants__WEBPACK_IMPORTED_MODULE_3__.HONEY_STYLED_COMPOSITION_DEPTH_PROP]: __compositionDepth - 1,
1955
1985
  }),
1956
1986
  });
1957
1987
  };
1988
+ const StyledComponent = StyledComponentImpl;
1958
1989
  StyledComponent[_constants__WEBPACK_IMPORTED_MODULE_3__.HONEY_STYLED_COMPONENT_ID_PROP] = componentId;
1959
1990
  if (_constants__WEBPACK_IMPORTED_MODULE_3__.__DEV__) {
1960
1991
  const componentName = (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.isString)(target)
@@ -2420,6 +2451,7 @@ __webpack_require__.r(__webpack_exports__);
2420
2451
  /* harmony export */ HONEY_BREAKPOINTS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_BREAKPOINTS),
2421
2452
  /* harmony export */ HONEY_GLOBAL_STYLE_ATTR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_GLOBAL_STYLE_ATTR),
2422
2453
  /* harmony export */ HONEY_STYLED_COMPONENT_ID_PROP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLED_COMPONENT_ID_PROP),
2454
+ /* harmony export */ HONEY_STYLED_COMPOSITION_DEPTH_PROP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLED_COMPOSITION_DEPTH_PROP),
2423
2455
  /* harmony export */ HONEY_STYLE_ATTR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_ATTR),
2424
2456
  /* harmony export */ HONEY_STYLE_PRIORITY_ATTR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_PRIORITY_ATTR),
2425
2457
  /* harmony export */ HONEY_STYLE_REGISTRY_SYMBOL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.HONEY_STYLE_REGISTRY_SYMBOL),
@@ -2434,6 +2466,8 @@ __webpack_require__.r(__webpack_exports__);
2434
2466
  /* harmony export */ css: () => (/* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_5__.css),
2435
2467
  /* harmony export */ filterNonHtmlAttrs: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_8__.filterNonHtmlAttrs),
2436
2468
  /* harmony export */ generateId: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_8__.generateId),
2469
+ /* harmony export */ isCssColorProperty: () => (/* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_5__.isCssColorProperty),
2470
+ /* harmony export */ isCssSpacingProperty: () => (/* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_5__.isCssSpacingProperty),
2437
2471
  /* harmony export */ isStyledComponent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_8__.isStyledComponent),
2438
2472
  /* harmony export */ isThemeColorValue: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_8__.isThemeColorValue),
2439
2473
  /* harmony export */ mediaQuery: () => (/* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_5__.mediaQuery),