@react-hive/honey-layout 17.7.0 → 17.9.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.
@@ -3966,12 +3966,12 @@ __webpack_require__.r(__webpack_exports__);
3966
3966
 
3967
3967
 
3968
3968
 
3969
- const HoneyContextMenu = ({ children, subProps, options, optionProps, clickOptions, context, ...popupProps }) => {
3969
+ const HoneyContextMenu = ({ children, subProps, options, optionProps, roleOptions, context, ...popupProps }) => {
3970
3970
  const { contentProps } = popupProps;
3971
- return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyPopup__WEBPACK_IMPORTED_MODULE_1__.HoneyPopup, { context: context, content: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyContextMenuContent__WEBPACK_IMPORTED_MODULE_2__.HoneyContextMenuContent, { options: options, optionProps: optionProps, contentProps: contentProps, ...subProps }), clickOptions: {
3972
- toggle: false,
3973
- ...clickOptions,
3974
- }, useArrow: true, ...popupProps, children: children }) }));
3971
+ return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyPopup__WEBPACK_IMPORTED_MODULE_1__.HoneyPopup, { context: context, content: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_HoneyContextMenuContent__WEBPACK_IMPORTED_MODULE_2__.HoneyContextMenuContent, { options: options, optionProps: optionProps, contentProps: contentProps, ...subProps }), roleOptions: {
3972
+ role: 'menu',
3973
+ ...roleOptions,
3974
+ }, ...popupProps, children: children }) }));
3975
3975
  };
3976
3976
 
3977
3977
 
@@ -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
- * Any explicitly provided style props **always take precedence**.
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 isRow = flexDirection === 'row';
4161
- const shouldCenterAlignItems = center || (isRow ? centerY : centerX);
4162
- const shouldCenterJustifyContent = center || (isRow ? centerX : centerY);
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 && ` - align-items is controlled by both semantics and $alignItems`,
4177
+ hasAlignConflict && ' - align-items is controlled by both semantics and $alignItems',
4173
4178
  hasJustifyConflict &&
4174
- ` - justify-content is controlled by both semantics and $justifyContent`,
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)