@itwin/itwinui-react 3.19.7 → 3.20.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 (81) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/DEV-cjs/core/Breadcrumbs/Breadcrumbs.js +1 -1
  3. package/DEV-cjs/core/ComboBox/ComboBox.js +6 -2
  4. package/DEV-cjs/core/Dialog/DialogTitleBarTitle.js +1 -1
  5. package/DEV-cjs/core/DropdownMenu/DropdownMenu.js +1 -1
  6. package/DEV-cjs/core/ExpandableBlock/ExpandableBlock.js +1 -1
  7. package/DEV-cjs/core/InformationPanel/InformationPanelHeader.js +0 -1
  8. package/DEV-cjs/core/Table/SubRowExpander.js +1 -1
  9. package/DEV-cjs/core/Table/Table.js +1 -1
  10. package/DEV-cjs/core/Table/TableCell.js +27 -18
  11. package/DEV-cjs/core/Table/cells/DefaultCell.js +63 -85
  12. package/DEV-cjs/core/Table/columns/expanderColumn.js +1 -1
  13. package/DEV-cjs/core/Tabs/Tabs.js +10 -6
  14. package/DEV-cjs/core/Tile/Tile.js +1 -2
  15. package/DEV-cjs/core/Tree/TreeNodeExpander.js +1 -5
  16. package/DEV-cjs/styles.js +1 -1
  17. package/DEV-esm/core/Breadcrumbs/Breadcrumbs.js +2 -2
  18. package/DEV-esm/core/ComboBox/ComboBox.js +6 -2
  19. package/DEV-esm/core/Dialog/DialogTitleBarTitle.js +1 -1
  20. package/DEV-esm/core/DropdownMenu/DropdownMenu.js +1 -1
  21. package/DEV-esm/core/ExpandableBlock/ExpandableBlock.js +2 -2
  22. package/DEV-esm/core/InformationPanel/InformationPanelHeader.js +0 -1
  23. package/DEV-esm/core/Table/SubRowExpander.js +2 -2
  24. package/DEV-esm/core/Table/Table.js +1 -1
  25. package/DEV-esm/core/Table/TableCell.js +22 -19
  26. package/DEV-esm/core/Table/cells/DefaultCell.js +62 -84
  27. package/DEV-esm/core/Table/columns/expanderColumn.js +2 -2
  28. package/DEV-esm/core/Tabs/Tabs.js +8 -2
  29. package/DEV-esm/core/Tile/Tile.js +1 -2
  30. package/DEV-esm/core/Tree/TreeNodeExpander.js +2 -5
  31. package/DEV-esm/styles.js +1 -1
  32. package/cjs/core/Breadcrumbs/Breadcrumbs.js +1 -1
  33. package/cjs/core/ComboBox/ComboBox.js +6 -2
  34. package/cjs/core/Dialog/Dialog.d.ts +1 -1
  35. package/cjs/core/Dialog/DialogTitleBar.d.ts +1 -1
  36. package/cjs/core/Dialog/DialogTitleBarTitle.d.ts +1 -1
  37. package/cjs/core/Dialog/DialogTitleBarTitle.js +1 -1
  38. package/cjs/core/DropdownMenu/DropdownMenu.d.ts +1 -1
  39. package/cjs/core/DropdownMenu/DropdownMenu.js +1 -1
  40. package/cjs/core/ExpandableBlock/ExpandableBlock.js +1 -1
  41. package/cjs/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
  42. package/cjs/core/InformationPanel/InformationPanelHeader.js +0 -1
  43. package/cjs/core/StatusMessage/StatusMessage.d.ts +1 -1
  44. package/cjs/core/Table/SubRowExpander.js +1 -1
  45. package/cjs/core/Table/Table.js +1 -1
  46. package/cjs/core/Table/TableCell.js +27 -18
  47. package/cjs/core/Table/cells/DefaultCell.d.ts +14 -3
  48. package/cjs/core/Table/cells/DefaultCell.js +63 -85
  49. package/cjs/core/Table/columns/expanderColumn.js +1 -1
  50. package/cjs/core/Tabs/Tabs.js +10 -6
  51. package/cjs/core/Tile/Tile.d.ts +1 -1
  52. package/cjs/core/Tile/Tile.js +1 -2
  53. package/cjs/core/Toast/Toast.d.ts +2 -0
  54. package/cjs/core/Tree/TreeNodeExpander.js +1 -5
  55. package/cjs/styles.js +1 -1
  56. package/esm/core/Breadcrumbs/Breadcrumbs.js +2 -2
  57. package/esm/core/ComboBox/ComboBox.js +6 -2
  58. package/esm/core/Dialog/Dialog.d.ts +1 -1
  59. package/esm/core/Dialog/DialogTitleBar.d.ts +1 -1
  60. package/esm/core/Dialog/DialogTitleBarTitle.d.ts +1 -1
  61. package/esm/core/Dialog/DialogTitleBarTitle.js +1 -1
  62. package/esm/core/DropdownMenu/DropdownMenu.d.ts +1 -1
  63. package/esm/core/DropdownMenu/DropdownMenu.js +1 -1
  64. package/esm/core/ExpandableBlock/ExpandableBlock.js +2 -2
  65. package/esm/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
  66. package/esm/core/InformationPanel/InformationPanelHeader.js +0 -1
  67. package/esm/core/StatusMessage/StatusMessage.d.ts +1 -1
  68. package/esm/core/Table/SubRowExpander.js +2 -2
  69. package/esm/core/Table/Table.js +1 -1
  70. package/esm/core/Table/TableCell.js +22 -19
  71. package/esm/core/Table/cells/DefaultCell.d.ts +14 -3
  72. package/esm/core/Table/cells/DefaultCell.js +62 -84
  73. package/esm/core/Table/columns/expanderColumn.js +2 -2
  74. package/esm/core/Tabs/Tabs.js +8 -2
  75. package/esm/core/Tile/Tile.d.ts +1 -1
  76. package/esm/core/Tile/Tile.js +1 -2
  77. package/esm/core/Toast/Toast.d.ts +2 -0
  78. package/esm/core/Tree/TreeNodeExpander.js +2 -5
  79. package/esm/styles.js +1 -1
  80. package/package.json +5 -5
  81. package/styles.css +12 -10
@@ -13,8 +13,8 @@ _export(exports, {
13
13
  DefaultCell: function () {
14
14
  return DefaultCell;
15
15
  },
16
- DefaultCellRendererPropsChildren: function () {
17
- return DefaultCellRendererPropsChildren;
16
+ DefaultCellContext: function () {
17
+ return DefaultCellContext;
18
18
  },
19
19
  });
20
20
  const _interop_require_default = require('@swc/helpers/_/_interop_require_default');
@@ -26,7 +26,7 @@ const _classnames = /*#__PURE__*/ _interop_require_default._(
26
26
  );
27
27
  const _index = require('../../../utils/index.js');
28
28
  const _utils = require('../utils.js');
29
- const DefaultCellRendererPropsChildren = _react.createContext(void 0);
29
+ const DefaultCellContext = _react.createContext({});
30
30
  const DefaultCell = (props) => {
31
31
  let instance = _react.useContext(_utils.TableInstanceContext);
32
32
  let isCustomCell = _react.useMemo(
@@ -35,8 +35,9 @@ const DefaultCell = (props) => {
35
35
  ?.Cell !== _reacttable.defaultColumn.Cell,
36
36
  [instance, props.cellProps.column.id],
37
37
  );
38
+ let defaultCellContext = _react.useContext(DefaultCellContext);
38
39
  let isCellRendererChildrenCustom =
39
- _react.useContext(DefaultCellRendererPropsChildren) !== props.children;
40
+ defaultCellContext.children !== props.children;
40
41
  let isDefaultTextCell =
41
42
  'string' == typeof props.cellProps.value &&
42
43
  !isCustomCell &&
@@ -55,10 +56,33 @@ const DefaultCell = (props) => {
55
56
  className,
56
57
  style,
57
58
  status,
58
- clamp = isDefaultTextCell,
59
+ text = isDefaultTextCell ? cellProps.value : void 0,
60
+ clamp = !!text,
59
61
  ...rest
60
62
  } = props;
61
63
  let { key: cellElementKey, ...cellElementPropsRest } = cellElementProps;
64
+ let decorations = {
65
+ start: startIcon
66
+ ? _react.createElement(
67
+ _index.Box,
68
+ {
69
+ className: 'iui-table-cell-start-icon',
70
+ key: `${cellElementKey}-start`,
71
+ },
72
+ startIcon,
73
+ )
74
+ : null,
75
+ end: endIcon
76
+ ? _react.createElement(
77
+ _index.Box,
78
+ {
79
+ className: 'iui-table-cell-end-icon',
80
+ key: `${cellElementKey}-end`,
81
+ },
82
+ endIcon,
83
+ )
84
+ : null,
85
+ };
62
86
  return _react.createElement(
63
87
  _index.Box,
64
88
  {
@@ -73,87 +97,41 @@ const DefaultCell = (props) => {
73
97
  ...style,
74
98
  },
75
99
  },
76
- _react.createElement(
77
- _index.ShadowRoot,
78
- {
79
- key: `${cellElementKey}-shadow-root`,
80
- flush: false,
81
- css: css,
82
- },
83
- _react.createElement('slot', {
84
- name: 'start',
85
- }),
86
- _react.createElement(
87
- TableCellContent,
88
- {
89
- shouldRenderWrapper: isDefaultTextCell,
90
- },
91
- clamp
92
- ? _react.createElement(
93
- 'div',
94
- {
95
- className: _index.lineClamp.className,
96
- },
97
- _react.createElement('slot', null),
98
- )
99
- : _react.createElement('slot', null),
100
- ),
101
- _react.createElement('slot', {
102
- name: 'end',
103
- }),
104
- _react.createElement('slot', {
105
- name: 'shadows',
106
- }),
107
- ),
108
- startIcon &&
109
- _react.createElement(
110
- _index.Box,
111
- {
112
- className: 'iui-table-cell-start-icon',
113
- slot: 'start',
114
- key: `${cellElementKey}-start`,
115
- },
116
- startIcon,
117
- ),
118
- children,
119
- endIcon &&
120
- _react.createElement(
121
- _index.Box,
122
- {
123
- className: 'iui-table-cell-end-icon',
124
- slot: 'end',
125
- key: `${cellElementKey}-end`,
126
- },
127
- endIcon,
128
- ),
100
+ (() => {
101
+ if (text)
102
+ return _react.createElement(
103
+ _react.Fragment,
104
+ null,
105
+ decorations.start,
106
+ defaultCellContext.expander,
107
+ _react.createElement(
108
+ _index.Box,
109
+ {
110
+ className: 'iui-table-cell-default-content',
111
+ onClick: (e) => e.stopPropagation(),
112
+ },
113
+ clamp
114
+ ? _react.createElement(
115
+ _index.Box,
116
+ {
117
+ className: 'iui-line-clamp',
118
+ },
119
+ text,
120
+ )
121
+ : text,
122
+ ),
123
+ decorations.end,
124
+ defaultCellContext.shadows,
125
+ );
126
+ return _react.createElement(
127
+ _react.Fragment,
128
+ null,
129
+ decorations.start,
130
+ children,
131
+ decorations.end,
132
+ );
133
+ })(),
129
134
  );
130
135
  };
131
136
  if ('development' === process.env.NODE_ENV)
132
137
  DefaultCell.displayName = 'DefaultCell';
133
- const TableCellContent = (props) => {
134
- let { children, shouldRenderWrapper } = props;
135
- return shouldRenderWrapper
136
- ? _react.createElement(
137
- 'div',
138
- {
139
- className: '_iui-table-cell-default-content',
140
- onClick: (e) => e.stopPropagation(),
141
- },
142
- children,
143
- )
144
- : children;
145
- };
146
- const css = `
147
- ._iui-table-cell-default-content {
148
- position: relative;
149
- isolation: isolate;
150
- }
151
- ._iui-table-cell-default-content::before {
152
- content: '';
153
- display: block;
154
- position: absolute;
155
- inset: -6px;
156
- z-index: -1;
157
- }
158
- ${_index.lineClamp.css}
159
- `;
@@ -52,7 +52,7 @@ const ExpanderColumn = (props = {}) => {
52
52
  disabled: isDisabled?.(props.row.original),
53
53
  'aria-expanded': row.isExpanded,
54
54
  },
55
- _react.createElement(_index.SvgChevronRight, null),
55
+ _react.createElement(_index.SvgChevronRightSmall, null),
56
56
  );
57
57
  },
58
58
  cellRenderer: (props) =>
@@ -85,11 +85,8 @@ const TabsWrapperPresentation = _react.forwardRef((props, forwardedRef) => {
85
85
  let { orientation = 'horizontal', ...rest } = props;
86
86
  return _react.createElement(_index.Box, {
87
87
  ...rest,
88
- className: (0, _classnames.default)(
89
- 'iui-tabs-wrapper',
90
- `iui-${orientation}`,
91
- props.className,
92
- ),
88
+ className: (0, _classnames.default)('iui-tabs-wrapper', props.className),
89
+ 'data-iui-orientation': orientation,
93
90
  ref: forwardedRef,
94
91
  });
95
92
  });
@@ -290,6 +287,7 @@ const Tab = _react.forwardRef((props, forwardedRef) => {
290
287
  if ('auto' === focusActivationMode && !props.disabled)
291
288
  setActiveValue(value);
292
289
  }),
290
+ 'data-iui-orientation': orientation,
293
291
  },
294
292
  label ? _react.createElement(Tabs.TabLabel, null, label) : children,
295
293
  );
@@ -336,6 +334,7 @@ if ('development' === process.env.NODE_ENV)
336
334
  TabDescription.displayName = 'Tabs.TabDescription';
337
335
  const TabsActions = _react.forwardRef((props, ref) => {
338
336
  let { wrapperProps, className, children, ...rest } = props;
337
+ let { orientation } = (0, _index.useSafeContext)(TabsContext);
339
338
  return _react.createElement(
340
339
  _index.Box,
341
340
  {
@@ -344,12 +343,14 @@ const TabsActions = _react.forwardRef((props, ref) => {
344
343
  'iui-tabs-actions-wrapper',
345
344
  wrapperProps?.className,
346
345
  ),
346
+ 'data-iui-orientation': orientation,
347
347
  },
348
348
  _react.createElement(
349
349
  _index.Box,
350
350
  {
351
351
  className: (0, _classnames.default)('iui-tabs-actions', className),
352
352
  ref: ref,
353
+ 'data-iui-orientation': orientation,
353
354
  ...rest,
354
355
  },
355
356
  children,
@@ -360,7 +361,9 @@ if ('development' === process.env.NODE_ENV)
360
361
  TabsActions.displayName = 'Tabs.Actions';
361
362
  const TabsPanel = _react.forwardRef((props, ref) => {
362
363
  let { value, className, children, ...rest } = props;
363
- let { activeValue, idPrefix } = (0, _index.useSafeContext)(TabsContext);
364
+ let { activeValue, idPrefix, orientation } = (0, _index.useSafeContext)(
365
+ TabsContext,
366
+ );
364
367
  return _react.createElement(
365
368
  _index.Box,
366
369
  {
@@ -371,6 +374,7 @@ const TabsPanel = _react.forwardRef((props, ref) => {
371
374
  ref: ref,
372
375
  ...rest,
373
376
  id: `${idPrefix}-panel-${value.replaceAll(' ', '-')}`,
377
+ 'data-iui-orientation': orientation,
374
378
  },
375
379
  children,
376
380
  );
@@ -270,7 +270,7 @@ export declare const Tile: PolymorphicForwardRefComponent<"div", TileLegacyProps
270
270
  * </Tile.Wrapper>
271
271
  */
272
272
  NameIcon: PolymorphicForwardRefComponent<"div", {}>;
273
- NameLabel: PolymorphicForwardRefComponent<"span", {}>;
273
+ NameLabel: PolymorphicForwardRefComponent<"h2", {}>;
274
274
  /**
275
275
  * Polymorphic Tile action component. Recommended to be used in `Tile.NameLabel` subcomponent.
276
276
  * Renders `a` element by default.
@@ -210,7 +210,7 @@ const TileNameIcon = _react.forwardRef((props, forwardedRef) => {
210
210
  });
211
211
  if ('development' === process.env.NODE_ENV)
212
212
  TileNameIcon.displayName = 'Tile.NameIcon';
213
- const TileNameLabel = _index.polymorphic.span('iui-tile-name-label');
213
+ const TileNameLabel = _index.polymorphic.h2('iui-tile-name-label');
214
214
  if ('development' === process.env.NODE_ENV)
215
215
  TileNameLabel.displayName = 'Tile.NameLabel';
216
216
  const TileContentArea = _index.polymorphic.div('iui-tile-content');
@@ -243,7 +243,6 @@ const TileMoreOptions = _react.forwardRef((props, forwardedRef) => {
243
243
  {
244
244
  onVisibleChange: setIsMenuVisible,
245
245
  menuItems: children,
246
- closeOnItemClick: true,
247
246
  },
248
247
  _react.createElement(
249
248
  _IconButton.IconButton,
@@ -40,6 +40,8 @@ export type ToastProps = {
40
40
  /**
41
41
  * Boolean indicating when the close button is visible.
42
42
  * When false, the toast will not have any close button.
43
+ *
44
+ * This prop has no effect when the toast `type` is set to `persisting`.
43
45
  */
44
46
  hasCloseButton?: boolean;
45
47
  /**
@@ -16,12 +16,8 @@ const _classnames = /*#__PURE__*/ _interop_require_default._(
16
16
  );
17
17
  const _index = require('../../utils/index.js');
18
18
  const _IconButton = require('../Buttons/IconButton.js');
19
- const _TreeContext = require('./TreeContext.js');
20
19
  const TreeNodeExpander = _react.forwardRef((props, ref) => {
21
20
  let { isExpanded, expanderIconProps = {}, ...rest } = props;
22
- let size = _react.useContext(_TreeContext.TreeContext)?.size ?? 'default';
23
- let ChevronIcon =
24
- 'small' === size ? _index.SvgChevronRightSmall : _index.SvgChevronRight;
25
21
  return _react.createElement(
26
22
  _IconButton.IconButton,
27
23
  {
@@ -31,7 +27,7 @@ const TreeNodeExpander = _react.forwardRef((props, ref) => {
31
27
  ref: ref,
32
28
  ...rest,
33
29
  },
34
- _react.createElement(ChevronIcon, {
30
+ _react.createElement(_index.SvgChevronRightSmall, {
35
31
  ...expanderIconProps,
36
32
  className: (0, _classnames.default)(
37
33
  'iui-tree-node-content-expander-icon',
package/cjs/styles.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
- const e = '3.19.7';
3
+ const e = '3.20.0';
4
4
  const u = new Proxy(
5
5
  {},
6
6
  {
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import cx from 'classnames';
3
3
  import {
4
- SvgChevronRight,
5
4
  Box,
6
5
  OverflowContainer,
7
6
  useWarningLogger,
8
7
  cloneElementWithRef,
8
+ SvgChevronRightSmall,
9
9
  } from '../../utils/index.js';
10
10
  import { Button } from '../Buttons/Button.js';
11
11
  import { Anchor } from '../Typography/Anchor.js';
@@ -161,7 +161,7 @@ let Separator = ({ separator }) =>
161
161
  className: 'iui-breadcrumbs-separator',
162
162
  'aria-hidden': true,
163
163
  },
164
- separator ?? React.createElement(SvgChevronRight, null),
164
+ separator ?? React.createElement(SvgChevronRightSmall, null),
165
165
  );
166
166
  let BreadcrumbsItem = React.forwardRef((props, forwardedRef) => {
167
167
  let { as: asProp, ...rest } = props;
@@ -20,8 +20,12 @@ import { ComboBoxMenuItem } from './ComboBoxMenuItem.js';
20
20
  let isMultipleEnabled = (variable, multiple) =>
21
21
  multiple && (Array.isArray(variable) || null == variable);
22
22
  let isSingleOnChange = (onChange, multiple) => !multiple;
23
- let getOptionId = (option, idPrefix) =>
24
- option.id ?? `${idPrefix}-option-${option.label.replace(/\s/g, '-')}`;
23
+ let getOptionId = (option, idPrefix) => {
24
+ if (option.id) return option.id;
25
+ if ('string' == typeof option.value || 'number' == typeof option.value)
26
+ return `${idPrefix}-option-${option.value.toString().replace(/\s/g, '-')}`;
27
+ return `${idPrefix}-option-${option.label.replace(/\s/g, '-')}`;
28
+ };
25
29
  export const ComboBox = React.forwardRef((props, forwardedRef) => {
26
30
  let idPrefix = useId();
27
31
  let defaultFilterFunction = React.useCallback(
@@ -36,7 +36,7 @@ export declare const Dialog: PolymorphicForwardRefComponent<"div", DialogProps>
36
36
  children?: React.ReactNode;
37
37
  titleText?: React.ReactNode;
38
38
  } & Pick<DialogContextProps, "onClose" | "isDismissible" | "isDraggable">> & {
39
- Title: PolymorphicForwardRefComponent<"div", {}>;
39
+ Title: PolymorphicForwardRefComponent<"h2", {}>;
40
40
  };
41
41
  Content: PolymorphicForwardRefComponent<"div", {}>;
42
42
  ButtonBar: PolymorphicForwardRefComponent<"div", {}>;
@@ -29,6 +29,6 @@ type DialogTitleBarProps = {
29
29
  * </Dialog.TitleBar>
30
30
  */
31
31
  export declare const DialogTitleBar: PolymorphicForwardRefComponent<"div", DialogTitleBarProps> & {
32
- Title: PolymorphicForwardRefComponent<"div", {}>;
32
+ Title: PolymorphicForwardRefComponent<"h2", {}>;
33
33
  };
34
34
  export {};
@@ -5,4 +5,4 @@
5
5
  * <Dialog.TitleBar.Title>My dialog title</Dialog.TitleBar.Title>
6
6
  * </Dialog.TitleBar>
7
7
  */
8
- export declare const DialogTitleBarTitle: import("../../utils/props.js").PolymorphicForwardRefComponent<"div", {}>;
8
+ export declare const DialogTitleBarTitle: import("../../utils/props.js").PolymorphicForwardRefComponent<"h2", {}>;
@@ -1,4 +1,4 @@
1
1
  import { polymorphic } from '../../utils/index.js';
2
- export const DialogTitleBarTitle = polymorphic.div('iui-dialog-title');
2
+ export const DialogTitleBarTitle = polymorphic.h2('iui-dialog-title');
3
3
  if ('development' === process.env.NODE_ENV)
4
4
  DialogTitleBarTitle.displayName = 'Dialog.TitleBar.Title';
@@ -30,7 +30,7 @@ export type DropdownMenuProps = {
30
30
  };
31
31
  /**
32
32
  * If `true`, closes the `DropdownMenu` when any descendant `MenuItem` is clicked.
33
- * @default false
33
+ * @default true
34
34
  */
35
35
  closeOnItemClick?: boolean;
36
36
  } & Pick<Parameters<typeof usePopover>[0], 'visible' | 'onVisibleChange' | 'placement' | 'matchWidth'> & Pick<React.ComponentProps<typeof Menu>, 'positionReference'> & Pick<PortalProps, 'portal'>;
@@ -25,7 +25,7 @@ let DropdownMenuContent = React.forwardRef((props, forwardedRef) => {
25
25
  onVisibleChange,
26
26
  portal = true,
27
27
  middleware,
28
- closeOnItemClick = false,
28
+ closeOnItemClick = true,
29
29
  ...rest
30
30
  } = props;
31
31
  let [visible, setVisible] = useControlledState(
@@ -2,13 +2,13 @@ import cx from 'classnames';
2
2
  import * as React from 'react';
3
3
  import {
4
4
  StatusIconMap,
5
- SvgChevronRight,
6
5
  Box,
7
6
  useSafeContext,
8
7
  polymorphic,
9
8
  mergeEventHandlers,
10
9
  ButtonBase,
11
10
  useId,
11
+ SvgChevronRightSmall,
12
12
  } from '../../utils/index.js';
13
13
  import { Icon } from '../Icon/Icon.js';
14
14
  import { LinkBox } from '../LinkAction/LinkAction.js';
@@ -128,7 +128,7 @@ let ExpandableBlockExpandIcon = React.forwardRef((props, forwardedRef) => {
128
128
  ...rest,
129
129
  },
130
130
  children ??
131
- React.createElement(SvgChevronRight, {
131
+ React.createElement(SvgChevronRightSmall, {
132
132
  'aria-hidden': true,
133
133
  }),
134
134
  );
@@ -36,7 +36,7 @@ type InformationPanelHeaderProps = {
36
36
  * </>
37
37
  * )}
38
38
  * >
39
- * <Text variant='subheading'>InfoPanel heading</Text>
39
+ * <Text variant='subheading' as='h2'>InfoPanel heading</Text>
40
40
  * </InformationPanelHeader>
41
41
  */
42
42
  export declare const InformationPanelHeader: PolymorphicForwardRefComponent<"div", InformationPanelHeaderProps>;
@@ -15,7 +15,6 @@ export const InformationPanelHeader = React.forwardRef(
15
15
  React.createElement(
16
16
  Box,
17
17
  {
18
- as: 'span',
19
18
  className: 'iui-information-header-label',
20
19
  },
21
20
  children,
@@ -5,7 +5,7 @@ type StatusMessageProps = {
5
5
  /**
6
6
  * Custom icon to be displayed at the beginning.
7
7
  *
8
- * - It will default to the `status` icon, if `status` is set.
8
+ * - It will default to the `status` icon, if `status` is set. Else, it defaults to no icon.
9
9
  * - If `startIcon` is set to `null`, no icon will be displayed, even if `status` is set.
10
10
  */
11
11
  startIcon?: React.JSX.Element | null;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { SvgChevronRight } from '../../utils/index.js';
2
+ import { SvgChevronRightSmall } from '../../utils/index.js';
3
3
  import { IconButton } from '../Buttons/IconButton.js';
4
4
  export const SubRowExpander = (props) => {
5
5
  let { cell, isDisabled, cellProps, expanderCell, density, ...rest } = props;
@@ -27,7 +27,7 @@ export const SubRowExpander = (props) => {
27
27
  disabled: isDisabled,
28
28
  ...rest,
29
29
  },
30
- React.createElement(SvgChevronRight, {
30
+ React.createElement(SvgChevronRightSmall, {
31
31
  style: {
32
32
  transform: cell.row.isExpanded ? 'rotate(90deg)' : void 0,
33
33
  },
@@ -567,7 +567,7 @@ export const Table = (props) => {
567
567
  count: page.length,
568
568
  getScrollElement: () => tableRef.current,
569
569
  estimateSize: () => rowHeight,
570
- getItemKey: (index) => page[index].id,
570
+ getItemKey: React.useCallback((index) => page[index].id, [page]),
571
571
  overscan: 1,
572
572
  });
573
573
  useLayoutEffect(() => {
@@ -5,7 +5,7 @@ import { SubRowExpander } from './SubRowExpander.js';
5
5
  import { SELECTION_CELL_ID } from './columns/index.js';
6
6
  import { DefaultCell } from './cells/index.js';
7
7
  import { Box } from '../../utils/index.js';
8
- import { DefaultCellRendererPropsChildren } from './cells/DefaultCell.js';
8
+ import { DefaultCellContext } from './cells/DefaultCell.js';
9
9
  export const TableCell = (props) => {
10
10
  let {
11
11
  cell,
@@ -46,24 +46,18 @@ export const TableCell = (props) => {
46
46
  }),
47
47
  [cell, tableInstance],
48
48
  );
49
- let cellContent = React.useMemo(
49
+ let expander = React.useMemo(
50
50
  () =>
51
- React.createElement(
52
- React.Fragment,
53
- null,
54
- tableHasSubRows &&
55
- hasSubRowExpander &&
56
- cell.row.canExpand &&
57
- React.createElement(SubRowExpander, {
51
+ tableHasSubRows && hasSubRowExpander && cell.row.canExpand
52
+ ? React.createElement(SubRowExpander, {
58
53
  cell: cell,
59
54
  isDisabled: isDisabled,
60
55
  cellProps: cellProps,
61
56
  expanderCell: expanderCell,
62
57
  density: density,
63
58
  slot: 'start',
64
- }),
65
- cell.render('Cell'),
66
- ),
59
+ })
60
+ : null,
67
61
  [
68
62
  cell,
69
63
  cellProps,
@@ -74,32 +68,34 @@ export const TableCell = (props) => {
74
68
  tableHasSubRows,
75
69
  ],
76
70
  );
77
- let defaultCellRendererChildren = React.useMemo(
71
+ let cellContent = React.useMemo(() => cell.render('Cell'), [cell]);
72
+ let shadows = React.useMemo(
78
73
  () =>
79
74
  React.createElement(
80
75
  React.Fragment,
81
76
  null,
82
- cellContent,
83
77
  'left' === cell.column.sticky &&
84
78
  tableInstance.state.sticky.isScrolledToRight &&
85
79
  React.createElement(Box, {
86
80
  className: 'iui-table-cell-shadow-right',
87
- slot: 'shadows',
88
81
  }),
89
82
  'right' === cell.column.sticky &&
90
83
  tableInstance.state.sticky.isScrolledToLeft &&
91
84
  React.createElement(Box, {
92
85
  className: 'iui-table-cell-shadow-left',
93
- slot: 'shadows',
94
86
  }),
95
87
  ),
96
88
  [
97
89
  cell.column.sticky,
98
- cellContent,
99
90
  tableInstance.state.sticky.isScrolledToLeft,
100
91
  tableInstance.state.sticky.isScrolledToRight,
101
92
  ],
102
93
  );
94
+ let defaultCellRendererChildren = React.useMemo(
95
+ () =>
96
+ React.createElement(React.Fragment, null, cellContent, expander, shadows),
97
+ [cellContent, expander, shadows],
98
+ );
103
99
  let cellRendererProps = React.useMemo(
104
100
  () => ({
105
101
  cellElementProps,
@@ -112,9 +108,16 @@ export const TableCell = (props) => {
112
108
  React.Fragment,
113
109
  null,
114
110
  React.createElement(
115
- DefaultCellRendererPropsChildren.Provider,
111
+ DefaultCellContext.Provider,
116
112
  {
117
- value: defaultCellRendererChildren,
113
+ value: React.useMemo(
114
+ () => ({
115
+ children: defaultCellRendererChildren,
116
+ expander,
117
+ shadows,
118
+ }),
119
+ [defaultCellRendererChildren, expander, shadows],
120
+ ),
118
121
  },
119
122
  cell.column.cellRenderer
120
123
  ? cell.column.cellRenderer({
@@ -16,12 +16,23 @@ export type DefaultCellProps<T extends Record<string, unknown>> = {
16
16
  /**
17
17
  * Should the contents of the cell be clamped after a certain number of lines?
18
18
  *
19
- * Will be enabled by default if the cell content is a string and a custom `Cell`
20
- * is not specified in the column object.
19
+ * Will be enabled by default if the `text` prop is used, or if the cell content
20
+ * is a string and a custom `Cell` is not specified in the column object.
21
21
  */
22
22
  clamp?: boolean;
23
+ /**
24
+ * Main text content displayed inside the cell. This takes precedence over `children`.
25
+ *
26
+ * This will be conditionally wrapped with additional elements for better text selection
27
+ * experience and also for line clamping (if `clamp` prop is not set to `false`).
28
+ */
29
+ text?: string;
23
30
  } & CellRendererProps<T> & React.ComponentPropsWithoutRef<'div'>;
24
- export declare const DefaultCellRendererPropsChildren: React.Context<React.ReactNode>;
31
+ export declare const DefaultCellContext: React.Context<{
32
+ children?: React.ReactNode;
33
+ expander?: React.ReactNode;
34
+ shadows?: React.ReactNode;
35
+ }>;
25
36
  /**
26
37
  * Default cell.
27
38
  * It should be passed to `cellRenderer`.