carbon-react 142.12.0 → 142.13.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.
Files changed (111) hide show
  1. package/esm/__internal__/character-count/character-count.style.js +1 -1
  2. package/esm/__internal__/fieldset/fieldset.style.js +2 -2
  3. package/esm/__internal__/label/label.style.js +2 -2
  4. package/esm/__internal__/validation-message/validation-message.style.js +1 -1
  5. package/esm/components/accordion/accordion.style.js +2 -2
  6. package/esm/components/action-popover/action-popover.style.js +1 -1
  7. package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
  8. package/esm/components/badge/badge.style.js +1 -1
  9. package/esm/components/button/button.style.js +1 -1
  10. package/esm/components/button-toggle/button-toggle.style.js +1 -1
  11. package/esm/components/card/card-footer/card-footer.style.js +1 -1
  12. package/esm/components/content/content.style.js +1 -1
  13. package/esm/components/date/__internal__/date-picker/day-picker.style.js +1 -1
  14. package/esm/components/definition-list/dd/dd.component.js +1 -0
  15. package/esm/components/definition-list/definition-list.style.js +1 -1
  16. package/esm/components/definition-list/dl.component.js +1 -0
  17. package/esm/components/definition-list/dt/dt.component.js +1 -0
  18. package/esm/components/duelling-picklist/duelling-picklist.style.js +1 -1
  19. package/esm/components/fieldset/fieldset.style.js +2 -2
  20. package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
  21. package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
  22. package/esm/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
  23. package/esm/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
  24. package/esm/components/form/__internal__/form-summary.style.js +1 -1
  25. package/esm/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
  26. package/esm/components/link-preview/link-preview.style.js +1 -1
  27. package/esm/components/loader-spinner/loader-spinner.component.js +1 -1
  28. package/esm/components/loader-star/loader-star.component.js +1 -1
  29. package/esm/components/menu/menu-item/menu-item.style.js +2 -2
  30. package/esm/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
  31. package/esm/components/note/note.style.js +2 -2
  32. package/esm/components/pill/pill.style.js +1 -1
  33. package/esm/components/pod/pod.style.js +1 -1
  34. package/esm/components/popover-container/popover-container.component.js +19 -26
  35. package/esm/components/popover-container/popover-container.style.js +34 -30
  36. package/esm/components/portrait/portrait.style.js +1 -1
  37. package/esm/components/profile/profile.style.js +1 -1
  38. package/esm/components/progress-tracker/progress-tracker.style.js +1 -1
  39. package/esm/components/search/search.style.js +2 -2
  40. package/esm/components/select/__internal__/select-list/select-list.style.js +1 -1
  41. package/esm/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  42. package/esm/components/select/__internal__/utils/matching-text.style.js +1 -1
  43. package/esm/components/select/option-row/option-row.style.js +1 -1
  44. package/esm/components/step-flow/step-flow-title/step-flow-title.component.js +1 -1
  45. package/esm/components/step-flow/step-flow.component.js +1 -1
  46. package/esm/components/switch/__internal__/switch-slider.style.js +1 -1
  47. package/esm/components/tabs/__internal__/tab-title/tab-title.style.js +1 -1
  48. package/esm/components/text-editor/__internal__/editor-link/editor-link.style.js +1 -1
  49. package/esm/components/textbox/__internal__/prefix.style.js +1 -1
  50. package/esm/components/tile-select/tile-select.style.js +2 -2
  51. package/esm/components/time/time.style.js +1 -1
  52. package/esm/components/typography/typography.style.js +2 -2
  53. package/esm/components/vertical-menu/vertical-menu.style.js +2 -2
  54. package/esm/style/fonts.css +2 -2
  55. package/esm/style/global-style.js +6 -6
  56. package/lib/__internal__/character-count/character-count.style.js +1 -1
  57. package/lib/__internal__/fieldset/fieldset.style.js +2 -2
  58. package/lib/__internal__/label/label.style.js +2 -2
  59. package/lib/__internal__/validation-message/validation-message.style.js +1 -1
  60. package/lib/components/accordion/accordion.style.js +2 -2
  61. package/lib/components/action-popover/action-popover.style.js +1 -1
  62. package/lib/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
  63. package/lib/components/badge/badge.style.js +1 -1
  64. package/lib/components/button/button.style.js +1 -1
  65. package/lib/components/button-toggle/button-toggle.style.js +1 -1
  66. package/lib/components/card/card-footer/card-footer.style.js +1 -1
  67. package/lib/components/content/content.style.js +1 -1
  68. package/lib/components/date/__internal__/date-picker/day-picker.style.js +1 -1
  69. package/lib/components/definition-list/dd/dd.component.js +1 -0
  70. package/lib/components/definition-list/definition-list.style.js +1 -1
  71. package/lib/components/definition-list/dl.component.js +1 -0
  72. package/lib/components/definition-list/dt/dt.component.js +1 -0
  73. package/lib/components/duelling-picklist/duelling-picklist.style.js +1 -1
  74. package/lib/components/fieldset/fieldset.style.js +2 -2
  75. package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
  76. package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
  77. package/lib/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
  78. package/lib/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
  79. package/lib/components/form/__internal__/form-summary.style.js +1 -1
  80. package/lib/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
  81. package/lib/components/link-preview/link-preview.style.js +1 -1
  82. package/lib/components/loader-spinner/loader-spinner.component.js +1 -1
  83. package/lib/components/loader-star/loader-star.component.js +1 -1
  84. package/lib/components/menu/menu-item/menu-item.style.js +2 -2
  85. package/lib/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
  86. package/lib/components/note/note.style.js +2 -2
  87. package/lib/components/pill/pill.style.js +1 -1
  88. package/lib/components/pod/pod.style.js +1 -1
  89. package/lib/components/popover-container/popover-container.component.js +18 -25
  90. package/lib/components/popover-container/popover-container.style.js +36 -30
  91. package/lib/components/portrait/portrait.style.js +1 -1
  92. package/lib/components/profile/profile.style.js +1 -1
  93. package/lib/components/progress-tracker/progress-tracker.style.js +1 -1
  94. package/lib/components/search/search.style.js +2 -2
  95. package/lib/components/select/__internal__/select-list/select-list.style.js +1 -1
  96. package/lib/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  97. package/lib/components/select/__internal__/utils/matching-text.style.js +1 -1
  98. package/lib/components/select/option-row/option-row.style.js +1 -1
  99. package/lib/components/step-flow/step-flow-title/step-flow-title.component.js +1 -1
  100. package/lib/components/step-flow/step-flow.component.js +1 -1
  101. package/lib/components/switch/__internal__/switch-slider.style.js +1 -1
  102. package/lib/components/tabs/__internal__/tab-title/tab-title.style.js +1 -1
  103. package/lib/components/text-editor/__internal__/editor-link/editor-link.style.js +1 -1
  104. package/lib/components/textbox/__internal__/prefix.style.js +1 -1
  105. package/lib/components/tile-select/tile-select.style.js +2 -2
  106. package/lib/components/time/time.style.js +1 -1
  107. package/lib/components/typography/typography.style.js +2 -2
  108. package/lib/components/vertical-menu/vertical-menu.style.js +2 -2
  109. package/lib/style/fonts.css +2 -2
  110. package/lib/style/global-style.js +6 -6
  111. package/package.json +1 -1
@@ -14,7 +14,7 @@ const StyledCharacterCount = styled.div`
14
14
  ${({
15
15
  isOverLimit
16
16
  }) => isOverLimit && css`
17
- font-weight: var(--fontWeights700);
17
+ font-weight: var(--fontWeights500);
18
18
  `}
19
19
  `;
20
20
  const VisuallyHiddenCharacterCount = styled.div`
@@ -26,7 +26,7 @@ const StyledLegendContent = styled.span`
26
26
  content: "*";
27
27
  line-height: 24px;
28
28
  color: var(--colorsSemanticNegative500);
29
- font-weight: var(--fontWeights700);
29
+ font-weight: var(--fontWeights500);
30
30
  margin-left: var(--spacing050);
31
31
  position: relative;
32
32
  top: 1px;
@@ -58,7 +58,7 @@ const StyledLegend = styled.legend`
58
58
  align-items: center;
59
59
  margin-bottom: var(--spacing100);
60
60
  padding: 0;
61
- font-weight: var(--fontWeights700);
61
+ font-weight: var(--fontWeights500);
62
62
  color: var(--colorsUtilityYin090);
63
63
  ${({
64
64
  inline,
@@ -2,7 +2,7 @@ import styled, { css } from "styled-components";
2
2
  const StyledLabel = styled.label`
3
3
  color: var(--colorsUtilityYin090);
4
4
  display: block;
5
- font-weight: var(--fontWeights700);
5
+ font-weight: var(--fontWeights500);
6
6
 
7
7
  ${({
8
8
  isRequired
@@ -10,7 +10,7 @@ const StyledLabel = styled.label`
10
10
  ::after {
11
11
  content: "*";
12
12
  color: var(--colorsSemanticNegative500);
13
- font-weight: var(--fontWeights700);
13
+ font-weight: var(--fontWeights500);
14
14
  margin-left: var(--spacing050);
15
15
  }
16
16
  `}
@@ -4,7 +4,7 @@ const StyledValidationMessage = styled.p`
4
4
  isWarning
5
5
  }) => css`
6
6
  color: ${isWarning ? "var(--colorsSemanticCaution600)" : "var(--colorsSemanticNegative500)"};
7
- font-weight: ${isWarning ? "normal" : "bold"};
7
+ font-weight: ${isWarning ? "normal" : "500"};
8
8
  margin-top: 0px;
9
9
  margin-bottom: 8px;
10
10
  `}
@@ -53,7 +53,7 @@ const StyledAccordionTitle = styled.h3`
53
53
  size,
54
54
  variant
55
55
  }) => size === "small" || variant === "subtle" ? "var(--fontSizes200)" : "var(--fontSizes400)"};
56
- font-weight: 700;
56
+ font-weight: 500;
57
57
  line-height: 1;
58
58
  user-select: none;
59
59
  margin: 0;
@@ -161,7 +161,7 @@ const StyledAccordionTitleContainer = styled.div`
161
161
 
162
162
  ${buttonHeading && css`
163
163
  box-sizing: border-box;
164
- font-weight: 600;
164
+ font-weight: 500;
165
165
  text-decoration: none;
166
166
  font-size: var(--fontSizes100);
167
167
  min-height: var(--spacing500);
@@ -116,7 +116,7 @@ const StyledMenuItem = styled.button`
116
116
  width: 100%;
117
117
  color: var(--colorsUtilityYin090);
118
118
  font-size: 14px;
119
- font-weight: 700;
119
+ font-weight: 500;
120
120
 
121
121
  &:focus {
122
122
  ${({
@@ -13,7 +13,7 @@ const StyledNavigationItem = styled.li`
13
13
  color: var(--colorsUtilityYin090);
14
14
  background-color: transparent;
15
15
  border-left: var(--sizing050) solid var(--colorsActionMinor100);
16
- font-weight: 700;
16
+ font-weight: 500;
17
17
  padding: 12px 24px;
18
18
  border-top-right-radius: var(--borderRadius100);
19
19
  border-bottom-right-radius: var(--borderRadius100);
@@ -19,7 +19,7 @@ const StyledBadgeWrapper = styled.div`
19
19
  display: inline-block;
20
20
  `;
21
21
  const StyledCounter = styled.div`
22
- font-weight: 700;
22
+ font-weight: 500;
23
23
  font-size: 12px;
24
24
  margin-top: -1px;
25
25
  `;
@@ -70,7 +70,7 @@ const StyledButton = styled.button`
70
70
  outline-offset: 0;
71
71
  border: 2px solid transparent;
72
72
  box-sizing: border-box;
73
- font-weight: 600;
73
+ font-weight: 500;
74
74
  text-decoration: none;
75
75
  border-radius: var(--borderRadius400);
76
76
 
@@ -46,7 +46,7 @@ const StyledButtonToggle = styled.button`
46
46
  box-sizing: border-box;
47
47
  max-width: 100%;
48
48
 
49
- font-weight: 700;
49
+ font-weight: 500;
50
50
  background-color: transparent;
51
51
  cursor: pointer;
52
52
  text-align: center;
@@ -24,7 +24,7 @@ const StyledCardFooter = styled.div`
24
24
  border-top-width: 1px;
25
25
  border-top-style: solid;
26
26
  font-size: 14px;
27
- font-weight: 700;
27
+ font-weight: 500;
28
28
  margin: ${marginSizes[spacing]};
29
29
  display: flex;
30
30
  ${roundness === "default" && css`
@@ -32,7 +32,7 @@ const StyledContentTitle = styled.div`
32
32
  }) => {
33
33
  return css`
34
34
  display: ${inline ? "inline-block" : "block"};
35
- font-weight: bold;
35
+ font-weight: 500;
36
36
  width: ${titleWidth && `calc(${titleWidth}% - 30px)`};
37
37
  text-align: ${!inline && align};
38
38
 
@@ -263,7 +263,7 @@ const StyledDayPicker = styled.div`
263
263
  border: none;
264
264
  //font-family: var(--fontFamiliesDefault); font assets to be updated part of FE-4975
265
265
  //font: var(--typographyDatePickerCalendarDateM); font assets to be updated part of FE-4975
266
- font-weight: var(--fontWeights700);
266
+ font-weight: var(--fontWeights500);
267
267
  font-size: var(--fontSizes100);
268
268
  line-height: var(--lineHeights500);
269
269
  border-radius: var(--borderRadius400);
@@ -16,6 +16,7 @@ const Dd = ({
16
16
  } = useContext(DlContext);
17
17
  return /*#__PURE__*/React.createElement(StyledDd, _extends({
18
18
  "data-element": "dd",
19
+ "data-role": "dd",
19
20
  asSingleColumn: asSingleColumn,
20
21
  ddTextAlign: ddTextAlign,
21
22
  mb: mb || 2
@@ -29,7 +29,7 @@ StyledDl.defaultProps = {
29
29
  export const StyledDt = styled.dt`
30
30
  ${space}
31
31
  font-size: var(--fontSizes100);
32
- font-weight: 700;
32
+ font-weight: 500;
33
33
  color: var(--colorsUtilityYin090);
34
34
  ${({
35
35
  asSingleColumn
@@ -14,6 +14,7 @@ const Dl = ({
14
14
  return /*#__PURE__*/React.createElement(StyledDl, _extends({
15
15
  w: w,
16
16
  "data-component": "dl",
17
+ "data-role": "dl",
17
18
  asSingleColumn: asSingleColumn
18
19
  }, rest), /*#__PURE__*/React.createElement(DlContext.Provider, {
19
20
  value: {
@@ -17,6 +17,7 @@ const Dt = ({
17
17
  } = rest;
18
18
  return /*#__PURE__*/React.createElement(StyledDt, _extends({
19
19
  "data-element": "dt",
20
+ "data-role": "dt",
20
21
  mb: mb || asSingleColumn ? undefined : 2,
21
22
  pr: pr || asSingleColumn ? undefined : 3,
22
23
  dtTextAlign: dtTextAlign,
@@ -27,7 +27,7 @@ const StyledLabelContainer = styled.div`
27
27
  margin-bottom: 16px;
28
28
  `;
29
29
  const StyledLabel = styled.p`
30
- font-weight: bold;
30
+ font-weight: 500;
31
31
  font-size: 12px;
32
32
  letter-spacing: 1;
33
33
  margin: 0;
@@ -27,7 +27,7 @@ const StyledLegend = styled.legend`
27
27
  align-items: center;
28
28
  margin-bottom: 32px;
29
29
  font-size: 20px;
30
- font-weight: var(--fontWeights700);
30
+ font-weight: var(--fontWeights500);
31
31
  color: var(--colorsUtilityYin090);
32
32
  line-height: 24px;
33
33
  margin-right: 4px;
@@ -39,7 +39,7 @@ const StyledLegend = styled.legend`
39
39
  content: "*";
40
40
  line-height: 24px;
41
41
  color: var(--colorsSemanticNegative500);
42
- font-weight: var(--fontWeights700);
42
+ font-weight: var(--fontWeights500);
43
43
  margin-left: var(--spacing100);
44
44
  position: relative;
45
45
  top: 1px;
@@ -71,7 +71,7 @@ export const StyledFileUploadStatus = styled.div`
71
71
  border: var(--${borderWidthToken}) solid var(--${colorToken});
72
72
  ${hasError && `&& ${StyledTypography} {
73
73
  color: var(--${colorToken});
74
- font-weight: 500;
74
+ font-weight: 400;
75
75
  }`}
76
76
  `;
77
77
  }}
@@ -32,7 +32,7 @@ const StyledFlatTableCheckbox = styled.td`
32
32
  border-width: 0;
33
33
  border-bottom: 1px solid var(--colorsUtilityMajor100);
34
34
  box-sizing: border-box;
35
- font-weight: 700;
35
+ font-weight: 500;
36
36
  left: auto;
37
37
  padding: 0;
38
38
  text-align: left;
@@ -9,7 +9,7 @@ const StyledFlatTableHead = styled.thead`
9
9
  border-right: none;
10
10
  }
11
11
  ${StyledFlatTableRowHeader}, ${StyledFlatTableCheckbox} {
12
- font-weight: 700;
12
+ font-weight: 500;
13
13
  }
14
14
  }
15
15
  `;
@@ -24,7 +24,7 @@ const StyledFlatTableHeader = styled.th`
24
24
  background-color: transparent;
25
25
  border-width: 0;
26
26
  box-sizing: border-box;
27
- font-weight: 700;
27
+ font-weight: 500;
28
28
  left: auto;
29
29
  text-align: ${align};
30
30
  user-select: none;
@@ -5,7 +5,7 @@ export const StyledFormSummary = styled.div`
5
5
  display: inline-flex;
6
6
  align-items: center;
7
7
  font-size: 13px;
8
- font-weight: 700;
8
+ font-weight: 500;
9
9
  margin: -8px;
10
10
  padding: 8px;
11
11
  white-space: nowrap;
@@ -10,7 +10,7 @@ const StyledIndicatorContainer = styled(Box)`
10
10
  ::after {
11
11
  content: "*";
12
12
  color: var(--colorsSemanticNegative500);
13
- font-weight: 700;
13
+ font-weight: 500;
14
14
  margin-left: var(--spacing050);
15
15
  }
16
16
  `;
@@ -65,7 +65,7 @@ const StyledPreviewWrapper = styled.div`
65
65
  const StyledTitle = styled.div`
66
66
  white-space: nowrap;
67
67
  text-overflow: ellipsis;
68
- font-weight: 700;
68
+ font-weight: 500;
69
69
  font-size: 14px;
70
70
  line-height: 21px;
71
71
  `;
@@ -23,7 +23,7 @@ export const LoaderSpinner = ({
23
23
  const renderSpinnerLabel = /*#__PURE__*/React.createElement(StyledLabel, {
24
24
  "data-role": "visible-label",
25
25
  variant: "span",
26
- fontWeight: "500",
26
+ fontWeight: "400",
27
27
  size: size,
28
28
  color: isLabelDark ? "var(--colorsUtilityYin090);" : "var(--colorsActionMajorYang100);",
29
29
  fontSize: size === "extra-large" ? "var(--sizing200)" : "var(--sizing175)",
@@ -16,7 +16,7 @@ const LoaderStar = ({
16
16
  const label = /*#__PURE__*/React.createElement(StyledLabel, {
17
17
  "data-role": "visible-label",
18
18
  variant: "span",
19
- fontWeight: "500"
19
+ fontWeight: "400"
20
20
  }, loaderStarLabel || locale.loaderStar.loading());
21
21
  return /*#__PURE__*/React.createElement(StyledLoaderStarWrapper, _extends({
22
22
  role: "status"
@@ -99,7 +99,7 @@ const StyledMenuItemWrapper = styled.a.attrs({
99
99
  display: flex;
100
100
  align-items: center;
101
101
  font-size: 14px;
102
- font-weight: 700;
102
+ font-weight: 500;
103
103
  min-height: 40px;
104
104
  position: relative;
105
105
  box-shadow: none;
@@ -250,7 +250,7 @@ const StyledMenuItemWrapper = styled.a.attrs({
250
250
  ${StyledLink} a,
251
251
  ${StyledLink} button,
252
252
  ${StyledLink} [data-component="icon"] {
253
- font-weight: 700;
253
+ font-weight: 500;
254
254
  text-decoration: none;
255
255
  ${!hasInput && `color: ${menuConfigVariants[menuType].color};`}
256
256
  }
@@ -9,7 +9,7 @@ const StyledTitle = styled.h2`
9
9
  margin: 0px;
10
10
  padding: 16px 16px 8px;
11
11
  font-size: 12px;
12
- font-weight: 700;
12
+ font-weight: 500;
13
13
  text-transform: uppercase;
14
14
  line-height: 14px;
15
15
  cursor: default;
@@ -41,7 +41,7 @@ const StyledInlineControl = styled.div`
41
41
  min-width: fit-content;
42
42
  `;
43
43
  const StyledTitle = styled.header`
44
- font-weight: 900;
44
+ font-weight: 700;
45
45
  font-size: 16px;
46
46
  line-height: 21px;
47
47
  padding-bottom: 16px;
@@ -49,7 +49,7 @@ const StyledTitle = styled.header`
49
49
  const StyledFooterContent = styled.div`
50
50
  line-height: 21px;
51
51
  align-items: baseline;
52
- font-weight: bold;
52
+ font-weight: 500;
53
53
 
54
54
  ${({
55
55
  hasName
@@ -51,7 +51,7 @@ const StyledPill = styled.span`
51
51
  return css`
52
52
  font-size: 12px;
53
53
  letter-spacing: 0.7px;
54
- font-weight: 700;
54
+ font-weight: 500;
55
55
  position: relative;
56
56
  display: inline-flex;
57
57
  text-align: center;
@@ -340,7 +340,7 @@ const StyledSubtitle = styled.h5`
340
340
  const StyledTitle = styled.h4`
341
341
  display: inline;
342
342
  font-size: 18px;
343
- font-weight: 600;
343
+ font-weight: 500;
344
344
  `;
345
345
  StyledPod.defaultProps = {
346
346
  theme: baseTheme
@@ -1,7 +1,7 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useCallback, useEffect, useRef, useState, useMemo } from "react";
3
3
  import PropTypes from "prop-types";
4
- import { Transition } from "react-transition-group";
4
+ import { CSSTransition } from "react-transition-group";
5
5
  import { flip, offset } from "@floating-ui/dom";
6
6
  import useMediaQuery from "../../hooks/useMediaQuery";
7
7
  import { PopoverContainerWrapperStyle, PopoverContainerHeaderStyle, PopoverContainerContentStyle, PopoverContainerCloseIcon, PopoverContainerTitleStyle, PopoverContainerOpenIcon } from "./popover-container.style";
@@ -95,15 +95,12 @@ export const PopoverContainer = ({
95
95
  const reduceMotion = !useMediaQuery("screen and (prefers-reduced-motion: no-preference)");
96
96
  const popoverMiddleware = usePopoverMiddleware(shouldCoverButton);
97
97
  const closePopover = useCallback(ev => {
98
- if (!isControlled) {
99
- setIsOpenInternal(false);
100
- }
101
- if (onClose) {
102
- onClose(ev);
103
- }
104
- if (isOpen && openButtonRef.current) {
105
- openButtonRef.current.focus();
106
- }
98
+ /* istanbul ignore else */
99
+ if (!isControlled) setIsOpenInternal(false);
100
+ onClose?.(ev);
101
+
102
+ /* istanbul ignore else */
103
+ if (isOpen) openButtonRef.current?.focus();
107
104
  }, [isControlled, isOpen, onClose]);
108
105
  const handleEscKey = useCallback(ev => {
109
106
  const eventIsFromSelectInput = Events.composedPath(ev).find(element => {
@@ -120,12 +117,11 @@ export const PopoverContainer = ({
120
117
  };
121
118
  }, [handleEscKey]);
122
119
  const handleOpenButtonClick = e => {
120
+ /* istanbul ignore else */
123
121
  if (!isControlled) setIsOpenInternal(!isOpen);
124
122
 
125
123
  // We want the open button to close the popover if it is already open
126
- if (!isOpen) {
127
- if (onOpen) onOpen(e);
128
- } else if (onClose) onClose(e);
124
+ if (!isOpen) onOpen?.(e);else onClose?.(e);
129
125
  };
130
126
  const handleCloseButtonClick = e => {
131
127
  closePopover(e);
@@ -152,14 +148,13 @@ export const PopoverContainer = ({
152
148
  };
153
149
  const handleClickAway = e => {
154
150
  if (!isControlled) setIsOpenInternal(false);
155
- if (onClose && isOpen) onClose(e);
151
+ if (isOpen) onClose?.(e);
156
152
  };
157
153
  const handleClick = useClickAwayListener(handleClickAway, "mousedown");
158
154
  const [isAnimationComplete, setIsAnimationComplete] = useState(false);
159
- const popover = state => /*#__PURE__*/React.createElement(PopoverContainerContentStyle, _extends({
155
+ const popover = () => /*#__PURE__*/React.createElement(PopoverContainerContentStyle, _extends({
160
156
  "data-element": "popover-container-content",
161
157
  role: "dialog",
162
- animationState: state,
163
158
  "aria-labelledby": popoverContainerId,
164
159
  "aria-label": containerAriaLabel,
165
160
  "aria-describedby": ariaDescribedBy,
@@ -171,36 +166,34 @@ export const PopoverContainer = ({
171
166
  id: popoverContainerId,
172
167
  "data-element": "popover-container-title"
173
168
  }, title), renderCloseComponent(renderCloseComponentProps)), children);
174
- const childrenToRender = state => shouldCoverButton ? /*#__PURE__*/React.createElement(ModalContext.Provider, {
169
+ const childrenToRender = () => shouldCoverButton ? /*#__PURE__*/React.createElement(ModalContext.Provider, {
175
170
  value: {
176
171
  isAnimationComplete
177
172
  }
178
173
  }, /*#__PURE__*/React.createElement(FocusTrap, {
179
174
  wrapperRef: popoverContentNodeRef,
180
175
  isOpen: isOpen
181
- }, popover(state))) : popover(state);
176
+ }, popover())) : popover();
182
177
  return /*#__PURE__*/React.createElement(PopoverContainerWrapperStyle, {
183
178
  "data-component": "popover-container",
184
179
  onMouseDown: handleClick
185
180
  }, /*#__PURE__*/React.createElement("div", {
186
181
  ref: popoverReference
187
- }, renderOpenComponent(renderOpenComponentProps)), /*#__PURE__*/React.createElement(Transition, {
188
- in: isOpen,
182
+ }, renderOpenComponent(renderOpenComponentProps)), /*#__PURE__*/React.createElement(CSSTransition, {
183
+ nodeRef: popoverContentNodeRef,
189
184
  timeout: {
190
- exit: 300
185
+ exit: disableAnimation ? 0 : 300
191
186
  },
192
- appear: true,
193
- mountOnEnter: true,
187
+ in: isOpen,
194
188
  unmountOnExit: true,
195
- nodeRef: popoverContentNodeRef,
196
189
  onEntered: shouldCoverButton ? /* istanbul ignore next */() => setIsAnimationComplete(true) : undefined,
197
190
  onExiting: shouldCoverButton ? /* istanbul ignore next */() => setIsAnimationComplete(false) : undefined
198
- }, state => isOpen && /*#__PURE__*/React.createElement(Popover, {
191
+ }, /*#__PURE__*/React.createElement(Popover, {
199
192
  reference: popoverReference,
200
193
  placement: position === "right" ? "bottom-start" : "bottom-end",
201
194
  popoverStrategy: disableAnimation || reduceMotion ? "fixed" : "absolute",
202
195
  middleware: popoverMiddleware,
203
196
  childRefOverride: popoverContentNodeRef
204
- }, childrenToRender(state))));
197
+ }, childrenToRender())));
205
198
  };
206
199
  export default PopoverContainer;
@@ -1,35 +1,8 @@
1
- import styled from "styled-components";
1
+ import styled, { css } from "styled-components";
2
2
  import { padding } from "styled-system";
3
3
  import { baseTheme } from "../../style/themes";
4
4
  import IconButton from "../icon-button";
5
5
  import StyledIcon from "../icon/icon.style";
6
- function animationToRender({
7
- animationState,
8
- disableAnimation
9
- }) {
10
- if (disableAnimation) return "opacity: 1;";
11
- switch (animationState) {
12
- case "entering":
13
- return `
14
- opacity: 0;
15
- transform: translateY(-8px);
16
- `;
17
- case "entered":
18
- return `
19
- opacity: 1;
20
- transform: translateY(0);
21
- transition: all 0.3s cubic-bezier(0.25, 0.25, 0, 1.5);
22
- `;
23
- case "exiting":
24
- return `
25
- opacity: 0;
26
- transform: translateY(-8px);
27
- transition: all 0.3s cubic-bezier(0.25, 0.25, 0, 1.5);
28
- `;
29
- default:
30
- return "opacity: 0;";
31
- }
32
- }
33
6
  const PopoverContainerWrapperStyle = styled.div`
34
7
  position: relative;
35
8
  display: inline-block;
@@ -53,7 +26,38 @@ const PopoverContainerContentStyle = styled.div`
53
26
  theme
54
27
  }) => theme.zIndex.popover};
55
28
 
56
- ${animationToRender}
29
+ ${({
30
+ disableAnimation
31
+ }) => disableAnimation ? css`
32
+ opacity: 1;
33
+ transform: none;
34
+ ` : css`
35
+ &.enter {
36
+ opacity: 0;
37
+ transform: translateY(-8px);
38
+ }
39
+
40
+ &.enter-done {
41
+ opacity: 1;
42
+ transform: translateY(0);
43
+ transition-property: opacity, transform;
44
+ transition-duration: 0.3s;
45
+ transition-timing-function: cubic-bezier(0.25, 0.25, 0, 1.5);
46
+ }
47
+
48
+ &.exit {
49
+ opacity: 0;
50
+ transform: translateY(-8px);
51
+ transition-property: opacity, transform;
52
+ transition-duration: 0.3s;
53
+ transition-timing-function: cubic-bezier(0.25, 0.25, 0, 1.5);
54
+ }
55
+
56
+ &.exit-done {
57
+ opacity: 0;
58
+ transform: translateY(0);
59
+ }
60
+ `}
57
61
 
58
62
  :focus {
59
63
  outline: none;
@@ -75,7 +79,7 @@ const PopoverContainerCloseIcon = styled(IconButton)`
75
79
  `;
76
80
  const PopoverContainerTitleStyle = styled.div`
77
81
  font-size: 16px;
78
- font-weight: bold;
82
+ font-weight: 500;
79
83
  `;
80
84
  PopoverContainerContentStyle.defaultProps = {
81
85
  theme: baseTheme
@@ -5,7 +5,7 @@ import Icon from "../icon";
5
5
  import { PORTRAIT_SIZE_PARAMS } from "./portrait.config";
6
6
  import profileConfigSizes from "../profile/profile.config";
7
7
  export const StyledPortraitInitials = styled.div`
8
- font-weight: bold;
8
+ font-weight: 500;
9
9
  font-size: ${({
10
10
  size
11
11
  }) => profileConfigSizes[size].initialSize};
@@ -6,7 +6,7 @@ import profileConfigSizes from "./profile.config";
6
6
  import Link from "../link";
7
7
  import { StyledPortraitContainer } from "../portrait/portrait.style";
8
8
  const ProfileNameStyle = styled.span`
9
- font-weight: bold;
9
+ font-weight: 500;
10
10
  font-size: ${({
11
11
  size = "M"
12
12
  }) => profileConfigSizes[size].nameSize};
@@ -71,7 +71,7 @@ const fontSizes = {
71
71
  };
72
72
  const StyledValue = styled.span`
73
73
  display: inline-block;
74
- font-weight: bold;
74
+ font-weight: 500;
75
75
  `;
76
76
  const StyledDescription = styled.span`
77
77
  color: var(--colorsUtilityYin055);
@@ -26,7 +26,7 @@ const StyledSearch = styled.div`
26
26
  background-color: transparent;
27
27
  display: inline-flex;
28
28
  font-size: var(--fontSize100);
29
- font-weight: 700;
29
+ font-weight: 500;
30
30
 
31
31
  ${!showSearchButton && css`
32
32
  border-bottom: var(--spacing025) solid ${variantColor};
@@ -107,7 +107,7 @@ const StyledSearch = styled.div`
107
107
 
108
108
  flex: 1;
109
109
  font-size: var(--fontSize100);
110
- font-weight: 700;
110
+ font-weight: 500;
111
111
  padding-bottom: var(--spacing025);
112
112
  padding-top: 1px;
113
113
  cursor: pointer;
@@ -63,7 +63,7 @@ const StyledSelectListTableHeader = styled.thead`
63
63
  padding: var(--spacing200);
64
64
  background-color: white;
65
65
  text-align: left;
66
- font-weight: 900;
66
+ font-weight: 500;
67
67
  font-size: 12px;
68
68
  text-transform: uppercase;
69
69
  color: var(--colorsUtilityYin055);
@@ -19,7 +19,7 @@ const StyledSelectText = styled.span`
19
19
  padding-left: ${sizes[size].horizontalPadding};
20
20
 
21
21
  ${transparent && css`
22
- font-weight: 900;
22
+ font-weight: 500;
23
23
  text-align: right;
24
24
  flex-direction: row-reverse;
25
25
  `}
@@ -1,6 +1,6 @@
1
1
  import styled from "styled-components";
2
2
  const MatchingText = styled.span`
3
- font-weight: 700;
3
+ font-weight: 500;
4
4
  text-decoration: underline;
5
5
  `;
6
6
  export default MatchingText;