@mackin.com/styleguide 8.7.1 → 8.9.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 +33 -3
  2. package/index.js +63 -19
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -212,15 +212,19 @@ interface FormProps extends BaseProps$3 {
212
212
  inline?: boolean;
213
213
  /** If true, preventDefault and stopPropagation will be applied prior to onSubmit being called. Defaults to true. */
214
214
  ajax?: boolean;
215
+ /** Removes the opinionated flex styling. 'inline' will be ignored. */
216
+ unstyled?: boolean;
215
217
  }
216
218
  /** Use this instead of <form> directly. If we need to fight Chrome's autofill, we can do so at a global level. */
217
- declare const Form: React.ForwardRefExoticComponent<Pick<FormProps, "inline" | "ajax" | "key" | "acceptCharset" | "action" | "autoComplete" | "encType" | "method" | "name" | "noValidate" | "target" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLFormElement>>;
219
+ declare const Form: React.ForwardRefExoticComponent<Pick<FormProps, "inline" | "ajax" | "unstyled" | "key" | "acceptCharset" | "action" | "autoComplete" | "encType" | "method" | "name" | "noValidate" | "target" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLFormElement>>;
220
+ /** @deprecated Just style normally using flex, grid, etc. */
218
221
  declare const FormFlexRow: (props: {
219
222
  children: React.ReactNode;
220
223
  className?: string;
221
224
  style?: React.CSSProperties;
222
225
  justifyContent?: "space-around" | "space-between" | "space-evenly" | "stretch" | "center" | "end" | "flex-end" | "flex-start" | "start";
223
226
  }) => JSX.Element;
227
+ /** @deprecated Just style normally using flex, grid, etc. */
224
228
  declare const FormColumnRow: (props: {
225
229
  children: React.ReactNode;
226
230
  cols: number;
@@ -658,7 +662,7 @@ declare type PickerOption<T> = T | {
658
662
  id: T;
659
663
  name?: string;
660
664
  };
661
- interface SelectProps extends Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, 'value' | 'options'> {
665
+ interface SelectProps extends Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, 'value' | 'options' | 'string'> {
662
666
  }
663
667
  interface PickerProps<T extends PickerValue> extends SelectProps {
664
668
  value: T;
@@ -668,6 +672,12 @@ interface PickerProps<T extends PickerValue> extends SelectProps {
668
672
  round?: boolean;
669
673
  /** If true, bottom padding will be added to account for other inputs having space for error messages. */
670
674
  controlAlign?: boolean;
675
+ /** This will be applied to the select element. */
676
+ className?: string;
677
+ /** Applies to the outer wrapper which contains the select and other elements. */
678
+ wrapperClassName?: string;
679
+ /** Applies to the custom down arrow. */
680
+ iconClassName?: string;
671
681
  }
672
682
  declare const Picker: <T extends PickerValue>(props: PickerProps<T>) => JSX.Element;
673
683
 
@@ -711,7 +721,6 @@ interface SearchBoxProps {
711
721
  id?: string;
712
722
  placeholder?: string;
713
723
  round?: boolean;
714
- onSubmit?: () => Promise<void>;
715
724
  /** Defaults to 250ms */
716
725
  debounceMs?: number;
717
726
  autoFocus?: boolean;
@@ -719,6 +728,10 @@ interface SearchBoxProps {
719
728
  className?: string;
720
729
  buttonClassName?: string;
721
730
  inputClassName?: string;
731
+ /** This will be ignored if 'noForm' is true. */
732
+ onSubmit?: () => Promise<void>;
733
+ /** If true, the controls will not be wrapped in a Form component. In addition, 'onSubmit' will be ignored. */
734
+ noForm?: boolean;
722
735
  }
723
736
  declare const SearchBox: (props: SearchBoxProps) => JSX.Element;
724
737
 
@@ -733,7 +746,9 @@ interface MackinTheme {
733
746
  primary2: string;
734
747
  primary2Font: string;
735
748
  secondary: string;
749
+ /** @deprecated Bad name. Use 'secondaryFont'. */
736
750
  secondary2Font: string;
751
+ secondaryFont: string;
737
752
  info: string;
738
753
  infoFont: string;
739
754
  warning: string;
@@ -786,7 +801,10 @@ interface MackinTheme {
786
801
  height: string;
787
802
  heightSmall: string;
788
803
  boxShadow: string;
804
+ /** For controls with a background color. */
789
805
  hoverBrightness: string;
806
+ /** For controls without a background color. */
807
+ hoverBackground: string;
790
808
  transitionDuration: string;
791
809
  transitionEasing: string;
792
810
  transition: string;
@@ -864,6 +882,18 @@ interface SliderProps<T extends SliderValue> {
864
882
  renderValue?: (value: number) => string;
865
883
  /** Used with renderValue for the custom element width. Defaults to theme.controls.height * 2. */
866
884
  renderValueWidth?: string;
885
+ /** Styles of the overall slider. */
886
+ className?: string;
887
+ /** Styles for the slider handles. */
888
+ handleClassName?: string;
889
+ /** Styles for the first handle. */
890
+ handle1ClassName?: string;
891
+ /** Styles for the second handle. Ignored if the value is not an array. */
892
+ handle2ClassName?: string;
893
+ /** Styles of the track. */
894
+ trackClassName?: string;
895
+ /** Styles applied to the track between two handlers. Ignored if the value is not an array. */
896
+ innerTrackClassName?: string;
867
897
  }
868
898
  declare const Slider: <T extends SliderValue>(p: SliderProps<T>) => JSX.Element;
869
899
 
package/index.js CHANGED
@@ -128,6 +128,7 @@ const defaultTheme = {
128
128
  primary2: '#007bff',
129
129
  primary2Font: 'rgba(255, 255, 255, 0.9)',
130
130
  secondary: '#9e9e9e',
131
+ secondaryFont: 'rgba(255, 255, 255, 0.9)',
131
132
  secondary2Font: 'rgba(255, 255, 255, 0.9)',
132
133
  info: '#7851a9',
133
134
  infoFont: 'rgba(255, 255, 255, 0.9)',
@@ -182,7 +183,8 @@ const defaultTheme = {
182
183
  boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.25)',
183
184
  headerBoxShadow: '0px 2px 12px 6px rgba(0, 0, 0, 0.2)',
184
185
  buttonBoxShadow: '2px 2px 4px rgba(0, 0, 0, 0.25)',
185
- hoverBrightness: 'brightness(0.75)',
186
+ hoverBrightness: 'brightness(0.8)',
187
+ hoverBackground: 'rgba(0, 0, 0, 0.1)',
186
188
  transitionDuration: '0.25s',
187
189
  transitionEasing: 'ease-in-out',
188
190
  transition: '',
@@ -311,6 +313,7 @@ const Text = (props) => {
311
313
  }, props.children);
312
314
  };
313
315
 
316
+ //TB: FUTURE de-dup these styles. create individual styles and compose them manually.
314
317
  const Button = React__namespace.forwardRef((props, ref) => {
315
318
  var _a;
316
319
  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"]);
@@ -375,6 +378,9 @@ const Button = React__namespace.forwardRef((props, ref) => {
375
378
  justify-content: center;
376
379
  align-items: center;
377
380
  background-color: transparent;
381
+ &:hover:not(:disabled) {
382
+ background-color: ${theme.controls.hoverBackground};
383
+ }
378
384
  ${props.small && `
379
385
  width: ${theme.controls.heightSmall};
380
386
  min-width: ${theme.controls.heightSmall};
@@ -387,6 +393,9 @@ const Button = React__namespace.forwardRef((props, ref) => {
387
393
  box-shadow: none;
388
394
  border: none;
389
395
  background-color: transparent;
396
+ &:hover:not(:disabled) {
397
+ background-color: ${theme.controls.hoverBackground};
398
+ }
390
399
  `}
391
400
  ${(props.variant === 'text') && `
392
401
  background-color: transparent;
@@ -503,7 +512,6 @@ const Button = React__namespace.forwardRef((props, ref) => {
503
512
  if (props.controlAlign) {
504
513
  return (React__namespace.createElement("span", { className: css.css({
505
514
  display: 'inline-block',
506
- width: '100%',
507
515
  paddingBottom: theme.controls.inputErrorMinHeight
508
516
  }) }, content));
509
517
  }
@@ -1745,14 +1753,19 @@ const ErrorModal = (props) => {
1745
1753
 
1746
1754
  /** Use this instead of <form> directly. If we need to fight Chrome's autofill, we can do so at a global level. */
1747
1755
  const Form = React__namespace.forwardRef((props, ref) => {
1748
- const { inline, children, onSubmit, className, ajax } = props, rest = __rest(props, ["inline", "children", "onSubmit", "className", "ajax"]);
1756
+ const { inline, children, onSubmit, className, ajax, unstyled } = props, rest = __rest(props, ["inline", "children", "onSubmit", "className", "ajax", "unstyled"]);
1749
1757
  const theme = useThemeSafely();
1750
- return (React__namespace.createElement("form", Object.assign({}, rest, { ref: ref, className: css.cx('form', css.css({
1758
+ let defaultStyle;
1759
+ if (!props.unstyled) {
1760
+ defaultStyle = css.css({
1761
+ label: 'Form',
1751
1762
  display: 'flex',
1752
1763
  flexDirection: props.inline ? 'row' : 'column',
1753
1764
  alignItems: props.inline ? 'flex-end' : 'normal',
1754
1765
  gap: theme.controls.gap
1755
- }), props.className), onSubmit: e => {
1766
+ });
1767
+ }
1768
+ return (React__namespace.createElement("form", Object.assign({}, rest, { ref: ref, className: css.cx('form', defaultStyle, props.className), onSubmit: e => {
1756
1769
  if (ajax !== false) {
1757
1770
  e.preventDefault();
1758
1771
  e.stopPropagation();
@@ -1762,6 +1775,7 @@ const Form = React__namespace.forwardRef((props, ref) => {
1762
1775
  }
1763
1776
  } }), children));
1764
1777
  });
1778
+ /** @deprecated Just style normally using flex, grid, etc. */
1765
1779
  const FormFlexRow = (props) => {
1766
1780
  var _a;
1767
1781
  const theme = useThemeSafely();
@@ -1771,6 +1785,7 @@ const FormFlexRow = (props) => {
1771
1785
  justifyContent: (_a = props.justifyContent) !== null && _a !== void 0 ? _a : 'normal'
1772
1786
  }), props.className) }, props.children));
1773
1787
  };
1788
+ /** @deprecated Just style normally using flex, grid, etc. */
1774
1789
  const FormColumnRow = (props) => {
1775
1790
  const theme = useThemeSafely();
1776
1791
  return (React__namespace.createElement("div", { style: props.style, className: css.cx('formColumnRow', css.css({
@@ -2288,6 +2303,7 @@ const BaseInput = React__namespace.forwardRef((props, ref) => {
2288
2303
  const theme = useThemeSafely();
2289
2304
  const { rightControl, round, wrapperClassName, showErrorDisplay } = props, nativeProps = __rest(props, ["rightControl", "round", "wrapperClassName", "showErrorDisplay"]);
2290
2305
  const inputStyles = css.css({
2306
+ backgroundColor: theme.colors.bg,
2291
2307
  fontFamily: theme.fonts.family,
2292
2308
  fontSize: theme.fonts.size,
2293
2309
  width: '100%',
@@ -2354,7 +2370,8 @@ const BaseInput = React__namespace.forwardRef((props, ref) => {
2354
2370
  `}
2355
2371
  `;
2356
2372
  return (React__namespace.createElement("div", { className: css.css({
2357
- width: '100%'
2373
+ width: '100%',
2374
+ label: 'BaseInput'
2358
2375
  }) },
2359
2376
  React__namespace.createElement("div", { className: css.cx('input', inputWrapperStyles, wrapperClassName) },
2360
2377
  inputElement,
@@ -3004,6 +3021,7 @@ const LinkContent = (props) => {
3004
3021
  }) }, props.rightIcon)));
3005
3022
  };
3006
3023
 
3024
+ //TB: FUTURE de-dup these styles. create individual styles and compose them manually.
3007
3025
  const generateLinkStyles = (props, theme) => {
3008
3026
  var _a, _b, _c, _d, _e;
3009
3027
  const linkStyles = css.css `
@@ -3055,9 +3073,15 @@ const generateLinkStyles = (props, theme) => {
3055
3073
  `}
3056
3074
  ${props.variant === 'button' && `
3057
3075
  text-align: center;
3076
+ &:hover {
3077
+ background-color: ${theme.controls.hoverBackground};
3078
+ }
3058
3079
  `}
3059
3080
  ${props.variant === 'circle' && `
3060
3081
  text-align: center;
3082
+ &:hover {
3083
+ background-color: ${theme.controls.hoverBackground};
3084
+ }
3061
3085
  width: ${theme.controls.height};
3062
3086
  border-radius: 100%;
3063
3087
  display: flex;
@@ -3131,6 +3155,9 @@ const generateLinkStyles = (props, theme) => {
3131
3155
  ${props.variant === 'label' && `
3132
3156
  box-shadow: none;
3133
3157
  border: none;
3158
+ &:hover {
3159
+ background-color: ${theme.controls.hoverBackground};
3160
+ }
3134
3161
  `}
3135
3162
  ${props.variant === 'text' && `
3136
3163
  font-weight: normal;
@@ -3147,6 +3174,9 @@ const generateLinkStyles = (props, theme) => {
3147
3174
  font-size: 1.6rem;
3148
3175
  padding-left: 0;
3149
3176
  padding-right: 0;
3177
+ &:hover {
3178
+ background-color: ${theme.controls.hoverBackground};
3179
+ }
3150
3180
  `}
3151
3181
  ${props.block && `
3152
3182
  display: block;
@@ -3284,20 +3314,21 @@ const Picker = (props) => {
3284
3314
  }
3285
3315
  return React__namespace.createElement("option", { key: val, value: val }, label);
3286
3316
  })));
3287
- return (React__namespace.createElement("span", { className: css.css({
3317
+ return (React__namespace.createElement("span", { className: css.cx(css.css({
3288
3318
  label: 'PickerWrapper',
3289
3319
  position: 'relative',
3290
3320
  display: 'inline-block',
3291
3321
  width: '100%',
3292
3322
  paddingBottom: props.controlAlign ? theme.controls.inputErrorMinHeight : undefined
3293
- }) },
3323
+ }), props.wrapperClassName) },
3294
3324
  select,
3295
- !props.readOnly && (React__namespace.createElement(Icon, { id: "sortDesc", className: css.css({
3325
+ !props.readOnly && (React__namespace.createElement(Icon, { id: "sortDesc", className: css.cx(css.css({
3296
3326
  position: 'absolute',
3297
3327
  right: `calc(${theme.controls.padding} + ${props.round ? roundPxPadding : '0px'})`,
3298
- height: theme.controls.height,
3299
- pointerEvents: 'none'
3300
- }) }))));
3328
+ height: '100%',
3329
+ pointerEvents: 'none',
3330
+ color: theme.colors.font
3331
+ }), props.iconClassName) }))));
3301
3332
  };
3302
3333
 
3303
3334
  const Pager = (props) => {
@@ -3806,8 +3837,12 @@ const SearchBox = (props) => {
3806
3837
  }), props.buttonClassName), variant: "icon", small: true },
3807
3838
  React__namespace.createElement(Icon, { id: waiting ? 'waiting' : 'search', spin: waiting })));
3808
3839
  //TB: FUTURE replace with new inputs
3809
- return (React__namespace.createElement(Form, { role: "search", className: css.cx('searchBox', props.className), onSubmit: onSubmit },
3810
- React__namespace.createElement(Input, { inputClassName: props.inputClassName, autoFocus: props.autoFocus, id: props.id, debounceMs: props.debounceMs, disabled: waiting, type: "text", value: props.value, placeholder: props.placeholder, round: props.round, onChange: props.onChange, rightControl: submitButton })));
3840
+ const input = (React__namespace.createElement(Input, { inputClassName: props.inputClassName, autoFocus: props.autoFocus, id: props.id, debounceMs: props.debounceMs, disabled: waiting, type: "text", value: props.value, placeholder: props.placeholder, round: props.round, onChange: props.onChange, rightControl: submitButton }));
3841
+ const wrapperClassName = css.cx('searchBox', props.className);
3842
+ if (!props.noForm) {
3843
+ return (React__namespace.createElement(Form, { role: "search", className: wrapperClassName, onSubmit: onSubmit }, input));
3844
+ }
3845
+ return (React__namespace.createElement("div", { className: wrapperClassName }, input));
3811
3846
  };
3812
3847
 
3813
3848
  const GlobalStyles = (p) => {
@@ -3843,10 +3878,11 @@ const Slider = (p) => {
3843
3878
  const currentValue = React.useRef(p.value);
3844
3879
  const sliderContainer = React.useRef(null);
3845
3880
  const height = p.showValue ? `calc(${theme.controls.height} + 1.5rem)` : theme.controls.height;
3846
- return (React__default['default'].createElement("div", { ref: sliderContainer, className: css.css({
3881
+ return (React__default['default'].createElement("div", { ref: sliderContainer, className: css.cx(css.css({
3882
+ label: 'Slider',
3847
3883
  width: '100%',
3848
3884
  height,
3849
- }) },
3885
+ }), p.className) },
3850
3886
  React__default['default'].createElement(ReactSlider__default['default'], { step: p.step, min: p.min, max: p.max, value: p.value, onAfterChange: (value, index) => {
3851
3887
  p.onChange(value);
3852
3888
  }, onChange: p.onUpdate || p.showValue ? (value, index) => {
@@ -3859,15 +3895,22 @@ const Slider = (p) => {
3859
3895
  display: 'flex',
3860
3896
  alignItems: 'center',
3861
3897
  height: theme.controls.height
3862
- })) }, rest),
3898
+ }), p.trackClassName) }, rest),
3863
3899
  React__default['default'].createElement("div", { className: css.css({
3864
3900
  backgroundColor: theme.colors.secondary,
3865
3901
  height: `calc(${theme.controls.height} / 4)`,
3866
3902
  borderRadius: theme.controls.roundRadius,
3867
3903
  width: '100%'
3868
- }) }));
3904
+ }, p.innerTrackClassName && rest.key === 'track-1' && Array.isArray(p.value) ? p.innerTrackClassName : undefined) }));
3869
3905
  }, renderThumb: (props, state) => {
3870
3906
  const { className } = props, rest = __rest(props, ["className"]);
3907
+ let specificThumbStyles;
3908
+ if (p.handle1ClassName && props.key === 'thumb-0') {
3909
+ specificThumbStyles = p.handle1ClassName;
3910
+ }
3911
+ else if (p.handle2ClassName && props.key === 'thumb-1') {
3912
+ specificThumbStyles = p.handle2ClassName;
3913
+ }
3871
3914
  return (React__default['default'].createElement("div", Object.assign({ className: css.cx(className, css.css({
3872
3915
  width: theme.controls.height,
3873
3916
  height: theme.controls.height,
@@ -3888,7 +3931,7 @@ const Slider = (p) => {
3888
3931
  '&:hover': {
3889
3932
  filter: theme.controls.hoverBrightness
3890
3933
  }
3891
- })) }, rest), p.showValue && (React__default['default'].createElement(HandleText, { index: state.index, parentElement: sliderContainer.current, value: Array.isArray(currentValue.current) ? currentValue.current[state.index] : currentValue.current, renderValue: p.renderValue, renderValueWidth: p.renderValueWidth }))));
3934
+ }), specificThumbStyles, p.handleClassName) }, rest), p.showValue && (React__default['default'].createElement(HandleText, { index: state.index, parentElement: sliderContainer.current, value: Array.isArray(currentValue.current) ? currentValue.current[state.index] : currentValue.current, renderValue: p.renderValue, renderValueWidth: p.renderValueWidth }))));
3892
3935
  } })));
3893
3936
  };
3894
3937
  const rectsCollideX = (r1, r2) => {
@@ -4178,6 +4221,7 @@ const TextArea = React__namespace.forwardRef((props, ref) => {
4178
4221
  updateErrorMessage();
4179
4222
  }, [props.value]);
4180
4223
  const styles = css.css({
4224
+ backgroundColor: theme.colors.bg,
4181
4225
  maxWidth: '100%',
4182
4226
  minHeight: theme.controls.height,
4183
4227
  fontFamily: theme.fonts.family,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mackin.com/styleguide",
3
- "version": "8.7.1",
3
+ "version": "8.9.1",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",