@mackin.com/styleguide 9.4.1 → 9.5.0
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/index.d.ts +4 -0
- package/index.js +7 -6
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -420,10 +420,14 @@ declare const Nav: (props: {
|
|
|
420
420
|
toggle: (show: boolean) => void;
|
|
421
421
|
id?: string | undefined;
|
|
422
422
|
children?: React.ReactNode;
|
|
423
|
+
/** @deprecated Going foward, implement the nav visibility based on screen size in the consuming application.
|
|
424
|
+
* If true, the nav and backdrop will hide when the screen is larger. Defaults to `theme.breakpoints.desktop`. */
|
|
423
425
|
responsive?: boolean | undefined;
|
|
424
426
|
className?: string | undefined;
|
|
425
427
|
/** Duration of the slide animation in ms. Defaults to `theme.timings.nav.slideMs`. */
|
|
426
428
|
slideMs?: number | undefined;
|
|
429
|
+
/** Defaults to `theme.layout.navWidth`. */
|
|
430
|
+
navWidth?: string | undefined;
|
|
427
431
|
__debug?: boolean | undefined;
|
|
428
432
|
}) => JSX.Element;
|
|
429
433
|
|
package/index.js
CHANGED
|
@@ -2697,14 +2697,15 @@ const useMediaQuery = (query) => {
|
|
|
2697
2697
|
};
|
|
2698
2698
|
|
|
2699
2699
|
const Nav = (props) => {
|
|
2700
|
-
var _a, _b, _c;
|
|
2700
|
+
var _a, _b, _c, _d;
|
|
2701
2701
|
const nav = React__namespace.useRef(null);
|
|
2702
2702
|
const theme = useThemeSafely();
|
|
2703
|
-
const
|
|
2703
|
+
const navWidth = (_a = props.navWidth) !== null && _a !== void 0 ? _a : theme.layout.navWidth;
|
|
2704
|
+
const totalNavOffset = `calc(${navWidth} + 20px)`;
|
|
2704
2705
|
const backdrop = React__namespace.useContext(BackdropContext);
|
|
2705
2706
|
const isLargeScreen = useMediaQuery(`(min-width:${theme.breakpoints.desktop})`);
|
|
2706
|
-
const log = useLogger(`Nav ${(
|
|
2707
|
-
const slideMs = (
|
|
2707
|
+
const log = useLogger(`Nav ${(_b = props.id) !== null && _b !== void 0 ? _b : '?'}`, (_c = props.__debug) !== null && _c !== void 0 ? _c : false);
|
|
2708
|
+
const slideMs = (_d = props.slideMs) !== null && _d !== void 0 ? _d : theme.timings.nav.slideMs;
|
|
2708
2709
|
const slideRight = css.keyframes `
|
|
2709
2710
|
0% {
|
|
2710
2711
|
transform: translateX(0);
|
|
@@ -2738,8 +2739,8 @@ const Nav = (props) => {
|
|
|
2738
2739
|
bottom: 0;
|
|
2739
2740
|
background-color: ${theme.colors.nav};
|
|
2740
2741
|
color: ${theme.colors.navFont};
|
|
2741
|
-
width: ${
|
|
2742
|
-
min-width: ${
|
|
2742
|
+
width: ${navWidth};
|
|
2743
|
+
min-width: ${navWidth};
|
|
2743
2744
|
box-shadow: 4px 2px 12px 6px rgba(0, 0, 0, 0.2);
|
|
2744
2745
|
z-index: ${theme.zIndexes.nav};
|
|
2745
2746
|
overflow-y: auto;
|