@aurora-ds/components 0.15.0 → 0.15.2

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.
@@ -1,6 +1,9 @@
1
+ import { Theme } from '@aurora-ds/theme';
1
2
  import { ReactNode } from 'react';
2
3
  export type MenuItemProps = {
3
4
  label: string;
4
5
  icon?: ReactNode;
5
6
  onClick: () => void;
7
+ textColor?: keyof Theme['colors'];
8
+ iconColor?: keyof Theme['colors'];
6
9
  };
@@ -1,3 +1,4 @@
1
1
  export declare const BUTTON_SIZE = 36;
2
+ export declare const MENU_ITEM_SIZE = 32;
2
3
  export declare const DRAWER_ITEM_HEIGHT = 32;
3
4
  export declare const DEFAULT_TRANSITION_DURATION_MS = 150;
package/dist/cjs/index.js CHANGED
@@ -419,6 +419,7 @@ const Chip = ({ label, icon, variant = 'filled', color = 'default', size = 'md',
419
419
  Chip.displayName = 'Chip';
420
420
 
421
421
  const BUTTON_SIZE = 36;
422
+ const MENU_ITEM_SIZE = 32;
422
423
  const DRAWER_ITEM_HEIGHT = 32;
423
424
  const DEFAULT_TRANSITION_DURATION_MS = 150;
424
425
 
@@ -1274,6 +1275,8 @@ const MENU_STYLES = theme.createStyles((theme) => ({
1274
1275
  border: `1px solid ${theme.colors.border}`,
1275
1276
  boxShadow: theme.shadows.md,
1276
1277
  minWidth: 150,
1278
+ maxHeight: MENU_ITEM_SIZE * 8,
1279
+ overflowY: 'auto',
1277
1280
  width,
1278
1281
  opacity: isFadingIn ? 1 : 0,
1279
1282
  transform: isFadingIn ? 'scale(1)' : 'scale(0.95)',
@@ -1424,6 +1427,9 @@ const MENU_ITEM_STYLES = theme.createStyles((theme) => ({
1424
1427
  outline: 'none',
1425
1428
  border: 'none',
1426
1429
  cursor: 'pointer',
1430
+ minHeight: MENU_ITEM_SIZE,
1431
+ maxHeight: MENU_ITEM_SIZE,
1432
+ flexShrink: 0,
1427
1433
  transition: 'background-color 150ms ease-in-out',
1428
1434
  ':hover': {
1429
1435
  backgroundColor: theme.colors.surfaceHover,
@@ -1431,8 +1437,8 @@ const MENU_ITEM_STYLES = theme.createStyles((theme) => ({
1431
1437
  },
1432
1438
  }));
1433
1439
 
1434
- const MenuItem = ({ label, icon, onClick }) => {
1435
- return (jsxRuntime.jsxs("button", { className: MENU_ITEM_STYLES.root, onClick: onClick, children: [icon && (jsxRuntime.jsx(Icon, { color: 'text', children: icon })), jsxRuntime.jsx(Text, { children: label })] }));
1440
+ const MenuItem = ({ label, icon, onClick, textColor, iconColor }) => {
1441
+ return (jsxRuntime.jsxs("button", { className: MENU_ITEM_STYLES.root, onClick: onClick, children: [icon && (jsxRuntime.jsx(Icon, { color: iconColor ?? 'text', children: icon })), jsxRuntime.jsx(Text, { variant: 'label', color: textColor ?? 'text', maxLines: 1, children: label })] }));
1436
1442
  };
1437
1443
  MenuItem.displayName = 'MenuItem';
1438
1444