UNPKG

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

110 lines (109 loc) 3.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Component = void 0; var _styledComponents = _interopRequireDefault(require("styled-components")); var _templateObject; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } var appliesFontWeight = function appliesFontWeight(weight) { switch (weight) { case "thin": return { fontWeight: "var(--font-weight-thin)" }; case "extra-light": return { fontWeight: "var(--font-weight-extra-light)" }; case "light": return { fontWeight: "var(--font-weight-light)" }; case "regular": return { fontWeight: "var(--font-weight-regular)" }; case "medium": return { fontWeight: "var(--font-weight-medium)" }; case "semi-bold": return { fontWeight: "var(--font-weight-semi-bold)" }; case "bold": return { fontWeight: "var(--font-weight-bold)" }; case "extra-bold": return { fontWeight: "var(--font-weight-extra-bold)" }; case "black": return { fontWeight: "var(--font-weight-black)" }; default: return { fontWeight: "var(--font-weight-regular)" }; } }; var appliesLineHeight = function appliesLineHeight(lineHeight) { switch (lineHeight) { case "low": return { lineHeight: "var(--font-line-height-low)" }; case "medium": return { lineHeight: "var(--font-line-height-medium)" }; case "high": return { lineHeight: "var(--font-line-height-high)" }; default: return { lineHeight: "var(--font-line-height-low)" }; } }; var appliesFontStyle = function appliesFontStyle(fontStyle) { switch (fontStyle) { case "italic": return { fontStyle: "italic" }; default: return { fontStyle: "normal" }; } }; var appliesSpacing = function appliesSpacing(spacingSelected) { return { margin: "var(--spacing-scale-".concat(spacingSelected, ")") }; }; var Component = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"])), function (props) { return props.fontWeight && appliesFontWeight(props.fontWeight); }, function (props) { return props.fontStyle && appliesFontStyle(props.fontStyle); }, function (props) { return props.lineHeight && appliesLineHeight(props.lineHeight); }, function (props) { return props.theme === "dark" ? { color: "var(--pure-0)", background: "var(--gray-80)" } : { color: "var(--gray-80)" }; }, function (props) { return props.spacing && appliesSpacing(props.spacing); }, function (props) { return props.fontSize && "font-size: ".concat(props.fontSize); }); exports.Component = Component;