@mackin.com/styleguide 8.3.1 → 8.4.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 +7 -0
- package/index.js +18 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -468,6 +468,8 @@ declare const Nav: (props: {
|
|
|
468
468
|
children?: React.ReactNode;
|
|
469
469
|
responsive?: boolean | undefined;
|
|
470
470
|
className?: string | undefined;
|
|
471
|
+
/** Duration of the slide animation in ms. Defaults to `theme.timings.nav.slideMs`. */
|
|
472
|
+
slideMs?: number | undefined;
|
|
471
473
|
__debug?: boolean | undefined;
|
|
472
474
|
}) => JSX.Element;
|
|
473
475
|
|
|
@@ -815,6 +817,11 @@ interface MackinTheme {
|
|
|
815
817
|
desktop: string;
|
|
816
818
|
tablet: string;
|
|
817
819
|
};
|
|
820
|
+
timings: {
|
|
821
|
+
nav: {
|
|
822
|
+
slideMs: number;
|
|
823
|
+
};
|
|
824
|
+
};
|
|
818
825
|
}
|
|
819
826
|
/** Call this on your theme after messing with the props. It will re-build things that depend on sizes and colors. */
|
|
820
827
|
declare const calcDynamicThemeProps: <T extends MackinTheme>(theme: T) => void;
|
package/index.js
CHANGED
|
@@ -107,7 +107,7 @@ const ICONS = {
|
|
|
107
107
|
const Icon = (props) => {
|
|
108
108
|
var _a;
|
|
109
109
|
const icon = (_a = ICONS[props.id]) !== null && _a !== void 0 ? _a : ICONS['noIcon'];
|
|
110
|
-
return React__namespace.createElement(reactFontawesome.FontAwesomeIcon, { title: props.title, style: props.style, onClick: props.onClick, spin: props.spin, className: css.cx('icon', props.className), icon: icon });
|
|
110
|
+
return React__namespace.createElement(reactFontawesome.FontAwesomeIcon, { title: props.title, style: props.style, onClick: props.onClick, spin: props.spin, className: css.cx('icon', css.css({ label: 'Icon' }), props.className), icon: icon });
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
/** Call this on your theme after messing with the props. It will re-build things that depend on sizes and colors. */
|
|
@@ -218,6 +218,11 @@ const defaultTheme = {
|
|
|
218
218
|
mediaQueries: {
|
|
219
219
|
desktop: '',
|
|
220
220
|
tablet: '' // set in calcDynamicThemeProps
|
|
221
|
+
},
|
|
222
|
+
timings: {
|
|
223
|
+
nav: {
|
|
224
|
+
slideMs: 250
|
|
225
|
+
}
|
|
221
226
|
}
|
|
222
227
|
};
|
|
223
228
|
calcDynamicThemeProps(defaultTheme);
|
|
@@ -362,6 +367,7 @@ const Button = React__namespace.forwardRef((props, ref) => {
|
|
|
362
367
|
display: flex;
|
|
363
368
|
justify-content: center;
|
|
364
369
|
align-items: center;
|
|
370
|
+
background-color: transparent;
|
|
365
371
|
${props.small && `
|
|
366
372
|
width: ${theme.controls.heightSmall};
|
|
367
373
|
min-width: ${theme.controls.heightSmall};
|
|
@@ -373,8 +379,10 @@ const Button = React__namespace.forwardRef((props, ref) => {
|
|
|
373
379
|
width: auto;
|
|
374
380
|
box-shadow: none;
|
|
375
381
|
border: none;
|
|
382
|
+
background-color: transparent;
|
|
376
383
|
`}
|
|
377
384
|
${(props.variant === 'text') && `
|
|
385
|
+
background-color: transparent;
|
|
378
386
|
font-weight: normal;
|
|
379
387
|
cursor: auto;
|
|
380
388
|
display: inline-block;
|
|
@@ -797,7 +805,7 @@ const List = React__namespace.forwardRef((props, ref) => {
|
|
|
797
805
|
return (React__namespace.createElement("ul", Object.assign({}, listProps, { ref: ref, className: css.cx('list', listStyles, props.className) }), children));
|
|
798
806
|
});
|
|
799
807
|
const ListItem = (props) => {
|
|
800
|
-
const liProps = __rest(props, ["variant"]);
|
|
808
|
+
const liProps = __rest(props, ["variant", "noContentStyling"]);
|
|
801
809
|
const theme = useThemeSafely();
|
|
802
810
|
const itemStyles = css.css `
|
|
803
811
|
border-bottom: ${theme.controls.border};
|
|
@@ -1558,6 +1566,8 @@ const Modal = (p) => {
|
|
|
1558
1566
|
}
|
|
1559
1567
|
}, [p.show]);
|
|
1560
1568
|
const modalBodyStyles = css.css({
|
|
1569
|
+
maxHeight: p.scrollable ? undefined : '99vh',
|
|
1570
|
+
overflow: 'hidden',
|
|
1561
1571
|
zIndex: theme.zIndexes.modal,
|
|
1562
1572
|
cursor: 'default',
|
|
1563
1573
|
margin: '1rem',
|
|
@@ -2840,7 +2850,7 @@ const useMediaQuery = (query) => {
|
|
|
2840
2850
|
};
|
|
2841
2851
|
|
|
2842
2852
|
const Nav = (props) => {
|
|
2843
|
-
var _a, _b;
|
|
2853
|
+
var _a, _b, _c, _d;
|
|
2844
2854
|
const nav = React__namespace.useRef(null);
|
|
2845
2855
|
const theme = useThemeSafely();
|
|
2846
2856
|
const totalNavOffset = `calc(${theme.layout.navWidth} + 20px)`;
|
|
@@ -2866,13 +2876,14 @@ const Nav = (props) => {
|
|
|
2866
2876
|
}
|
|
2867
2877
|
`;
|
|
2868
2878
|
const classNavShowing = css.css `
|
|
2869
|
-
animation: ${slideRight} 0.
|
|
2879
|
+
animation: ${slideRight} ${(_c = props.slideMs) !== null && _c !== void 0 ? _c : theme.timings.nav.slideMs}ms cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
|
2870
2880
|
`;
|
|
2871
2881
|
const classNavNotShowing = css.css `
|
|
2872
|
-
animation: ${slideLeft} 0.
|
|
2882
|
+
animation: ${slideLeft} ${(_d = props.slideMs) !== null && _d !== void 0 ? _d : theme.timings.nav.slideMs}ms cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
|
2873
2883
|
`;
|
|
2874
2884
|
// the padding-top here is to offset the navs' content from the header. the shadow creeps over it.
|
|
2875
2885
|
const navStyles = css.css `
|
|
2886
|
+
label: Nav;
|
|
2876
2887
|
position: fixed;
|
|
2877
2888
|
top: 0;
|
|
2878
2889
|
left: calc(${totalNavOffset} * -1);
|
|
@@ -3089,6 +3100,7 @@ const generateLinkStyles = (props, theme) => {
|
|
|
3089
3100
|
border: none;
|
|
3090
3101
|
`}
|
|
3091
3102
|
${props.variant === 'text' && `
|
|
3103
|
+
font-weight: normal;
|
|
3092
3104
|
box-shadow: none;
|
|
3093
3105
|
border: none;
|
|
3094
3106
|
cursor: auto;
|
|
@@ -3099,6 +3111,7 @@ const generateLinkStyles = (props, theme) => {
|
|
|
3099
3111
|
border-radius: 100%;
|
|
3100
3112
|
width: ${theme.controls.height};
|
|
3101
3113
|
text-align: center;
|
|
3114
|
+
font-size: 1.6rem;
|
|
3102
3115
|
`}
|
|
3103
3116
|
${props.block && `
|
|
3104
3117
|
display: block;
|