@itwin/itwinui-react 1.30.0 → 1.32.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 (66) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/cjs/core/Badge/Badge.js +2 -2
  3. package/cjs/core/Checkbox/Checkbox.d.ts +13 -0
  4. package/cjs/core/Checkbox/Checkbox.js +15 -22
  5. package/cjs/core/ColorPicker/ColorBuilder.js +7 -8
  6. package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
  7. package/cjs/core/ColorPicker/ColorSwatch.js +2 -2
  8. package/cjs/core/ComboBox/ComboBox.d.ts +11 -0
  9. package/cjs/core/ComboBox/ComboBox.js +93 -55
  10. package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +6 -0
  11. package/cjs/core/ExpandableBlock/ExpandableBlock.js +3 -2
  12. package/cjs/core/Menu/Menu.js +3 -3
  13. package/cjs/core/Menu/MenuItem.js +1 -1
  14. package/cjs/core/Radio/Radio.d.ts +13 -0
  15. package/cjs/core/Radio/Radio.js +7 -8
  16. package/cjs/core/Select/Select.js +23 -8
  17. package/cjs/core/Table/TablePaginator.js +7 -9
  18. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +1 -1
  19. package/cjs/core/Tile/Tile.js +4 -4
  20. package/cjs/core/Tree/Tree.d.ts +123 -0
  21. package/cjs/core/Tree/Tree.js +177 -0
  22. package/cjs/core/Tree/TreeContext.d.ts +25 -0
  23. package/cjs/core/Tree/TreeContext.js +20 -0
  24. package/cjs/core/Tree/TreeNode.d.ts +87 -0
  25. package/cjs/core/Tree/TreeNode.js +169 -0
  26. package/cjs/core/Tree/TreeNodeExpander.d.ts +8 -0
  27. package/cjs/core/Tree/TreeNodeExpander.js +46 -0
  28. package/cjs/core/Tree/index.d.ts +6 -0
  29. package/cjs/core/Tree/index.js +13 -0
  30. package/cjs/core/index.d.ts +2 -0
  31. package/cjs/core/index.js +5 -1
  32. package/cjs/core/utils/components/Popover.js +1 -1
  33. package/cjs/core/utils/functions/focusable.js +6 -2
  34. package/esm/core/Badge/Badge.js +2 -2
  35. package/esm/core/Checkbox/Checkbox.d.ts +13 -0
  36. package/esm/core/Checkbox/Checkbox.js +15 -22
  37. package/esm/core/ColorPicker/ColorBuilder.js +7 -8
  38. package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
  39. package/esm/core/ColorPicker/ColorSwatch.js +2 -2
  40. package/esm/core/ComboBox/ComboBox.d.ts +11 -0
  41. package/esm/core/ComboBox/ComboBox.js +94 -56
  42. package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +6 -0
  43. package/esm/core/ExpandableBlock/ExpandableBlock.js +3 -2
  44. package/esm/core/Menu/Menu.js +3 -3
  45. package/esm/core/Menu/MenuItem.js +1 -1
  46. package/esm/core/Radio/Radio.d.ts +13 -0
  47. package/esm/core/Radio/Radio.js +7 -8
  48. package/esm/core/Select/Select.js +23 -8
  49. package/esm/core/Table/TablePaginator.js +7 -9
  50. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +1 -1
  51. package/esm/core/Tile/Tile.js +4 -4
  52. package/esm/core/Tree/Tree.d.ts +123 -0
  53. package/esm/core/Tree/Tree.js +170 -0
  54. package/esm/core/Tree/TreeContext.d.ts +25 -0
  55. package/esm/core/Tree/TreeContext.js +13 -0
  56. package/esm/core/Tree/TreeNode.d.ts +87 -0
  57. package/esm/core/Tree/TreeNode.js +162 -0
  58. package/esm/core/Tree/TreeNodeExpander.d.ts +8 -0
  59. package/esm/core/Tree/TreeNodeExpander.js +39 -0
  60. package/esm/core/Tree/index.d.ts +6 -0
  61. package/esm/core/Tree/index.js +7 -0
  62. package/esm/core/index.d.ts +2 -0
  63. package/esm/core/index.js +1 -0
  64. package/esm/core/utils/components/Popover.js +1 -1
  65. package/esm/core/utils/functions/focusable.js +6 -2
  66. package/package.json +2 -2
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.TreeNode = void 0;
29
+ /*---------------------------------------------------------------------------------------------
30
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
31
+ * See LICENSE.md in the project root for license terms and full copyright notice.
32
+ *--------------------------------------------------------------------------------------------*/
33
+ var react_1 = __importDefault(require("react"));
34
+ var utils_1 = require("../utils");
35
+ require("@itwin/itwinui-css/css/tree.css");
36
+ var classnames_1 = __importDefault(require("classnames"));
37
+ var TreeNodeExpander_1 = require("./TreeNodeExpander");
38
+ var TreeContext_1 = require("./TreeContext");
39
+ /**
40
+ * `TreeNode` component to display node content within a `Tree`.
41
+ * Must be used inside `Tree` component to correctly set node `depth` and `subNodes`.
42
+ * @example
43
+ <TreeNode
44
+ nodeId={props.nodeId}
45
+ label={props.node.label}
46
+ sublabel={props.node.sublabel}
47
+ onExpanded={onExpanded}
48
+ onSelected={onSelectedNodeChange}
49
+ isDisabled={props.isDisabled}
50
+ isExpanded={props.isExpanded}
51
+ isSelected={props.isSelected}
52
+ checkbox={
53
+ <Checkbox variant='eyeball' disabled={props.isDisabled} />
54
+ }
55
+ icon={<SvgPlaceholder />}
56
+ />
57
+ */
58
+ var TreeNode = function (props) {
59
+ var nodeId = props.nodeId, label = props.label, sublabel = props.sublabel, children = props.children, className = props.className, icon = props.icon, _a = props.hasSubNodes, hasSubNodes = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isExpanded, isExpanded = _c === void 0 ? false : _c, _d = props.isSelected, isSelected = _d === void 0 ? false : _d, onSelected = props.onSelected, onExpanded = props.onExpanded, checkbox = props.checkbox, expander = props.expander, rest = __rest(props, ["nodeId", "label", "sublabel", "children", "className", "icon", "hasSubNodes", "isDisabled", "isExpanded", "isSelected", "onSelected", "onExpanded", "checkbox", "expander"]);
60
+ (0, utils_1.useTheme)();
61
+ var _e = (0, TreeContext_1.useTreeContext)(), nodeDepth = _e.nodeDepth, _f = _e.subNodeIds, subNodeIds = _f === void 0 ? [] : _f, parentNodeId = _e.parentNodeId, groupSize = _e.groupSize, indexInGroup = _e.indexInGroup;
62
+ var _g = react_1.default.useState(false), isFocused = _g[0], setIsFocused = _g[1];
63
+ var nodeRef = react_1.default.useRef(null);
64
+ var styleDepth = react_1.default.useMemo(function () {
65
+ var _a, _b, _c;
66
+ return ((_c = (_b = (_a = (0, utils_1.getWindow)()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--level: " + nodeDepth))
67
+ ? { '--level': nodeDepth }
68
+ : { marginLeft: nodeDepth ? nodeDepth * 28 : 0 };
69
+ }, [nodeDepth]);
70
+ var onKeyDown = function (event) {
71
+ var _a, _b, _c, _d, _e, _f, _g;
72
+ var isNodeFocused = nodeRef.current === ((_a = nodeRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument.activeElement);
73
+ switch (event.key) {
74
+ case 'ArrowLeft': {
75
+ event.preventDefault();
76
+ if (isNodeFocused) {
77
+ if (isExpanded) {
78
+ onExpanded(nodeId, false);
79
+ break;
80
+ }
81
+ if (parentNodeId) {
82
+ var parentNode = (_b = nodeRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument.querySelector("#" + parentNodeId);
83
+ parentNode === null || parentNode === void 0 ? void 0 : parentNode.focus();
84
+ break;
85
+ }
86
+ // If it is top level node (doesn't have parent node), then do nothing.
87
+ break;
88
+ }
89
+ var focusableElements = (0, utils_1.getFocusableElements)(nodeRef.current);
90
+ var currentIndex = focusableElements.indexOf((_c = nodeRef.current) === null || _c === void 0 ? void 0 : _c.ownerDocument.activeElement);
91
+ if (currentIndex === 0) {
92
+ (_d = nodeRef.current) === null || _d === void 0 ? void 0 : _d.focus();
93
+ }
94
+ else {
95
+ (_e = focusableElements[currentIndex - 1]) === null || _e === void 0 ? void 0 : _e.focus();
96
+ }
97
+ break;
98
+ }
99
+ case 'ArrowRight': {
100
+ event.preventDefault();
101
+ var focusableElements = (0, utils_1.getFocusableElements)(nodeRef.current);
102
+ if (isNodeFocused) {
103
+ if (!isExpanded && hasSubNodes) {
104
+ onExpanded(nodeId, true);
105
+ break;
106
+ }
107
+ (_f = focusableElements[0]) === null || _f === void 0 ? void 0 : _f.focus();
108
+ break;
109
+ }
110
+ var currentIndex = focusableElements.indexOf((_g = nodeRef.current) === null || _g === void 0 ? void 0 : _g.ownerDocument.activeElement);
111
+ if (currentIndex < focusableElements.length - 1) {
112
+ focusableElements[currentIndex + 1].focus();
113
+ break;
114
+ }
115
+ break;
116
+ }
117
+ case ' ':
118
+ case 'Spacebar':
119
+ case 'Enter': {
120
+ // Ignore if it is called on the element inside, e.g. checkbox or expander
121
+ if (event.target !== nodeRef.current) {
122
+ break;
123
+ }
124
+ event.preventDefault();
125
+ if (!isDisabled) {
126
+ onSelected === null || onSelected === void 0 ? void 0 : onSelected(nodeId, !isSelected);
127
+ }
128
+ break;
129
+ }
130
+ default:
131
+ break;
132
+ }
133
+ };
134
+ var onExpanderClick = react_1.default.useCallback(function (event) {
135
+ onExpanded(nodeId, !isExpanded);
136
+ event.stopPropagation();
137
+ }, [isExpanded, nodeId, onExpanded]);
138
+ return (react_1.default.createElement("li", __assign({ role: 'treeitem', className: (0, classnames_1.default)('iui-tree-item', className), id: nodeId, "aria-expanded": hasSubNodes ? isExpanded : undefined, "aria-disabled": isDisabled, "aria-selected": isSelected, "aria-level": nodeDepth + 1, "aria-setsize": groupSize, "aria-posinset": indexInGroup + 1, tabIndex: -1, onFocus: function (e) {
139
+ setIsFocused(true);
140
+ // Prevents from triggering onFocus on parent Tree
141
+ e.stopPropagation();
142
+ }, onBlur: function () {
143
+ setIsFocused(false);
144
+ }, ref: nodeRef, onKeyDown: onKeyDown }, rest),
145
+ react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-tree-node', {
146
+ 'iui-active': isSelected,
147
+ 'iui-disabled': isDisabled,
148
+ }), style: styleDepth, onClick: function () { return !isDisabled && (onSelected === null || onSelected === void 0 ? void 0 : onSelected(nodeId, !isSelected)); } },
149
+ checkbox && react_1.default.isValidElement(checkbox)
150
+ ? react_1.default.cloneElement(checkbox, {
151
+ className: (0, classnames_1.default)('iui-tree-node-checkbox', checkbox.props.className),
152
+ tabIndex: isFocused ? 0 : -1,
153
+ })
154
+ : checkbox,
155
+ react_1.default.createElement("div", { className: 'iui-tree-node-content' },
156
+ hasSubNodes && expander,
157
+ hasSubNodes && !expander && (react_1.default.createElement(TreeNodeExpander_1.TreeNodeExpander, { isExpanded: isExpanded, disabled: isDisabled, onClick: onExpanderClick, tabIndex: isFocused ? 0 : -1 })),
158
+ icon &&
159
+ react_1.default.cloneElement(icon, {
160
+ className: (0, classnames_1.default)('iui-tree-node-content-icon', icon.props.className),
161
+ }),
162
+ react_1.default.createElement("span", { className: 'iui-tree-node-content-label' },
163
+ react_1.default.createElement("div", { className: 'iui-tree-node-content-title' }, label),
164
+ sublabel && (react_1.default.createElement("div", { className: 'iui-tree-node-content-caption' }, sublabel))),
165
+ children)),
166
+ hasSubNodes && (react_1.default.createElement("ul", { className: 'iui-sub-tree', role: 'group', "aria-owns": subNodeIds.join(',') }))));
167
+ };
168
+ exports.TreeNode = TreeNode;
169
+ exports.default = exports.TreeNode;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { IconButtonProps } from '../Buttons/IconButton';
3
+ import '@itwin/itwinui-css/css/tree.css';
4
+ export declare type TreeNodeExpanderProps = {
5
+ isExpanded?: boolean;
6
+ } & IconButtonProps;
7
+ export declare const TreeNodeExpander: (props: TreeNodeExpanderProps) => JSX.Element;
8
+ export default TreeNodeExpander;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.TreeNodeExpander = void 0;
29
+ /*---------------------------------------------------------------------------------------------
30
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
31
+ * See LICENSE.md in the project root for license terms and full copyright notice.
32
+ *--------------------------------------------------------------------------------------------*/
33
+ var react_1 = __importDefault(require("react"));
34
+ var classnames_1 = __importDefault(require("classnames"));
35
+ var ChevronRight_1 = __importDefault(require("@itwin/itwinui-icons-react/cjs/icons/ChevronRight"));
36
+ var IconButton_1 = require("../Buttons/IconButton");
37
+ require("@itwin/itwinui-css/css/tree.css");
38
+ var TreeNodeExpander = function (props) {
39
+ var isExpanded = props.isExpanded, rest = __rest(props, ["isExpanded"]);
40
+ return (react_1.default.createElement(IconButton_1.IconButton, __assign({ styleType: 'borderless', size: 'small', "aria-label": isExpanded ? 'Collapse' : 'Expand' }, rest),
41
+ react_1.default.createElement(ChevronRight_1.default, { className: (0, classnames_1.default)('iui-tree-node-content-expander-icon', {
42
+ 'iui-tree-node-content-expander-icon-expanded': isExpanded,
43
+ }) })));
44
+ };
45
+ exports.TreeNodeExpander = TreeNodeExpander;
46
+ exports.default = exports.TreeNodeExpander;
@@ -0,0 +1,6 @@
1
+ export { Tree } from './Tree';
2
+ export type { TreeProps, NodeData, NodeRenderProps } from './Tree';
3
+ export { TreeNode } from './TreeNode';
4
+ export type { TreeNodeProps } from './TreeNode';
5
+ export { TreeNodeExpander } from './TreeNodeExpander';
6
+ export type { TreeNodeExpanderProps } from './TreeNodeExpander';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TreeNodeExpander = exports.TreeNode = exports.Tree = void 0;
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ var Tree_1 = require("./Tree");
9
+ Object.defineProperty(exports, "Tree", { enumerable: true, get: function () { return Tree_1.Tree; } });
10
+ var TreeNode_1 = require("./TreeNode");
11
+ Object.defineProperty(exports, "TreeNode", { enumerable: true, get: function () { return TreeNode_1.TreeNode; } });
12
+ var TreeNodeExpander_1 = require("./TreeNodeExpander");
13
+ Object.defineProperty(exports, "TreeNodeExpander", { enumerable: true, get: function () { return TreeNodeExpander_1.TreeNodeExpander; } });
@@ -80,6 +80,8 @@ export { ToggleSwitch } from './ToggleSwitch';
80
80
  export type { ToggleSwitchProps } from './ToggleSwitch';
81
81
  export { Tooltip } from './Tooltip';
82
82
  export type { TooltipProps } from './Tooltip';
83
+ export { Tree, TreeNode, TreeNodeExpander } from './Tree';
84
+ export type { TreeProps, TreeNodeProps, TreeNodeExpanderProps, NodeData, NodeRenderProps, } from './Tree';
83
85
  export { Anchor, Body, Headline, Leading, Small, Subheading, Title, Blockquote, Code, Kbd, KbdKeys, Text, } from './Typography';
84
86
  export type { BodyProps, HeadlineProps, LeadingProps, SmallProps, SubheadingProps, TitleProps, BlockquoteProps, CodeProps, KbdProps, TextProps, } from './Typography';
85
87
  export { UserIcon } from './UserIcon';
package/cjs/core/index.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ModalButtonBar = exports.Modal = exports.MenuExtraContent = exports.MenuDivider = exports.MenuItem = exports.Menu = exports.LabeledTextarea = exports.LabeledSelect = exports.InputGroup = exports.LabeledInput = exports.Label = exports.Input = exports.InformationPanelContent = exports.InformationPanelBody = exports.InformationPanelHeader = exports.InformationPanelWrapper = exports.InformationPanel = exports.HorizontalTab = exports.HorizontalTabs = exports.Tab = exports.VerticalTabs = exports.HeaderLogo = exports.HeaderButton = exports.HeaderBreadcrumbs = exports.Header = exports.Footer = exports.FileUploadTemplate = exports.FileUpload = exports.Fieldset = exports.ExpandableBlock = exports.ErrorPage = exports.DropdownMenu = exports.generateLocalizedStrings = exports.DatePicker = exports.ComboBox = exports.ColorPalette = exports.ColorInputPanel = exports.ColorBuilder = exports.ColorSwatch = exports.ColorPicker = exports.Checkbox = exports.ButtonGroup = exports.SplitButton = exports.IdeasButton = exports.IconButton = exports.DropdownButton = exports.Button = exports.Breadcrumbs = exports.Badge = exports.Alert = void 0;
7
- exports.MiddleTextTruncation = exports.ColorValue = exports.useTheme = exports.getUserColor = exports.Wizard = exports.UserIconGroup = exports.UserIcon = exports.Text = exports.KbdKeys = exports.Kbd = exports.Code = exports.Blockquote = exports.Title = exports.Subheading = exports.Small = exports.Leading = exports.Headline = exports.Body = exports.Anchor = exports.Tooltip = exports.ToggleSwitch = exports.ThemeProvider = exports.toaster = exports.TimePicker = exports.Tile = exports.Textarea = exports.TagContainer = exports.Tag = exports.TablePaginator = exports.EditableCell = exports.DefaultCell = exports.FilterButtonBar = exports.tableFilters = exports.Table = exports.Slider = exports.SidenavSubmenuHeader = exports.SidenavSubmenu = exports.SidenavButton = exports.SideNavigation = exports.Select = exports.RadioTileGroup = exports.RadioTile = exports.Radio = exports.ProgressRadial = exports.ProgressLinear = void 0;
7
+ exports.MiddleTextTruncation = exports.ColorValue = exports.useTheme = exports.getUserColor = exports.Wizard = exports.UserIconGroup = exports.UserIcon = exports.Text = exports.KbdKeys = exports.Kbd = exports.Code = exports.Blockquote = exports.Title = exports.Subheading = exports.Small = exports.Leading = exports.Headline = exports.Body = exports.Anchor = exports.TreeNodeExpander = exports.TreeNode = exports.Tree = exports.Tooltip = exports.ToggleSwitch = exports.ThemeProvider = exports.toaster = exports.TimePicker = exports.Tile = exports.Textarea = exports.TagContainer = exports.Tag = exports.TablePaginator = exports.EditableCell = exports.DefaultCell = exports.FilterButtonBar = exports.tableFilters = exports.Table = exports.Slider = exports.SidenavSubmenuHeader = exports.SidenavSubmenu = exports.SidenavButton = exports.SideNavigation = exports.Select = exports.RadioTileGroup = exports.RadioTile = exports.Radio = exports.ProgressRadial = exports.ProgressLinear = void 0;
8
8
  /*---------------------------------------------------------------------------------------------
9
9
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
10
10
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -126,6 +126,10 @@ var ToggleSwitch_1 = require("./ToggleSwitch");
126
126
  Object.defineProperty(exports, "ToggleSwitch", { enumerable: true, get: function () { return ToggleSwitch_1.ToggleSwitch; } });
127
127
  var Tooltip_1 = require("./Tooltip");
128
128
  Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
129
+ var Tree_1 = require("./Tree");
130
+ Object.defineProperty(exports, "Tree", { enumerable: true, get: function () { return Tree_1.Tree; } });
131
+ Object.defineProperty(exports, "TreeNode", { enumerable: true, get: function () { return Tree_1.TreeNode; } });
132
+ Object.defineProperty(exports, "TreeNodeExpander", { enumerable: true, get: function () { return Tree_1.TreeNodeExpander; } });
129
133
  var Typography_1 = require("./Typography");
130
134
  Object.defineProperty(exports, "Anchor", { enumerable: true, get: function () { return Typography_1.Anchor; } });
131
135
  Object.defineProperty(exports, "Body", { enumerable: true, get: function () { return Typography_1.Body; } });
@@ -59,7 +59,7 @@ exports.Popover = react_1.default.forwardRef(function (props, ref) {
59
59
  },
60
60
  }); },
61
61
  };
62
- var computedProps = __assign(__assign({ allowHTML: true, animation: false, appendTo: 'parent', arrow: false, duration: 0, interactive: true, role: undefined, offset: [0, 0], maxWidth: '' }, props), { className: (0, classnames_1.default)('iui-popover', props.className), plugins: __spreadArray([
62
+ var computedProps = __assign(__assign({ allowHTML: true, animation: false, appendTo: function (el) { return el.ownerDocument.body; }, arrow: false, duration: 0, interactive: true, role: undefined, offset: [0, 0], maxWidth: '', zIndex: 99999 }, props), { className: (0, classnames_1.default)('iui-popover', props.className), plugins: __spreadArray([
63
63
  lazyLoad,
64
64
  removeTabIndex,
65
65
  exports.hideOnEscOrTab
@@ -15,7 +15,9 @@ var getTabbableElements = function (container) {
15
15
  }
16
16
  var elements = container.querySelectorAll(tabbableElementsSelector);
17
17
  return Array.from(elements).filter(function (el) {
18
- return !el.hasAttribute('disabled') && !el.classList.contains('iui-disabled');
18
+ return !el.hasAttribute('disabled') &&
19
+ !el.classList.contains('iui-disabled') &&
20
+ el.getAttribute('aria-disabled') !== 'true';
19
21
  });
20
22
  };
21
23
  exports.getTabbableElements = getTabbableElements;
@@ -28,7 +30,9 @@ var getFocusableElements = function (container) {
28
30
  }
29
31
  var elements = container.querySelectorAll(tabbableElementsSelector + ", [tabindex=\"-1\"]");
30
32
  return Array.from(elements).filter(function (el) {
31
- return !el.hasAttribute('disabled') && !el.classList.contains('iui-disabled');
33
+ return !el.hasAttribute('disabled') &&
34
+ !el.classList.contains('iui-disabled') &&
35
+ el.getAttribute('aria-disabled') !== 'true';
32
36
  });
33
37
  };
34
38
  exports.getFocusableElements = getFocusableElements;
@@ -60,8 +60,8 @@ export var Badge = function (props) {
60
60
  var backgroundColor = props.backgroundColor, style = props.style, className = props.className, children = props.children, rest = __rest(props, ["backgroundColor", "style", "className", "children"]);
61
61
  useTheme();
62
62
  var _style = backgroundColor &&
63
- ((_c = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--badge-color: " + backgroundColor))
64
- ? __assign({ '--badge-color': getBadgeColorValue(backgroundColor) }, style) : __assign({ backgroundColor: getBadgeColorValue(backgroundColor) }, style);
63
+ ((_c = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-badge-background-color: " + backgroundColor))
64
+ ? __assign({ '--iui-badge-background-color': getBadgeColorValue(backgroundColor) }, style) : __assign({ backgroundColor: getBadgeColorValue(backgroundColor) }, style);
65
65
  return (React.createElement("span", __assign({ className: cx('iui-badge', className), style: _style }, rest), children));
66
66
  };
67
67
  export default Badge;
@@ -30,16 +30,23 @@ export declare type CheckboxProps = {
30
30
  isLoading?: boolean;
31
31
  /**
32
32
  * Custom CSS class name for the checkmark element.
33
+ *
34
+ * @deprecated As of 1.32.0, this is applied on the actual checkbox `<input>` element.
35
+ * The checkmark has been moved into a pseudo-element.
33
36
  */
34
37
  checkmarkClassName?: string;
35
38
  /**
36
39
  * Custom CSS Style for the checkmark element.
40
+ *
41
+ * @deprecated As of 1.32.0, this is applied on the actual checkbox `<input>` element.
42
+ * The checkmark has been moved into a pseudo-element.
37
43
  */
38
44
  checkmarkStyle?: React.CSSProperties;
39
45
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>;
40
46
  /**
41
47
  * Simple input checkbox
42
48
  * @example
49
+ * <Checkbox />
43
50
  * <Checkbox label='Basic Checkbox' />
44
51
  * <Checkbox label='Disabled Checkbox' disabled />
45
52
  * <Checkbox label='Checked' checked />
@@ -78,10 +85,16 @@ export declare const Checkbox: React.ForwardRefExoticComponent<{
78
85
  isLoading?: boolean | undefined;
79
86
  /**
80
87
  * Custom CSS class name for the checkmark element.
88
+ *
89
+ * @deprecated As of 1.32.0, this is applied on the actual checkbox `<input>` element.
90
+ * The checkmark has been moved into a pseudo-element.
81
91
  */
82
92
  checkmarkClassName?: string | undefined;
83
93
  /**
84
94
  * Custom CSS Style for the checkmark element.
95
+ *
96
+ * @deprecated As of 1.32.0, this is applied on the actual checkbox `<input>` element.
97
+ * The checkmark has been moved into a pseudo-element.
85
98
  */
86
99
  checkmarkStyle?: React.CSSProperties | undefined;
87
100
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> & React.RefAttributes<HTMLInputElement>>;
@@ -32,6 +32,7 @@ import '@itwin/itwinui-css/css/inputs.css';
32
32
  /**
33
33
  * Simple input checkbox
34
34
  * @example
35
+ * <Checkbox />
35
36
  * <Checkbox label='Basic Checkbox' />
36
37
  * <Checkbox label='Disabled Checkbox' disabled />
37
38
  * <Checkbox label='Checked' checked />
@@ -41,8 +42,8 @@ import '@itwin/itwinui-css/css/inputs.css';
41
42
  * <Checkbox label='Visibility Checkbox' variant='eyeball' />
42
43
  */
43
44
  export var Checkbox = React.forwardRef(function (props, ref) {
44
- var _a;
45
- var className = props.className, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.indeterminate, indeterminate = _c === void 0 ? false : _c, label = props.label, status = props.status, _d = props.variant, variant = _d === void 0 ? 'default' : _d, setFocus = props.setFocus, _e = props.isLoading, isLoading = _e === void 0 ? false : _e, style = props.style, checkmarkClassName = props.checkmarkClassName, checkmarkStyle = props.checkmarkStyle, rest = __rest(props, ["className", "disabled", "indeterminate", "label", "status", "variant", "setFocus", "isLoading", "style", "checkmarkClassName", "checkmarkStyle"]);
45
+ var _a, _b;
46
+ var className = props.className, _c = props.disabled, disabled = _c === void 0 ? false : _c, _d = props.indeterminate, indeterminate = _d === void 0 ? false : _d, label = props.label, status = props.status, _e = props.variant, variant = _e === void 0 ? 'default' : _e, setFocus = props.setFocus, _f = props.isLoading, isLoading = _f === void 0 ? false : _f, style = props.style, checkmarkClassName = props.checkmarkClassName, checkmarkStyle = props.checkmarkStyle, rest = __rest(props, ["className", "disabled", "indeterminate", "label", "status", "variant", "setFocus", "isLoading", "style", "checkmarkClassName", "checkmarkStyle"]);
46
47
  useTheme();
47
48
  var inputElementRef = React.useRef(null);
48
49
  var refs = useMergedRefs(inputElementRef, ref);
@@ -59,27 +60,19 @@ export var Checkbox = React.forwardRef(function (props, ref) {
59
60
  : inputElementRef.current.checked;
60
61
  }
61
62
  });
62
- var defaultCheckbox = (React.createElement("svg", { viewBox: '0 0 16 16', "aria-hidden": 'true', focusable: 'false' },
63
- React.createElement("path", { className: 'iui-check', d: 'm6.5 12.5-4.5-4.5 1.5-1.5 3 3 6-6 1.5 1.5z' }),
64
- React.createElement("path", { className: 'iui-check-partial', d: 'm2.75 6.875h10.5v2.25h-10.5z' })));
65
- var visibilityCheckbox = (React.createElement("svg", { viewBox: '0 0 16 16', "aria-hidden": 'true', focusable: 'false' },
66
- React.createElement("path", { className: 'iui-check', d: 'm8 2.99051a8.81883 8.81883 0 0 0 -8 4.95062 8.74664 8.74664 0 0 0 8 5.06836 8.63266 8.63266 0 0 0 8-5.06836 8.83631 8.83631 0 0 0 -8-4.95062zm-1.31445 1.86981a1.47663 1.47663 0 1 1 -1.47663 1.47668 1.47665 1.47665 0 0 1 1.47663-1.47668zm1.31445 6.64917a7.17486 7.17486 0 0 1 -6.30475-3.55237 7.4952 7.4952 0 0 1 2.81475-2.6336 3.83956 3.83956 0 1 0 6.98126.00244 7.522 7.522 0 0 1 2.81774 2.63916 7.09785 7.09785 0 0 1 -6.309 3.54437z' }),
67
- React.createElement("g", { className: 'iui-check-partial' },
68
- React.createElement("path", { d: 'm8 3v7.9a4.01179 4.01179 0 0 0 4-4 6.7509 6.7509 0 0 0 -.2-1.4l.1.1a6.89429 6.89429 0 0 1 2.4 2.4 8.39088 8.39088 0 0 1 -2.3 2.3 6.89412 6.89412 0 0 1 -3.9 1.2c-.03345 0-.06653-.00677-.1-.0072v1.5072a8.90686 8.90686 0 0 0 8-5 8.90686 8.90686 0 0 0 -8-5z', opacity: '.33' }),
69
- React.createElement("path", { d: 'm8 0a1 1 0 0 0 -1 1v2.07135a8.91637 8.91637 0 0 0 -7 4.92865 8.91637 8.91637 0 0 0 7 4.92865v2.07135a1 1 0 0 0 2 0v-14a1 1 0 0 0 -1-1zm-1.5 4.9a1.55426 1.55426 0 0 1 .5.087v2.81451a1.40746 1.40746 0 0 1 -.5.09849 1.538 1.538 0 0 1 -1.5-1.5 1.53794 1.53794 0 0 1 1.5-1.5zm-2.3 5.4a6.97279 6.97279 0 0 1 -2.5-2.3 6.89429 6.89429 0 0 1 2.4-2.4c.1 0 .1-.1.2-.1a3.194 3.194 0 0 0 -.3 1.4 4.0047 4.0047 0 0 0 3 3.857v.65289a6.37491 6.37491 0 0 1 -2.8-1.10989z' })),
70
- React.createElement("path", { className: 'iui-uncheck', d: 'm1.70671 12.879 11.17218-11.17219 1.4142 1.4142-11.17218 11.17218zm.99329-1.679 1.1-1.1a5.06317 5.06317 0 0 1 -2-2.1 7.48268 7.48268 0 0 1 6.2-3.5 4.86877 4.86877 0 0 1 1.2.1l1.3-1.3a10.07431 10.07431 0 0 0 -2.5-.3 8.84129 8.84129 0 0 0 -8 5 8.42455 8.42455 0 0 0 2.7 3.2zm10.7-6.4-1.1 1.1a7.08625 7.08625 0 0 1 2 2.1 7.50323 7.50323 0 0 1 -6.2 3.5 8.31665 8.31665 0 0 1 -1.3-.2l-1.3 1.3a8.909 8.909 0 0 0 6.4-.5 9.04344 9.04344 0 0 0 4.1-4.1 9.168 9.168 0 0 0 -2.6-3.2z' })));
71
- return (React.createElement("label", { className: cx('iui-checkbox', (_a = {
63
+ var checkbox = (React.createElement(React.Fragment, null,
64
+ React.createElement("input", __assign({ className: cx('iui-checkbox', {
65
+ 'iui-checkbox-visibility': variant === 'eyeball',
66
+ 'iui-loading': isLoading,
67
+ }, className && (_a = {}, _a[className] = !label, _a), checkmarkClassName), style: __assign(__assign({}, (!label && style)), checkmarkStyle), disabled: disabled || isLoading, type: 'checkbox', ref: refs }, rest)),
68
+ isLoading && React.createElement(ProgressRadial, { size: 'x-small', indeterminate: true })));
69
+ return !label ? (checkbox) : (React.createElement("label", { className: cx('iui-checkbox-wrapper', (_b = {
72
70
  'iui-disabled': disabled
73
71
  },
74
- _a["iui-" + status] = !!status,
75
- _a['iui-loading'] = isLoading,
76
- _a['iui-checkbox-visibility'] = variant === 'eyeball',
77
- _a), className), style: style },
78
- React.createElement("input", __assign({ disabled: disabled || isLoading, type: 'checkbox', ref: refs }, rest)),
79
- React.createElement("span", { className: cx('iui-checkbox-checkmark', checkmarkClassName), style: checkmarkStyle },
80
- isLoading && React.createElement(ProgressRadial, { indeterminate: true }),
81
- !isLoading &&
82
- (variant === 'default' ? defaultCheckbox : visibilityCheckbox)),
83
- label && React.createElement("span", { className: 'iui-label' }, label)));
72
+ _b["iui-" + status] = !!status,
73
+ _b['iui-loading'] = isLoading,
74
+ _b), className), style: style },
75
+ checkbox,
76
+ label && React.createElement("span", { className: 'iui-checkbox-label' }, label)));
84
77
  });
85
78
  export default Checkbox;
@@ -63,21 +63,20 @@ export var ColorBuilder = React.forwardRef(function (props, ref) {
63
63
  ]);
64
64
  var _p = React.useState(false), colorDotActive = _p[0], setColorDotActive = _p[1];
65
65
  var hueColorString = hueSliderColor.toHexString();
66
- var colorSquareStyle = ((_c = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--hue:\u00A0" + hueColorString))
66
+ var colorSquareStyle = ((_c = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-color-field-hue: " + hueColorString))
67
67
  ? {
68
- '--hue': hueColorString,
69
- '--selected-color': dotColorString,
68
+ '--iui-color-field-hue': hueColorString,
69
+ '--iui-color-picker-selected-color': dotColorString,
70
70
  }
71
71
  : { backgroundColor: hueColorString };
72
- var opacitySliderStyle = ((_f = (_e = (_d = getWindow()) === null || _d === void 0 ? void 0 : _d.CSS) === null || _e === void 0 ? void 0 : _e.supports) === null || _f === void 0 ? void 0 : _f.call(_e, "--selected-color:\u00A0" + hueColorString))
73
- ? { '--selected-color': hueColorString }
72
+ var opacitySliderStyle = ((_f = (_e = (_d = getWindow()) === null || _d === void 0 ? void 0 : _d.CSS) === null || _e === void 0 ? void 0 : _e.supports) === null || _f === void 0 ? void 0 : _f.call(_e, "--iui-color-picker-selected-color: " + hueColorString))
73
+ ? { '--iui-color-picker-selected-color': hueColorString }
74
74
  : { backgroundColor: hueColorString };
75
75
  var squareTop = 100 - hsvColor.v;
76
76
  var squareLeft = hsvColor.s;
77
- var colorDotStyle = ((_j = (_h = (_g = getWindow()) === null || _g === void 0 ? void 0 : _g.CSS) === null || _h === void 0 ? void 0 : _h.supports) === null || _j === void 0 ? void 0 : _j.call(_h, "--top:\u00A0" + squareTop.toString() + "%"))
77
+ var colorDotStyle = ((_j = (_h = (_g = getWindow()) === null || _g === void 0 ? void 0 : _g.CSS) === null || _h === void 0 ? void 0 : _h.supports) === null || _j === void 0 ? void 0 : _j.call(_h, "--iui-color-dot-inset: 0"))
78
78
  ? {
79
- '--top': squareTop.toString() + '%',
80
- '--left': squareLeft.toString() + '%',
79
+ '--iui-color-dot-inset': squareTop.toString() + "% auto auto " + squareLeft.toString() + "%",
81
80
  }
82
81
  : {
83
82
  backgroundColor: dotColorString,
@@ -17,5 +17,5 @@ export declare type ColorSwatchProps = {
17
17
  * <ColorSwatch color='#23450b' onClick={onClick}/>
18
18
  * <ColorSwatch color={{ r: 255, g: 255, b: 0 }} onClick={onClick}/>
19
19
  */
20
- export declare const ColorSwatch: React.ForwardRefExoticComponent<Pick<ColorSwatchProps, "dir" | "slot" | "style" | "title" | "id" | "role" | "children" | "className" | "accessKey" | "draggable" | "hidden" | "lang" | "translate" | "prefix" | "contentEditable" | "inputMode" | "tabIndex" | "onFocus" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "isActive"> & React.RefAttributes<HTMLDivElement>>;
20
+ export declare const ColorSwatch: React.ForwardRefExoticComponent<Pick<ColorSwatchProps, "dir" | "slot" | "style" | "title" | "id" | "aria-disabled" | "role" | "children" | "className" | "accessKey" | "draggable" | "hidden" | "lang" | "translate" | "prefix" | "contentEditable" | "inputMode" | "tabIndex" | "onFocus" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "isActive"> & React.RefAttributes<HTMLDivElement>>;
21
21
  export default ColorSwatch;
@@ -45,8 +45,8 @@ export var ColorSwatch = React.forwardRef(function (props, ref) {
45
45
  }, [color]);
46
46
  var _style = React.useMemo(function () {
47
47
  var _a, _b, _c;
48
- return ((_c = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--swatch-color: " + colorString))
49
- ? __assign({ '--swatch-color': colorString }, style) : __assign({ backgroundColor: colorString }, style);
48
+ return ((_c = (_b = (_a = getWindow()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--iui-color-swatch-background: " + colorString))
49
+ ? __assign({ '--iui-color-swatch-background': colorString }, style) : __assign({ backgroundColor: colorString }, style);
50
50
  }, [colorString, style]);
51
51
  return (React.createElement("div", __assign({ className: cx('iui-color-swatch', { 'iui-active': isActive }, className), style: _style, onClick: onClick, tabIndex: isActive ? 0 : -1, "aria-selected": isActive, ref: ref }, rest)));
52
52
  });
@@ -33,6 +33,17 @@ export declare type ComboBoxProps<T> = {
33
33
  * @default 'No options found'
34
34
  */
35
35
  emptyStateMessage?: string;
36
+ /**
37
+ * A custom item renderer can be specified to control the rendering.
38
+ * This function should ideally return a customized version of `MenuItem`,
39
+ * otherwise you will need to make sure to provide styling for the `isFocused` state.
40
+ */
41
+ itemRenderer?: (option: SelectOption<T>, states: {
42
+ isSelected: boolean;
43
+ isFocused: boolean;
44
+ id: string;
45
+ index: number;
46
+ }) => JSX.Element;
36
47
  } & Pick<InputContainerProps, 'status'> & Omit<CommonProps, 'title'>;
37
48
  /**
38
49
  * ComboBox component that allows typing a value to filter the options in dropdown list.