@adamjanicki/ui 1.4.4 → 1.4.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.
|
@@ -32,7 +32,7 @@ export var flipAngles = {
|
|
|
32
32
|
left: -225,
|
|
33
33
|
};
|
|
34
34
|
var Hamburger = function (props) {
|
|
35
|
-
var _a = props.size, size = _a === void 0 ? 36 : _a, _b = props.duration, duration = _b === void 0 ? 0.25 : _b, double = props.double, openStyle = props.openStyle, open = props.open, style = props.style, buttonProps = __rest(props, ["size", "duration", "double", "openStyle", "open", "style"]);
|
|
35
|
+
var _a = props.size, size = _a === void 0 ? 36 : _a, _b = props.duration, duration = _b === void 0 ? 0.25 : _b, double = props.double, openStyle = props.openStyle, open = props.open, style = props.style, rounded = props.rounded, buttonProps = __rest(props, ["size", "duration", "double", "openStyle", "open", "style", "rounded"]);
|
|
36
36
|
var lineHeight = Math.max(1, Math.round(size / 20));
|
|
37
37
|
var buttonStyle = {
|
|
38
38
|
width: size,
|
|
@@ -41,7 +41,7 @@ var Hamburger = function (props) {
|
|
|
41
41
|
position: "relative",
|
|
42
42
|
justifyContent: "center",
|
|
43
43
|
alignItems: "center",
|
|
44
|
-
transition: "
|
|
44
|
+
transition: "transform ".concat(duration, "s ease"),
|
|
45
45
|
};
|
|
46
46
|
var commonLineStyle = {
|
|
47
47
|
height: lineHeight,
|
|
@@ -49,6 +49,7 @@ var Hamburger = function (props) {
|
|
|
49
49
|
backgroundColor: "currentColor",
|
|
50
50
|
position: "absolute",
|
|
51
51
|
transition: "all ".concat(duration, "s ease"),
|
|
52
|
+
borderRadius: rounded ? 10000 : 0,
|
|
52
53
|
};
|
|
53
54
|
var yTranslateMagnitude = useMemo(function () { return size / (double ? 7 : 4); }, [size, double]);
|
|
54
55
|
var outer = openStyle.outer, top = openStyle.top, middle = openStyle.middle, bottom = openStyle.bottom;
|
|
@@ -60,6 +61,6 @@ var Hamburger = function (props) {
|
|
|
60
61
|
? bottom
|
|
61
62
|
: { transform: "translateY(".concat(yTranslateMagnitude, "px)") };
|
|
62
63
|
var middleStyle = open ? middle : {};
|
|
63
|
-
return (_jsxs(UnstyledButton, __assign({ style: __assign(__assign(__assign({}, style), outerStyle), buttonStyle) }, buttonProps, { "aria-label": buttonProps["aria-label"] || "hamburger", children: [_jsx("span", { style: __assign(__assign({}, commonLineStyle), topStyle) }), !double && _jsx("span", { style: __assign(__assign({}, commonLineStyle), middleStyle) }), _jsx("span", { style: __assign(__assign({}, commonLineStyle), bottomStyle) })] })));
|
|
64
|
+
return (_jsxs(UnstyledButton, __assign({ style: __assign(__assign(__assign({}, style), outerStyle), buttonStyle) }, buttonProps, { "aria-label": buttonProps["aria-label"] || "hamburger", "aria-expanded": open, children: [_jsx("span", { style: __assign(__assign({}, commonLineStyle), topStyle) }), !double && _jsx("span", { style: __assign(__assign({}, commonLineStyle), middleStyle) }), _jsx("span", { style: __assign(__assign({}, commonLineStyle), bottomStyle) })] })));
|
|
64
65
|
};
|
|
65
66
|
export default Hamburger;
|