@wonderflow/react-components 3.0.0-beta.21 → 3.0.0-beta.22

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.
@@ -48,8 +48,7 @@ export declare type MenuItemProps = {
48
48
  autoFocus?: boolean;
49
49
  /**
50
50
  * Add an element to decorate the menu item. This is useful for adding extra elements
51
- * and informations to the menu item. The decoration element will be placed on the
52
- * opposite side of the icon, based on `iconPosition`.
51
+ * and informations to the menu item.
53
52
  *
54
53
  * @note Don't use interactive elements (link, buttons, etc..) as decoration
55
54
  * if `Menu.Item` is rendered as ´<button>´ (default).
@@ -15,7 +15,7 @@ export const MenuItem = forwardRef(({ className, children, onClick, icon, dimens
15
15
  onClick();
16
16
  }
17
17
  }, [handleClick, onClick]);
18
- const InnerContent = useMemo(() => (_jsxs(Stack, { direction: isIconRight ? 'row-reverse' : 'row', as: "span", className: ItemContent, horizontalAlign: isIconRight ? 'space-between' : 'start', verticalAlign: "center", columnGap: 8, horizontalPadding: 16, verticalPadding: 8, "data-menu-item-icon-right": isIconRight, "data-menu-item-has-icon": Boolean(icon), "data-menu-item-padding": padding, style: { inlineSize: '100%' }, children: [icon && (_jsx(Icon, { className: IconClass, name: icon, dimension: dimension === 'small' ? 14 : 16 }, void 0)), _jsxs(Stack, { direction: "row", horizontalAlign: "space-between", children: [children, decoration] }, void 0)] }, void 0)), [children, dimension, icon, isIconRight, decoration, padding]);
18
+ const InnerContent = useMemo(() => (_jsxs(Stack, { direction: isIconRight ? 'row-reverse' : 'row', as: "span", className: ItemContent, horizontalAlign: isIconRight ? 'space-between' : 'start', verticalAlign: "center", columnGap: 8, horizontalPadding: 16, verticalPadding: 8, "data-menu-item-icon-right": isIconRight, "data-menu-item-has-icon": Boolean(icon), "data-menu-item-padding": padding, style: { inlineSize: '100%' }, children: [icon && (_jsx(Icon, { className: IconClass, name: icon, dimension: dimension === 'small' ? 14 : 16 }, void 0)), _jsxs(Stack, { columnGap: 16, direction: "row", horizontalAlign: "space-between", children: [children, decoration] }, void 0)] }, void 0)), [children, dimension, icon, isIconRight, decoration, padding]);
19
19
  return (_jsx(Wrapper, { autoFocus: autoFocus, ref: itemRef, role: "menuitem", className: clsx(MenuItemClass, className), onClick: disabled ? undefined : triggerClick, onKeyDown: disabled ? undefined : handleKeyDown, tabIndex: tabIndex, "aria-disabled": disabled, type: Wrapper === 'button' ? 'button' : undefined, "data-menu-item-dimension": dimension, ...otherProps, children: description
20
20
  ? (_jsx(Tooltip, { fill: true, open: focused, placement: "right-start", interactive: true, trigger: InnerContent, children: description }, void 0))
21
21
  : InnerContent }, void 0));
package/menu/menu.js CHANGED
@@ -3,12 +3,12 @@ import { Children, forwardRef } from 'react';
3
3
  import { RovingTabIndexProvider } from 'react-roving-tabindex';
4
4
  import { MenuItem } from './menu-item/menu-item';
5
5
  import { MenuItemCheckbox } from './menu-item/menu-item-checkbox';
6
- import { Stack, Elevator } from '..';
6
+ import { Stack, Elevator, Card } from '..';
7
7
  import { Menu as MenuClass } from './menu.module.css';
8
8
  import clsx from 'clsx';
9
9
  export const Menu = forwardRef(({ className, children, ...otherProps }, forwardedRef) => {
10
10
  const renderedChildren = Children.toArray(children).filter(Boolean);
11
- return (_jsx(Elevator, { resting: 2, children: _jsx(Stack, { as: "ul", ref: forwardedRef, className: clsx(MenuClass, className), role: "menu", ...otherProps, children: _jsx(RovingTabIndexProvider, { options: { direction: 'vertical', loopAround: true }, children: Children.map(renderedChildren, (child) => (_jsx(Stack, { as: "li", role: "none", verticalPadding: child.type?.displayName === 'Separator' ? 8 : undefined, children: child }, void 0))) }, void 0) }, void 0) }, void 0));
11
+ return (_jsx(Elevator, { resting: 2, children: _jsx(Card, { bordered: true, radius: 8, padding: false, as: "ul", ref: forwardedRef, className: clsx(MenuClass, className), role: "menu", ...otherProps, children: _jsx(RovingTabIndexProvider, { options: { direction: 'vertical', loopAround: true }, children: Children.map(renderedChildren, (child) => (_jsx(Stack, { as: "li", role: "none", verticalPadding: child.type?.displayName === 'Separator' ? 8 : undefined, children: child }, void 0))) }, void 0) }, void 0) }, void 0));
12
12
  });
13
13
  Menu.displayName = 'Menu';
14
14
  Menu.Item = MenuItem;
@@ -1 +1 @@
1
- .Menu{background-color:var(--global-background);border:1px solid var(--dimmed-1);border-radius:.44rem;list-style-type:none;overflow:hidden;padding:.44rem 0;position:relative}.Menu hr{margin:0 .44rem}
1
+ .Menu{list-style-type:none;overflow:hidden;padding:.44rem 0;position:relative}.Menu hr{margin:0 .44rem}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wonderflow/react-components",
3
3
  "description": "UI components from Wonderflow's Wanda design system",
4
- "version": "3.0.0-beta.21",
4
+ "version": "3.0.0-beta.22",
5
5
  "author": "Wonderflow",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
@@ -1 +1 @@
1
- :where(.Stack){grid-gap:var(--rGap,0) var(--cGap,0);align-items:var(--hAlign);display:flex;flex-direction:column;justify-content:var(--vAlign);padding:var(--vPadding,0) var(--hPadding,0)}:where(.Stack):where([data-stack-fill=true]>*){flex-grow:1}[data-stack-direction=column-reverse]:where(.Stack){flex-direction:column-reverse}[data-stack-direction^=row]:where(.Stack){align-items:var(--vAlign);justify-content:var(--hAlign)}[data-stack-direction=row]:where(.Stack){flex-direction:row}[data-stack-direction=row-reverse]:where(.Stack){flex-direction:row-reverse}[data-stack-inline=true]:where(.Stack){display:inline-flex;flex-grow:0}[data-stack-wrap=true]:where(.Stack){flex-wrap:wrap}
1
+ :where(.Stack){grid-gap:var(--rGap,0) var(--cGap,0);align-items:var(--hAlign);display:flex;flex-direction:column;justify-content:var(--vAlign);padding:var(--vPadding,0) var(--hPadding,0)}:where(.Stack):where([data-stack-fill=true])>*{flex-grow:1}[data-stack-direction=column-reverse]:where(.Stack){flex-direction:column-reverse}[data-stack-direction^=row]:where(.Stack){align-items:var(--vAlign);justify-content:var(--hAlign)}[data-stack-direction=row]:where(.Stack){flex-direction:row}[data-stack-direction=row-reverse]:where(.Stack){flex-direction:row-reverse}[data-stack-inline=true]:where(.Stack){display:inline-flex;flex-grow:0}[data-stack-wrap=true]:where(.Stack){flex-wrap:wrap}
package/themes/dark.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 03 Jan 2022 09:04:22 GMT
3
+ * Generated on Mon, 03 Jan 2022 10:10:21 GMT
4
4
  */
5
5
 
6
6
  :root {
package/themes/light.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 03 Jan 2022 09:04:22 GMT
3
+ * Generated on Mon, 03 Jan 2022 10:10:21 GMT
4
4
  */
5
5
 
6
6
  :root {