@mackin.com/styleguide 7.4.1 → 7.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +12 -2
- package/index.js +27 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -133,6 +133,7 @@ interface PagerStyleProps {
|
|
|
133
133
|
noResultsText?: string;
|
|
134
134
|
/** Used for localizations. Defaults to 'Page' */
|
|
135
135
|
pageText?: string;
|
|
136
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
136
137
|
rounded?: boolean;
|
|
137
138
|
className?: string;
|
|
138
139
|
leftControls?: JSX.Element;
|
|
@@ -182,7 +183,7 @@ interface ButtonProps {
|
|
|
182
183
|
block?: boolean;
|
|
183
184
|
/** As round as can be. */
|
|
184
185
|
round?: boolean;
|
|
185
|
-
/**
|
|
186
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
186
187
|
rounded?: boolean;
|
|
187
188
|
className?: string;
|
|
188
189
|
rightIcon?: JSX.Element;
|
|
@@ -309,6 +310,8 @@ declare const InfoPanel: (props: {
|
|
|
309
310
|
variant?: 'info' | 'warning' | 'error' | 'negative' | 'positive';
|
|
310
311
|
className?: string;
|
|
311
312
|
style?: React.CSSProperties;
|
|
313
|
+
/** Defaults to 'p'. */
|
|
314
|
+
tag?: 'p' | 'div';
|
|
312
315
|
}) => JSX.Element;
|
|
313
316
|
|
|
314
317
|
interface InfoTipProps {
|
|
@@ -455,7 +458,7 @@ interface OmniLinkProps {
|
|
|
455
458
|
title?: string;
|
|
456
459
|
/** Only for button variants. */
|
|
457
460
|
round?: boolean;
|
|
458
|
-
/** Only for button variants. */
|
|
461
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. Only for button variants. */
|
|
459
462
|
rounded?: boolean;
|
|
460
463
|
/** Only for button variants. */
|
|
461
464
|
small?: boolean;
|
|
@@ -474,6 +477,7 @@ interface PickerProps<T extends PickerValue> {
|
|
|
474
477
|
})[];
|
|
475
478
|
onChange: (value: T) => void;
|
|
476
479
|
id?: string;
|
|
480
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
477
481
|
rounded?: boolean;
|
|
478
482
|
disabled?: boolean;
|
|
479
483
|
className?: string;
|
|
@@ -500,6 +504,7 @@ interface SearchBoxProps {
|
|
|
500
504
|
id?: string;
|
|
501
505
|
placeholder?: string;
|
|
502
506
|
round?: boolean;
|
|
507
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
503
508
|
rounded?: boolean;
|
|
504
509
|
className?: string;
|
|
505
510
|
onSubmit?: () => Promise<void>;
|
|
@@ -622,6 +627,7 @@ interface DatePickerProps {
|
|
|
622
627
|
required?: boolean;
|
|
623
628
|
/** Defaults to 250ms */
|
|
624
629
|
debounceMs?: number;
|
|
630
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
625
631
|
rounded?: boolean;
|
|
626
632
|
round?: boolean;
|
|
627
633
|
/** This is the ms from Date.valueOf(). */
|
|
@@ -639,6 +645,7 @@ interface TabHeaderTabProps {
|
|
|
639
645
|
interface TabHeaderProps {
|
|
640
646
|
tabs: TabHeaderTabProps[];
|
|
641
647
|
id?: string;
|
|
648
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
642
649
|
rounded?: boolean;
|
|
643
650
|
/** Defaults to 10rem. */
|
|
644
651
|
maxTabWidth?: string;
|
|
@@ -702,6 +709,7 @@ interface MackinTheme {
|
|
|
702
709
|
fontSize: string;
|
|
703
710
|
borderWidth: string;
|
|
704
711
|
border: string;
|
|
712
|
+
borderRadius: string;
|
|
705
713
|
height: string;
|
|
706
714
|
heightSmall: string;
|
|
707
715
|
boxShadow: string;
|
|
@@ -712,6 +720,7 @@ interface MackinTheme {
|
|
|
712
720
|
focusOutlineShadow: string;
|
|
713
721
|
focusOutlineRequiredShadow: string;
|
|
714
722
|
roundRadius: string;
|
|
723
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
715
724
|
roundedRadius: string;
|
|
716
725
|
disabledOpacity: string;
|
|
717
726
|
formButtonMinWidth: string;
|
|
@@ -919,6 +928,7 @@ declare type AutocompleteValue = string | AutoCompleteItem;
|
|
|
919
928
|
interface AutocompleteProps {
|
|
920
929
|
value: AutocompleteValue | undefined;
|
|
921
930
|
round?: boolean;
|
|
931
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
922
932
|
rounded?: boolean;
|
|
923
933
|
rightControl?: JSX.Element;
|
|
924
934
|
placeholder?: string;
|
package/index.js
CHANGED
|
@@ -116,6 +116,7 @@ const defaultTheme = {
|
|
|
116
116
|
padding: '0.5rem',
|
|
117
117
|
fontSize: '1rem',
|
|
118
118
|
borderWidth: '1px',
|
|
119
|
+
borderRadius: '',
|
|
119
120
|
border: ``,
|
|
120
121
|
height: '44px',
|
|
121
122
|
heightSmall: '34px',
|
|
@@ -127,6 +128,7 @@ const defaultTheme = {
|
|
|
127
128
|
focusOutlineShadow: '',
|
|
128
129
|
focusOutlineRequiredShadow: '',
|
|
129
130
|
roundRadius: '3rem',
|
|
131
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
130
132
|
roundedRadius: '0.5rem',
|
|
131
133
|
disabledOpacity: '0.5',
|
|
132
134
|
formButtonMinWidth: '7rem',
|
|
@@ -303,6 +305,7 @@ const Button = (props) => {
|
|
|
303
305
|
padding-right: ${theme.controls.padding};
|
|
304
306
|
background-color: white;
|
|
305
307
|
border: ${theme.controls.border};
|
|
308
|
+
border-radius: ${theme.controls.borderRadius};
|
|
306
309
|
cursor: pointer;
|
|
307
310
|
box-shadow: ${theme.controls.boxShadow};
|
|
308
311
|
color: ${theme.colors.font};
|
|
@@ -697,6 +700,7 @@ const Picker = (props) => {
|
|
|
697
700
|
font-size: ${theme.controls.fontSize};
|
|
698
701
|
width: 100%;
|
|
699
702
|
border: ${theme.controls.border};
|
|
703
|
+
border-radius: ${theme.controls.borderRadius};
|
|
700
704
|
transition: ${theme.controls.transition};
|
|
701
705
|
&:disabled {
|
|
702
706
|
color: ${theme.colors.font};
|
|
@@ -785,6 +789,7 @@ const Pager = (props) => {
|
|
|
785
789
|
grid-template-columns: ${theme.controls.height} 1fr ${theme.controls.height};
|
|
786
790
|
grid-column-gap: ${theme.controls.gap};
|
|
787
791
|
border: ${theme.controls.border};
|
|
792
|
+
border-radius: ${theme.controls.borderRadius};
|
|
788
793
|
padding: 0.5rem;
|
|
789
794
|
background-color: ${theme.colors.pagerBg};
|
|
790
795
|
@media(min-width: ${theme.breakpoints.tablet}) {
|
|
@@ -1788,7 +1793,7 @@ const InfoPanel = (props) => {
|
|
|
1788
1793
|
color:${theme.colors.positiveFont};
|
|
1789
1794
|
`}
|
|
1790
1795
|
`;
|
|
1791
|
-
return (React__namespace.createElement(Text, { style: props.style, align: "center", className: css.cx('infoPanel', styles, props.className) }, props.children));
|
|
1796
|
+
return (React__namespace.createElement(Text, { tag: props.tag || 'p', style: props.style, align: "center", className: css.cx('infoPanel', styles, props.className) }, props.children));
|
|
1792
1797
|
};
|
|
1793
1798
|
|
|
1794
1799
|
const Popover = (p) => {
|
|
@@ -1798,13 +1803,14 @@ const Popover = (p) => {
|
|
|
1798
1803
|
return (React__namespace.createElement(reactTinyPopover.Popover, { containerClassName: css.css({
|
|
1799
1804
|
zIndex: theme.zIndexes.tooltip
|
|
1800
1805
|
}), reposition: resposition, isOpen: p.isOpen, positions: (_b = p.positions) !== null && _b !== void 0 ? _b : ['right', 'top', 'left', 'bottom'], onClickOutside: p.onClickOutside, content: ({ position, childRect, popoverRect }) => {
|
|
1801
|
-
var _a, _b, _c;
|
|
1806
|
+
var _a, _b, _c, _d;
|
|
1802
1807
|
return (React__namespace.createElement(reactTinyPopover.ArrowContainer, { position: position, childRect: childRect, popoverRect: popoverRect, arrowColor: (_a = p.arrorColor) !== null && _a !== void 0 ? _a : theme.colors.border, arrowSize: 10 },
|
|
1803
1808
|
React__namespace.createElement(TabLocker, null,
|
|
1804
1809
|
React__namespace.createElement("div", { className: css.css({
|
|
1805
1810
|
border: (_b = p.border) !== null && _b !== void 0 ? _b : theme.controls.border,
|
|
1811
|
+
borderRadius: (_c = p.border) !== null && _c !== void 0 ? _c : theme.controls.borderRadius,
|
|
1806
1812
|
boxShadow: theme.controls.boxShadow,
|
|
1807
|
-
backgroundColor: (
|
|
1813
|
+
backgroundColor: (_d = p.backgroundColor) !== null && _d !== void 0 ? _d : theme.colors.bg,
|
|
1808
1814
|
}) }, p.content))));
|
|
1809
1815
|
} },
|
|
1810
1816
|
React__namespace.createElement("span", null, p.parent)));
|
|
@@ -1935,6 +1941,7 @@ const Input = React__namespace.forwardRef((props, ref) => {
|
|
|
1935
1941
|
fontSize: theme.fonts.size,
|
|
1936
1942
|
width: '100%',
|
|
1937
1943
|
border: theme.controls.border,
|
|
1944
|
+
borderRadius: theme.controls.borderRadius,
|
|
1938
1945
|
color: theme.colors.font,
|
|
1939
1946
|
paddingLeft: theme.controls.padding,
|
|
1940
1947
|
paddingRight: theme.controls.padding,
|
|
@@ -2282,6 +2289,7 @@ const OmniLink = (props) => {
|
|
|
2282
2289
|
padding-left: ${theme.controls.padding};
|
|
2283
2290
|
padding-right: ${theme.controls.padding};
|
|
2284
2291
|
border: ${theme.controls.border};
|
|
2292
|
+
border-radius: ${theme.controls.borderRadius};
|
|
2285
2293
|
box-shadow: ${theme.controls.boxShadow};
|
|
2286
2294
|
height: ${theme.controls.height};
|
|
2287
2295
|
line-height: ${theme.controls.height};
|
|
@@ -2521,6 +2529,7 @@ const ToggleButtonGroup = (props) => {
|
|
|
2521
2529
|
const groupStyles = css.css `
|
|
2522
2530
|
display: flex;
|
|
2523
2531
|
box-shadow: ${theme.controls.boxShadow};
|
|
2532
|
+
border-radius: ${theme.controls.borderRadius};
|
|
2524
2533
|
${props.round && `
|
|
2525
2534
|
border-radius: ${theme.controls.roundRadius};
|
|
2526
2535
|
`}
|
|
@@ -2531,6 +2540,15 @@ const ToggleButtonGroup = (props) => {
|
|
|
2531
2540
|
&:nth-of-type(1n+2){
|
|
2532
2541
|
margin-left: -1px;
|
|
2533
2542
|
}
|
|
2543
|
+
border-radius: 0;
|
|
2544
|
+
&:first-of-type{
|
|
2545
|
+
border-top-left-radius: ${theme.controls.borderRadius};
|
|
2546
|
+
border-bottom-left-radius: ${theme.controls.borderRadius};
|
|
2547
|
+
}
|
|
2548
|
+
&:last-child {
|
|
2549
|
+
border-top-right-radius: ${theme.controls.borderRadius};
|
|
2550
|
+
border-bottom-right-radius: ${theme.controls.borderRadius};
|
|
2551
|
+
}
|
|
2534
2552
|
${props.round && `
|
|
2535
2553
|
&:first-of-type{
|
|
2536
2554
|
border-top-left-radius: ${theme.controls.roundRadius};
|
|
@@ -2770,7 +2788,7 @@ const DatePicker = (p) => {
|
|
|
2770
2788
|
} }))), content: (React__namespace.createElement("div", { ref: popover, className: css.css({
|
|
2771
2789
|
paddingLeft: '1rem',
|
|
2772
2790
|
paddingRight: '1rem',
|
|
2773
|
-
paddingBottom: '1rem'
|
|
2791
|
+
paddingBottom: '1rem'
|
|
2774
2792
|
}) },
|
|
2775
2793
|
React__namespace.createElement(Calendar, { onClick: date => {
|
|
2776
2794
|
p.onChange(date.valueOf());
|
|
@@ -2822,12 +2840,15 @@ const TabHeader = (p) => {
|
|
|
2822
2840
|
zIndex: 1,
|
|
2823
2841
|
}, active && {
|
|
2824
2842
|
border: theme.controls.border,
|
|
2843
|
+
borderRadius: theme.controls.borderRadius,
|
|
2844
|
+
borderBottomLeftRadius: 0,
|
|
2845
|
+
borderBottomRightRadius: 0,
|
|
2825
2846
|
borderBottom: 'none',
|
|
2826
2847
|
zIndex: 3,
|
|
2827
2848
|
}, active && p.rounded && {
|
|
2828
2849
|
borderRadius: p.rounded && theme.controls.roundedRadius,
|
|
2829
2850
|
borderBottomLeftRadius: 0,
|
|
2830
|
-
borderBottomRightRadius: 0
|
|
2851
|
+
borderBottomRightRadius: 0,
|
|
2831
2852
|
});
|
|
2832
2853
|
buttonVariant = 'link';
|
|
2833
2854
|
buttonStyles = css.css({
|
|
@@ -3402,6 +3423,7 @@ const Autocomplete = (p) => {
|
|
|
3402
3423
|
position: absolute;
|
|
3403
3424
|
width: 100%;
|
|
3404
3425
|
border: ${theme.controls.border};
|
|
3426
|
+
border-radius: ${theme.controls.borderRadius};
|
|
3405
3427
|
box-shadow: ${theme.controls.boxShadow};
|
|
3406
3428
|
background-color: ${theme.colors.bg};
|
|
3407
3429
|
margin-top: -4px !important;
|