@mackin.com/styleguide 8.0.4 → 8.2.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 +75 -51
- package/index.js +645 -273
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -116,8 +116,9 @@ 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
|
+
theme.controls.buttonBoxShadow = theme.controls.boxShadow;
|
|
121
122
|
theme.mediaQueries.desktop = `@media(min-width:${theme.breakpoints.desktop})`;
|
|
122
123
|
theme.mediaQueries.tablet = `@media(min-width:${theme.breakpoints.tablet})`;
|
|
123
124
|
};
|
|
@@ -166,6 +167,10 @@ const defaultTheme = {
|
|
|
166
167
|
sizeSmall: '0.7rem',
|
|
167
168
|
sizeLarge: '1.3rem',
|
|
168
169
|
headerFamily: 'Arial, Helvetica, sans-serif',
|
|
170
|
+
sizeH1: '2rem',
|
|
171
|
+
sizeH2: '1.5rem',
|
|
172
|
+
sizeH3: '1.17rem',
|
|
173
|
+
sizeH4: '1rem',
|
|
169
174
|
},
|
|
170
175
|
controls: {
|
|
171
176
|
padding: '0.5rem',
|
|
@@ -188,8 +193,11 @@ const defaultTheme = {
|
|
|
188
193
|
gap: '1rem',
|
|
189
194
|
dividerMargin: '1rem',
|
|
190
195
|
dividerBorder: '',
|
|
196
|
+
dividerThickness: '2px',
|
|
191
197
|
headerBoxShadow: '0px 2px 12px 6px rgba(0, 0, 0, 0.2)',
|
|
192
|
-
|
|
198
|
+
buttonBoxShadow: '',
|
|
199
|
+
inputErrorMinHeight: '',
|
|
200
|
+
paragraphPadding: '1rem'
|
|
193
201
|
},
|
|
194
202
|
zIndexes: {
|
|
195
203
|
header: 50,
|
|
@@ -210,7 +218,7 @@ const defaultTheme = {
|
|
|
210
218
|
},
|
|
211
219
|
mediaQueries: {
|
|
212
220
|
desktop: '',
|
|
213
|
-
tablet: ''
|
|
221
|
+
tablet: '' // set in calcDynamicThemeProps
|
|
214
222
|
}
|
|
215
223
|
};
|
|
216
224
|
calcDynamicThemeProps(defaultTheme);
|
|
@@ -233,7 +241,7 @@ const useThemeSafely = () => {
|
|
|
233
241
|
|
|
234
242
|
const Button = React__namespace.forwardRef((props, ref) => {
|
|
235
243
|
var _a;
|
|
236
|
-
const nativeProps = __rest(props, ["variant", "round", "rightIcon", "leftIcon", "iconBlock", "small", "readOnly", "waiting", "enforceMinWidth"]);
|
|
244
|
+
const nativeProps = __rest(props, ["variant", "round", "rightIcon", "leftIcon", "iconBlock", "small", "readOnly", "waiting", "enforceMinWidth", "controlAlign"]);
|
|
237
245
|
const theme = useThemeSafely();
|
|
238
246
|
const buttonStyles = css.css `
|
|
239
247
|
padding-left: ${theme.controls.padding};
|
|
@@ -242,7 +250,7 @@ const Button = React__namespace.forwardRef((props, ref) => {
|
|
|
242
250
|
border: ${theme.controls.border};
|
|
243
251
|
border-radius: ${theme.controls.borderRadius};
|
|
244
252
|
cursor: pointer;
|
|
245
|
-
box-shadow: ${theme.controls.
|
|
253
|
+
box-shadow: ${theme.controls.buttonBoxShadow};
|
|
246
254
|
color: ${theme.colors.font};
|
|
247
255
|
height: ${theme.controls.height};
|
|
248
256
|
transition: ${theme.controls.transition};
|
|
@@ -395,10 +403,18 @@ const Button = React__namespace.forwardRef((props, ref) => {
|
|
|
395
403
|
`}
|
|
396
404
|
`;
|
|
397
405
|
const disabled = props.disabled || props.waiting;
|
|
398
|
-
|
|
406
|
+
const button = (React__namespace.createElement("button", Object.assign({}, nativeProps, { ref: ref, disabled: disabled, className: css.cx('button', styles, props.className), type: (_a = props.type) !== null && _a !== void 0 ? _a : 'button' }),
|
|
399
407
|
props.leftIcon && React__namespace.createElement("span", { className: css.css({ marginRight: '0.5rem' }) }, props.leftIcon),
|
|
400
408
|
props.waiting ? React__namespace.createElement(Icon, { id: "waiting", spin: true }) : props.children,
|
|
401
409
|
props.rightIcon && React__namespace.createElement("span", { className: css.css({ marginLeft: '0.5rem' }) }, props.rightIcon)));
|
|
410
|
+
if (props.controlAlign) {
|
|
411
|
+
return (React__namespace.createElement("span", { className: css.css({
|
|
412
|
+
display: 'inline-block',
|
|
413
|
+
width: '100%',
|
|
414
|
+
paddingBottom: theme.controls.inputErrorMinHeight
|
|
415
|
+
}) }, button));
|
|
416
|
+
}
|
|
417
|
+
return button;
|
|
402
418
|
});
|
|
403
419
|
|
|
404
420
|
const accordianExpandTimeMs = 250;
|
|
@@ -450,8 +466,6 @@ const Accordian = (props) => {
|
|
|
450
466
|
}, [props.open]);
|
|
451
467
|
return (React__namespace.createElement("div", { className: "accordian" },
|
|
452
468
|
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
469
|
display: 'flex',
|
|
456
470
|
alignItems: 'center',
|
|
457
471
|
justifyContent: 'space-between',
|
|
@@ -772,23 +786,26 @@ const TabLocker = (props) => {
|
|
|
772
786
|
} }, props.children));
|
|
773
787
|
};
|
|
774
788
|
|
|
775
|
-
const
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
789
|
+
const getTagStyles = (theme, tag) => {
|
|
790
|
+
switch (tag) {
|
|
791
|
+
case 'p': return {
|
|
792
|
+
marginTop: theme.controls.paragraphPadding,
|
|
793
|
+
marginBottom: theme.controls.paragraphPadding
|
|
794
|
+
};
|
|
795
|
+
case 'h1': return {
|
|
796
|
+
fontSize: theme.fonts.sizeH1
|
|
797
|
+
};
|
|
798
|
+
case 'h2': return {
|
|
799
|
+
fontSize: theme.fonts.sizeH2
|
|
800
|
+
};
|
|
801
|
+
case 'h3': return {
|
|
802
|
+
fontSize: theme.fonts.sizeH3
|
|
803
|
+
};
|
|
804
|
+
case 'h4': return {
|
|
805
|
+
fontSize: theme.fonts.sizeH4
|
|
806
|
+
};
|
|
807
|
+
default: return undefined;
|
|
808
|
+
}
|
|
792
809
|
};
|
|
793
810
|
const headerRegex = /h1|h2|h3|h4/;
|
|
794
811
|
const alignStyles = {
|
|
@@ -796,6 +813,7 @@ const alignStyles = {
|
|
|
796
813
|
'left': { textAlign: 'left' },
|
|
797
814
|
'right': { textAlign: 'right' }
|
|
798
815
|
};
|
|
816
|
+
/** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
|
|
799
817
|
const Text = (props) => {
|
|
800
818
|
var _a, _b;
|
|
801
819
|
const theme = useThemeSafely();
|
|
@@ -807,10 +825,11 @@ const Text = (props) => {
|
|
|
807
825
|
if (props.leftPad) {
|
|
808
826
|
style.paddingLeft = props.leftPad;
|
|
809
827
|
}
|
|
810
|
-
const styles = css.css({
|
|
828
|
+
const styles = css.css(getTagStyles(theme, tagChoice), {
|
|
811
829
|
userSelect: 'text',
|
|
812
|
-
label: 'Text'
|
|
813
|
-
|
|
830
|
+
label: 'Text',
|
|
831
|
+
fontSize: props.fontSize ? props.fontSize : undefined
|
|
832
|
+
}, alignStyles[(_a = props.align) !== null && _a !== void 0 ? _a : 'left'], props.smaller && { fontSize: theme.fonts.sizeSmall }, props.larger && { fontSize: theme.fonts.sizeLarge }, props.italics && { fontStyle: 'italic' }, props.ellipsis && {
|
|
814
833
|
overflow: 'hidden',
|
|
815
834
|
whiteSpace: 'nowrap',
|
|
816
835
|
textOverflow: 'ellipsis'
|
|
@@ -904,7 +923,7 @@ const Autocomplete = (p) => {
|
|
|
904
923
|
label: 'Autocomplete'
|
|
905
924
|
}), 'autocomplete') },
|
|
906
925
|
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 => {
|
|
926
|
+
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
927
|
const value = v;
|
|
909
928
|
p.onChange(value);
|
|
910
929
|
onChangeForOptions.current(value);
|
|
@@ -1646,6 +1665,7 @@ const CopyButton = (props) => {
|
|
|
1646
1665
|
const Divider = (p) => {
|
|
1647
1666
|
const theme = useThemeSafely();
|
|
1648
1667
|
return (React__namespace.createElement("hr", Object.assign({}, p, { className: css.cx("divider", css.css({
|
|
1668
|
+
label: 'Divider',
|
|
1649
1669
|
margin: theme.controls.dividerMargin,
|
|
1650
1670
|
border: theme.controls.dividerBorder
|
|
1651
1671
|
}), p.className) })));
|
|
@@ -2013,7 +2033,7 @@ const Header = (props) => {
|
|
|
2013
2033
|
background-color:transparent;
|
|
2014
2034
|
}
|
|
2015
2035
|
${props.inline && `
|
|
2016
|
-
position:
|
|
2036
|
+
position: relative;
|
|
2017
2037
|
`}
|
|
2018
2038
|
${!!props.rightElements && `
|
|
2019
2039
|
justify-content: space-between;
|
|
@@ -2050,7 +2070,7 @@ const Header = (props) => {
|
|
|
2050
2070
|
justify-content: center;
|
|
2051
2071
|
left: 0;
|
|
2052
2072
|
right: 0;
|
|
2053
|
-
|
|
2073
|
+
bottom: calc(${theme.layout.headerHeight} / 2 * -1);
|
|
2054
2074
|
`;
|
|
2055
2075
|
let title;
|
|
2056
2076
|
if (props.title) {
|
|
@@ -2248,6 +2268,14 @@ const BaseInput = React__namespace.forwardRef((props, ref) => {
|
|
|
2248
2268
|
':focus': {
|
|
2249
2269
|
outline: 'none',
|
|
2250
2270
|
boxShadow: 'none'
|
|
2271
|
+
},
|
|
2272
|
+
// FF fix to hide spinner on number elements
|
|
2273
|
+
appearance: props.type === 'number' ? 'none' : undefined,
|
|
2274
|
+
'::-webkit-outer-spin-button': {
|
|
2275
|
+
appearance: 'none'
|
|
2276
|
+
},
|
|
2277
|
+
'::-webkit-inner-spin-button': {
|
|
2278
|
+
appearance: 'none'
|
|
2251
2279
|
}
|
|
2252
2280
|
}, props.rightControl && {
|
|
2253
2281
|
paddingRight: theme.controls.height
|
|
@@ -2683,38 +2711,41 @@ const TextInput = React__namespace.forwardRef((props, ref) => {
|
|
|
2683
2711
|
|
|
2684
2712
|
const Label = (props) => {
|
|
2685
2713
|
var _a, _b, _c;
|
|
2714
|
+
const labelProps = __rest(props, ["text", "static", "orientation", "align", "noWrap", "subText", "optional", "controlAlign"]);
|
|
2686
2715
|
const theme = useThemeSafely();
|
|
2687
|
-
const
|
|
2688
|
-
const
|
|
2716
|
+
const orientationChoice = (_a = props.orientation) !== null && _a !== void 0 ? _a : 'vertical';
|
|
2717
|
+
const alignChoice = (_b = props.align) !== null && _b !== void 0 ? _b : 'left';
|
|
2689
2718
|
const padding = '0.25rem';
|
|
2690
2719
|
const labelStyles = css.css `
|
|
2720
|
+
label: Label;
|
|
2691
2721
|
${padding};
|
|
2692
2722
|
display: flex;
|
|
2693
|
-
${
|
|
2723
|
+
${orientationChoice === 'vertical' && `
|
|
2694
2724
|
flex-direction: column;
|
|
2695
2725
|
`}
|
|
2696
|
-
${
|
|
2726
|
+
${orientationChoice === 'horizontal' && `
|
|
2697
2727
|
flex-direction: row;
|
|
2698
2728
|
align-items: center;
|
|
2699
2729
|
`}
|
|
2700
|
-
${
|
|
2730
|
+
${orientationChoice === 'horizontalReverse' && `
|
|
2701
2731
|
flex-direction: row-reverse;
|
|
2702
2732
|
align-items: center;
|
|
2703
2733
|
`}
|
|
2704
2734
|
`;
|
|
2705
2735
|
const labelTextStyles = css.css `
|
|
2736
|
+
label: LabelText;
|
|
2706
2737
|
flex-shrink:0;
|
|
2707
|
-
${
|
|
2738
|
+
${orientationChoice === 'vertical' && `
|
|
2708
2739
|
margin-bottom: ${padding};
|
|
2709
2740
|
`}
|
|
2710
|
-
${
|
|
2741
|
+
${orientationChoice === 'horizontal' && `
|
|
2711
2742
|
flex-direction: row;
|
|
2712
2743
|
margin-right:${padding};
|
|
2713
2744
|
${props.static && `
|
|
2714
2745
|
margin-right:0.5rem;
|
|
2715
2746
|
`}
|
|
2716
2747
|
`}
|
|
2717
|
-
${
|
|
2748
|
+
${orientationChoice === 'horizontalReverse' && `
|
|
2718
2749
|
margin-left:${padding};
|
|
2719
2750
|
`}
|
|
2720
2751
|
${(props.subText || props.optional) && `
|
|
@@ -2722,6 +2753,7 @@ const Label = (props) => {
|
|
|
2722
2753
|
`}
|
|
2723
2754
|
`;
|
|
2724
2755
|
const labelContentStyles = css.css `
|
|
2756
|
+
label: LabelContent;
|
|
2725
2757
|
display:inline-block;
|
|
2726
2758
|
width:100%;
|
|
2727
2759
|
${props.controlAlign && `
|
|
@@ -2730,27 +2762,27 @@ const Label = (props) => {
|
|
|
2730
2762
|
`}
|
|
2731
2763
|
`;
|
|
2732
2764
|
const outerClass = props.className;
|
|
2733
|
-
let labelText = React__namespace.createElement(Text, { align:
|
|
2734
|
-
let
|
|
2765
|
+
let labelText = React__namespace.createElement(Text, { align: alignChoice, className: labelTextStyles, tag: "div", bold: true }, props.text);
|
|
2766
|
+
let subTextChoice;
|
|
2735
2767
|
if (props.subText) {
|
|
2736
2768
|
if (typeof props.subText === 'string') {
|
|
2737
|
-
|
|
2769
|
+
subTextChoice = React__namespace.createElement(Text, { tag: "div" }, props.subText);
|
|
2738
2770
|
}
|
|
2739
2771
|
else {
|
|
2740
|
-
|
|
2772
|
+
subTextChoice = props.subText;
|
|
2741
2773
|
}
|
|
2742
2774
|
}
|
|
2743
2775
|
else if (props.optional) {
|
|
2744
|
-
|
|
2776
|
+
subTextChoice = React__namespace.createElement(Text, { tag: "div" },
|
|
2745
2777
|
React__namespace.createElement("em", null, "(optional)"));
|
|
2746
2778
|
}
|
|
2747
|
-
if (
|
|
2779
|
+
if (subTextChoice) {
|
|
2748
2780
|
labelText = React__namespace.createElement("span", { className: css.css({ display: 'flex' }) },
|
|
2749
2781
|
labelText,
|
|
2750
2782
|
React__namespace.createElement("span", { className: css.css({
|
|
2751
2783
|
fontSize: '90%',
|
|
2752
2784
|
marginBottom: padding
|
|
2753
|
-
}) },
|
|
2785
|
+
}) }, subTextChoice));
|
|
2754
2786
|
}
|
|
2755
2787
|
if (props.noWrap) {
|
|
2756
2788
|
return (React__namespace.createElement("span", { className: css.cx(labelStyles, outerClass) },
|
|
@@ -2766,7 +2798,7 @@ const Label = (props) => {
|
|
|
2766
2798
|
// labels without htmlFor can cause focus, hover, and click issues when wrapping other elements.
|
|
2767
2799
|
// this fixes the issues.
|
|
2768
2800
|
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));
|
|
2801
|
+
return (React__namespace.createElement("label", Object.assign({}, labelProps, { htmlFor: htmlFor, className: css.cx('label', labelStyles, outerClass) }), content));
|
|
2770
2802
|
};
|
|
2771
2803
|
|
|
2772
2804
|
/*
|
|
@@ -2893,180 +2925,194 @@ const Nav = (props) => {
|
|
|
2893
2925
|
return (React__namespace.createElement("nav", { ref: nav, className: css.cx('nav', navStyles, props.className) }, props.children));
|
|
2894
2926
|
};
|
|
2895
2927
|
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2928
|
+
const LinkContent = (props) => {
|
|
2929
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2930
|
+
React__namespace.createElement("span", null,
|
|
2931
|
+
props.leftIcon && React__namespace.createElement("span", { className: css.css({
|
|
2932
|
+
label: 'LinkLeftIcon',
|
|
2933
|
+
marginRight: '1rem',
|
|
2934
|
+
display: 'inline-block',
|
|
2935
|
+
minWidth: '1.5rem',
|
|
2936
|
+
verticalAlign: 'middle'
|
|
2937
|
+
}) }, props.leftIcon),
|
|
2938
|
+
props.children),
|
|
2939
|
+
props.rightIcon && React__namespace.createElement("span", { className: css.css({
|
|
2940
|
+
label: 'LinkRightIcon',
|
|
2941
|
+
marginLeft: '1rem',
|
|
2942
|
+
verticalAlign: 'middle'
|
|
2943
|
+
}) }, props.rightIcon)));
|
|
2944
|
+
};
|
|
2945
|
+
|
|
2946
|
+
const generateLinkStyles = (props, theme) => {
|
|
2947
|
+
var _a, _b, _c, _d, _e;
|
|
2900
2948
|
const linkStyles = css.css `
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2949
|
+
label: Link;
|
|
2950
|
+
display: inline-block;
|
|
2951
|
+
cursor: pointer;
|
|
2952
|
+
text-decoration: none;
|
|
2953
|
+
color: ${(_a = props.colorOverride) !== null && _a !== void 0 ? _a : theme.colors.link};
|
|
2954
|
+
transition: ${theme.controls.transition};
|
|
2955
|
+
&:hover {
|
|
2956
|
+
filter: ${theme.controls.hoverBrightness};
|
|
2957
|
+
text-decoration: underline;
|
|
2958
|
+
}
|
|
2959
|
+
&:active,
|
|
2960
|
+
&:visited {
|
|
2961
|
+
color: ${(_b = props.colorOverride) !== null && _b !== void 0 ? _b : theme.colors.link};
|
|
2962
|
+
}
|
|
2963
|
+
&:focus {
|
|
2964
|
+
text-decoration: underline;
|
|
2965
|
+
outline: none;
|
|
2966
|
+
color: ${(_c = props.colorOverride) !== null && _c !== void 0 ? _c : theme.colors.link};
|
|
2967
|
+
}
|
|
2968
|
+
${!!props.variant && `
|
|
2969
|
+
padding-left: ${theme.controls.padding};
|
|
2970
|
+
padding-right: ${theme.controls.padding};
|
|
2971
|
+
border: ${theme.controls.border};
|
|
2972
|
+
border-radius: ${theme.controls.borderRadius};
|
|
2973
|
+
box-shadow: ${theme.controls.buttonBoxShadow};
|
|
2974
|
+
height: ${theme.controls.height};
|
|
2975
|
+
line-height: ${theme.controls.height};
|
|
2976
|
+
font-weight: bold;
|
|
2977
|
+
color: ${(_d = props.colorOverride) !== null && _d !== void 0 ? _d : theme.colors.font};
|
|
2910
2978
|
&:active,
|
|
2979
|
+
&:focus,
|
|
2911
2980
|
&:visited {
|
|
2912
|
-
color: ${(
|
|
2981
|
+
color: ${(_e = props.colorOverride) !== null && _e !== void 0 ? _e : theme.colors.font};
|
|
2913
2982
|
}
|
|
2914
2983
|
&:focus {
|
|
2915
|
-
text-decoration: underline;
|
|
2916
2984
|
outline: none;
|
|
2917
|
-
|
|
2985
|
+
box-shadow: ${theme.controls.focusOutlineShadow};
|
|
2986
|
+
text-decoration: none;
|
|
2918
2987
|
}
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
}
|
|
2939
|
-
&:active {
|
|
2940
|
-
box-shadow: none;
|
|
2941
|
-
}
|
|
2942
|
-
&:hover {
|
|
2943
|
-
text-decoration: none;
|
|
2944
|
-
}
|
|
2945
|
-
`}
|
|
2946
|
-
${props.variant === 'button' && `
|
|
2947
|
-
text-align: center;
|
|
2948
|
-
`}
|
|
2949
|
-
${props.variant === 'circle' && `
|
|
2950
|
-
text-align: center;
|
|
2951
|
-
width: ${theme.controls.height};
|
|
2952
|
-
border-radius: 100%;
|
|
2953
|
-
display: flex;
|
|
2954
|
-
justify-content: center;
|
|
2955
|
-
align-items: center;
|
|
2956
|
-
${props.small && `
|
|
2957
|
-
width: ${theme.controls.heightSmall};
|
|
2958
|
-
min-width: ${theme.controls.heightSmall};
|
|
2959
|
-
`}
|
|
2988
|
+
&:active {
|
|
2989
|
+
box-shadow: none;
|
|
2990
|
+
}
|
|
2991
|
+
&:hover {
|
|
2992
|
+
text-decoration: none;
|
|
2993
|
+
}
|
|
2994
|
+
`}
|
|
2995
|
+
${props.variant === 'button' && `
|
|
2996
|
+
text-align: center;
|
|
2997
|
+
`}
|
|
2998
|
+
${props.variant === 'circle' && `
|
|
2999
|
+
text-align: center;
|
|
3000
|
+
width: ${theme.controls.height};
|
|
3001
|
+
border-radius: 100%;
|
|
3002
|
+
display: flex;
|
|
3003
|
+
justify-content: center;
|
|
3004
|
+
align-items: center;
|
|
3005
|
+
${props.small && `
|
|
3006
|
+
width: ${theme.controls.heightSmall};
|
|
3007
|
+
min-width: ${theme.controls.heightSmall};
|
|
2960
3008
|
`}
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
3009
|
+
`}
|
|
3010
|
+
${props.variant === 'primary' && `
|
|
3011
|
+
text-align: center;
|
|
3012
|
+
background-color: ${theme.colors.primary};
|
|
3013
|
+
color: ${theme.colors.primaryFont};
|
|
3014
|
+
&:active,
|
|
3015
|
+
&:focus,
|
|
3016
|
+
&:visited {
|
|
2964
3017
|
color: ${theme.colors.primaryFont};
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
3018
|
+
}
|
|
3019
|
+
`}
|
|
3020
|
+
${props.variant === 'primary2' && `
|
|
3021
|
+
text-align: center;
|
|
3022
|
+
background-color: ${theme.colors.primary2};
|
|
3023
|
+
color: ${theme.colors.primary2Font};
|
|
3024
|
+
&:active,
|
|
3025
|
+
&:focus,
|
|
3026
|
+
&:visited {
|
|
2974
3027
|
color: ${theme.colors.primary2Font};
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
3028
|
+
}
|
|
3029
|
+
`}
|
|
3030
|
+
${props.variant === 'secondary' && `
|
|
3031
|
+
text-align: center;
|
|
3032
|
+
background-color: ${theme.colors.secondary};
|
|
3033
|
+
color: ${theme.colors.secondary2Font};
|
|
3034
|
+
&:active,
|
|
3035
|
+
&:focus,
|
|
3036
|
+
&:visited {
|
|
2984
3037
|
color: ${theme.colors.secondary2Font};
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
3038
|
+
}
|
|
3039
|
+
`}
|
|
3040
|
+
${props.variant === 'positive' && `
|
|
3041
|
+
text-align: center;
|
|
3042
|
+
background-color: ${theme.colors.positive};
|
|
3043
|
+
color: ${theme.colors.positiveFont};
|
|
3044
|
+
&:active,
|
|
3045
|
+
&:focus,
|
|
3046
|
+
&:visited {
|
|
2994
3047
|
color: ${theme.colors.positiveFont};
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3048
|
+
}
|
|
3049
|
+
`}
|
|
3050
|
+
${props.variant === 'negative' && `
|
|
3051
|
+
text-align: center;
|
|
3052
|
+
background-color: ${theme.colors.negative};
|
|
3053
|
+
color: ${theme.colors.negativeFont};
|
|
3054
|
+
&:active,
|
|
3055
|
+
&:focus,
|
|
3056
|
+
&:visited {
|
|
3004
3057
|
color: ${theme.colors.negativeFont};
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3058
|
+
}
|
|
3059
|
+
`}
|
|
3060
|
+
${props.variant === 'omg' && `
|
|
3061
|
+
text-align: center;
|
|
3062
|
+
background-color: ${theme.colors.omg};
|
|
3063
|
+
color: ${theme.colors.omgFont};
|
|
3064
|
+
&:active,
|
|
3065
|
+
&:focus,
|
|
3066
|
+
&:visited {
|
|
3014
3067
|
color: ${theme.colors.omgFont};
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
${
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3068
|
+
}
|
|
3069
|
+
`}
|
|
3070
|
+
${props.variant === 'label' && `
|
|
3071
|
+
box-shadow: none;
|
|
3072
|
+
border: none;
|
|
3073
|
+
`}
|
|
3074
|
+
${props.variant === 'icon' && `
|
|
3075
|
+
box-shadow: none;
|
|
3076
|
+
border: none;
|
|
3077
|
+
border-radius: 100%;
|
|
3078
|
+
width: ${theme.controls.height};
|
|
3079
|
+
text-align: center;
|
|
3080
|
+
`}
|
|
3081
|
+
${props.block && `
|
|
3082
|
+
display: block;
|
|
3083
|
+
width:100%;
|
|
3084
|
+
`}
|
|
3085
|
+
${props.iconBlock && `
|
|
3086
|
+
display: flex;
|
|
3087
|
+
justify-content: space-between;
|
|
3088
|
+
align-items: center;
|
|
3089
|
+
`}
|
|
3090
|
+
${props.round && `
|
|
3091
|
+
border-radius: ${theme.controls.roundRadius};
|
|
3092
|
+
`}
|
|
3093
|
+
${props.small && `
|
|
3094
|
+
font-size: 0.8rem;
|
|
3095
|
+
height: ${theme.controls.heightSmall};
|
|
3096
|
+
line-height: ${theme.controls.heightSmall};
|
|
3097
|
+
`}
|
|
3098
|
+
`;
|
|
3099
|
+
return linkStyles;
|
|
3100
|
+
};
|
|
3101
|
+
|
|
3102
|
+
const OmniLink = (props) => {
|
|
3103
|
+
const linkProps = __rest(props, ["noRouter", "rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
|
|
3104
|
+
const theme = useThemeSafely();
|
|
3105
|
+
const linkStyles = generateLinkStyles(props, theme);
|
|
3050
3106
|
const mainClassName = css.cx('omniLink', linkStyles, props.className);
|
|
3051
|
-
const content = React__namespace.createElement(
|
|
3052
|
-
React__namespace.createElement("span", null,
|
|
3053
|
-
props.leftIcon && React__namespace.createElement("span", { className: css.css({
|
|
3054
|
-
marginRight: '1rem',
|
|
3055
|
-
display: 'inline-block',
|
|
3056
|
-
minWidth: '1.5rem',
|
|
3057
|
-
verticalAlign: 'middle'
|
|
3058
|
-
}) }, props.leftIcon),
|
|
3059
|
-
props.children),
|
|
3060
|
-
props.rightIcon && React__namespace.createElement("span", { className: css.css({
|
|
3061
|
-
marginLeft: '1rem',
|
|
3062
|
-
verticalAlign: 'middle'
|
|
3063
|
-
}) }, props.rightIcon));
|
|
3107
|
+
const content = React__namespace.createElement(LinkContent, Object.assign({}, props));
|
|
3064
3108
|
if (props.noRouter) {
|
|
3065
|
-
return (React__namespace.createElement("a", {
|
|
3109
|
+
return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }), content));
|
|
3066
3110
|
}
|
|
3067
|
-
return (React__namespace.createElement(reactRouterDom.Link, {
|
|
3111
|
+
return (React__namespace.createElement(reactRouterDom.Link, Object.assign({}, linkProps, { className: mainClassName, to: props.href }), content));
|
|
3068
3112
|
};
|
|
3069
3113
|
|
|
3114
|
+
//TB: test in safari with the new arrow
|
|
3115
|
+
const roundPxPadding = '4px';
|
|
3070
3116
|
const Picker = (props) => {
|
|
3071
3117
|
const selectProps = __rest(props
|
|
3072
3118
|
// if we put numbers in, we expect them out
|
|
@@ -3083,40 +3129,42 @@ const Picker = (props) => {
|
|
|
3083
3129
|
}
|
|
3084
3130
|
}
|
|
3085
3131
|
const theme = useThemeSafely();
|
|
3086
|
-
const selectStyles = css.css
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3132
|
+
const selectStyles = css.css({
|
|
3133
|
+
// fix the arrow so browser all look the same
|
|
3134
|
+
appearance: 'none',
|
|
3135
|
+
paddingLeft: theme.controls.padding,
|
|
3136
|
+
paddingRight: `calc(${theme.controls.padding} + 1rem)`,
|
|
3137
|
+
backgroundColor: theme.colors.bg,
|
|
3138
|
+
color: theme.colors.font,
|
|
3139
|
+
height: theme.controls.height,
|
|
3140
|
+
fontSize: theme.controls.fontSize,
|
|
3141
|
+
width: '100%',
|
|
3142
|
+
border: theme.controls.border,
|
|
3143
|
+
borderRadius: theme.controls.borderRadius || 0,
|
|
3144
|
+
transition: theme.controls.transition,
|
|
3145
|
+
'&:disabled': {
|
|
3146
|
+
color: theme.colors.font,
|
|
3147
|
+
opacity: 1,
|
|
3148
|
+
backgroundColor: theme.colors.disabled,
|
|
3149
|
+
cursor: 'not-allowed'
|
|
3150
|
+
},
|
|
3151
|
+
'&:focus': {
|
|
3152
|
+
outline: 'none',
|
|
3153
|
+
boxShadow: theme.controls.focusOutlineShadow
|
|
3154
|
+
}
|
|
3155
|
+
}, props.round && {
|
|
3156
|
+
borderRadius: theme.controls.roundRadius,
|
|
3157
|
+
paddingLeft: `calc(${theme.controls.padding} + ${roundPxPadding})`,
|
|
3158
|
+
paddingRight: `calc(${theme.controls.padding} + 1rem + ${roundPxPadding})`,
|
|
3159
|
+
}, props.readOnly && {
|
|
3160
|
+
backgroundColor: 'transparent !important',
|
|
3161
|
+
backgroundImage: 'unset',
|
|
3162
|
+
border: 'none',
|
|
3163
|
+
'&:focus': {
|
|
3164
|
+
outline: 'none',
|
|
3165
|
+
boxShadow: 'none'
|
|
3166
|
+
}
|
|
3167
|
+
});
|
|
3120
3168
|
const select = (React__namespace.createElement("select", Object.assign({}, selectProps, { tabIndex: props.readOnly ? -1 : selectProps.tabIndex, className: css.cx('picker', selectStyles, props.className), value: props.value, onKeyDown: e => {
|
|
3121
3169
|
var _a;
|
|
3122
3170
|
if (props.readOnly) {
|
|
@@ -3164,14 +3212,20 @@ const Picker = (props) => {
|
|
|
3164
3212
|
}
|
|
3165
3213
|
return React__namespace.createElement("option", { key: val, value: val }, label);
|
|
3166
3214
|
})));
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3215
|
+
return (React__namespace.createElement("span", { className: css.css({
|
|
3216
|
+
label: 'PickerWrapper',
|
|
3217
|
+
position: 'relative',
|
|
3218
|
+
display: 'inline-block',
|
|
3219
|
+
width: '100%',
|
|
3220
|
+
paddingBottom: props.controlAlign ? theme.controls.inputErrorMinHeight : undefined
|
|
3221
|
+
}) },
|
|
3222
|
+
select,
|
|
3223
|
+
!props.readOnly && (React__namespace.createElement(Icon, { id: "sortDesc", className: css.css({
|
|
3224
|
+
position: 'absolute',
|
|
3225
|
+
right: `calc(${theme.controls.padding} + ${props.round ? roundPxPadding : '0px'})`,
|
|
3226
|
+
height: theme.controls.height,
|
|
3227
|
+
pointerEvents: 'none'
|
|
3228
|
+
}) }))));
|
|
3175
3229
|
};
|
|
3176
3230
|
|
|
3177
3231
|
const Pager = (props) => {
|
|
@@ -3681,10 +3735,10 @@ const SearchBox = (props) => {
|
|
|
3681
3735
|
React__namespace.createElement(Icon, { id: waiting ? 'waiting' : 'search', spin: waiting })));
|
|
3682
3736
|
//TB: FUTURE replace with new inputs
|
|
3683
3737
|
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 })));
|
|
3738
|
+
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
3739
|
};
|
|
3686
3740
|
|
|
3687
|
-
const GlobalStyles = () => {
|
|
3741
|
+
const GlobalStyles = (p) => {
|
|
3688
3742
|
const theme = useThemeSafely();
|
|
3689
3743
|
css.injectGlobal({
|
|
3690
3744
|
'*': {
|
|
@@ -3712,28 +3766,6 @@ const GlobalStyles = () => {
|
|
|
3712
3766
|
return null;
|
|
3713
3767
|
};
|
|
3714
3768
|
|
|
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
3769
|
const Slider = (p) => {
|
|
3738
3770
|
const theme = useThemeSafely();
|
|
3739
3771
|
const currentValue = React.useRef(p.value);
|
|
@@ -3771,7 +3803,7 @@ const Slider = (p) => {
|
|
|
3771
3803
|
backgroundColor: 'white',
|
|
3772
3804
|
border: theme.controls.border,
|
|
3773
3805
|
cursor: 'grab',
|
|
3774
|
-
boxShadow: theme.controls.
|
|
3806
|
+
boxShadow: theme.controls.buttonBoxShadow,
|
|
3775
3807
|
transition: theme.controls.transition,
|
|
3776
3808
|
'&:focus': {
|
|
3777
3809
|
outline: 'none',
|
|
@@ -4102,15 +4134,24 @@ const TextArea = React__namespace.forwardRef((props, ref) => {
|
|
|
4102
4134
|
React__namespace.createElement(InputErrorDisplay, { error: validationError })));
|
|
4103
4135
|
});
|
|
4104
4136
|
|
|
4105
|
-
const ToggleButton = (props) => {
|
|
4106
|
-
|
|
4107
|
-
|
|
4137
|
+
const ToggleButton = React__namespace.forwardRef((props, ref) => {
|
|
4138
|
+
var _a, _b;
|
|
4139
|
+
const buttonProps = __rest(props, ["checked", "checkedText", "uncheckedText", "checkedChildren", "uncheckedChildren", "checkedVariant", "checkedClassName", "checkedStyle", "checkedIcon", "uncheckedIcon"]);
|
|
4140
|
+
let children;
|
|
4141
|
+
if (props.checked) {
|
|
4142
|
+
children = (_a = props.checkedChildren) !== null && _a !== void 0 ? _a : props.checkedText;
|
|
4143
|
+
}
|
|
4144
|
+
else {
|
|
4145
|
+
children = (_b = props.uncheckedChildren) !== null && _b !== void 0 ? _b : props.uncheckedText;
|
|
4146
|
+
}
|
|
4147
|
+
return (React__namespace.createElement(Button, Object.assign({}, buttonProps, { ref: ref, className: css.cx('toggleButton', props.checked && 'toggleButton--checked', props.className, props.checked && props.checkedClassName), rightIcon: props.checked ? props.checkedIcon : props.uncheckedIcon, variant: props.checked ? props.checkedVariant : props.variant, style: props.checked ? props.checkedStyle : props.style }), children));
|
|
4148
|
+
});
|
|
4108
4149
|
|
|
4109
4150
|
const ToggleButtonGroup = (props) => {
|
|
4110
4151
|
const theme = useThemeSafely();
|
|
4111
4152
|
const groupStyles = css.css `
|
|
4112
4153
|
display: flex;
|
|
4113
|
-
box-shadow: ${theme.controls.
|
|
4154
|
+
box-shadow: ${theme.controls.buttonBoxShadow};
|
|
4114
4155
|
border-radius: ${theme.controls.borderRadius};
|
|
4115
4156
|
${props.round && `
|
|
4116
4157
|
border-radius: ${theme.controls.roundRadius};
|
|
@@ -4242,6 +4283,335 @@ const WaitingIndicator = (p) => {
|
|
|
4242
4283
|
React__default['default'].createElement(Icon, { id: "waiting", spin: true }))));
|
|
4243
4284
|
};
|
|
4244
4285
|
|
|
4286
|
+
/*
|
|
4287
|
+
pulled from https://github.com/necolas/normalize.css/blob/master/normalize.css.
|
|
4288
|
+
the IE-specific fixes have been removed.
|
|
4289
|
+
*/
|
|
4290
|
+
/** Resets certain styles so there is more consistancy between browsers. */
|
|
4291
|
+
const NormalizeCss = (p) => {
|
|
4292
|
+
/* tslint:disable:no-unused-expression */
|
|
4293
|
+
css.injectGlobal `
|
|
4294
|
+
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
|
4295
|
+
|
|
4296
|
+
/* Document
|
|
4297
|
+
========================================================================== */
|
|
4298
|
+
|
|
4299
|
+
/**
|
|
4300
|
+
* 1. Correct the line height in all browsers.
|
|
4301
|
+
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
|
4302
|
+
*/
|
|
4303
|
+
|
|
4304
|
+
html {
|
|
4305
|
+
line-height: 1.15; /* 1 */
|
|
4306
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
|
4307
|
+
}
|
|
4308
|
+
|
|
4309
|
+
/* Sections
|
|
4310
|
+
========================================================================== */
|
|
4311
|
+
|
|
4312
|
+
/**
|
|
4313
|
+
* Remove the margin in all browsers.
|
|
4314
|
+
*/
|
|
4315
|
+
|
|
4316
|
+
body {
|
|
4317
|
+
margin: 0;
|
|
4318
|
+
}
|
|
4319
|
+
|
|
4320
|
+
/**
|
|
4321
|
+
* Correct the font size and margin on 'h1' elements within 'section' and
|
|
4322
|
+
* 'article' contexts in Chrome, Firefox, and Safari.
|
|
4323
|
+
*/
|
|
4324
|
+
|
|
4325
|
+
h1 {
|
|
4326
|
+
font-size: 2em;
|
|
4327
|
+
margin: 0.67em 0;
|
|
4328
|
+
}
|
|
4329
|
+
|
|
4330
|
+
/* Grouping content
|
|
4331
|
+
========================================================================== */
|
|
4332
|
+
|
|
4333
|
+
/**
|
|
4334
|
+
* 1. Add the correct box sizing in Firefox.
|
|
4335
|
+
* 2. Show the overflow in Edge and IE.
|
|
4336
|
+
*/
|
|
4337
|
+
|
|
4338
|
+
hr {
|
|
4339
|
+
box-sizing: content-box; /* 1 */
|
|
4340
|
+
height: 0; /* 1 */
|
|
4341
|
+
overflow: visible; /* 2 */
|
|
4342
|
+
}
|
|
4343
|
+
|
|
4344
|
+
/**
|
|
4345
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
4346
|
+
* 2. Correct the odd 'em' font sizing in all browsers.
|
|
4347
|
+
*/
|
|
4348
|
+
|
|
4349
|
+
pre {
|
|
4350
|
+
font-family: monospace, monospace; /* 1 */
|
|
4351
|
+
font-size: 1em; /* 2 */
|
|
4352
|
+
}
|
|
4353
|
+
|
|
4354
|
+
/* Text-level semantics
|
|
4355
|
+
========================================================================== */
|
|
4356
|
+
|
|
4357
|
+
/**
|
|
4358
|
+
* 1. Remove the bottom border in Chrome 57-
|
|
4359
|
+
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
|
4360
|
+
*/
|
|
4361
|
+
|
|
4362
|
+
abbr[title] {
|
|
4363
|
+
border-bottom: none; /* 1 */
|
|
4364
|
+
text-decoration: underline; /* 2 */
|
|
4365
|
+
text-decoration: underline dotted; /* 2 */
|
|
4366
|
+
}
|
|
4367
|
+
|
|
4368
|
+
/**
|
|
4369
|
+
* Add the correct font weight in Chrome, Edge, and Safari.
|
|
4370
|
+
*/
|
|
4371
|
+
|
|
4372
|
+
b,
|
|
4373
|
+
strong {
|
|
4374
|
+
font-weight: bolder;
|
|
4375
|
+
}
|
|
4376
|
+
|
|
4377
|
+
/**
|
|
4378
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
4379
|
+
* 2. Correct the odd 'em' font sizing in all browsers.
|
|
4380
|
+
*/
|
|
4381
|
+
|
|
4382
|
+
code,
|
|
4383
|
+
kbd,
|
|
4384
|
+
samp {
|
|
4385
|
+
font-family: monospace, monospace; /* 1 */
|
|
4386
|
+
font-size: 1em; /* 2 */
|
|
4387
|
+
}
|
|
4388
|
+
|
|
4389
|
+
/**
|
|
4390
|
+
* Add the correct font size in all browsers.
|
|
4391
|
+
*/
|
|
4392
|
+
|
|
4393
|
+
small {
|
|
4394
|
+
font-size: 80%;
|
|
4395
|
+
}
|
|
4396
|
+
|
|
4397
|
+
/**
|
|
4398
|
+
* Prevent 'sub' and 'sup' elements from affecting the line height in
|
|
4399
|
+
* all browsers.
|
|
4400
|
+
*/
|
|
4401
|
+
|
|
4402
|
+
sub,
|
|
4403
|
+
sup {
|
|
4404
|
+
font-size: 75%;
|
|
4405
|
+
line-height: 0;
|
|
4406
|
+
position: relative;
|
|
4407
|
+
vertical-align: baseline;
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
sub {
|
|
4411
|
+
bottom: -0.25em;
|
|
4412
|
+
}
|
|
4413
|
+
|
|
4414
|
+
sup {
|
|
4415
|
+
top: -0.5em;
|
|
4416
|
+
}
|
|
4417
|
+
|
|
4418
|
+
/* Forms
|
|
4419
|
+
========================================================================== */
|
|
4420
|
+
|
|
4421
|
+
/**
|
|
4422
|
+
* 1. Change the font styles in all browsers.
|
|
4423
|
+
* 2. Remove the margin in Firefox and Safari.
|
|
4424
|
+
*/
|
|
4425
|
+
|
|
4426
|
+
button,
|
|
4427
|
+
input,
|
|
4428
|
+
optgroup,
|
|
4429
|
+
select,
|
|
4430
|
+
textarea {
|
|
4431
|
+
font-family: inherit; /* 1 */
|
|
4432
|
+
font-size: 100%; /* 1 */
|
|
4433
|
+
line-height: 1.15; /* 1 */
|
|
4434
|
+
margin: 0; /* 2 */
|
|
4435
|
+
}
|
|
4436
|
+
|
|
4437
|
+
/**
|
|
4438
|
+
* Show the overflow in IE.
|
|
4439
|
+
* 1. Show the overflow in Edge.
|
|
4440
|
+
*/
|
|
4441
|
+
|
|
4442
|
+
button,
|
|
4443
|
+
input { /* 1 */
|
|
4444
|
+
overflow: visible;
|
|
4445
|
+
}
|
|
4446
|
+
|
|
4447
|
+
/**
|
|
4448
|
+
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
4449
|
+
* 1. Remove the inheritance of text transform in Firefox.
|
|
4450
|
+
*/
|
|
4451
|
+
|
|
4452
|
+
button,
|
|
4453
|
+
select { /* 1 */
|
|
4454
|
+
text-transform: none;
|
|
4455
|
+
}
|
|
4456
|
+
|
|
4457
|
+
/**
|
|
4458
|
+
* Correct the inability to style clickable types in iOS and Safari.
|
|
4459
|
+
*/
|
|
4460
|
+
|
|
4461
|
+
button,
|
|
4462
|
+
[type="button"],
|
|
4463
|
+
[type="reset"],
|
|
4464
|
+
[type="submit"] {
|
|
4465
|
+
-webkit-appearance: button;
|
|
4466
|
+
}
|
|
4467
|
+
|
|
4468
|
+
/**
|
|
4469
|
+
* Remove the inner border and padding in Firefox.
|
|
4470
|
+
*/
|
|
4471
|
+
|
|
4472
|
+
button::-moz-focus-inner,
|
|
4473
|
+
[type="button"]::-moz-focus-inner,
|
|
4474
|
+
[type="reset"]::-moz-focus-inner,
|
|
4475
|
+
[type="submit"]::-moz-focus-inner {
|
|
4476
|
+
border-style: none;
|
|
4477
|
+
padding: 0;
|
|
4478
|
+
}
|
|
4479
|
+
|
|
4480
|
+
/**
|
|
4481
|
+
* Restore the focus styles unset by the previous rule.
|
|
4482
|
+
*/
|
|
4483
|
+
|
|
4484
|
+
button:-moz-focusring,
|
|
4485
|
+
[type="button"]:-moz-focusring,
|
|
4486
|
+
[type="reset"]:-moz-focusring,
|
|
4487
|
+
[type="submit"]:-moz-focusring {
|
|
4488
|
+
outline: 1px dotted ButtonText;
|
|
4489
|
+
}
|
|
4490
|
+
|
|
4491
|
+
/**
|
|
4492
|
+
* Correct the padding in Firefox.
|
|
4493
|
+
*/
|
|
4494
|
+
|
|
4495
|
+
fieldset {
|
|
4496
|
+
padding: 0.35em 0.75em 0.625em;
|
|
4497
|
+
}
|
|
4498
|
+
|
|
4499
|
+
/**
|
|
4500
|
+
* 1. Correct the text wrapping in Edge and IE.
|
|
4501
|
+
* 2. Correct the color inheritance from 'fieldset' elements in IE.
|
|
4502
|
+
* 3. Remove the padding so developers are not caught out when they zero out
|
|
4503
|
+
* 'fieldset' elements in all browsers.
|
|
4504
|
+
*/
|
|
4505
|
+
|
|
4506
|
+
legend {
|
|
4507
|
+
box-sizing: border-box; /* 1 */
|
|
4508
|
+
color: inherit; /* 2 */
|
|
4509
|
+
display: table; /* 1 */
|
|
4510
|
+
max-width: 100%; /* 1 */
|
|
4511
|
+
padding: 0; /* 3 */
|
|
4512
|
+
white-space: normal; /* 1 */
|
|
4513
|
+
}
|
|
4514
|
+
|
|
4515
|
+
/**
|
|
4516
|
+
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
4517
|
+
*/
|
|
4518
|
+
|
|
4519
|
+
progress {
|
|
4520
|
+
vertical-align: baseline;
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4523
|
+
|
|
4524
|
+
/**
|
|
4525
|
+
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
4526
|
+
*/
|
|
4527
|
+
|
|
4528
|
+
[type="number"]::-webkit-inner-spin-button,
|
|
4529
|
+
[type="number"]::-webkit-outer-spin-button {
|
|
4530
|
+
height: auto;
|
|
4531
|
+
}
|
|
4532
|
+
|
|
4533
|
+
/**
|
|
4534
|
+
* 1. Correct the odd appearance in Chrome and Safari.
|
|
4535
|
+
* 2. Correct the outline style in Safari.
|
|
4536
|
+
*/
|
|
4537
|
+
|
|
4538
|
+
[type="search"] {
|
|
4539
|
+
-webkit-appearance: textfield; /* 1 */
|
|
4540
|
+
outline-offset: -2px; /* 2 */
|
|
4541
|
+
}
|
|
4542
|
+
|
|
4543
|
+
/**
|
|
4544
|
+
* Remove the inner padding in Chrome and Safari on macOS.
|
|
4545
|
+
*/
|
|
4546
|
+
|
|
4547
|
+
[type="search"]::-webkit-search-decoration {
|
|
4548
|
+
-webkit-appearance: none;
|
|
4549
|
+
}
|
|
4550
|
+
|
|
4551
|
+
/**
|
|
4552
|
+
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
4553
|
+
* 2. Change font properties to 'inherit' in Safari.
|
|
4554
|
+
*/
|
|
4555
|
+
|
|
4556
|
+
::-webkit-file-upload-button {
|
|
4557
|
+
-webkit-appearance: button; /* 1 */
|
|
4558
|
+
font: inherit; /* 2 */
|
|
4559
|
+
}
|
|
4560
|
+
|
|
4561
|
+
/* Interactive
|
|
4562
|
+
========================================================================== */
|
|
4563
|
+
|
|
4564
|
+
/*
|
|
4565
|
+
* Add the correct display in Edge, IE 10+, and Firefox.
|
|
4566
|
+
*/
|
|
4567
|
+
|
|
4568
|
+
details {
|
|
4569
|
+
display: block;
|
|
4570
|
+
}
|
|
4571
|
+
|
|
4572
|
+
/*
|
|
4573
|
+
* Add the correct display in all browsers.
|
|
4574
|
+
*/
|
|
4575
|
+
|
|
4576
|
+
summary {
|
|
4577
|
+
display: list-item;
|
|
4578
|
+
}
|
|
4579
|
+
`;
|
|
4580
|
+
return null;
|
|
4581
|
+
};
|
|
4582
|
+
|
|
4583
|
+
/** Displays the value in American dollars. */
|
|
4584
|
+
const getCurrencyDisplay = (value, isCents, denomination = '$') => {
|
|
4585
|
+
let actualValue = value || 0;
|
|
4586
|
+
if (isCents) {
|
|
4587
|
+
actualValue /= 100;
|
|
4588
|
+
}
|
|
4589
|
+
return `${denomination}${actualValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
4590
|
+
};
|
|
4591
|
+
|
|
4592
|
+
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
4593
|
+
const enumToEntities = (enumObj) => {
|
|
4594
|
+
const entities = [];
|
|
4595
|
+
for (const key in enumObj) {
|
|
4596
|
+
if (isNaN(parseInt(key, 10))) {
|
|
4597
|
+
entities.push({
|
|
4598
|
+
id: enumObj[key],
|
|
4599
|
+
name: key
|
|
4600
|
+
});
|
|
4601
|
+
}
|
|
4602
|
+
}
|
|
4603
|
+
return entities;
|
|
4604
|
+
};
|
|
4605
|
+
|
|
4606
|
+
const Link = (props) => {
|
|
4607
|
+
const linkProps = __rest(props, ["rightIcon", "leftIcon", "block", "iconBlock", "variant", "round", "small", "colorOverride", "children", "ref"]);
|
|
4608
|
+
const theme = useThemeSafely();
|
|
4609
|
+
const linkStyles = generateLinkStyles(props, theme);
|
|
4610
|
+
const mainClassName = css.cx('link', linkStyles, props.className);
|
|
4611
|
+
return (React__namespace.createElement("a", Object.assign({}, linkProps, { target: props.target, className: mainClassName }),
|
|
4612
|
+
React__namespace.createElement(LinkContent, Object.assign({}, props))));
|
|
4613
|
+
};
|
|
4614
|
+
|
|
4245
4615
|
exports.Accordian = Accordian;
|
|
4246
4616
|
exports.Autocomplete = Autocomplete;
|
|
4247
4617
|
exports.Backdrop = Backdrop$1;
|
|
@@ -4271,10 +4641,12 @@ exports.InfoTip = InfoTip;
|
|
|
4271
4641
|
exports.Input = Input;
|
|
4272
4642
|
exports.ItemPager = ItemPager;
|
|
4273
4643
|
exports.Label = Label;
|
|
4644
|
+
exports.Link = Link;
|
|
4274
4645
|
exports.List = List;
|
|
4275
4646
|
exports.ListItem = ListItem;
|
|
4276
4647
|
exports.Modal = Modal;
|
|
4277
4648
|
exports.Nav = Nav;
|
|
4649
|
+
exports.NormalizeCss = NormalizeCss;
|
|
4278
4650
|
exports.NumberInput = NumberInput;
|
|
4279
4651
|
exports.OmniLink = OmniLink;
|
|
4280
4652
|
exports.PagedResult = PagedResult;
|