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
30 lines (29 loc) • 5 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.Wrapper = exports.Title = exports.Label = exports.Input = exports.Info = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
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 Label = _styledComponents.default.label(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n color: var(--gray-80);\n cursor: pointer;\n display: grid;\n font-size: var(--font-size-scale-base);\n font-weight: var(--font-weight-medium);\n grid-template-columns: 32px auto;\n ", "\n\n &:not(:last-child) {\n margin-bottom: var(--spacing-scale-2x);\n }\n"])), function (_ref) {
var disabled = _ref.disabled;
return disabled && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: not-allowed;\n opacity: 0.45;\n "])));
});
exports.Label = Label;
var Input = _styledComponents.default.input(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n appearance: none;\n background-color: #fff;\n border: 1px solid var(--gray-20);\n border-radius: 50%;\n box-sizing: border-box;\n color: var(--gray-20);\n cursor: pointer;\n display: grid;\n margin: 0;\n place-content: center;\n width: 24px;\n height: 24px;\n\n ", "\n\n &::before {\n content: \"\";\n width: 16px;\n height: 16px;\n border-radius: 50%;\n transform: scale(0);\n transition: 120ms transform ease-in-out;\n box-shadow: inset 16px 16px var(--blue-warm-vivid-50);\n }\n\n &:checked::before {\n transform: scale(1);\n }\n\n &:focus-visible {\n border-color: var(--gold-vivid-40);\n box-shadow: 0 0 0 var(--surface-width-md) var(--gold-vivid-40);\n outline: none;\n }\n"])), function (_ref2) {
var state = _ref2.state;
return state === "valid" ? "\n border-color: var(--green-cool-vivid-50);\n " : state === "invalid" ? "border-color: var(--red-vivid-50);" : null;
});
exports.Input = Input;
var Title = _styledComponents.default.p(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: var(--gray-80);\n font-size: var(--font-size-scale-base);\n font-weight: var(--font-weight-semi-bold);\n line-height: var(--font-line-height-medium);\n margin-bottom: var(--spacing-scale-default);\n"])));
exports.Title = Title;
var Info = _styledComponents.default.p(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: var(--gray-80);\n font-size: var(--font-size-scale-up-01);\n font-weight: var(--font-weight-regular);\n line-height: var(--font-line-height-medium);\n margin-bottom: var(--spacing-scale-2x);\n"])));
exports.Info = Info;
var Wrapper = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
return props.inline && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n div {\n align-items: center;\n display: flex;\n }\n ", " {\n margin-right: var(--spacing-scale-4x);\n\n &:not(:last-child) {\n margin-bottom: 0;\n }\n }\n "])), Label);
});
exports.Wrapper = Wrapper;