@mackin.com/styleguide 8.2.1 → 8.3.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.
Files changed (3) hide show
  1. package/index.d.ts +15 -3
  2. package/index.js +184 -104
  3. 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;
@@ -1039,7 +1045,7 @@ interface LinkProps extends LinkContentProps, React.DetailedHTMLProps<React.Anch
1039
1045
  /** Full width with max space between the text and the icon */
1040
1046
  iconBlock?: boolean;
1041
1047
  /** Corresponds to the button variants of the same name. */
1042
- variant?: 'button' | 'label' | 'icon' | 'circle' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
1048
+ variant?: 'button' | 'label' | 'icon' | 'circle' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative' | 'text';
1043
1049
  /** Only for button variants. */
1044
1050
  round?: boolean;
1045
1051
  /** Only for button variants. */
@@ -1049,4 +1055,10 @@ interface LinkProps extends LinkContentProps, React.DetailedHTMLProps<React.Anch
1049
1055
  }
1050
1056
  declare const Link: (props: LinkProps) => JSX.Element;
1051
1057
 
1052
- 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, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
1058
+ interface ThemeRendererProps extends MackinTheme {
1059
+ backgroundColor?: string;
1060
+ color?: string;
1061
+ }
1062
+ declare const ThemeRenderer: (p: ThemeRendererProps) => JSX.Element;
1063
+
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 };
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', 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. */
@@ -118,7 +118,6 @@ const calcDynamicThemeProps = (theme) => {
118
118
  theme.controls.focusOutlineRequiredShadow = `0px 0px 4px 2px ${theme.colors.focusOutlineRequired}`;
119
119
  theme.controls.dividerBorder = `${theme.controls.dividerThickness} solid ${theme.colors.divider}`;
120
120
  theme.controls.inputErrorMinHeight = `calc(${theme.fonts.sizeSmall} * 1.5 + 4px)`;
121
- theme.controls.buttonBoxShadow = theme.controls.boxShadow;
122
121
  theme.mediaQueries.desktop = `@media(min-width:${theme.breakpoints.desktop})`;
123
122
  theme.mediaQueries.tablet = `@media(min-width:${theme.breakpoints.tablet})`;
124
123
  };
@@ -181,6 +180,8 @@ const defaultTheme = {
181
180
  height: '44px',
182
181
  heightSmall: '34px',
183
182
  boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.25)',
183
+ headerBoxShadow: '0px 2px 12px 6px rgba(0, 0, 0, 0.2)',
184
+ buttonBoxShadow: '2px 2px 4px rgba(0, 0, 0, 0.25)',
184
185
  hoverBrightness: 'brightness(0.75)',
185
186
  transitionDuration: '0.25s',
186
187
  transitionEasing: 'ease-in-out',
@@ -194,8 +195,6 @@ const defaultTheme = {
194
195
  dividerMargin: '1rem',
195
196
  dividerBorder: '',
196
197
  dividerThickness: '2px',
197
- headerBoxShadow: '0px 2px 12px 6px rgba(0, 0, 0, 0.2)',
198
- buttonBoxShadow: '',
199
198
  inputErrorMinHeight: '',
200
199
  paragraphPadding: '1rem'
201
200
  },
@@ -239,9 +238,70 @@ const useThemeSafely = () => {
239
238
  return defaultTheme;
240
239
  };
241
240
 
241
+ const getTagStyles = (theme, tag) => {
242
+ switch (tag) {
243
+ case 'p': return {
244
+ marginTop: theme.controls.paragraphPadding,
245
+ marginBottom: theme.controls.paragraphPadding
246
+ };
247
+ case 'h1': return {
248
+ fontSize: theme.fonts.sizeH1
249
+ };
250
+ case 'h2': return {
251
+ fontSize: theme.fonts.sizeH2
252
+ };
253
+ case 'h3': return {
254
+ fontSize: theme.fonts.sizeH3
255
+ };
256
+ case 'h4': return {
257
+ fontSize: theme.fonts.sizeH4
258
+ };
259
+ default: return undefined;
260
+ }
261
+ };
262
+ const headerRegex = /h1|h2|h3|h4/;
263
+ const alignStyles = {
264
+ 'center': { textAlign: 'center' },
265
+ 'left': { textAlign: 'left' },
266
+ 'right': { textAlign: 'right' }
267
+ };
268
+ /** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
269
+ const Text = (props) => {
270
+ var _a, _b;
271
+ const theme = useThemeSafely();
272
+ const tagChoice = props.tag || 'p';
273
+ const style = props.style || {};
274
+ if (props.lineClamp) {
275
+ style.WebkitLineClamp = props.lineClamp;
276
+ }
277
+ if (props.leftPad) {
278
+ style.paddingLeft = props.leftPad;
279
+ }
280
+ const styles = css.css(getTagStyles(theme, tagChoice), {
281
+ userSelect: 'text',
282
+ label: 'Text',
283
+ fontSize: props.fontSize ? props.fontSize : undefined
284
+ }, 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 && {
285
+ overflow: 'hidden',
286
+ whiteSpace: 'nowrap',
287
+ textOverflow: 'ellipsis'
288
+ }, props.lineClamp && {
289
+ WebkitBoxOrient: 'vertical',
290
+ overflow: 'hidden',
291
+ textOverflow: 'ellipsis',
292
+ display: '-webkit-box'
293
+ }, 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 : '') && {
294
+ fontFamily: theme.fonts.headerFamily
295
+ });
296
+ return React__namespace.createElement(tagChoice, {
297
+ style: style,
298
+ className: css.cx('text', styles, props.className)
299
+ }, props.children);
300
+ };
301
+
242
302
  const Button = React__namespace.forwardRef((props, ref) => {
243
303
  var _a;
244
- const nativeProps = __rest(props, ["variant", "round", "rightIcon", "leftIcon", "iconBlock", "small", "readOnly", "waiting", "enforceMinWidth", "controlAlign"]);
304
+ 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"]);
245
305
  const theme = useThemeSafely();
246
306
  const buttonStyles = css.css `
247
307
  padding-left: ${theme.controls.padding};
@@ -308,11 +368,22 @@ const Button = React__namespace.forwardRef((props, ref) => {
308
368
  font-size: 1.3rem;
309
369
  `}
310
370
  `}
311
- ${props.variant === 'label' && `
371
+ ${(props.variant === 'label') && `
372
+ display: inline-block;
373
+ width: auto;
374
+ box-shadow: none;
375
+ border: none;
376
+ `}
377
+ ${(props.variant === 'text') && `
378
+ cursor: auto;
312
379
  display: inline-block;
313
380
  width: auto;
314
381
  box-shadow: none;
315
382
  border: none;
383
+ line-height: ${theme.controls.height};
384
+ &:hover:not(:disabled) {
385
+ filter: none;
386
+ }
316
387
  `}
317
388
  ${props.variant === 'link' && `
318
389
  padding: 0;
@@ -403,18 +474,24 @@ const Button = React__namespace.forwardRef((props, ref) => {
403
474
  `}
404
475
  `;
405
476
  const disabled = props.disabled || props.waiting;
406
- const button = (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' }),
407
- props.leftIcon && React__namespace.createElement("span", { className: css.css({ marginRight: '0.5rem' }) }, props.leftIcon),
408
- props.waiting ? React__namespace.createElement(Icon, { id: "waiting", spin: true }) : props.children,
409
- props.rightIcon && React__namespace.createElement("span", { className: css.css({ marginLeft: '0.5rem' }) }, props.rightIcon)));
477
+ let content;
478
+ if (variant === 'text') {
479
+ content = React__namespace.createElement(Text, { className: css.cx(styles, props.className), tag: "div" }, props.children);
480
+ }
481
+ else {
482
+ 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' }),
483
+ props.leftIcon && React__namespace.createElement("span", { className: css.css({ marginRight: '0.5rem' }) }, props.leftIcon),
484
+ props.waiting ? React__namespace.createElement(Icon, { id: "waiting", spin: true }) : props.children,
485
+ props.rightIcon && React__namespace.createElement("span", { className: css.css({ marginLeft: '0.5rem' }) }, props.rightIcon)));
486
+ }
410
487
  if (props.controlAlign) {
411
488
  return (React__namespace.createElement("span", { className: css.css({
412
489
  display: 'inline-block',
413
490
  width: '100%',
414
491
  paddingBottom: theme.controls.inputErrorMinHeight
415
- }) }, button));
492
+ }) }, content));
416
493
  }
417
- return button;
494
+ return content;
418
495
  });
419
496
 
420
497
  const accordianExpandTimeMs = 250;
@@ -727,30 +804,30 @@ const ListItem = (props) => {
727
804
  border-bottom: none;
728
805
  }
729
806
  `;
730
- const contentStyle = css.css `
731
- padding: calc(${theme.controls.padding} * 1.5);
732
- ${props.variant === 'full' && `
733
- padding:0;
734
- >.button {
735
- padding: calc(${theme.controls.padding} * 1.5);
736
- width: 100%;
737
- border: none;
738
- }
739
- >.omniLink {
740
- padding-left: calc(${theme.controls.padding} * 1.5);
741
- padding-right: calc(${theme.controls.padding} * 1.5);
742
- width: 100%;
743
- line-height: ${theme.controls.height};
744
- border: none;
745
- }
746
- >.button:not(:focus), >.omniLink:not(:focus) {
747
- box-shadow: none;
748
- }
749
- >.omniLink:not(.omniLink--iconBlock){
750
- display: block;
751
- }
752
- `}
753
- `;
807
+ const contentStyle = css.css({
808
+ padding: `calc(${theme.controls.padding} * 1.5)`
809
+ }, props.variant === 'full' && {
810
+ padding: 0
811
+ }, !props.noContentStyling && {
812
+ '>.button': {
813
+ padding: `calc(${theme.controls.padding} * 1.5)`,
814
+ width: '100%',
815
+ border: 'none'
816
+ },
817
+ '>.omniLink': {
818
+ paddingLeft: `calc(${theme.controls.padding} * 1.5)`,
819
+ paddingRight: `calc(${theme.controls.padding} * 1.5)`,
820
+ width: '100%',
821
+ border: 'none',
822
+ lineHeight: theme.controls.height
823
+ },
824
+ '>.button:not(:focus), >.omniLink:not(:focus)': {
825
+ boxShadow: 'none',
826
+ },
827
+ '>.omniLink:not(.omniLink--iconBlock)': {
828
+ display: 'block'
829
+ }
830
+ });
754
831
  return (React__namespace.createElement("li", Object.assign({}, liProps, { className: css.cx('listItem', itemStyles, props.className) }),
755
832
  React__namespace.createElement("div", { className: css.css(contentStyle) }, props.children)));
756
833
  };
@@ -786,67 +863,6 @@ const TabLocker = (props) => {
786
863
  } }, props.children));
787
864
  };
788
865
 
789
- const getTagStyles = (theme, tag) => {
790
- switch (tag) {
791
- case 'p': return {
792
- marginTop: theme.controls.paragraphPadding,
793
- marginBottom: theme.controls.paragraphPadding
794
- };
795
- case 'h1': return {
796
- fontSize: theme.fonts.sizeH1
797
- };
798
- case 'h2': return {
799
- fontSize: theme.fonts.sizeH2
800
- };
801
- case 'h3': return {
802
- fontSize: theme.fonts.sizeH3
803
- };
804
- case 'h4': return {
805
- fontSize: theme.fonts.sizeH4
806
- };
807
- default: return undefined;
808
- }
809
- };
810
- const headerRegex = /h1|h2|h3|h4/;
811
- const alignStyles = {
812
- 'center': { textAlign: 'center' },
813
- 'left': { textAlign: 'left' },
814
- 'right': { textAlign: 'right' }
815
- };
816
- /** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
817
- const Text = (props) => {
818
- var _a, _b;
819
- const theme = useThemeSafely();
820
- const tagChoice = props.tag || 'p';
821
- const style = props.style || {};
822
- if (props.lineClamp) {
823
- style.WebkitLineClamp = props.lineClamp;
824
- }
825
- if (props.leftPad) {
826
- style.paddingLeft = props.leftPad;
827
- }
828
- const styles = css.css(getTagStyles(theme, tagChoice), {
829
- userSelect: 'text',
830
- label: 'Text',
831
- fontSize: props.fontSize ? props.fontSize : undefined
832
- }, 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 && {
833
- overflow: 'hidden',
834
- whiteSpace: 'nowrap',
835
- textOverflow: 'ellipsis'
836
- }, props.lineClamp && {
837
- WebkitBoxOrient: 'vertical',
838
- overflow: 'hidden',
839
- textOverflow: 'ellipsis',
840
- display: '-webkit-box'
841
- }, 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 : '') && {
842
- fontFamily: theme.fonts.headerFamily
843
- });
844
- return React__namespace.createElement(tagChoice, {
845
- style: style,
846
- className: css.cx('text', styles, props.className)
847
- }, props.children);
848
- };
849
-
850
866
  //TB: FUTURE will need to use the new input
851
867
  const defaultMaxShownValues = 7;
852
868
  const buttonMarkerClass = 'ListItem__button';
@@ -1557,14 +1573,14 @@ const Modal = (p) => {
1557
1573
  outline: 'none'
1558
1574
  }
1559
1575
  });
1560
- const modalHeaderStyles = css.css({
1576
+ const modalHeaderStyles = css.cx(css.css({
1561
1577
  display: 'flex',
1562
1578
  justifyContent: 'space-between',
1563
1579
  alignItems: 'center',
1564
1580
  backgroundColor: theme.colors.header,
1565
1581
  padding: '1rem',
1566
1582
  color: theme.colors.headerFont
1567
- });
1583
+ }), p.headerClassName);
1568
1584
  const modalContainerStyles = css.css([{
1569
1585
  position: 'fixed',
1570
1586
  height: '100%',
@@ -3071,6 +3087,11 @@ const generateLinkStyles = (props, theme) => {
3071
3087
  box-shadow: none;
3072
3088
  border: none;
3073
3089
  `}
3090
+ ${props.variant === 'text' && `
3091
+ box-shadow: none;
3092
+ border: none;
3093
+ cursor: auto;
3094
+ `}
3074
3095
  ${props.variant === 'icon' && `
3075
3096
  box-shadow: none;
3076
3097
  border: none;
@@ -3100,10 +3121,13 @@ const generateLinkStyles = (props, theme) => {
3100
3121
  };
3101
3122
 
3102
3123
  const OmniLink = (props) => {
3103
- const linkProps = __rest(props, ["noRouter", "rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
3124
+ 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"]);
3104
3125
  const theme = useThemeSafely();
3105
3126
  const linkStyles = generateLinkStyles(props, theme);
3106
3127
  const mainClassName = css.cx('omniLink', linkStyles, props.className);
3128
+ if (variant === 'text') {
3129
+ return React__namespace.createElement(Text, { className: mainClassName, tag: "div" }, props.children);
3130
+ }
3107
3131
  const content = React__namespace.createElement(LinkContent, Object.assign({}, props));
3108
3132
  if (props.noRouter) {
3109
3133
  return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }), content));
@@ -3111,7 +3135,6 @@ const OmniLink = (props) => {
3111
3135
  return (React__namespace.createElement(reactRouterDom.Link, Object.assign({}, linkProps, { className: mainClassName, to: props.href }), content));
3112
3136
  };
3113
3137
 
3114
- //TB: test in safari with the new arrow
3115
3138
  const roundPxPadding = '4px';
3116
3139
  const Picker = (props) => {
3117
3140
  const selectProps = __rest(props
@@ -4430,7 +4453,7 @@ select,
4430
4453
  textarea {
4431
4454
  font-family: inherit; /* 1 */
4432
4455
  font-size: 100%; /* 1 */
4433
- line-height: 1; /* 1 Mackin changed this from 1.15 to 1 which seems to be the Chrome default for buttons. */
4456
+ /* line-height: 1.15; This causes issues with Chrome buttons. */
4434
4457
  margin: 0; /* 2 */
4435
4458
  }
4436
4459
 
@@ -4604,14 +4627,70 @@ const enumToEntities = (enumObj) => {
4604
4627
  };
4605
4628
 
4606
4629
  const Link = (props) => {
4607
- const linkProps = __rest(props, ["rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
4630
+ 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"]);
4608
4631
  const theme = useThemeSafely();
4609
4632
  const linkStyles = generateLinkStyles(props, theme);
4610
4633
  const mainClassName = css.cx('link', linkStyles, props.className);
4634
+ if (variant === 'text') {
4635
+ return React__namespace.createElement(Text, { className: mainClassName, tag: "div" }, props.children);
4636
+ }
4611
4637
  return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }),
4612
4638
  React__namespace.createElement(LinkContent, Object.assign({}, props))));
4613
4639
  };
4614
4640
 
4641
+ const ThemeRenderer = (p) => {
4642
+ const { backgroundColor, color } = p, theme = __rest(p, ["backgroundColor", "color"]);
4643
+ const flatTheme = flatten(theme);
4644
+ const entries = lodash.orderBy(Object.entries(flatTheme), x => x[0]);
4645
+ return (React__namespace.createElement(Table, { caption: (React__namespace.createElement("div", null,
4646
+ React__namespace.createElement(Text, { tag: "h1", align: "center" }, "Theme"),
4647
+ React__namespace.createElement(Text, { tag: "p", align: "center", italics: true }, "Background color applied to show colors with alpha ('rgba(X, X, X, 0.X)')"))), className: css.css({
4648
+ backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : '#eee7ca',
4649
+ color: color !== null && color !== void 0 ? color : 'black'
4650
+ }) },
4651
+ React__namespace.createElement("thead", null,
4652
+ React__namespace.createElement(Tr, null,
4653
+ React__namespace.createElement(Th, { align: "left" }, "Property"),
4654
+ React__namespace.createElement(Th, { align: "left" }, "Value"))),
4655
+ React__namespace.createElement("tbody", null, entries.map(([key, value]) => {
4656
+ let colorBox;
4657
+ if (/color/i.test(key)) {
4658
+ colorBox = (React__namespace.createElement("span", { className: css.css({
4659
+ display: 'block',
4660
+ border: '1px solid black',
4661
+ width: '100%',
4662
+ height: 24,
4663
+ background: value
4664
+ }) }));
4665
+ }
4666
+ return (React__namespace.createElement(Tr, { key: key },
4667
+ React__namespace.createElement(Td, { align: "left" }, key),
4668
+ React__namespace.createElement(Td, { align: "left" },
4669
+ React__namespace.createElement("div", { className: css.css({
4670
+ display: 'flex',
4671
+ alignItems: 'center',
4672
+ gap: '1rem'
4673
+ }) },
4674
+ React__namespace.createElement("span", { className: css.css({ flexShrink: 1 }) }, value),
4675
+ " ",
4676
+ colorBox))));
4677
+ }))));
4678
+ };
4679
+ const flatten = (obj, parent, path = 'theme') => {
4680
+ const flatObj = parent !== null && parent !== void 0 ? parent : {};
4681
+ for (const prop in obj) {
4682
+ const value = obj[prop];
4683
+ const fullPath = `${path}.${prop}`;
4684
+ if (typeof value !== 'object') {
4685
+ flatObj[fullPath] = value;
4686
+ }
4687
+ else {
4688
+ flatten(value, flatObj, fullPath);
4689
+ }
4690
+ }
4691
+ return flatObj;
4692
+ };
4693
+
4615
4694
  exports.Accordian = Accordian;
4616
4695
  exports.Autocomplete = Autocomplete;
4617
4696
  exports.Backdrop = Backdrop$1;
@@ -4668,6 +4747,7 @@ exports.TextInput = TextInput;
4668
4747
  exports.Th = Th;
4669
4748
  exports.ThSort = ThSort;
4670
4749
  exports.ThemeProvider = ThemeProvider;
4750
+ exports.ThemeRenderer = ThemeRenderer;
4671
4751
  exports.ToggleButton = ToggleButton;
4672
4752
  exports.ToggleButtonGroup = ToggleButtonGroup;
4673
4753
  exports.TogglePasswordInput = TogglePasswordInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mackin.com/styleguide",
3
- "version": "8.2.1",
3
+ "version": "8.3.0",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",