@sproutsocial/racine 23.1.0 → 23.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Change Log
2
2
 
3
+ ## 23.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e3834c0: Support for negative number abbreviation in the Numeral component
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [72c52c8]
12
+ - Updated dependencies [9612ff1]
13
+ - @sproutsocial/seeds-icons@1.13.0
14
+ - @sproutsocial/seeds-react-theme@1.6.0
15
+
3
16
  ## 23.1.0
4
17
 
5
18
  ### Minor Changes
@@ -70,7 +70,7 @@ var _getNumberFormatters = function _getNumberFormatters(options) {
70
70
  var memoizer = (0, _lruMemoize.default)(_constants2.MEMO_CACHE_SIZE, _constants2.COMPARE_OBJECTS);
71
71
  var getNumberFormatters = memoizer(_getNumberFormatters);
72
72
  var getThreshold = function getThreshold(abbreviate) {
73
- if (typeof abbreviate === "number") return Math.max(1000, abbreviate);
73
+ if (typeof abbreviate === "number") return Math.max(1000, Math.abs(abbreviate));
74
74
  if (abbreviate) return _constants2.DEFAULT_THRESHOLD;
75
75
  return Infinity;
76
76
  };
@@ -103,7 +103,7 @@ var normalizeArgs = function normalizeArgs(props) {
103
103
  max = _getMinMaxPrecision2[1];
104
104
  var _number = number || 0;
105
105
  var value = _number * (format === "percent" ? 0.01 : 1);
106
- var canAbbreviate = _number >= threshold;
106
+ var canAbbreviate = Math.abs(_number) >= threshold;
107
107
  var options = {
108
108
  locale: locale,
109
109
  format: format,
@@ -1 +1 @@
1
- {"version":3,"file":"Numeral.d.ts","sourceRoot":"","sources":["../../../src/Numeral/Numeral.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,KAAK,EAAqB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAqL1E,eAAO,MAAM,aAAa,UAAW,gBAAgB,KAAG,MAEvD,CAAC;AAEF,QAAA,MAAM,OAAO,UAAW,gBAAgB,oBAEvC,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Numeral.d.ts","sourceRoot":"","sources":["../../../src/Numeral/Numeral.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,KAAK,EAAqB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAsL1E,eAAO,MAAM,aAAa,UAAW,gBAAgB,KAAG,MAEvD,CAAC;AAEF,QAAA,MAAM,OAAO,UAAW,gBAAgB,oBAEvC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -63,7 +63,7 @@ var _getNumberFormatters = function _getNumberFormatters(options) {
63
63
  var memoizer = memoize(MEMO_CACHE_SIZE, COMPARE_OBJECTS);
64
64
  var getNumberFormatters = memoizer(_getNumberFormatters);
65
65
  var getThreshold = function getThreshold(abbreviate) {
66
- if (typeof abbreviate === "number") return Math.max(1000, abbreviate);
66
+ if (typeof abbreviate === "number") return Math.max(1000, Math.abs(abbreviate));
67
67
  if (abbreviate) return DEFAULT_THRESHOLD;
68
68
  return Infinity;
69
69
  };
@@ -96,7 +96,7 @@ var normalizeArgs = function normalizeArgs(props) {
96
96
  max = _getMinMaxPrecision2[1];
97
97
  var _number = number || 0;
98
98
  var value = _number * (format === "percent" ? 0.01 : 1);
99
- var canAbbreviate = _number >= threshold;
99
+ var canAbbreviate = Math.abs(_number) >= threshold;
100
100
  var options = {
101
101
  locale: locale,
102
102
  format: format,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "23.1.0",
3
+ "version": "23.2.0",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": ">=18"