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
60 lines (59 loc) • 6.53 kB
JavaScript
"use strict";
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.Select = exports.PaginationBox = exports.InputBox = exports.Icon = exports.BoxSelect = exports.BoxButtons = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
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 size = function size(_size) {
switch (_size) {
case "small":
return (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: var(--spacing-scale-3xh);\n height: var(--spacing-scale-3xh);\n "])));
case "large":
return (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: var(--spacing-scale-4xh);\n height: var(--spacing-scale-4xh);\n "])));
default:
break;
}
};
var PaginationBox = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background-color: ", ";\n display: flex;\n justify-content: ", ";\n\n & label {\n display: flex;\n align-items: center;\n color: ", ";\n margin-right: var(--spacing-scale-2x);\n }\n\n & .boxPage {\n display: flex;\n\n & span {\n display: flex;\n align-items: center;\n margin-inline: var(--spacing-scale-3xh);\n color: ", ";\n }\n\n & div {\n display: flex;\n height: var(--spacing-scale-7x);\n }\n }\n\n & button {\n color: ", ";\n\n &:hover {\n background: ", ";\n }\n }\n"])), function (props) {
return props.dark && "var(--blue-vivid-80)";
}, function (props) {
return props.type === "context" ? "space-between" : "center";
}, function (props) {
return props.dark ? "var(--pure-0)" : "var(--gray-80)";
}, function (props) {
return props.dark ? "var(--pure-0)" : "var(--gray-80)";
}, function (props) {
return props.dark && "var(--pure-0)";
}, function (props) {
return props.dark && "rgba(var(--rgb-primary-default), var(--surface-opacity-md)) !important";
});
exports.PaginationBox = PaginationBox;
var InputBox = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: contents;\n\n & div {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n & label {\n color: ", ";\n font-size: var(--spacing-scale-2x);\n border-radius: 100%;\n margin-inline: var(--spacing-scale-half);\n display: flex;\n align-items: center;\n justify-content: center;\n ", ";\n }\n\n & label:hover {\n background: rgba(\n var(--blue-warm-20-rgb),\n ", "\n );\n cursor: pointer;\n }\n\n & input {\n display: none;\n }\n\n & input:checked + label {\n background-color: ", ";\n color: ", ";\n font-weight: var(--font-weight-medium);\n }\n"])), function (props) {
return props.dark ? "var(--pure-0)" : "var(--blue-warm-vivid-70)";
}, function (props) {
return size(props === null || props === void 0 ? void 0 : props.size);
}, function (props) {
return props.dark ? "var(--surface-opacity-sm)" : "var(--surface-opacity-lg)";
}, function (props) {
return props.dark ? "var(--pure-0)" : "var(--blue-vivid-80)";
}, function (props) {
return props.dark ? "var(--blue-warm-vivid-70)" : "var(--pure-0)";
});
exports.InputBox = InputBox;
var Icon = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n margin-right: var(--spacing-scale-half);\n"])), function (props) {
return props.dark ? "var(--pure-0)" : "var(--blue-warm-vivid-70)";
});
exports.Icon = Icon;
var Select = _styledComponents.default.select(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n padding: var(--spacing-scale-half) var(--spacing-scale-base);\n border: none;\n background: ", ";\n border-radius: var(--spacing-scale-half);\n font-size: var(--font-size-scale-base);\n color: var(--green-cool-vivid-50);\n height: 60%;\n\n &:hover {\n background: rgba(var(--rgb-secondary-04), var(--surface-opacity-lg));\n }\n\n & option {\n font-size: var(--font-size-scale-base);\n }\n"])), function (props) {
return props.dark ? "var(--pure-0)" : "none";
});
exports.Select = Select;
var BoxSelect = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n align-items: center;\n display: flex;\n margin: var(--spacing-scale-default) var(--spacing-scale-3xh);\n"])));
exports.BoxSelect = BoxSelect;
var BoxButtons = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: var(--spacing-scale-default) var(--spacing-scale-2x);\n"])));
exports.BoxButtons = BoxButtons;