@mackin.com/styleguide 7.2.1 → 7.6.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 +22 -5
  2. package/index.js +46 -15
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -133,6 +133,7 @@ interface PagerStyleProps {
133
133
  noResultsText?: string;
134
134
  /** Used for localizations. Defaults to 'Page' */
135
135
  pageText?: string;
136
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
136
137
  rounded?: boolean;
137
138
  className?: string;
138
139
  leftControls?: JSX.Element;
@@ -182,7 +183,7 @@ interface ButtonProps {
182
183
  block?: boolean;
183
184
  /** As round as can be. */
184
185
  round?: boolean;
185
- /** Just taking the edge off. */
186
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
186
187
  rounded?: boolean;
187
188
  className?: string;
188
189
  rightIcon?: JSX.Element;
@@ -247,9 +248,11 @@ declare const ErrorModal: (props: {
247
248
  declare type FormProps = React.ClassAttributes<HTMLFormElement> & React.FormHTMLAttributes<HTMLFormElement>;
248
249
  interface IProps extends FormProps {
249
250
  inline?: boolean;
251
+ /** If true, preventDefault and stopPropagation will be applied prior to onSubmit being called. Defaults to true. */
252
+ ajax?: boolean;
250
253
  }
251
254
  /** Use this instead of <form> directly. If we need to fight Chrome's autofill, we can do so at a global level. */
252
- declare const Form: React.ForwardRefExoticComponent<Pick<IProps, "inline" | "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<any>>;
255
+ declare const Form: React.ForwardRefExoticComponent<Pick<IProps, "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<any>>;
253
256
  declare const FormFlexRow: (props: {
254
257
  children: React.ReactNode;
255
258
  className?: string;
@@ -268,9 +271,11 @@ declare const Header: (props: {
268
271
  toggleMenu?: () => void | undefined;
269
272
  /** If true, will hide menu button on larger screens */
270
273
  responsive?: boolean;
271
- rightElements?: JSX.Element;
272
274
  inline?: boolean;
273
275
  className?: string;
276
+ leftElements?: JSX.Element;
277
+ rightElements?: JSX.Element;
278
+ /** Elements will appear in the center of the header and slightly below. */
274
279
  centerOffsetElements?: JSX.Element;
275
280
  noMenu?: boolean;
276
281
  /** Will fill the title center aligned with wrapping. */
@@ -305,6 +310,8 @@ declare const InfoPanel: (props: {
305
310
  variant?: 'info' | 'warning' | 'error' | 'negative' | 'positive';
306
311
  className?: string;
307
312
  style?: React.CSSProperties;
313
+ /** Defaults to 'p'. */
314
+ tag?: 'p' | 'div';
308
315
  }) => JSX.Element;
309
316
 
310
317
  interface InfoTipProps {
@@ -345,6 +352,7 @@ interface InputProps {
345
352
  debounceMs?: number;
346
353
  /** Defaults to 'off'. */
347
354
  autoComplete?: string;
355
+ autoFocus?: boolean;
348
356
  /** Called with debounce when the input changes. */
349
357
  onChange?: (value: InputValue, name?: string) => void;
350
358
  onFocus?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
@@ -450,7 +458,7 @@ interface OmniLinkProps {
450
458
  title?: string;
451
459
  /** Only for button variants. */
452
460
  round?: boolean;
453
- /** Only for button variants. */
461
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. Only for button variants. */
454
462
  rounded?: boolean;
455
463
  /** Only for button variants. */
456
464
  small?: boolean;
@@ -469,6 +477,7 @@ interface PickerProps<T extends PickerValue> {
469
477
  })[];
470
478
  onChange: (value: T) => void;
471
479
  id?: string;
480
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
472
481
  rounded?: boolean;
473
482
  disabled?: boolean;
474
483
  className?: string;
@@ -495,6 +504,7 @@ interface SearchBoxProps {
495
504
  id?: string;
496
505
  placeholder?: string;
497
506
  round?: boolean;
507
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
498
508
  rounded?: boolean;
499
509
  className?: string;
500
510
  onSubmit?: () => Promise<void>;
@@ -617,6 +627,7 @@ interface DatePickerProps {
617
627
  required?: boolean;
618
628
  /** Defaults to 250ms */
619
629
  debounceMs?: number;
630
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
620
631
  rounded?: boolean;
621
632
  round?: boolean;
622
633
  /** This is the ms from Date.valueOf(). */
@@ -634,6 +645,7 @@ interface TabHeaderTabProps {
634
645
  interface TabHeaderProps {
635
646
  tabs: TabHeaderTabProps[];
636
647
  id?: string;
648
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
637
649
  rounded?: boolean;
638
650
  /** Defaults to 10rem. */
639
651
  maxTabWidth?: string;
@@ -688,6 +700,8 @@ interface MackinTheme {
688
700
  fonts: {
689
701
  family: string;
690
702
  size: string;
703
+ sizeSmall: string;
704
+ sizeLarge: string;
691
705
  headerFamily: string;
692
706
  };
693
707
  controls: {
@@ -695,6 +709,7 @@ interface MackinTheme {
695
709
  fontSize: string;
696
710
  borderWidth: string;
697
711
  border: string;
712
+ borderRadius: string;
698
713
  height: string;
699
714
  heightSmall: string;
700
715
  boxShadow: string;
@@ -705,6 +720,7 @@ interface MackinTheme {
705
720
  focusOutlineShadow: string;
706
721
  focusOutlineRequiredShadow: string;
707
722
  roundRadius: string;
723
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
708
724
  roundedRadius: string;
709
725
  disabledOpacity: string;
710
726
  formButtonMinWidth: string;
@@ -912,6 +928,7 @@ declare type AutocompleteValue = string | AutoCompleteItem;
912
928
  interface AutocompleteProps {
913
929
  value: AutocompleteValue | undefined;
914
930
  round?: boolean;
931
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
915
932
  rounded?: boolean;
916
933
  rightControl?: JSX.Element;
917
934
  placeholder?: string;
@@ -933,4 +950,4 @@ interface AutocompleteProps {
933
950
  }
934
951
  declare const Autocomplete: (p: AutocompleteProps) => JSX.Element;
935
952
 
936
- export { Alignment, Autocomplete, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DatePicker, DatePickerProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, List, ListItem, MackinTheme, Modal, Nav, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerProps, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextProps, Th, ThSort, ThemeProvider, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, getCurrencyDisplay, mergeClassNames, useMediaQuery, useThemeSafely };
953
+ export { Alignment, Autocomplete, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DatePicker, DatePickerProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, List, ListItem, MackinTheme, Modal, Nav, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerProps, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextProps, Th, ThSort, ThemeProvider, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, getCurrencyDisplay, mergeClassNames, useMediaQuery, useThemeSafely };
package/index.js CHANGED
@@ -108,12 +108,15 @@ const defaultTheme = {
108
108
  fonts: {
109
109
  family: 'Arial, Helvetica, sans-serif',
110
110
  size: '16px',
111
+ sizeSmall: '0.7rem',
112
+ sizeLarge: '1.3rem',
111
113
  headerFamily: 'Arial, Helvetica, sans-serif',
112
114
  },
113
115
  controls: {
114
116
  padding: '0.5rem',
115
117
  fontSize: '1rem',
116
118
  borderWidth: '1px',
119
+ borderRadius: '',
117
120
  border: ``,
118
121
  height: '44px',
119
122
  heightSmall: '34px',
@@ -125,6 +128,7 @@ const defaultTheme = {
125
128
  focusOutlineShadow: '',
126
129
  focusOutlineRequiredShadow: '',
127
130
  roundRadius: '3rem',
131
+ /** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
128
132
  roundedRadius: '0.5rem',
129
133
  disabledOpacity: '0.5',
130
134
  formButtonMinWidth: '7rem',
@@ -301,6 +305,7 @@ const Button = (props) => {
301
305
  padding-right: ${theme.controls.padding};
302
306
  background-color: white;
303
307
  border: ${theme.controls.border};
308
+ border-radius: ${theme.controls.borderRadius};
304
309
  cursor: pointer;
305
310
  box-shadow: ${theme.controls.boxShadow};
306
311
  color: ${theme.colors.font};
@@ -567,7 +572,7 @@ const Text = (props) => {
567
572
  const styles = css.css({
568
573
  userSelect: 'text',
569
574
  label: 'Text'
570
- }, tagStyles[tagChoice], alignStyles[(_a = props.align) !== null && _a !== void 0 ? _a : 'left'], props.smaller && { fontSize: '0.7rem' }, props.larger && { fontSize: '1.3rem' }, props.italics && { fontStyle: 'italic' }, props.ellipsis && {
575
+ }, tagStyles[tagChoice], 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 && {
571
576
  overflow: 'hidden',
572
577
  whiteSpace: 'nowrap',
573
578
  textOverflow: 'ellipsis'
@@ -695,6 +700,7 @@ const Picker = (props) => {
695
700
  font-size: ${theme.controls.fontSize};
696
701
  width: 100%;
697
702
  border: ${theme.controls.border};
703
+ border-radius: ${theme.controls.borderRadius};
698
704
  transition: ${theme.controls.transition};
699
705
  &:disabled {
700
706
  color: ${theme.colors.font};
@@ -783,6 +789,7 @@ const Pager = (props) => {
783
789
  grid-template-columns: ${theme.controls.height} 1fr ${theme.controls.height};
784
790
  grid-column-gap: ${theme.controls.gap};
785
791
  border: ${theme.controls.border};
792
+ border-radius: ${theme.controls.borderRadius};
786
793
  padding: 0.5rem;
787
794
  background-color: ${theme.colors.pagerBg};
788
795
  @media(min-width: ${theme.breakpoints.tablet}) {
@@ -800,7 +807,6 @@ const Pager = (props) => {
800
807
  display: block;
801
808
  }
802
809
  `;
803
- //TB: check this after fixing buttons
804
810
  const buttonStyles = css.css({
805
811
  backgroundColor: 'transparent'
806
812
  });
@@ -1603,7 +1609,7 @@ const ErrorModal = (props) => {
1603
1609
 
1604
1610
  /** Use this instead of <form> directly. If we need to fight Chrome's autofill, we can do so at a global level. */
1605
1611
  const Form = React__namespace.forwardRef((props, ref) => {
1606
- const { inline, children, onSubmit, className } = props, rest = __rest(props, ["inline", "children", "onSubmit", "className"]);
1612
+ const { inline, children, onSubmit, className, ajax } = props, rest = __rest(props, ["inline", "children", "onSubmit", "className", "ajax"]);
1607
1613
  const theme = useThemeSafely();
1608
1614
  return (React__namespace.createElement("form", Object.assign({}, rest, { ref: ref, className: css.cx('form', css.css({
1609
1615
  display: 'flex',
@@ -1611,8 +1617,10 @@ const Form = React__namespace.forwardRef((props, ref) => {
1611
1617
  alignItems: props.inline ? 'flex-end' : 'normal',
1612
1618
  gap: theme.controls.gap
1613
1619
  }), props.className), onSubmit: e => {
1614
- e.preventDefault();
1615
- e.stopPropagation();
1620
+ if (ajax !== false) {
1621
+ e.preventDefault();
1622
+ e.stopPropagation();
1623
+ }
1616
1624
  if (onSubmit) {
1617
1625
  onSubmit(e);
1618
1626
  }
@@ -1636,7 +1644,6 @@ const FormColumnRow = (props) => {
1636
1644
  }), props.className) }, props.children));
1637
1645
  };
1638
1646
 
1639
- //TB: have a sticky variant
1640
1647
  const Header = (props) => {
1641
1648
  const theme = useThemeSafely();
1642
1649
  const bodyStyles = css.css `
@@ -1696,6 +1703,12 @@ const Header = (props) => {
1696
1703
  grid-auto-flow: column;
1697
1704
  align-items: center;
1698
1705
  `;
1706
+ const leftElementStyles = props.leftElements && css.css({
1707
+ display: 'grid',
1708
+ gap: '0.5rem',
1709
+ gridAutoFlow: 'column',
1710
+ alignItems: 'center'
1711
+ });
1699
1712
  const centerElementsStyles = props.centerOffsetElements && css.css `
1700
1713
  position: absolute;
1701
1714
  display: flex;
@@ -1721,6 +1734,7 @@ const Header = (props) => {
1721
1734
  return (React__namespace.createElement("div", { className: css.cx('header', headerStyles, props.className) },
1722
1735
  !props.noMenu && (React__namespace.createElement(Button, { variant: "icon", className: headerButtonStyles, onClick: toggleMenu },
1723
1736
  React__namespace.createElement(Icon, { id: "menu" }))),
1737
+ props.leftElements && React__namespace.createElement("div", { className: leftElementStyles }, props.leftElements),
1724
1738
  title,
1725
1739
  props.rightElements && React__namespace.createElement("div", { className: rightElementStyles }, props.rightElements),
1726
1740
  props.centerOffsetElements && (React__namespace.createElement("div", { className: centerElementsStyles },
@@ -1779,7 +1793,7 @@ const InfoPanel = (props) => {
1779
1793
  color:${theme.colors.positiveFont};
1780
1794
  `}
1781
1795
  `;
1782
- return (React__namespace.createElement(Text, { style: props.style, align: "center", className: css.cx('infoPanel', styles, props.className) }, props.children));
1796
+ return (React__namespace.createElement(Text, { tag: props.tag || 'p', style: props.style, align: "center", className: css.cx('infoPanel', styles, props.className) }, props.children));
1783
1797
  };
1784
1798
 
1785
1799
  const Popover = (p) => {
@@ -1789,13 +1803,14 @@ const Popover = (p) => {
1789
1803
  return (React__namespace.createElement(reactTinyPopover.Popover, { containerClassName: css.css({
1790
1804
  zIndex: theme.zIndexes.tooltip
1791
1805
  }), reposition: resposition, isOpen: p.isOpen, positions: (_b = p.positions) !== null && _b !== void 0 ? _b : ['right', 'top', 'left', 'bottom'], onClickOutside: p.onClickOutside, content: ({ position, childRect, popoverRect }) => {
1792
- var _a, _b, _c;
1806
+ var _a, _b, _c, _d;
1793
1807
  return (React__namespace.createElement(reactTinyPopover.ArrowContainer, { position: position, childRect: childRect, popoverRect: popoverRect, arrowColor: (_a = p.arrorColor) !== null && _a !== void 0 ? _a : theme.colors.border, arrowSize: 10 },
1794
1808
  React__namespace.createElement(TabLocker, null,
1795
1809
  React__namespace.createElement("div", { className: css.css({
1796
1810
  border: (_b = p.border) !== null && _b !== void 0 ? _b : theme.controls.border,
1811
+ borderRadius: (_c = p.border) !== null && _c !== void 0 ? _c : theme.controls.borderRadius,
1797
1812
  boxShadow: theme.controls.boxShadow,
1798
- backgroundColor: (_c = p.backgroundColor) !== null && _c !== void 0 ? _c : theme.colors.bg,
1813
+ backgroundColor: (_d = p.backgroundColor) !== null && _d !== void 0 ? _d : theme.colors.bg,
1799
1814
  }) }, p.content))));
1800
1815
  } },
1801
1816
  React__namespace.createElement("span", null, p.parent)));
@@ -1926,6 +1941,7 @@ const Input = React__namespace.forwardRef((props, ref) => {
1926
1941
  fontSize: theme.fonts.size,
1927
1942
  width: '100%',
1928
1943
  border: theme.controls.border,
1944
+ borderRadius: theme.controls.borderRadius,
1929
1945
  color: theme.colors.font,
1930
1946
  paddingLeft: theme.controls.padding,
1931
1947
  paddingRight: theme.controls.padding,
@@ -2033,15 +2049,15 @@ const Input = React__namespace.forwardRef((props, ref) => {
2033
2049
  };
2034
2050
  }
2035
2051
  if (props.type === 'number') {
2036
- inputElement = React__namespace.createElement("input", { ref: ref, name: props.name, pattern: props.pattern, style: props.style, autoComplete: autoComplete, tabIndex: props.readOnly ? -1 : undefined, readOnly: props.readOnly,
2052
+ inputElement = React__namespace.createElement("input", { autoFocus: props.autoFocus, ref: ref, name: props.name, pattern: props.pattern, style: props.style, autoComplete: autoComplete, tabIndex: props.readOnly ? -1 : undefined, readOnly: props.readOnly,
2037
2053
  // set fixed default to defeat pasting stupid numbers
2038
2054
  maxLength: 50, min: props.min, max: props.max, required: props.required, disabled: props.disabled, id: props.id, className: css.cx(inputStyles, props.inputClassName), placeholder: props.placeholder, type: "number", value: localValue, onFocus: onFocus, onBlur: onBlur, onChange: localOnChange, onKeyDown: props.onKeyDown, onKeyUp: props.onKeyUp, onKeyPress: props.onKeyPress });
2039
2055
  }
2040
2056
  else if (props.type === 'date') {
2041
- inputElement = React__namespace.createElement("input", { ref: ref, name: props.name, pattern: props.pattern, style: props.style, autoComplete: autoComplete, tabIndex: props.readOnly ? -1 : undefined, readOnly: props.readOnly, maxLength: 10, required: props.required, disabled: props.disabled, id: props.id, className: css.cx(inputStyles, props.inputClassName), placeholder: props.placeholder, type: "text", value: localValue, onFocus: onFocus, onBlur: onBlur, onChange: localOnChange, onKeyDown: props.onKeyDown, onKeyUp: props.onKeyUp, onKeyPress: props.onKeyPress });
2057
+ inputElement = React__namespace.createElement("input", { autoFocus: props.autoFocus, ref: ref, name: props.name, pattern: props.pattern, style: props.style, autoComplete: autoComplete, tabIndex: props.readOnly ? -1 : undefined, readOnly: props.readOnly, maxLength: 10, required: props.required, disabled: props.disabled, id: props.id, className: css.cx(inputStyles, props.inputClassName), placeholder: props.placeholder, type: "text", value: localValue, onFocus: onFocus, onBlur: onBlur, onChange: localOnChange, onKeyDown: props.onKeyDown, onKeyUp: props.onKeyUp, onKeyPress: props.onKeyPress });
2042
2058
  }
2043
2059
  else if (props.type === 'textarea') {
2044
- inputElement = React__namespace.createElement("textarea", { ref: ref, name: props.name, style: props.style, rows: props.rows || 10, autoComplete: autoComplete, tabIndex: props.readOnly ? -1 : undefined, readOnly: props.readOnly, maxLength: props.maxLength || DEFAULT_MAX_LENGTH, required: props.required, disabled: props.disabled, id: props.id, className: css.cx(css.css `
2060
+ inputElement = React__namespace.createElement("textarea", { autoFocus: props.autoFocus, ref: ref, name: props.name, style: props.style, rows: props.rows || 10, autoComplete: autoComplete, tabIndex: props.readOnly ? -1 : undefined, readOnly: props.readOnly, maxLength: props.maxLength || DEFAULT_MAX_LENGTH, required: props.required, disabled: props.disabled, id: props.id, className: css.cx(css.css `
2045
2061
  ${inputStyles}
2046
2062
  max-width: 100%;
2047
2063
  min-height: ${theme.controls.height};
@@ -2050,7 +2066,7 @@ const Input = React__namespace.forwardRef((props, ref) => {
2050
2066
  }
2051
2067
  else {
2052
2068
  // text, password, email, and url
2053
- inputElement = React__namespace.createElement("input", { ref: ref, name: props.name, pattern: props.pattern, style: props.style, autoComplete: autoComplete, tabIndex: props.readOnly ? -1 : undefined, readOnly: props.readOnly, maxLength: props.maxLength || DEFAULT_MAX_LENGTH, required: props.required, disabled: props.disabled, id: props.id, className: css.cx(inputStyles, props.inputClassName), placeholder: props.placeholder, type: props.type, value: localValue, onFocus: onFocus, onBlur: onBlur, onChange: localOnChange, onKeyDown: props.onKeyDown, onKeyUp: props.onKeyUp, onKeyPress: props.onKeyPress });
2069
+ inputElement = React__namespace.createElement("input", { autoFocus: props.autoFocus, ref: ref, name: props.name, pattern: props.pattern, style: props.style, autoComplete: autoComplete, tabIndex: props.readOnly ? -1 : undefined, readOnly: props.readOnly, maxLength: props.maxLength || DEFAULT_MAX_LENGTH, required: props.required, disabled: props.disabled, id: props.id, className: css.cx(inputStyles, props.inputClassName), placeholder: props.placeholder, type: props.type, value: localValue, onFocus: onFocus, onBlur: onBlur, onChange: localOnChange, onKeyDown: props.onKeyDown, onKeyUp: props.onKeyUp, onKeyPress: props.onKeyPress });
2054
2070
  }
2055
2071
  const inputWrapperStyles = css.css `
2056
2072
  width:100%;
@@ -2273,6 +2289,7 @@ const OmniLink = (props) => {
2273
2289
  padding-left: ${theme.controls.padding};
2274
2290
  padding-right: ${theme.controls.padding};
2275
2291
  border: ${theme.controls.border};
2292
+ border-radius: ${theme.controls.borderRadius};
2276
2293
  box-shadow: ${theme.controls.boxShadow};
2277
2294
  height: ${theme.controls.height};
2278
2295
  line-height: ${theme.controls.height};
@@ -2512,6 +2529,7 @@ const ToggleButtonGroup = (props) => {
2512
2529
  const groupStyles = css.css `
2513
2530
  display: flex;
2514
2531
  box-shadow: ${theme.controls.boxShadow};
2532
+ border-radius: ${theme.controls.borderRadius};
2515
2533
  ${props.round && `
2516
2534
  border-radius: ${theme.controls.roundRadius};
2517
2535
  `}
@@ -2522,6 +2540,15 @@ const ToggleButtonGroup = (props) => {
2522
2540
  &:nth-of-type(1n+2){
2523
2541
  margin-left: -1px;
2524
2542
  }
2543
+ border-radius: 0;
2544
+ &:first-of-type{
2545
+ border-top-left-radius: ${theme.controls.borderRadius};
2546
+ border-bottom-left-radius: ${theme.controls.borderRadius};
2547
+ }
2548
+ &:last-child {
2549
+ border-top-right-radius: ${theme.controls.borderRadius};
2550
+ border-bottom-right-radius: ${theme.controls.borderRadius};
2551
+ }
2525
2552
  ${props.round && `
2526
2553
  &:first-of-type{
2527
2554
  border-top-left-radius: ${theme.controls.roundRadius};
@@ -2761,7 +2788,7 @@ const DatePicker = (p) => {
2761
2788
  } }))), content: (React__namespace.createElement("div", { ref: popover, className: css.css({
2762
2789
  paddingLeft: '1rem',
2763
2790
  paddingRight: '1rem',
2764
- paddingBottom: '1rem',
2791
+ paddingBottom: '1rem'
2765
2792
  }) },
2766
2793
  React__namespace.createElement(Calendar, { onClick: date => {
2767
2794
  p.onChange(date.valueOf());
@@ -2813,12 +2840,15 @@ const TabHeader = (p) => {
2813
2840
  zIndex: 1,
2814
2841
  }, active && {
2815
2842
  border: theme.controls.border,
2843
+ borderRadius: theme.controls.borderRadius,
2844
+ borderBottomLeftRadius: 0,
2845
+ borderBottomRightRadius: 0,
2816
2846
  borderBottom: 'none',
2817
2847
  zIndex: 3,
2818
2848
  }, active && p.rounded && {
2819
2849
  borderRadius: p.rounded && theme.controls.roundedRadius,
2820
2850
  borderBottomLeftRadius: 0,
2821
- borderBottomRightRadius: 0
2851
+ borderBottomRightRadius: 0,
2822
2852
  });
2823
2853
  buttonVariant = 'link';
2824
2854
  buttonStyles = css.css({
@@ -3393,6 +3423,7 @@ const Autocomplete = (p) => {
3393
3423
  position: absolute;
3394
3424
  width: 100%;
3395
3425
  border: ${theme.controls.border};
3426
+ border-radius: ${theme.controls.borderRadius};
3396
3427
  box-shadow: ${theme.controls.boxShadow};
3397
3428
  background-color: ${theme.colors.bg};
3398
3429
  margin-top: -4px !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mackin.com/styleguide",
3
- "version": "7.2.1",
3
+ "version": "7.6.0",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",