@beydesign/storybook 0.5.2 → 0.5.3

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.
@@ -26,6 +26,11 @@ export const Menu = ({ icon = 'DotsThreeOutline', iconWeight = 'bold', items, st
26
26
  return 'var(--color-text-text-error)';
27
27
  return 'var(--color-text-text-title)';
28
28
  };
29
+ const getHoverColor = (action) => {
30
+ if (action?.destructive)
31
+ return 'var(--color-background-bg-error-subtle)';
32
+ return 'var(--color-background-bg-secondary-action-hover)';
33
+ };
29
34
  return (_jsxs(Fragment, { children: [_jsx(MainButton, { displayIcon: icon, iconWeight: iconWeight, onClick: handleClick, type: ButtonType.Button, displayIconMode: ButtonDisplayMode.Only, hierarchy: hierarchy, size: size, style: {
30
35
  // The menu trigger sits on top of media (cards, images), so it uses a
31
36
  // theme-aware translucent overlay (white 30% in light, black 30% in
@@ -37,6 +42,9 @@ export const Menu = ({ icon = 'DotsThreeOutline', iconWeight = 'bold', items, st
37
42
  'aria-labelledby': 'basic-button',
38
43
  style: {
39
44
  padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)',
45
+ display: 'flex',
46
+ flexDirection: 'column',
47
+ gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)',
40
48
  },
41
49
  }, slotProps: {
42
50
  paper: {
@@ -46,13 +54,18 @@ export const Menu = ({ icon = 'DotsThreeOutline', iconWeight = 'bold', items, st
46
54
  border: '1px solid var(--color-border-border-component)',
47
55
  },
48
56
  },
49
- root: { style: { gap: '4px' } },
50
57
  }, children: items?.map((action, index) => {
51
58
  if (action) {
52
59
  return (_jsxs(MuiMenuItem, { onClick: (e) => handleMenuItemClick(action, e), sx: {
53
60
  gap: '8px',
61
+ minHeight: 'auto',
62
+ padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs) var(--spacing-tokens-size-in-px-spacing-spacing-md)',
63
+ borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-xs)',
64
+ '@media (pointer: coarse)': {
65
+ minHeight: '44px',
66
+ },
54
67
  '&:hover': {
55
- backgroundColor: 'var(--color-background-bg-element)',
68
+ backgroundColor: getHoverColor(action),
56
69
  },
57
70
  }, disableRipple: true, "data-testid": `${testKey}-menu-item-${index}`, children: [action?.icon &&
58
71
  getIconComponent(action.icon, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beydesign/storybook",
3
3
  "private": false,
4
- "version": "0.5.2",
4
+ "version": "0.5.3",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",