@itwin/itwinui-react 5.0.0-alpha.12 → 5.0.0-alpha.14

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 (109) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +31 -0
  3. package/dist/DEV/bricks/Anchor.js +2 -2
  4. package/dist/DEV/bricks/Avatar.js +1 -1
  5. package/dist/DEV/bricks/Badge.js +1 -1
  6. package/dist/DEV/bricks/Button.js +2 -2
  7. package/dist/DEV/bricks/Checkbox.js +2 -4
  8. package/dist/DEV/bricks/Chip.js +3 -3
  9. package/dist/DEV/bricks/Description.js +1 -1
  10. package/dist/DEV/bricks/Divider.js +1 -1
  11. package/dist/DEV/bricks/DropdownMenu.js +23 -16
  12. package/dist/DEV/bricks/ErrorRegion.js +106 -0
  13. package/dist/DEV/bricks/Field.internal.js +2 -5
  14. package/dist/DEV/bricks/Field.js +17 -16
  15. package/dist/DEV/bricks/Icon.js +28 -7
  16. package/dist/DEV/bricks/IconButton.internal.js +23 -0
  17. package/dist/DEV/bricks/IconButton.js +24 -19
  18. package/dist/DEV/bricks/Kbd.js +3 -3
  19. package/dist/DEV/bricks/Label.js +1 -1
  20. package/dist/DEV/bricks/Radio.js +2 -4
  21. package/dist/DEV/bricks/Root.js +11 -11
  22. package/dist/DEV/bricks/Select.js +4 -7
  23. package/dist/DEV/bricks/Switch.js +2 -4
  24. package/dist/DEV/bricks/Table.js +2 -2
  25. package/dist/DEV/bricks/Tabs.js +1 -1
  26. package/dist/DEV/bricks/TextBox.js +6 -8
  27. package/dist/DEV/bricks/Toolbar.js +27 -0
  28. package/dist/DEV/bricks/Tooltip.js +4 -4
  29. package/dist/DEV/bricks/Tree.js +3 -3
  30. package/dist/DEV/bricks/TreeItem.js +254 -166
  31. package/dist/DEV/bricks/VisuallyHidden.js +10 -2
  32. package/dist/DEV/bricks/index.js +6 -2
  33. package/dist/DEV/bricks/styles.css.js +1 -1
  34. package/dist/DEV/bricks/~hooks.js +1 -1
  35. package/dist/DEV/bricks/~utils.Dot.js +22 -0
  36. package/dist/DEV/bricks/~utils.ListItem.js +2 -2
  37. package/dist/DEV/foundations/styles.css.js +1 -1
  38. package/dist/bricks/Anchor.d.ts +1 -1
  39. package/dist/bricks/Anchor.js +2 -2
  40. package/dist/bricks/Avatar.d.ts +1 -1
  41. package/dist/bricks/Avatar.js +1 -1
  42. package/dist/bricks/Badge.d.ts +1 -1
  43. package/dist/bricks/Badge.js +1 -1
  44. package/dist/bricks/Button.d.ts +1 -1
  45. package/dist/bricks/Button.js +2 -2
  46. package/dist/bricks/Checkbox.d.ts +2 -2
  47. package/dist/bricks/Checkbox.js +2 -4
  48. package/dist/bricks/Chip.d.ts +1 -1
  49. package/dist/bricks/Chip.js +3 -3
  50. package/dist/bricks/Description.d.ts +1 -1
  51. package/dist/bricks/Description.js +1 -1
  52. package/dist/bricks/Divider.d.ts +2 -2
  53. package/dist/bricks/Divider.js +1 -1
  54. package/dist/bricks/DropdownMenu.d.ts +5 -3
  55. package/dist/bricks/DropdownMenu.js +23 -16
  56. package/dist/bricks/ErrorRegion.d.ts +83 -0
  57. package/dist/bricks/ErrorRegion.js +104 -0
  58. package/dist/bricks/Field.d.ts +8 -2
  59. package/dist/bricks/Field.internal.d.ts +2 -1
  60. package/dist/bricks/Field.internal.js +2 -5
  61. package/dist/bricks/Field.js +17 -16
  62. package/dist/bricks/Icon.d.ts +4 -1
  63. package/dist/bricks/Icon.js +27 -7
  64. package/dist/bricks/IconButton.internal.d.ts +10 -0
  65. package/dist/bricks/IconButton.internal.js +22 -0
  66. package/dist/bricks/IconButton.js +24 -19
  67. package/dist/bricks/Kbd.d.ts +2 -2
  68. package/dist/bricks/Kbd.js +3 -3
  69. package/dist/bricks/Label.d.ts +1 -1
  70. package/dist/bricks/Label.js +1 -1
  71. package/dist/bricks/ProgressBar.d.ts +8 -2
  72. package/dist/bricks/Radio.d.ts +2 -2
  73. package/dist/bricks/Radio.js +2 -4
  74. package/dist/bricks/Root.d.ts +1 -1
  75. package/dist/bricks/Root.js +11 -11
  76. package/dist/bricks/Select.d.ts +1 -1
  77. package/dist/bricks/Select.js +4 -7
  78. package/dist/bricks/Skeleton.d.ts +1 -1
  79. package/dist/bricks/Spinner.d.ts +1 -1
  80. package/dist/bricks/Switch.d.ts +2 -2
  81. package/dist/bricks/Switch.js +2 -4
  82. package/dist/bricks/Table.d.ts +1 -1
  83. package/dist/bricks/Table.js +2 -2
  84. package/dist/bricks/Tabs.d.ts +1 -1
  85. package/dist/bricks/Tabs.js +1 -1
  86. package/dist/bricks/Text.d.ts +1 -1
  87. package/dist/bricks/TextBox.d.ts +1 -1
  88. package/dist/bricks/TextBox.js +6 -8
  89. package/dist/bricks/Toolbar.d.ts +36 -0
  90. package/dist/bricks/Toolbar.js +25 -0
  91. package/dist/bricks/Tooltip.d.ts +2 -2
  92. package/dist/bricks/Tooltip.js +4 -4
  93. package/dist/bricks/Tree.d.ts +2 -2
  94. package/dist/bricks/Tree.js +3 -3
  95. package/dist/bricks/TreeItem.d.ts +24 -8
  96. package/dist/bricks/TreeItem.js +243 -164
  97. package/dist/bricks/VisuallyHidden.d.ts +1 -1
  98. package/dist/bricks/VisuallyHidden.js +10 -2
  99. package/dist/bricks/index.d.ts +3 -1
  100. package/dist/bricks/index.js +6 -2
  101. package/dist/bricks/styles.css.js +1 -1
  102. package/dist/bricks/~hooks.js +1 -1
  103. package/dist/bricks/~utils.Dot.d.ts +11 -0
  104. package/dist/bricks/~utils.Dot.js +21 -0
  105. package/dist/bricks/~utils.ListItem.d.ts +1 -1
  106. package/dist/bricks/~utils.ListItem.js +2 -2
  107. package/dist/bricks/~utils.d.ts +1 -1
  108. package/dist/foundations/styles.css.js +1 -1
  109. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import cx from "classnames";
3
2
  import { Role } from "@ariakit/react/role";
3
+ import cx from "classnames";
4
4
  import { forwardRef } from "./~utils.js";
5
5
  const Label = forwardRef((props, forwardedRef) => {
6
6
  return /* @__PURE__ */ jsx(
@@ -1,5 +1,11 @@
1
- import { type BaseProps } from "./~utils.js";
2
- interface ProgressBarProps extends Omit<BaseProps, "aria-labelledby">, Required<Pick<BaseProps, "aria-labelledby">> {
1
+ import type { BaseProps } from "./~utils.js";
2
+ interface ProgressBarProps extends Omit<BaseProps, "aria-labelledby"> {
3
+ /**
4
+ * Label for the progress bar.
5
+ *
6
+ * This prop is required because `role="progressbar"` requires an accessible name.
7
+ */
8
+ "aria-labelledby": string;
3
9
  /**
4
10
  * The size of the progress bar.
5
11
  * @default "medium"
@@ -1,5 +1,5 @@
1
- import { type RadioProps as AkRadioProps } from "@ariakit/react/radio";
2
- import { type FocusableProps } from "./~utils.js";
1
+ import type { RadioProps as AkRadioProps } from "@ariakit/react/radio";
2
+ import type { FocusableProps } from "./~utils.js";
3
3
  type InputBaseProps = Omit<FocusableProps<"input">, "defaultValue" | "value">;
4
4
  type RadioOwnProps = Pick<AkRadioProps, "value" | "checked" | "onChange">;
5
5
  interface RadioProps extends InputBaseProps, RadioOwnProps {
@@ -1,10 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { Radio as AkRadio } from "@ariakit/react/radio";
2
3
  import cx from "classnames";
3
- import {
4
- Radio as AkRadio
5
- } from "@ariakit/react/radio";
6
- import { forwardRef } from "./~utils.js";
7
4
  import { useFieldControlType } from "./Field.internal.js";
5
+ import { forwardRef } from "./~utils.js";
8
6
  const Radio = forwardRef((props, forwardedRef) => {
9
7
  useFieldControlType("checkable");
10
8
  return /* @__PURE__ */ jsx(
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { type BaseProps } from "./~utils.js";
2
+ import type { BaseProps } from "./~utils.js";
3
3
  interface RootProps extends BaseProps {
4
4
  /**
5
5
  * The color scheme to use for all components under the Root.
@@ -1,11 +1,18 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import * as ReactDOM from "react-dom";
4
- import { Role } from "@ariakit/react/role";
5
2
  import { PortalContext } from "@ariakit/react/portal";
3
+ import { Role } from "@ariakit/react/role";
6
4
  import cx from "classnames";
5
+ import * as React from "react";
6
+ import * as ReactDOM from "react-dom";
7
7
  import foundationsCss from "../foundations/styles.css.js";
8
+ import {
9
+ HtmlSanitizerContext,
10
+ RootNodeContext,
11
+ spriteSheetId,
12
+ useRootNode
13
+ } from "./Root.internal.js";
8
14
  import bricksCss from "./styles.css.js";
15
+ import { useLayoutEffect, useMergedRefs } from "./~hooks.js";
9
16
  import {
10
17
  forwardRef,
11
18
  getOwnerDocument,
@@ -13,13 +20,6 @@ import {
13
20
  isBrowser,
14
21
  isDocument
15
22
  } from "./~utils.js";
16
- import { useLayoutEffect, useMergedRefs } from "./~hooks.js";
17
- import {
18
- HtmlSanitizerContext,
19
- RootNodeContext,
20
- spriteSheetId,
21
- useRootNode
22
- } from "./Root.internal.js";
23
23
  const css = foundationsCss + bricksCss;
24
24
  const Root = forwardRef((props, forwardedRef) => {
25
25
  const {
@@ -187,7 +187,7 @@ function InlineSpriteSheet() {
187
187
  }
188
188
  function loadFonts(rootNode) {
189
189
  const ownerWindow = getWindow(rootNode);
190
- if (!ownerWindow || Array.from(ownerWindow.document.fonts).some(
190
+ if (!ownerWindow?.document?.fonts || Array.from(ownerWindow.document.fonts).some(
191
191
  (font) => font.family === "InterVariable"
192
192
  )) {
193
193
  return;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { type FocusableProps } from "./~utils.js";
2
+ import type { FocusableProps } from "./~utils.js";
3
3
  /**
4
4
  * Compound component for a select element, which allows the user to select a value from a list of options.
5
5
  *
@@ -1,13 +1,10 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import cx from "classnames";
4
2
  import { Role } from "@ariakit/react/role";
5
- import {
6
- forwardRef,
7
- isBrowser
8
- } from "./~utils.js";
9
- import { DisclosureArrow } from "./Icon.js";
3
+ import cx from "classnames";
4
+ import * as React from "react";
10
5
  import { useFieldControlType } from "./Field.internal.js";
6
+ import { DisclosureArrow } from "./Icon.js";
7
+ import { forwardRef, isBrowser } from "./~utils.js";
11
8
  const supportsHas = isBrowser && CSS?.supports?.("selector(:has(+ *))");
12
9
  const HtmlSelectContext = React.createContext(() => {
13
10
  });
@@ -1,4 +1,4 @@
1
- import { type BaseProps } from "./~utils.js";
1
+ import type { BaseProps } from "./~utils.js";
2
2
  interface SkeletonPropsBase extends Omit<BaseProps, "children"> {
3
3
  }
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { type BaseProps } from "./~utils.js";
1
+ import type { BaseProps } from "./~utils.js";
2
2
  interface SpinnerProps extends BaseProps {
3
3
  /**
4
4
  * A text alternative for the spinner.
@@ -1,5 +1,5 @@
1
- import { type CheckboxProps as AkCheckboxProps } from "@ariakit/react/checkbox";
2
- import { type FocusableProps } from "./~utils.js";
1
+ import type { CheckboxProps as AkCheckboxProps } from "@ariakit/react/checkbox";
2
+ import type { FocusableProps } from "./~utils.js";
3
3
  type InputBaseProps = Omit<FocusableProps<"input">, "defaultValue" | "value">;
4
4
  type CheckboxOwnProps = Pick<AkCheckboxProps, "value" | "defaultChecked" | "checked" | "onChange">;
5
5
  interface SwitchProps extends InputBaseProps, CheckboxOwnProps {
@@ -1,10 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { Checkbox as AkCheckbox } from "@ariakit/react/checkbox";
2
3
  import cx from "classnames";
3
- import {
4
- Checkbox as AkCheckbox
5
- } from "@ariakit/react/checkbox";
6
- import { forwardRef } from "./~utils.js";
7
4
  import { useFieldControlType } from "./Field.internal.js";
5
+ import { forwardRef } from "./~utils.js";
8
6
  const Switch = forwardRef(
9
7
  (props, forwardedRef) => {
10
8
  useFieldControlType("checkable");
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { type BaseProps } from "./~utils.js";
2
+ import type { BaseProps } from "./~utils.js";
3
3
  interface HtmlTableProps extends BaseProps {
4
4
  }
5
5
  /**
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Role } from "@ariakit/react/role";
3
- import * as React from "react";
4
3
  import cx from "classnames";
5
- import { forwardRef } from "./~utils.js";
4
+ import * as React from "react";
6
5
  import { useMergedRefs, useSafeContext } from "./~hooks.js";
6
+ import { forwardRef } from "./~utils.js";
7
7
  const TableContext = React.createContext(void 0);
8
8
  const TableHeaderContext = React.createContext(false);
9
9
  const HtmlTable = forwardRef((props, forwardedRef) => {
@@ -1,5 +1,5 @@
1
1
  import * as AkTab from "@ariakit/react/tab";
2
- import { type FocusableProps, type BaseProps } from "./~utils.js";
2
+ import type { BaseProps, FocusableProps } from "./~utils.js";
3
3
  interface TabsProps extends Pick<AkTab.TabProviderProps, "defaultSelectedId" | "selectedId" | "setSelectedId" | "selectOnMove" | "children"> {
4
4
  }
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import cx from "classnames";
3
2
  import * as AkTab from "@ariakit/react/tab";
3
+ import cx from "classnames";
4
4
  import { forwardRef } from "./~utils.js";
5
5
  function Tabs(props) {
6
6
  const {
@@ -1,4 +1,4 @@
1
- import { type BaseProps } from "./~utils.js";
1
+ import type { BaseProps } from "./~utils.js";
2
2
  interface TextProps extends BaseProps {
3
3
  /**
4
4
  * The typography variant to use.
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { Icon } from "./Icon.js";
3
- import { type FocusableProps, type BaseProps } from "./~utils.js";
3
+ import type { BaseProps, FocusableProps } from "./~utils.js";
4
4
  interface BaseInputProps extends FocusableProps<"input"> {
5
5
  }
6
6
  interface TextBoxInputProps extends Omit<BaseInputProps, "children" | "type"> {
@@ -1,12 +1,12 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { Role } from "@ariakit/react/role";
4
2
  import { Focusable } from "@ariakit/react/focusable";
3
+ import { Role } from "@ariakit/react/role";
5
4
  import cx from "classnames";
5
+ import * as React from "react";
6
+ import { useFieldControlType } from "./Field.internal.js";
6
7
  import { Icon } from "./Icon.js";
7
- import { useMergedRefs } from "./~hooks.js";
8
+ import { useEventHandlers, useMergedRefs } from "./~hooks.js";
8
9
  import { forwardRef } from "./~utils.js";
9
- import { useFieldControlType } from "./Field.internal.js";
10
10
  const TextBoxInput = forwardRef(
11
11
  (props, forwardedRef) => {
12
12
  useFieldControlType("textlike");
@@ -70,14 +70,12 @@ const TextBoxRoot = forwardRef(
70
70
  ...props,
71
71
  "data-kiwi-disabled": disabled,
72
72
  className: cx("\u{1F95D}-text-box", props.className),
73
- onPointerDown: (e) => {
74
- props.onPointerDown?.(e);
75
- if (e.defaultPrevented) return;
73
+ onPointerDown: useEventHandlers(props.onPointerDown, (e) => {
76
74
  if (disabled) return;
77
75
  if (e.target !== e.currentTarget) return;
78
76
  e.preventDefault();
79
77
  inputRef.current?.focus();
80
- },
78
+ }),
81
79
  ref: forwardedRef
82
80
  }
83
81
  )
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ import type { BaseProps } from "./~utils.js";
3
+ interface ToolbarProps extends BaseProps {
4
+ /** Must be set to `"solid"` for now. */
5
+ variant: "solid";
6
+ }
7
+ /**
8
+ * A toolbar for grouping related interactive elements.
9
+ *
10
+ * Follows the [ARIA Toolbar pattern](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/) for reducing the number of tab stops.
11
+ *
12
+ * Example:
13
+ * ```jsx
14
+ * <Toolbar.Group variant="solid">
15
+ * <Toolbar.Item render={…} />
16
+ * <Toolbar.Item render={…} />
17
+ * <Toolbar.Item render={…} />
18
+ * </Toolbar.Group>
19
+ * ```
20
+ */
21
+ declare const ToolbarGroup: React.ForwardRefExoticComponent<ToolbarProps & React.RefAttributes<HTMLElement | HTMLDivElement>>;
22
+ interface ToolbarItemProps extends Omit<BaseProps<"button">, "render">, Required<Pick<BaseProps, "render">> {
23
+ }
24
+ /**
25
+ * An item within the toolbar.
26
+ * Should be used with the `render` prop.
27
+ *
28
+ * Example:
29
+ * ```jsx
30
+ * <Toolbar.Item
31
+ * render={<IconButton variant="ghost" … />}
32
+ * />
33
+ * ```
34
+ */
35
+ declare const ToolbarItem: React.ForwardRefExoticComponent<ToolbarItemProps & React.RefAttributes<HTMLElement | HTMLButtonElement>>;
36
+ export { ToolbarGroup as Group, ToolbarItem as Item };
@@ -0,0 +1,25 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as Toolbar from "@ariakit/react/toolbar";
3
+ import cx from "classnames";
4
+ import * as React from "react";
5
+ import { IconButtonContext } from "./IconButton.internal.js";
6
+ import { forwardRef } from "./~utils.js";
7
+ const ToolbarGroup = forwardRef((props, forwardedRef) => {
8
+ return /* @__PURE__ */ jsx(IconButtonContext, { value: React.useMemo(() => ({ iconSize: "large" }), []), children: /* @__PURE__ */ jsx(
9
+ Toolbar.Toolbar,
10
+ {
11
+ ...props,
12
+ className: cx("\u{1F95D}-toolbar", props.className),
13
+ ref: forwardedRef
14
+ }
15
+ ) });
16
+ });
17
+ const ToolbarItem = forwardRef(
18
+ (props, forwardedRef) => {
19
+ return /* @__PURE__ */ jsx(Toolbar.ToolbarItem, { ...props, ref: forwardedRef });
20
+ }
21
+ );
22
+ export {
23
+ ToolbarGroup as Group,
24
+ ToolbarItem as Item
25
+ };
@@ -1,6 +1,6 @@
1
- import * as React from "react";
2
1
  import * as AkTooltip from "@ariakit/react/tooltip";
3
- import { type FocusableProps } from "./~utils.js";
2
+ import * as React from "react";
3
+ import type { FocusableProps } from "./~utils.js";
4
4
  interface TooltipProps extends Omit<FocusableProps<"div">, "content">, Pick<AkTooltip.TooltipProps, "open" | "unmountOnHide">, Pick<AkTooltip.TooltipProviderProps, "defaultOpen" | "setOpen"> {
5
5
  /**
6
6
  * The content to be displayed inside the tooltip when the trigger element is hovered or focused.
@@ -1,10 +1,10 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import cx from "classnames";
4
- import * as AkTooltip from "@ariakit/react/tooltip";
5
2
  import { useStoreState } from "@ariakit/react/store";
6
- import { forwardRef } from "./~utils.js";
3
+ import * as AkTooltip from "@ariakit/react/tooltip";
4
+ import cx from "classnames";
5
+ import * as React from "react";
7
6
  import { usePopoverApi } from "./~hooks.js";
7
+ import { forwardRef } from "./~utils.js";
8
8
  const Tooltip = forwardRef(
9
9
  (props, forwardedRef) => {
10
10
  const generatedId = React.useId();
@@ -1,5 +1,5 @@
1
- import { type BaseProps } from "./~utils.js";
2
- import { Root as TreeItemRoot, Action as TreeItemAction } from "./TreeItem.js";
1
+ import { Action as TreeItemAction, Root as TreeItemRoot } from "./TreeItem.js";
2
+ import type { BaseProps } from "./~utils.js";
3
3
  interface TreeProps extends BaseProps {
4
4
  }
5
5
  /**
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import cx from "classnames";
2
+ import { Composite, useCompositeStore } from "@ariakit/react/composite";
3
3
  import { Role } from "@ariakit/react/role";
4
- import { useCompositeStore, Composite } from "@ariakit/react/composite";
4
+ import cx from "classnames";
5
+ import { Action as TreeItemAction, Root as TreeItemRoot } from "./TreeItem.js";
5
6
  import { forwardRef } from "./~utils.js";
6
- import { Root as TreeItemRoot, Action as TreeItemAction } from "./TreeItem.js";
7
7
  const Tree = forwardRef((props, forwardedRef) => {
8
8
  const composite = useCompositeStore({ orientation: "vertical" });
9
9
  return /* @__PURE__ */ jsx(
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { type BaseProps } from "./~utils.js";
3
- interface TreeItemRootProps extends Omit<BaseProps, "content" | "children"> {
2
+ import type { BaseProps } from "./~utils.js";
3
+ interface TreeItemProps extends Omit<BaseProps, "content" | "children"> {
4
4
  /** Specifies the nesting level of the tree item. Nesting levels start at 1. */
5
5
  "aria-level": number;
6
6
  /** Defines tree item position in the current level of tree items. Integer greater than or equal to 1. */
@@ -93,13 +93,14 @@ interface TreeItemRootProps extends Omit<BaseProps, "content" | "children"> {
93
93
  actions?: React.ReactNode[];
94
94
  /**
95
95
  * Specifies if the tree item is in an error state.
96
+ * The id for an associated error message (e.g. `<ErrorRegion.Item>`) can be passed as a string.
96
97
  *
97
- * Can be combined with the `actions` prop to display an error-related action. The first
98
- * action will be made visible by default.
98
+ * Can be combined with the `actions` prop to display an error-related action (e.g. "Retry").
99
+ * The first action will be made visible by default.
99
100
  *
100
101
  * @default false
101
102
  */
102
- error?: boolean;
103
+ error?: boolean | string;
103
104
  }
104
105
  /**
105
106
  * A treeitem is a node in a tree structure that may be expanded or collapsed to reveal or hide its descendants.
@@ -127,7 +128,7 @@ interface TreeItemRootProps extends Omit<BaseProps, "content" | "children"> {
127
128
  *
128
129
  * Secondary actions can be passed into the `actions` prop.
129
130
  */
130
- declare const TreeItemRoot: React.ForwardRefExoticComponent<TreeItemRootProps & React.RefAttributes<HTMLElement | HTMLDivElement>>;
131
+ declare const TreeItem: React.NamedExoticComponent<TreeItemProps & React.RefAttributes<HTMLElement | HTMLDivElement>>;
131
132
  interface TreeItemActionProps extends Omit<BaseProps<"button">, "children"> {
132
133
  /**
133
134
  * Label for the action.
@@ -155,6 +156,21 @@ interface TreeItemActionProps extends Omit<BaseProps<"button">, "children"> {
155
156
  * to `true` when `error` is set).
156
157
  */
157
158
  visible?: boolean;
159
+ /**
160
+ * A small dot displayed in the corner of the action.
161
+ *
162
+ * The value of this prop gets used as the button's "accessible description".
163
+ *
164
+ * Example:
165
+ * ```tsx
166
+ * <Tree.ItemAction
167
+ * label="Filter"
168
+ * dot="Some filters applied"
169
+ * icon={…}
170
+ * />
171
+ * ```
172
+ */
173
+ dot?: string;
158
174
  }
159
175
  /**
160
176
  * A secondary action for `<Tree.Item>`, to be passed into the `actions` prop. The action is typically
@@ -163,5 +179,5 @@ interface TreeItemActionProps extends Omit<BaseProps<"button">, "children"> {
163
179
  * By default, the action appears only when the treeitem has hover/focus or an error. This behavior can
164
180
  * be overridden using the `visible` prop.
165
181
  */
166
- declare const TreeItemAction: React.ForwardRefExoticComponent<TreeItemActionProps & React.RefAttributes<HTMLElement | HTMLButtonElement>>;
167
- export { TreeItemRoot as Root, TreeItemAction as Action };
182
+ declare const TreeItemAction: React.NamedExoticComponent<TreeItemActionProps & React.RefAttributes<HTMLElement | HTMLButtonElement>>;
183
+ export { TreeItem as Root, TreeItemAction as Action };