react-magma-dom 4.10.0-next.3 → 4.10.0-next.31

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 (50) hide show
  1. package/dist/components/AIButton/StyledAIButton.d.ts +13 -0
  2. package/dist/components/AIButton/StyledAIButtonTemplate.d.ts +15 -0
  3. package/dist/components/AIButton/index.d.ts +124 -0
  4. package/dist/components/AIButton/styles.d.ts +14 -0
  5. package/dist/components/Combobox/index.d.ts +1 -14
  6. package/dist/components/DatePicker/CalendarContext.d.ts +4 -0
  7. package/dist/components/DatePicker/CalendarHeader.d.ts +1 -1
  8. package/dist/components/DatePicker/CalendarMonth.d.ts +1 -0
  9. package/dist/components/DatePicker/MonthPicker.d.ts +6 -0
  10. package/dist/components/DatePicker/StyledSelect.d.ts +9 -0
  11. package/dist/components/DatePicker/YearPicker.d.ts +7 -0
  12. package/dist/components/DatePicker/index.d.ts +24 -0
  13. package/dist/components/DatePicker/utils.d.ts +6 -0
  14. package/dist/components/DateTimePicker/index.d.ts +99 -0
  15. package/dist/components/Drawer/Drawer.d.ts +10 -0
  16. package/dist/components/IconButton/index.d.ts +1 -0
  17. package/dist/components/Input/testUtils.d.ts +17 -0
  18. package/dist/components/Modal/Modal.d.ts +11 -1
  19. package/dist/components/Popover/Popover.d.ts +15 -1
  20. package/dist/components/Select/index.d.ts +0 -13
  21. package/dist/components/SelectionControls/InputStyles.d.ts +0 -1
  22. package/dist/components/Table/Table.d.ts +26 -0
  23. package/dist/components/Table/TableHeaderCell.d.ts +9 -1
  24. package/dist/components/Table/TablePagination.d.ts +5 -0
  25. package/dist/components/Table/TableRow.d.ts +1 -1
  26. package/dist/components/Tabs/CustomTab.d.ts +7 -0
  27. package/dist/components/Tabs/Tab.d.ts +6 -0
  28. package/dist/components/Toggle/index.d.ts +2 -2
  29. package/dist/components/Transition/Transition.d.ts +5 -0
  30. package/dist/components/TreeView/TreeItem.d.ts +3 -2
  31. package/dist/components/TreeView/TreeViewContext.d.ts +5 -0
  32. package/dist/components/TreeView/useTreeItem.d.ts +31 -18
  33. package/dist/components/TreeView/useTreeView.d.ts +56 -39
  34. package/dist/components/TreeView/utils.d.ts +3 -1
  35. package/dist/esm/index.js +6304 -4735
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist/hooks/useDeviceDetect.d.ts +6 -1
  38. package/dist/hooks/useMagmaFloating.d.ts +24 -0
  39. package/dist/i18n/interface.d.ts +12 -0
  40. package/dist/index.d.ts +6 -2
  41. package/dist/properties.json +3466 -1825
  42. package/dist/react-magma-dom.cjs.development.js +14271 -12714
  43. package/dist/react-magma-dom.cjs.development.js.map +1 -1
  44. package/dist/react-magma-dom.cjs.production.min.js +1 -1
  45. package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
  46. package/dist/theme/ThemeContext.d.ts +14 -0
  47. package/dist/theme/components/drawerTransition.d.ts +2 -0
  48. package/dist/theme/magma.d.ts +28 -0
  49. package/dist/utils/index.d.ts +2 -0
  50. package/package.json +3 -3
@@ -35,6 +35,11 @@ export interface BaseTablePaginationProps extends React.HTMLAttributes<HTMLDivEl
35
35
  * @default true
36
36
  */
37
37
  hasSquareCorners?: boolean;
38
+ /**
39
+ * If true, the table paginator will have outer border
40
+ * @default false
41
+ */
42
+ hasOutsideBorder?: boolean;
38
43
  }
39
44
  export interface ControlledPageProps {
40
45
  /**
@@ -25,7 +25,7 @@ export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement>
25
25
  onTableRowSelect?: (event: React.ChangeEvent<HTMLInputElement>) => void;
26
26
  rowIndex?: number;
27
27
  /**
28
- * Unique name to be used to identify row for screenreaders
28
+ * Unique name to be used to identify row for screen readers
29
29
  */
30
30
  rowName?: string;
31
31
  /**
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { TabProps } from './Tab';
3
+ /**
4
+ * CustomTab allows full customization of the tab content while preserving tab behavior.
5
+ * You can pass any children (e.g., a Button) and all tab context/props will be handled.
6
+ */
7
+ export declare const CustomTab: React.ForwardRefExoticComponent<TabProps & React.RefAttributes<HTMLButtonElement>>;
@@ -8,6 +8,11 @@ export interface TabProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
8
8
  */
9
9
  icon?: React.ReactElement<any> | React.ReactElement<any>[];
10
10
  isInverse?: boolean;
11
+ /**
12
+ * If true, the tab will have no styles and will render the children directly.
13
+ * @internal
14
+ */
15
+ unstyled?: boolean;
11
16
  /**
12
17
  * Determines whether the tab appears in all-caps
13
18
  * @default TabsTextTransform.uppercase
@@ -33,6 +38,7 @@ export declare const StyledTabsChild: import("@emotion/styled").StyledComponent<
33
38
  isInverse?: boolean;
34
39
  orientation: TabsOrientation;
35
40
  theme: ThemeInterface;
41
+ unstyled?: boolean;
36
42
  }, React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
37
43
  export declare const TabStyles: (props: any) => import("@emotion/react").SerializedStyles;
38
44
  export declare const StyledIcon: import("@emotion/styled").StyledComponent<{
@@ -6,7 +6,7 @@ export declare enum ToggleTextPosition {
6
6
  }
7
7
  export interface ToggleProps extends React.InputHTMLAttributes<HTMLInputElement> {
8
8
  /**
9
- * If true, element is checked (i.e. selected)
9
+ * If true, an element is checked (i.e., selected)
10
10
  * @default false
11
11
  */
12
12
  checked?: boolean;
@@ -29,7 +29,7 @@ export interface ToggleProps extends React.InputHTMLAttributes<HTMLInputElement>
29
29
  hasError?: boolean;
30
30
  isInverse?: boolean;
31
31
  /**
32
- * If true, label text will be hidden visually, but will still be read by assistive technology
32
+ * If true, a label text will be hidden visually, but will still be read by assistive technology
33
33
  * @default false
34
34
  */
35
35
  isTextVisuallyHidden?: boolean;
@@ -94,5 +94,10 @@ export interface TransitionProps extends HTMLMotionProps<'div'> {
94
94
  * @default false
95
95
  */
96
96
  rotate180?: boolean;
97
+ /**
98
+ * Shows the drawer transition animation
99
+ * @internal
100
+ */
101
+ hasDrawerAnimation?: boolean;
97
102
  }
98
103
  export declare const Transition: React.ForwardRefExoticComponent<TransitionProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { UseTreeItemProps } from './useTreeItem';
3
- export declare type TreeItemProps = UseTreeItemProps;
4
- export declare const TreeItem: React.ForwardRefExoticComponent<UseTreeItemProps & React.RefAttributes<HTMLLIElement>>;
3
+ export interface TreeItemProps extends UseTreeItemProps {
4
+ }
5
+ export declare const TreeItem: React.ForwardRefExoticComponent<TreeItemProps & React.RefAttributes<HTMLLIElement>>;
@@ -14,6 +14,10 @@ export interface TreeViewItemInterface {
14
14
  hasOwnTreeItems: boolean;
15
15
  isDisabled?: boolean;
16
16
  }
17
+ export interface ExpandIconInterface {
18
+ size?: number;
19
+ color?: string;
20
+ }
17
21
  export interface TreeViewContextInterface {
18
22
  children?: React.ReactNode[];
19
23
  hasIcons: boolean;
@@ -32,5 +36,6 @@ export interface TreeViewContextInterface {
32
36
  handleExpandedChange: (event: React.SyntheticEvent, expandedItemId: string) => void;
33
37
  expandedSet: Set<string>;
34
38
  isTopLevelSelectable?: boolean;
39
+ expandIconStyles?: ExpandIconInterface;
35
40
  }
36
41
  export declare const TreeViewContext: React.Context<TreeViewContextInterface>;
@@ -2,31 +2,49 @@ import * as React from 'react';
2
2
  import { IconProps } from 'react-magma-icons';
3
3
  import { IndeterminateCheckboxStatus } from '../IndeterminateCheckbox';
4
4
  export interface UseTreeItemProps extends React.HTMLAttributes<HTMLLIElement> {
5
+ /**
6
+ * Enables additional content within the TreeItem.
7
+ */
8
+ additionalContent?: React.ReactNode;
9
+ /**
10
+ * Tree item hover color
11
+ * @default transparent
12
+ */
13
+ hoverColor?: string;
14
+ /**
15
+ * Icon for the tree item
16
+ */
17
+ icon?: React.ReactElement<IconProps>;
18
+ /**
19
+ * If true, element is disabled
20
+ * @default false
21
+ */
22
+ isDisabled?: boolean;
5
23
  /**
6
24
  * Index number
7
25
  * private
8
26
  */
9
27
  index?: number;
10
28
  /**
11
- * Item name
29
+ * @internal
12
30
  */
13
- label: React.ReactNode;
31
+ itemDepth?: number;
14
32
  /**
15
33
  * Item id
16
34
  */
17
35
  itemId: string;
18
36
  /**
19
- * @internal
37
+ * Item name
20
38
  */
21
- testId?: string;
39
+ label: React.ReactNode;
22
40
  /**
23
- * Action that fires when the item is clicked
41
+ * Style properties for the tree item label
24
42
  */
25
- onClick?: () => void;
43
+ labelStyle?: React.CSSProperties;
26
44
  /**
27
- * Icon for the tree item
45
+ * Action that fires when the item is clicked
28
46
  */
29
- icon?: React.ReactElement<IconProps>;
47
+ onClick?: () => void;
30
48
  /**
31
49
  * @internal
32
50
  */
@@ -34,21 +52,16 @@ export interface UseTreeItemProps extends React.HTMLAttributes<HTMLLIElement> {
34
52
  /**
35
53
  * @internal
36
54
  */
37
- itemDepth?: number;
38
- /**
39
- * If true, element is disabled
40
- * @default false
41
- */
42
- isDisabled?: boolean;
43
- /**
44
- * Style properties for the tree item label
45
- */
46
- labelStyle?: React.CSSProperties;
55
+ testId?: string;
47
56
  /**
48
57
  * @internal
49
58
  * Whether this item is a top-level item (no parent)
50
59
  */
51
60
  topLevel?: boolean;
61
+ /**
62
+ * Style properties for the tree item
63
+ */
64
+ treeItemStyles?: React.CSSProperties;
52
65
  }
53
66
  export declare const checkedStatusToBoolean: (status: IndeterminateCheckboxStatus) => boolean;
54
67
  export declare function useTreeItem(props: UseTreeItemProps, forwardedRef: any): {
@@ -10,8 +10,21 @@ export interface TreeViewApi {
10
10
  showLess(): void;
11
11
  expandAll(): void;
12
12
  collapseAll(): void;
13
+ addItem(item: TreeViewItemInterface): void;
13
14
  }
14
15
  export interface UseTreeViewProps {
16
+ /**
17
+ * The ref object that allows TreeView manipulation.
18
+ * Actions available:
19
+ * selectItem({ itemId, checkedStatus }: Pick<TreeViewItemInterface, 'itemId' | 'checkedStatus'>): void - action that allows to change item selection,
20
+ * selectAll(): void - action that allows to select all items,
21
+ * clearAll(): void - action that allows to unselect all items.
22
+ * showMore(): void - action that gets called when a tree has hidden items and they get expanded.
23
+ * showLess(): void - action that gets called when a tree has hidden items and they get collapsed.
24
+ * expandAll(): void - action that allows to expand all items.
25
+ * collapseAll(): void - action that allows to collapse all items.
26
+ */
27
+ apiRef?: React.MutableRefObject<TreeViewApi | undefined>;
15
28
  /**
16
29
  * Text for aria-label attribute for the tree.
17
30
  * If there is no visible name for the element you can reference, use aria-label to provide the user with a recognizable accessible name.
@@ -24,6 +37,29 @@ export interface UseTreeViewProps {
24
37
  * It's required to use either `ariaLabel` OR `ariaLabelledBy`.
25
38
  */
26
39
  ariaLabelledBy?: string;
40
+ /**
41
+ * Only affects if selectable mode is TreeViewSelectable.multi.
42
+ * Determines if the parent checkbox will get selected when the user selects all its children checkboxes.
43
+ * When checkParents is enabled, the TreeView displays the indeterminate state of the parent checkboxes too.
44
+ * @default true
45
+ */
46
+ checkParents?: boolean;
47
+ /**
48
+ * Only affects if selectable mode is TreeViewSelectable.multi.
49
+ * Determines if the child checkboxes get selected when the user selects parent checkbox.
50
+ * @default true
51
+ */
52
+ checkChildren?: boolean;
53
+ children?: React.ReactNode[] | React.ReactNode;
54
+ /**
55
+ * Expand icon styles.
56
+ */
57
+ expandIconStyles?: ExpandIconStylesProps;
58
+ /**
59
+ * If true, every item is disabled
60
+ * @default false
61
+ */
62
+ isDisabled?: boolean;
27
63
  /**
28
64
  * Array list of itemIds of items that should be expanded by default.
29
65
  * For all items expanded, provide an array with all the indexes
@@ -32,19 +68,11 @@ export interface UseTreeViewProps {
32
68
  initialExpandedItems?: Array<string>;
33
69
  isInverse?: boolean;
34
70
  /**
35
- * Array list of itemIds of items that should be selected when the component renders
36
- * * @default [] (no items selected)
37
- */
38
- preselectedItems?: Array<TreeItemSelectedInterface>;
39
- /**
40
- * How many items can be selected in the tree view: single, multi, off
41
- * @default TreeViewSelectable.single
42
- */
43
- selectable?: TreeViewSelectable;
44
- /**
45
- * @internal
71
+ * If false, top-level items will not be selectable in multi-select mode.
72
+ * Their checkboxes will be hidden, and they will only function as expandable groups.
73
+ * @default true
46
74
  */
47
- testId?: string;
75
+ isTopLevelSelectable?: boolean;
48
76
  /**
49
77
  * Action that fires when an item is expanded or collapsed
50
78
  * Return an array of itemIds of items that are expanded
@@ -58,42 +86,30 @@ export interface UseTreeViewProps {
58
86
  */
59
87
  onSelectedItemChange?: (selectedItems: Array<TreeItemSelectedInterface>) => void;
60
88
  /**
61
- * Only affects if selectable mode is TreeViewSelectable.multi.
62
- * Determines if the parent checkbox will get selected when the user selects all its children checkboxes.
63
- * When checkParents is enabled, the TreeView displays the indeterminate state of the parent checkboxes too.
64
- * @default true
89
+ * Array list of itemIds of items that should be selected when the component renders
90
+ * * @default [] (no items selected)
65
91
  */
66
- checkParents?: boolean;
92
+ preselectedItems?: Array<TreeItemSelectedInterface>;
67
93
  /**
68
- * Only affects if selectable mode is TreeViewSelectable.multi.
69
- * Determines if the child checkboxes get selected when the user selects parent checkbox.
70
- * @default true
94
+ * How many items can be selected in the tree view: single, multi, off
95
+ * @default TreeViewSelectable.single
71
96
  */
72
- checkChildren?: boolean;
73
- children?: React.ReactNode[] | React.ReactNode;
97
+ selectable?: TreeViewSelectable;
74
98
  /**
75
- * The ref object that allows TreeView manipulation.
76
- * Actions available:
77
- * selectItem({ itemId, checkedStatus }: Pick<TreeViewItemInterface, 'itemId' | 'checkedStatus'>): void - action that allows to change item selection,
78
- * selectAll(): void - action that allows to select all items,
79
- * clearAll(): void - action that allows to unselect all items.
80
- * showMore(): void - action that gets called when a tree has hidden items and they get expanded.
81
- * showLess(): void - action that gets called when a tree has hidden items and they get collapsed.
82
- * expandAll(): void - action that allows to expand all items.
83
- * collapseAll(): void - action that allows to collapse all items.
99
+ * @internal
84
100
  */
85
- apiRef?: React.MutableRefObject<TreeViewApi | undefined>;
101
+ testId?: string;
102
+ }
103
+ interface ExpandIconStylesProps {
86
104
  /**
87
- * If true, every item is disabled
88
- * @default false
105
+ * Size for the expand/collapse icon.
106
+ * @default 24
89
107
  */
90
- isDisabled?: boolean;
108
+ size?: number;
91
109
  /**
92
- * If false, top-level items will not be selectable in multi-select mode.
93
- * Their checkboxes will be hidden, and they will only function as expandable groups.
94
- * @default true
110
+ * Color for the expand/collapse icon.
95
111
  */
96
- isTopLevelSelectable?: boolean;
112
+ color?: string;
97
113
  }
98
114
  export declare function useTreeView(props: UseTreeViewProps): {
99
115
  contextValue: {
@@ -112,6 +128,7 @@ export declare function useTreeView(props: UseTreeViewProps): {
112
128
  selectItem: ({ itemId, checkedStatus, }: Pick<TreeViewItemInterface, 'itemId'> & Partial<Pick<TreeViewItemInterface, 'checkedStatus'>>) => void;
113
129
  handleExpandedChange: (event: React.SyntheticEvent, itemId: string | string[]) => void;
114
130
  expandedSet: Set<string>;
131
+ expandIconStyles: ExpandIconStylesProps;
115
132
  isTopLevelSelectable: boolean;
116
133
  };
117
134
  };
@@ -34,7 +34,9 @@ export declare const getChildrenIds: ({ items, itemId, }: {
34
34
  items: TreeViewItemInterface[];
35
35
  itemId: TreeViewItemInterface['itemId'];
36
36
  }) => any;
37
- export declare const getInitialItems: ({ children, preselectedItems: rawPreselectedItems, checkParents, checkChildren, selectable, isDisabled: isTreeViewDisabled, isTopLevelSelectable, }: Pick<UseTreeViewProps, 'children' | 'preselectedItems' | 'checkParents' | 'checkChildren' | 'selectable' | 'isDisabled' | 'isTopLevelSelectable'>) => any;
37
+ export declare const getInitialItems: ({ children, preselectedItems: rawPreselectedItems, checkParents, checkChildren, selectable, isDisabled: isTreeViewDisabled, isTopLevelSelectable, items, }: Pick<UseTreeViewProps, "isDisabled" | "checkChildren" | "selectable" | "preselectedItems" | "checkParents" | "children" | "isTopLevelSelectable"> & {
38
+ items?: TreeViewItemInterface[];
39
+ }) => any;
38
40
  export declare const selectSingle: ({ items, itemId, checkedStatus, }: {
39
41
  items: TreeViewItemInterface[];
40
42
  itemId: TreeViewItemInterface['itemId'];