@atlaskit/spotlight
Version:
A spotlight introduces users to points of interest, from focused messages to multi-step tours.
41 lines • 1.48 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';
const 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 const SpotlightSecondaryAction = /*#__PURE__*/forwardRef(({
'aria-label': ariaLabel,
onClick,
children,
testId
}, ref) => {
const {
secondaryAction
} = useContext(SpotlightContext);
const 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));
});