@muraldevkit/ui-toolkit 2.25.0 → 2.27.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/button/MrlAnimatedIconButton/MrlAnimatedIconButton.d.ts +1 -1
- package/dist/components/button/MrlIconButton/MrlIconButton.d.ts +4 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/menu/MrlMenu/MrlMenu.d.ts +6 -11
- package/dist/components/menu/MrlMenu/utilities.d.ts +6 -0
- package/dist/components/menu/constants.d.ts +5 -0
- package/dist/components/menu/demo/MenuWithLink.d.ts +3 -4
- package/dist/components/menu/demo/MenuWithPopover.d.ts +19 -0
- package/dist/components/menu/demo/MenuWithSubmenu.d.ts +5 -6
- package/dist/components/menu/demo/MenuWithTrigger.d.ts +5 -6
- package/dist/components/menu/hooks/useBrowserEdgeScroll.d.ts +20 -0
- package/dist/components/modal/MrlModal/MrlModal.d.ts +5 -1
- package/dist/components/popover/MrlPopover/MrlPopover.d.ts +79 -0
- package/dist/components/popover/MrlPopover/index.d.ts +1 -0
- package/dist/components/popover/demo/PopoverWithTrigger.d.ts +22 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/tooltip/MrlTooltip/MrlTooltip.d.ts +3 -1
- package/dist/components/tooltip/MrlTooltipContent/MrlTooltipContent.d.ts +3 -1
- package/dist/components/tooltip/constants.d.ts +4 -3
- package/dist/hooks/useClickOutside/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/styles/MrlPopover/module.scss +100 -0
- package/dist/styles/MrlPopover/variables.scss +16 -0
- package/dist/styles/MrlTooltipContent/variables.scss +4 -0
- package/package.json +1 -1
- package/dist/components/menu/hooks/useMenuScroll.d.ts +0 -17
|
@@ -5,5 +5,5 @@ import './MrlAnimatedIconButton.scss';
|
|
|
5
5
|
interface MrlAnimatedIconButtonProps extends Omit<MrlIconButtonProps, 'icon'> {
|
|
6
6
|
icon: MrlSvgAnimateProps;
|
|
7
7
|
}
|
|
8
|
-
export declare const MrlAnimatedIconButton: React.ForwardRefExoticComponent<Pick<MrlAnimatedIconButtonProps, "form" | "slot" | "style" | "title" | "text" | "dir" | "name" | "children" | "disabled" | "id" | "defaultValue" | "state" | "kind" | "size" | "attrs" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "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" | "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" | "type" | "key" | "value" | "client" | "icon" | "badge" | "disableEvents" | "loading" | "loadingText" | "position" | "tipAnchor" | "toggleAria" | "toggleStyle" | "wrapperClassName" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export declare const MrlAnimatedIconButton: React.ForwardRefExoticComponent<Pick<MrlAnimatedIconButtonProps, "form" | "slot" | "style" | "title" | "text" | "dir" | "name" | "children" | "disabled" | "id" | "defaultValue" | "state" | "kind" | "size" | "attrs" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "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" | "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" | "type" | "key" | "value" | "client" | "icon" | "badge" | "disableEvents" | "loading" | "loadingText" | "position" | "tipAnchor" | "toggleAria" | "toggleStyle" | "tooltipKind" | "wrapperClassName" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MrlButtonKind, MrlButtonSize, MrlButtonState, MrlGhostIconButtonSize, ToggleAria, ToggleStyle } from '../constants';
|
|
3
3
|
import { AttrsObject, MrlComponentProps } from '../../../utils';
|
|
4
|
-
import { MrlTooltipAnchor, MrlTooltipPosition } from '../../tooltip/constants';
|
|
4
|
+
import { MrlTooltipAnchor, MrlTooltipPosition, MrlTooltipVariant } from '../../tooltip/constants';
|
|
5
5
|
import { MrlDeviceClient } from '../../../contexts';
|
|
6
6
|
import './MrlIconButton.scss';
|
|
7
7
|
export interface MrlIconButtonProps extends Omit<MrlComponentProps, 'style'>, React.ComponentProps<'button'> {
|
|
@@ -86,9 +86,11 @@ export interface MrlIconButtonProps extends Omit<MrlComponentProps, 'style'>, Re
|
|
|
86
86
|
* informs the component that this is a toggle button and to add that functionality
|
|
87
87
|
*/
|
|
88
88
|
toggleStyle?: ToggleStyle;
|
|
89
|
+
/** tooltip varient kind */
|
|
90
|
+
tooltipKind?: MrlTooltipVariant;
|
|
89
91
|
/**
|
|
90
92
|
* An optional class name to add to the tooltip wrapper.
|
|
91
93
|
*/
|
|
92
94
|
wrapperClassName?: string;
|
|
93
95
|
}
|
|
94
|
-
export declare const MrlIconButton: React.ForwardRefExoticComponent<Pick<MrlIconButtonProps, "form" | "slot" | "style" | "title" | "text" | "dir" | "name" | "children" | "disabled" | "id" | "defaultValue" | "state" | "kind" | "size" | "attrs" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "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" | "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" | "type" | "key" | "value" | "client" | "icon" | "badge" | "disableEvents" | "loading" | "loadingText" | "position" | "tipAnchor" | "toggleAria" | "toggleStyle" | "wrapperClassName" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<HTMLButtonElement>>;
|
|
96
|
+
export declare const MrlIconButton: React.ForwardRefExoticComponent<Pick<MrlIconButtonProps, "form" | "slot" | "style" | "title" | "text" | "dir" | "name" | "children" | "disabled" | "id" | "defaultValue" | "state" | "kind" | "size" | "attrs" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "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" | "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" | "type" | "key" | "value" | "client" | "icon" | "badge" | "disableEvents" | "loading" | "loadingText" | "position" | "tipAnchor" | "toggleAria" | "toggleStyle" | "tooltipKind" | "wrapperClassName" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
-
import { MenuPosition, VerticalAlign, HorizontalAlign } from '../constants';
|
|
3
|
-
export type ActionType = 'ArrowUp' | 'ArrowDown' | 'ArrowRight' | 'Enter' | 'Escape' | ' ' | 'click' | null;
|
|
4
|
-
export interface MrlMenuState {
|
|
5
|
-
actionType: ActionType;
|
|
6
|
-
isOpen: boolean;
|
|
7
|
-
}
|
|
2
|
+
import { MenuPosition, VerticalAlign, HorizontalAlign, ActionState } from '../constants';
|
|
8
3
|
export interface MrlMenuProps {
|
|
9
4
|
/** Children to be rendered within the menu component*/
|
|
10
5
|
children: React.ReactNode;
|
|
@@ -19,12 +14,12 @@ export interface MrlMenuProps {
|
|
|
19
14
|
*/
|
|
20
15
|
isSubMenu?: boolean;
|
|
21
16
|
/**
|
|
22
|
-
*
|
|
17
|
+
* spacing of menu
|
|
23
18
|
* - compact has less padding
|
|
24
19
|
*
|
|
25
20
|
* @default 'default'
|
|
26
21
|
*/
|
|
27
|
-
|
|
22
|
+
spacing?: 'default' | 'compact';
|
|
28
23
|
/**
|
|
29
24
|
* Offset of the menu from the trigger element in pixels
|
|
30
25
|
*
|
|
@@ -36,13 +31,13 @@ export interface MrlMenuProps {
|
|
|
36
31
|
*
|
|
37
32
|
* @default 'bottom'
|
|
38
33
|
*/
|
|
39
|
-
|
|
34
|
+
position?: MenuPosition;
|
|
40
35
|
/**
|
|
41
36
|
* Set initial state of menu
|
|
42
37
|
*
|
|
43
38
|
* @default { actionType: null, isOpen: false }
|
|
44
39
|
*/
|
|
45
|
-
|
|
40
|
+
actionState?: ActionState;
|
|
46
41
|
/**
|
|
47
42
|
* Reference to the DOM element that triggers this menu.
|
|
48
43
|
*/
|
|
@@ -74,4 +69,4 @@ export interface MrlMenuProps {
|
|
|
74
69
|
* @param {MrlMenuProps} props - The props for the MrlMenu component
|
|
75
70
|
* @returns {Element} - rendered MrlMenu component
|
|
76
71
|
*/
|
|
77
|
-
export declare function MrlMenu({ children, id, isSubMenu,
|
|
72
|
+
export declare function MrlMenu({ children, id, isSubMenu, spacing, menuOffset, position, actionState, verticalAlign, horizontalAlign, onClose, triggerRef }: MrlMenuProps): JSX.Element;
|
|
@@ -35,3 +35,9 @@ export declare const calculateLeftPosition: (overlapsRight: boolean, overlapsLef
|
|
|
35
35
|
* @returns The top position of the menu
|
|
36
36
|
*/
|
|
37
37
|
export declare const calculateTopPosition: (overlapsRight: boolean, overlapsLeft: boolean, triggerRef: React.RefObject<HTMLElement>, menuRect: DOMRect, parentMenu: HTMLElement, triggerRect: DOMRect) => string;
|
|
38
|
+
/**
|
|
39
|
+
* Prevent default on event
|
|
40
|
+
*
|
|
41
|
+
* @param e - The event
|
|
42
|
+
*/
|
|
43
|
+
export declare const preventDefault: (e: React.MouseEvent | React.KeyboardEvent | MouseEvent | KeyboardEvent) => void;
|
|
@@ -2,3 +2,8 @@ export type MenuPosition = 'bottom' | 'left' | 'right' | 'top' | 'below';
|
|
|
2
2
|
export type HorizontalAlign = 'left' | 'right' | 'center';
|
|
3
3
|
export type VerticalAlign = 'top' | 'bottom' | 'center';
|
|
4
4
|
export type MenuIgnore = 'ignore';
|
|
5
|
+
export type ActionType = 'ArrowUp' | 'ArrowDown' | 'ArrowRight' | 'Enter' | 'Escape' | ' ' | 'click' | null;
|
|
6
|
+
export interface ActionState {
|
|
7
|
+
actionType: ActionType;
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { MenuPosition, VerticalAlign, HorizontalAlign } from '../constants';
|
|
2
|
+
import { MenuPosition, VerticalAlign, HorizontalAlign, ActionState } from '../constants';
|
|
4
3
|
interface MenuWithLinkProps {
|
|
5
4
|
menuAlign?: MenuPosition;
|
|
6
5
|
kind?: 'default' | 'compact';
|
|
7
6
|
verticalAlign?: VerticalAlign;
|
|
8
7
|
horizontalAlign?: HorizontalAlign;
|
|
9
|
-
menuState?:
|
|
8
|
+
menuState?: ActionState;
|
|
10
9
|
onClose?: () => void;
|
|
11
10
|
triggerAlignment?: 'left' | 'right' | 'center';
|
|
12
11
|
}
|
|
@@ -16,5 +15,5 @@ interface MenuWithLinkProps {
|
|
|
16
15
|
* @param {MenuWithLinkProps} props - The props for the menu with trigger
|
|
17
16
|
* @returns {Element} The menu with trigger demo
|
|
18
17
|
*/
|
|
19
|
-
export declare const MenuWithLink: ({ menuAlign, verticalAlign, horizontalAlign,
|
|
18
|
+
export declare const MenuWithLink: ({ menuAlign, verticalAlign, horizontalAlign, menuState, onClose, triggerAlignment }: MenuWithLinkProps) => JSX.Element;
|
|
20
19
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuPosition, VerticalAlign, HorizontalAlign, ActionState } from '../constants';
|
|
3
|
+
interface MenuWithPopoverProps {
|
|
4
|
+
position?: MenuPosition;
|
|
5
|
+
spacing?: 'default' | 'compact';
|
|
6
|
+
verticalAlign?: VerticalAlign;
|
|
7
|
+
horizontalAlign?: HorizontalAlign;
|
|
8
|
+
actionState?: ActionState;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
triggerAlignment?: 'left' | 'right' | 'center';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Demo of a menu with a trigger for stories and testing
|
|
14
|
+
*
|
|
15
|
+
* @param {MenuWithPopoverProps} props - The props for the menu with trigger
|
|
16
|
+
* @returns {Element} The menu with trigger demo
|
|
17
|
+
*/
|
|
18
|
+
export declare const MenuWithPopover: ({ position, verticalAlign, horizontalAlign, spacing, actionState, onClose, triggerAlignment }: MenuWithPopoverProps) => JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { MenuPosition, VerticalAlign, HorizontalAlign } from '../constants';
|
|
2
|
+
import { MenuPosition, VerticalAlign, HorizontalAlign, ActionState } from '../constants';
|
|
4
3
|
interface MenuWithSubmenuProps {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
position?: MenuPosition;
|
|
5
|
+
spacing?: 'default' | 'compact';
|
|
7
6
|
verticalAlign?: VerticalAlign;
|
|
8
7
|
horizontalAlign?: HorizontalAlign;
|
|
9
|
-
|
|
8
|
+
actionState?: ActionState;
|
|
10
9
|
onClose?: () => void;
|
|
11
10
|
triggerAlignment?: 'left' | 'right' | 'center';
|
|
12
11
|
}
|
|
@@ -16,5 +15,5 @@ interface MenuWithSubmenuProps {
|
|
|
16
15
|
* @param {MenuWithSubmenuProps} props - The props for the menu with trigger
|
|
17
16
|
* @returns {Element} The menu with trigger demo
|
|
18
17
|
*/
|
|
19
|
-
export declare const MenuWithSubmenu: ({
|
|
18
|
+
export declare const MenuWithSubmenu: ({ position, verticalAlign, horizontalAlign, spacing, actionState, onClose, triggerAlignment }: MenuWithSubmenuProps) => JSX.Element;
|
|
20
19
|
export {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { MenuPosition, VerticalAlign, HorizontalAlign } from '../constants';
|
|
2
|
+
import { MenuPosition, VerticalAlign, HorizontalAlign, ActionState } from '../constants';
|
|
4
3
|
interface MenuWithTriggerProps {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
position?: MenuPosition;
|
|
5
|
+
spacing?: 'default' | 'compact';
|
|
7
6
|
verticalAlign?: VerticalAlign;
|
|
8
7
|
horizontalAlign?: HorizontalAlign;
|
|
9
|
-
|
|
8
|
+
actionState?: ActionState;
|
|
10
9
|
onClose?: () => void;
|
|
11
10
|
triggerAlignment?: 'left' | 'right' | 'center';
|
|
12
11
|
}
|
|
@@ -16,5 +15,5 @@ interface MenuWithTriggerProps {
|
|
|
16
15
|
* @param {MenuWithTriggerProps} props - The props for the menu with trigger
|
|
17
16
|
* @returns {Element} The menu with trigger demo
|
|
18
17
|
*/
|
|
19
|
-
export declare const MenuWithTrigger: ({
|
|
18
|
+
export declare const MenuWithTrigger: ({ position, verticalAlign, horizontalAlign, spacing, actionState, onClose, triggerAlignment }: MenuWithTriggerProps) => JSX.Element;
|
|
20
19
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MenuPosition } from '../constants';
|
|
2
|
+
interface ElementScrollStyles {
|
|
3
|
+
isScrolling: boolean;
|
|
4
|
+
styles: AdjustedElementStyle;
|
|
5
|
+
}
|
|
6
|
+
interface AdjustedElementStyle {
|
|
7
|
+
maxHeight: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* useBrowserEdgeScroll hook
|
|
11
|
+
*
|
|
12
|
+
* This hook will calculate if an element's top or bottom edge bleed over the viewport edge
|
|
13
|
+
* and will provide a max height value for the element to allow it to scroll instead of bleed over
|
|
14
|
+
*
|
|
15
|
+
* @param elementRef - reference to the DOM element that is the menu
|
|
16
|
+
* @param elementAlign - the alignment of the menu
|
|
17
|
+
* @returns AdjustedElementStyle - returns the new updated style for scrolling the menu
|
|
18
|
+
*/
|
|
19
|
+
export declare const useBrowserEdgeScroll: (elementRef: React.RefObject<HTMLElement>, elementAlign?: MenuPosition) => ElementScrollStyles;
|
|
20
|
+
export {};
|
|
@@ -4,6 +4,10 @@ import { ModalSize, ModalState } from '../constants';
|
|
|
4
4
|
import { MrlDeviceClient } from '../../../contexts/MrlDeviceProvider';
|
|
5
5
|
import './MrlModal.global.scss';
|
|
6
6
|
interface ModalProps extends MrlComponentProps {
|
|
7
|
+
/**
|
|
8
|
+
* Aria label for the modal
|
|
9
|
+
*/
|
|
10
|
+
ariaLabel?: string;
|
|
7
11
|
/**
|
|
8
12
|
* Content of the modal
|
|
9
13
|
*/
|
|
@@ -47,5 +51,5 @@ interface ModalProps extends MrlComponentProps {
|
|
|
47
51
|
* @param {React.ReactElement} props.children - Children to be rendered within the modal. The first child is used as the trigger.
|
|
48
52
|
* @returns {React.ReactElement} an instance of the MrlModal
|
|
49
53
|
*/
|
|
50
|
-
export declare const MrlModal: ({ children, className, client, closable, loading, size, state, hookClose, attrs }: ModalProps) => ReactElement;
|
|
54
|
+
export declare const MrlModal: ({ ariaLabel, children, className, client, closable, loading, size, state, hookClose, attrs }: ModalProps) => ReactElement;
|
|
51
55
|
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { MenuPosition, VerticalAlign, HorizontalAlign, ActionState } from '../../menu/constants';
|
|
3
|
+
export interface MrlPopoverProps {
|
|
4
|
+
/** Label for the popover */
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
/** ID of element to associate a label */
|
|
7
|
+
ariaLabelledBy?: string;
|
|
8
|
+
/** Children to be rendered within the menu component*/
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/** If the popover should have a close button */
|
|
11
|
+
hasCloseButton?: boolean;
|
|
12
|
+
/** If the popover should close when clicking outside of the menu */
|
|
13
|
+
disableClickOutside?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* spacing of menu
|
|
16
|
+
* - 'default' has 16px padding
|
|
17
|
+
* - 'compact' has 12px padding
|
|
18
|
+
*/
|
|
19
|
+
spacing?: 'default' | 'compact';
|
|
20
|
+
/** Unique identifier for the menu */
|
|
21
|
+
id?: string;
|
|
22
|
+
/** If the menu is a submenu */
|
|
23
|
+
isSubMenu?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Horizontal and vertical alignment of the menu relative to the trigger element
|
|
26
|
+
*
|
|
27
|
+
* @default 'bottom'
|
|
28
|
+
*/
|
|
29
|
+
position?: MenuPosition;
|
|
30
|
+
/**
|
|
31
|
+
* Set initial state of menu
|
|
32
|
+
*
|
|
33
|
+
* @default { actionType: null, isOpen: false }
|
|
34
|
+
*/
|
|
35
|
+
actionState?: ActionState;
|
|
36
|
+
/**
|
|
37
|
+
* Reference to the DOM element that triggers this menu.
|
|
38
|
+
*/
|
|
39
|
+
triggerRef?: RefObject<HTMLButtonElement>;
|
|
40
|
+
/**
|
|
41
|
+
* Vertical alignment of the menu relative to the trigger element
|
|
42
|
+
*
|
|
43
|
+
* @default 'center'
|
|
44
|
+
*/
|
|
45
|
+
verticalAlign?: VerticalAlign;
|
|
46
|
+
/**
|
|
47
|
+
* Horizontal alignment of the menu relative to the trigger element
|
|
48
|
+
*
|
|
49
|
+
* @default 'left'
|
|
50
|
+
*/
|
|
51
|
+
horizontalAlign?: HorizontalAlign;
|
|
52
|
+
/**
|
|
53
|
+
* If the menu should be rendered with the inverse theme
|
|
54
|
+
*
|
|
55
|
+
* @default 'primary'
|
|
56
|
+
*/
|
|
57
|
+
kind?: 'primary' | 'inverse';
|
|
58
|
+
/**
|
|
59
|
+
* If the menu should have a pointer element
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
point?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Callback to be called when the menu is closed
|
|
66
|
+
*
|
|
67
|
+
* @param type - type of close event
|
|
68
|
+
*/
|
|
69
|
+
onClose?: (type?: string) => void;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* MrlPopover
|
|
73
|
+
*
|
|
74
|
+
* Renders a popover component with alignment relative to a trigger element
|
|
75
|
+
*
|
|
76
|
+
* @param {MrlPopoverProps} props - The props for the MrlPopover component
|
|
77
|
+
* @returns {Element} - rendered MrlPopover component
|
|
78
|
+
*/
|
|
79
|
+
export declare function MrlPopover({ ariaLabel, ariaLabelledBy, children, disableClickOutside, hasCloseButton, spacing, id, isSubMenu, actionState, position, verticalAlign, horizontalAlign, point, kind, onClose, triggerRef, ...rest }: MrlPopoverProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlPopover';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuPosition, VerticalAlign, HorizontalAlign, ActionState } from '../../menu/constants';
|
|
3
|
+
interface PopoverWithTriggerProps {
|
|
4
|
+
hasCloseButton?: boolean;
|
|
5
|
+
menuAlign?: MenuPosition;
|
|
6
|
+
spacing?: 'default' | 'compact';
|
|
7
|
+
verticalAlign?: VerticalAlign;
|
|
8
|
+
horizontalAlign?: HorizontalAlign;
|
|
9
|
+
actionState?: ActionState;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
triggerAlignment?: 'left' | 'right' | 'center';
|
|
12
|
+
kind?: 'inverse' | 'primary';
|
|
13
|
+
point?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Demo of a menu with a trigger for stories and testing
|
|
17
|
+
*
|
|
18
|
+
* @param {PopoverWithTriggerProps} props - The props for the menu with trigger
|
|
19
|
+
* @returns {Element} The menu with trigger demo
|
|
20
|
+
*/
|
|
21
|
+
export declare const PopoverWithTrigger: ({ menuAlign, verticalAlign, horizontalAlign, actionState, onClose, triggerAlignment, spacing, kind, point, hasCloseButton }: PopoverWithTriggerProps) => JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlPopover';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import { AttrsObject } from '../../../utils';
|
|
3
|
-
import { MrlTooltipAnchor, MrlTooltipPosition } from '../constants';
|
|
3
|
+
import { MrlTooltipAnchor, MrlTooltipPosition, MrlTooltipVariant } from '../constants';
|
|
4
4
|
interface MrlTooltipProps {
|
|
5
5
|
/** The arrow position of the tooltip in relation to its trigger's content */
|
|
6
6
|
anchor?: MrlTooltipAnchor;
|
|
@@ -17,6 +17,8 @@ interface MrlTooltipProps {
|
|
|
17
17
|
* are passed in the component will not have event handling for the additional child elements.
|
|
18
18
|
*/
|
|
19
19
|
children: React.ReactElement;
|
|
20
|
+
/** The kind of tooltip to be rendered */
|
|
21
|
+
kind?: MrlTooltipVariant;
|
|
20
22
|
/** The placement of the tooltip in relation to its trigger */
|
|
21
23
|
position?: MrlTooltipPosition;
|
|
22
24
|
/** The textual label of tooltip */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { AttrsObject } from '../../../utils';
|
|
3
|
-
import { MrlTooltipAnchor, MrlTooltipPosition } from '../constants';
|
|
3
|
+
import { MrlTooltipAnchor, MrlTooltipPosition, MrlTooltipVariant } from '../constants';
|
|
4
4
|
import './MrlTooltipContent.global.scss';
|
|
5
5
|
interface MrlTooltipContentProps {
|
|
6
6
|
/**
|
|
@@ -15,6 +15,8 @@ interface MrlTooltipContentProps {
|
|
|
15
15
|
* Example usage: html attributes, custom data attributes (data-qa), aria
|
|
16
16
|
*/
|
|
17
17
|
attrs: AttrsObject;
|
|
18
|
+
/** The kind of tooltip to be rendered */
|
|
19
|
+
kind: MrlTooltipVariant;
|
|
18
20
|
/** The id of the tooltip used for aria-describedby in the parent component */
|
|
19
21
|
id: string;
|
|
20
22
|
/** The placement of the tooltip in relation to its trigger */
|
|
@@ -8,9 +8,9 @@ export declare const allowedMrlTooltipValues: {
|
|
|
8
8
|
positions: readonly ["top", "bottom", "left", "right"];
|
|
9
9
|
state: readonly ["show", "hide"];
|
|
10
10
|
};
|
|
11
|
-
export type MrlTooltipPosition = typeof allowedMrlTooltipValues.positions[number];
|
|
12
|
-
export type MrlTooltipAnchor = typeof allowedMrlTooltipValues.anchors[number];
|
|
13
|
-
export type MrlTooltipState = typeof allowedMrlTooltipValues.state[number];
|
|
11
|
+
export type MrlTooltipPosition = (typeof allowedMrlTooltipValues.positions)[number];
|
|
12
|
+
export type MrlTooltipAnchor = (typeof allowedMrlTooltipValues.anchors)[number];
|
|
13
|
+
export type MrlTooltipState = (typeof allowedMrlTooltipValues.state)[number];
|
|
14
14
|
export interface MrlTooltipDefaults {
|
|
15
15
|
anchor: MrlTooltipAnchor;
|
|
16
16
|
attrs: AttrsObject;
|
|
@@ -22,3 +22,4 @@ export interface MrlTooltipDefaults {
|
|
|
22
22
|
* Shared between the component and Storybook
|
|
23
23
|
*/
|
|
24
24
|
export declare const MrlTooltipDefaults: MrlTooltipDefaults;
|
|
25
|
+
export type MrlTooltipVariant = 'default' | 'inverse';
|
|
@@ -4,5 +4,6 @@ import { RefObject } from 'react';
|
|
|
4
4
|
*
|
|
5
5
|
* @param menuRef - Reference to the DOM element that caused this menu to be shown.
|
|
6
6
|
* @param onOutsideClick - Function to call when a click is detected outside the menuRef element
|
|
7
|
+
* @param disabled - If the hook should be disabled
|
|
7
8
|
*/
|
|
8
|
-
export declare const useClickOutside: (menuRef: RefObject<HTMLElement>, onOutsideClick: () => void) => void;
|
|
9
|
+
export declare const useClickOutside: (menuRef: RefObject<HTMLElement>, onOutsideClick: () => void, disabled?: boolean) => void;
|