braid-design-system 32.12.4 → 32.12.5

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
  # braid-design-system
2
2
 
3
+ ## 32.12.5
4
+
5
+ ### Patch Changes
6
+
7
+ - The Braid Provider contains some code to check that it's running in a browser context (otherwise a BraidTestProvider should be used). ([#1382](https://github.com/seek-oss/braid-design-system/pull/1382))
8
+
9
+ Part of this check was looking to see if there was a `navigator` object, which was not available in Node.
10
+ If there were, it would check the `userAgent` to determine if it was inside jsdom.
11
+
12
+ Node 21 has a `navigator` object, but it doesn't have a `userAgent` property, so this check was failing (cannot read property 'indexOf' of undefined).
13
+
14
+ The "are we in JSDom" check in the BraidProvider has now been reworked slightly to account for the potentially existing but empty `navigator` object.
15
+
3
16
  ## 32.12.4
4
17
 
5
18
  ### Patch Changes
@@ -125,7 +125,7 @@ const BraidProvider = ({
125
125
  const linkComponentFromContext = React.useContext(LinkComponentContext);
126
126
  useHideFocusRings(!(alreadyInBraidProvider || inTestProvider));
127
127
  assert__default.default(
128
- typeof navigator !== "object" || navigator.userAgent.indexOf("jsdom") === -1 || inTestProvider,
128
+ inTestProvider || typeof navigator === "undefined" || navigator.userAgent === void 0 || navigator.userAgent.indexOf("jsdom") === -1,
129
129
  `Rendering 'BraidProvider' in Jest is not supported as it expects a browser environment. Please switch to 'BraidTestProvider'. See the docs for more info: https://seek-oss.github.io/braid-design-system/components/BraidTestProvider`
130
130
  );
131
131
  return /* @__PURE__ */ jsxRuntime.jsxs(BraidThemeContext.Provider, { value: theme, children: [
@@ -121,7 +121,7 @@ const BraidProvider = ({
121
121
  const linkComponentFromContext = useContext(LinkComponentContext);
122
122
  useHideFocusRings(!(alreadyInBraidProvider || inTestProvider));
123
123
  assert(
124
- typeof navigator !== "object" || navigator.userAgent.indexOf("jsdom") === -1 || inTestProvider,
124
+ inTestProvider || typeof navigator === "undefined" || navigator.userAgent === void 0 || navigator.userAgent.indexOf("jsdom") === -1,
125
125
  `Rendering 'BraidProvider' in Jest is not supported as it expects a browser environment. Please switch to 'BraidTestProvider'. See the docs for more info: https://seek-oss.github.io/braid-design-system/components/BraidTestProvider`
126
126
  );
127
127
  return /* @__PURE__ */ jsxs(BraidThemeContext.Provider, { value: theme, children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-design-system",
3
- "version": "32.12.4",
3
+ "version": "32.12.5",
4
4
  "description": "Themeable design system for the SEEK Group",
5
5
  "homepage": "https://seek-oss.github.io/braid-design-system/",
6
6
  "bugs": {