@muraldevkit/ui-toolkit 4.78.1 → 4.79.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/cjs/components/avatar/MrlAvatarButton/MrlAvatarButton.js +2 -1
- package/dist/cjs/components/avatar/MrlAvatarButton/MrlAvatarButton.js.map +1 -1
- package/dist/cjs/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js +4 -2
- package/dist/cjs/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js.map +1 -1
- package/dist/cjs/components/button/MrlButton/MrlButton.js +2 -1
- package/dist/cjs/components/button/MrlButton/MrlButton.js.map +1 -1
- package/dist/cjs/components/button/MrlIconButton/MrlIconButton.js +3 -1
- package/dist/cjs/components/button/MrlIconButton/MrlIconButton.js.map +1 -1
- package/dist/cjs/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js +8 -4
- package/dist/cjs/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js.map +1 -1
- package/dist/cjs/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js +8 -4
- package/dist/cjs/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js.map +1 -1
- package/dist/cjs/components/link/MrlLinkButton/MrlLinkButton.js +2 -1
- package/dist/cjs/components/link/MrlLinkButton/MrlLinkButton.js.map +1 -1
- package/dist/cjs/components/pagination/MrlPaginationButton/MrlPaginationButton.js +4 -2
- package/dist/cjs/components/pagination/MrlPaginationButton/MrlPaginationButton.js.map +1 -1
- package/dist/cjs/components/toolbar/MrlToolbarButton/MrlToolbarButton.js.map +1 -1
- package/dist/cjs/components/tooltip/MrlTooltip/MrlTooltip.js +5 -0
- package/dist/cjs/components/tooltip/MrlTooltip/MrlTooltip.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/components/avatar/MrlAvatarButton/MrlAvatarButton.d.ts +2 -1
- package/dist/components/button/MrlButton/MrlButton.d.ts +1 -19
- package/dist/components/button/MrlIconButton/MrlIconButton.d.ts +8 -0
- package/dist/components/link/MrlLinkButton/MrlLinkButton.d.ts +1 -1
- package/dist/components/pagination/MrlPaginationButton/MrlPaginationButton.d.ts +9 -1
- package/dist/components/svg/config.d.ts +1 -1
- package/dist/components/toolbar/MrlToolbarButton/MrlToolbarButton.d.ts +1 -0
- package/dist/components/tooltip/MrlTooltip/MrlTooltip.d.ts +11 -3
- package/dist/components/tooltip/MrlTooltip/index.d.ts +1 -1
- package/dist/esm/components/avatar/MrlAvatarButton/MrlAvatarButton.js +2 -1
- package/dist/esm/components/avatar/MrlAvatarButton/MrlAvatarButton.js.map +1 -1
- package/dist/esm/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js +4 -2
- package/dist/esm/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js.map +1 -1
- package/dist/esm/components/button/MrlButton/MrlButton.js +2 -1
- package/dist/esm/components/button/MrlButton/MrlButton.js.map +1 -1
- package/dist/esm/components/button/MrlIconButton/MrlIconButton.js +3 -1
- package/dist/esm/components/button/MrlIconButton/MrlIconButton.js.map +1 -1
- package/dist/esm/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js +8 -4
- package/dist/esm/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js.map +1 -1
- package/dist/esm/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js +8 -4
- package/dist/esm/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js.map +1 -1
- package/dist/esm/components/link/MrlLinkButton/MrlLinkButton.js +2 -1
- package/dist/esm/components/link/MrlLinkButton/MrlLinkButton.js.map +1 -1
- package/dist/esm/components/pagination/MrlPaginationButton/MrlPaginationButton.js +4 -2
- package/dist/esm/components/pagination/MrlPaginationButton/MrlPaginationButton.js.map +1 -1
- package/dist/esm/components/toolbar/MrlToolbarButton/MrlToolbarButton.js.map +1 -1
- package/dist/esm/components/tooltip/MrlTooltip/MrlTooltip.js +5 -0
- package/dist/esm/components/tooltip/MrlTooltip/MrlTooltip.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/components/avatar/MrlAvatarButton/MrlAvatarButton.d.ts +2 -1
- package/dist/types/components/button/MrlButton/MrlButton.d.ts +1 -19
- package/dist/types/components/button/MrlIconButton/MrlIconButton.d.ts +8 -0
- package/dist/types/components/link/MrlLinkButton/MrlLinkButton.d.ts +1 -1
- package/dist/types/components/pagination/MrlPaginationButton/MrlPaginationButton.d.ts +9 -1
- package/dist/types/components/toolbar/MrlToolbarButton/MrlToolbarButton.d.ts +1 -0
- package/dist/types/components/tooltip/MrlTooltip/MrlTooltip.d.ts +11 -3
- package/dist/types/components/tooltip/MrlTooltip/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MrlToolbarButton.js","sources":["../../../../../src/components/toolbar/MrlToolbarButton/MrlToolbarButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlIconButton, MrlIconButtonProps } from '../../button/MrlIconButton/MrlIconButton';\nimport { MrlMenuItem, MrlMenuItemProps } from '../../menu/MrlMenuItem/MrlMenuItem';\n\nimport styles from './MrlToolbarButton.module.scss';\nimport classnames from 'classnames';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\n/**\n * Props for the MrlToolbarButton component.\n */\nexport interface MrlToolbarButtonProps {\n\t/** Additional class to add to the Toolbar button */\n\tclassName?: string;\n\t/**\n\t * The icon that will be rendered.\n\t */\n\ticon: React.ReactElement;\n\tincludeInRoving?: boolean;\n\t/**\n\t * A prop used to set a toolbar button to never move into the menu.\n\t */\n\tlockedInToolbar?: boolean;\n\t/**\n\t * onClick event for the button.\n\t */\n\tonClick?: (e?: React.MouseEvent<HTMLButtonElement>) => void;\n\t/**\n\t * Props used to control the display of the button in the menu.\n\t */\n\tmenuItemProps?: Omit<MrlMenuItemProps, 'onClick'>;\n\tqa?: string;\n\t/**\n\t * A prop used to render the item in the menu instead of the toolbar.\n\t */\n\trenderInMenu?: boolean;\n\ttext: string;\n\t/**\n\t * Enables interaction tracking for this button. Provide a stable, non-PII id\n\t * (e.g. 'canvas-toolbar-shapes'). When omitted, the button emits no analytics.\n\t */\n\teventId?: string;\n\t/**\n\t * Props used to control the display of the button in the toolbar.\n\t */\n\ttoolbarButtonProps?: {\n\t\tbadge?: MrlIconButtonProps['badge'];\n\t\tdisableEvents?: MrlIconButtonProps['disableEvents'];\n\t\tkind?: MrlIconButtonProps['kind'];\n\t\tloading?: MrlIconButtonProps['loading'];\n\t\tloadingText?: MrlIconButtonProps['loadingText'];\n\t\tonKeyUp?: MrlIconButtonProps['onKeyUp'];\n\t\tonMouseUp?: MrlIconButtonProps['onMouseUp'];\n\t\tposition?: MrlIconButtonProps['position'];\n\t\tsize?: MrlIconButtonProps['size'];\n\t\tstate?: MrlIconButtonProps['state'];\n\t\ttipAnchor?: MrlIconButtonProps['tipAnchor'];\n\t\ttoggleAria?: MrlIconButtonProps['toggleAria'];\n\t\ttoggleStyle?: MrlIconButtonProps['toggleStyle'];\n\t};\n}\n\n/**\n * MrlToolbarButton component.\n * @param props The MrlToolbarButton component properties.\n * @returns The MrlToolbarButton component.\n */\nexport const MrlToolbarButton = React.forwardRef<HTMLButtonElement, MrlToolbarButtonProps>(\n\tfunction MrlToolbarButton(props, ref): JSX.Element {\n\t\tconst {\n\t\t\tclassName,\n\t\t\ticon,\n\t\t\tincludeInRoving = false,\n\t\t\tmenuItemProps,\n\t\t\tonClick,\n\t\t\tqa,\n\t\t\trenderInMenu,\n\t\t\ttext,\n\t\t\ttoolbarButtonProps = {\n\t\t\t\tposition: 'bottom',\n\t\t\t\tsize: 'small',\n\t\t\t\tstate: 'default'\n\t\t\t},\n\t\t\t// pulled out of `rest` so the nested MrlIconButton/MrlMenuItem doesn't emit a\n\t\t\t// second, less specific event for the same interaction.\n\t\t\teventId,\n\t\t\t...rest\n\t\t} = props;\n\t\tconst classes = classnames('MrlToolbarButton', className);\n\n\t\tconst trackInteraction = useMrlTrackInteraction('MrlToolbarButton', eventId);\n\n\t\t/**\n\t\t * Handle onClick events\n\t\t *\n\t\t * @param {React.MouseEvent<HTMLButtonElement>} e - mouse event\n\t\t */\n\t\tconst handleOnClick = (e?: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\ttrackInteraction({\n\t\t\t\taction: 'click',\n\t\t\t\tvariant: renderInMenu ? 'menu' : 'toolbar'\n\t\t\t});\n\n\t\t\tonClick?.(e);\n\t\t};\n\n\t\tif (renderInMenu) {\n\t\t\treturn (\n\t\t\t\t<MrlMenuItem {...menuItemProps} className={classes} data-qa={qa} onClick={handleOnClick}>\n\t\t\t\t\t<span className={styles.MrlToolbarButtonIcon}>{icon}</span>\n\t\t\t\t\t{text}\n\t\t\t\t</MrlMenuItem>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<MrlIconButton\n\t\t\t\t{...rest}\n\t\t\t\t{...toolbarButtonProps}\n\t\t\t\tclassName={classes}\n\t\t\t\tdata-qa={qa}\n\t\t\t\tdata-roving={includeInRoving ? 'true' : undefined}\n\t\t\t\ticon={icon}\n\t\t\t\tonClick={handleOnClick}\n\t\t\t\tref={ref}\n\t\t\t\ttext={text}\n\t\t\t/>\n\t\t);\n\t}\n);\n"],"names":["MrlToolbarButton","React","forwardRef","props","ref","className","icon","_props$includeInRovin","includeInRoving","menuItemProps","onClick","qa","renderInMenu","text","_props$toolbarButtonP","toolbarButtonProps","position","size","state","eventId","rest","_objectWithoutProperties","_excluded","classes","classnames","trackInteraction","useMrlTrackInteraction","handleOnClick","e","action","variant","createElement","MrlMenuItem","_extends","styles","MrlToolbarButtonIcon","MrlIconButton","undefined"],"mappings":";;;;;;;;;;AAQA;AACA;AACA;;
|
|
1
|
+
{"version":3,"file":"MrlToolbarButton.js","sources":["../../../../../src/components/toolbar/MrlToolbarButton/MrlToolbarButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlIconButton, MrlIconButtonProps } from '../../button/MrlIconButton/MrlIconButton';\nimport { MrlMenuItem, MrlMenuItemProps } from '../../menu/MrlMenuItem/MrlMenuItem';\n\nimport styles from './MrlToolbarButton.module.scss';\nimport classnames from 'classnames';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\n/**\n * Props for the MrlToolbarButton component.\n */\nexport interface MrlToolbarButtonProps {\n\t/** Additional class to add to the Toolbar button */\n\tclassName?: string;\n\t/**\n\t * The icon that will be rendered.\n\t */\n\ticon: React.ReactElement;\n\tincludeInRoving?: boolean;\n\t/**\n\t * A prop used to set a toolbar button to never move into the menu.\n\t */\n\tlockedInToolbar?: boolean;\n\t/**\n\t * onClick event for the button.\n\t */\n\tonClick?: (e?: React.MouseEvent<HTMLButtonElement>) => void;\n\t/**\n\t * Props used to control the display of the button in the menu.\n\t */\n\tmenuItemProps?: Omit<MrlMenuItemProps, 'onClick'>;\n\tqa?: string;\n\t/**\n\t * A prop used to render the item in the menu instead of the toolbar.\n\t */\n\trenderInMenu?: boolean;\n\ttext: string;\n\t/**\n\t * Enables interaction tracking for this button. Provide a stable, non-PII id\n\t * (e.g. 'canvas-toolbar-shapes'). When omitted, the button emits no analytics.\n\t */\n\teventId?: string;\n\t/**\n\t * Props used to control the display of the button in the toolbar.\n\t */\n\ttoolbarButtonProps?: {\n\t\tbadge?: MrlIconButtonProps['badge'];\n\t\tdisableEvents?: MrlIconButtonProps['disableEvents'];\n\t\tkind?: MrlIconButtonProps['kind'];\n\t\tloading?: MrlIconButtonProps['loading'];\n\t\tloadingText?: MrlIconButtonProps['loadingText'];\n\t\tonKeyUp?: MrlIconButtonProps['onKeyUp'];\n\t\tonMouseUp?: MrlIconButtonProps['onMouseUp'];\n\t\tposition?: MrlIconButtonProps['position'];\n\t\tsize?: MrlIconButtonProps['size'];\n\t\tstate?: MrlIconButtonProps['state'];\n\t\ttipAnchor?: MrlIconButtonProps['tipAnchor'];\n\t\ttooltipCustomRender?: MrlIconButtonProps['tooltipCustomRender'];\n\t\ttoggleAria?: MrlIconButtonProps['toggleAria'];\n\t\ttoggleStyle?: MrlIconButtonProps['toggleStyle'];\n\t};\n}\n\n/**\n * MrlToolbarButton component.\n * @param props The MrlToolbarButton component properties.\n * @returns The MrlToolbarButton component.\n */\nexport const MrlToolbarButton = React.forwardRef<HTMLButtonElement, MrlToolbarButtonProps>(\n\tfunction MrlToolbarButton(props, ref): JSX.Element {\n\t\tconst {\n\t\t\tclassName,\n\t\t\ticon,\n\t\t\tincludeInRoving = false,\n\t\t\tmenuItemProps,\n\t\t\tonClick,\n\t\t\tqa,\n\t\t\trenderInMenu,\n\t\t\ttext,\n\t\t\ttoolbarButtonProps = {\n\t\t\t\tposition: 'bottom',\n\t\t\t\tsize: 'small',\n\t\t\t\tstate: 'default'\n\t\t\t},\n\t\t\t// pulled out of `rest` so the nested MrlIconButton/MrlMenuItem doesn't emit a\n\t\t\t// second, less specific event for the same interaction.\n\t\t\teventId,\n\t\t\t...rest\n\t\t} = props;\n\t\tconst classes = classnames('MrlToolbarButton', className);\n\n\t\tconst trackInteraction = useMrlTrackInteraction('MrlToolbarButton', eventId);\n\n\t\t/**\n\t\t * Handle onClick events\n\t\t *\n\t\t * @param {React.MouseEvent<HTMLButtonElement>} e - mouse event\n\t\t */\n\t\tconst handleOnClick = (e?: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\ttrackInteraction({\n\t\t\t\taction: 'click',\n\t\t\t\tvariant: renderInMenu ? 'menu' : 'toolbar'\n\t\t\t});\n\n\t\t\tonClick?.(e);\n\t\t};\n\n\t\tif (renderInMenu) {\n\t\t\treturn (\n\t\t\t\t<MrlMenuItem {...menuItemProps} className={classes} data-qa={qa} onClick={handleOnClick}>\n\t\t\t\t\t<span className={styles.MrlToolbarButtonIcon}>{icon}</span>\n\t\t\t\t\t{text}\n\t\t\t\t</MrlMenuItem>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<MrlIconButton\n\t\t\t\t{...rest}\n\t\t\t\t{...toolbarButtonProps}\n\t\t\t\tclassName={classes}\n\t\t\t\tdata-qa={qa}\n\t\t\t\tdata-roving={includeInRoving ? 'true' : undefined}\n\t\t\t\ticon={icon}\n\t\t\t\tonClick={handleOnClick}\n\t\t\t\tref={ref}\n\t\t\t\ttext={text}\n\t\t\t/>\n\t\t);\n\t}\n);\n"],"names":["MrlToolbarButton","React","forwardRef","props","ref","className","icon","_props$includeInRovin","includeInRoving","menuItemProps","onClick","qa","renderInMenu","text","_props$toolbarButtonP","toolbarButtonProps","position","size","state","eventId","rest","_objectWithoutProperties","_excluded","classes","classnames","trackInteraction","useMrlTrackInteraction","handleOnClick","e","action","variant","createElement","MrlMenuItem","_extends","styles","MrlToolbarButtonIcon","MrlIconButton","undefined"],"mappings":";;;;;;;;;;AAQA;AACA;AACA;;AAqDA;AACA;AACA;AACA;AACA;AACO,IAAMA,gBAAgB,gBAAGC,KAAK,CAACC,UAAU,CAC/C,SAASF,gBAAgBA,CAACG,KAAK,EAAEC,GAAG,EAAe;AAClD,EAAA,IACCC,SAAS,GAiBNF,KAAK,CAjBRE,SAAS;IACTC,IAAI,GAgBDH,KAAK,CAhBRG,IAAI;IAAAC,qBAAA,GAgBDJ,KAAK,CAfRK,eAAe;AAAfA,IAAAA,eAAe,GAAAD,qBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,qBAAA;IACvBE,aAAa,GAcVN,KAAK,CAdRM,aAAa;IACbC,OAAO,GAaJP,KAAK,CAbRO,OAAO;IACPC,EAAE,GAYCR,KAAK,CAZRQ,EAAE;IACFC,YAAY,GAWTT,KAAK,CAXRS,YAAY;IACZC,IAAI,GAUDV,KAAK,CAVRU,IAAI;IAAAC,qBAAA,GAUDX,KAAK,CATRY,kBAAkB;IAAlBA,kBAAkB,GAAAD,qBAAA,KAAA,MAAA,GAAG;AACpBE,MAAAA,QAAQ,EAAE,QAAQ;AAClBC,MAAAA,IAAI,EAAE,OAAO;AACbC,MAAAA,KAAK,EAAE;AACR,KAA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AEiB,aAAc;AACvBvB,IAAAA,GAAG,EAAEA,GAAI;AACTS,IAAAA,IAAI,EAAEA;AAAK,GAAA,CACX,CAAC;AAEJ,CACD;;;;"}
|
|
@@ -13,6 +13,11 @@ import { MrlPortal } from '../../portal/MrlPortal.js';
|
|
|
13
13
|
|
|
14
14
|
var _excluded = ["children", "clickToClose", "disableTooltipHover", "display", "text", "attrs", "dataQa", "position", "anchor", "srAnnouncement", "tooltipClass", "tooltipContentClass", "eventId"],
|
|
15
15
|
_excluded2 = ["className", "onBlur", "onFocus", "onKeyDown", "onMouseOver", "onMouseOut", "onMouseUp", "children"];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Tooltip configuration for components that wrap `MrlTooltip` (e.g. `MrlButton`).
|
|
19
|
+
*/
|
|
20
|
+
|
|
16
21
|
/**
|
|
17
22
|
* MrlTooltip Component
|
|
18
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MrlTooltip.js","sources":["../../../../../src/components/tooltip/MrlTooltip/MrlTooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { AttrsObject, getUniqueId } from '../../../utils';\nimport {\n\tMrlTooltipAnchor,\n\tMrlTooltipDefaults,\n\tMrlTooltipPosition,\n\tMrlTooltipState\n} from '../constants';\nimport { MrlTooltipContent } from '../MrlTooltipContent/MrlTooltipContent';\nimport { curryHandlers } from '../utils';\nimport classNames from 'classnames';\nimport { MrlPortal } from '../../portal';\nimport '../../../styles/shared/a11y-helpers/a11y.global.scss';\nimport { useTooltipPosition } from '../useTooltipPosition';\nimport { useTransition, animated } from '@react-spring/web';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\ninterface MrlTooltipProps {\n\t/** The arrow position of the tooltip in relation to its trigger's content */\n\tanchor?: MrlTooltipAnchor;\n\n\t/**\n\t * Attributes that are applied to the component during the initial render.\n\t *\n\t * Example usage: html attributes, custom data attributes (data-qa), aria\n\t * @deprecated please use props for component instead\n\t */\n\tattrs?: AttrsObject;\n\n\t/**\n\t * Children to be rendered within the tooltip. The first child is used as the trigger.\n\t *\n\t * Warning: The tooltip is only setup to work with a single trigger. If multiple children\n\t * are passed in the component will not have event handling for the additional child elements.\n\t */\n\tchildren: React.ReactElement;\n\n\t/** Whether the tooltip should close when clicked */\n\tclickToClose?: boolean;\n\n\t/** The data-qa attribute for the tooltip */\n\tdataQa?: string;\n\n\t/** The state value to determine if the tooltip should be displayed */\n\tdisplay?: MrlTooltipState;\n\n\t/** Whether to disable the tooltip hover action that keeps it open */\n\tdisableTooltipHover?: boolean;\n\n\t/** The placement of the tooltip in relation to its trigger */\n\tposition?: MrlTooltipPosition;\n\n\t/** Whether to announce the tooltip content to screen readers */\n\tsrAnnouncement?: boolean;\n\n\t/** The textual label of tooltip */\n\ttext: string;\n\n\t/** A custom class selector to be applied to the tooltip wrapper */\n\ttooltipClass?: string;\n\n\t/** A class to be applied ot the tooltip content */\n\ttooltipContentClass?: string;\n\n\t/** A custom render function to render the tooltip content */\n\tcustomRender?: (text?: string) => React.ReactNode;\n\n\t/**\n\t * Enables interaction tracking for this tooltip. Provide a stable, non-PII id\n\t * (e.g. 'facilitation-timer-tooltip'). When omitted, the tooltip emits no analytics.\n\t *\n\t * Note: tooltips open on hover, so an instrumented tooltip is a high-volume source.\n\t * Only add an id where the reveal itself is the signal you need.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlTooltip Component\n *\n * This component is not displayed when rendering this component if the primary pointing device can’t hover. Examples include touchscreens and screens that use a basic drawing stylus.\n * Pointing devices that can hover, but for which doing so is inconvenient and not part of the normal way they are used, also match this criteria. For example, a touchscreen where a long press is treated as hovering.\n * @param {MrlTooltipProps} props - The props of the component\n * @returns {HTMLElement} a configured Tooltip component\n */\nexport const MrlTooltip = React.memo((props: MrlTooltipProps): React.ReactElement => {\n\tconst {\n\t\tchildren,\n\t\tclickToClose = true,\n\t\tdisableTooltipHover = false,\n\t\tdisplay: defaultDisplay = 'hide',\n\t\ttext,\n\t\tattrs = {},\n\t\tdataQa,\n\t\tposition = MrlTooltipDefaults.position || 'top',\n\t\tanchor = MrlTooltipDefaults.anchor,\n\t\tsrAnnouncement = true,\n\t\ttooltipClass,\n\t\ttooltipContentClass,\n\t\teventId,\n\t\t...rest\n\t} = props;\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlTooltip', eventId);\n\n\tconst [interaction, setInteraction] = React.useState('mouse');\n\n\tconst triggerRef = React.useRef<HTMLElement | null>(null);\n\n\tconst tooltipRef = React.useRef<HTMLDivElement>(null);\n\n\t/**\n\t * State value to determine if the tooltip should be displayed\n\t */\n\tconst [display, setDisplay] = React.useState<MrlTooltipState>(defaultDisplay);\n\n\t/**\n\t * State value to determine if the tooltip should be displayed\n\t */\n\tconst [id, setId] = React.useState<string>('');\n\n\t/**\n\t * The tooltip shows and hides from hover, focus and click, so open/close is emitted\n\t * from the resulting display state rather than from each individual handler.\n\t */\n\tconst previousDisplayRef = React.useRef<MrlTooltipState>(defaultDisplay);\n\n\tReact.useEffect(() => {\n\t\tif (previousDisplayRef.current === display) return;\n\n\t\tpreviousDisplayRef.current = display;\n\n\t\ttrackInteraction({\n\t\t\taction: display === 'show' ? 'open' : 'close',\n\t\t\tmetadata: { interaction },\n\t\t\tvariant: position\n\t\t});\n\t\t// `interaction` only annotates the event; it must not re-trigger it\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [display, position, trackInteraction]);\n\n\t/**\n\t * Event handler to show tooltip when the trigger is focused\n\t */\n\tconst handleShowTooltip = React.useCallback(() => {\n\t\tsetDisplay('show');\n\t}, []);\n\n\tconst handleFocus = React.useCallback(() => {\n\t\tif (interaction === 'keyboard') {\n\t\t\thandleShowTooltip();\n\t\t}\n\t}, [interaction, handleShowTooltip]);\n\n\t/**\n\t * Event handler to hide the tooltip on mouseout\n\t */\n\tconst handleHideTooltip = (): void => {\n\t\tsetDisplay('hide');\n\t};\n\n\t/**\n\t * Event handler to hide the tooltip when a user presses escape\n\t * @param {React.KeyboardEvent} e Keyboard event\n\t */\n\tconst handleKeyDown = (e: React.KeyboardEvent): void => {\n\t\tif (e.key === 'Escape' || e.key === 'Enter' || e.key === ' ') {\n\t\t\thandleHideTooltip();\n\t\t}\n\t};\n\n\tconst handleSetKeyboardInteraction = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Tab' || e.key === 'Enter' || e.key === ' ') {\n\t\t\tsetInteraction('keyboard');\n\t\t}\n\t};\n\n\tconst handlesetMouseInteraction = () => setInteraction('mouse');\n\n\t/**\n\t * Setup of the initial component attributes and events\n\t */\n\tReact.useEffect(() => {\n\t\tif (id === '') setId(getUniqueId('mrl-tooltip'));\n\t}, [id]);\n\n\tReact.useEffect(() => {\n\t\tsetDisplay(defaultDisplay);\n\t}, [defaultDisplay]);\n\n\t/**\n\t * Setting the triggerRef to the trigger element\n\t *\n\t * We need to use 'querySelector' because we cannot pass a ref to the child object. There are\n\t * some situations where the child component may not accept a ref, for example: a react router\n\t * link is passed as a child. In older versions of react router you could not pass a ref to the\n\t * component so this causes an issue.\n\t */\n\tReact.useEffect(() => {\n\t\tconst trigger = document.querySelector(`[data-tooltip-id=\"${id}\"]`);\n\t\ttriggerRef.current = trigger as HTMLElement;\n\t}, [id]);\n\n\tReact.useEffect(() => {\n\t\tconst currentTooltipRef = tooltipRef.current;\n\n\t\tdocument.addEventListener('keydown', handleSetKeyboardInteraction);\n\t\tdocument.addEventListener('mousedown', handlesetMouseInteraction);\n\n\t\tif (!disableTooltipHover && currentTooltipRef) {\n\t\t\tcurrentTooltipRef.addEventListener('mouseover', handleShowTooltip);\n\t\t\tcurrentTooltipRef.addEventListener('mouseout', handleHideTooltip);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (!disableTooltipHover && currentTooltipRef) {\n\t\t\t\tcurrentTooltipRef.removeEventListener('mouseover', handleShowTooltip);\n\t\t\t\tcurrentTooltipRef.removeEventListener('mouseout', handleHideTooltip);\n\t\t\t}\n\n\t\t\tdocument.removeEventListener('keydown', handleSetKeyboardInteraction);\n\t\t\tdocument.removeEventListener('mousedown', handlesetMouseInteraction);\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [handleShowTooltip, tooltipRef.current]);\n\n\tconst positionStyles = useTooltipPosition(\n\t\ttriggerRef,\n\t\ttooltipRef,\n\t\t{\n\t\t\talign: anchor,\n\t\t\tposition: position\n\t\t},\n\t\tdisplay === 'show',\n\t\t-1\n\t);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: positionStyles.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: positionStyles.top\n\t\t}\n\t};\n\n\tconst transitions = useTransition(display === 'show', {\n\t\tconfig: { duration: display === 'show' ? 150 : 25 },\n\t\tenter: { opacity: 1 },\n\t\tfrom: { opacity: 0 },\n\t\tleave: { opacity: 0 }\n\t});\n\n\treturn (\n\t\t<>\n\t\t\t{React.Children.map(children, (child, index) => {\n\t\t\t\tif (index === 0 && React.isValidElement(child)) {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\tonBlur,\n\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\tonKeyDown,\n\t\t\t\t\t\tonMouseOver,\n\t\t\t\t\t\tonMouseOut,\n\t\t\t\t\t\tonMouseUp,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t...otherProps\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t} = (child as any).props;\n\n\t\t\t\t\treturn React.cloneElement(child as React.ReactElement, {\n\t\t\t\t\t\t'aria-describedby': display === 'show' && srAnnouncement ? id : undefined,\n\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\ttooltipClass,\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'mrl-tooltip-trigger',\n\t\t\t\t\t\t\tdisplay === 'show' && 'mrl-tooltip-trigger--active'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tonBlur: curryHandlers(onBlur, handleHideTooltip),\n\t\t\t\t\t\t...(clickToClose && !disableTooltipHover\n\t\t\t\t\t\t\t? { onMouseUp: curryHandlers(onMouseUp, handleHideTooltip) }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\tonFocus: curryHandlers(onFocus, handleFocus),\n\t\t\t\t\t\tonKeyDown: curryHandlers(onKeyDown, handleKeyDown),\n\t\t\t\t\t\tonMouseOut: curryHandlers(onMouseOut, handleHideTooltip),\n\t\t\t\t\t\tonMouseOver: curryHandlers(onMouseOver, handleShowTooltip),\n\t\t\t\t\t\t...otherProps,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t['data-tooltip-id']: id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn child;\n\t\t\t})}\n\t\t\t<MrlPortal\n\t\t\t\tid={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t\tlayer={PORTAL_LAYERS.TOOLTIP}\n\t\t\t\tclassName={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t\tdata-qa={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<animated.div ref={tooltipRef} style={{ ...inlineStyles.menu, ...style }}>\n\t\t\t\t\t\t\t\t<MrlTooltipContent\n\t\t\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\t\t\tattrs={attrs}\n\t\t\t\t\t\t\t\t\tanchor={anchor}\n\t\t\t\t\t\t\t\t\tdataQa={dataQa}\n\t\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\t\tposition={position}\n\t\t\t\t\t\t\t\t\ttext={text}\n\t\t\t\t\t\t\t\t\ttooltipContentClass={tooltipContentClass}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</MrlPortal>\n\t\t</>\n\t);\n});\n\nMrlTooltip.displayName = 'MrlTooltip';\n"],"names":["MrlTooltip","React","memo","props","children","_props$clickToClose","clickToClose","_props$disableTooltip","disableTooltipHover","_props$display","display","defaultDisplay","text","_props$attrs","attrs","dataQa","_props$position","position","MrlTooltipDefaults","_props$anchor","anchor","_props$srAnnouncement","srAnnouncement","tooltipClass","tooltipContentClass","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","_React$useState","useState","_React$useState2","_slicedToArray","interaction","setInteraction","triggerRef","useRef","tooltipRef","_React$useState3","_React$useState4","setDisplay","_React$useState5","_React$useState6","id","setId","previousDisplayRef","useEffect","current","action","metadata","variant","handleShowTooltip","useCallback","handleFocus","handleHideTooltip","handleKeyDown","e","key","handleSetKeyboardInteraction","handlesetMouseInteraction","getUniqueId","trigger","document","querySelector","concat","currentTooltipRef","addEventListener","removeEventListener","positionStyles","useTooltipPosition","align","inlineStyles","menu","left","top","transitions","useTransition","config","duration","enter","opacity","from","leave","createElement","Fragment","Children","map","child","index","isValidElement","_props","className","onBlur","onFocus","onKeyDown","onMouseOver","onMouseOut","onMouseUp","otherProps","_excluded2","cloneElement","_objectSpread","undefined","classNames","curryHandlers","MrlPortal","PORTAL_LAYERS","TOOLTIP","name","layer","style","item","animated","div","ref","MrlTooltipContent","_extends","displayName"],"mappings":";;;;;;;;;;;;;;;AA8EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,UAAU,gBAAGC,KAAK,CAACC,IAAI,CAAEC,KAAsB,IAAyB;AACpF,EAAA,IACCC,QAAQ,GAcLD,KAAK,CAdRC,QAAQ;IAAAC,mBAAA,GAcLF,KAAK,CAbRG,YAAY;AAAZA,IAAAA,YAAY,GAAAD,mBAAA,KAAA,MAAA,GAAG,IAAI,GAAAA,mBAAA;IAAAE,qBAAA,GAahBJ,KAAK,CAZRK,mBAAmB;AAAnBA,IAAAA,mBAAmB,GAAAD,qBAAA,KAAA,MAAA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;IAC/BC,KAAK,EAAEH,aAAa,CAACC,OAAQ;AAC7BhB,IAAAA,SAAS,EAAEe,aAAa,CAACC,OAAO,CAACC,IAAK;IACtC,SAAA,EAASF,aAAa,CAACC,OAAO,CAACC;AAAK,GAAA,EAEnCjC,WAAW,CACX,CAACmC,KAAK,EAAEC,IAAI,KACXA,IAAI,iBACHhH,KAAA,CAAAoF,aAAA,CAAC6B,QAAQ,CAACC,GAAG,EAAA;AAACC,IAAAA,GAAG,EAAE7E,UAAW;IAACyE,KAAK,EAAAT,cAAA,CAAAA,cAAA,KAAO9B,YAAY,CAACC,IAAI,CAAA,EAAKsC,KAAK;GAAG,eACxE/G,KAAA,CAAAoF,aAAA,CAACgC,iBAAiB,EAAAC,QAAA,KACb5F,IAAI,EAAA;AACRZ,IAAAA,KAAK,EAAEA,KAAM;AACbM,IAAAA,MAAM,EAAEA,MAAO;AACfL,IAAAA,MAAM,EAAEA,MAAO;AACf8B,IAAAA,EAAE,EAAEA,EAAG;AACP5B,IAAAA,QAAQ,EAAEA,QAAS;AACnBL,IAAAA,IAAI,EAAEA,IAAK;AACXY,IAAAA,mBAAmB,EAAEA;AAAoB,GAAA,CACzC,CACY,CAEjB,CACU,CACV,CAAC;AAEL,CAAC;AAEDxB,UAAU,CAACuH,WAAW,GAAG,YAAY;;;;"}
|
|
1
|
+
{"version":3,"file":"MrlTooltip.js","sources":["../../../../../src/components/tooltip/MrlTooltip/MrlTooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { AttrsObject, getUniqueId } from '../../../utils';\nimport {\n\tMrlTooltipAnchor,\n\tMrlTooltipDefaults,\n\tMrlTooltipPosition,\n\tMrlTooltipState\n} from '../constants';\nimport { MrlTooltipContent } from '../MrlTooltipContent/MrlTooltipContent';\nimport { curryHandlers } from '../utils';\nimport classNames from 'classnames';\nimport { MrlPortal } from '../../portal';\nimport '../../../styles/shared/a11y-helpers/a11y.global.scss';\nimport { useTooltipPosition } from '../useTooltipPosition';\nimport { useTransition, animated } from '@react-spring/web';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nexport interface MrlTooltipProps {\n\t/** The arrow position of the tooltip in relation to its trigger's content */\n\tanchor?: MrlTooltipAnchor;\n\n\t/**\n\t * Attributes that are applied to the component during the initial render.\n\t *\n\t * Example usage: html attributes, custom data attributes (data-qa), aria\n\t * @deprecated please use props for component instead\n\t */\n\tattrs?: AttrsObject;\n\n\t/**\n\t * Children to be rendered within the tooltip. The first child is used as the trigger.\n\t *\n\t * Warning: The tooltip is only setup to work with a single trigger. If multiple children\n\t * are passed in the component will not have event handling for the additional child elements.\n\t */\n\tchildren: React.ReactElement;\n\n\t/** Whether the tooltip should close when clicked */\n\tclickToClose?: boolean;\n\n\t/** The data-qa attribute for the tooltip */\n\tdataQa?: string;\n\n\t/** The state value to determine if the tooltip should be displayed */\n\tdisplay?: MrlTooltipState;\n\n\t/** Whether to disable the tooltip hover action that keeps it open */\n\tdisableTooltipHover?: boolean;\n\n\t/** The placement of the tooltip in relation to its trigger */\n\tposition?: MrlTooltipPosition;\n\n\t/** Whether to announce the tooltip content to screen readers */\n\tsrAnnouncement?: boolean;\n\n\t/** The textual label of tooltip */\n\ttext: string;\n\n\t/** A custom class selector to be applied to the tooltip wrapper */\n\ttooltipClass?: string;\n\n\t/** A class to be applied ot the tooltip content */\n\ttooltipContentClass?: string;\n\n\t/**\n\t * Renders custom tooltip content instead of the plain `text`. Receives `text` as\n\t * its argument. `text` is still required and used for accessibility.\n\t *\n\t * Note: `MrlTooltip` is memoized, so this function should be memoized by consumers.\n\t */\n\tcustomRender?: (text?: string) => React.ReactNode;\n\n\t/**\n\t * Enables interaction tracking for this tooltip. Provide a stable, non-PII id\n\t * (e.g. 'facilitation-timer-tooltip'). When omitted, the tooltip emits no analytics.\n\t *\n\t * Note: tooltips open on hover, so an instrumented tooltip is a high-volume source.\n\t * Only add an id where the reveal itself is the signal you need.\n\t */\n\teventId?: string;\n}\n\n/**\n * Tooltip configuration for components that wrap `MrlTooltip` (e.g. `MrlButton`).\n */\nexport type TooltipConfig = Pick<\n\tMrlTooltipProps,\n\t'anchor' | 'customRender' | 'dataQa' | 'position' | 'text'\n>;\n\n/**\n * MrlTooltip Component\n *\n * This component is not displayed when rendering this component if the primary pointing device can’t hover. Examples include touchscreens and screens that use a basic drawing stylus.\n * Pointing devices that can hover, but for which doing so is inconvenient and not part of the normal way they are used, also match this criteria. For example, a touchscreen where a long press is treated as hovering.\n * @param {MrlTooltipProps} props - The props of the component\n * @returns {HTMLElement} a configured Tooltip component\n */\nexport const MrlTooltip = React.memo((props: MrlTooltipProps): React.ReactElement => {\n\tconst {\n\t\tchildren,\n\t\tclickToClose = true,\n\t\tdisableTooltipHover = false,\n\t\tdisplay: defaultDisplay = 'hide',\n\t\ttext,\n\t\tattrs = {},\n\t\tdataQa,\n\t\tposition = MrlTooltipDefaults.position || 'top',\n\t\tanchor = MrlTooltipDefaults.anchor,\n\t\tsrAnnouncement = true,\n\t\ttooltipClass,\n\t\ttooltipContentClass,\n\t\teventId,\n\t\t...rest\n\t} = props;\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlTooltip', eventId);\n\n\tconst [interaction, setInteraction] = React.useState('mouse');\n\n\tconst triggerRef = React.useRef<HTMLElement | null>(null);\n\n\tconst tooltipRef = React.useRef<HTMLDivElement>(null);\n\n\t/**\n\t * State value to determine if the tooltip should be displayed\n\t */\n\tconst [display, setDisplay] = React.useState<MrlTooltipState>(defaultDisplay);\n\n\t/**\n\t * State value to determine if the tooltip should be displayed\n\t */\n\tconst [id, setId] = React.useState<string>('');\n\n\t/**\n\t * The tooltip shows and hides from hover, focus and click, so open/close is emitted\n\t * from the resulting display state rather than from each individual handler.\n\t */\n\tconst previousDisplayRef = React.useRef<MrlTooltipState>(defaultDisplay);\n\n\tReact.useEffect(() => {\n\t\tif (previousDisplayRef.current === display) return;\n\n\t\tpreviousDisplayRef.current = display;\n\n\t\ttrackInteraction({\n\t\t\taction: display === 'show' ? 'open' : 'close',\n\t\t\tmetadata: { interaction },\n\t\t\tvariant: position\n\t\t});\n\t\t// `interaction` only annotates the event; it must not re-trigger it\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [display, position, trackInteraction]);\n\n\t/**\n\t * Event handler to show tooltip when the trigger is focused\n\t */\n\tconst handleShowTooltip = React.useCallback(() => {\n\t\tsetDisplay('show');\n\t}, []);\n\n\tconst handleFocus = React.useCallback(() => {\n\t\tif (interaction === 'keyboard') {\n\t\t\thandleShowTooltip();\n\t\t}\n\t}, [interaction, handleShowTooltip]);\n\n\t/**\n\t * Event handler to hide the tooltip on mouseout\n\t */\n\tconst handleHideTooltip = (): void => {\n\t\tsetDisplay('hide');\n\t};\n\n\t/**\n\t * Event handler to hide the tooltip when a user presses escape\n\t * @param {React.KeyboardEvent} e Keyboard event\n\t */\n\tconst handleKeyDown = (e: React.KeyboardEvent): void => {\n\t\tif (e.key === 'Escape' || e.key === 'Enter' || e.key === ' ') {\n\t\t\thandleHideTooltip();\n\t\t}\n\t};\n\n\tconst handleSetKeyboardInteraction = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Tab' || e.key === 'Enter' || e.key === ' ') {\n\t\t\tsetInteraction('keyboard');\n\t\t}\n\t};\n\n\tconst handlesetMouseInteraction = () => setInteraction('mouse');\n\n\t/**\n\t * Setup of the initial component attributes and events\n\t */\n\tReact.useEffect(() => {\n\t\tif (id === '') setId(getUniqueId('mrl-tooltip'));\n\t}, [id]);\n\n\tReact.useEffect(() => {\n\t\tsetDisplay(defaultDisplay);\n\t}, [defaultDisplay]);\n\n\t/**\n\t * Setting the triggerRef to the trigger element\n\t *\n\t * We need to use 'querySelector' because we cannot pass a ref to the child object. There are\n\t * some situations where the child component may not accept a ref, for example: a react router\n\t * link is passed as a child. In older versions of react router you could not pass a ref to the\n\t * component so this causes an issue.\n\t */\n\tReact.useEffect(() => {\n\t\tconst trigger = document.querySelector(`[data-tooltip-id=\"${id}\"]`);\n\t\ttriggerRef.current = trigger as HTMLElement;\n\t}, [id]);\n\n\tReact.useEffect(() => {\n\t\tconst currentTooltipRef = tooltipRef.current;\n\n\t\tdocument.addEventListener('keydown', handleSetKeyboardInteraction);\n\t\tdocument.addEventListener('mousedown', handlesetMouseInteraction);\n\n\t\tif (!disableTooltipHover && currentTooltipRef) {\n\t\t\tcurrentTooltipRef.addEventListener('mouseover', handleShowTooltip);\n\t\t\tcurrentTooltipRef.addEventListener('mouseout', handleHideTooltip);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (!disableTooltipHover && currentTooltipRef) {\n\t\t\t\tcurrentTooltipRef.removeEventListener('mouseover', handleShowTooltip);\n\t\t\t\tcurrentTooltipRef.removeEventListener('mouseout', handleHideTooltip);\n\t\t\t}\n\n\t\t\tdocument.removeEventListener('keydown', handleSetKeyboardInteraction);\n\t\t\tdocument.removeEventListener('mousedown', handlesetMouseInteraction);\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [handleShowTooltip, tooltipRef.current]);\n\n\tconst positionStyles = useTooltipPosition(\n\t\ttriggerRef,\n\t\ttooltipRef,\n\t\t{\n\t\t\talign: anchor,\n\t\t\tposition: position\n\t\t},\n\t\tdisplay === 'show',\n\t\t-1\n\t);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: positionStyles.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: positionStyles.top\n\t\t}\n\t};\n\n\tconst transitions = useTransition(display === 'show', {\n\t\tconfig: { duration: display === 'show' ? 150 : 25 },\n\t\tenter: { opacity: 1 },\n\t\tfrom: { opacity: 0 },\n\t\tleave: { opacity: 0 }\n\t});\n\n\treturn (\n\t\t<>\n\t\t\t{React.Children.map(children, (child, index) => {\n\t\t\t\tif (index === 0 && React.isValidElement(child)) {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\tonBlur,\n\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\tonKeyDown,\n\t\t\t\t\t\tonMouseOver,\n\t\t\t\t\t\tonMouseOut,\n\t\t\t\t\t\tonMouseUp,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t...otherProps\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t} = (child as any).props;\n\n\t\t\t\t\treturn React.cloneElement(child as React.ReactElement, {\n\t\t\t\t\t\t'aria-describedby': display === 'show' && srAnnouncement ? id : undefined,\n\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\ttooltipClass,\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'mrl-tooltip-trigger',\n\t\t\t\t\t\t\tdisplay === 'show' && 'mrl-tooltip-trigger--active'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tonBlur: curryHandlers(onBlur, handleHideTooltip),\n\t\t\t\t\t\t...(clickToClose && !disableTooltipHover\n\t\t\t\t\t\t\t? { onMouseUp: curryHandlers(onMouseUp, handleHideTooltip) }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\tonFocus: curryHandlers(onFocus, handleFocus),\n\t\t\t\t\t\tonKeyDown: curryHandlers(onKeyDown, handleKeyDown),\n\t\t\t\t\t\tonMouseOut: curryHandlers(onMouseOut, handleHideTooltip),\n\t\t\t\t\t\tonMouseOver: curryHandlers(onMouseOver, handleShowTooltip),\n\t\t\t\t\t\t...otherProps,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t['data-tooltip-id']: id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn child;\n\t\t\t})}\n\t\t\t<MrlPortal\n\t\t\t\tid={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t\tlayer={PORTAL_LAYERS.TOOLTIP}\n\t\t\t\tclassName={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t\tdata-qa={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<animated.div ref={tooltipRef} style={{ ...inlineStyles.menu, ...style }}>\n\t\t\t\t\t\t\t\t<MrlTooltipContent\n\t\t\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\t\t\tattrs={attrs}\n\t\t\t\t\t\t\t\t\tanchor={anchor}\n\t\t\t\t\t\t\t\t\tdataQa={dataQa}\n\t\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\t\tposition={position}\n\t\t\t\t\t\t\t\t\ttext={text}\n\t\t\t\t\t\t\t\t\ttooltipContentClass={tooltipContentClass}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</MrlPortal>\n\t\t</>\n\t);\n});\n\nMrlTooltip.displayName = 'MrlTooltip';\n"],"names":["MrlTooltip","React","memo","props","children","_props$clickToClose","clickToClose","_props$disableTooltip","disableTooltipHover","_props$display","display","defaultDisplay","text","_props$attrs","attrs","dataQa","_props$position","position","MrlTooltipDefaults","_props$anchor","anchor","_props$srAnnouncement","srAnnouncement","tooltipClass","tooltipContentClass","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","_React$useState","useState","_React$useState2","_slicedToArray","interaction","setInteraction","triggerRef","useRef","tooltipRef","_React$useState3","_React$useState4","setDisplay","_React$useState5","_React$useState6","id","setId","previousDisplayRef","useEffect","current","action","metadata","variant","handleShowTooltip","useCallback","handleFocus","handleHideTooltip","handleKeyDown","e","key","handleSetKeyboardInteraction","handlesetMouseInteraction","getUniqueId","trigger","document","querySelector","concat","currentTooltipRef","addEventListener","removeEventListener","positionStyles","useTooltipPosition","align","inlineStyles","menu","left","top","transitions","useTransition","config","duration","enter","opacity","from","leave","createElement","Fragment","Children","map","child","index","isValidElement","_props","className","onBlur","onFocus","onKeyDown","onMouseOver","onMouseOut","onMouseUp","otherProps","_excluded2","cloneElement","_objectSpread","undefined","classNames","curryHandlers","MrlPortal","PORTAL_LAYERS","TOOLTIP","name","layer","style","item","animated","div","ref","MrlTooltipContent","_extends","displayName"],"mappings":";;;;;;;;;;;;;;;;AAmFA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,UAAU,gBAAGC,KAAK,CAACC,IAAI,CAAEC,KAAsB,IAAyB;AACpF,EAAA,IACCC,QAAQ,GAcLD,KAAK,CAdRC,QAAQ;IAAAC,mBAAA,GAcLF,KAAK,CAbRG,YAAY;AAAZA,IAAAA,YAAY,GAAAD,mBAAA,KAAA,MAAA,GAAG,IAAI,GAAAA,mBAAA;IAAAE,qBAAA,GAahBJ,KAAK,CAZRK,mBAAmB;AAAnBA,IAAAA,mBAAmB,GAAAD,qBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,qBAAA;IAAAE,cAAA,GAYxBN,KAAK,CAXRO,OAAO;AAAEC,IAAAA,cAAc,GAAAF,cAAA,KAAA,MAAA,GAAG,MAAM,GAAAA,cAAA;IAChCG,IAAI,GAUDT,KAAK,CAVRS,IAAI;IAAAC,YAAA,GAUDV,KAAK,CATRW,KAAK;AAALA,IAAAA,KAAK,GAAAD,YAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,YAAA;IACVE,MAAM,GAQHZ,KAAK,CARRY,MAAM;IAAAC,eAAA,GAQHb,KAAK,CAPRc,QAAQ;IAARA,QAAQ,GAAAD,eAAA,KAAA,MAAA,GAAGE,kBAAkB,CAACD,QAAQ,IAAI,KAAK,GAAAD,eAAA;IAAAG,aAAA,GAO5ChB,KAAK,CANRiB,MAAM;AAANA,IAAAA,MAAM,GAAAD,aAAA,KAAA,MAAA,GAAGD,kBAAkB,CAACE,MAAM,GAAAD,aAAA;IAAAE,qBAAA,GAM/BlB,KAAK,CALRmB,cAAc;AAAdA,IAAAA,cAAc,GAAAD,qBAAA,KAAA,MAAA,GAAG,IAAI,GAAAA,qBAAA;IACrBE,YAAY,GAITpB,KA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zC,CACY,CAEjB,CACU,CACV,CAAC;AAEL,CAAC;AAEDxB,UAAU,CAACuH,WAAW,GAAG,YAAY;;;;"}
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.79.0\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MrlButtonState
|
|
2
|
+
import type { MrlButtonState } from '../../button/MrlButton/MrlButton';
|
|
3
|
+
import { type TooltipConfig } from '../../tooltip/MrlTooltip/MrlTooltip';
|
|
3
4
|
import { MrlAvatarPropTypes } from '../MrlAvatar/MrlAvatar';
|
|
4
5
|
import { ToggleAria } from '../../button/constants';
|
|
5
6
|
export interface MrlAvatarButtonPropTypes extends MrlAvatarPropTypes, React.HTMLAttributes<HTMLButtonElement> {
|
|
@@ -1,28 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { allowedButtonValues, MrlButtonKind, MrlButtonSize, ToggleAria, IconPosition } from '../constants';
|
|
3
|
-
import {
|
|
3
|
+
import { type TooltipConfig } from '../../tooltip/MrlTooltip/MrlTooltip';
|
|
4
4
|
import { AttrsObject, MrlComponentProps } from '../../../utils';
|
|
5
5
|
import './MrlButton.global.scss';
|
|
6
6
|
export type MrlButtonState = (typeof allowedButtonValues.states)[number];
|
|
7
7
|
export type ToggleStyle = (typeof allowedButtonValues.toggleStyles)[number];
|
|
8
|
-
export interface TooltipConfig {
|
|
9
|
-
/**
|
|
10
|
-
* The text to display in the tooltip
|
|
11
|
-
*/
|
|
12
|
-
text: string;
|
|
13
|
-
/**
|
|
14
|
-
* The position of the tooltip relative to the button
|
|
15
|
-
*/
|
|
16
|
-
position?: MrlTooltipPosition;
|
|
17
|
-
/**
|
|
18
|
-
* The anchor of the tooltip relative to the button
|
|
19
|
-
*/
|
|
20
|
-
anchor?: MrlTooltipAnchor;
|
|
21
|
-
/**
|
|
22
|
-
* The data-qa attribute for the tooltip
|
|
23
|
-
*/
|
|
24
|
-
dataQa?: string;
|
|
25
|
-
}
|
|
26
8
|
export interface MrlButtonProps extends Omit<MrlComponentProps, 'style'>, React.ComponentProps<'button'> {
|
|
27
9
|
/**
|
|
28
10
|
* Applies additional HTML attributes to the button element.
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { MrlButtonKind, MrlButtonSize, MrlGhostIconButtonSize, ToggleAria } from '../constants';
|
|
3
3
|
import { AttrsObject, MrlComponentProps } from '../../../utils';
|
|
4
4
|
import { MrlTooltipAnchor, MrlTooltipPosition } from '../../tooltip/constants';
|
|
5
|
+
import { type MrlTooltipProps } from '../../tooltip/MrlTooltip/MrlTooltip';
|
|
5
6
|
import type { MrlButtonState, ToggleStyle } from '../MrlButton/MrlButton';
|
|
6
7
|
import './MrlIconButton.scss';
|
|
7
8
|
export interface MrlIconButtonProps extends Omit<MrlComponentProps, 'style'>, React.ComponentProps<'button'> {
|
|
@@ -80,6 +81,13 @@ export interface MrlIconButtonProps extends Omit<MrlComponentProps, 'style'>, Re
|
|
|
80
81
|
* The arrow position of the tooltip in relation to the button.
|
|
81
82
|
*/
|
|
82
83
|
tipAnchor?: MrlTooltipAnchor;
|
|
84
|
+
/**
|
|
85
|
+
* Renders custom tooltip content instead of the plain `text`. Receives `text` as
|
|
86
|
+
* its argument. `text` is still required and used for accessibility.
|
|
87
|
+
*
|
|
88
|
+
* Note: `MrlTooltip` is memoized, so this function should be memoized by consumers.
|
|
89
|
+
*/
|
|
90
|
+
tooltipCustomRender?: MrlTooltipProps['customRender'];
|
|
83
91
|
/**
|
|
84
92
|
* Enables interaction tracking for this button. Provide a stable, non-PII id
|
|
85
93
|
* (e.g. 'board-share-cta'). When omitted, the button emits no analytics.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MrlButtonSize, IconPosition } from '../../button/constants';
|
|
3
3
|
import { LinkTargetType, MrlLinkButtonKind } from '../constants';
|
|
4
|
-
import type
|
|
4
|
+
import { type TooltipConfig } from '../../tooltip/MrlTooltip/MrlTooltip';
|
|
5
5
|
import { MrlComponentProps } from '../../../utils';
|
|
6
6
|
import './MrlLinkButton.global.scss';
|
|
7
7
|
export interface MrlLinkButtonProps extends Omit<MrlComponentProps, 'style'>, React.ComponentProps<'a'> {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { MrlIconButtonProps } from '../../button/MrlIconButton/MrlIconButton';
|
|
2
3
|
import { MrlTooltipAnchor, MrlTooltipPosition } from '../../tooltip/constants';
|
|
3
4
|
import { PaginationButtonType } from '../constants';
|
|
4
5
|
interface MrlPaginationButtonProps {
|
|
@@ -35,11 +36,18 @@ interface MrlPaginationButtonProps {
|
|
|
35
36
|
tooltipAnchor?: MrlTooltipAnchor;
|
|
36
37
|
/** The placement of the tooltips on the buttons */
|
|
37
38
|
tooltipPosition?: MrlTooltipPosition;
|
|
39
|
+
/**
|
|
40
|
+
* Renders custom tooltip content instead of the plain label. Receives the resolved
|
|
41
|
+
* label (`text` or the default for `kind`) so defaults can be decorated.
|
|
42
|
+
*
|
|
43
|
+
* Note: `MrlTooltip` is memoized, so this function should be memoized by consumers.
|
|
44
|
+
*/
|
|
45
|
+
tooltipCustomRender?: MrlIconButtonProps['tooltipCustomRender'];
|
|
38
46
|
}
|
|
39
47
|
/**
|
|
40
48
|
* Pagination button component
|
|
41
49
|
* @param {MrlPaginationButtonProps} props - the component props
|
|
42
50
|
* @returns a pagintaion button
|
|
43
51
|
*/
|
|
44
|
-
export declare function MrlPaginationButton({ buttonClass, className, disabled, kind, handleClick, text, tooltipAnchor, tooltipPosition, eventId, ...rest }: MrlPaginationButtonProps): JSX.Element;
|
|
52
|
+
export declare function MrlPaginationButton({ buttonClass, className, disabled, kind, handleClick, text, tooltipAnchor, tooltipPosition, tooltipCustomRender, eventId, ...rest }: MrlPaginationButtonProps): JSX.Element;
|
|
45
53
|
export {};
|
|
@@ -50,6 +50,7 @@ export interface MrlToolbarButtonProps {
|
|
|
50
50
|
size?: MrlIconButtonProps['size'];
|
|
51
51
|
state?: MrlIconButtonProps['state'];
|
|
52
52
|
tipAnchor?: MrlIconButtonProps['tipAnchor'];
|
|
53
|
+
tooltipCustomRender?: MrlIconButtonProps['tooltipCustomRender'];
|
|
53
54
|
toggleAria?: MrlIconButtonProps['toggleAria'];
|
|
54
55
|
toggleStyle?: MrlIconButtonProps['toggleStyle'];
|
|
55
56
|
};
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { AttrsObject } from '../../../utils';
|
|
3
3
|
import { MrlTooltipAnchor, MrlTooltipPosition, MrlTooltipState } from '../constants';
|
|
4
4
|
import '../../../styles/shared/a11y-helpers/a11y.global.scss';
|
|
5
|
-
interface MrlTooltipProps {
|
|
5
|
+
export interface MrlTooltipProps {
|
|
6
6
|
/** The arrow position of the tooltip in relation to its trigger's content */
|
|
7
7
|
anchor?: MrlTooltipAnchor;
|
|
8
8
|
/**
|
|
@@ -37,7 +37,12 @@ interface MrlTooltipProps {
|
|
|
37
37
|
tooltipClass?: string;
|
|
38
38
|
/** A class to be applied ot the tooltip content */
|
|
39
39
|
tooltipContentClass?: string;
|
|
40
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Renders custom tooltip content instead of the plain `text`. Receives `text` as
|
|
42
|
+
* its argument. `text` is still required and used for accessibility.
|
|
43
|
+
*
|
|
44
|
+
* Note: `MrlTooltip` is memoized, so this function should be memoized by consumers.
|
|
45
|
+
*/
|
|
41
46
|
customRender?: (text?: string) => React.ReactNode;
|
|
42
47
|
/**
|
|
43
48
|
* Enables interaction tracking for this tooltip. Provide a stable, non-PII id
|
|
@@ -48,6 +53,10 @@ interface MrlTooltipProps {
|
|
|
48
53
|
*/
|
|
49
54
|
eventId?: string;
|
|
50
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Tooltip configuration for components that wrap `MrlTooltip` (e.g. `MrlButton`).
|
|
58
|
+
*/
|
|
59
|
+
export type TooltipConfig = Pick<MrlTooltipProps, 'anchor' | 'customRender' | 'dataQa' | 'position' | 'text'>;
|
|
51
60
|
/**
|
|
52
61
|
* MrlTooltip Component
|
|
53
62
|
*
|
|
@@ -57,4 +66,3 @@ interface MrlTooltipProps {
|
|
|
57
66
|
* @returns {HTMLElement} a configured Tooltip component
|
|
58
67
|
*/
|
|
59
68
|
export declare const MrlTooltip: React.MemoExoticComponent<(props: MrlTooltipProps) => React.ReactElement>;
|
|
60
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MrlTooltip } from './MrlTooltip';
|
|
1
|
+
export { MrlTooltip, type MrlTooltipProps, type TooltipConfig } from './MrlTooltip';
|