@navinc/base-react-components
Version:
Nav's Pattern Library
34 lines • 1.03 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
/**
* DOM attributes required to redact text from systems like FullStory and Heap
*
* @example
* ```tsx
* <div {....redactProps}>Private text will be redacted</div>
* ```
*
* @note `className` is likely to conflict with other props, so it is recommended to use the `<Redact>` component
* instead. If you must use `redactProps`, be sure to spread it after other props.
* ```tsx
* <div className="test" {...redactProps}>Private text will be redacted</div> // className will be overridden here
* ```
*/
export const redactProps = {
className: 'js-private',
'data-heap-redact-text': 'true',
};
/**
* Redact children text from systems like FullStory and Heap
*
* @example
* ```tsx
* <Redact>Private text will be redacted</Redact>
* <Redact>
* <Input placeholder="Private text will be redacted" />
* </Redact>
* ```
*/
export const Redact = (props) => {
return _jsx("span", Object.assign({}, props, redactProps));
};
//# sourceMappingURL=redact.js.map