@atlaskit/spotlight
Version:
A spotlight introduces users to points of interest, from focused messages to multi-step tours.
39 lines • 1.59 kB
JavaScript
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */
import "./index.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { forwardRef, useContext } from 'react';
import { fg } from '@atlaskit/platform-feature-flags/fg';
import { Pressable, Text } from '@atlaskit/primitives/compiled';
import { SpotlightContext } from '../../controllers/context';
var styles = {
root: "_2rko12b0 _v564k6bl _syaz15cr _bfhk1aqn _irr31ibz _1ggl5xtf _1di6of27",
rootMotion: "_2rko12b0 _v564k6bl _syaz15cr _bfhk1aqn _irr31ibz _1ggl5xtf _1di6of27"
};
/**
* __Spotlight secondary action__
*
* `SpotlightSecondaryAction` is not required for all spotlight components. It should supplement the `SpotlightPrimaryAction`.
* It is intended to be used to go back to the previous step in multi step spotlight tours, or other similar actions.
*
*/
export var SpotlightSecondaryAction = /*#__PURE__*/forwardRef(function (_ref, ref) {
var ariaLabel = _ref['aria-label'],
onClick = _ref.onClick,
children = _ref.children,
testId = _ref.testId;
var _useContext = useContext(SpotlightContext),
secondaryAction = _useContext.secondaryAction;
var back = function back(event) {
secondaryAction.action.current(event);
};
return /*#__PURE__*/React.createElement(Pressable, {
"aria-label": ariaLabel,
ref: ref,
testId: testId,
xcss: fg('platform-dst-motion-uplift-custom-button') ? styles.rootMotion : styles.root,
onClick: onClick || back
}, /*#__PURE__*/React.createElement(Text, {
as: "span"
}, children));
});