braid-design-system 32.12.3 → 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,27 @@
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
+
16
+ ## 32.12.4
17
+
18
+ ### Patch Changes
19
+
20
+ - **TextLink, TextLinkButton:** Ensure consistent underline thickness on weak links ([#1380](https://github.com/seek-oss/braid-design-system/pull/1380))
21
+
22
+ A subtle bug affecting weak links was resulting in a change in underline thickness on hover.
23
+ This bug has been fixed such that weak links now always have the same underline thickness regardless of hover state.
24
+
3
25
  ## 32.12.3
4
26
 
5
27
  ### 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: [
@@ -20,16 +20,17 @@ const weakLinkVars = css.assignVars(textLinkVars, {
20
20
  color: "inherit",
21
21
  colorHover: "inherit"
22
22
  });
23
+ const textDecorationThickness = "0.08em";
23
24
  const base = css.style({
24
25
  color: textLinkVars.color,
25
26
  textDecoration: styles_lib_themes_vars_css_cjs.vars.linkDecoration,
26
- textDecorationThickness: "0.08em",
27
+ textDecorationThickness,
27
28
  textUnderlineOffset: 3,
28
29
  ":hover": {
29
30
  color: textLinkVars.colorHover,
30
31
  textDecoration: "underline",
31
32
  /*
32
- Duplicating the thickness rule due to inconsistent support
33
+ Duplicating the thickness property due to inconsistent support
33
34
  for shorthand properties of `text-decoration`. Without this,
34
35
  applying the above decoration rule resets the thickness in
35
36
  browsers that do support shorthands.
@@ -37,7 +38,7 @@ const base = css.style({
37
38
  We also cannot use the long-form `text-decoration-line` due
38
39
  to browser support policy of Edge 16+.
39
40
  */
40
- textDecorationThickness: "0.08em"
41
+ textDecorationThickness
41
42
  },
42
43
  ":focus-visible": {
43
44
  color: textLinkVars.colorHover,
@@ -48,7 +49,15 @@ const base = css.style({
48
49
  }, "base");
49
50
  const weakLink = css.style({
50
51
  vars: weakLinkVars,
51
- textDecoration: "underline"
52
+ textDecoration: "underline",
53
+ /*
54
+ Duplicating the thickness property again as the `textDecoration`
55
+ property above overrides the `textDecorationThickness` property
56
+ in the `base` style due to CSS rule ordering. Without this property,
57
+ weak links were receiving `auto` thickness instead of the desired
58
+ value.
59
+ */
60
+ textDecorationThickness
52
61
  }, "weakLink");
53
62
  const regularLinkLightMode = css.styleVariants({
54
63
  light: {
@@ -19,16 +19,17 @@ const weakLinkVars = assignVars(textLinkVars, {
19
19
  color: "inherit",
20
20
  colorHover: "inherit"
21
21
  });
22
+ const textDecorationThickness = "0.08em";
22
23
  const base = style({
23
24
  color: textLinkVars.color,
24
25
  textDecoration: vars.linkDecoration,
25
- textDecorationThickness: "0.08em",
26
+ textDecorationThickness,
26
27
  textUnderlineOffset: 3,
27
28
  ":hover": {
28
29
  color: textLinkVars.colorHover,
29
30
  textDecoration: "underline",
30
31
  /*
31
- Duplicating the thickness rule due to inconsistent support
32
+ Duplicating the thickness property due to inconsistent support
32
33
  for shorthand properties of `text-decoration`. Without this,
33
34
  applying the above decoration rule resets the thickness in
34
35
  browsers that do support shorthands.
@@ -36,7 +37,7 @@ const base = style({
36
37
  We also cannot use the long-form `text-decoration-line` due
37
38
  to browser support policy of Edge 16+.
38
39
  */
39
- textDecorationThickness: "0.08em"
40
+ textDecorationThickness
40
41
  },
41
42
  ":focus-visible": {
42
43
  color: textLinkVars.colorHover,
@@ -47,7 +48,15 @@ const base = style({
47
48
  }, "base");
48
49
  const weakLink = style({
49
50
  vars: weakLinkVars,
50
- textDecoration: "underline"
51
+ textDecoration: "underline",
52
+ /*
53
+ Duplicating the thickness property again as the `textDecoration`
54
+ property above overrides the `textDecorationThickness` property
55
+ in the `base` style due to CSS rule ordering. Without this property,
56
+ weak links were receiving `auto` thickness instead of the desired
57
+ value.
58
+ */
59
+ textDecorationThickness
51
60
  }, "weakLink");
52
61
  const regularLinkLightMode = styleVariants({
53
62
  light: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-design-system",
3
- "version": "32.12.3",
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": {