react-magma-dom 5.1.1-rc.4 → 5.1.1-rc.6

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.
@@ -45,3 +45,11 @@ export declare const DateFieldDefault: {
45
45
  helperMessage: string;
46
46
  };
47
47
  };
48
+ export declare const InsideModal: {
49
+ render: (args: any) => React.JSX.Element;
50
+ args: {
51
+ labelText: string;
52
+ errorMessage: string;
53
+ helperMessage: string;
54
+ };
55
+ };
@@ -3,6 +3,7 @@ import { IconProps } from 'react-magma-icons';
3
3
  import { ThemeInterface } from '../../theme/magma';
4
4
  import { XOR } from '../../utils';
5
5
  import { ButtonProps, ButtonSize } from '../Button';
6
+ import { ToggleButtonGroupRole } from '../ToggleButtonGroup';
6
7
  export interface ToggleButtonTextProps extends ButtonProps {
7
8
  /**
8
9
  * Sets a disabled state for a button.
@@ -58,6 +59,12 @@ export interface ToggleButtonIconProps extends ButtonProps {
58
59
  theme?: ThemeInterface;
59
60
  }
60
61
  export declare type ToggleButtonProps = XOR<ToggleButtonTextProps, ToggleButtonIconProps>;
62
+ export declare enum ToggleButtonRole {
63
+ radio = "radio",
64
+ switch = "switch",
65
+ tab = "tab"
66
+ }
67
+ export declare function getToggleButtonRole(groupRole?: ToggleButtonGroupRole, exclusive?: boolean): ToggleButtonRole;
61
68
  export declare function setIconWidth(props: ToggleButtonIconProps): string;
62
69
  export declare function setBackgroundColor(props: any): string;
63
70
  export declare const ToggleButtonStyles: (props: any) => import("@emotion/react").SerializedStyles;
@@ -2,7 +2,12 @@ import * as React from 'react';
2
2
  import { ThemeInterface } from '../../theme/magma';
3
3
  import { ButtonSize } from '../Button';
4
4
  import { ButtonGroupProps } from '../ButtonGroup';
5
- export interface ToggleButtonGroupProps extends ButtonGroupProps {
5
+ export declare enum ToggleButtonGroupRole {
6
+ group = "group",
7
+ radiogroup = "radiogroup",
8
+ tablist = "tablist"
9
+ }
10
+ export interface ToggleButtonGroupProps extends Omit<ButtonGroupProps, 'role'> {
6
11
  /**
7
12
  * @children required
8
13
  */
@@ -26,6 +31,15 @@ export interface ToggleButtonGroupProps extends ButtonGroupProps {
26
31
  * The onChange handler for managing state of toggle buttons by your custom logic.
27
32
  */
28
33
  onChange?: (event: React.ChangeEvent<HTMLInputElement>, value?: string) => void;
34
+ /**
35
+ * ARIA role for the group container. `tablist` renders children as tabs
36
+ * (`aria-selected`); `radiogroup` renders them as radios (`aria-checked`);
37
+ * `group` renders radios or switches based on `exclusive`. `tablist` and
38
+ * `radiogroup` are single-select patterns, so pair them with `exclusive`
39
+ * (and `enforced` for tabs, to keep one selected at all times).
40
+ * @default ToggleButtonGroupRole.group
41
+ */
42
+ role?: ToggleButtonGroupRole;
29
43
  /**
30
44
  * @internal
31
45
  */
@@ -46,6 +60,7 @@ export interface ToggleButtonGroupContextInterface {
46
60
  isInverse?: boolean;
47
61
  enforced?: boolean;
48
62
  exclusive?: boolean;
63
+ role?: ToggleButtonGroupRole;
49
64
  selected?: boolean;
50
65
  onChange?: (event: React.ChangeEvent<HTMLInputElement>, value?: string) => void;
51
66
  size?: ButtonSize;
@@ -23,3 +23,11 @@ export declare const DifferentToggleButtons: {
23
23
  noSpace: boolean;
24
24
  };
25
25
  };
26
+ export declare const TablistPattern: {
27
+ render: (args: any) => React.JSX.Element;
28
+ args: {
29
+ enforced: boolean;
30
+ exclusive: boolean;
31
+ role: string;
32
+ };
33
+ };