@react-hive/honey-layout 17.7.0 → 17.8.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/HoneyFlex/HoneyFlex.d.ts +21 -14
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +12 -7
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
package/dist/index.dev.cjs
CHANGED
|
@@ -4118,7 +4118,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4118
4118
|
* - `centerX`, `centerY` → axis-aware centering helpers
|
|
4119
4119
|
*
|
|
4120
4120
|
* Semantic helpers exist purely for convenience and readability.
|
|
4121
|
-
*
|
|
4121
|
+
*
|
|
4122
|
+
* Precedence rules:
|
|
4123
|
+
* - `inline` takes precedence over `$display`
|
|
4124
|
+
* - `$flexDirection` takes precedence over `row`
|
|
4125
|
+
* - `$alignItems` and `$justifyContent` take precedence over centering helpers
|
|
4122
4126
|
*
|
|
4123
4127
|
* ---
|
|
4124
4128
|
*
|
|
@@ -4139,7 +4143,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4139
4143
|
*
|
|
4140
4144
|
* @example Horizontal layout
|
|
4141
4145
|
* ```tsx
|
|
4142
|
-
* <HoneyFlex $gap={2} row/>
|
|
4146
|
+
* <HoneyFlex $gap={2} row />
|
|
4143
4147
|
* ```
|
|
4144
4148
|
*
|
|
4145
4149
|
* @example Column layout
|
|
@@ -4157,9 +4161,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4157
4161
|
const HoneyFlex = (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.styled)((0,_HoneyBox__WEBPACK_IMPORTED_MODULE_3__.HoneyBox), ({ inline = false, row = false, center = false, centerX = false, centerY = false, $display, $flexDirection, $alignItems, $justifyContent, ...props }) => {
|
|
4158
4162
|
const display = inline ? 'inline-flex' : ($display ?? 'flex');
|
|
4159
4163
|
const flexDirection = $flexDirection ?? (row ? 'row' : 'column');
|
|
4160
|
-
const
|
|
4161
|
-
const
|
|
4162
|
-
const
|
|
4164
|
+
const isRowDirection = flexDirection === 'row' || flexDirection === 'row-reverse';
|
|
4165
|
+
const isColumnDirection = flexDirection === 'column' || flexDirection === 'column-reverse';
|
|
4166
|
+
const shouldCenterAlignItems = center || (isRowDirection ? centerY : isColumnDirection ? centerX : false);
|
|
4167
|
+
const shouldCenterJustifyContent = center || (isRowDirection ? centerX : isColumnDirection ? centerY : false);
|
|
4163
4168
|
const alignItems = $alignItems ?? (shouldCenterAlignItems ? 'center' : undefined);
|
|
4164
4169
|
const justifyContent = $justifyContent ?? (shouldCenterJustifyContent ? 'center' : undefined);
|
|
4165
4170
|
if (_constants__WEBPACK_IMPORTED_MODULE_1__.__DEV__) {
|
|
@@ -4169,9 +4174,9 @@ const HoneyFlex = (0,_react_hive_honey_style__WEBPACK_IMPORTED_MODULE_0__.styled
|
|
|
4169
4174
|
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.warnOnce)(`HoneyFlex:${hasAlignConflict}:${hasJustifyConflict}`, [
|
|
4170
4175
|
'[@react-hive/honey-layout]: HoneyFlex.',
|
|
4171
4176
|
'Semantic centering props conflict with explicit flex alignment styles:',
|
|
4172
|
-
hasAlignConflict &&
|
|
4177
|
+
hasAlignConflict && ' - align-items is controlled by both semantics and $alignItems',
|
|
4173
4178
|
hasJustifyConflict &&
|
|
4174
|
-
|
|
4179
|
+
' - justify-content is controlled by both semantics and $justifyContent',
|
|
4175
4180
|
'Explicit styles always win. Remove one side to silence this warning.',
|
|
4176
4181
|
]
|
|
4177
4182
|
.filter(Boolean)
|