@xh/hoist 67.0.0-SNAPSHOT.1725049253748 → 67.0.0-SNAPSHOT.1725050289733

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
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## 67.0.0-SNAPSHOT - unreleased
4
4
 
5
+ ### 💥 Breaking Changes
6
+
7
+ * Requires `hoist-core >= 21.0`.
8
+
5
9
  ### 🎁 New Features
6
10
 
7
11
  * Added support for Correlation IDs across fetch requests and error / activity tracking:
@@ -33,9 +37,9 @@
33
37
  * Fixed bug where a role with a dot in its name could not be deleted.
34
38
  * Fixed `SelectEditor` to ensure new value is flushed before editing stops.
35
39
 
36
- ### 💥 Breaking Changes
40
+ ### Styles
37
41
 
38
- * Requires `hoist-core >= 21.0`.
42
+ * Added CSS variables to support customization of `Badge` component styling.
39
43
 
40
44
  ### ⚙️ Technical
41
45
 
@@ -10,16 +10,16 @@
10
10
  justify-content: center;
11
11
  align-items: center;
12
12
  align-self: center;
13
- font-size: 0.75em;
13
+ font-size: var(--xh-badge-font-size);
14
14
  font-weight: bold;
15
- border-radius: 4px;
15
+ border-radius: var(--xh-badge-border-radius);
16
16
  margin-left: 5px;
17
- padding: 0 4px;
18
- height: 1.6em;
17
+ padding: var(--xh-badge-padding);
18
+ height: var(--xh-badge-height);
19
19
  width: fit-content;
20
- min-width: 15px;
21
- background-color: var(--xh-blue-gray);
22
- color: white;
20
+ min-width: var(--xh-badge-min-width);
21
+ background-color: var(--xh-badge-bg);
22
+ color: var(--xh-badge-text-color);
23
23
 
24
24
  &--compact {
25
25
  font-size: 0.5em;
@@ -13,7 +13,8 @@ import {
13
13
  isInteger,
14
14
  isNil,
15
15
  isNumber,
16
- isString
16
+ isString,
17
+ round
17
18
  } from 'lodash';
18
19
  import Numbro from 'numbro';
19
20
  import numbro from 'numbro';
@@ -498,14 +499,11 @@ function buildFormatConfig(
498
499
 
499
500
  // Calculate numbro mantissa and trimMantissa options based on precision and zeroPad settings.
500
501
  if (isNumber(zeroPad)) {
501
- // Specific zeroPad set - need to read actual precision of number to determine exact
502
- // mantissa, as we cannot use trimMantissa (since we do want to allow some trailing zeroes).
503
- const actualPrecision = countDecimalPlaces(absVal);
504
-
505
- // How much precision do we actually want/need? Lower of actual vs. precision set above.
506
- // Ensures we respect a deliberately low precision spec, but otherwise include only as
507
- // much precision as we need to show the value.
508
- const requiredPrecision = Math.min(actualPrecision, precision);
502
+ // Specific zeroPad set - we want to show at least this much precision, but not more unless
503
+ // the value actually has more precision. Note, we round to requested *max* precision first,
504
+ // then determine the value's actual precision. This avoids issues where values resulting
505
+ // from floating point operations have spurious precision that would defeat this routine.
506
+ const requiredPrecision = countDecimalPlaces(round(absVal, precision));
509
507
 
510
508
  // Then set mantissa to higher of required precision vs. requested zeroPad.
511
509
  // Ensures we display all of the requested/available precision + extra zeros if needed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "67.0.0-SNAPSHOT.1725049253748",
3
+ "version": "67.0.0-SNAPSHOT.1725050289733",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
package/styles/vars.scss CHANGED
@@ -254,6 +254,16 @@ body {
254
254
  --xh-bg-highlight: var(--bg-highlight, hsl(200, 50%, 27%));
255
255
  }
256
256
 
257
+ //-----------------------------------------
258
+ // Badges
259
+ //-----------------------------------------
260
+ --xh-badge-bg: var(--badge-bg, var(--xh-blue-gray));
261
+ --xh-badge-border-radius: var(--badge-border-radius, var(--xh-border-radius-px));
262
+ --xh-badge-font-size: var(--badge-font-size, 0.75em);
263
+ --xh-badge-height: var(--badge-height, 1.6em);
264
+ --xh-badge-min-width: var(--badge-min-width, 15px);
265
+ --xh-badge-padding: var(--badge-padding, #{0 4px});
266
+ --xh-badge-text-color: var(--badge-text-color, white);
257
267
 
258
268
  //------------------------
259
269
  // Borders