@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.
- package/dist/cjs/index.js +13 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Button/Button.d.ts +1 -1
- package/dist/cjs/types/components/ButtonMenu/ButtonMenu.d.ts +2 -1
- package/dist/cjs/types/components/PageHeader/PageHeader.d.ts +2 -1
- package/dist/esm/index.js +13 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Button/Button.d.ts +1 -1
- package/dist/esm/types/components/ButtonMenu/ButtonMenu.d.ts +2 -1
- package/dist/esm/types/components/PageHeader/PageHeader.d.ts +2 -1
- package/dist/index.d.ts +5 -3
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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,
|
|
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
|
};
|