Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Tooltip", {
enumerable: true,
get: function() {
return Tooltip;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useTooltip = require("./useTooltip");
const _renderTooltip = require("./renderTooltip");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _useTooltipStylesstyles = require("./useTooltipStyles.styles");
const Tooltip = (props)=>{
const state = (0, _useTooltip.useTooltip_unstable)(props);
(0, _useTooltipStylesstyles.useTooltipStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useTooltipStyles_unstable')(state);
return (0, _renderTooltip.renderTooltip_unstable)(state);
};
Tooltip.displayName = 'Tooltip';
// type casting here is required to ensure internal type FluentTriggerComponent is not leaked
Tooltip.isFluentTriggerComponent = true;
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTooltip_unstable } from './useTooltip';\nimport { renderTooltip_unstable } from './renderTooltip';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useTooltipStyles_unstable } from './useTooltipStyles.styles';\nimport type { TooltipProps } from './Tooltip.types';\nimport type { FluentTriggerComponent } from '@fluentui/react-utilities';\n\n/**\n * A tooltip provides light weight contextual information on top of its target element.\n */\nexport const Tooltip: React.FC<TooltipProps> = props => {\n const state = useTooltip_unstable(props);\n\n useTooltipStyles_unstable(state);\n\n useCustomStyleHook_unstable('useTooltipStyles_unstable')(state);\n\n return renderTooltip_unstable(state);\n};\n\nTooltip.displayName = 'Tooltip';\n// type casting here is required to ensure internal type FluentTriggerComponent is not leaked\n(Tooltip as FluentTriggerComponent).isFluentTriggerComponent = true;\n"],"names":["Tooltip","props","state","useTooltip_unstable","useTooltipStyles_unstable","useCustomStyleHook_unstable","renderTooltip_unstable","displayName","isFluentTriggerComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;4BACa;+BACG;qCACK;wCACF;AAOnC,MAAMA,UAAkCC,CAAAA;IAC7C,MAAMC,QAAQC,IAAAA,+BAAAA,EAAoBF;IAElCG,IAAAA,iDAAAA,EAA0BF;IAE1BG,IAAAA,gDAAAA,EAA4B,6BAA6BH;IAEzD,OAAOI,IAAAA,qCAAAA,EAAuBJ;AAChC;AAEAF,QAAQO,WAAW,GAAG;AACtB,6FAA6F;AAC5FP,QAAmCQ,wBAAwB,GAAG"}
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Tooltip/Tooltip.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { PositioningShorthand } from '@fluentui/react-positioning';\nimport type { ComponentProps, ComponentState, Slot, TriggerProps } from '@fluentui/react-utilities';\nimport type { PortalProps } from '@fluentui/react-portal';\n\n/**\n * Slot properties for Tooltip\n */\nexport type TooltipSlots = {\n /**\n * The text or JSX content of the tooltip.\n */\n content: NonNullable<Slot<'div'>>;\n};\n\n/**\n * The properties that are added to the child of the Tooltip\n */\nexport type TooltipChildProps = {\n ref?: React.Ref<unknown>;\n} & Pick<\n React.HTMLAttributes<HTMLElement>,\n | 'aria-describedby'\n | 'aria-label'\n | 'aria-labelledby'\n | 'onBlur'\n | 'onFocus'\n | 'onPointerEnter'\n | 'onPointerLeave'\n | 'aria-haspopup'\n | 'aria-expanded'\n>;\n\n/**\n * Data for the Tooltip's onVisibleChange event.\n */\nexport type OnVisibleChangeData = {\n visible: boolean;\n\n /**\n * The event object, if this visibility change was triggered by a keyboard event on the document element\n * (such as Escape to hide the visible tooltip). Otherwise undefined.\n */\n documentKeyboardEvent?: KeyboardEvent;\n};\n\n/**\n * Properties for Tooltip\n */\nexport type TooltipProps = ComponentProps<TooltipSlots> &\n TriggerProps<TooltipChildProps> &\n Pick<PortalProps, 'mountNode'> & {\n /**\n * The tooltip's visual appearance.\n * * `normal` - Uses the theme's background and text colors.\n * * `inverted` - Higher contrast variant that uses the theme's inverted colors.\n *\n * @default normal\n */\n appearance?: 'normal' | 'inverted';\n /**\n * Delay before the tooltip is hidden, in milliseconds.\n *\n * @default 250\n */\n hideDelay?: number;\n\n /**\n * Notification when the visibility of the tooltip is changing.\n *\n * **Note**: for backwards compatibility, `event` will be undefined if this was triggered by a keyboard event on\n * the document element. Use `data.documentKeyboardEvent` if the keyboard event object is needed.\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onVisibleChange?: (\n event: React.PointerEvent<HTMLElement> | React.FocusEvent<HTMLElement> | undefined,\n data: OnVisibleChangeData,\n ) => void;\n\n /**\n * Configure the positioning of the tooltip\n *\n * @default above\n */\n positioning?: PositioningShorthand;\n\n /**\n * (Required) Specifies whether this tooltip is acting as the description or label of its trigger element.\n *\n * * `label` - The tooltip sets the trigger's aria-label or aria-labelledby attribute. This is useful for buttons\n * displaying only an icon, for example.\n * * `description` - The tooltip sets the trigger's aria-description or aria-describedby attribute.\n * * `inaccessible` - No aria attributes are set on the trigger. This makes the tooltip's content inaccessible to\n * screen readers, and should only be used if the tooltip's text is available by some other means.\n */\n relationship: 'label' | 'description' | 'inaccessible';\n\n /**\n * Delay before the tooltip is shown, in milliseconds.\n *\n * @default 250\n */\n showDelay?: number;\n\n /**\n * Control the tooltip's visibility programatically.\n *\n * This can be used in conjunction with onVisibleChange to modify the tooltip's show and hide behavior.\n *\n * If not provided, the visibility will be controlled by the tooltip itself, based on hover and focus events on the\n * trigger (child) element.\n *\n * @default false\n */\n visible?: boolean;\n\n /**\n * Render an arrow pointing to the target element\n *\n * @default false\n */\n withArrow?: boolean;\n };\n\n/**\n * State used in rendering Tooltip\n */\nexport type TooltipState = ComponentState<TooltipSlots> &\n Pick<TooltipProps, 'mountNode' | 'relationship'> &\n Required<Pick<TooltipProps, 'appearance' | 'hideDelay' | 'positioning' | 'showDelay' | 'visible' | 'withArrow'>> & {\n children?: React.ReactElement | null;\n\n /**\n * Whether the tooltip should be rendered to the DOM.\n */\n shouldRenderTooltip?: boolean;\n\n /**\n * Ref to the arrow element\n */\n arrowRef?: React.Ref<HTMLDivElement>;\n\n /**\n * CSS class for the arrow element\n */\n arrowClassName?: string;\n };\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Tooltip: function() {
return _Tooltip.Tooltip;
},
renderTooltip_unstable: function() {
return _renderTooltip.renderTooltip_unstable;
},
tooltipClassNames: function() {
return _useTooltipStylesstyles.tooltipClassNames;
},
useTooltipStyles_unstable: function() {
return _useTooltipStylesstyles.useTooltipStyles_unstable;
},
useTooltip_unstable: function() {
return _useTooltip.useTooltip_unstable;
}
});
const _Tooltip = require("./Tooltip");
const _renderTooltip = require("./renderTooltip");
const _useTooltip = require("./useTooltip");
const _useTooltipStylesstyles = require("./useTooltipStyles.styles");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Tooltip/index.ts"],"sourcesContent":["export { Tooltip } from './Tooltip';\nexport type { OnVisibleChangeData, TooltipChildProps, TooltipProps, TooltipSlots, TooltipState } from './Tooltip.types';\nexport { renderTooltip_unstable } from './renderTooltip';\nexport { useTooltip_unstable } from './useTooltip';\nexport { tooltipClassNames, useTooltipStyles_unstable } from './useTooltipStyles.styles';\n"],"names":["Tooltip","renderTooltip_unstable","tooltipClassNames","useTooltipStyles_unstable","useTooltip_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,OAAO;eAAPA,gBAAO;;IAEPC,sBAAsB;eAAtBA,qCAAsB;;IAEtBC,iBAAiB;eAAjBA,yCAAiB;;IAAEC,yBAAyB;eAAzBA,iDAAyB;;IAD5CC,mBAAmB;eAAnBA,+BAAmB;;;yBAHJ;+BAEe;4BACH;wCACyB"}
@@ -0,0 +1,22 @@
/**
* The height of the tooltip's arrow in pixels.
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
arrowHeight: function() {
return arrowHeight;
},
tooltipBorderRadius: function() {
return tooltipBorderRadius;
}
});
const arrowHeight = 6;
const tooltipBorderRadius = 4;
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Tooltip/private/constants.ts"],"sourcesContent":["/**\n * The height of the tooltip's arrow in pixels.\n */\nexport const arrowHeight = 6;\n\n/**\n * The default value of the tooltip's border radius (borderRadiusMedium).\n *\n * Unfortunately, Popper requires it to be specified as a variable instead of using CSS.\n * While we could use getComputedStyle, that adds a performance penalty for something that\n * will likely never change.\n */\nexport const tooltipBorderRadius = 4;\n"],"names":["arrowHeight","tooltipBorderRadius"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;CAEC;;;;;;;;;;;IACYA,WAAAA;eAAAA;;IASAC,mBAAAA;eAAAA;;;AATN,MAAMD,cAAc;AASpB,MAAMC,sBAAsB"}
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderTooltip_unstable", {
enumerable: true,
get: function() {
return renderTooltip_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactportal = require("@fluentui/react-portal");
const _reactutilities = require("@fluentui/react-utilities");
const renderTooltip_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
children: [
state.children,
state.shouldRenderTooltip && /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactportal.Portal, {
mountNode: state.mountNode,
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.content, {
children: [
state.withArrow && /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
ref: state.arrowRef,
className: state.arrowClassName
}),
state.content.children
]
})
})
]
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Tooltip/renderTooltip.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Portal } from '@fluentui/react-portal';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TooltipSlots, TooltipState } from './Tooltip.types';\n\n/**\n * Render the final JSX of Tooltip\n */\nexport const renderTooltip_unstable = (state: TooltipState) => {\n assertSlots<TooltipSlots>(state);\n\n return (\n <>\n {state.children}\n {state.shouldRenderTooltip && (\n <Portal mountNode={state.mountNode}>\n <state.content>\n {state.withArrow && <div ref={state.arrowRef} className={state.arrowClassName} />}\n {state.content.children}\n </state.content>\n </Portal>\n )}\n </>\n );\n};\n"],"names":["renderTooltip_unstable","state","assertSlots","_jsxs","_Fragment","children","shouldRenderTooltip","_jsx","Portal","mountNode","content","withArrow","div","ref","arrowRef","className","arrowClassName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;4BATb;6BAEuB;gCACK;AAMrB,MAAMA,yBAAyB,CAACC;IACrCC,IAAAA,2BAAAA,EAA0BD;IAE1B,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAAAC,oBAAA,EAAA;;YACGH,MAAMI,QAAQ;YACdJ,MAAMK,mBAAmB,IAAA,WAAA,GACxBC,IAAAA,eAAA,EAACC,mBAAAA,EAAAA;gBAAOC,WAAWR,MAAMQ,SAAS;0BAChC,WAAA,GAAAN,IAAAA,gBAAA,EAACF,MAAMS,OAAO,EAAA;;wBACXT,MAAMU,SAAS,IAAA,WAAA,GAAIJ,IAAAA,eAAA,EAACK,OAAAA;4BAAIC,KAAKZ,MAAMa,QAAQ;4BAAEC,WAAWd,MAAMe,cAAc;;wBAC5Ef,MAAMS,OAAO,CAACL,QAAQ;;;;;;AAMnC"}
@@ -0,0 +1,231 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useTooltip_unstable", {
enumerable: true,
get: function() {
return useTooltip_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactpositioning = require("@fluentui/react-positioning");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const _reacttabster = require("@fluentui/react-tabster");
const _reactutilities = require("@fluentui/react-utilities");
const _constants = require("./private/constants");
const _keyboardkeys = require("@fluentui/keyboard-keys");
const useTooltip_unstable = (props)=>{
'use no memo';
var _child_props, _child_props1, _child_props2, _child_props3, _child_props4, _child_props5;
const context = (0, _reactsharedcontexts.useTooltipVisibility_unstable)();
const isServerSideRender = (0, _reactutilities.useIsSSR)();
const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
const [setDelayTimeout, clearDelayTimeout] = (0, _reactutilities.useTimeout)();
const { appearance = 'normal', children, content, withArrow = false, positioning = 'above', onVisibleChange, relationship, showDelay = 250, hideDelay = 250, mountNode } = props;
const [visible, setVisibleInternal] = (0, _reactutilities.useControllableState)({
state: props.visible,
initialState: false
});
const setVisible = _react.useCallback((ev, data)=>{
clearDelayTimeout();
setVisibleInternal((oldVisible)=>{
if (data.visible !== oldVisible) {
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(ev, data);
}
return data.visible;
});
}, [
clearDelayTimeout,
setVisibleInternal,
onVisibleChange
]);
const state = {
withArrow,
positioning,
showDelay,
hideDelay,
relationship,
visible,
shouldRenderTooltip: visible,
appearance,
mountNode,
// Slots
components: {
content: 'div'
},
content: _reactutilities.slot.always(content, {
defaultProps: {
role: 'tooltip'
},
elementType: 'div'
})
};
state.content.id = (0, _reactutilities.useId)('tooltip-', state.content.id);
const positioningOptions = {
enabled: state.visible,
arrowPadding: 2 * _constants.tooltipBorderRadius,
position: 'above',
align: 'center',
offset: 4,
...(0, _reactpositioning.resolvePositioningShorthand)(state.positioning)
};
if (state.withArrow) {
positioningOptions.offset = (0, _reactpositioning.mergeArrowOffset)(positioningOptions.offset, _constants.arrowHeight);
}
const { targetRef, containerRef, arrowRef } = (0, _reactpositioning.usePositioning)(positioningOptions);
state.content.ref = (0, _reactutilities.useMergedRefs)(state.content.ref, containerRef);
state.arrowRef = arrowRef;
// When this tooltip is visible, hide any other tooltips, and register it
// as the visibleTooltip with the TooltipContext.
// Also add a listener on document to hide the tooltip if Escape is pressed
(0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
if (visible) {
var _context_visibleTooltip;
const thisTooltip = {
hide: (ev)=>setVisible(undefined, {
visible: false,
documentKeyboardEvent: ev
})
};
(_context_visibleTooltip = context.visibleTooltip) === null || _context_visibleTooltip === void 0 ? void 0 : _context_visibleTooltip.hide();
context.visibleTooltip = thisTooltip;
const onDocumentKeyDown = (ev)=>{
if (ev.key === _keyboardkeys.Escape && !ev.defaultPrevented) {
thisTooltip.hide(ev);
// stop propagation to avoid conflicting with other elements that listen for `Escape`
// e,g: Dialog, Popover, Menu and Tooltip
ev.preventDefault();
}
};
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener('keydown', onDocumentKeyDown, {
// As this event is added at targeted document,
// we need to capture the event to be sure keydown handling from tooltip happens first
capture: true
});
return ()=>{
if (context.visibleTooltip === thisTooltip) {
context.visibleTooltip = undefined;
}
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener('keydown', onDocumentKeyDown, {
capture: true
});
};
}
}, [
context,
targetDocument,
visible,
setVisible
]);
// Used to skip showing the tooltip in certain situations when the trigger is focused.
// See comments where this is set for more info.
const ignoreNextFocusEventRef = _react.useRef(false);
// Listener for onPointerEnter and onFocus on the trigger element
const onEnterTrigger = _react.useCallback((ev)=>{
if (ev.type === 'focus' && ignoreNextFocusEventRef.current) {
ignoreNextFocusEventRef.current = false;
return;
}
// Show immediately if another tooltip is already visible
const delay = context.visibleTooltip ? 0 : state.showDelay;
setDelayTimeout(()=>{
setVisible(ev, {
visible: true
});
}, delay);
ev.persist(); // Persist the event since the setVisible call will happen asynchronously
}, [
setDelayTimeout,
setVisible,
state.showDelay,
context
]);
const isNavigatingWithKeyboard = (0, _reacttabster.useIsNavigatingWithKeyboard)();
// Callback ref that attaches a keyborg:focusin event listener.
const [keyborgListenerCallbackRef] = _react.useState(()=>{
const onKeyborgFocusIn = (ev)=>{
var _ev_detail;
// Skip showing the tooltip if focus moved programmatically.
// For example, we don't want to show the tooltip when a dialog is closed
// and Tabster programmatically restores focus to the trigger button.
// See https://github.com/microsoft/fluentui/issues/27576
if (((_ev_detail = ev.detail) === null || _ev_detail === void 0 ? void 0 : _ev_detail.isFocusedProgrammatically) && !isNavigatingWithKeyboard()) {
ignoreNextFocusEventRef.current = true;
}
};
// Save the current element to remove the listener when the ref changes
let current = null;
// Callback ref that attaches the listener to the element
return (element)=>{
current === null || current === void 0 ? void 0 : current.removeEventListener(_reacttabster.KEYBORG_FOCUSIN, onKeyborgFocusIn);
element === null || element === void 0 ? void 0 : element.addEventListener(_reacttabster.KEYBORG_FOCUSIN, onKeyborgFocusIn);
current = element;
};
});
// Listener for onPointerLeave and onBlur on the trigger element
const onLeaveTrigger = _react.useCallback((ev)=>{
let delay = state.hideDelay;
if (ev.type === 'blur') {
// Hide immediately when losing focus
delay = 0;
// The focused element gets a blur event when the document loses focus
// (e.g. switching tabs in the browser), but we don't want to show the
// tooltip again when the document gets focus back. Handle this case by
// checking if the blurred element is still the document's activeElement.
// See https://github.com/microsoft/fluentui/issues/13541
ignoreNextFocusEventRef.current = (targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement) === ev.target;
}
setDelayTimeout(()=>{
setVisible(ev, {
visible: false
});
}, delay);
ev.persist(); // Persist the event since the setVisible call will happen asynchronously
}, [
setDelayTimeout,
setVisible,
state.hideDelay,
targetDocument
]);
// Cancel the hide timer when the mouse or focus enters the tooltip, and restart it when the mouse or focus leaves.
// This keeps the tooltip visible when the mouse is moved over it, or it has focus within.
state.content.onPointerEnter = (0, _reactutilities.mergeCallbacks)(state.content.onPointerEnter, clearDelayTimeout);
state.content.onPointerLeave = (0, _reactutilities.mergeCallbacks)(state.content.onPointerLeave, onLeaveTrigger);
state.content.onFocus = (0, _reactutilities.mergeCallbacks)(state.content.onFocus, clearDelayTimeout);
state.content.onBlur = (0, _reactutilities.mergeCallbacks)(state.content.onBlur, onLeaveTrigger);
const child = (0, _reactutilities.getTriggerChild)(children);
const triggerAriaProps = {};
const isMenuTrigger = (child === null || child === void 0 ? void 0 : (_child_props = child.props) === null || _child_props === void 0 ? void 0 : _child_props['aria-haspopup']) === 'menu' && (child === null || child === void 0 ? void 0 : (_child_props1 = child.props) === null || _child_props1 === void 0 ? void 0 : _child_props1['aria-expanded']);
if (relationship === 'label') {
// aria-label only works if the content is a string. Otherwise, need to use aria-labelledby.
if (typeof state.content.children === 'string') {
triggerAriaProps['aria-label'] = state.content.children;
} else {
triggerAriaProps['aria-labelledby'] = state.content.id;
// Always render the tooltip even if hidden, so that aria-labelledby refers to a valid element
state.shouldRenderTooltip = true;
}
} else if (relationship === 'description') {
triggerAriaProps['aria-describedby'] = state.content.id;
// Always render the tooltip even if hidden, so that aria-describedby refers to a valid element
state.shouldRenderTooltip = true;
}
// Case 1: Don't render the Tooltip in SSR to avoid hydration errors
// Case 2: Don't render the Tooltip, if it triggers Menu and it's already opened
if (isServerSideRender || isMenuTrigger) {
state.shouldRenderTooltip = false;
}
// Apply the trigger props to the child, either by calling the render function, or cloning with the new props
state.children = (0, _reactutilities.applyTriggerPropsToChildren)(children, {
...triggerAriaProps,
...child === null || child === void 0 ? void 0 : child.props,
ref: (0, _reactutilities.useMergedRefs)(child === null || child === void 0 ? void 0 : child.ref, keyborgListenerCallbackRef, positioningOptions.target === undefined ? targetRef : undefined),
onPointerEnter: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : (_child_props2 = child.props) === null || _child_props2 === void 0 ? void 0 : _child_props2.onPointerEnter, onEnterTrigger)),
onPointerLeave: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : (_child_props3 = child.props) === null || _child_props3 === void 0 ? void 0 : _child_props3.onPointerLeave, onLeaveTrigger)),
onFocus: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : (_child_props4 = child.props) === null || _child_props4 === void 0 ? void 0 : _child_props4.onFocus, onEnterTrigger)),
onBlur: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(child === null || child === void 0 ? void 0 : (_child_props5 = child.props) === null || _child_props5 === void 0 ? void 0 : _child_props5.onBlur, onLeaveTrigger))
});
return state;
};
File diff suppressed because one or more lines are too long
@@ -0,0 +1,202 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
tooltipClassNames: function() {
return tooltipClassNames;
},
useTooltipStyles_unstable: function() {
return useTooltipStyles_unstable;
}
});
const _react = require("@griffel/react");
const tooltipClassNames = {
content: 'fui-Tooltip__content'
};
/**
* Styles for the tooltip
*/ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
root: {
mc9l5x: "fjseox",
B7ck84d: "f1ewtqcl",
B2u0y6b: "f132xexn",
Bceei9c: "f158kwzp",
Bahqtrf: "fk6fouc",
Be2twd7: "fy9rknc",
Bg96gwp: "fwrc4pm",
Btd35i7: "fokg9q4",
Beyfa6y: 0,
Bbmb7ep: 0,
Btl43ni: 0,
B7oj6ja: 0,
Dimara: "ft85np5",
Bgfg5da: 0,
B9xav0g: 0,
oivjwe: 0,
Bn0qgzm: 0,
B4g9neb: 0,
zhjwy3: 0,
wvpqe5: 0,
ibv6hh: 0,
u1mtju: 0,
h3c5rm: 0,
vrafjx: 0,
Bekrc4i: 0,
i8vvqc: 0,
g2u3we: 0,
icvyot: 0,
B4j52fo: 0,
irswps: "f9ggezi",
Byoj8tv: 0,
uwmqm3: 0,
z189sj: 0,
z8tnut: 0,
B0ocmuz: "f1bzqsji",
De3pzq: "fxugw4r",
sj55zd: "f19n0e5",
Bhu2qc9: "fxeb0a7"
},
visible: {
mc9l5x: "ftgm304"
},
inverted: {
De3pzq: "fg3r6xk",
sj55zd: "fonrgv7"
},
arrow: {
B7ck84d: "f1ewtqcl",
qhf8xq: "f1euv43f",
Bj3rh1h: "f1bsuimh",
rhnwrx: "f1s3jn22",
Bdy53xb: "fv40uqz",
De3pzq: "f1u2r49w",
B2eet1l: "fqhgnl",
Beyfa6y: "f17bz04i",
Bz10aip: "f36o3x3",
Bqenvij: "fzofk8q",
a9b677: "f1wbx1ie",
Ftih45: "f1wl9k8s",
Br0sdwz: "f1aocrix",
cmx5o7: "f1ljr5q2",
susq4k: 0,
Biibvgv: 0,
Bicfajf: 0,
qehafq: 0,
Brs5u8j: "f155f1qt",
Ccq8qp: "f9mhzq7",
Baz25je: "fr6rhvx",
Bcgcnre: 0,
Bqjgrrk: 0,
qa3bma: 0,
y0oebl: 0,
Biqmznv: 0,
Bm6vgfq: 0,
Bbv0w2i: 0,
uvfttm: 0,
eqrjj: 0,
Bk5zm6e: 0,
m598lv: 0,
B4f6apu: 0,
ydt019: 0,
Bq4z7u6: 0,
Bdkvgpv: 0,
B0qfbqy: 0,
kj8mxx: "f1kc0wz4",
r59vdv: "fgq90dz",
Bkw5xw4: "fq0y47f",
hl6cv3: "f1pwrbz6",
aea9ga: "f1hxxcvm",
yayu3t: "fw8rgyo",
Bhsv975: "f1wnzycx",
rhl9o9: "f1730wal",
B7gxrvb: "f1fy4ixr",
B6q6orb: "fobkauc",
B0lu1f8: "f16bqv1l"
}
}, {
d: [
".fjseox{display:none;}",
".f1ewtqcl{box-sizing:border-box;}",
".f132xexn{max-width:240px;}",
".f158kwzp{cursor:default;}",
".fk6fouc{font-family:var(--fontFamilyBase);}",
".fy9rknc{font-size:var(--fontSizeBase200);}",
".fwrc4pm{line-height:var(--lineHeightBase200);}",
".fokg9q4{overflow-wrap:break-word;}",
[
".ft85np5{border-radius:var(--borderRadiusMedium);}",
{
p: -1
}
],
[
".f9ggezi{border:1px solid var(--colorTransparentStroke);}",
{
p: -2
}
],
[
".f1bzqsji{padding:4px 11px 6px 11px;}",
{
p: -1
}
],
".fxugw4r{background-color:var(--colorNeutralBackground1);}",
".f19n0e5{color:var(--colorNeutralForeground1);}",
".fxeb0a7{filter:drop-shadow(0 0 2px var(--colorNeutralShadowAmbient)) drop-shadow(0 4px 8px var(--colorNeutralShadowKey));}",
".ftgm304{display:block;}",
".fg3r6xk{background-color:var(--colorNeutralBackgroundStatic);}",
".fonrgv7{color:var(--colorNeutralForegroundStaticInverted);}",
".f1euv43f{position:absolute;}",
".f1bsuimh{z-index:-1;}",
".f1s3jn22{--fui-positioning-arrow-height:8.484px;}",
".fv40uqz{--fui-positioning-arrow-offset:-4.242px;}",
".f1u2r49w{background-color:inherit;}",
".fqhgnl{background-clip:content-box;}",
".f17bz04i{border-bottom-left-radius:var(--borderRadiusSmall);}",
".f36o3x3{transform:rotate(var(--fui-positioning-arrow-angle));}",
".fzofk8q{height:var(--fui-positioning-arrow-height);}",
".f1wbx1ie{width:var(--fui-positioning-arrow-height);}",
".f1wl9k8s::before{content:\"\";}",
".f1aocrix::before{display:block;}",
".f1ljr5q2::before{background-color:inherit;}",
[
".f155f1qt::before{margin:-1px;}",
{
p: -1
}
],
".f9mhzq7::before{width:100%;}",
".fr6rhvx::before{height:100%;}",
[
".f1kc0wz4::before{border:1px solid var(--colorTransparentStroke);}",
{
p: -2
}
],
".fgq90dz::before{border-bottom-left-radius:var(--borderRadiusSmall);}",
".fq0y47f::before{clip-path:polygon(0% 0%, 100% 100%, 0% 100%);}",
"[data-popper-placement^=\"top\"] .f1pwrbz6{bottom:var(--fui-positioning-arrow-offset);}",
"[data-popper-placement^=\"top\"] .f1hxxcvm{--fui-positioning-arrow-angle:-45deg;}",
"[data-popper-placement^=\"right\"] .fw8rgyo{left:var(--fui-positioning-arrow-offset);}",
"[data-popper-placement^=\"right\"] .f1wnzycx{--fui-positioning-arrow-angle:45deg;}",
"[data-popper-placement^=\"bottom\"] .f1730wal{top:var(--fui-positioning-arrow-offset);}",
"[data-popper-placement^=\"bottom\"] .f1fy4ixr{--fui-positioning-arrow-angle:135deg;}",
"[data-popper-placement^=\"left\"] .fobkauc{right:var(--fui-positioning-arrow-offset);}",
"[data-popper-placement^=\"left\"] .f16bqv1l{--fui-positioning-arrow-angle:225deg;}"
]
});
const useTooltipStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.content.className = (0, _react.mergeClasses)(tooltipClassNames.content, styles.root, state.appearance === 'inverted' && styles.inverted, state.visible && styles.visible, state.content.className);
state.arrowClassName = styles.arrow;
return state;
};
File diff suppressed because one or more lines are too long