@react-hive/honey-style 1.5.0 → 1.5.1

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.
@@ -1164,6 +1164,78 @@ function filter (array, pattern) {
1164
1164
  }
1165
1165
 
1166
1166
 
1167
+ /***/ }),
1168
+
1169
+ /***/ "./src/at-rules/index.ts":
1170
+ /*!*******************************!*\
1171
+ !*** ./src/at-rules/index.ts ***!
1172
+ \*******************************/
1173
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1174
+
1175
+ __webpack_require__.r(__webpack_exports__);
1176
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1177
+ /* harmony export */ mediaQuery: () => (/* reexport safe */ _media_query__WEBPACK_IMPORTED_MODULE_0__.mediaQuery)
1178
+ /* harmony export */ });
1179
+ /* harmony import */ var _media_query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./media-query */ "./src/at-rules/media-query.ts");
1180
+
1181
+
1182
+
1183
+ /***/ }),
1184
+
1185
+ /***/ "./src/at-rules/media-query.ts":
1186
+ /*!*************************************!*\
1187
+ !*** ./src/at-rules/media-query.ts ***!
1188
+ \*************************************/
1189
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1190
+
1191
+ __webpack_require__.r(__webpack_exports__);
1192
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1193
+ /* harmony export */ mediaQuery: () => (/* binding */ mediaQuery)
1194
+ /* harmony export */ });
1195
+ /**
1196
+ * Constructs a complete `@media` query string from an array of media rule objects.
1197
+ * Each rule defines conditions such as screen size, orientation, or resolution,
1198
+ * which are converted into standard CSS media query syntax.
1199
+ *
1200
+ * @param rules - An array of media rule objects used to generate individual media queries.
1201
+ *
1202
+ * @returns A string containing a full `@media` query that can be used in CSS or injected into a stylesheet.
1203
+ *
1204
+ * @example
1205
+ * ```ts
1206
+ * atMedia([
1207
+ * { minWidth: '768px', orientation: 'landscape' },
1208
+ * { mediaType: 'print' }
1209
+ * ]);
1210
+ * // Returns: "@media screen and (min-width: 768px) and (orientation: landscape), print"
1211
+ * ```
1212
+ */
1213
+ const mediaQuery = (rules) => {
1214
+ const mediaRules = rules.map(rule => {
1215
+ const conditions = [
1216
+ rule.width && ['width', rule.width],
1217
+ rule.minWidth && ['min-width', rule.minWidth],
1218
+ rule.maxWidth && ['max-width', rule.maxWidth],
1219
+ rule.height && ['height', rule.height],
1220
+ rule.minHeight && ['min-height', rule.minHeight],
1221
+ rule.maxHeight && ['max-height', rule.maxHeight],
1222
+ rule.orientation && ['orientation', rule.orientation],
1223
+ rule.minResolution && ['min-resolution', rule.minResolution],
1224
+ rule.maxResolution && ['max-resolution', rule.maxResolution],
1225
+ rule.resolution && ['resolution', rule.resolution],
1226
+ rule.update && ['update', rule.update],
1227
+ ]
1228
+ .filter(Boolean)
1229
+ .map(r => r && `(${r[0]}: ${r[1]})`)
1230
+ .join(' and ');
1231
+ const operatorPart = rule.operator ? `${rule.operator} ` : '';
1232
+ const conditionsPart = conditions ? ` and ${conditions}` : '';
1233
+ return `${operatorPart}${rule.mediaType ?? 'screen'}${conditionsPart}`;
1234
+ });
1235
+ return `@media ${mediaRules.join(', ')}`;
1236
+ };
1237
+
1238
+
1167
1239
  /***/ }),
1168
1240
 
1169
1241
  /***/ "./src/constants.ts":
@@ -1897,7 +1969,6 @@ __webpack_require__.r(__webpack_exports__);
1897
1969
  /* harmony export */ isObject: () => (/* binding */ isObject),
1898
1970
  /* harmony export */ isString: () => (/* binding */ isString),
1899
1971
  /* harmony export */ isStyledComponent: () => (/* binding */ isStyledComponent),
1900
- /* harmony export */ mediaQuery: () => (/* binding */ mediaQuery),
1901
1972
  /* harmony export */ processCss: () => (/* binding */ processCss),
1902
1973
  /* harmony export */ resolveClassName: () => (/* binding */ resolveClassName),
1903
1974
  /* harmony export */ toKebabCase: () => (/* binding */ toKebabCase)
@@ -1991,48 +2062,6 @@ const filterNonHtmlAttrs = (attrs) => Object.entries(attrs).reduce((allowedAttrs
1991
2062
  }
1992
2063
  return allowedAttrs;
1993
2064
  }, {});
1994
- /**
1995
- * Constructs a complete `@media` query string from an array of media rule objects.
1996
- * Each rule defines conditions such as screen size, orientation, or resolution,
1997
- * which are converted into standard CSS media query syntax.
1998
- *
1999
- * @param rules - An array of media rule objects used to generate individual media queries.
2000
- *
2001
- * @returns A string containing a full `@media` query that can be used in CSS or injected into a stylesheet.
2002
- *
2003
- * @example
2004
- * ```ts
2005
- * atMedia([
2006
- * { minWidth: '768px', orientation: 'landscape' },
2007
- * { mediaType: 'print' }
2008
- * ]);
2009
- * // Returns: "@media screen and (min-width: 768px) and (orientation: landscape), print"
2010
- * ```
2011
- */
2012
- const mediaQuery = (rules) => {
2013
- const mediaRules = rules.map(rule => {
2014
- const conditions = [
2015
- rule.width && ['width', rule.width],
2016
- rule.minWidth && ['min-width', rule.minWidth],
2017
- rule.maxWidth && ['max-width', rule.maxWidth],
2018
- rule.height && ['height', rule.height],
2019
- rule.minHeight && ['min-height', rule.minHeight],
2020
- rule.maxHeight && ['max-height', rule.maxHeight],
2021
- rule.orientation && ['orientation', rule.orientation],
2022
- rule.minResolution && ['min-resolution', rule.minResolution],
2023
- rule.maxResolution && ['max-resolution', rule.maxResolution],
2024
- rule.resolution && ['resolution', rule.resolution],
2025
- rule.update && ['update', rule.update],
2026
- ]
2027
- .filter(Boolean)
2028
- .map(r => r && `(${r[0]}: ${r[1]})`)
2029
- .join(' and ');
2030
- const operatorPart = rule.operator ? `${rule.operator} ` : '';
2031
- const conditionsPart = conditions ? ` and ${conditions}` : '';
2032
- return `${operatorPart}${rule.mediaType ?? 'screen'}${conditionsPart}`;
2033
- });
2034
- return `@media ${mediaRules.join(', ')}`;
2035
- };
2036
2065
 
2037
2066
 
2038
2067
  /***/ }),
@@ -2133,6 +2162,7 @@ __webpack_require__.r(__webpack_exports__);
2133
2162
  /* harmony export */ __DEV__: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.__DEV__),
2134
2163
  /* harmony export */ createGlobalStyle: () => (/* reexport safe */ _global_style__WEBPACK_IMPORTED_MODULE_6__.createGlobalStyle),
2135
2164
  /* harmony export */ css: () => (/* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_5__.css),
2165
+ /* harmony export */ mediaQuery: () => (/* reexport safe */ _at_rules__WEBPACK_IMPORTED_MODULE_8__.mediaQuery),
2136
2166
  /* harmony export */ styled: () => (/* reexport safe */ _styled__WEBPACK_IMPORTED_MODULE_7__.styled),
2137
2167
  /* harmony export */ useHoneyStyle: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_3__.useHoneyStyle)
2138
2168
  /* harmony export */ });
@@ -2144,6 +2174,8 @@ __webpack_require__.r(__webpack_exports__);
2144
2174
  /* harmony import */ var _css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./css */ "./src/css.ts");
2145
2175
  /* harmony import */ var _global_style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./global-style */ "./src/global-style.ts");
2146
2176
  /* harmony import */ var _styled__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./styled */ "./src/styled.ts");
2177
+ /* harmony import */ var _at_rules__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./at-rules */ "./src/at-rules/index.ts");
2178
+
2147
2179
 
2148
2180
 
2149
2181