@mackin.com/styleguide 8.3.0 → 8.4.1
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 +8 -1
- package/index.js +28 -7
- 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;
|
|
@@ -1061,4 +1068,4 @@ interface ThemeRendererProps extends MackinTheme {
|
|
|
1061
1068
|
}
|
|
1062
1069
|
declare const ThemeRenderer: (p: ThemeRendererProps) => JSX.Element;
|
|
1063
1070
|
|
|
1064
|
-
export { Accordian, AccordianProps, Alignment, Autocomplete, AutocompleteProps, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, FormProps, GlobalStyles, Header, Highlight, ICONS, Icon, Image, ImageProps, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, Link, LinkProps, List, ListItem, ListItemProps, ListProps, MackinTheme, Modal, Nav, NormalizeCss, NumberInput, NumberInputProps, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerOption, PickerProps, PickerValue, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Th, ThSort, ThemeProvider, ThemeRenderer, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
|
1071
|
+
export { Accordian, AccordianProps, Alignment, Autocomplete, AutocompleteProps, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, FormProps, GlobalStyles, Header, Highlight, ICONS, Icon, Image, ImageProps, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, Link, LinkProps, List, ListItem, ListItemProps, ListProps, MackinTheme, Modal, ModalProps, Nav, NormalizeCss, NumberInput, NumberInputProps, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerOption, PickerProps, PickerValue, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Th, ThSort, ThemeProvider, ThemeRenderer, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
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,11 @@ 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;
|
|
386
|
+
font-weight: normal;
|
|
378
387
|
cursor: auto;
|
|
379
388
|
display: inline-block;
|
|
380
389
|
width: auto;
|
|
@@ -796,7 +805,7 @@ const List = React__namespace.forwardRef((props, ref) => {
|
|
|
796
805
|
return (React__namespace.createElement("ul", Object.assign({}, listProps, { ref: ref, className: css.cx('list', listStyles, props.className) }), children));
|
|
797
806
|
});
|
|
798
807
|
const ListItem = (props) => {
|
|
799
|
-
const liProps = __rest(props, ["variant"]);
|
|
808
|
+
const liProps = __rest(props, ["variant", "noContentStyling"]);
|
|
800
809
|
const theme = useThemeSafely();
|
|
801
810
|
const itemStyles = css.css `
|
|
802
811
|
border-bottom: ${theme.controls.border};
|
|
@@ -1557,6 +1566,8 @@ const Modal = (p) => {
|
|
|
1557
1566
|
}
|
|
1558
1567
|
}, [p.show]);
|
|
1559
1568
|
const modalBodyStyles = css.css({
|
|
1569
|
+
maxHeight: p.scrollable ? undefined : '99vh',
|
|
1570
|
+
overflow: 'hidden',
|
|
1560
1571
|
zIndex: theme.zIndexes.modal,
|
|
1561
1572
|
cursor: 'default',
|
|
1562
1573
|
margin: '1rem',
|
|
@@ -2516,13 +2527,17 @@ const DateInput = React__namespace.forwardRef((props, ref) => {
|
|
|
2516
2527
|
const nativeProps = __rest(props, ["customError", "reposition", "onValueChange"]);
|
|
2517
2528
|
useIgnoreMount(() => {
|
|
2518
2529
|
var _a;
|
|
2530
|
+
/*
|
|
2531
|
+
Run this right away.
|
|
2532
|
+
If not, our value may be valid but our error system reports it otherwise due to not being updated yet.
|
|
2533
|
+
*/
|
|
2534
|
+
updateDateErrorMessages();
|
|
2519
2535
|
if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.checkValidity()) {
|
|
2520
2536
|
props.onValueChange(dateValue);
|
|
2521
2537
|
}
|
|
2522
2538
|
else {
|
|
2523
2539
|
props.onValueChange(undefined);
|
|
2524
2540
|
}
|
|
2525
|
-
updateDateErrorMessages();
|
|
2526
2541
|
}, [dateValue]);
|
|
2527
2542
|
useIgnoreMount(() => {
|
|
2528
2543
|
updateDateErrorMessages();
|
|
@@ -2839,13 +2854,14 @@ const useMediaQuery = (query) => {
|
|
|
2839
2854
|
};
|
|
2840
2855
|
|
|
2841
2856
|
const Nav = (props) => {
|
|
2842
|
-
var _a, _b;
|
|
2857
|
+
var _a, _b, _c;
|
|
2843
2858
|
const nav = React__namespace.useRef(null);
|
|
2844
2859
|
const theme = useThemeSafely();
|
|
2845
2860
|
const totalNavOffset = `calc(${theme.layout.navWidth} + 20px)`;
|
|
2846
2861
|
const backdrop = React__namespace.useContext(BackdropContext);
|
|
2847
2862
|
const isLargeScreen = useMediaQuery(`(min-width:${theme.breakpoints.desktop})`);
|
|
2848
2863
|
const log = useLogger(`Nav ${(_a = props.id) !== null && _a !== void 0 ? _a : '?'}`, (_b = props.__debug) !== null && _b !== void 0 ? _b : false);
|
|
2864
|
+
const slideMs = (_c = props.slideMs) !== null && _c !== void 0 ? _c : theme.timings.nav.slideMs;
|
|
2849
2865
|
const slideRight = css.keyframes `
|
|
2850
2866
|
0% {
|
|
2851
2867
|
transform: translateX(0);
|
|
@@ -2865,13 +2881,14 @@ const Nav = (props) => {
|
|
|
2865
2881
|
}
|
|
2866
2882
|
`;
|
|
2867
2883
|
const classNavShowing = css.css `
|
|
2868
|
-
animation: ${slideRight}
|
|
2884
|
+
animation: ${slideRight} ${slideMs}ms cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
|
2869
2885
|
`;
|
|
2870
2886
|
const classNavNotShowing = css.css `
|
|
2871
|
-
animation: ${slideLeft}
|
|
2887
|
+
animation: ${slideLeft} ${slideMs}ms cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
|
|
2872
2888
|
`;
|
|
2873
2889
|
// the padding-top here is to offset the navs' content from the header. the shadow creeps over it.
|
|
2874
2890
|
const navStyles = css.css `
|
|
2891
|
+
label: Nav;
|
|
2875
2892
|
position: fixed;
|
|
2876
2893
|
top: 0;
|
|
2877
2894
|
left: calc(${totalNavOffset} * -1);
|
|
@@ -2926,7 +2943,7 @@ const Nav = (props) => {
|
|
|
2926
2943
|
if (nav && nav.current) {
|
|
2927
2944
|
nav.current.classList.remove(classNavNotShowing);
|
|
2928
2945
|
}
|
|
2929
|
-
},
|
|
2946
|
+
}, slideMs);
|
|
2930
2947
|
}
|
|
2931
2948
|
}
|
|
2932
2949
|
}
|
|
@@ -3088,6 +3105,7 @@ const generateLinkStyles = (props, theme) => {
|
|
|
3088
3105
|
border: none;
|
|
3089
3106
|
`}
|
|
3090
3107
|
${props.variant === 'text' && `
|
|
3108
|
+
font-weight: normal;
|
|
3091
3109
|
box-shadow: none;
|
|
3092
3110
|
border: none;
|
|
3093
3111
|
cursor: auto;
|
|
@@ -3098,6 +3116,9 @@ const generateLinkStyles = (props, theme) => {
|
|
|
3098
3116
|
border-radius: 100%;
|
|
3099
3117
|
width: ${theme.controls.height};
|
|
3100
3118
|
text-align: center;
|
|
3119
|
+
font-size: 1.6rem;
|
|
3120
|
+
padding-left: 0;
|
|
3121
|
+
padding-right: 0;
|
|
3101
3122
|
`}
|
|
3102
3123
|
${props.block && `
|
|
3103
3124
|
display: block;
|