@mackin.com/styleguide 9.3.1 → 9.3.3

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.
Files changed (2) hide show
  1. package/index.js +11 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1434,7 +1434,7 @@ const Calendar = (p) => {
1434
1434
  };
1435
1435
 
1436
1436
  const Checkbox = (props) => {
1437
- const inputProps = __rest(props, ["checked", "onChange", "label", "checkedIcon", "uncheckedIcon", "checkedThemeColor", "checkedColor", "readOnly"]);
1437
+ const inputProps = __rest(props, ["onChange", "label", "checkedIcon", "uncheckedIcon", "checkedThemeColor", "checkedColor", "readOnly"]);
1438
1438
  const selected = props.checkedIcon || 'selected';
1439
1439
  const unselected = props.uncheckedIcon || 'unselected';
1440
1440
  const theme = useThemeSafely();
@@ -3697,10 +3697,19 @@ const GlobalStyles = (p) => {
3697
3697
  const Slider = (p) => {
3698
3698
  var _a;
3699
3699
  const theme = useThemeSafely();
3700
- const currentValue = React.useRef(p.value);
3701
3700
  const sliderContainer = React.useRef(null);
3702
3701
  const sliderHandleSize = (_a = p.sliderHandleSize) !== null && _a !== void 0 ? _a : theme.controls.height;
3703
3702
  const height = p.showValue ? `calc(${sliderHandleSize} + 1.5rem)` : sliderHandleSize;
3703
+ // we're keeping this value in a ref vs. state so the constant updates don't cause re-render.
3704
+ // we will have to respond to outside value changes after the fact however...
3705
+ const currentValue = React.useRef(p.value);
3706
+ const [, forceUpdate] = React.useState(Date.now());
3707
+ React.useEffect(() => {
3708
+ if (p.value !== currentValue.current) {
3709
+ currentValue.current = p.value;
3710
+ forceUpdate(Date.now());
3711
+ }
3712
+ }, [p.value]);
3704
3713
  return (React__default['default'].createElement("div", { ref: sliderContainer, className: css.cx(css.css({
3705
3714
  label: 'Slider',
3706
3715
  width: '100%',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mackin.com/styleguide",
3
- "version": "9.3.1",
3
+ "version": "9.3.3",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",