@mackin.com/styleguide 10.1.5 → 10.2.1
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 +13 -6
- package/index.esm.js +19 -7
- package/index.js +19 -7
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -667,17 +667,22 @@ interface PopoverProps {
|
|
|
667
667
|
declare const Popover: (p: PopoverProps) => React.JSX.Element;
|
|
668
668
|
|
|
669
669
|
interface ProgressBarProps {
|
|
670
|
+
/** The value in whole pct - 55 NOT 0.55. */
|
|
670
671
|
pct: number;
|
|
672
|
+
/** If `true`, the bar will be rounded at the corners. */
|
|
671
673
|
round?: boolean;
|
|
674
|
+
/** If `true`, the current percent will be shown as a label. */
|
|
672
675
|
showPct?: boolean;
|
|
676
|
+
/** Where to place the pct label from `showPct`. Defaults to `bottom`. Ignored if `showPct` is false. */
|
|
677
|
+
showPctPosition?: 'bottom' | 'right';
|
|
678
|
+
/** This will be applied to the bar. */
|
|
673
679
|
className?: string;
|
|
680
|
+
/** This will be applied to the bar fill. Override this to change the transitions or remove them. */
|
|
681
|
+
barFillClassName?: string;
|
|
682
|
+
/** Applied to the percent label element. Ignored if `showPct` is false. */
|
|
683
|
+
pctLabelClassName?: string;
|
|
674
684
|
}
|
|
675
|
-
declare const ProgressBar: (props:
|
|
676
|
-
pct: number;
|
|
677
|
-
round?: boolean;
|
|
678
|
-
showPct?: boolean;
|
|
679
|
-
className?: string;
|
|
680
|
-
}) => React.JSX.Element;
|
|
685
|
+
declare const ProgressBar: (props: ProgressBarProps) => React.JSX.Element;
|
|
681
686
|
|
|
682
687
|
type BaseProps$1 = Omit<TextInputProps, 'rightControl' | 'wrapperClassName' | 'type' | 'className'> & InputOnFocusProps;
|
|
683
688
|
interface SearchBoxProps extends BaseProps$1 {
|
|
@@ -858,6 +863,8 @@ interface SliderProps<T extends SliderValue> {
|
|
|
858
863
|
innerTrackClassName?: string;
|
|
859
864
|
/** Styles applied to the floating handle text with using 'showValue'. */
|
|
860
865
|
sliderTextClassName?: string;
|
|
866
|
+
/** Styles applied to the floating handle text with using 'showValue'. */
|
|
867
|
+
ariaLabel?: (T extends number ? string : readonly string[] | undefined) | undefined;
|
|
861
868
|
}
|
|
862
869
|
declare const Slider: <T extends SliderValue>(p: SliderProps<T>) => React__default.JSX.Element;
|
|
863
870
|
|
package/index.esm.js
CHANGED
|
@@ -1743,7 +1743,7 @@ const Modal = (p) => {
|
|
|
1743
1743
|
color: theme.colors.headerFont,
|
|
1744
1744
|
marginLeft: '1rem',
|
|
1745
1745
|
backgroundColor: 'transparent'
|
|
1746
|
-
})), variant: "icon", onClick: p.onClick },
|
|
1746
|
+
})), "aria-label": "Close", variant: "icon", onClick: p.onClick },
|
|
1747
1747
|
React__default.createElement(Icon, { id: "close" })) : React__default.createElement("span", null))),
|
|
1748
1748
|
p.children)))), backdropContainer);
|
|
1749
1749
|
}
|
|
@@ -3665,6 +3665,7 @@ class ItemPager {
|
|
|
3665
3665
|
}
|
|
3666
3666
|
|
|
3667
3667
|
const ProgressBar = (props) => {
|
|
3668
|
+
var _a;
|
|
3668
3669
|
const bar = React.useRef(null);
|
|
3669
3670
|
React.useEffect(() => {
|
|
3670
3671
|
const pct = cleanPct(props.pct);
|
|
@@ -3690,12 +3691,23 @@ const ProgressBar = (props) => {
|
|
|
3690
3691
|
border-radius: 1rem;
|
|
3691
3692
|
`}
|
|
3692
3693
|
`;
|
|
3693
|
-
|
|
3694
|
+
const showPctPosition = (_a = props.showPctPosition) !== null && _a !== void 0 ? _a : 'bottom';
|
|
3695
|
+
const wrapStyles = css({
|
|
3696
|
+
label: 'ProgressBar',
|
|
3697
|
+
display: 'flex',
|
|
3698
|
+
flexDirection: showPctPosition === 'bottom' ? 'column' : 'row',
|
|
3699
|
+
alignItems: showPctPosition === 'right' ? 'center' : undefined,
|
|
3700
|
+
gap: showPctPosition === 'right' ? '0.5rem' : undefined,
|
|
3701
|
+
});
|
|
3702
|
+
const pctLabelStyles = (props.showPct && props.showPctPosition === 'right') ? css({
|
|
3703
|
+
width: '3rem'
|
|
3704
|
+
}) : undefined;
|
|
3705
|
+
return (React.createElement("div", { className: cx(wrapStyles, "progressBar") },
|
|
3694
3706
|
React.createElement("div", { className: cx(barStyles, props.className) },
|
|
3695
|
-
React.createElement("div", { ref: bar, className: fillStyles })),
|
|
3696
|
-
props.showPct && React.createElement(Text, { align: "center", tag: "div", spacedOut: true },
|
|
3697
|
-
props.pct,
|
|
3698
|
-
"
|
|
3707
|
+
React.createElement("div", { ref: bar, className: cx(fillStyles, props.barFillClassName) })),
|
|
3708
|
+
props.showPct && (React.createElement(Text, { align: "center", tag: "div", spacedOut: true, className: cx(pctLabelStyles, props.pctLabelClassName) },
|
|
3709
|
+
cleanPct(props.pct),
|
|
3710
|
+
"%"))));
|
|
3699
3711
|
};
|
|
3700
3712
|
const cleanPct = (value) => {
|
|
3701
3713
|
if (value) {
|
|
@@ -3850,7 +3862,7 @@ const Slider = (p) => {
|
|
|
3850
3862
|
width: '100%',
|
|
3851
3863
|
height,
|
|
3852
3864
|
}), p.className) },
|
|
3853
|
-
React__default.createElement(ReactSlider, { step: p.step, min: p.min, max: p.max, value: p.value, onAfterChange: (value) => {
|
|
3865
|
+
React__default.createElement(ReactSlider, { ariaLabel: p.ariaLabel, step: p.step, min: p.min, max: p.max, value: p.value, onAfterChange: (value) => {
|
|
3854
3866
|
p.onChange(value);
|
|
3855
3867
|
}, onChange: p.onUpdate || p.showValue ? (value) => {
|
|
3856
3868
|
var _a;
|
package/index.js
CHANGED
|
@@ -1761,7 +1761,7 @@ const Modal = (p) => {
|
|
|
1761
1761
|
color: theme.colors.headerFont,
|
|
1762
1762
|
marginLeft: '1rem',
|
|
1763
1763
|
backgroundColor: 'transparent'
|
|
1764
|
-
})), variant: "icon", onClick: p.onClick },
|
|
1764
|
+
})), "aria-label": "Close", variant: "icon", onClick: p.onClick },
|
|
1765
1765
|
React.createElement(Icon, { id: "close" })) : React.createElement("span", null))),
|
|
1766
1766
|
p.children)))), backdropContainer);
|
|
1767
1767
|
}
|
|
@@ -3683,6 +3683,7 @@ class ItemPager {
|
|
|
3683
3683
|
}
|
|
3684
3684
|
|
|
3685
3685
|
const ProgressBar = (props) => {
|
|
3686
|
+
var _a;
|
|
3686
3687
|
const bar = React__namespace.useRef(null);
|
|
3687
3688
|
React__namespace.useEffect(() => {
|
|
3688
3689
|
const pct = cleanPct(props.pct);
|
|
@@ -3708,12 +3709,23 @@ const ProgressBar = (props) => {
|
|
|
3708
3709
|
border-radius: 1rem;
|
|
3709
3710
|
`}
|
|
3710
3711
|
`;
|
|
3711
|
-
|
|
3712
|
+
const showPctPosition = (_a = props.showPctPosition) !== null && _a !== void 0 ? _a : 'bottom';
|
|
3713
|
+
const wrapStyles = css.css({
|
|
3714
|
+
label: 'ProgressBar',
|
|
3715
|
+
display: 'flex',
|
|
3716
|
+
flexDirection: showPctPosition === 'bottom' ? 'column' : 'row',
|
|
3717
|
+
alignItems: showPctPosition === 'right' ? 'center' : undefined,
|
|
3718
|
+
gap: showPctPosition === 'right' ? '0.5rem' : undefined,
|
|
3719
|
+
});
|
|
3720
|
+
const pctLabelStyles = (props.showPct && props.showPctPosition === 'right') ? css.css({
|
|
3721
|
+
width: '3rem'
|
|
3722
|
+
}) : undefined;
|
|
3723
|
+
return (React__namespace.createElement("div", { className: css.cx(wrapStyles, "progressBar") },
|
|
3712
3724
|
React__namespace.createElement("div", { className: css.cx(barStyles, props.className) },
|
|
3713
|
-
React__namespace.createElement("div", { ref: bar, className: fillStyles })),
|
|
3714
|
-
props.showPct && React__namespace.createElement(Text, { align: "center", tag: "div", spacedOut: true },
|
|
3715
|
-
props.pct,
|
|
3716
|
-
"
|
|
3725
|
+
React__namespace.createElement("div", { ref: bar, className: css.cx(fillStyles, props.barFillClassName) })),
|
|
3726
|
+
props.showPct && (React__namespace.createElement(Text, { align: "center", tag: "div", spacedOut: true, className: css.cx(pctLabelStyles, props.pctLabelClassName) },
|
|
3727
|
+
cleanPct(props.pct),
|
|
3728
|
+
"%"))));
|
|
3717
3729
|
};
|
|
3718
3730
|
const cleanPct = (value) => {
|
|
3719
3731
|
if (value) {
|
|
@@ -3868,7 +3880,7 @@ const Slider = (p) => {
|
|
|
3868
3880
|
width: '100%',
|
|
3869
3881
|
height,
|
|
3870
3882
|
}), p.className) },
|
|
3871
|
-
React.createElement(ReactSlider, { step: p.step, min: p.min, max: p.max, value: p.value, onAfterChange: (value) => {
|
|
3883
|
+
React.createElement(ReactSlider, { ariaLabel: p.ariaLabel, step: p.step, min: p.min, max: p.max, value: p.value, onAfterChange: (value) => {
|
|
3872
3884
|
p.onChange(value);
|
|
3873
3885
|
}, onChange: p.onUpdate || p.showValue ? (value) => {
|
|
3874
3886
|
var _a;
|