react-magma-dom 7.1.0-next.20 → 7.1.0-next.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/SKILL.md +3 -2
- package/dist/components/TreeView/TreeItemHierarchyContext.d.ts +2 -0
- package/dist/components/TreeView/TreeViewAnnounceContext.d.ts +4 -5
- package/dist/components/TreeView/TreeViewAnnouncer.d.ts +2 -1
- package/dist/components/TreeView/TreeViewVirtualizationContext.d.ts +8 -0
- package/dist/components/TreeView/VirtualizedTreeItemFlow.d.ts +8 -0
- package/dist/components/TreeView/useTreeItem.d.ts +3 -1
- package/dist/components/TreeView/utils.d.ts +3 -1
- package/dist/esm/index.js +472 -119
- package/dist/esm/index.js.map +1 -1
- package/dist/properties.json +10 -1
- package/dist/react-magma-dom.cjs.development.js +473 -118
- package/dist/react-magma-dom.cjs.development.js.map +1 -1
- package/dist/react-magma-dom.cjs.production.min.js +1 -1
- package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
- package/package.json +1 -1
package/ai/SKILL.md
CHANGED
|
@@ -3,9 +3,9 @@ name: react-magma
|
|
|
3
3
|
description: Use when writing or editing React UI in a project that depends on react-magma-dom (Cengage's accessible component library) — finding the right component, its props, theming, inverse surfaces, icons and accessibility.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# React Magma (react-magma-dom 7.1.0-next.
|
|
6
|
+
# React Magma (react-magma-dom 7.1.0-next.22)
|
|
7
7
|
|
|
8
|
-
Accessible React component library. This guide is generated for react-magma-dom 7.1.0-next.
|
|
8
|
+
Accessible React component library. This guide is generated for react-magma-dom 7.1.0-next.22, which requires React ^18.3.1.
|
|
9
9
|
|
|
10
10
|
## How to use this guide
|
|
11
11
|
|
|
@@ -24,6 +24,7 @@ Accessible React component library. This guide is generated for react-magma-dom
|
|
|
24
24
|
|
|
25
25
|
## Library conventions
|
|
26
26
|
|
|
27
|
+
- Omit optional props when the desired value is already the component default. Verify defaults in the installed version's declarations, JSDoc or implementation before omitting them. Set props explicitly when overriding a default; keep required props and explicit values needed to override inherited context.
|
|
27
28
|
- Import from the package root: `import { Button, ButtonColor } from 'react-magma-dom'`.
|
|
28
29
|
- Variants are exported enums (`ButtonColor.secondary`, `ModalSize.large`).
|
|
29
30
|
- Dark backgrounds: `isInverse` prop, or `<InverseContext.Provider value={{ isInverse: true }}>` for a region.
|
|
@@ -10,6 +10,8 @@ interface TreeItemHierarchyContextInterface {
|
|
|
10
10
|
isTopLevel: boolean;
|
|
11
11
|
index: number;
|
|
12
12
|
isVirtualized?: boolean;
|
|
13
|
+
posInSet?: number;
|
|
14
|
+
setSize?: number;
|
|
13
15
|
}
|
|
14
16
|
export declare const TreeItemHierarchyContext: React.Context<TreeItemHierarchyContextInterface>;
|
|
15
17
|
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface TreeViewAnnounceContextInterface {
|
|
3
3
|
/**
|
|
4
|
-
* Publishes a message
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* name.
|
|
4
|
+
* Publishes a message outside the `ul[role="tree"]`. Windows cascade
|
|
5
|
+
* messages use the source item's live region; other messages use the tree's
|
|
6
|
+
* shared region.
|
|
8
7
|
*/
|
|
9
|
-
announce: (message: string) => void;
|
|
8
|
+
announce: (message: string, itemId?: string) => void;
|
|
10
9
|
}
|
|
11
10
|
export declare const TreeViewAnnounceContext: React.Context<TreeViewAnnounceContextInterface>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface TreeViewAnnouncerHandle {
|
|
3
|
-
announce: (message: string) => void;
|
|
3
|
+
announce: (message: string, itemId?: string) => void;
|
|
4
4
|
}
|
|
5
5
|
export interface TreeViewAnnouncerProps {
|
|
6
|
+
branchIds: string[];
|
|
6
7
|
testId?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare const ANNOUNCE_DELAY_MS = 150;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface TreeViewVirtualizationContextValue {
|
|
3
|
+
scrollRef: React.RefObject<HTMLUListElement>;
|
|
4
|
+
requestedItemId: string | null;
|
|
5
|
+
resolveRequestedFocus: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const TreeViewVirtualizationContext: React.Context<TreeViewVirtualizationContextValue>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface VirtualizedTreeItemFlowProps {
|
|
3
|
+
childDepth: number;
|
|
4
|
+
children: React.ReactNode[];
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const VirtualizedTreeItemFlow: ({ childDepth, children, expanded, }: VirtualizedTreeItemFlowProps) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -67,6 +67,8 @@ export interface UseTreeItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
|
67
67
|
* Used in virtualization to indicate this item has TreeItem children.
|
|
68
68
|
*/
|
|
69
69
|
hasTreeItemChildren?: boolean;
|
|
70
|
+
/** @internal Direct child IDs retained when virtualization removes nested JSX. */
|
|
71
|
+
directChildItemIds?: string[];
|
|
70
72
|
}
|
|
71
73
|
export declare const checkedStatusToBoolean: (status: IndeterminateCheckboxStatus) => boolean;
|
|
72
74
|
export declare function useTreeItem(props: UseTreeItemProps, forwardedRef: any): {
|
|
@@ -80,7 +82,7 @@ export declare function useTreeItem(props: UseTreeItemProps, forwardedRef: any):
|
|
|
80
82
|
parentDepth: number;
|
|
81
83
|
ref: (node: any) => void;
|
|
82
84
|
selectedItems: import("./TreeViewSelectionContext").TreeItemSelectedInterface[];
|
|
83
|
-
treeItemChildren:
|
|
85
|
+
treeItemChildren: React.ReactNode[];
|
|
84
86
|
isDisabled: boolean;
|
|
85
87
|
};
|
|
86
88
|
handleClick: (event: React.SyntheticEvent | React.ChangeEvent, clickedItemId: string) => void;
|
|
@@ -9,6 +9,8 @@ export declare enum TreeNodeType {
|
|
|
9
9
|
branch = "branch",
|
|
10
10
|
leaf = "leaf"
|
|
11
11
|
}
|
|
12
|
+
export declare function flattenTreeViewChildren(children: React.ReactNode): React.ReactNode[];
|
|
13
|
+
export declare function containsTreeItem(children: React.ReactNode, itemId: string): boolean;
|
|
12
14
|
declare type TreeViewI18n = Required<NonNullable<I18nInterface['treeView']>>;
|
|
13
15
|
export declare function resolveTreeViewString(i18n: I18nInterface, key: keyof TreeViewI18n): string;
|
|
14
16
|
export declare function resolveExpansionAnnounceTemplate(i18n: I18nInterface, expanded: boolean): string;
|
|
@@ -40,7 +42,7 @@ export declare const getChildrenIds: ({ items, itemId, parentChildMap, }: {
|
|
|
40
42
|
itemId: TreeViewItemInterface['itemId'];
|
|
41
43
|
parentChildMap?: Map<string, string[]>;
|
|
42
44
|
}) => string[];
|
|
43
|
-
export declare const getInitialItems: ({ children, preselectedItems: rawPreselectedItems, checkParents, checkChildren, selectable, isDisabled: isTreeViewDisabled, isTopLevelSelectable, items, }: Pick<UseTreeViewProps, "isDisabled" | "
|
|
45
|
+
export declare const getInitialItems: ({ children, preselectedItems: rawPreselectedItems, checkParents, checkChildren, selectable, isDisabled: isTreeViewDisabled, isTopLevelSelectable, items, }: Pick<UseTreeViewProps, "isDisabled" | "children" | "checkChildren" | "selectable" | "preselectedItems" | "checkParents" | "isTopLevelSelectable"> & {
|
|
44
46
|
items?: TreeViewItemInterface[];
|
|
45
47
|
}) => any;
|
|
46
48
|
export declare const selectSingle: ({ items, itemId, checkedStatus, }: {
|