@hexure/ui 1.8.4 → 1.8.6

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.
@@ -20,7 +20,7 @@ export interface ButtonProps extends AccessibleProps {
20
20
  /** If enabled, the small button format will be used. */
21
21
  small?: boolean;
22
22
  /** Define which button format to display. By default the Primary button will be used. */
23
- format?: 'primary' | 'secondary' | 'red';
23
+ format?: 'primary' | 'secondary' | 'red' | 'green';
24
24
  }
25
25
  declare const Button: FC<ButtonProps>;
26
26
  export default Button;
@@ -5,7 +5,8 @@ export interface ButtonMenuProps {
5
5
  label: string;
6
6
  small?: boolean;
7
7
  menuItems: Array<MenuItemProps>;
8
- maxHeight?: string | number;
8
+ menuWidth?: string;
9
+ maxHeight?: string;
9
10
  position?: 'left' | 'right';
10
11
  format?: 'primary' | 'secondary';
11
12
  }
@@ -8,13 +8,14 @@ export interface PageHeaderProps {
8
8
  }>;
9
9
  actions?: Array<{
10
10
  disabled?: boolean;
11
- format?: 'primary' | 'secondary' | 'red';
11
+ format?: 'primary' | 'secondary' | 'red' | 'green';
12
12
  icon?: string;
13
13
  label: string;
14
14
  onClick?: (e: any) => void;
15
15
  }>;
16
16
  buttonMenu?: {
17
17
  disabled?: boolean;
18
+ format?: 'primary' | 'secondary';
18
19
  icon?: string;
19
20
  label: string;
20
21
  menuItems: Array<MenuItemProps>;
package/dist/esm/index.js CHANGED
@@ -2059,6 +2059,13 @@ const button_type_mapping = {
2059
2059
  badge_bg_color: '#fff',
2060
2060
  badge_content_color: Colors.RED.Hex,
2061
2061
  },
2062
+ green: {
2063
+ background_color: Colors.GREEN.Hex,
2064
+ border_color: Colors.GREEN.Hex,
2065
+ content_color: '#fff',
2066
+ badge_bg_color: '#fff',
2067
+ badge_content_color: Colors.GREEN.Hex,
2068
+ },
2062
2069
  };
2063
2070
  const StyledButton = styled.button `
2064
2071
  height: ${props => (props.$small ? '30px' : '40px')};
@@ -2444,13 +2451,14 @@ const StyledMoreMenu = styled(MoreMenu) `
2444
2451
  right: ${props => (props.$position === 'right' ? '0px' : 'auto')};
2445
2452
  left: ${props => (props.$position === 'left' ? '0px' : 'auto')};
2446
2453
  top: ${props => (props.$small ? '30px' : '40px')};
2454
+ width: ${props => props.$menuWidth};
2447
2455
  z-index: 10;
2448
2456
  `;
2449
- const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = 'right', format = 'primary', }) => {
2457
+ const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = 'right', format = 'primary', menuWidth = '200px', }) => {
2450
2458
  const [show_menu, toggleMenu] = useState(false);
2451
2459
  return (React.createElement(Wrapper$d, { onMouseEnter: disabled ? undefined : toggleMenu.bind(null, true), onMouseLeave: disabled ? undefined : toggleMenu.bind(null, false) },
2452
2460
  React.createElement(Button, { disabled: disabled, format: format, icon: mdiDotsHorizontal, small: small }, label),
2453
- show_menu ? (React.createElement(StyledMoreMenu, { "$position": position, "$small": small, maxHeight: maxHeight, menuItems: menuItems })) : null));
2461
+ show_menu ? (React.createElement(StyledMoreMenu, { "$menuWidth": menuWidth, "$position": position, "$small": small, maxHeight: maxHeight, menuItems: menuItems })) : null));
2454
2462
  };
2455
2463
 
2456
2464
  const Wrapper$c = styled.label `
@@ -3806,14 +3814,14 @@ const PageHeader = ({ title = '', breadcrumbs, actions, buttonMenu }) => {
3806
3814
  React.createElement(Info, null,
3807
3815
  React.createElement(Heading, { type: 'secondary' }, title),
3808
3816
  breadcrumbs ? (React.createElement(Breadcrumbs, null, breadcrumbs.map((crumb, i) => {
3809
- return (React.createElement(React.Fragment, null,
3817
+ return (React.createElement(React.Fragment, { key: i },
3810
3818
  crumb.onClick ? (React.createElement(Link, { onClick: crumb.onClick, small: true }, crumb.label)) : (React.createElement(Copy, { type: 'small' }, crumb.label)),
3811
3819
  i + 1 < breadcrumbs.length ? React.createElement(Icon$1, { path: mdiChevronRight, size: '14px' }) : null));
3812
3820
  }))) : null),
3813
3821
  actions ? (React.createElement(Actions, null,
3814
- actions.map(action => {
3822
+ actions.map((action, i) => {
3815
3823
  const { label } = action, buttonProps = __rest(action, ["label"]);
3816
- return (React.createElement(Button, Object.assign({}, buttonProps, { small: true }), label));
3824
+ return (React.createElement(Button, Object.assign({}, buttonProps, { key: i, small: true }), label));
3817
3825
  }),
3818
3826
  menuItems.length ? (React.createElement(ButtonMenu, { label: label, menuItems: menuItems, small: true })) : null)) : null));
3819
3827
  };