react-magma-dom 3.2.1 → 3.5.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.
- package/dist/components/Alert/index.d.ts +4 -0
- package/dist/components/AlertBase/index.d.ts +2 -0
- package/dist/components/Banner/index.d.ts +4 -0
- package/dist/components/CharacterCounter/CharacterCounter.d.ts +12 -0
- package/dist/components/CharacterCounter/CharacterCounter.stories.d.ts +16 -0
- package/dist/components/FormFieldContainer/FormFieldContainer.d.ts +12 -0
- package/dist/components/Grid/Grid.d.ts +12 -0
- package/dist/components/Heading/index.d.ts +5 -1
- package/dist/components/Input/Input.stories.d.ts +322 -1
- package/dist/components/Input/InputMessage.d.ts +1 -1
- package/dist/components/InputBase/index.d.ts +18 -0
- package/dist/components/Pagination/Pagination.d.ts +17 -1
- package/dist/components/Pagination/Pagination.stories.d.ts +3 -1
- package/dist/components/Pagination/SimplePagination.d.ts +2 -0
- package/dist/components/PasswordInput/index.d.ts +5 -0
- package/dist/components/Select/shared.d.ts +1 -0
- package/dist/components/Table/Table.stories.d.ts +9 -0
- package/dist/components/Table/TablePagination.d.ts +6 -0
- package/dist/components/Textarea/Textarea.stories.d.ts +3 -1
- package/dist/components/Textarea/index.d.ts +1 -1
- package/dist/components/Toast/Toast.stories.d.ts +0 -9
- package/dist/components/ToggleButton/ToggleButton.d.ts +66 -0
- package/dist/components/ToggleButton/ToggleButton.stories.d.ts +1135 -0
- package/dist/components/ToggleButton/index.d.ts +1 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +53 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.stories.d.ts +556 -0
- package/dist/components/ToggleButtonGroup/index.d.ts +1 -0
- package/dist/esm/index.js +1700 -1241
- package/dist/esm/index.js.map +1 -1
- package/dist/i18n/interface.d.ts +7 -0
- package/dist/index.d.ts +3 -1
- package/dist/properties.json +949 -91
- package/dist/react-magma-dom.cjs.development.js +1706 -1061
- 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
|
@@ -55,11 +55,20 @@ export interface BasePaginationProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
55
55
|
* @default false
|
|
56
56
|
*/
|
|
57
57
|
showLastButton?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Enum which changes Pagination into a dropdown when using 'simple'.
|
|
60
|
+
* @default PaginationType.classic
|
|
61
|
+
*/
|
|
62
|
+
type?: PaginationType;
|
|
63
|
+
}
|
|
64
|
+
export declare enum PaginationType {
|
|
65
|
+
classic = "classic",
|
|
66
|
+
simple = "simple"
|
|
58
67
|
}
|
|
59
68
|
export interface ControlledPaginationProps extends BasePaginationProps {
|
|
60
69
|
defaultPage: never;
|
|
61
70
|
/**
|
|
62
|
-
* Current page number
|
|
71
|
+
* Current page number when used with onPageChange.
|
|
63
72
|
*/
|
|
64
73
|
page?: number;
|
|
65
74
|
}
|
|
@@ -68,6 +77,9 @@ export interface UncontrolledPaginationProps extends BasePaginationProps {
|
|
|
68
77
|
* Page selected by default when the component is uncontrolled
|
|
69
78
|
*/
|
|
70
79
|
defaultPage?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Current page number when used with onPageChange.
|
|
82
|
+
*/
|
|
71
83
|
page: number;
|
|
72
84
|
}
|
|
73
85
|
export declare type PaginationProps = ControlledPaginationProps | UncontrolledPaginationProps;
|
|
@@ -75,4 +87,8 @@ export declare enum PageButtonSize {
|
|
|
75
87
|
medium = "medium",
|
|
76
88
|
large = "large"
|
|
77
89
|
}
|
|
90
|
+
export declare const NavButton: import("@emotion/styled-base").StyledComponent<({} & import("../IconButton").IconTextButtonProps & React.RefAttributes<HTMLButtonElement>) | ({
|
|
91
|
+
children?: never;
|
|
92
|
+
iconPosition?: never;
|
|
93
|
+
} & import("../IconButton").IconOnlyButtonProps & React.RefAttributes<HTMLButtonElement>), any, import("../..").ThemeInterface>;
|
|
78
94
|
export declare const Pagination: React.ForwardRefExoticComponent<(ControlledPaginationProps & React.RefAttributes<HTMLDivElement>) | (UncontrolledPaginationProps & React.RefAttributes<HTMLDivElement>)>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PaginationProps } from './Pagination';
|
|
2
3
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
4
|
export default _default;
|
|
@@ -6,4 +7,5 @@ export declare const DefaultSelected: import("@storybook/csf").AnnotatedStoryFn<
|
|
|
6
7
|
export declare const AdjacentPages: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, PaginationProps>;
|
|
7
8
|
export declare const EdgePages: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, PaginationProps>;
|
|
8
9
|
export declare const Size: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, PaginationProps>;
|
|
9
|
-
export declare const
|
|
10
|
+
export declare const SimplePagination: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, PaginationProps>;
|
|
11
|
+
export declare const SimplePaginationOnPageChange: () => JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const SimplePagination: React.ForwardRefExoticComponent<(import("./Pagination").ControlledPaginationProps & React.RefAttributes<HTMLDivElement>) | (import("./Pagination").UncontrolledPaginationProps & React.RefAttributes<HTMLDivElement>)>;
|
|
@@ -33,5 +33,10 @@ export interface PasswordInputProps extends Omit<FormFieldContainerBaseProps, 'f
|
|
|
33
33
|
* @internal
|
|
34
34
|
*/
|
|
35
35
|
testId?: string;
|
|
36
|
+
/**
|
|
37
|
+
* String to determine width of input, must be suffixed with "px", "rem", or "%""
|
|
38
|
+
* @default "auto"
|
|
39
|
+
*/
|
|
40
|
+
width?: string;
|
|
36
41
|
}
|
|
37
42
|
export declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -17,5 +17,6 @@ export declare const StyledItem: import("@emotion/styled-base").StyledComponent<
|
|
|
17
17
|
export declare const SelectedItemsWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "slot" | "style" | "title" | "color" | "translate" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css">, import("../..").ThemeInterface>;
|
|
18
18
|
export declare const SelectedItemButton: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
19
19
|
isInverse?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
20
21
|
}, import("../..").ThemeInterface>;
|
|
21
22
|
export declare const IconWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "slot" | "style" | "title" | "color" | "translate" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css">, import("../..").ThemeInterface>;
|
|
@@ -287,6 +287,15 @@ export declare const ControlledPagination: {
|
|
|
287
287
|
};
|
|
288
288
|
};
|
|
289
289
|
export declare const UncontrolledPagination: (args: any) => JSX.Element;
|
|
290
|
+
export declare const PaginationWithSquareCorners: {
|
|
291
|
+
(args: any): JSX.Element;
|
|
292
|
+
args: {
|
|
293
|
+
hasSquareCorners: boolean;
|
|
294
|
+
hasHoverStyles: boolean;
|
|
295
|
+
hasVerticalBorders: boolean;
|
|
296
|
+
hasZebraStripes: boolean;
|
|
297
|
+
};
|
|
298
|
+
};
|
|
290
299
|
export declare const PaginationInverse: {
|
|
291
300
|
(args: any): JSX.Element;
|
|
292
301
|
args: {
|
|
@@ -5,6 +5,7 @@ export interface BaseTablePaginationProps extends React.HTMLAttributes<HTMLDivEl
|
|
|
5
5
|
/**
|
|
6
6
|
* Position of the dropdown content
|
|
7
7
|
* @default DropdownDropDirection.up
|
|
8
|
+
* @deprecated true
|
|
8
9
|
*/
|
|
9
10
|
dropdownDropDirection?: DropdownDropDirection;
|
|
10
11
|
/**
|
|
@@ -28,6 +29,11 @@ export interface BaseTablePaginationProps extends React.HTMLAttributes<HTMLDivEl
|
|
|
28
29
|
* @internal
|
|
29
30
|
*/
|
|
30
31
|
testId?: string;
|
|
32
|
+
/**
|
|
33
|
+
* If true, the table paginator will have square edges
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
hasSquareCorners?: boolean;
|
|
31
37
|
}
|
|
32
38
|
export interface ControlledPageProps {
|
|
33
39
|
/**
|
|
@@ -9,13 +9,14 @@ export declare const OnClear: {
|
|
|
9
9
|
args: {
|
|
10
10
|
containerStyle?: React.CSSProperties;
|
|
11
11
|
isInverse?: boolean;
|
|
12
|
-
|
|
12
|
+
maxCount?: number;
|
|
13
13
|
testId?: string;
|
|
14
14
|
textareaStyle?: React.CSSProperties;
|
|
15
15
|
value?: string | number | readonly string[];
|
|
16
16
|
iconPosition?: import("../InputBase").InputIconPosition;
|
|
17
17
|
actionable?: boolean;
|
|
18
18
|
errorMessage?: React.ReactNode;
|
|
19
|
+
hasCharacterCounter?: boolean;
|
|
19
20
|
helperMessage?: React.ReactNode;
|
|
20
21
|
inputLength?: number;
|
|
21
22
|
isLabelVisuallyHidden?: boolean;
|
|
@@ -23,6 +24,7 @@ export declare const OnClear: {
|
|
|
23
24
|
labelStyle?: React.CSSProperties;
|
|
24
25
|
labelText?: React.ReactNode;
|
|
25
26
|
labelWidth?: number;
|
|
27
|
+
maxLength?: number;
|
|
26
28
|
messageStyle?: React.CSSProperties;
|
|
27
29
|
autoComplete?: string;
|
|
28
30
|
autoFocus?: boolean;
|
|
@@ -10,7 +10,7 @@ export interface TextareaProps extends Omit<FormFieldContainerBaseProps, 'inputS
|
|
|
10
10
|
/**
|
|
11
11
|
* A number value which gives Character Counter the maximum length of allowable characters in an Textarea.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
maxCount?: number;
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
@@ -20,12 +20,3 @@ export declare const TwoLine: {
|
|
|
20
20
|
isInverse: boolean;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
export declare const MultiLine: {
|
|
24
|
-
(args: any): JSX.Element;
|
|
25
|
-
args: {
|
|
26
|
-
variant: AlertVariant;
|
|
27
|
-
toastDuration: number;
|
|
28
|
-
disableAutoDismiss: boolean;
|
|
29
|
-
isInverse: boolean;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { XOR } from '../../utils';
|
|
3
|
+
import { ThemeInterface } from '../../theme/magma';
|
|
4
|
+
import { ButtonProps, ButtonSize } from '../Button';
|
|
5
|
+
import { IconProps } from 'react-magma-icons';
|
|
6
|
+
export interface ToggleButtonTextProps extends ButtonProps {
|
|
7
|
+
/**
|
|
8
|
+
* Sets a disabled state for a button.
|
|
9
|
+
*/
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Sets an active button state for a single button.
|
|
13
|
+
*/
|
|
14
|
+
isChecked?: boolean;
|
|
15
|
+
isInverse?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Changes the button size: 'small', 'medium', and 'large'.
|
|
18
|
+
*/
|
|
19
|
+
size?: ButtonSize;
|
|
20
|
+
/**
|
|
21
|
+
* Value of the button element
|
|
22
|
+
*/
|
|
23
|
+
value: string;
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
theme?: ThemeInterface;
|
|
28
|
+
}
|
|
29
|
+
export interface ToggleButtonIconProps extends ButtonProps {
|
|
30
|
+
/**
|
|
31
|
+
* Sets the aria-label which is required for icon only buttons.
|
|
32
|
+
*/
|
|
33
|
+
'aria-label'?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Sets a disabled state for a button.
|
|
36
|
+
*/
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Icon which displays alongside text.
|
|
40
|
+
*/
|
|
41
|
+
icon: React.ReactElement<IconProps>;
|
|
42
|
+
/**
|
|
43
|
+
* Sets an active button state for a single button.
|
|
44
|
+
*/
|
|
45
|
+
isChecked?: boolean;
|
|
46
|
+
isInverse?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Changes the button size: 'small', 'medium', and 'large'.
|
|
49
|
+
*/
|
|
50
|
+
size?: ButtonSize;
|
|
51
|
+
/**
|
|
52
|
+
* Value of the button element
|
|
53
|
+
*/
|
|
54
|
+
value: string;
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
theme?: ThemeInterface;
|
|
59
|
+
}
|
|
60
|
+
export declare type ToggleButtonProps = XOR<ToggleButtonTextProps, ToggleButtonIconProps>;
|
|
61
|
+
export declare function setIconWidth(props: ToggleButtonIconProps): string;
|
|
62
|
+
export declare function setBackgroundColor(props: any): string;
|
|
63
|
+
export declare const ToggleButtonStyles: (props: any) => import("@emotion/utils").SerializedStyles;
|
|
64
|
+
export declare const ToggleButton: React.ForwardRefExoticComponent<({} & ToggleButtonIconProps & React.RefAttributes<HTMLButtonElement>) | ({
|
|
65
|
+
icon?: never;
|
|
66
|
+
} & ToggleButtonTextProps & React.RefAttributes<HTMLButtonElement>)>;
|