design-system-govbr-rnp
Version:
## Padrão Digital de Governo - React Biblioteca de componentes React que implementa o [Padrão Visual digital do governo](https://www.gov.br/ds/). O objetivo da biblioteca é facilitar a implementação e promover a padronização das interfaces de sistemas do
26 lines (25 loc) • 3.88 kB
JavaScript
;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.IconButton = exports.Button = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var densityVariant = function densityVariant(density) {
return {
small: (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: var(--spacing-scale-9x);\n "]))),
medium: (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: var(--spacing-scale-8x);\n "]))),
large: (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: var(--spacing-scale-7x);\n "])))
}[density];
};
var Button = _styledComponents.default.button(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: var(--green-cool-vivid-50);\n border: var(--gray-5) solid\n calc((var(--spacing-scale-8x) - var(--spacing-scale-5xh)) * 0.5);\n border-radius: 100em;\n box-shadow: var(--surface-offset-none) var(--surface-offset-md)\n var(--surface-blur-lg)\n rgba(var(--rgb-secondary-09), var(--surface-opacity-xs));\n color: var(--pure-0);\n cursor: pointer;\n font-size: var(--font-size-scale-up-02);\n font-weight: var(--font-weight-semi-bold);\n height: var(--spacing-scale-8x);\n padding: 0 var(--spacing-scale-3xh);\n text-align: center;\n vertical-align: middle;\n white-space: nowrap;\n width: auto;\n\n &:hover {\n background-color: var(--green-cool-vivid-50);\n }\n\n &:focus {\n outline-color: var(--gold-vivid-40);\n outline-offset: var(--spacing-scale-half);\n outline-style: dashed;\n outline-width: var(--surface-width-lg);\n }\n\n ", "\n"])), function (_ref) {
var density = _ref.density;
return densityVariant(density);
});
exports.Button = Button;
var IconButton = (0, _styledComponents.default)(Button)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border-radius: 50%;\n padding: 0;\n width: var(--spacing-scale-8x);\n"])));
exports.IconButton = IconButton;