@mackin.com/styleguide 8.0.4 → 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 +40 -24
- package/index.js +400 -73
- 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;
|
|
@@ -401,16 +404,14 @@ declare const TextInput: React.ForwardRefExoticComponent<Pick<TextInputProps, "t
|
|
|
401
404
|
/** useEffect but ignores the first call on component mount. */
|
|
402
405
|
declare const useIgnoreMount: (effect: React__default.EffectCallback, deps?: React__default.DependencyList | undefined) => void;
|
|
403
406
|
|
|
404
|
-
interface LabelProps {
|
|
407
|
+
interface LabelProps extends React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
405
408
|
text: string | JSX.Element;
|
|
406
|
-
|
|
409
|
+
/** Displays the label NOT using a label element. */
|
|
407
410
|
static?: boolean;
|
|
408
|
-
htmlFor?: string;
|
|
409
411
|
/** Defaults to 'vertical'. */
|
|
410
412
|
orientation?: 'vertical' | 'horizontal' | 'horizontalReverse';
|
|
411
413
|
/** The alignment of the label text. Defaults to 'left'. Ignored for horizontal and horizontalReverse orientation. */
|
|
412
414
|
align?: 'left' | 'right' | 'center';
|
|
413
|
-
className?: string;
|
|
414
415
|
/** Don't wrap the children in the <label>. Fixes re-focus bugs with the date picker and possible future libraries. */
|
|
415
416
|
noWrap?: boolean;
|
|
416
417
|
/** Smaller text next to the main label. */
|
|
@@ -464,12 +465,8 @@ declare const Nav: (props: {
|
|
|
464
465
|
__debug?: boolean | undefined;
|
|
465
466
|
}) => JSX.Element;
|
|
466
467
|
|
|
467
|
-
interface OmniLinkProps {
|
|
468
|
+
interface OmniLinkProps extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
|
468
469
|
href: string;
|
|
469
|
-
children: React.ReactNode;
|
|
470
|
-
onClick?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
|
|
471
|
-
className?: string;
|
|
472
|
-
style?: React.CSSProperties;
|
|
473
470
|
noRouter?: boolean;
|
|
474
471
|
/** Ignored if 'noRouter' is false */
|
|
475
472
|
target?: string;
|
|
@@ -480,12 +477,11 @@ interface OmniLinkProps {
|
|
|
480
477
|
iconBlock?: boolean;
|
|
481
478
|
/** Corresponds to the button variants of the same name. */
|
|
482
479
|
variant?: 'button' | 'label' | 'icon' | 'circle' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
483
|
-
title?: string;
|
|
484
480
|
/** Only for button variants. */
|
|
485
481
|
round?: boolean;
|
|
486
482
|
/** Only for button variants. */
|
|
487
483
|
small?: boolean;
|
|
488
|
-
/** 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`. */
|
|
489
485
|
colorOverride?: string;
|
|
490
486
|
}
|
|
491
487
|
declare const OmniLink: (props: OmniLinkProps) => JSX.Element;
|
|
@@ -720,21 +716,13 @@ interface SearchBoxProps {
|
|
|
720
716
|
onSubmit?: () => Promise<void>;
|
|
721
717
|
/** Defaults to 250ms */
|
|
722
718
|
debounceMs?: number;
|
|
719
|
+
autoFocus?: boolean;
|
|
723
720
|
}
|
|
724
721
|
declare const SearchBox: (props: SearchBoxProps) => JSX.Element;
|
|
725
722
|
|
|
726
723
|
declare type Alignment = 'left' | 'right' | 'center';
|
|
727
724
|
|
|
728
|
-
declare const GlobalStyles: () => null;
|
|
729
|
-
|
|
730
|
-
declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
|
|
731
|
-
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
732
|
-
declare const enumToEntities: <T extends {
|
|
733
|
-
[key: string]: string | number;
|
|
734
|
-
}>(enumObj: T) => {
|
|
735
|
-
id: string | number;
|
|
736
|
-
name: string;
|
|
737
|
-
}[];
|
|
725
|
+
declare const GlobalStyles: (p: {}) => null;
|
|
738
726
|
|
|
739
727
|
interface MackinTheme {
|
|
740
728
|
colors: {
|
|
@@ -782,6 +770,10 @@ interface MackinTheme {
|
|
|
782
770
|
sizeSmall: string;
|
|
783
771
|
sizeLarge: string;
|
|
784
772
|
headerFamily: string;
|
|
773
|
+
sizeH1: string;
|
|
774
|
+
sizeH2: string;
|
|
775
|
+
sizeH3: string;
|
|
776
|
+
sizeH4: string;
|
|
785
777
|
};
|
|
786
778
|
controls: {
|
|
787
779
|
padding: string;
|
|
@@ -804,8 +796,10 @@ interface MackinTheme {
|
|
|
804
796
|
gap: string;
|
|
805
797
|
dividerMargin: string;
|
|
806
798
|
dividerBorder: string;
|
|
799
|
+
dividerThickness: string;
|
|
807
800
|
headerBoxShadow: string;
|
|
808
801
|
inputErrorMinHeight: string;
|
|
802
|
+
paragraphPadding: string;
|
|
809
803
|
};
|
|
810
804
|
zIndexes: {
|
|
811
805
|
header: number;
|
|
@@ -930,10 +924,11 @@ declare const TabLocker: (props: {
|
|
|
930
924
|
style?: React.CSSProperties;
|
|
931
925
|
}) => JSX.Element;
|
|
932
926
|
|
|
927
|
+
declare type SupportedTags = 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'span' | 'div';
|
|
933
928
|
interface TextProps {
|
|
934
929
|
children: any;
|
|
935
930
|
/** Defaults to 'p'. */
|
|
936
|
-
tag?:
|
|
931
|
+
tag?: SupportedTags;
|
|
937
932
|
align?: Alignment;
|
|
938
933
|
bold?: boolean;
|
|
939
934
|
italics?: boolean;
|
|
@@ -941,14 +936,19 @@ interface TextProps {
|
|
|
941
936
|
/** You will need to set a width or max-width on the element for this to work. */
|
|
942
937
|
ellipsis?: boolean;
|
|
943
938
|
style?: React.CSSProperties;
|
|
939
|
+
/** Applies `theme.fonts.sizeSmall` to the font-size. */
|
|
944
940
|
smaller?: boolean;
|
|
941
|
+
/** Applies `theme.fonts.sizeLarge` to the font-size. */
|
|
945
942
|
larger?: boolean;
|
|
943
|
+
/** Overrides the theme font-size. */
|
|
944
|
+
fontSize?: string | number;
|
|
946
945
|
spacedOut?: boolean;
|
|
947
946
|
lineClamp?: number;
|
|
948
947
|
/** Will remove all margin/padding from specified tag */
|
|
949
948
|
noPad?: boolean;
|
|
950
949
|
leftPad?: string;
|
|
951
950
|
}
|
|
951
|
+
/** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
|
|
952
952
|
declare const Text: (props: TextProps) => React.DetailedReactHTMLElement<{
|
|
953
953
|
style: React.CSSProperties;
|
|
954
954
|
className: string;
|
|
@@ -1025,4 +1025,20 @@ declare const useWaiting: <TArgs extends any[], TReturn>(func: (...args: TArgs)
|
|
|
1025
1025
|
*/
|
|
1026
1026
|
declare const useBooleanChanged: (effect: (current: boolean, previous: boolean) => void, dep: boolean | undefined) => void;
|
|
1027
1027
|
|
|
1028
|
-
|
|
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
|
@@ -116,7 +116,7 @@ const calcDynamicThemeProps = (theme) => {
|
|
|
116
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}`;
|
|
117
117
|
theme.controls.focusOutlineShadow = `0px 0px 4px 2px ${theme.colors.focusOutline}`;
|
|
118
118
|
theme.controls.focusOutlineRequiredShadow = `0px 0px 4px 2px ${theme.colors.focusOutlineRequired}`;
|
|
119
|
-
theme.controls.dividerBorder =
|
|
119
|
+
theme.controls.dividerBorder = `${theme.controls.dividerThickness} solid ${theme.colors.divider}`;
|
|
120
120
|
theme.controls.inputErrorMinHeight = `calc(${theme.fonts.sizeSmall} * 1.5 + 4px)`;
|
|
121
121
|
theme.mediaQueries.desktop = `@media(min-width:${theme.breakpoints.desktop})`;
|
|
122
122
|
theme.mediaQueries.tablet = `@media(min-width:${theme.breakpoints.tablet})`;
|
|
@@ -166,6 +166,10 @@ const defaultTheme = {
|
|
|
166
166
|
sizeSmall: '0.7rem',
|
|
167
167
|
sizeLarge: '1.3rem',
|
|
168
168
|
headerFamily: 'Arial, Helvetica, sans-serif',
|
|
169
|
+
sizeH1: '2rem',
|
|
170
|
+
sizeH2: '1.5rem',
|
|
171
|
+
sizeH3: '1.17rem',
|
|
172
|
+
sizeH4: '1rem',
|
|
169
173
|
},
|
|
170
174
|
controls: {
|
|
171
175
|
padding: '0.5rem',
|
|
@@ -188,8 +192,10 @@ const defaultTheme = {
|
|
|
188
192
|
gap: '1rem',
|
|
189
193
|
dividerMargin: '1rem',
|
|
190
194
|
dividerBorder: '',
|
|
195
|
+
dividerThickness: '2px',
|
|
191
196
|
headerBoxShadow: '0px 2px 12px 6px rgba(0, 0, 0, 0.2)',
|
|
192
|
-
inputErrorMinHeight: ''
|
|
197
|
+
inputErrorMinHeight: '',
|
|
198
|
+
paragraphPadding: '1rem'
|
|
193
199
|
},
|
|
194
200
|
zIndexes: {
|
|
195
201
|
header: 50,
|
|
@@ -233,7 +239,7 @@ const useThemeSafely = () => {
|
|
|
233
239
|
|
|
234
240
|
const Button = React__namespace.forwardRef((props, ref) => {
|
|
235
241
|
var _a;
|
|
236
|
-
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"]);
|
|
237
243
|
const theme = useThemeSafely();
|
|
238
244
|
const buttonStyles = css.css `
|
|
239
245
|
padding-left: ${theme.controls.padding};
|
|
@@ -395,10 +401,18 @@ const Button = React__namespace.forwardRef((props, ref) => {
|
|
|
395
401
|
`}
|
|
396
402
|
`;
|
|
397
403
|
const disabled = props.disabled || props.waiting;
|
|
398
|
-
|
|
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' }),
|
|
399
405
|
props.leftIcon && React__namespace.createElement("span", { className: css.css({ marginRight: '0.5rem' }) }, props.leftIcon),
|
|
400
406
|
props.waiting ? React__namespace.createElement(Icon, { id: "waiting", spin: true }) : props.children,
|
|
401
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;
|
|
402
416
|
});
|
|
403
417
|
|
|
404
418
|
const accordianExpandTimeMs = 250;
|
|
@@ -450,8 +464,6 @@ const Accordian = (props) => {
|
|
|
450
464
|
}, [props.open]);
|
|
451
465
|
return (React__namespace.createElement("div", { className: "accordian" },
|
|
452
466
|
React__namespace.createElement(Button, { readOnly: props.disabled, variant: props.variant, className: css.cx(css.css({
|
|
453
|
-
//TB: fix this with a global reset
|
|
454
|
-
margin: 0,
|
|
455
467
|
display: 'flex',
|
|
456
468
|
alignItems: 'center',
|
|
457
469
|
justifyContent: 'space-between',
|
|
@@ -772,23 +784,26 @@ const TabLocker = (props) => {
|
|
|
772
784
|
} }, props.children));
|
|
773
785
|
};
|
|
774
786
|
|
|
775
|
-
const
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
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
|
+
}
|
|
792
807
|
};
|
|
793
808
|
const headerRegex = /h1|h2|h3|h4/;
|
|
794
809
|
const alignStyles = {
|
|
@@ -796,6 +811,7 @@ const alignStyles = {
|
|
|
796
811
|
'left': { textAlign: 'left' },
|
|
797
812
|
'right': { textAlign: 'right' }
|
|
798
813
|
};
|
|
814
|
+
/** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
|
|
799
815
|
const Text = (props) => {
|
|
800
816
|
var _a, _b;
|
|
801
817
|
const theme = useThemeSafely();
|
|
@@ -809,8 +825,9 @@ const Text = (props) => {
|
|
|
809
825
|
}
|
|
810
826
|
const styles = css.css({
|
|
811
827
|
userSelect: 'text',
|
|
812
|
-
label: 'Text'
|
|
813
|
-
|
|
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 && {
|
|
814
831
|
overflow: 'hidden',
|
|
815
832
|
whiteSpace: 'nowrap',
|
|
816
833
|
textOverflow: 'ellipsis'
|
|
@@ -904,7 +921,7 @@ const Autocomplete = (p) => {
|
|
|
904
921
|
label: 'Autocomplete'
|
|
905
922
|
}), 'autocomplete') },
|
|
906
923
|
React__namespace.createElement(TabLocker, { disabled: !showValues, style: { position: 'relative' } },
|
|
907
|
-
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 => {
|
|
908
925
|
const value = v;
|
|
909
926
|
p.onChange(value);
|
|
910
927
|
onChangeForOptions.current(value);
|
|
@@ -1646,6 +1663,7 @@ const CopyButton = (props) => {
|
|
|
1646
1663
|
const Divider = (p) => {
|
|
1647
1664
|
const theme = useThemeSafely();
|
|
1648
1665
|
return (React__namespace.createElement("hr", Object.assign({}, p, { className: css.cx("divider", css.css({
|
|
1666
|
+
label: 'Divider',
|
|
1649
1667
|
margin: theme.controls.dividerMargin,
|
|
1650
1668
|
border: theme.controls.dividerBorder
|
|
1651
1669
|
}), p.className) })));
|
|
@@ -2248,7 +2266,9 @@ const BaseInput = React__namespace.forwardRef((props, ref) => {
|
|
|
2248
2266
|
':focus': {
|
|
2249
2267
|
outline: 'none',
|
|
2250
2268
|
boxShadow: 'none'
|
|
2251
|
-
}
|
|
2269
|
+
},
|
|
2270
|
+
// FF fix to hide spinner on number elements
|
|
2271
|
+
appearance: props.type === 'number' ? 'textfield' : undefined
|
|
2252
2272
|
}, props.rightControl && {
|
|
2253
2273
|
paddingRight: theme.controls.height
|
|
2254
2274
|
});
|
|
@@ -2683,38 +2703,41 @@ const TextInput = React__namespace.forwardRef((props, ref) => {
|
|
|
2683
2703
|
|
|
2684
2704
|
const Label = (props) => {
|
|
2685
2705
|
var _a, _b, _c;
|
|
2706
|
+
const labelProps = __rest(props, ["text", "static", "orientation", "align", "noWrap", "subText", "optional", "controlAlign"]);
|
|
2686
2707
|
const theme = useThemeSafely();
|
|
2687
|
-
const
|
|
2688
|
-
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';
|
|
2689
2710
|
const padding = '0.25rem';
|
|
2690
2711
|
const labelStyles = css.css `
|
|
2712
|
+
label: Label;
|
|
2691
2713
|
${padding};
|
|
2692
2714
|
display: flex;
|
|
2693
|
-
${
|
|
2715
|
+
${orientationChoice === 'vertical' && `
|
|
2694
2716
|
flex-direction: column;
|
|
2695
2717
|
`}
|
|
2696
|
-
${
|
|
2718
|
+
${orientationChoice === 'horizontal' && `
|
|
2697
2719
|
flex-direction: row;
|
|
2698
2720
|
align-items: center;
|
|
2699
2721
|
`}
|
|
2700
|
-
${
|
|
2722
|
+
${orientationChoice === 'horizontalReverse' && `
|
|
2701
2723
|
flex-direction: row-reverse;
|
|
2702
2724
|
align-items: center;
|
|
2703
2725
|
`}
|
|
2704
2726
|
`;
|
|
2705
2727
|
const labelTextStyles = css.css `
|
|
2728
|
+
label: LabelText;
|
|
2706
2729
|
flex-shrink:0;
|
|
2707
|
-
${
|
|
2730
|
+
${orientationChoice === 'vertical' && `
|
|
2708
2731
|
margin-bottom: ${padding};
|
|
2709
2732
|
`}
|
|
2710
|
-
${
|
|
2733
|
+
${orientationChoice === 'horizontal' && `
|
|
2711
2734
|
flex-direction: row;
|
|
2712
2735
|
margin-right:${padding};
|
|
2713
2736
|
${props.static && `
|
|
2714
2737
|
margin-right:0.5rem;
|
|
2715
2738
|
`}
|
|
2716
2739
|
`}
|
|
2717
|
-
${
|
|
2740
|
+
${orientationChoice === 'horizontalReverse' && `
|
|
2718
2741
|
margin-left:${padding};
|
|
2719
2742
|
`}
|
|
2720
2743
|
${(props.subText || props.optional) && `
|
|
@@ -2722,6 +2745,7 @@ const Label = (props) => {
|
|
|
2722
2745
|
`}
|
|
2723
2746
|
`;
|
|
2724
2747
|
const labelContentStyles = css.css `
|
|
2748
|
+
label: LabelContent;
|
|
2725
2749
|
display:inline-block;
|
|
2726
2750
|
width:100%;
|
|
2727
2751
|
${props.controlAlign && `
|
|
@@ -2730,27 +2754,27 @@ const Label = (props) => {
|
|
|
2730
2754
|
`}
|
|
2731
2755
|
`;
|
|
2732
2756
|
const outerClass = props.className;
|
|
2733
|
-
let labelText = React__namespace.createElement(Text, { align:
|
|
2734
|
-
let
|
|
2757
|
+
let labelText = React__namespace.createElement(Text, { align: alignChoice, className: labelTextStyles, tag: "div", bold: true }, props.text);
|
|
2758
|
+
let subTextChoice;
|
|
2735
2759
|
if (props.subText) {
|
|
2736
2760
|
if (typeof props.subText === 'string') {
|
|
2737
|
-
|
|
2761
|
+
subTextChoice = React__namespace.createElement(Text, { tag: "div" }, props.subText);
|
|
2738
2762
|
}
|
|
2739
2763
|
else {
|
|
2740
|
-
|
|
2764
|
+
subTextChoice = props.subText;
|
|
2741
2765
|
}
|
|
2742
2766
|
}
|
|
2743
2767
|
else if (props.optional) {
|
|
2744
|
-
|
|
2768
|
+
subTextChoice = React__namespace.createElement(Text, { tag: "div" },
|
|
2745
2769
|
React__namespace.createElement("em", null, "(optional)"));
|
|
2746
2770
|
}
|
|
2747
|
-
if (
|
|
2771
|
+
if (subTextChoice) {
|
|
2748
2772
|
labelText = React__namespace.createElement("span", { className: css.css({ display: 'flex' }) },
|
|
2749
2773
|
labelText,
|
|
2750
2774
|
React__namespace.createElement("span", { className: css.css({
|
|
2751
2775
|
fontSize: '90%',
|
|
2752
2776
|
marginBottom: padding
|
|
2753
|
-
}) },
|
|
2777
|
+
}) }, subTextChoice));
|
|
2754
2778
|
}
|
|
2755
2779
|
if (props.noWrap) {
|
|
2756
2780
|
return (React__namespace.createElement("span", { className: css.cx(labelStyles, outerClass) },
|
|
@@ -2766,7 +2790,7 @@ const Label = (props) => {
|
|
|
2766
2790
|
// labels without htmlFor can cause focus, hover, and click issues when wrapping other elements.
|
|
2767
2791
|
// this fixes the issues.
|
|
2768
2792
|
const htmlFor = (_c = props.htmlFor) !== null && _c !== void 0 ? _c : nanoid.nanoid();
|
|
2769
|
-
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));
|
|
2770
2794
|
};
|
|
2771
2795
|
|
|
2772
2796
|
/*
|
|
@@ -2893,11 +2917,12 @@ const Nav = (props) => {
|
|
|
2893
2917
|
return (React__namespace.createElement("nav", { ref: nav, className: css.cx('nav', navStyles, props.className) }, props.children));
|
|
2894
2918
|
};
|
|
2895
2919
|
|
|
2896
|
-
//TB: FUTURE make just a basic styled link so you don't have to go with React Router if you don't want to.
|
|
2897
2920
|
const OmniLink = (props) => {
|
|
2898
|
-
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"]);
|
|
2899
2923
|
const theme = useThemeSafely();
|
|
2900
2924
|
const linkStyles = css.css `
|
|
2925
|
+
label: OmniLink;
|
|
2901
2926
|
display: inline-block;
|
|
2902
2927
|
cursor: pointer;
|
|
2903
2928
|
text-decoration: none;
|
|
@@ -2925,11 +2950,11 @@ const OmniLink = (props) => {
|
|
|
2925
2950
|
height: ${theme.controls.height};
|
|
2926
2951
|
line-height: ${theme.controls.height};
|
|
2927
2952
|
font-weight: bold;
|
|
2928
|
-
color: ${theme.colors.font};
|
|
2953
|
+
color: ${(_d = props.colorOverride) !== null && _d !== void 0 ? _d : theme.colors.font};
|
|
2929
2954
|
&:active,
|
|
2930
2955
|
&:focus,
|
|
2931
2956
|
&:visited {
|
|
2932
|
-
color: ${theme.colors.font};
|
|
2957
|
+
color: ${(_e = props.colorOverride) !== null && _e !== void 0 ? _e : theme.colors.font};
|
|
2933
2958
|
}
|
|
2934
2959
|
&:focus {
|
|
2935
2960
|
outline: none;
|
|
@@ -3051,6 +3076,7 @@ const OmniLink = (props) => {
|
|
|
3051
3076
|
const content = React__namespace.createElement(React__namespace.Fragment, null,
|
|
3052
3077
|
React__namespace.createElement("span", null,
|
|
3053
3078
|
props.leftIcon && React__namespace.createElement("span", { className: css.css({
|
|
3079
|
+
label: 'OmniLinkLeftIcon',
|
|
3054
3080
|
marginRight: '1rem',
|
|
3055
3081
|
display: 'inline-block',
|
|
3056
3082
|
minWidth: '1.5rem',
|
|
@@ -3058,13 +3084,14 @@ const OmniLink = (props) => {
|
|
|
3058
3084
|
}) }, props.leftIcon),
|
|
3059
3085
|
props.children),
|
|
3060
3086
|
props.rightIcon && React__namespace.createElement("span", { className: css.css({
|
|
3087
|
+
label: 'OmniLinkRightIcon',
|
|
3061
3088
|
marginLeft: '1rem',
|
|
3062
3089
|
verticalAlign: 'middle'
|
|
3063
3090
|
}) }, props.rightIcon));
|
|
3064
3091
|
if (props.noRouter) {
|
|
3065
|
-
return (React__namespace.createElement("a", {
|
|
3092
|
+
return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }), content));
|
|
3066
3093
|
}
|
|
3067
|
-
return (React__namespace.createElement(reactRouterDom.Link, {
|
|
3094
|
+
return (React__namespace.createElement(reactRouterDom.Link, Object.assign({}, linkProps, { className: mainClassName, to: props.href }), content));
|
|
3068
3095
|
};
|
|
3069
3096
|
|
|
3070
3097
|
const Picker = (props) => {
|
|
@@ -3084,6 +3111,7 @@ const Picker = (props) => {
|
|
|
3084
3111
|
}
|
|
3085
3112
|
const theme = useThemeSafely();
|
|
3086
3113
|
const selectStyles = css.css `
|
|
3114
|
+
background-color: ${theme.colors.bg};
|
|
3087
3115
|
color: ${theme.colors.font};
|
|
3088
3116
|
padding-left: ${theme.controls.padding};
|
|
3089
3117
|
padding-right: ${theme.controls.padding};
|
|
@@ -3681,10 +3709,10 @@ const SearchBox = (props) => {
|
|
|
3681
3709
|
React__namespace.createElement(Icon, { id: waiting ? 'waiting' : 'search', spin: waiting })));
|
|
3682
3710
|
//TB: FUTURE replace with new inputs
|
|
3683
3711
|
return (React__namespace.createElement(Form, { role: "search", className: css.cx('searchBox', props.className), onSubmit: onSubmit },
|
|
3684
|
-
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 })));
|
|
3685
3713
|
};
|
|
3686
3714
|
|
|
3687
|
-
const GlobalStyles = () => {
|
|
3715
|
+
const GlobalStyles = (p) => {
|
|
3688
3716
|
const theme = useThemeSafely();
|
|
3689
3717
|
css.injectGlobal({
|
|
3690
3718
|
'*': {
|
|
@@ -3712,28 +3740,6 @@ const GlobalStyles = () => {
|
|
|
3712
3740
|
return null;
|
|
3713
3741
|
};
|
|
3714
3742
|
|
|
3715
|
-
const getCurrencyDisplay = (value, isCents, denomination = '$') => {
|
|
3716
|
-
let actualValue = value || 0;
|
|
3717
|
-
if (isCents) {
|
|
3718
|
-
actualValue /= 100;
|
|
3719
|
-
}
|
|
3720
|
-
return `${denomination}${actualValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
3721
|
-
};
|
|
3722
|
-
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
3723
|
-
const enumToEntities = (enumObj) => {
|
|
3724
|
-
const entities = [];
|
|
3725
|
-
for (const key in enumObj) {
|
|
3726
|
-
if (isNaN(parseInt(key, 10))) {
|
|
3727
|
-
entities.push({
|
|
3728
|
-
id: enumObj[key],
|
|
3729
|
-
name: key
|
|
3730
|
-
});
|
|
3731
|
-
}
|
|
3732
|
-
}
|
|
3733
|
-
return entities;
|
|
3734
|
-
};
|
|
3735
|
-
//TB: FUTURE Expose in UI.
|
|
3736
|
-
|
|
3737
3743
|
const Slider = (p) => {
|
|
3738
3744
|
const theme = useThemeSafely();
|
|
3739
3745
|
const currentValue = React.useRef(p.value);
|
|
@@ -4242,6 +4248,326 @@ const WaitingIndicator = (p) => {
|
|
|
4242
4248
|
React__default['default'].createElement(Icon, { id: "waiting", spin: true }))));
|
|
4243
4249
|
};
|
|
4244
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
|
+
|
|
4245
4571
|
exports.Accordian = Accordian;
|
|
4246
4572
|
exports.Autocomplete = Autocomplete;
|
|
4247
4573
|
exports.Backdrop = Backdrop$1;
|
|
@@ -4275,6 +4601,7 @@ exports.List = List;
|
|
|
4275
4601
|
exports.ListItem = ListItem;
|
|
4276
4602
|
exports.Modal = Modal;
|
|
4277
4603
|
exports.Nav = Nav;
|
|
4604
|
+
exports.NormalizeCss = NormalizeCss;
|
|
4278
4605
|
exports.NumberInput = NumberInput;
|
|
4279
4606
|
exports.OmniLink = OmniLink;
|
|
4280
4607
|
exports.PagedResult = PagedResult;
|