@mackin.com/styleguide 8.0.2 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +46 -29
- package/index.js +416 -78
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ interface AutocompleteProps<T extends AutocompleteValue> {
|
|
|
53
53
|
inputAriaAttributes?: React.AriaAttributes;
|
|
54
54
|
/** Defaults to 0ms. */
|
|
55
55
|
getOptionsDebounceMs?: number;
|
|
56
|
+
autoFocus?: boolean;
|
|
56
57
|
onChange: (value: string) => void;
|
|
57
58
|
getOptions: (value: string) => Promise<T[]>;
|
|
58
59
|
onPick: (value: T) => void;
|
|
@@ -100,8 +101,10 @@ interface ButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes
|
|
|
100
101
|
waiting?: boolean;
|
|
101
102
|
/** The minimum button size will be set to the themes' formButtonMinWidth. */
|
|
102
103
|
enforceMinWidth?: boolean;
|
|
104
|
+
/** If true, bottom padding will be added to account for other inputs having space for error messages. */
|
|
105
|
+
controlAlign?: boolean;
|
|
103
106
|
}
|
|
104
|
-
declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "form" | "variant" | "round" | "rightIcon" | "leftIcon" | "iconBlock" | "small" | "readOnly" | "waiting" | "enforceMinWidth" | "key" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "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<HTMLButtonElement>>;
|
|
107
|
+
declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "form" | "variant" | "round" | "rightIcon" | "leftIcon" | "iconBlock" | "small" | "readOnly" | "waiting" | "enforceMinWidth" | "controlAlign" | "key" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "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<HTMLButtonElement>>;
|
|
105
108
|
|
|
106
109
|
interface CalendarProps {
|
|
107
110
|
month: number;
|
|
@@ -257,12 +260,11 @@ declare const Icon: (props: {
|
|
|
257
260
|
onClick?: ((e: React.MouseEvent<SVGSVGElement | HTMLElement, MouseEvent>) => void) | undefined;
|
|
258
261
|
}) => JSX.Element;
|
|
259
262
|
|
|
260
|
-
|
|
263
|
+
interface ImageProps extends Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, 'src' | 'alt'> {
|
|
261
264
|
src: string;
|
|
262
265
|
alt: string;
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}) => JSX.Element;
|
|
266
|
+
}
|
|
267
|
+
declare const Image: React.ForwardRefExoticComponent<Pick<ImageProps, "src" | "alt" | "key" | "crossOrigin" | "decoding" | "height" | "loading" | "referrerPolicy" | "sizes" | "srcSet" | "useMap" | "width" | "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<HTMLImageElement>>;
|
|
266
268
|
|
|
267
269
|
declare const InfoPanel: (props: {
|
|
268
270
|
children: React.ReactNode;
|
|
@@ -402,16 +404,14 @@ declare const TextInput: React.ForwardRefExoticComponent<Pick<TextInputProps, "t
|
|
|
402
404
|
/** useEffect but ignores the first call on component mount. */
|
|
403
405
|
declare const useIgnoreMount: (effect: React__default.EffectCallback, deps?: React__default.DependencyList | undefined) => void;
|
|
404
406
|
|
|
405
|
-
interface LabelProps {
|
|
407
|
+
interface LabelProps extends React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
406
408
|
text: string | JSX.Element;
|
|
407
|
-
|
|
409
|
+
/** Displays the label NOT using a label element. */
|
|
408
410
|
static?: boolean;
|
|
409
|
-
htmlFor?: string;
|
|
410
411
|
/** Defaults to 'vertical'. */
|
|
411
412
|
orientation?: 'vertical' | 'horizontal' | 'horizontalReverse';
|
|
412
413
|
/** The alignment of the label text. Defaults to 'left'. Ignored for horizontal and horizontalReverse orientation. */
|
|
413
414
|
align?: 'left' | 'right' | 'center';
|
|
414
|
-
className?: string;
|
|
415
415
|
/** Don't wrap the children in the <label>. Fixes re-focus bugs with the date picker and possible future libraries. */
|
|
416
416
|
noWrap?: boolean;
|
|
417
417
|
/** Smaller text next to the main label. */
|
|
@@ -465,12 +465,8 @@ declare const Nav: (props: {
|
|
|
465
465
|
__debug?: boolean | undefined;
|
|
466
466
|
}) => JSX.Element;
|
|
467
467
|
|
|
468
|
-
interface OmniLinkProps {
|
|
468
|
+
interface OmniLinkProps extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
|
469
469
|
href: string;
|
|
470
|
-
children: React.ReactNode;
|
|
471
|
-
onClick?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
|
|
472
|
-
className?: string;
|
|
473
|
-
style?: React.CSSProperties;
|
|
474
470
|
noRouter?: boolean;
|
|
475
471
|
/** Ignored if 'noRouter' is false */
|
|
476
472
|
target?: string;
|
|
@@ -481,12 +477,11 @@ interface OmniLinkProps {
|
|
|
481
477
|
iconBlock?: boolean;
|
|
482
478
|
/** Corresponds to the button variants of the same name. */
|
|
483
479
|
variant?: 'button' | 'label' | 'icon' | 'circle' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
484
|
-
title?: string;
|
|
485
480
|
/** Only for button variants. */
|
|
486
481
|
round?: boolean;
|
|
487
482
|
/** Only for button variants. */
|
|
488
483
|
small?: boolean;
|
|
489
|
-
/** Overrides the
|
|
484
|
+
/** Overrides the `theme.colors.link` for non-button variants or `theme.colors.font` for the `button` variant. Does not apply to themed button variants like `primary`. */
|
|
490
485
|
colorOverride?: string;
|
|
491
486
|
}
|
|
492
487
|
declare const OmniLink: (props: OmniLinkProps) => JSX.Element;
|
|
@@ -721,21 +716,13 @@ interface SearchBoxProps {
|
|
|
721
716
|
onSubmit?: () => Promise<void>;
|
|
722
717
|
/** Defaults to 250ms */
|
|
723
718
|
debounceMs?: number;
|
|
719
|
+
autoFocus?: boolean;
|
|
724
720
|
}
|
|
725
721
|
declare const SearchBox: (props: SearchBoxProps) => JSX.Element;
|
|
726
722
|
|
|
727
723
|
declare type Alignment = 'left' | 'right' | 'center';
|
|
728
724
|
|
|
729
|
-
declare const GlobalStyles: () => null;
|
|
730
|
-
|
|
731
|
-
declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
|
|
732
|
-
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
733
|
-
declare const enumToEntities: <T extends {
|
|
734
|
-
[key: string]: string | number;
|
|
735
|
-
}>(enumObj: T) => {
|
|
736
|
-
id: string | number;
|
|
737
|
-
name: string;
|
|
738
|
-
}[];
|
|
725
|
+
declare const GlobalStyles: (p: {}) => null;
|
|
739
726
|
|
|
740
727
|
interface MackinTheme {
|
|
741
728
|
colors: {
|
|
@@ -783,6 +770,10 @@ interface MackinTheme {
|
|
|
783
770
|
sizeSmall: string;
|
|
784
771
|
sizeLarge: string;
|
|
785
772
|
headerFamily: string;
|
|
773
|
+
sizeH1: string;
|
|
774
|
+
sizeH2: string;
|
|
775
|
+
sizeH3: string;
|
|
776
|
+
sizeH4: string;
|
|
786
777
|
};
|
|
787
778
|
controls: {
|
|
788
779
|
padding: string;
|
|
@@ -805,8 +796,10 @@ interface MackinTheme {
|
|
|
805
796
|
gap: string;
|
|
806
797
|
dividerMargin: string;
|
|
807
798
|
dividerBorder: string;
|
|
799
|
+
dividerThickness: string;
|
|
808
800
|
headerBoxShadow: string;
|
|
809
801
|
inputErrorMinHeight: string;
|
|
802
|
+
paragraphPadding: string;
|
|
810
803
|
};
|
|
811
804
|
zIndexes: {
|
|
812
805
|
header: number;
|
|
@@ -931,10 +924,11 @@ declare const TabLocker: (props: {
|
|
|
931
924
|
style?: React.CSSProperties;
|
|
932
925
|
}) => JSX.Element;
|
|
933
926
|
|
|
927
|
+
declare type SupportedTags = 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'span' | 'div';
|
|
934
928
|
interface TextProps {
|
|
935
929
|
children: any;
|
|
936
930
|
/** Defaults to 'p'. */
|
|
937
|
-
tag?:
|
|
931
|
+
tag?: SupportedTags;
|
|
938
932
|
align?: Alignment;
|
|
939
933
|
bold?: boolean;
|
|
940
934
|
italics?: boolean;
|
|
@@ -942,14 +936,19 @@ interface TextProps {
|
|
|
942
936
|
/** You will need to set a width or max-width on the element for this to work. */
|
|
943
937
|
ellipsis?: boolean;
|
|
944
938
|
style?: React.CSSProperties;
|
|
939
|
+
/** Applies `theme.fonts.sizeSmall` to the font-size. */
|
|
945
940
|
smaller?: boolean;
|
|
941
|
+
/** Applies `theme.fonts.sizeLarge` to the font-size. */
|
|
946
942
|
larger?: boolean;
|
|
943
|
+
/** Overrides the theme font-size. */
|
|
944
|
+
fontSize?: string | number;
|
|
947
945
|
spacedOut?: boolean;
|
|
948
946
|
lineClamp?: number;
|
|
949
947
|
/** Will remove all margin/padding from specified tag */
|
|
950
948
|
noPad?: boolean;
|
|
951
949
|
leftPad?: string;
|
|
952
950
|
}
|
|
951
|
+
/** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
|
|
953
952
|
declare const Text: (props: TextProps) => React.DetailedReactHTMLElement<{
|
|
954
953
|
style: React.CSSProperties;
|
|
955
954
|
className: string;
|
|
@@ -961,9 +960,11 @@ interface TextAreaProps extends Omit<React.DetailedHTMLProps<React.TextareaHTMLA
|
|
|
961
960
|
noTrim?: boolean;
|
|
962
961
|
/** Will mark the input as invalid and show this as the validation failed message. */
|
|
963
962
|
customError?: string;
|
|
963
|
+
/** onValueChange will report the local value even if the control is flagged as invalid. Defaults to false. */
|
|
964
|
+
reportValueOnError?: boolean;
|
|
964
965
|
onValueChange: (value: string | undefined) => void;
|
|
965
966
|
}
|
|
966
|
-
declare const TextArea: React.ForwardRefExoticComponent<Pick<TextAreaProps, "value" | "key" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "disabled" | "form" | "maxLength" | "minLength" | "name" | "placeholder" | "readOnly" | "required" | "rows" | "wrap" | "onChange" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "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" | "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" | "noTrim" | "customError" | "onValueChange"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
967
|
+
declare const TextArea: React.ForwardRefExoticComponent<Pick<TextAreaProps, "value" | "key" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "disabled" | "form" | "maxLength" | "minLength" | "name" | "placeholder" | "readOnly" | "required" | "rows" | "wrap" | "onChange" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "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" | "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" | "noTrim" | "customError" | "reportValueOnError" | "onValueChange"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
967
968
|
|
|
968
969
|
declare type ToggleButtonVariant = 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
969
970
|
interface ToggleButtonProps {
|
|
@@ -1024,4 +1025,20 @@ declare const useWaiting: <TArgs extends any[], TReturn>(func: (...args: TArgs)
|
|
|
1024
1025
|
*/
|
|
1025
1026
|
declare const useBooleanChanged: (effect: (current: boolean, previous: boolean) => void, dep: boolean | undefined) => void;
|
|
1026
1027
|
|
|
1027
|
-
|
|
1028
|
+
interface NormalizeCssProps {
|
|
1029
|
+
}
|
|
1030
|
+
/** Resets certain styles so there is more consistancy between browsers. */
|
|
1031
|
+
declare const NormalizeCss: (p: NormalizeCssProps) => null;
|
|
1032
|
+
|
|
1033
|
+
/** Displays the value in American dollars. */
|
|
1034
|
+
declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
|
|
1035
|
+
|
|
1036
|
+
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
1037
|
+
declare const enumToEntities: <T extends {
|
|
1038
|
+
[key: string]: string | number;
|
|
1039
|
+
}>(enumObj: T) => {
|
|
1040
|
+
id: string | number;
|
|
1041
|
+
name: string;
|
|
1042
|
+
}[];
|
|
1043
|
+
|
|
1044
|
+
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, 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 };
|
package/index.js
CHANGED
|
@@ -67,6 +67,8 @@ 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.
|
|
71
|
+
// major version
|
|
70
72
|
const ICONS = {
|
|
71
73
|
add: proSolidSvgIcons.faPlus,
|
|
72
74
|
delete: proSolidSvgIcons.faTrashAlt,
|
|
@@ -114,7 +116,7 @@ const calcDynamicThemeProps = (theme) => {
|
|
|
114
116
|
theme.controls.transition = `box-shadow ${theme.controls.transitionDuration} ${theme.controls.transitionEasing}, opacity ${theme.controls.transitionDuration} ${theme.controls.transitionEasing}, background-color ${theme.controls.transitionDuration} ${theme.controls.transitionEasing}, filter ${theme.controls.transitionDuration} ${theme.controls.transitionEasing}`;
|
|
115
117
|
theme.controls.focusOutlineShadow = `0px 0px 4px 2px ${theme.colors.focusOutline}`;
|
|
116
118
|
theme.controls.focusOutlineRequiredShadow = `0px 0px 4px 2px ${theme.colors.focusOutlineRequired}`;
|
|
117
|
-
theme.controls.dividerBorder =
|
|
119
|
+
theme.controls.dividerBorder = `${theme.controls.dividerThickness} solid ${theme.colors.divider}`;
|
|
118
120
|
theme.controls.inputErrorMinHeight = `calc(${theme.fonts.sizeSmall} * 1.5 + 4px)`;
|
|
119
121
|
theme.mediaQueries.desktop = `@media(min-width:${theme.breakpoints.desktop})`;
|
|
120
122
|
theme.mediaQueries.tablet = `@media(min-width:${theme.breakpoints.tablet})`;
|
|
@@ -164,6 +166,10 @@ const defaultTheme = {
|
|
|
164
166
|
sizeSmall: '0.7rem',
|
|
165
167
|
sizeLarge: '1.3rem',
|
|
166
168
|
headerFamily: 'Arial, Helvetica, sans-serif',
|
|
169
|
+
sizeH1: '2rem',
|
|
170
|
+
sizeH2: '1.5rem',
|
|
171
|
+
sizeH3: '1.17rem',
|
|
172
|
+
sizeH4: '1rem',
|
|
167
173
|
},
|
|
168
174
|
controls: {
|
|
169
175
|
padding: '0.5rem',
|
|
@@ -186,8 +192,10 @@ const defaultTheme = {
|
|
|
186
192
|
gap: '1rem',
|
|
187
193
|
dividerMargin: '1rem',
|
|
188
194
|
dividerBorder: '',
|
|
195
|
+
dividerThickness: '2px',
|
|
189
196
|
headerBoxShadow: '0px 2px 12px 6px rgba(0, 0, 0, 0.2)',
|
|
190
|
-
inputErrorMinHeight: ''
|
|
197
|
+
inputErrorMinHeight: '',
|
|
198
|
+
paragraphPadding: '1rem'
|
|
191
199
|
},
|
|
192
200
|
zIndexes: {
|
|
193
201
|
header: 50,
|
|
@@ -231,7 +239,7 @@ const useThemeSafely = () => {
|
|
|
231
239
|
|
|
232
240
|
const Button = React__namespace.forwardRef((props, ref) => {
|
|
233
241
|
var _a;
|
|
234
|
-
const nativeProps = __rest(props, ["variant", "round", "rightIcon", "leftIcon", "iconBlock", "small", "readOnly", "waiting", "enforceMinWidth"]);
|
|
242
|
+
const nativeProps = __rest(props, ["variant", "round", "rightIcon", "leftIcon", "iconBlock", "small", "readOnly", "waiting", "enforceMinWidth", "controlAlign"]);
|
|
235
243
|
const theme = useThemeSafely();
|
|
236
244
|
const buttonStyles = css.css `
|
|
237
245
|
padding-left: ${theme.controls.padding};
|
|
@@ -393,10 +401,18 @@ const Button = React__namespace.forwardRef((props, ref) => {
|
|
|
393
401
|
`}
|
|
394
402
|
`;
|
|
395
403
|
const disabled = props.disabled || props.waiting;
|
|
396
|
-
|
|
404
|
+
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' }),
|
|
397
405
|
props.leftIcon && React__namespace.createElement("span", { className: css.css({ marginRight: '0.5rem' }) }, props.leftIcon),
|
|
398
406
|
props.waiting ? React__namespace.createElement(Icon, { id: "waiting", spin: true }) : props.children,
|
|
399
407
|
props.rightIcon && React__namespace.createElement("span", { className: css.css({ marginLeft: '0.5rem' }) }, props.rightIcon)));
|
|
408
|
+
if (props.controlAlign) {
|
|
409
|
+
return (React__namespace.createElement("span", { className: css.css({
|
|
410
|
+
display: 'inline-block',
|
|
411
|
+
width: '100%',
|
|
412
|
+
paddingBottom: theme.controls.inputErrorMinHeight
|
|
413
|
+
}) }, button));
|
|
414
|
+
}
|
|
415
|
+
return button;
|
|
400
416
|
});
|
|
401
417
|
|
|
402
418
|
const accordianExpandTimeMs = 250;
|
|
@@ -768,23 +784,26 @@ const TabLocker = (props) => {
|
|
|
768
784
|
} }, props.children));
|
|
769
785
|
};
|
|
770
786
|
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
787
|
+
const getTagStyles = (theme, tag) => {
|
|
788
|
+
switch (tag) {
|
|
789
|
+
case 'p': return {
|
|
790
|
+
marginTop: theme.controls.paragraphPadding,
|
|
791
|
+
marginBottom: theme.controls.paragraphPadding
|
|
792
|
+
};
|
|
793
|
+
case 'h1': return {
|
|
794
|
+
fontSize: theme.fonts.sizeH1
|
|
795
|
+
};
|
|
796
|
+
case 'h2': return {
|
|
797
|
+
fontSize: theme.fonts.sizeH2
|
|
798
|
+
};
|
|
799
|
+
case 'h3': return {
|
|
800
|
+
fontSize: theme.fonts.sizeH3
|
|
801
|
+
};
|
|
802
|
+
case 'h4': return {
|
|
803
|
+
fontSize: theme.fonts.sizeH4
|
|
804
|
+
};
|
|
805
|
+
default: return undefined;
|
|
806
|
+
}
|
|
788
807
|
};
|
|
789
808
|
const headerRegex = /h1|h2|h3|h4/;
|
|
790
809
|
const alignStyles = {
|
|
@@ -792,6 +811,7 @@ const alignStyles = {
|
|
|
792
811
|
'left': { textAlign: 'left' },
|
|
793
812
|
'right': { textAlign: 'right' }
|
|
794
813
|
};
|
|
814
|
+
/** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
|
|
795
815
|
const Text = (props) => {
|
|
796
816
|
var _a, _b;
|
|
797
817
|
const theme = useThemeSafely();
|
|
@@ -805,8 +825,9 @@ const Text = (props) => {
|
|
|
805
825
|
}
|
|
806
826
|
const styles = css.css({
|
|
807
827
|
userSelect: 'text',
|
|
808
|
-
label: 'Text'
|
|
809
|
-
|
|
828
|
+
label: 'Text',
|
|
829
|
+
fontSize: props.fontSize ? props.fontSize : undefined
|
|
830
|
+
}, getTagStyles(theme, 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 && {
|
|
810
831
|
overflow: 'hidden',
|
|
811
832
|
whiteSpace: 'nowrap',
|
|
812
833
|
textOverflow: 'ellipsis'
|
|
@@ -900,7 +921,7 @@ const Autocomplete = (p) => {
|
|
|
900
921
|
label: 'Autocomplete'
|
|
901
922
|
}), 'autocomplete') },
|
|
902
923
|
React__namespace.createElement(TabLocker, { disabled: !showValues, style: { position: 'relative' } },
|
|
903
|
-
React__namespace.createElement(Input, { inputAriaAttributes: p.inputAriaAttributes, ref: input, debounceMs: 0, type: "text", value: getAutocompleteValueText(p.value), round: p.round, rightControl: p.rightControl, placeholder: p.placeholder, id: p.id, disabled: p.disabled, className: p.className, inputClassName: p.inputClassName, maxLength: p.maxLength, required: p.required, onChange: v => {
|
|
924
|
+
React__namespace.createElement(Input, { autoFocus: p.autoFocus, inputAriaAttributes: p.inputAriaAttributes, ref: input, debounceMs: 0, type: "text", value: getAutocompleteValueText(p.value), round: p.round, rightControl: p.rightControl, placeholder: p.placeholder, id: p.id, disabled: p.disabled, className: p.className, inputClassName: p.inputClassName, maxLength: p.maxLength, required: p.required, onChange: v => {
|
|
904
925
|
const value = v;
|
|
905
926
|
p.onChange(value);
|
|
906
927
|
onChangeForOptions.current(value);
|
|
@@ -1642,6 +1663,7 @@ const CopyButton = (props) => {
|
|
|
1642
1663
|
const Divider = (p) => {
|
|
1643
1664
|
const theme = useThemeSafely();
|
|
1644
1665
|
return (React__namespace.createElement("hr", Object.assign({}, p, { className: css.cx("divider", css.css({
|
|
1666
|
+
label: 'Divider',
|
|
1645
1667
|
margin: theme.controls.dividerMargin,
|
|
1646
1668
|
border: theme.controls.dividerBorder
|
|
1647
1669
|
}), p.className) })));
|
|
@@ -2089,12 +2111,13 @@ const Highlight = (props) => {
|
|
|
2089
2111
|
return (React__namespace.createElement("span", { className: css.cx('highlight', highlightStyles), dangerouslySetInnerHTML: { __html: text } }));
|
|
2090
2112
|
};
|
|
2091
2113
|
|
|
2092
|
-
const Image = (
|
|
2093
|
-
return (React__namespace.createElement("img", {
|
|
2114
|
+
const Image = React__namespace.forwardRef((p, ref) => {
|
|
2115
|
+
return (React__namespace.createElement("img", Object.assign({}, p, { ref: ref, className: css.cx('image', css.css({
|
|
2116
|
+
label: 'Image',
|
|
2094
2117
|
maxWidth: '100%',
|
|
2095
2118
|
maxHeight: '100%',
|
|
2096
|
-
}),
|
|
2097
|
-
};
|
|
2119
|
+
}), p.className) })));
|
|
2120
|
+
});
|
|
2098
2121
|
|
|
2099
2122
|
const Popover = (p) => {
|
|
2100
2123
|
var _a, _b;
|
|
@@ -2243,7 +2266,9 @@ const BaseInput = React__namespace.forwardRef((props, ref) => {
|
|
|
2243
2266
|
':focus': {
|
|
2244
2267
|
outline: 'none',
|
|
2245
2268
|
boxShadow: 'none'
|
|
2246
|
-
}
|
|
2269
|
+
},
|
|
2270
|
+
// FF fix to hide spinner on number elements
|
|
2271
|
+
appearance: props.type === 'number' ? 'textfield' : undefined
|
|
2247
2272
|
}, props.rightControl && {
|
|
2248
2273
|
paddingRight: theme.controls.height
|
|
2249
2274
|
});
|
|
@@ -2678,38 +2703,41 @@ const TextInput = React__namespace.forwardRef((props, ref) => {
|
|
|
2678
2703
|
|
|
2679
2704
|
const Label = (props) => {
|
|
2680
2705
|
var _a, _b, _c;
|
|
2706
|
+
const labelProps = __rest(props, ["text", "static", "orientation", "align", "noWrap", "subText", "optional", "controlAlign"]);
|
|
2681
2707
|
const theme = useThemeSafely();
|
|
2682
|
-
const
|
|
2683
|
-
const
|
|
2708
|
+
const orientationChoice = (_a = props.orientation) !== null && _a !== void 0 ? _a : 'vertical';
|
|
2709
|
+
const alignChoice = (_b = props.align) !== null && _b !== void 0 ? _b : 'left';
|
|
2684
2710
|
const padding = '0.25rem';
|
|
2685
2711
|
const labelStyles = css.css `
|
|
2712
|
+
label: Label;
|
|
2686
2713
|
${padding};
|
|
2687
2714
|
display: flex;
|
|
2688
|
-
${
|
|
2715
|
+
${orientationChoice === 'vertical' && `
|
|
2689
2716
|
flex-direction: column;
|
|
2690
2717
|
`}
|
|
2691
|
-
${
|
|
2718
|
+
${orientationChoice === 'horizontal' && `
|
|
2692
2719
|
flex-direction: row;
|
|
2693
2720
|
align-items: center;
|
|
2694
2721
|
`}
|
|
2695
|
-
${
|
|
2722
|
+
${orientationChoice === 'horizontalReverse' && `
|
|
2696
2723
|
flex-direction: row-reverse;
|
|
2697
2724
|
align-items: center;
|
|
2698
2725
|
`}
|
|
2699
2726
|
`;
|
|
2700
2727
|
const labelTextStyles = css.css `
|
|
2728
|
+
label: LabelText;
|
|
2701
2729
|
flex-shrink:0;
|
|
2702
|
-
${
|
|
2730
|
+
${orientationChoice === 'vertical' && `
|
|
2703
2731
|
margin-bottom: ${padding};
|
|
2704
2732
|
`}
|
|
2705
|
-
${
|
|
2733
|
+
${orientationChoice === 'horizontal' && `
|
|
2706
2734
|
flex-direction: row;
|
|
2707
2735
|
margin-right:${padding};
|
|
2708
2736
|
${props.static && `
|
|
2709
2737
|
margin-right:0.5rem;
|
|
2710
2738
|
`}
|
|
2711
2739
|
`}
|
|
2712
|
-
${
|
|
2740
|
+
${orientationChoice === 'horizontalReverse' && `
|
|
2713
2741
|
margin-left:${padding};
|
|
2714
2742
|
`}
|
|
2715
2743
|
${(props.subText || props.optional) && `
|
|
@@ -2717,6 +2745,7 @@ const Label = (props) => {
|
|
|
2717
2745
|
`}
|
|
2718
2746
|
`;
|
|
2719
2747
|
const labelContentStyles = css.css `
|
|
2748
|
+
label: LabelContent;
|
|
2720
2749
|
display:inline-block;
|
|
2721
2750
|
width:100%;
|
|
2722
2751
|
${props.controlAlign && `
|
|
@@ -2725,27 +2754,27 @@ const Label = (props) => {
|
|
|
2725
2754
|
`}
|
|
2726
2755
|
`;
|
|
2727
2756
|
const outerClass = props.className;
|
|
2728
|
-
let labelText = React__namespace.createElement(Text, { align:
|
|
2729
|
-
let
|
|
2757
|
+
let labelText = React__namespace.createElement(Text, { align: alignChoice, className: labelTextStyles, tag: "div", bold: true }, props.text);
|
|
2758
|
+
let subTextChoice;
|
|
2730
2759
|
if (props.subText) {
|
|
2731
2760
|
if (typeof props.subText === 'string') {
|
|
2732
|
-
|
|
2761
|
+
subTextChoice = React__namespace.createElement(Text, { tag: "div" }, props.subText);
|
|
2733
2762
|
}
|
|
2734
2763
|
else {
|
|
2735
|
-
|
|
2764
|
+
subTextChoice = props.subText;
|
|
2736
2765
|
}
|
|
2737
2766
|
}
|
|
2738
2767
|
else if (props.optional) {
|
|
2739
|
-
|
|
2768
|
+
subTextChoice = React__namespace.createElement(Text, { tag: "div" },
|
|
2740
2769
|
React__namespace.createElement("em", null, "(optional)"));
|
|
2741
2770
|
}
|
|
2742
|
-
if (
|
|
2771
|
+
if (subTextChoice) {
|
|
2743
2772
|
labelText = React__namespace.createElement("span", { className: css.css({ display: 'flex' }) },
|
|
2744
2773
|
labelText,
|
|
2745
2774
|
React__namespace.createElement("span", { className: css.css({
|
|
2746
2775
|
fontSize: '90%',
|
|
2747
2776
|
marginBottom: padding
|
|
2748
|
-
}) },
|
|
2777
|
+
}) }, subTextChoice));
|
|
2749
2778
|
}
|
|
2750
2779
|
if (props.noWrap) {
|
|
2751
2780
|
return (React__namespace.createElement("span", { className: css.cx(labelStyles, outerClass) },
|
|
@@ -2761,7 +2790,7 @@ const Label = (props) => {
|
|
|
2761
2790
|
// labels without htmlFor can cause focus, hover, and click issues when wrapping other elements.
|
|
2762
2791
|
// this fixes the issues.
|
|
2763
2792
|
const htmlFor = (_c = props.htmlFor) !== null && _c !== void 0 ? _c : nanoid.nanoid();
|
|
2764
|
-
return (React__namespace.createElement("label", { htmlFor: htmlFor, className: css.cx('label', labelStyles, outerClass) }, content));
|
|
2793
|
+
return (React__namespace.createElement("label", Object.assign({}, labelProps, { htmlFor: htmlFor, className: css.cx('label', labelStyles, outerClass) }), content));
|
|
2765
2794
|
};
|
|
2766
2795
|
|
|
2767
2796
|
/*
|
|
@@ -2888,11 +2917,12 @@ const Nav = (props) => {
|
|
|
2888
2917
|
return (React__namespace.createElement("nav", { ref: nav, className: css.cx('nav', navStyles, props.className) }, props.children));
|
|
2889
2918
|
};
|
|
2890
2919
|
|
|
2891
|
-
//TB: FUTURE make just a basic styled link so you don't have to go with React Router if you don't want to.
|
|
2892
2920
|
const OmniLink = (props) => {
|
|
2893
|
-
var _a, _b, _c;
|
|
2921
|
+
var _a, _b, _c, _d, _e;
|
|
2922
|
+
const linkProps = __rest(props, ["noRouter", "rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
|
|
2894
2923
|
const theme = useThemeSafely();
|
|
2895
2924
|
const linkStyles = css.css `
|
|
2925
|
+
label: OmniLink;
|
|
2896
2926
|
display: inline-block;
|
|
2897
2927
|
cursor: pointer;
|
|
2898
2928
|
text-decoration: none;
|
|
@@ -2920,11 +2950,11 @@ const OmniLink = (props) => {
|
|
|
2920
2950
|
height: ${theme.controls.height};
|
|
2921
2951
|
line-height: ${theme.controls.height};
|
|
2922
2952
|
font-weight: bold;
|
|
2923
|
-
color: ${theme.colors.font};
|
|
2953
|
+
color: ${(_d = props.colorOverride) !== null && _d !== void 0 ? _d : theme.colors.font};
|
|
2924
2954
|
&:active,
|
|
2925
2955
|
&:focus,
|
|
2926
2956
|
&:visited {
|
|
2927
|
-
color: ${theme.colors.font};
|
|
2957
|
+
color: ${(_e = props.colorOverride) !== null && _e !== void 0 ? _e : theme.colors.font};
|
|
2928
2958
|
}
|
|
2929
2959
|
&:focus {
|
|
2930
2960
|
outline: none;
|
|
@@ -3046,6 +3076,7 @@ const OmniLink = (props) => {
|
|
|
3046
3076
|
const content = React__namespace.createElement(React__namespace.Fragment, null,
|
|
3047
3077
|
React__namespace.createElement("span", null,
|
|
3048
3078
|
props.leftIcon && React__namespace.createElement("span", { className: css.css({
|
|
3079
|
+
label: 'OmniLinkLeftIcon',
|
|
3049
3080
|
marginRight: '1rem',
|
|
3050
3081
|
display: 'inline-block',
|
|
3051
3082
|
minWidth: '1.5rem',
|
|
@@ -3053,13 +3084,14 @@ const OmniLink = (props) => {
|
|
|
3053
3084
|
}) }, props.leftIcon),
|
|
3054
3085
|
props.children),
|
|
3055
3086
|
props.rightIcon && React__namespace.createElement("span", { className: css.css({
|
|
3087
|
+
label: 'OmniLinkRightIcon',
|
|
3056
3088
|
marginLeft: '1rem',
|
|
3057
3089
|
verticalAlign: 'middle'
|
|
3058
3090
|
}) }, props.rightIcon));
|
|
3059
3091
|
if (props.noRouter) {
|
|
3060
|
-
return (React__namespace.createElement("a", {
|
|
3092
|
+
return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }), content));
|
|
3061
3093
|
}
|
|
3062
|
-
return (React__namespace.createElement(reactRouterDom.Link, {
|
|
3094
|
+
return (React__namespace.createElement(reactRouterDom.Link, Object.assign({}, linkProps, { className: mainClassName, to: props.href }), content));
|
|
3063
3095
|
};
|
|
3064
3096
|
|
|
3065
3097
|
const Picker = (props) => {
|
|
@@ -3079,6 +3111,7 @@ const Picker = (props) => {
|
|
|
3079
3111
|
}
|
|
3080
3112
|
const theme = useThemeSafely();
|
|
3081
3113
|
const selectStyles = css.css `
|
|
3114
|
+
background-color: ${theme.colors.bg};
|
|
3082
3115
|
color: ${theme.colors.font};
|
|
3083
3116
|
padding-left: ${theme.controls.padding};
|
|
3084
3117
|
padding-right: ${theme.controls.padding};
|
|
@@ -3669,17 +3702,17 @@ const SearchBox = (props) => {
|
|
|
3669
3702
|
return (_c = props.onSubmit) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
3670
3703
|
});
|
|
3671
3704
|
const theme = useThemeSafely();
|
|
3672
|
-
const submitButton = (React__namespace.createElement(Button, { disabled: waiting, readOnly: !props.onSubmit, type: "submit", className: css.css({
|
|
3705
|
+
const submitButton = (React__namespace.createElement(Button, { tabIndex: -1, disabled: waiting, readOnly: !props.onSubmit, type: "submit", className: css.css({
|
|
3673
3706
|
color: `${theme.colors.font} !important;`,
|
|
3674
3707
|
fontSize: '1rem'
|
|
3675
3708
|
}), variant: "icon", small: true },
|
|
3676
3709
|
React__namespace.createElement(Icon, { id: waiting ? 'waiting' : 'search', spin: waiting })));
|
|
3677
3710
|
//TB: FUTURE replace with new inputs
|
|
3678
3711
|
return (React__namespace.createElement(Form, { role: "search", className: css.cx('searchBox', props.className), onSubmit: onSubmit },
|
|
3679
|
-
React__namespace.createElement(Input, { id: props.id, debounceMs: props.debounceMs, disabled: waiting, type: "text", value: props.value, placeholder: props.placeholder, round: props.round, onChange: props.onChange, rightControl: submitButton })));
|
|
3712
|
+
React__namespace.createElement(Input, { 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 })));
|
|
3680
3713
|
};
|
|
3681
3714
|
|
|
3682
|
-
const GlobalStyles = () => {
|
|
3715
|
+
const GlobalStyles = (p) => {
|
|
3683
3716
|
const theme = useThemeSafely();
|
|
3684
3717
|
css.injectGlobal({
|
|
3685
3718
|
'*': {
|
|
@@ -3707,28 +3740,6 @@ const GlobalStyles = () => {
|
|
|
3707
3740
|
return null;
|
|
3708
3741
|
};
|
|
3709
3742
|
|
|
3710
|
-
const getCurrencyDisplay = (value, isCents, denomination = '$') => {
|
|
3711
|
-
let actualValue = value || 0;
|
|
3712
|
-
if (isCents) {
|
|
3713
|
-
actualValue /= 100;
|
|
3714
|
-
}
|
|
3715
|
-
return `${denomination}${actualValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
3716
|
-
};
|
|
3717
|
-
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
3718
|
-
const enumToEntities = (enumObj) => {
|
|
3719
|
-
const entities = [];
|
|
3720
|
-
for (const key in enumObj) {
|
|
3721
|
-
if (isNaN(parseInt(key, 10))) {
|
|
3722
|
-
entities.push({
|
|
3723
|
-
id: enumObj[key],
|
|
3724
|
-
name: key
|
|
3725
|
-
});
|
|
3726
|
-
}
|
|
3727
|
-
}
|
|
3728
|
-
return entities;
|
|
3729
|
-
};
|
|
3730
|
-
//TB: FUTURE Expose in UI.
|
|
3731
|
-
|
|
3732
3743
|
const Slider = (p) => {
|
|
3733
3744
|
const theme = useThemeSafely();
|
|
3734
3745
|
const currentValue = React.useRef(p.value);
|
|
@@ -4013,7 +4024,7 @@ const TextArea = React__namespace.forwardRef((props, ref) => {
|
|
|
4013
4024
|
const [localValue, setLocalValue] = React__namespace.useState(props.value);
|
|
4014
4025
|
const inputRef = (ref !== null && ref !== void 0 ? ref : React__namespace.useRef(null));
|
|
4015
4026
|
const [validationError, updateErrorMessage] = useInputValidationMessage(inputRef, props);
|
|
4016
|
-
const nativeProps = __rest(props, ["onValueChange", "customError"]);
|
|
4027
|
+
const nativeProps = __rest(props, ["onValueChange", "customError", "reportValueOnError"]);
|
|
4017
4028
|
const theme = useThemeSafely();
|
|
4018
4029
|
React__namespace.useEffect(() => {
|
|
4019
4030
|
updateErrorMessage();
|
|
@@ -4024,7 +4035,13 @@ const TextArea = React__namespace.forwardRef((props, ref) => {
|
|
|
4024
4035
|
props.onValueChange(localValue);
|
|
4025
4036
|
}
|
|
4026
4037
|
else {
|
|
4027
|
-
props.
|
|
4038
|
+
if (props.reportValueOnError) {
|
|
4039
|
+
//TB: temp, add a custom list of validators that will be run for all inputs if a pattern cannot be decided.
|
|
4040
|
+
props.onValueChange(localValue);
|
|
4041
|
+
}
|
|
4042
|
+
else {
|
|
4043
|
+
props.onValueChange(undefined);
|
|
4044
|
+
}
|
|
4028
4045
|
}
|
|
4029
4046
|
updateErrorMessage();
|
|
4030
4047
|
}, [localValue]);
|
|
@@ -4231,6 +4248,326 @@ const WaitingIndicator = (p) => {
|
|
|
4231
4248
|
React__default['default'].createElement(Icon, { id: "waiting", spin: true }))));
|
|
4232
4249
|
};
|
|
4233
4250
|
|
|
4251
|
+
/*
|
|
4252
|
+
pulled from https://github.com/necolas/normalize.css/blob/master/normalize.css.
|
|
4253
|
+
the IE-specific fixes have been removed.
|
|
4254
|
+
*/
|
|
4255
|
+
/** Resets certain styles so there is more consistancy between browsers. */
|
|
4256
|
+
const NormalizeCss = (p) => {
|
|
4257
|
+
/* tslint:disable:no-unused-expression */
|
|
4258
|
+
css.injectGlobal `
|
|
4259
|
+
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
|
4260
|
+
|
|
4261
|
+
/* Document
|
|
4262
|
+
========================================================================== */
|
|
4263
|
+
|
|
4264
|
+
/**
|
|
4265
|
+
* 1. Correct the line height in all browsers.
|
|
4266
|
+
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
|
4267
|
+
*/
|
|
4268
|
+
|
|
4269
|
+
html {
|
|
4270
|
+
line-height: 1.15; /* 1 */
|
|
4271
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
|
4272
|
+
}
|
|
4273
|
+
|
|
4274
|
+
/* Sections
|
|
4275
|
+
========================================================================== */
|
|
4276
|
+
|
|
4277
|
+
/**
|
|
4278
|
+
* Remove the margin in all browsers.
|
|
4279
|
+
*/
|
|
4280
|
+
|
|
4281
|
+
body {
|
|
4282
|
+
margin: 0;
|
|
4283
|
+
}
|
|
4284
|
+
|
|
4285
|
+
/**
|
|
4286
|
+
* Correct the font size and margin on 'h1' elements within 'section' and
|
|
4287
|
+
* 'article' contexts in Chrome, Firefox, and Safari.
|
|
4288
|
+
*/
|
|
4289
|
+
|
|
4290
|
+
h1 {
|
|
4291
|
+
font-size: 2em;
|
|
4292
|
+
margin: 0.67em 0;
|
|
4293
|
+
}
|
|
4294
|
+
|
|
4295
|
+
/* Grouping content
|
|
4296
|
+
========================================================================== */
|
|
4297
|
+
|
|
4298
|
+
/**
|
|
4299
|
+
* 1. Add the correct box sizing in Firefox.
|
|
4300
|
+
* 2. Show the overflow in Edge and IE.
|
|
4301
|
+
*/
|
|
4302
|
+
|
|
4303
|
+
hr {
|
|
4304
|
+
box-sizing: content-box; /* 1 */
|
|
4305
|
+
height: 0; /* 1 */
|
|
4306
|
+
overflow: visible; /* 2 */
|
|
4307
|
+
}
|
|
4308
|
+
|
|
4309
|
+
/**
|
|
4310
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
4311
|
+
* 2. Correct the odd 'em' font sizing in all browsers.
|
|
4312
|
+
*/
|
|
4313
|
+
|
|
4314
|
+
pre {
|
|
4315
|
+
font-family: monospace, monospace; /* 1 */
|
|
4316
|
+
font-size: 1em; /* 2 */
|
|
4317
|
+
}
|
|
4318
|
+
|
|
4319
|
+
/* Text-level semantics
|
|
4320
|
+
========================================================================== */
|
|
4321
|
+
|
|
4322
|
+
/**
|
|
4323
|
+
* 1. Remove the bottom border in Chrome 57-
|
|
4324
|
+
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
|
4325
|
+
*/
|
|
4326
|
+
|
|
4327
|
+
abbr[title] {
|
|
4328
|
+
border-bottom: none; /* 1 */
|
|
4329
|
+
text-decoration: underline; /* 2 */
|
|
4330
|
+
text-decoration: underline dotted; /* 2 */
|
|
4331
|
+
}
|
|
4332
|
+
|
|
4333
|
+
/**
|
|
4334
|
+
* Add the correct font weight in Chrome, Edge, and Safari.
|
|
4335
|
+
*/
|
|
4336
|
+
|
|
4337
|
+
b,
|
|
4338
|
+
strong {
|
|
4339
|
+
font-weight: bolder;
|
|
4340
|
+
}
|
|
4341
|
+
|
|
4342
|
+
/**
|
|
4343
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
4344
|
+
* 2. Correct the odd 'em' font sizing in all browsers.
|
|
4345
|
+
*/
|
|
4346
|
+
|
|
4347
|
+
code,
|
|
4348
|
+
kbd,
|
|
4349
|
+
samp {
|
|
4350
|
+
font-family: monospace, monospace; /* 1 */
|
|
4351
|
+
font-size: 1em; /* 2 */
|
|
4352
|
+
}
|
|
4353
|
+
|
|
4354
|
+
/**
|
|
4355
|
+
* Add the correct font size in all browsers.
|
|
4356
|
+
*/
|
|
4357
|
+
|
|
4358
|
+
small {
|
|
4359
|
+
font-size: 80%;
|
|
4360
|
+
}
|
|
4361
|
+
|
|
4362
|
+
/**
|
|
4363
|
+
* Prevent 'sub' and 'sup' elements from affecting the line height in
|
|
4364
|
+
* all browsers.
|
|
4365
|
+
*/
|
|
4366
|
+
|
|
4367
|
+
sub,
|
|
4368
|
+
sup {
|
|
4369
|
+
font-size: 75%;
|
|
4370
|
+
line-height: 0;
|
|
4371
|
+
position: relative;
|
|
4372
|
+
vertical-align: baseline;
|
|
4373
|
+
}
|
|
4374
|
+
|
|
4375
|
+
sub {
|
|
4376
|
+
bottom: -0.25em;
|
|
4377
|
+
}
|
|
4378
|
+
|
|
4379
|
+
sup {
|
|
4380
|
+
top: -0.5em;
|
|
4381
|
+
}
|
|
4382
|
+
|
|
4383
|
+
/* Forms
|
|
4384
|
+
========================================================================== */
|
|
4385
|
+
|
|
4386
|
+
/**
|
|
4387
|
+
* 1. Change the font styles in all browsers.
|
|
4388
|
+
* 2. Remove the margin in Firefox and Safari.
|
|
4389
|
+
*/
|
|
4390
|
+
|
|
4391
|
+
button,
|
|
4392
|
+
input,
|
|
4393
|
+
optgroup,
|
|
4394
|
+
select,
|
|
4395
|
+
textarea {
|
|
4396
|
+
font-family: inherit; /* 1 */
|
|
4397
|
+
font-size: 100%; /* 1 */
|
|
4398
|
+
line-height: 1.15; /* 1 */
|
|
4399
|
+
margin: 0; /* 2 */
|
|
4400
|
+
}
|
|
4401
|
+
|
|
4402
|
+
/**
|
|
4403
|
+
* Show the overflow in IE.
|
|
4404
|
+
* 1. Show the overflow in Edge.
|
|
4405
|
+
*/
|
|
4406
|
+
|
|
4407
|
+
button,
|
|
4408
|
+
input { /* 1 */
|
|
4409
|
+
overflow: visible;
|
|
4410
|
+
}
|
|
4411
|
+
|
|
4412
|
+
/**
|
|
4413
|
+
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
4414
|
+
* 1. Remove the inheritance of text transform in Firefox.
|
|
4415
|
+
*/
|
|
4416
|
+
|
|
4417
|
+
button,
|
|
4418
|
+
select { /* 1 */
|
|
4419
|
+
text-transform: none;
|
|
4420
|
+
}
|
|
4421
|
+
|
|
4422
|
+
/**
|
|
4423
|
+
* Correct the inability to style clickable types in iOS and Safari.
|
|
4424
|
+
*/
|
|
4425
|
+
|
|
4426
|
+
button,
|
|
4427
|
+
[type="button"],
|
|
4428
|
+
[type="reset"],
|
|
4429
|
+
[type="submit"] {
|
|
4430
|
+
-webkit-appearance: button;
|
|
4431
|
+
}
|
|
4432
|
+
|
|
4433
|
+
/**
|
|
4434
|
+
* Remove the inner border and padding in Firefox.
|
|
4435
|
+
*/
|
|
4436
|
+
|
|
4437
|
+
button::-moz-focus-inner,
|
|
4438
|
+
[type="button"]::-moz-focus-inner,
|
|
4439
|
+
[type="reset"]::-moz-focus-inner,
|
|
4440
|
+
[type="submit"]::-moz-focus-inner {
|
|
4441
|
+
border-style: none;
|
|
4442
|
+
padding: 0;
|
|
4443
|
+
}
|
|
4444
|
+
|
|
4445
|
+
/**
|
|
4446
|
+
* Restore the focus styles unset by the previous rule.
|
|
4447
|
+
*/
|
|
4448
|
+
|
|
4449
|
+
button:-moz-focusring,
|
|
4450
|
+
[type="button"]:-moz-focusring,
|
|
4451
|
+
[type="reset"]:-moz-focusring,
|
|
4452
|
+
[type="submit"]:-moz-focusring {
|
|
4453
|
+
outline: 1px dotted ButtonText;
|
|
4454
|
+
}
|
|
4455
|
+
|
|
4456
|
+
/**
|
|
4457
|
+
* Correct the padding in Firefox.
|
|
4458
|
+
*/
|
|
4459
|
+
|
|
4460
|
+
fieldset {
|
|
4461
|
+
padding: 0.35em 0.75em 0.625em;
|
|
4462
|
+
}
|
|
4463
|
+
|
|
4464
|
+
/**
|
|
4465
|
+
* 1. Correct the text wrapping in Edge and IE.
|
|
4466
|
+
* 2. Correct the color inheritance from 'fieldset' elements in IE.
|
|
4467
|
+
* 3. Remove the padding so developers are not caught out when they zero out
|
|
4468
|
+
* 'fieldset' elements in all browsers.
|
|
4469
|
+
*/
|
|
4470
|
+
|
|
4471
|
+
legend {
|
|
4472
|
+
box-sizing: border-box; /* 1 */
|
|
4473
|
+
color: inherit; /* 2 */
|
|
4474
|
+
display: table; /* 1 */
|
|
4475
|
+
max-width: 100%; /* 1 */
|
|
4476
|
+
padding: 0; /* 3 */
|
|
4477
|
+
white-space: normal; /* 1 */
|
|
4478
|
+
}
|
|
4479
|
+
|
|
4480
|
+
/**
|
|
4481
|
+
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
4482
|
+
*/
|
|
4483
|
+
|
|
4484
|
+
progress {
|
|
4485
|
+
vertical-align: baseline;
|
|
4486
|
+
}
|
|
4487
|
+
|
|
4488
|
+
|
|
4489
|
+
/**
|
|
4490
|
+
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
4491
|
+
*/
|
|
4492
|
+
|
|
4493
|
+
[type="number"]::-webkit-inner-spin-button,
|
|
4494
|
+
[type="number"]::-webkit-outer-spin-button {
|
|
4495
|
+
height: auto;
|
|
4496
|
+
}
|
|
4497
|
+
|
|
4498
|
+
/**
|
|
4499
|
+
* 1. Correct the odd appearance in Chrome and Safari.
|
|
4500
|
+
* 2. Correct the outline style in Safari.
|
|
4501
|
+
*/
|
|
4502
|
+
|
|
4503
|
+
[type="search"] {
|
|
4504
|
+
-webkit-appearance: textfield; /* 1 */
|
|
4505
|
+
outline-offset: -2px; /* 2 */
|
|
4506
|
+
}
|
|
4507
|
+
|
|
4508
|
+
/**
|
|
4509
|
+
* Remove the inner padding in Chrome and Safari on macOS.
|
|
4510
|
+
*/
|
|
4511
|
+
|
|
4512
|
+
[type="search"]::-webkit-search-decoration {
|
|
4513
|
+
-webkit-appearance: none;
|
|
4514
|
+
}
|
|
4515
|
+
|
|
4516
|
+
/**
|
|
4517
|
+
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
4518
|
+
* 2. Change font properties to 'inherit' in Safari.
|
|
4519
|
+
*/
|
|
4520
|
+
|
|
4521
|
+
::-webkit-file-upload-button {
|
|
4522
|
+
-webkit-appearance: button; /* 1 */
|
|
4523
|
+
font: inherit; /* 2 */
|
|
4524
|
+
}
|
|
4525
|
+
|
|
4526
|
+
/* Interactive
|
|
4527
|
+
========================================================================== */
|
|
4528
|
+
|
|
4529
|
+
/*
|
|
4530
|
+
* Add the correct display in Edge, IE 10+, and Firefox.
|
|
4531
|
+
*/
|
|
4532
|
+
|
|
4533
|
+
details {
|
|
4534
|
+
display: block;
|
|
4535
|
+
}
|
|
4536
|
+
|
|
4537
|
+
/*
|
|
4538
|
+
* Add the correct display in all browsers.
|
|
4539
|
+
*/
|
|
4540
|
+
|
|
4541
|
+
summary {
|
|
4542
|
+
display: list-item;
|
|
4543
|
+
}
|
|
4544
|
+
`;
|
|
4545
|
+
return null;
|
|
4546
|
+
};
|
|
4547
|
+
|
|
4548
|
+
/** Displays the value in American dollars. */
|
|
4549
|
+
const getCurrencyDisplay = (value, isCents, denomination = '$') => {
|
|
4550
|
+
let actualValue = value || 0;
|
|
4551
|
+
if (isCents) {
|
|
4552
|
+
actualValue /= 100;
|
|
4553
|
+
}
|
|
4554
|
+
return `${denomination}${actualValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
4555
|
+
};
|
|
4556
|
+
|
|
4557
|
+
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
4558
|
+
const enumToEntities = (enumObj) => {
|
|
4559
|
+
const entities = [];
|
|
4560
|
+
for (const key in enumObj) {
|
|
4561
|
+
if (isNaN(parseInt(key, 10))) {
|
|
4562
|
+
entities.push({
|
|
4563
|
+
id: enumObj[key],
|
|
4564
|
+
name: key
|
|
4565
|
+
});
|
|
4566
|
+
}
|
|
4567
|
+
}
|
|
4568
|
+
return entities;
|
|
4569
|
+
};
|
|
4570
|
+
|
|
4234
4571
|
exports.Accordian = Accordian;
|
|
4235
4572
|
exports.Autocomplete = Autocomplete;
|
|
4236
4573
|
exports.Backdrop = Backdrop$1;
|
|
@@ -4264,6 +4601,7 @@ exports.List = List;
|
|
|
4264
4601
|
exports.ListItem = ListItem;
|
|
4265
4602
|
exports.Modal = Modal;
|
|
4266
4603
|
exports.Nav = Nav;
|
|
4604
|
+
exports.NormalizeCss = NormalizeCss;
|
|
4267
4605
|
exports.NumberInput = NumberInput;
|
|
4268
4606
|
exports.OmniLink = OmniLink;
|
|
4269
4607
|
exports.PagedResult = PagedResult;
|