react-magma-dom 7.0.1-next.0 → 7.1.0-next.2

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.
@@ -15,6 +15,12 @@ export interface IndeterminateCheckboxProps extends Omit<CheckboxProps, 'checked
15
15
  * @internal
16
16
  */
17
17
  hideFocus?: boolean;
18
+ /**
19
+ * Suppresses this checkbox's own status live region. Used by `TreeView`,
20
+ * which announces selection itself.
21
+ * @internal
22
+ */
23
+ suppressStatusAnnounce?: boolean;
18
24
  }
19
25
  export declare enum IndeterminateCheckboxStatus {
20
26
  checked = "checked",
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ export interface TreeViewAnnounceContextInterface {
3
+ /**
4
+ * Publishes a message to the tree's single live region, which is owned by
5
+ * `TreeView` and rendered outside the `ul[role="tree"]`. A region rendered
6
+ * inside a tree item would become a permanent part of that item's accessible
7
+ * name.
8
+ */
9
+ announce: (message: string) => void;
10
+ }
11
+ export declare const TreeViewAnnounceContext: React.Context<TreeViewAnnounceContextInterface>;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ export interface TreeViewAnnouncerHandle {
3
+ announce: (message: string) => void;
4
+ }
5
+ export interface TreeViewAnnouncerProps {
6
+ testId?: string;
7
+ }
8
+ export declare const ANNOUNCE_DELAY_MS = 150;
9
+ export declare const TreeViewAnnouncer: React.ForwardRefExoticComponent<TreeViewAnnouncerProps & React.RefAttributes<TreeViewAnnouncerHandle>>;
@@ -4,5 +4,10 @@ export interface TreeViewExpansionContextInterface {
4
4
  handleExpandedChange: (event: React.SyntheticEvent, expandedItemId: string) => void;
5
5
  onExpandedChange?: (event: React.SyntheticEvent, expandedItems: Array<string>) => void;
6
6
  initialExpandedItems: Array<string>;
7
+ /**
8
+ * Marks an expansion change as coming from `expandAll`/`collapseAll`. Tree
9
+ * items stay silent while it is set; `TreeView` announces the action once.
10
+ */
11
+ bulkExpansionRef?: React.MutableRefObject<'expand' | 'collapse' | null>;
7
12
  }
8
13
  export declare const TreeViewExpansionContext: React.Context<TreeViewExpansionContextInterface>;
@@ -137,6 +137,7 @@ export declare function useTreeView(props: UseTreeViewProps): {
137
137
  handleExpandedChange: (event: React.SyntheticEvent, itemId: string | string[]) => void;
138
138
  onExpandedChange: (event: React.SyntheticEvent<Element, Event>, expandedItems: string[]) => void;
139
139
  initialExpandedItems: any[];
140
+ bulkExpansionRef: React.MutableRefObject<"expand" | "collapse">;
140
141
  };
141
142
  configContextValue: {
142
143
  hasIcons: boolean;
@@ -2,12 +2,16 @@ import React from 'react';
2
2
  import { TreeItemSelectedInterface, TreeViewItemInterface } from './TreeViewContext';
3
3
  import { TreeViewSelectable } from './types';
4
4
  import { UseTreeViewProps } from './useTreeView';
5
+ import { I18nInterface } from '../../i18n/interface';
5
6
  import { ThemeInterface } from '../../theme/magma';
6
7
  import { IndeterminateCheckboxStatus } from '../IndeterminateCheckbox';
7
8
  export declare enum TreeNodeType {
8
9
  branch = "branch",
9
10
  leaf = "leaf"
10
11
  }
12
+ declare type TreeViewI18n = Required<NonNullable<I18nInterface['treeView']>>;
13
+ export declare function resolveTreeViewString(i18n: I18nInterface, key: keyof TreeViewI18n): string;
14
+ export declare function resolveExpansionAnnounceTemplate(i18n: I18nInterface, expanded: boolean): string;
11
15
  /**
12
16
  * Leaf node - 1st level has 40px of left padding.
13
17
  * Each level after that adds 56px of left padding.
@@ -66,3 +70,4 @@ export declare const getInitialExpandedIds: ({ items, initialExpandedItems, }: {
66
70
  } & Pick<UseTreeViewProps, "initialExpandedItems">) => any[];
67
71
  export declare const isEqualArrays: <T>(arrayA: T[], arrayB: T[]) => boolean;
68
72
  export declare const isSelectedItemsChanged: (prevSelectedItems: TreeItemSelectedInterface[] | null, selectedItems: TreeItemSelectedInterface[]) => boolean;
73
+ export {};