@longline/aqua-ui 1.0.176 → 1.0.178
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 +1 @@
|
|
|
1
|
-
export { Dropdown } from './Dropdown';
|
|
1
|
+
export { Dropdown, IDropdownProps } from './Dropdown';
|
|
@@ -16,9 +16,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import styled, { css, useTheme } from 'styled-components';
|
|
18
18
|
import { usePopper } from 'react-popper';
|
|
19
|
-
import { createPortal } from 'react-dom';
|
|
20
19
|
import { Icon } from '../../../controls/Icon';
|
|
21
|
-
import { MenuButtonHint } from './MenuButtonHint';
|
|
22
20
|
var MenuButtonBase = function (props) {
|
|
23
21
|
var theme = useTheme();
|
|
24
22
|
var buttonRef = React.useRef(null);
|
|
@@ -43,8 +41,7 @@ var MenuButtonBase = function (props) {
|
|
|
43
41
|
]
|
|
44
42
|
}), styles = _a.styles, attributes = _a.attributes, update = _a.update;
|
|
45
43
|
return (React.createElement("button", { className: props.className, disabled: props.disabled, onClick: props.onClick, ref: buttonRef, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
46
|
-
React.createElement(Icon, { color: props.disabled ? theme.colors.neutral[80] : theme.colors.neutral[50], url: props.icon })
|
|
47
|
-
createPortal(React.createElement(MenuButtonHint, { keys: props.keys, ref: hintRef, styles: styles, attributes: attributes }, props.hint), document.body)));
|
|
44
|
+
React.createElement(Icon, { color: props.disabled ? theme.colors.neutral[80] : theme.colors.neutral[50], url: props.icon })));
|
|
48
45
|
};
|
|
49
46
|
var MenuButtonStyled = styled(MenuButtonBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Size:\n position: relative;\n width: 26px;\n height: 26px;\n\n // Appearance:\n border: none;\n background-color: transparent;\n border-radius: 4px;\n cursor: pointer;\n outline: none;\n user-select: none;\n ", "\n &:active {\n background-color: ", ";\n }\n &:focus {\n outline: solid 2px ", ";\n }\n\n // Content:\n display: flex;\n justify-content: center;\n align-items: center;\n"], ["\n // Size:\n position: relative;\n width: 26px;\n height: 26px;\n\n // Appearance:\n border: none;\n background-color: transparent;\n border-radius: 4px;\n cursor: pointer;\n outline: none;\n user-select: none;\n ", "\n &:active {\n background-color: ", ";\n }\n &:focus {\n outline: solid 2px ", ";\n }\n\n // Content:\n display: flex;\n justify-content: center;\n align-items: center;\n"])), function (p) { return p.active && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), function (p) { return p.theme.colors.neutral[80]; }); }, function (p) { return p.theme.colors.neutral[80]; }, function (p) { return p.theme.colors.primary[1]; });
|
|
50
47
|
var MenuButton = function (props) { return React.createElement(MenuButtonStyled, __assign({}, props)); };
|