@react-hive/honey-style 4.0.0 → 4.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/css/process-css.d.ts +2 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +13 -11
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.dev.cjs
CHANGED
|
@@ -1267,7 +1267,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1267
1267
|
|
|
1268
1268
|
|
|
1269
1269
|
|
|
1270
|
-
const processCss = (rawCss,
|
|
1270
|
+
const processCss = (rawCss, { theme, selector } = {}) => {
|
|
1271
1271
|
const scopedCss = selector ? (0,_css__WEBPACK_IMPORTED_MODULE_1__.createCssRule)(selector, rawCss) : rawCss;
|
|
1272
1272
|
const ast = (0,_react_hive_honey_css__WEBPACK_IMPORTED_MODULE_0__.parseCss)(scopedCss);
|
|
1273
1273
|
const transformers = [
|
|
@@ -1626,7 +1626,7 @@ const createGlobalStyle = (strings, ...interpolations) => {
|
|
|
1626
1626
|
const { theme } = (0,_hooks__WEBPACK_IMPORTED_MODULE_4__.useHoneyStyle)();
|
|
1627
1627
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useInsertionEffect)(() => {
|
|
1628
1628
|
const rawCss = computeCss({ theme });
|
|
1629
|
-
const processedCss = (0,_css__WEBPACK_IMPORTED_MODULE_2__.processCss)(rawCss);
|
|
1629
|
+
const processedCss = (0,_css__WEBPACK_IMPORTED_MODULE_2__.processCss)(rawCss, { theme });
|
|
1630
1630
|
const styleElement = document.createElement('style');
|
|
1631
1631
|
styleElement.id = styleId;
|
|
1632
1632
|
styleElement.innerHTML = processedCss;
|
|
@@ -1891,8 +1891,9 @@ const styled = (target, defaultProps, { omitProps } = {}) => {
|
|
|
1891
1891
|
const rawCss = computeCss(context);
|
|
1892
1892
|
const baseClassName = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.resolveClassName)(rawCss);
|
|
1893
1893
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useInsertionEffect)(() => {
|
|
1894
|
-
const baseCss = (0,_css__WEBPACK_IMPORTED_MODULE_4__.processCss)(rawCss,
|
|
1894
|
+
const baseCss = (0,_css__WEBPACK_IMPORTED_MODULE_4__.processCss)(rawCss, {
|
|
1895
1895
|
theme,
|
|
1896
|
+
selector: `.${baseClassName}`,
|
|
1896
1897
|
});
|
|
1897
1898
|
return (0,_mount_style__WEBPACK_IMPORTED_MODULE_5__.mountStyle)(baseClassName, baseCss, __compositionDepth);
|
|
1898
1899
|
}, [baseClassName]);
|
|
@@ -1901,8 +1902,9 @@ const styled = (target, defaultProps, { omitProps } = {}) => {
|
|
|
1901
1902
|
const cssPropClassName = cssPropString ? (0,_utils__WEBPACK_IMPORTED_MODULE_3__.resolveClassName)(cssPropString) : '';
|
|
1902
1903
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useInsertionEffect)(() => {
|
|
1903
1904
|
if (cssPropClassName) {
|
|
1904
|
-
const overrideCss = (0,_css__WEBPACK_IMPORTED_MODULE_4__.processCss)(cssPropString,
|
|
1905
|
+
const overrideCss = (0,_css__WEBPACK_IMPORTED_MODULE_4__.processCss)(cssPropString, {
|
|
1905
1906
|
theme,
|
|
1907
|
+
selector: `.${cssPropClassName}`,
|
|
1906
1908
|
});
|
|
1907
1909
|
return (0,_mount_style__WEBPACK_IMPORTED_MODULE_5__.mountStyle)(cssPropClassName, overrideCss, 1);
|
|
1908
1910
|
}
|
|
@@ -2022,7 +2024,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2022
2024
|
|
|
2023
2025
|
|
|
2024
2026
|
|
|
2025
|
-
const generateId = (prefix) => `${prefix}-${
|
|
2027
|
+
const generateId = (prefix) => `${prefix}-${(0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_0__.generateEphemeralId)()}`;
|
|
2026
2028
|
/**
|
|
2027
2029
|
* Combines multiple class names into a single space-separated string
|
|
2028
2030
|
*
|
|
@@ -2354,12 +2356,6 @@ const e=e=>new Blob([e],{type:e.type}),t=e=>new DOMRect(e.offsetLeft,e.offsetTop
|
|
|
2354
2356
|
/******/ if (cachedModule !== undefined) {
|
|
2355
2357
|
/******/ return cachedModule.exports;
|
|
2356
2358
|
/******/ }
|
|
2357
|
-
/******/ // Check if module exists (development only)
|
|
2358
|
-
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
2359
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
2360
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
2361
|
-
/******/ throw e;
|
|
2362
|
-
/******/ }
|
|
2363
2359
|
/******/ // Create a new module (and put it into the cache)
|
|
2364
2360
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
2365
2361
|
/******/ // no module.id needed
|
|
@@ -2368,6 +2364,12 @@ const e=e=>new Blob([e],{type:e.type}),t=e=>new DOMRect(e.offsetLeft,e.offsetTop
|
|
|
2368
2364
|
/******/ };
|
|
2369
2365
|
/******/
|
|
2370
2366
|
/******/ // Execute the module function
|
|
2367
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
2368
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
2369
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
2370
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
2371
|
+
/******/ throw e;
|
|
2372
|
+
/******/ }
|
|
2371
2373
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
2372
2374
|
/******/
|
|
2373
2375
|
/******/ // Return the exports of the module
|