@procore/core-react
Version:
React library of Procore Design Guidelines
45 lines • 2.39 kB
JavaScript
var _excluded = ["children", "variant"];
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
import React from 'react';
import styled from 'styled-components';
import { getTypographyIntent } from '../Typography';
import { useDeprecation } from '../_hooks/Deprecation';
import { colors } from '../_styles/colors';
var variantColorMap = {
required: 'orange50',
error: 'red50',
pagination: 'gray45'
};
var StyledNotation = /*#__PURE__*/styled.i.withConfig({
displayName: "StyledNotation",
componentId: "core-12_44_0__sc-160q1m6-0"
})(["", " color:", ";font-style:italic;"], getTypographyIntent('small'), function (_ref) {
var $variant = _ref.$variant;
return $variant ? colors[variantColorMap[$variant]] : colors.gray15;
});
/**
* @deprecated Please use `<Typography italic />` component for plain text
* notations or the `<Required />` component for required notations. `Notation`
* will be removed in a future version.
* @deprecatedSince 11
*
* @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_coverage-notation--basic-props)
*/
export var Notation = /*#__PURE__*/React.forwardRef(function Notation(_ref2, ref) {
var children = _ref2.children,
_ref2$variant = _ref2.variant,
variant = _ref2$variant === void 0 ? '' : _ref2$variant,
props = _objectWithoutProperties(_ref2, _excluded);
useDeprecation({
oldThing: 'Notation',
newThing: 'Typography or Required'
});
return /*#__PURE__*/React.createElement(StyledNotation, _extends({}, props, {
$variant: variant,
ref: ref
}), children);
});
Notation.displayName = 'Notation';
//# sourceMappingURL=Notation.js.map