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) • 4.93 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.TabList = exports.TabButton = exports.StyledTabPanel = 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 densityVariant = function densityVariant(density) {
return {
small: (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n button {\n padding: var(--spacing-scale-3xh) var(--spacing-scale-3xh);\n }\n "]))),
medium: (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n button {\n padding: var(--spacing-scale-2x) var(--spacing-scale-3xh);\n }\n "]))),
large: (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n button {\n padding: var(--spacing-scale-base) var(--spacing-scale-3xh);\n }\n "])))
}[density];
};
var TabButton = _styledComponents.default.button(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: transparent;\n border: 0;\n border-bottom: 4px solid transparent;\n color: var(--gray-80);\n cursor: pointer;\n display: inline-block;\n font-size: var(--font-size-scale-up-02);\n font-weight: var(--font-weight-medium);\n line-height: 1;\n padding: var(--spacing-scale-2x) var(--spacing-scale-3xh);\n text-align: center;\n white-space: nowrap;\n\n &[aria-selected=\"true\"] {\n border-bottom: 4px solid var(--blue-warm-vivid-80);\n color: var(--blue-warm-vivid-80);\n }\n\n &:focus-visible {\n outline-color: var(--gold-vivid-40);\n outline-offset: -var(--spacing-scale-base);\n outline-style: dashed;\n outline-width: var(--surface-width-lg);\n }\n"])));
exports.TabButton = TabButton;
var TabList = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border-bottom: 1px solid var(--rgb-secondary-04);\n display: flex;\n overflow-x: auto;\n width: 100%;\n\n &::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n\n &::-webkit-scrollbar-track {\n background: var(--gray-10);\n }\n\n &::-webkit-scrollbar-thumb {\n background: var(--gray-30);\n }\n\n ", "\n\n ", "\n"])), function (props) {
return props.inverted && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n border-bottom: 1px solid var(--pure-0);\n\n ", " {\n color: var(--pure-0);\n\n &[aria-selected=\"true\"] {\n border-bottom: 4px solid var(--pure-0);\n color: var(--pure-0);\n }\n }\n "])), TabButton);
}, function (_ref) {
var density = _ref.density;
return density && densityVariant(density);
});
exports.TabList = TabList;
var StyledTabPanel = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n &:focus-visible {\n outline-color: var(--gold-vivid-40);\n outline-offset: var(--spacing-scale-base);\n outline-style: dashed;\n outline-width: var(--surface-width-lg);\n }\n"])));
exports.StyledTabPanel = StyledTabPanel;