@autoguru/overdrive 4.9.3 → 4.9.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../lib/components/Stepper/Stepper.tsx"],"names":[],"mappings":"AAIA,OAAO,EACN,iBAAiB,EAIjB,MAAM,OAAO,CAAC;AASf,MAAM,WAAW,KAAK;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/B,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAiDD,eAAO,MAAM,OAAO,EAAE,iBAAiB,CAAC,KAAK,CA6H5C,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../lib/components/Stepper/Stepper.tsx"],"names":[],"mappings":"AAIA,OAAO,EACN,iBAAiB,EAIjB,MAAM,OAAO,CAAC;AAUf,MAAM,WAAW,KAAK;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/B,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAiDD,eAAO,MAAM,OAAO,EAAE,iBAAiB,CAAC,KAAK,CA6H5C,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -3,6 +3,7 @@ import { clamp } from '@autoguru/utilities';
3
3
  import clsx from 'clsx';
4
4
  import * as React from 'react';
5
5
  import { useCallback, } from 'react';
6
+ import { addWithSafeDecimal } from '../../utils/number';
6
7
  import { Box, useBoxStyles } from '../Box';
7
8
  import { Column, Columns } from '../Columns';
8
9
  import { Icon } from '../Icon';
@@ -10,7 +11,7 @@ import { Text, useTextStyles } from '../Text';
10
11
  import * as styles from './Stepper.css';
11
12
  const takeStep = ({ min, max, value, step, direction }) => {
12
13
  const directionChange = (direction === 'DOWN' ? -1 : 1) * step;
13
- return clamp(value + directionChange, min, max);
14
+ return clamp(addWithSafeDecimal(value, directionChange), min, max);
14
15
  };
15
16
  const Handle = ({ disabled, icon, label, onClick, }) => (React.createElement(Box, { is: "button", className: [
16
17
  styles.handle.default,
@@ -3,4 +3,5 @@ export declare const bigNumFormatter: (num: number) => {
3
3
  descriptor: string;
4
4
  };
5
5
  export declare const toPrettyBigNumber: (number: number, fractionDigits?: number) => string;
6
+ export declare const addWithSafeDecimal: (a: number, b: number) => number;
6
7
  //# sourceMappingURL=number.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../lib/utils/number.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,QACtB,MAAM,KACT;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAoBrC,CAAC;AAEF,eAAO,MAAM,iBAAiB,WACrB,MAAM,8BAEZ,MAMF,CAAC"}
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../lib/utils/number.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,QACtB,MAAM,KACT;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAoBrC,CAAC;AAEF,eAAO,MAAM,iBAAiB,WACrB,MAAM,8BAEZ,MAMF,CAAC;AAEF,eAAO,MAAM,kBAAkB,MAAO,MAAM,KAAK,MAAM,KAAG,MAC9B,CAAC"}
@@ -23,3 +23,4 @@ export const toPrettyBigNumber = (number, fractionDigits = 1) => {
23
23
  : formatChunks.value.toFixed(fractionDigits);
24
24
  return `${value}${formatChunks.descriptor}`;
25
25
  };
26
+ export const addWithSafeDecimal = (a, b) => Number((a + b).toFixed(12));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.9.3",
3
+ "version": "4.9.4",
4
4
  "description": "Overdrive is a product component library, and design system for AutoGuru.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",