@mackin.com/styleguide 8.2.2 → 8.3.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.
Files changed (3) hide show
  1. package/index.d.ts +9 -3
  2. package/index.js +137 -108
  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. */
@@ -1055,4 +1061,4 @@ interface ThemeRendererProps extends MackinTheme {
1055
1061
  }
1056
1062
  declare const ThemeRenderer: (p: ThemeRendererProps) => JSX.Element;
1057
1063
 
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 };
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, 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', 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,12 +368,24 @@ 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') && `
312
372
  display: inline-block;
313
373
  width: auto;
314
374
  box-shadow: none;
315
375
  border: none;
316
376
  `}
377
+ ${(props.variant === 'text') && `
378
+ font-weight: normal;
379
+ cursor: auto;
380
+ display: inline-block;
381
+ width: auto;
382
+ box-shadow: none;
383
+ border: none;
384
+ line-height: ${theme.controls.height};
385
+ &:hover:not(:disabled) {
386
+ filter: none;
387
+ }
388
+ `}
317
389
  ${props.variant === 'link' && `
318
390
  padding: 0;
319
391
  display: inline-block;
@@ -403,18 +475,24 @@ const Button = React__namespace.forwardRef((props, ref) => {
403
475
  `}
404
476
  `;
405
477
  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)));
478
+ let content;
479
+ if (variant === 'text') {
480
+ content = React__namespace.createElement(Text, { className: css.cx(styles, props.className), tag: "div" }, props.children);
481
+ }
482
+ else {
483
+ 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' }),
484
+ props.leftIcon && React__namespace.createElement("span", { className: css.css({ marginRight: '0.5rem' }) }, props.leftIcon),
485
+ props.waiting ? React__namespace.createElement(Icon, { id: "waiting", spin: true }) : props.children,
486
+ props.rightIcon && React__namespace.createElement("span", { className: css.css({ marginLeft: '0.5rem' }) }, props.rightIcon)));
487
+ }
410
488
  if (props.controlAlign) {
411
489
  return (React__namespace.createElement("span", { className: css.css({
412
490
  display: 'inline-block',
413
491
  width: '100%',
414
492
  paddingBottom: theme.controls.inputErrorMinHeight
415
- }) }, button));
493
+ }) }, content));
416
494
  }
417
- return button;
495
+ return content;
418
496
  });
419
497
 
420
498
  const accordianExpandTimeMs = 250;
@@ -727,30 +805,30 @@ const ListItem = (props) => {
727
805
  border-bottom: none;
728
806
  }
729
807
  `;
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
- `;
808
+ const contentStyle = css.css({
809
+ padding: `calc(${theme.controls.padding} * 1.5)`
810
+ }, props.variant === 'full' && {
811
+ padding: 0
812
+ }, !props.noContentStyling && {
813
+ '>.button': {
814
+ padding: `calc(${theme.controls.padding} * 1.5)`,
815
+ width: '100%',
816
+ border: 'none'
817
+ },
818
+ '>.omniLink': {
819
+ paddingLeft: `calc(${theme.controls.padding} * 1.5)`,
820
+ paddingRight: `calc(${theme.controls.padding} * 1.5)`,
821
+ width: '100%',
822
+ border: 'none',
823
+ lineHeight: theme.controls.height
824
+ },
825
+ '>.button:not(:focus), >.omniLink:not(:focus)': {
826
+ boxShadow: 'none',
827
+ },
828
+ '>.omniLink:not(.omniLink--iconBlock)': {
829
+ display: 'block'
830
+ }
831
+ });
754
832
  return (React__namespace.createElement("li", Object.assign({}, liProps, { className: css.cx('listItem', itemStyles, props.className) }),
755
833
  React__namespace.createElement("div", { className: css.css(contentStyle) }, props.children)));
756
834
  };
@@ -786,67 +864,6 @@ const TabLocker = (props) => {
786
864
  } }, props.children));
787
865
  };
788
866
 
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
867
  //TB: FUTURE will need to use the new input
851
868
  const defaultMaxShownValues = 7;
852
869
  const buttonMarkerClass = 'ListItem__button';
@@ -1557,14 +1574,14 @@ const Modal = (p) => {
1557
1574
  outline: 'none'
1558
1575
  }
1559
1576
  });
1560
- const modalHeaderStyles = css.css({
1577
+ const modalHeaderStyles = css.cx(css.css({
1561
1578
  display: 'flex',
1562
1579
  justifyContent: 'space-between',
1563
1580
  alignItems: 'center',
1564
1581
  backgroundColor: theme.colors.header,
1565
1582
  padding: '1rem',
1566
1583
  color: theme.colors.headerFont
1567
- });
1584
+ }), p.headerClassName);
1568
1585
  const modalContainerStyles = css.css([{
1569
1586
  position: 'fixed',
1570
1587
  height: '100%',
@@ -3071,6 +3088,11 @@ const generateLinkStyles = (props, theme) => {
3071
3088
  box-shadow: none;
3072
3089
  border: none;
3073
3090
  `}
3091
+ ${props.variant === 'text' && `
3092
+ box-shadow: none;
3093
+ border: none;
3094
+ cursor: auto;
3095
+ `}
3074
3096
  ${props.variant === 'icon' && `
3075
3097
  box-shadow: none;
3076
3098
  border: none;
@@ -3100,10 +3122,13 @@ const generateLinkStyles = (props, theme) => {
3100
3122
  };
3101
3123
 
3102
3124
  const OmniLink = (props) => {
3103
- const linkProps = __rest(props, ["noRouter", "rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
3125
+ 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
3126
  const theme = useThemeSafely();
3105
3127
  const linkStyles = generateLinkStyles(props, theme);
3106
3128
  const mainClassName = css.cx('omniLink', linkStyles, props.className);
3129
+ if (variant === 'text') {
3130
+ return React__namespace.createElement(Text, { className: mainClassName, tag: "div" }, props.children);
3131
+ }
3107
3132
  const content = React__namespace.createElement(LinkContent, Object.assign({}, props));
3108
3133
  if (props.noRouter) {
3109
3134
  return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }), content));
@@ -3111,7 +3136,6 @@ const OmniLink = (props) => {
3111
3136
  return (React__namespace.createElement(reactRouterDom.Link, Object.assign({}, linkProps, { className: mainClassName, to: props.href }), content));
3112
3137
  };
3113
3138
 
3114
- //TB: test in safari with the new arrow
3115
3139
  const roundPxPadding = '4px';
3116
3140
  const Picker = (props) => {
3117
3141
  const selectProps = __rest(props
@@ -4604,16 +4628,21 @@ const enumToEntities = (enumObj) => {
4604
4628
  };
4605
4629
 
4606
4630
  const Link = (props) => {
4607
- const linkProps = __rest(props, ["rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
4631
+ 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
4632
  const theme = useThemeSafely();
4609
4633
  const linkStyles = generateLinkStyles(props, theme);
4610
4634
  const mainClassName = css.cx('link', linkStyles, props.className);
4635
+ if (variant === 'text') {
4636
+ return React__namespace.createElement(Text, { className: mainClassName, tag: "div" }, props.children);
4637
+ }
4611
4638
  return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }),
4612
4639
  React__namespace.createElement(LinkContent, Object.assign({}, props))));
4613
4640
  };
4614
4641
 
4615
4642
  const ThemeRenderer = (p) => {
4616
4643
  const { backgroundColor, color } = p, theme = __rest(p, ["backgroundColor", "color"]);
4644
+ const flatTheme = flatten(theme);
4645
+ const entries = lodash.orderBy(Object.entries(flatTheme), x => x[0]);
4617
4646
  return (React__namespace.createElement(Table, { caption: (React__namespace.createElement("div", null,
4618
4647
  React__namespace.createElement(Text, { tag: "h1", align: "center" }, "Theme"),
4619
4648
  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({
@@ -4624,15 +4653,15 @@ const ThemeRenderer = (p) => {
4624
4653
  React__namespace.createElement(Tr, null,
4625
4654
  React__namespace.createElement(Th, { align: "left" }, "Property"),
4626
4655
  React__namespace.createElement(Th, { align: "left" }, "Value"))),
4627
- React__namespace.createElement("tbody", null, Object.entries(flatten(theme)).map(([key, value]) => {
4656
+ React__namespace.createElement("tbody", null, entries.map(([key, value]) => {
4628
4657
  let colorBox;
4629
4658
  if (/color/i.test(key)) {
4630
4659
  colorBox = (React__namespace.createElement("span", { className: css.css({
4631
- display: 'inline-block',
4660
+ display: 'block',
4632
4661
  border: '1px solid black',
4633
- width: 24,
4662
+ width: '100%',
4634
4663
  height: 24,
4635
- backgroundColor: value
4664
+ background: value
4636
4665
  }) }));
4637
4666
  }
4638
4667
  return (React__namespace.createElement(Tr, { key: key },
@@ -4643,7 +4672,7 @@ const ThemeRenderer = (p) => {
4643
4672
  alignItems: 'center',
4644
4673
  gap: '1rem'
4645
4674
  }) },
4646
- value,
4675
+ React__namespace.createElement("span", { className: css.css({ flexShrink: 1 }) }, value),
4647
4676
  " ",
4648
4677
  colorBox))));
4649
4678
  }))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mackin.com/styleguide",
3
- "version": "8.2.2",
3
+ "version": "8.3.1",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",