@itwin/itwinui-react 3.7.1 → 3.7.3

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
  # Changelog
2
2
 
3
+ ## 3.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1946](https://github.com/iTwin/iTwinUI/pull/1946): Fixed a bug in `Table` where resizing the columns and then toggling the column visibility in the column manager would trigger an unnecessary auto-scroll in the vertical direction.
8
+ - [#1943](https://github.com/iTwin/iTwinUI/pull/1943): Fixed a z-index issue in `Table` where the table resizer appeared above the sticky header cells.
9
+
10
+ ## 3.7.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [#1939](https://github.com/iTwin/iTwinUI/pull/1939): Fixed an issue in `ButtonGroup` where the overflow logic was running even when `overflowButton` prop was not passed.
15
+
3
16
  ## 3.7.1
4
17
 
5
18
  ### Patch Changes
@@ -68,7 +68,7 @@ exports.defaultStatusTitles = {
68
68
  exports.Avatar = React.forwardRef((props, ref) => {
69
69
  const { size = 'small', status, abbreviation, image, backgroundColor, title, translatedStatusTitles, className, style, ...rest } = props;
70
70
  const statusTitles = { ...exports.defaultStatusTitles, ...translatedStatusTitles };
71
- return (React.createElement(index_js_1.Box, { as: 'span', className: (0, classnames_1.default)('iui-avatar', { [`iui-${size}`]: size !== 'medium' }, className), "data-iui-status": status, title: title, style: { backgroundColor: getBackground(backgroundColor), ...style }, ref: ref, ...rest },
71
+ return (React.createElement(index_js_1.Box, { as: 'span', className: (0, classnames_1.default)('iui-avatar', className), "data-iui-size": size !== 'medium' ? size : undefined, "data-iui-status": status, title: title, style: { backgroundColor: getBackground(backgroundColor), ...style }, ref: ref, ...rest },
72
72
  !image ? abbreviation?.substring(0, 2) : null,
73
73
  image,
74
74
  status ? React.createElement(VisuallyHidden_js_1.VisuallyHidden, null, statusTitles[status]) : null));
@@ -79,7 +79,7 @@ exports.AvatarGroup = React.forwardRef((props, ref) => {
79
79
  childrenArray.length <= maxIcons + 1 && getAvatarList(maxIcons + 1),
80
80
  childrenArray.length > maxIcons + 1 && (React.createElement(React.Fragment, null,
81
81
  getAvatarList(maxIcons),
82
- React.createElement(index_js_1.Box, { ...countIconProps, className: (0, classnames_1.default)('iui-avatar', { [`iui-${iconSize}`]: iconSize !== 'medium' }, 'iui-avatar-count', countIconProps?.className) }, childrenLength <= maxLength
82
+ React.createElement(index_js_1.Box, { ...countIconProps, className: (0, classnames_1.default)('iui-avatar', 'iui-avatar-count', countIconProps?.className), "data-iui-size": iconSize !== 'medium' ? iconSize : undefined }, childrenLength <= maxLength
83
83
  ? `${childrenLength - maxIcons}`
84
84
  : `${maxLength}+`)))));
85
85
  });
@@ -71,12 +71,15 @@ exports.ButtonGroup = React.forwardRef((props, ref) => {
71
71
  const { children, className, overflowButton, overflowPlacement = 'end', orientation = 'horizontal', ...rest } = props;
72
72
  const items = React.useMemo(() => React.Children.toArray(children).filter(Boolean), [children]);
73
73
  const [overflowRef, visibleCount] = (0, index_js_1.useOverflow)(items, !overflowButton, orientation);
74
- const refs = (0, index_js_1.useMergedRefs)(overflowRef, ref);
74
+ const refs = (0, index_js_1.useMergedRefs)(!!overflowButton ? overflowRef : null, ref);
75
75
  return (React.createElement(react_1.FloatingDelayGroup, { delay: { open: 50, close: 250 } },
76
76
  React.createElement(exports.ButtonGroupContext.Provider, { value: orientation },
77
77
  React.createElement(index_js_1.Box, { className: (0, classnames_1.default)('iui-button-group', {
78
78
  'iui-button-group-overflow-x': !!overflowButton && orientation === 'horizontal',
79
79
  }, className), "data-iui-orientation": orientation === 'vertical' ? orientation : undefined, ref: refs, ...rest }, (() => {
80
+ if (!overflowButton) {
81
+ return children;
82
+ }
80
83
  if (!(visibleCount < items.length)) {
81
84
  return items;
82
85
  }
@@ -46,8 +46,8 @@ const index_js_1 = require("../utils/index.js");
46
46
  */
47
47
  exports.HeaderBreadcrumbs = React.forwardRef((props, forwardedRef) => {
48
48
  const { className, items, ...rest } = props;
49
- return (React.createElement(index_js_1.Box, { as: 'nav', "aria-label": 'breadcrumbs', className: (0, classnames_1.default)('iui-header-breadcrumbs', className), ref: forwardedRef, ...rest },
50
- React.createElement(index_js_1.Box, { as: 'ol', className: 'iui-header-breadcrumbs-list' }, items.reduce((previous, current, index) => [
49
+ return (React.createElement(index_js_1.Box, { as: 'nav', "aria-label": 'breadcrumbs', className: (0, classnames_1.default)('iui-breadcrumbs', 'iui-header-breadcrumbs', className), ref: forwardedRef, ...rest },
50
+ React.createElement(index_js_1.Box, { as: 'ol', className: (0, classnames_1.default)('iui-breadcrumbs-list', 'iui-header-breadcrumbs-list') }, items.reduce((previous, current, index) => [
51
51
  ...previous,
52
52
  current,
53
53
  index !== items.length - 1 && (React.createElement(index_js_1.Box, { as: 'li', className: 'iui-breadcrumbs-separator', key: index },
@@ -96,7 +96,7 @@ const ActionColumn = ({ columnManager = false, } = {}) => {
96
96
  // and table is scrolled to the very left which means our visibility dropdown menu is not visible.
97
97
  // So for better UX we need to scroll to that dropdown menu.
98
98
  queueMicrotask(() => {
99
- buttonRef.current?.scrollIntoView();
99
+ buttonRef.current?.scrollIntoView({ block: 'nearest' });
100
100
  });
101
101
  };
102
102
  return (React.createElement(MenuItem_js_1.MenuItem, { key: column.id, startIcon: React.createElement(Checkbox_js_1.Checkbox, { checked: checked, disabled: column.disableToggleVisibility, onClick: (e) => e.stopPropagation(), onChange: onClick, "aria-labelledby": `iui-column-${column.id}` }), onClick: onClick, disabled: column.disableToggleVisibility },
@@ -39,7 +39,7 @@ export const defaultStatusTitles = {
39
39
  export const Avatar = React.forwardRef((props, ref) => {
40
40
  const { size = 'small', status, abbreviation, image, backgroundColor, title, translatedStatusTitles, className, style, ...rest } = props;
41
41
  const statusTitles = { ...defaultStatusTitles, ...translatedStatusTitles };
42
- return (React.createElement(Box, { as: 'span', className: cx('iui-avatar', { [`iui-${size}`]: size !== 'medium' }, className), "data-iui-status": status, title: title, style: { backgroundColor: getBackground(backgroundColor), ...style }, ref: ref, ...rest },
42
+ return (React.createElement(Box, { as: 'span', className: cx('iui-avatar', className), "data-iui-size": size !== 'medium' ? size : undefined, "data-iui-status": status, title: title, style: { backgroundColor: getBackground(backgroundColor), ...style }, ref: ref, ...rest },
43
43
  !image ? abbreviation?.substring(0, 2) : null,
44
44
  image,
45
45
  status ? React.createElement(VisuallyHidden, null, statusTitles[status]) : null));
@@ -50,7 +50,7 @@ export const AvatarGroup = React.forwardRef((props, ref) => {
50
50
  childrenArray.length <= maxIcons + 1 && getAvatarList(maxIcons + 1),
51
51
  childrenArray.length > maxIcons + 1 && (React.createElement(React.Fragment, null,
52
52
  getAvatarList(maxIcons),
53
- React.createElement(Box, { ...countIconProps, className: cx('iui-avatar', { [`iui-${iconSize}`]: iconSize !== 'medium' }, 'iui-avatar-count', countIconProps?.className) }, childrenLength <= maxLength
53
+ React.createElement(Box, { ...countIconProps, className: cx('iui-avatar', 'iui-avatar-count', countIconProps?.className), "data-iui-size": iconSize !== 'medium' ? iconSize : undefined }, childrenLength <= maxLength
54
54
  ? `${childrenLength - maxIcons}`
55
55
  : `${maxLength}+`)))));
56
56
  });
@@ -42,12 +42,15 @@ export const ButtonGroup = React.forwardRef((props, ref) => {
42
42
  const { children, className, overflowButton, overflowPlacement = 'end', orientation = 'horizontal', ...rest } = props;
43
43
  const items = React.useMemo(() => React.Children.toArray(children).filter(Boolean), [children]);
44
44
  const [overflowRef, visibleCount] = useOverflow(items, !overflowButton, orientation);
45
- const refs = useMergedRefs(overflowRef, ref);
45
+ const refs = useMergedRefs(!!overflowButton ? overflowRef : null, ref);
46
46
  return (React.createElement(FloatingDelayGroup, { delay: { open: 50, close: 250 } },
47
47
  React.createElement(ButtonGroupContext.Provider, { value: orientation },
48
48
  React.createElement(Box, { className: cx('iui-button-group', {
49
49
  'iui-button-group-overflow-x': !!overflowButton && orientation === 'horizontal',
50
50
  }, className), "data-iui-orientation": orientation === 'vertical' ? orientation : undefined, ref: refs, ...rest }, (() => {
51
+ if (!overflowButton) {
52
+ return children;
53
+ }
51
54
  if (!(visibleCount < items.length)) {
52
55
  return items;
53
56
  }
@@ -17,8 +17,8 @@ import { SvgChevronRight, Box } from '../utils/index.js';
17
17
  */
18
18
  export const HeaderBreadcrumbs = React.forwardRef((props, forwardedRef) => {
19
19
  const { className, items, ...rest } = props;
20
- return (React.createElement(Box, { as: 'nav', "aria-label": 'breadcrumbs', className: cx('iui-header-breadcrumbs', className), ref: forwardedRef, ...rest },
21
- React.createElement(Box, { as: 'ol', className: 'iui-header-breadcrumbs-list' }, items.reduce((previous, current, index) => [
20
+ return (React.createElement(Box, { as: 'nav', "aria-label": 'breadcrumbs', className: cx('iui-breadcrumbs', 'iui-header-breadcrumbs', className), ref: forwardedRef, ...rest },
21
+ React.createElement(Box, { as: 'ol', className: cx('iui-breadcrumbs-list', 'iui-header-breadcrumbs-list') }, items.reduce((previous, current, index) => [
22
22
  ...previous,
23
23
  current,
24
24
  index !== items.length - 1 && (React.createElement(Box, { as: 'li', className: 'iui-breadcrumbs-separator', key: index },
@@ -70,7 +70,7 @@ export const ActionColumn = ({ columnManager = false, } = {}) => {
70
70
  // and table is scrolled to the very left which means our visibility dropdown menu is not visible.
71
71
  // So for better UX we need to scroll to that dropdown menu.
72
72
  queueMicrotask(() => {
73
- buttonRef.current?.scrollIntoView();
73
+ buttonRef.current?.scrollIntoView({ block: 'nearest' });
74
74
  });
75
75
  };
76
76
  return (React.createElement(MenuItem, { key: column.id, startIcon: React.createElement(Checkbox, { checked: checked, disabled: column.disableToggleVisibility, onClick: (e) => e.stopPropagation(), onChange: onClick, "aria-labelledby": `iui-column-${column.id}` }), onClick: onClick, disabled: column.disableToggleVisibility },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/itwinui-react",
3
- "version": "3.7.1",
3
+ "version": "3.7.3",
4
4
  "author": "Bentley Systems",
5
5
  "license": "MIT",
6
6
  "type": "module",