@mackin.com/styleguide 8.2.3 → 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 +16 -3
- package/index.js +149 -108
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare const Backdrop: (p: {
|
|
|
86
86
|
__debug?: boolean;
|
|
87
87
|
}) => JSX.Element;
|
|
88
88
|
|
|
89
|
-
declare type ButtonVariant = 'label' | 'circle' | 'icon' | 'link' | 'inlineLink' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
89
|
+
declare type ButtonVariant = 'label' | 'circle' | 'icon' | 'link' | 'inlineLink' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative' | 'text';
|
|
90
90
|
interface ButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
91
91
|
variant?: ButtonVariant;
|
|
92
92
|
/** As round as can be. */
|
|
@@ -254,6 +254,7 @@ declare const ICONS: {
|
|
|
254
254
|
};
|
|
255
255
|
declare const Icon: (props: {
|
|
256
256
|
id: string;
|
|
257
|
+
title?: string | undefined;
|
|
257
258
|
className?: string | undefined;
|
|
258
259
|
spin?: boolean | undefined;
|
|
259
260
|
style?: React.CSSProperties | undefined;
|
|
@@ -432,6 +433,8 @@ declare const List: React.ForwardRefExoticComponent<Pick<ListProps, "altRowColor
|
|
|
432
433
|
interface ListItemProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
|
|
433
434
|
/** For variant 'full', the content will take up the entire space of the parent (no padding applied by this component). */
|
|
434
435
|
variant?: 'full';
|
|
436
|
+
/** By default (and not a good idea in hindsight), ListItem applies styles to child Button or OmniLink elements when the variant is 'full'. Use this to remove these styles. */
|
|
437
|
+
noContentStyling?: boolean;
|
|
435
438
|
}
|
|
436
439
|
declare const ListItem: (props: ListItemProps) => JSX.Element;
|
|
437
440
|
|
|
@@ -445,10 +448,13 @@ interface ModalProps {
|
|
|
445
448
|
noBackground?: boolean;
|
|
446
449
|
closeButton?: boolean;
|
|
447
450
|
heading?: string;
|
|
451
|
+
/** Use to override default heading styling. */
|
|
452
|
+
headerClassName?: string;
|
|
448
453
|
/** Selector of the element to focus on initial show. */
|
|
449
454
|
focusSelector?: string;
|
|
450
455
|
scrollable?: boolean;
|
|
451
456
|
id?: string;
|
|
457
|
+
/** Applied to the modal body. */
|
|
452
458
|
className?: string;
|
|
453
459
|
__debug?: boolean;
|
|
454
460
|
onClick?: () => void;
|
|
@@ -462,6 +468,8 @@ declare const Nav: (props: {
|
|
|
462
468
|
children?: React.ReactNode;
|
|
463
469
|
responsive?: boolean | undefined;
|
|
464
470
|
className?: string | undefined;
|
|
471
|
+
/** Duration of the slide animation in ms. Defaults to `theme.timings.nav.slideMs`. */
|
|
472
|
+
slideMs?: number | undefined;
|
|
465
473
|
__debug?: boolean | undefined;
|
|
466
474
|
}) => JSX.Element;
|
|
467
475
|
|
|
@@ -809,6 +817,11 @@ interface MackinTheme {
|
|
|
809
817
|
desktop: string;
|
|
810
818
|
tablet: string;
|
|
811
819
|
};
|
|
820
|
+
timings: {
|
|
821
|
+
nav: {
|
|
822
|
+
slideMs: number;
|
|
823
|
+
};
|
|
824
|
+
};
|
|
812
825
|
}
|
|
813
826
|
/** Call this on your theme after messing with the props. It will re-build things that depend on sizes and colors. */
|
|
814
827
|
declare const calcDynamicThemeProps: <T extends MackinTheme>(theme: T) => void;
|
|
@@ -1039,7 +1052,7 @@ interface LinkProps extends LinkContentProps, React.DetailedHTMLProps<React.Anch
|
|
|
1039
1052
|
/** Full width with max space between the text and the icon */
|
|
1040
1053
|
iconBlock?: boolean;
|
|
1041
1054
|
/** Corresponds to the button variants of the same name. */
|
|
1042
|
-
variant?: 'button' | 'label' | 'icon' | 'circle' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
1055
|
+
variant?: 'button' | 'label' | 'icon' | 'circle' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative' | 'text';
|
|
1043
1056
|
/** Only for button variants. */
|
|
1044
1057
|
round?: boolean;
|
|
1045
1058
|
/** Only for button variants. */
|
|
@@ -1055,4 +1068,4 @@ interface ThemeRendererProps extends MackinTheme {
|
|
|
1055
1068
|
}
|
|
1056
1069
|
declare const ThemeRenderer: (p: ThemeRendererProps) => JSX.Element;
|
|
1057
1070
|
|
|
1058
|
-
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
|
@@ -67,7 +67,7 @@ function __rest(s, e) {
|
|
|
67
67
|
return t;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
//TB: will need to update. the versions of fa are at 6 now.
|
|
70
|
+
//TB: FUTURE will need to update. the versions of fa are at 6 now.
|
|
71
71
|
// major version
|
|
72
72
|
const ICONS = {
|
|
73
73
|
add: proSolidSvgIcons.faPlus,
|
|
@@ -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, { 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);
|
|
@@ -238,9 +243,70 @@ const useThemeSafely = () => {
|
|
|
238
243
|
return defaultTheme;
|
|
239
244
|
};
|
|
240
245
|
|
|
246
|
+
const getTagStyles = (theme, tag) => {
|
|
247
|
+
switch (tag) {
|
|
248
|
+
case 'p': return {
|
|
249
|
+
marginTop: theme.controls.paragraphPadding,
|
|
250
|
+
marginBottom: theme.controls.paragraphPadding
|
|
251
|
+
};
|
|
252
|
+
case 'h1': return {
|
|
253
|
+
fontSize: theme.fonts.sizeH1
|
|
254
|
+
};
|
|
255
|
+
case 'h2': return {
|
|
256
|
+
fontSize: theme.fonts.sizeH2
|
|
257
|
+
};
|
|
258
|
+
case 'h3': return {
|
|
259
|
+
fontSize: theme.fonts.sizeH3
|
|
260
|
+
};
|
|
261
|
+
case 'h4': return {
|
|
262
|
+
fontSize: theme.fonts.sizeH4
|
|
263
|
+
};
|
|
264
|
+
default: return undefined;
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
const headerRegex = /h1|h2|h3|h4/;
|
|
268
|
+
const alignStyles = {
|
|
269
|
+
'center': { textAlign: 'center' },
|
|
270
|
+
'left': { textAlign: 'left' },
|
|
271
|
+
'right': { textAlign: 'right' }
|
|
272
|
+
};
|
|
273
|
+
/** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
|
|
274
|
+
const Text = (props) => {
|
|
275
|
+
var _a, _b;
|
|
276
|
+
const theme = useThemeSafely();
|
|
277
|
+
const tagChoice = props.tag || 'p';
|
|
278
|
+
const style = props.style || {};
|
|
279
|
+
if (props.lineClamp) {
|
|
280
|
+
style.WebkitLineClamp = props.lineClamp;
|
|
281
|
+
}
|
|
282
|
+
if (props.leftPad) {
|
|
283
|
+
style.paddingLeft = props.leftPad;
|
|
284
|
+
}
|
|
285
|
+
const styles = css.css(getTagStyles(theme, tagChoice), {
|
|
286
|
+
userSelect: 'text',
|
|
287
|
+
label: 'Text',
|
|
288
|
+
fontSize: props.fontSize ? props.fontSize : undefined
|
|
289
|
+
}, alignStyles[(_a = props.align) !== null && _a !== void 0 ? _a : 'left'], props.smaller && { fontSize: theme.fonts.sizeSmall }, props.larger && { fontSize: theme.fonts.sizeLarge }, props.italics && { fontStyle: 'italic' }, props.ellipsis && {
|
|
290
|
+
overflow: 'hidden',
|
|
291
|
+
whiteSpace: 'nowrap',
|
|
292
|
+
textOverflow: 'ellipsis'
|
|
293
|
+
}, props.lineClamp && {
|
|
294
|
+
WebkitBoxOrient: 'vertical',
|
|
295
|
+
overflow: 'hidden',
|
|
296
|
+
textOverflow: 'ellipsis',
|
|
297
|
+
display: '-webkit-box'
|
|
298
|
+
}, props.spacedOut && { lineHeight: '1.5rem' }, props.bold && { fontWeight: 'bold' }, props.noPad && { margin: 0, padding: 0 }, headerRegex.test((_b = props.tag) !== null && _b !== void 0 ? _b : '') && {
|
|
299
|
+
fontFamily: theme.fonts.headerFamily
|
|
300
|
+
});
|
|
301
|
+
return React__namespace.createElement(tagChoice, {
|
|
302
|
+
style: style,
|
|
303
|
+
className: css.cx('text', styles, props.className)
|
|
304
|
+
}, props.children);
|
|
305
|
+
};
|
|
306
|
+
|
|
241
307
|
const Button = React__namespace.forwardRef((props, ref) => {
|
|
242
308
|
var _a;
|
|
243
|
-
const nativeProps = __rest(props, ["variant", "round", "rightIcon", "leftIcon", "iconBlock", "small", "readOnly", "waiting", "enforceMinWidth", "controlAlign"]);
|
|
309
|
+
const { variant, round, rightIcon, leftIcon, iconBlock, small, readOnly, waiting, enforceMinWidth, controlAlign } = props, nativeProps = __rest(props, ["variant", "round", "rightIcon", "leftIcon", "iconBlock", "small", "readOnly", "waiting", "enforceMinWidth", "controlAlign"]);
|
|
244
310
|
const theme = useThemeSafely();
|
|
245
311
|
const buttonStyles = css.css `
|
|
246
312
|
padding-left: ${theme.controls.padding};
|
|
@@ -301,17 +367,32 @@ const Button = React__namespace.forwardRef((props, ref) => {
|
|
|
301
367
|
display: flex;
|
|
302
368
|
justify-content: center;
|
|
303
369
|
align-items: center;
|
|
370
|
+
background-color: transparent;
|
|
304
371
|
${props.small && `
|
|
305
372
|
width: ${theme.controls.heightSmall};
|
|
306
373
|
min-width: ${theme.controls.heightSmall};
|
|
307
374
|
font-size: 1.3rem;
|
|
308
375
|
`}
|
|
309
376
|
`}
|
|
310
|
-
${props.variant === 'label' && `
|
|
377
|
+
${(props.variant === 'label') && `
|
|
378
|
+
display: inline-block;
|
|
379
|
+
width: auto;
|
|
380
|
+
box-shadow: none;
|
|
381
|
+
border: none;
|
|
382
|
+
background-color: transparent;
|
|
383
|
+
`}
|
|
384
|
+
${(props.variant === 'text') && `
|
|
385
|
+
background-color: transparent;
|
|
386
|
+
font-weight: normal;
|
|
387
|
+
cursor: auto;
|
|
311
388
|
display: inline-block;
|
|
312
389
|
width: auto;
|
|
313
390
|
box-shadow: none;
|
|
314
391
|
border: none;
|
|
392
|
+
line-height: ${theme.controls.height};
|
|
393
|
+
&:hover:not(:disabled) {
|
|
394
|
+
filter: none;
|
|
395
|
+
}
|
|
315
396
|
`}
|
|
316
397
|
${props.variant === 'link' && `
|
|
317
398
|
padding: 0;
|
|
@@ -402,18 +483,24 @@ const Button = React__namespace.forwardRef((props, ref) => {
|
|
|
402
483
|
`}
|
|
403
484
|
`;
|
|
404
485
|
const disabled = props.disabled || props.waiting;
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
486
|
+
let content;
|
|
487
|
+
if (variant === 'text') {
|
|
488
|
+
content = React__namespace.createElement(Text, { className: css.cx(styles, props.className), tag: "div" }, props.children);
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
content = (React__namespace.createElement("button", Object.assign({}, nativeProps, { ref: ref, disabled: disabled, className: css.cx('button', styles, props.className), type: (_a = props.type) !== null && _a !== void 0 ? _a : 'button' }),
|
|
492
|
+
props.leftIcon && React__namespace.createElement("span", { className: css.css({ marginRight: '0.5rem' }) }, props.leftIcon),
|
|
493
|
+
props.waiting ? React__namespace.createElement(Icon, { id: "waiting", spin: true }) : props.children,
|
|
494
|
+
props.rightIcon && React__namespace.createElement("span", { className: css.css({ marginLeft: '0.5rem' }) }, props.rightIcon)));
|
|
495
|
+
}
|
|
409
496
|
if (props.controlAlign) {
|
|
410
497
|
return (React__namespace.createElement("span", { className: css.css({
|
|
411
498
|
display: 'inline-block',
|
|
412
499
|
width: '100%',
|
|
413
500
|
paddingBottom: theme.controls.inputErrorMinHeight
|
|
414
|
-
}) },
|
|
501
|
+
}) }, content));
|
|
415
502
|
}
|
|
416
|
-
return
|
|
503
|
+
return content;
|
|
417
504
|
});
|
|
418
505
|
|
|
419
506
|
const accordianExpandTimeMs = 250;
|
|
@@ -718,7 +805,7 @@ const List = React__namespace.forwardRef((props, ref) => {
|
|
|
718
805
|
return (React__namespace.createElement("ul", Object.assign({}, listProps, { ref: ref, className: css.cx('list', listStyles, props.className) }), children));
|
|
719
806
|
});
|
|
720
807
|
const ListItem = (props) => {
|
|
721
|
-
const liProps = __rest(props, ["variant"]);
|
|
808
|
+
const liProps = __rest(props, ["variant", "noContentStyling"]);
|
|
722
809
|
const theme = useThemeSafely();
|
|
723
810
|
const itemStyles = css.css `
|
|
724
811
|
border-bottom: ${theme.controls.border};
|
|
@@ -726,30 +813,30 @@ const ListItem = (props) => {
|
|
|
726
813
|
border-bottom: none;
|
|
727
814
|
}
|
|
728
815
|
`;
|
|
729
|
-
const contentStyle = css.css
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
816
|
+
const contentStyle = css.css({
|
|
817
|
+
padding: `calc(${theme.controls.padding} * 1.5)`
|
|
818
|
+
}, props.variant === 'full' && {
|
|
819
|
+
padding: 0
|
|
820
|
+
}, !props.noContentStyling && {
|
|
821
|
+
'>.button': {
|
|
822
|
+
padding: `calc(${theme.controls.padding} * 1.5)`,
|
|
823
|
+
width: '100%',
|
|
824
|
+
border: 'none'
|
|
825
|
+
},
|
|
826
|
+
'>.omniLink': {
|
|
827
|
+
paddingLeft: `calc(${theme.controls.padding} * 1.5)`,
|
|
828
|
+
paddingRight: `calc(${theme.controls.padding} * 1.5)`,
|
|
829
|
+
width: '100%',
|
|
830
|
+
border: 'none',
|
|
831
|
+
lineHeight: theme.controls.height
|
|
832
|
+
},
|
|
833
|
+
'>.button:not(:focus), >.omniLink:not(:focus)': {
|
|
834
|
+
boxShadow: 'none',
|
|
835
|
+
},
|
|
836
|
+
'>.omniLink:not(.omniLink--iconBlock)': {
|
|
837
|
+
display: 'block'
|
|
838
|
+
}
|
|
839
|
+
});
|
|
753
840
|
return (React__namespace.createElement("li", Object.assign({}, liProps, { className: css.cx('listItem', itemStyles, props.className) }),
|
|
754
841
|
React__namespace.createElement("div", { className: css.css(contentStyle) }, props.children)));
|
|
755
842
|
};
|
|
@@ -785,67 +872,6 @@ const TabLocker = (props) => {
|
|
|
785
872
|
} }, props.children));
|
|
786
873
|
};
|
|
787
874
|
|
|
788
|
-
const getTagStyles = (theme, tag) => {
|
|
789
|
-
switch (tag) {
|
|
790
|
-
case 'p': return {
|
|
791
|
-
marginTop: theme.controls.paragraphPadding,
|
|
792
|
-
marginBottom: theme.controls.paragraphPadding
|
|
793
|
-
};
|
|
794
|
-
case 'h1': return {
|
|
795
|
-
fontSize: theme.fonts.sizeH1
|
|
796
|
-
};
|
|
797
|
-
case 'h2': return {
|
|
798
|
-
fontSize: theme.fonts.sizeH2
|
|
799
|
-
};
|
|
800
|
-
case 'h3': return {
|
|
801
|
-
fontSize: theme.fonts.sizeH3
|
|
802
|
-
};
|
|
803
|
-
case 'h4': return {
|
|
804
|
-
fontSize: theme.fonts.sizeH4
|
|
805
|
-
};
|
|
806
|
-
default: return undefined;
|
|
807
|
-
}
|
|
808
|
-
};
|
|
809
|
-
const headerRegex = /h1|h2|h3|h4/;
|
|
810
|
-
const alignStyles = {
|
|
811
|
-
'center': { textAlign: 'center' },
|
|
812
|
-
'left': { textAlign: 'left' },
|
|
813
|
-
'right': { textAlign: 'right' }
|
|
814
|
-
};
|
|
815
|
-
/** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
|
|
816
|
-
const Text = (props) => {
|
|
817
|
-
var _a, _b;
|
|
818
|
-
const theme = useThemeSafely();
|
|
819
|
-
const tagChoice = props.tag || 'p';
|
|
820
|
-
const style = props.style || {};
|
|
821
|
-
if (props.lineClamp) {
|
|
822
|
-
style.WebkitLineClamp = props.lineClamp;
|
|
823
|
-
}
|
|
824
|
-
if (props.leftPad) {
|
|
825
|
-
style.paddingLeft = props.leftPad;
|
|
826
|
-
}
|
|
827
|
-
const styles = css.css(getTagStyles(theme, tagChoice), {
|
|
828
|
-
userSelect: 'text',
|
|
829
|
-
label: 'Text',
|
|
830
|
-
fontSize: props.fontSize ? props.fontSize : undefined
|
|
831
|
-
}, alignStyles[(_a = props.align) !== null && _a !== void 0 ? _a : 'left'], props.smaller && { fontSize: theme.fonts.sizeSmall }, props.larger && { fontSize: theme.fonts.sizeLarge }, props.italics && { fontStyle: 'italic' }, props.ellipsis && {
|
|
832
|
-
overflow: 'hidden',
|
|
833
|
-
whiteSpace: 'nowrap',
|
|
834
|
-
textOverflow: 'ellipsis'
|
|
835
|
-
}, props.lineClamp && {
|
|
836
|
-
WebkitBoxOrient: 'vertical',
|
|
837
|
-
overflow: 'hidden',
|
|
838
|
-
textOverflow: 'ellipsis',
|
|
839
|
-
display: '-webkit-box'
|
|
840
|
-
}, props.spacedOut && { lineHeight: '1.5rem' }, props.bold && { fontWeight: 'bold' }, props.noPad && { margin: 0, padding: 0 }, headerRegex.test((_b = props.tag) !== null && _b !== void 0 ? _b : '') && {
|
|
841
|
-
fontFamily: theme.fonts.headerFamily
|
|
842
|
-
});
|
|
843
|
-
return React__namespace.createElement(tagChoice, {
|
|
844
|
-
style: style,
|
|
845
|
-
className: css.cx('text', styles, props.className)
|
|
846
|
-
}, props.children);
|
|
847
|
-
};
|
|
848
|
-
|
|
849
875
|
//TB: FUTURE will need to use the new input
|
|
850
876
|
const defaultMaxShownValues = 7;
|
|
851
877
|
const buttonMarkerClass = 'ListItem__button';
|
|
@@ -1540,6 +1566,8 @@ const Modal = (p) => {
|
|
|
1540
1566
|
}
|
|
1541
1567
|
}, [p.show]);
|
|
1542
1568
|
const modalBodyStyles = css.css({
|
|
1569
|
+
maxHeight: p.scrollable ? undefined : '99vh',
|
|
1570
|
+
overflow: 'hidden',
|
|
1543
1571
|
zIndex: theme.zIndexes.modal,
|
|
1544
1572
|
cursor: 'default',
|
|
1545
1573
|
margin: '1rem',
|
|
@@ -1556,14 +1584,14 @@ const Modal = (p) => {
|
|
|
1556
1584
|
outline: 'none'
|
|
1557
1585
|
}
|
|
1558
1586
|
});
|
|
1559
|
-
const modalHeaderStyles = css.css({
|
|
1587
|
+
const modalHeaderStyles = css.cx(css.css({
|
|
1560
1588
|
display: 'flex',
|
|
1561
1589
|
justifyContent: 'space-between',
|
|
1562
1590
|
alignItems: 'center',
|
|
1563
1591
|
backgroundColor: theme.colors.header,
|
|
1564
1592
|
padding: '1rem',
|
|
1565
1593
|
color: theme.colors.headerFont
|
|
1566
|
-
});
|
|
1594
|
+
}), p.headerClassName);
|
|
1567
1595
|
const modalContainerStyles = css.css([{
|
|
1568
1596
|
position: 'fixed',
|
|
1569
1597
|
height: '100%',
|
|
@@ -2822,7 +2850,7 @@ const useMediaQuery = (query) => {
|
|
|
2822
2850
|
};
|
|
2823
2851
|
|
|
2824
2852
|
const Nav = (props) => {
|
|
2825
|
-
var _a, _b;
|
|
2853
|
+
var _a, _b, _c, _d;
|
|
2826
2854
|
const nav = React__namespace.useRef(null);
|
|
2827
2855
|
const theme = useThemeSafely();
|
|
2828
2856
|
const totalNavOffset = `calc(${theme.layout.navWidth} + 20px)`;
|
|
@@ -2848,13 +2876,14 @@ const Nav = (props) => {
|
|
|
2848
2876
|
}
|
|
2849
2877
|
`;
|
|
2850
2878
|
const classNavShowing = css.css `
|
|
2851
|
-
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;
|
|
2852
2880
|
`;
|
|
2853
2881
|
const classNavNotShowing = css.css `
|
|
2854
|
-
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;
|
|
2855
2883
|
`;
|
|
2856
2884
|
// the padding-top here is to offset the navs' content from the header. the shadow creeps over it.
|
|
2857
2885
|
const navStyles = css.css `
|
|
2886
|
+
label: Nav;
|
|
2858
2887
|
position: fixed;
|
|
2859
2888
|
top: 0;
|
|
2860
2889
|
left: calc(${totalNavOffset} * -1);
|
|
@@ -3070,12 +3099,19 @@ const generateLinkStyles = (props, theme) => {
|
|
|
3070
3099
|
box-shadow: none;
|
|
3071
3100
|
border: none;
|
|
3072
3101
|
`}
|
|
3102
|
+
${props.variant === 'text' && `
|
|
3103
|
+
font-weight: normal;
|
|
3104
|
+
box-shadow: none;
|
|
3105
|
+
border: none;
|
|
3106
|
+
cursor: auto;
|
|
3107
|
+
`}
|
|
3073
3108
|
${props.variant === 'icon' && `
|
|
3074
3109
|
box-shadow: none;
|
|
3075
3110
|
border: none;
|
|
3076
3111
|
border-radius: 100%;
|
|
3077
3112
|
width: ${theme.controls.height};
|
|
3078
3113
|
text-align: center;
|
|
3114
|
+
font-size: 1.6rem;
|
|
3079
3115
|
`}
|
|
3080
3116
|
${props.block && `
|
|
3081
3117
|
display: block;
|
|
@@ -3099,10 +3135,13 @@ const generateLinkStyles = (props, theme) => {
|
|
|
3099
3135
|
};
|
|
3100
3136
|
|
|
3101
3137
|
const OmniLink = (props) => {
|
|
3102
|
-
const linkProps = __rest(props, ["noRouter", "rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
|
|
3138
|
+
const { noRouter, rightIcon, leftIcon, block, iconBlock, variant, round, small, colorOverride, children, ref } = props, linkProps = __rest(props, ["noRouter", "rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
|
|
3103
3139
|
const theme = useThemeSafely();
|
|
3104
3140
|
const linkStyles = generateLinkStyles(props, theme);
|
|
3105
3141
|
const mainClassName = css.cx('omniLink', linkStyles, props.className);
|
|
3142
|
+
if (variant === 'text') {
|
|
3143
|
+
return React__namespace.createElement(Text, { className: mainClassName, tag: "div" }, props.children);
|
|
3144
|
+
}
|
|
3106
3145
|
const content = React__namespace.createElement(LinkContent, Object.assign({}, props));
|
|
3107
3146
|
if (props.noRouter) {
|
|
3108
3147
|
return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }), content));
|
|
@@ -3110,7 +3149,6 @@ const OmniLink = (props) => {
|
|
|
3110
3149
|
return (React__namespace.createElement(reactRouterDom.Link, Object.assign({}, linkProps, { className: mainClassName, to: props.href }), content));
|
|
3111
3150
|
};
|
|
3112
3151
|
|
|
3113
|
-
//TB: test in safari with the new arrow
|
|
3114
3152
|
const roundPxPadding = '4px';
|
|
3115
3153
|
const Picker = (props) => {
|
|
3116
3154
|
const selectProps = __rest(props
|
|
@@ -4603,10 +4641,13 @@ const enumToEntities = (enumObj) => {
|
|
|
4603
4641
|
};
|
|
4604
4642
|
|
|
4605
4643
|
const Link = (props) => {
|
|
4606
|
-
const linkProps = __rest(props, ["rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
|
|
4644
|
+
const { rightIcon, leftIcon, block, iconBlock, variant, round, small, colorOverride, children, ref } = props, linkProps = __rest(props, ["rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
|
|
4607
4645
|
const theme = useThemeSafely();
|
|
4608
4646
|
const linkStyles = generateLinkStyles(props, theme);
|
|
4609
4647
|
const mainClassName = css.cx('link', linkStyles, props.className);
|
|
4648
|
+
if (variant === 'text') {
|
|
4649
|
+
return React__namespace.createElement(Text, { className: mainClassName, tag: "div" }, props.children);
|
|
4650
|
+
}
|
|
4610
4651
|
return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }),
|
|
4611
4652
|
React__namespace.createElement(LinkContent, Object.assign({}, props))));
|
|
4612
4653
|
};
|
|
@@ -4629,11 +4670,11 @@ const ThemeRenderer = (p) => {
|
|
|
4629
4670
|
let colorBox;
|
|
4630
4671
|
if (/color/i.test(key)) {
|
|
4631
4672
|
colorBox = (React__namespace.createElement("span", { className: css.css({
|
|
4632
|
-
display: '
|
|
4673
|
+
display: 'block',
|
|
4633
4674
|
border: '1px solid black',
|
|
4634
|
-
width:
|
|
4675
|
+
width: '100%',
|
|
4635
4676
|
height: 24,
|
|
4636
|
-
|
|
4677
|
+
background: value
|
|
4637
4678
|
}) }));
|
|
4638
4679
|
}
|
|
4639
4680
|
return (React__namespace.createElement(Tr, { key: key },
|
|
@@ -4644,7 +4685,7 @@ const ThemeRenderer = (p) => {
|
|
|
4644
4685
|
alignItems: 'center',
|
|
4645
4686
|
gap: '1rem'
|
|
4646
4687
|
}) },
|
|
4647
|
-
value,
|
|
4688
|
+
React__namespace.createElement("span", { className: css.css({ flexShrink: 1 }) }, value),
|
|
4648
4689
|
" ",
|
|
4649
4690
|
colorBox))));
|
|
4650
4691
|
}))));
|