react-magma-dom 7.1.0-next.8 → 7.1.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 (42) hide show
  1. package/ai/SKILL.md +143 -0
  2. package/ai/setup-guide.md +44 -0
  3. package/ai/styling-guide.md +89 -0
  4. package/dist/components/Checkbox/index.d.ts +1 -1
  5. package/dist/components/Combobox/Combobox.stories.d.ts +47 -1
  6. package/dist/components/EmptyState/styles.d.ts +5 -0
  7. package/dist/components/IndeterminateCheckbox/index.d.ts +1 -1
  8. package/dist/components/Pagination/PageButton.d.ts +2 -0
  9. package/dist/components/Pagination/Pagination.d.ts +5 -0
  10. package/dist/components/Pagination/Pagination.stories.d.ts +29 -0
  11. package/dist/components/Pagination/usePagination.d.ts +1 -0
  12. package/dist/components/Pagination/utils.d.ts +1 -0
  13. package/dist/components/Radio/index.d.ts +1 -1
  14. package/dist/components/Select/ItemsList.d.ts +1 -1
  15. package/dist/components/Select/Select.stories.d.ts +43 -1
  16. package/dist/components/Select/utils.d.ts +3 -0
  17. package/dist/components/Stepper/Step.d.ts +3 -1
  18. package/dist/components/Table/Table.stories.d.ts +30 -0
  19. package/dist/components/Table/TableHeaderCell.d.ts +2 -1
  20. package/dist/components/Tabs/Tabs.stories.d.ts +47 -0
  21. package/dist/components/Tagline/Tagline.stories.d.ts +9 -0
  22. package/dist/components/Tagline/index.d.ts +21 -0
  23. package/dist/components/Toggle/index.d.ts +1 -1
  24. package/dist/components/TreeView/TreeItemHierarchyContext.d.ts +2 -0
  25. package/dist/components/TreeView/TreeView.d.ts +3 -3
  26. package/dist/components/TreeView/TreeView.stories.d.ts +21 -0
  27. package/dist/components/TreeView/TreeViewAnnounceContext.d.ts +4 -5
  28. package/dist/components/TreeView/TreeViewAnnouncer.d.ts +2 -1
  29. package/dist/components/TreeView/TreeViewVirtualizationContext.d.ts +8 -0
  30. package/dist/components/TreeView/VirtualizedTreeItemFlow.d.ts +8 -0
  31. package/dist/components/TreeView/useTreeItem.d.ts +3 -1
  32. package/dist/components/TreeView/utils.d.ts +3 -1
  33. package/dist/esm/index.js +1046 -469
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/i18n/interface.d.ts +3 -0
  36. package/dist/index.d.ts +2 -0
  37. package/dist/properties.json +56 -9
  38. package/dist/react-magma-dom.cjs.development.js +1041 -458
  39. package/dist/react-magma-dom.cjs.development.js.map +1 -1
  40. package/dist/react-magma-dom.cjs.production.min.js +1 -1
  41. package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
  42. package/package.json +9 -5
@@ -34,7 +34,8 @@ export interface TableHeaderCellProps extends React.HTMLAttributes<HTMLTableCell
34
34
  */
35
35
  testId?: string;
36
36
  /**
37
- * Width of the component, set by CSS
37
+ * Width of the component, set by CSS. Header text wraps onto multiple lines
38
+ * when it exceeds the column width.
38
39
  * @default auto
39
40
  */
40
41
  width?: string | number;
@@ -12,6 +12,53 @@ export declare const Default: {
12
12
  };
13
13
  };
14
14
  };
15
+ export declare const FullWidth: {
16
+ render: any;
17
+ args: {
18
+ isFullWidth: boolean;
19
+ };
20
+ parameters: {
21
+ controls: {
22
+ exclude: string[];
23
+ };
24
+ };
25
+ };
26
+ export declare const LongLabels: {
27
+ render: any;
28
+ args: {
29
+ isFullWidth: boolean;
30
+ };
31
+ parameters: {
32
+ controls: {
33
+ exclude: string[];
34
+ };
35
+ };
36
+ };
37
+ export declare const LongLabelsWithIcons: {
38
+ render: any;
39
+ args: {
40
+ iconPosition: TabsIconPosition;
41
+ isFullWidth: boolean;
42
+ };
43
+ };
44
+ export declare const Vertical: {
45
+ render: any;
46
+ args: {
47
+ orientation: TabsOrientation;
48
+ };
49
+ parameters: {
50
+ controls: {
51
+ exclude: string[];
52
+ };
53
+ };
54
+ };
55
+ export declare const VerticalWithIcons: {
56
+ render: any;
57
+ args: {
58
+ iconPosition: TabsIconPosition;
59
+ orientation: TabsOrientation;
60
+ };
61
+ };
15
62
  export declare const Icon: {
16
63
  render: any;
17
64
  args: {
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ declare const _default: any;
3
+ export default _default;
4
+ export declare const Default: {
5
+ render: (args: any) => React.JSX.Element;
6
+ };
7
+ export declare const Inverse: {
8
+ render: (args: any) => React.JSX.Element;
9
+ };
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ export interface TaglineProps extends React.HTMLAttributes<HTMLParagraphElement> {
3
+ /**
4
+ * @children required
5
+ */
6
+ children: React.ReactNode;
7
+ /**
8
+ * @internal
9
+ */
10
+ css?: any;
11
+ /**
12
+ * Uses the inverse text color for dark backgrounds
13
+ * @default false
14
+ */
15
+ isInverse?: boolean;
16
+ /**
17
+ * @internal
18
+ */
19
+ testId?: string;
20
+ }
21
+ export declare const Tagline: React.ForwardRefExoticComponent<TaglineProps & React.RefAttributes<HTMLParagraphElement>>;
@@ -46,7 +46,7 @@ export interface ToggleProps extends React.InputHTMLAttributes<HTMLInputElement>
46
46
  */
47
47
  testId?: string;
48
48
  /**
49
- * Whether the label appears to the left of the right of the toggle switch
49
+ * Whether the label appears to the left or the right of the toggle switch
50
50
  * @default ToggleTextPosition.left
51
51
  */
52
52
  textPosition?: ToggleTextPosition;
@@ -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 {};
@@ -7,9 +7,9 @@ export interface TreeViewProps extends Omit<React.HTMLAttributes<HTMLUListElemen
7
7
  */
8
8
  enableVirtualization?: boolean;
9
9
  /**
10
- * Height of the TreeView container in pixels.
11
- * REQUIRED when enableVirtualization is true.
12
- * Without a fixed height, virtualization cannot calculate the viewport properly.
10
+ * Height of the scrollable TreeView container in pixels.
11
+ * When enableVirtualization is true, provide this prop or a bounded CSS
12
+ * height with overflow: auto so virtualization can calculate the viewport.
13
13
  * @example height={400}
14
14
  */
15
15
  height?: number;
@@ -210,6 +210,27 @@ export declare const VirtualizedLargeTree: {
210
210
  enableVirtualization: boolean;
211
211
  };
212
212
  };
213
+ export declare const ResizableVirtualizedTree: {
214
+ render: ({ lessonsPerChapter, ...args }: TreeViewProps & {
215
+ lessonsPerChapter: number;
216
+ }) => React.JSX.Element;
217
+ args: {
218
+ ariaLabel: string;
219
+ enableVirtualization: boolean;
220
+ initialExpandedItems: string[];
221
+ testId: string;
222
+ lessonsPerChapter: number;
223
+ };
224
+ argTypes: {
225
+ lessonsPerChapter: {
226
+ control: {
227
+ type: string;
228
+ min: number;
229
+ max: number;
230
+ };
231
+ };
232
+ };
233
+ };
213
234
  export declare const SelectChildrenOnly: {
214
235
  render: (args: TreeViewProps) => React.JSX.Element;
215
236
  args: {
@@ -1,11 +1,10 @@
1
1
  import * as React from 'react';
2
2
  export interface TreeViewAnnounceContextInterface {
3
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.
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: (string | number | React.ReactElement<any, string | ((props: any, deprecatedLegacyContext?: any) => React.ReactElement<any, any>) | (new (props: any, deprecatedLegacyContext?: any) => React.Component<any, any, any>)> | Iterable<React.ReactNode> | React.ReactPortal)[];
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" | "checkChildren" | "selectable" | "preselectedItems" | "checkParents" | "children" | "isTopLevelSelectable"> & {
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, }: {