@react-hive/honey-layout 16.0.0 → 16.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 +5 -5
- package/dist/components/HoneyFlex/HoneyFlex.d.ts +2 -2
- package/dist/components/HoneyGrid/HoneyGridStyled.d.ts +2 -2
- package/dist/components/HoneyGridColumn/HoneyGridColumnStyled.d.ts +2 -2
- package/dist/components/HoneyList/HoneyListStyled.d.ts +2 -2
- package/dist/components/HoneyPopup/HoneyPopupStyled.d.ts +2 -2
- package/dist/effects.d.ts +2 -2
- package/dist/helpers/helpers.d.ts +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.dev.cjs +12 -13
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/index.mjs.map +1 -1
- package/dist/types/css.types.d.ts +11 -11
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @deprecated Please, use import from `@react-hive/honey-style`
|
|
3
3
|
*/
|
|
4
|
-
declare const resolveSpacing: <Value extends import("@react-hive/honey-style").
|
|
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
5
|
export { resolveSpacing };
|
|
6
6
|
export * from './constants';
|
|
7
7
|
export * from './types';
|
package/dist/index.dev.cjs
CHANGED
|
@@ -5570,7 +5570,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5570
5570
|
/* harmony import */ var _react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hive/honey-utils */ "./node_modules/.pnpm/@react-hive+honey-utils@3.26.0/node_modules/@react-hive/honey-utils/dist/index.mjs");
|
|
5571
5571
|
|
|
5572
5572
|
|
|
5573
|
-
|
|
5574
5573
|
const generateUniqueId = () => {
|
|
5575
5574
|
const timestamp = Date.now().toString();
|
|
5576
5575
|
const randomNum = Math.floor(Math.random() * 10000)
|
|
@@ -5589,7 +5588,7 @@ const generateUniqueId = () => {
|
|
|
5589
5588
|
*
|
|
5590
5589
|
* @returns `true` if the property is a spacing property, otherwise `false`.
|
|
5591
5590
|
*/
|
|
5592
|
-
const
|
|
5591
|
+
const isSpacingCssProperty = (propertyName) => _react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.CSS_SPACING_PROPERTIES.includes(propertyName);
|
|
5593
5592
|
/**
|
|
5594
5593
|
* Type guard function to check if a property name is a color property.
|
|
5595
5594
|
*
|
|
@@ -5597,7 +5596,7 @@ const checkIsSpacingCSSProperty = (propertyName) => _react_hive_honey_style__WEB
|
|
|
5597
5596
|
*
|
|
5598
5597
|
* @returns True if the property name is a color property, false otherwise.
|
|
5599
5598
|
*/
|
|
5600
|
-
const
|
|
5599
|
+
const isColorCssProperty = (propertyName) => _react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.CSS_COLOR_PROPERTIES.includes(propertyName);
|
|
5601
5600
|
/**
|
|
5602
5601
|
* Determines if a given HTML property is a CSS property that is prefixed with a '$'.
|
|
5603
5602
|
* This convention is typically used for applying dynamic or responsive styles.
|
|
@@ -5606,7 +5605,7 @@ const checkIsColorCSSProperty = (propertyName) => _react_hive_honey_style__WEBPA
|
|
|
5606
5605
|
*
|
|
5607
5606
|
* @returns Returns true if the property is a valid prefixed CSS property, otherwise false.
|
|
5608
5607
|
*/
|
|
5609
|
-
const is$
|
|
5608
|
+
const is$PrefixedCssProperty = (propertyName) => propertyName[0] === '$';
|
|
5610
5609
|
/**
|
|
5611
5610
|
* Retrieves the CSS property value for a specific breakpoint, potentially resolving it to include units.
|
|
5612
5611
|
*
|
|
@@ -5627,7 +5626,7 @@ const is$PrefixedCSSProperty = (propertyName) => propertyName[0] === '$';
|
|
|
5627
5626
|
* - A direct value (if `propertyValue` was not an object or the property is not related to dimensions).
|
|
5628
5627
|
* - A value formatted with units (if the property is related to dimensions or spacing and `resolveSpacing` was applied).
|
|
5629
5628
|
*/
|
|
5630
|
-
const
|
|
5629
|
+
const getCssPropertyValue = (propertyName, propertyValue, breakpoint) => {
|
|
5631
5630
|
// Determine the actual value to use based on the breakpoint
|
|
5632
5631
|
const resolvedValue = typeof propertyValue === 'object' && !Array.isArray(propertyValue)
|
|
5633
5632
|
? propertyValue[breakpoint]
|
|
@@ -5635,13 +5634,13 @@ const getCSSPropertyValue = (propertyName, propertyValue, breakpoint) => {
|
|
|
5635
5634
|
if (resolvedValue === undefined) {
|
|
5636
5635
|
return undefined;
|
|
5637
5636
|
}
|
|
5638
|
-
if (
|
|
5637
|
+
if (isSpacingCssProperty(propertyName)) {
|
|
5639
5638
|
if (typeof resolvedValue === 'number' || Array.isArray(resolvedValue)) {
|
|
5640
5639
|
return (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.resolveSpacing)(resolvedValue, 'px');
|
|
5641
5640
|
}
|
|
5642
5641
|
}
|
|
5643
|
-
else if (
|
|
5644
|
-
if (typeof resolvedValue === 'string' && (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.
|
|
5642
|
+
else if (isColorCssProperty(propertyName)) {
|
|
5643
|
+
if (typeof resolvedValue === 'string' && (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.isThemeColorValue)(resolvedValue)) {
|
|
5645
5644
|
return (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.resolveColor)(resolvedValue);
|
|
5646
5645
|
}
|
|
5647
5646
|
}
|
|
@@ -5657,8 +5656,8 @@ const getCSSPropertyValue = (propertyName, propertyValue, breakpoint) => {
|
|
|
5657
5656
|
*
|
|
5658
5657
|
* @returns An array of tuples where each tuple contains a Honey-prefixed CSS property and its value.
|
|
5659
5658
|
*/
|
|
5660
|
-
const
|
|
5661
|
-
const isMatchingXsBreakpoint = breakpoint === 'xs' && is$
|
|
5659
|
+
const matchCssProperties = (props, breakpoint) => Object.entries(props).filter(([propertyName, propertyValue]) => {
|
|
5660
|
+
const isMatchingXsBreakpoint = breakpoint === 'xs' && is$PrefixedCssProperty(propertyName);
|
|
5662
5661
|
return (isMatchingXsBreakpoint ||
|
|
5663
5662
|
(propertyValue && typeof propertyValue === 'object' && breakpoint in propertyValue));
|
|
5664
5663
|
});
|
|
@@ -5675,10 +5674,10 @@ const matchCSSProperties = (props, breakpoint) => Object.entries(props).filter((
|
|
|
5675
5674
|
* with styles generated for the specified breakpoint.
|
|
5676
5675
|
*/
|
|
5677
5676
|
const createStyles = (breakpoint) => ({ theme, ...props }) => (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.css) `
|
|
5678
|
-
${
|
|
5677
|
+
${matchCssProperties(props, breakpoint).map(([prefixedPropertyName, propertyValue]) => {
|
|
5679
5678
|
const propertyName = prefixedPropertyName.slice(1);
|
|
5680
5679
|
return (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.css) `
|
|
5681
|
-
${(0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.camelToDashCase)(propertyName)}: ${
|
|
5680
|
+
${(0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.camelToDashCase)(propertyName)}: ${getCssPropertyValue(propertyName, propertyValue, breakpoint)};
|
|
5682
5681
|
`;
|
|
5683
5682
|
})}
|
|
5684
5683
|
`;
|
|
@@ -5692,7 +5691,7 @@ const createStyles = (breakpoint) => ({ theme, ...props }) => (0,_react_hive_hon
|
|
|
5692
5691
|
*
|
|
5693
5692
|
* @returns Returns true if at least one property in `props` has styles for the specified breakpoint; otherwise, false.
|
|
5694
5693
|
*/
|
|
5695
|
-
const hasBreakpointStyles = (breakpoint, props) => Object.entries(props).some(([propertyName, propertyValue]) => is$
|
|
5694
|
+
const hasBreakpointStyles = (breakpoint, props) => Object.entries(props).some(([propertyName, propertyValue]) => is$PrefixedCssProperty(propertyName) &&
|
|
5696
5695
|
typeof propertyValue === 'object' &&
|
|
5697
5696
|
breakpoint in propertyValue);
|
|
5698
5697
|
/**
|