@itwin/itwinui-react 2.12.13 → 2.12.15

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.12.15
4
+
5
+ ### Patch Changes
6
+
7
+ - df057f24: Fixed `ThemeProvider` to correctly inherit `highContrast` option when using `theme="inherit"`.
8
+
9
+ ## 2.12.14
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1643](https://github.com/iTwin/iTwinUI/pull/1643): Fixed an issue where ProgressRadial was not respecting explicit size.
14
+
3
15
  ## 2.12.13
4
16
 
5
17
  ### Patch Changes
@@ -62,15 +62,19 @@ const useStyles_js_1 = require("../utils/hooks/useStyles.js");
62
62
  * </ThemeProvider>
63
63
  */
64
64
  exports.ThemeProvider = React.forwardRef((props, ref) => {
65
- var _a, _b;
66
- const { theme: themeProp, children, themeOptions, includeCss = { withLayer: true }, ...rest } = props;
65
+ var _a, _b, _c, _d;
66
+ const { theme: themeProp, children, themeOptions = {}, includeCss = { withLayer: true }, ...rest } = props;
67
67
  const rootRef = React.useRef(null);
68
68
  const mergedRefs = (0, index_js_1.useMergedRefs)(rootRef, ref);
69
69
  const hasChildren = React.Children.count(children) > 0;
70
70
  const parentContext = React.useContext(exports.ThemeContext);
71
71
  const theme = themeProp === 'inherit' ? (_a = parentContext === null || parentContext === void 0 ? void 0 : parentContext.theme) !== null && _a !== void 0 ? _a : 'light' : themeProp;
72
+ // default inherit highContrast option from parent if also inheriting base theme
73
+ (_b = themeOptions.highContrast) !== null && _b !== void 0 ? _b : (themeOptions.highContrast = themeProp === 'inherit'
74
+ ? (_c = parentContext === null || parentContext === void 0 ? void 0 : parentContext.themeOptions) === null || _c === void 0 ? void 0 : _c.highContrast
75
+ : undefined);
72
76
  const newStylesLoaded = React.useRef(false);
73
- const stylesLoaded = (_b = parentContext === null || parentContext === void 0 ? void 0 : parentContext.stylesLoaded) !== null && _b !== void 0 ? _b : newStylesLoaded;
77
+ const stylesLoaded = (_d = parentContext === null || parentContext === void 0 ? void 0 : parentContext.stylesLoaded) !== null && _d !== void 0 ? _d : newStylesLoaded;
74
78
  const contextValue = React.useMemo(() => ({
75
79
  theme,
76
80
  themeOptions,