@react-page-plugins/slate-table
Version:
react-page plugin for slate table
39 lines • 4.91 kB
JavaScript
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import React from 'react';
import styled from 'styled-components';
import cx from 'clsx';
var defaultStyle = {
buttonGroup: "\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n font-size: 0em;\n vertical-align: baseline;\n margin: 0em 0.25em 0em 0em;\n -webkit-box-shadow: none;\n box-shadow: none;\n border: 1px solid rgba(34, 36, 38, 0.15);\n border-radius: 0.28571429rem;\n\n &:after {\n content: \".\";\n display: block;\n height: 0;\n clear: both;\n visibility: hidden;\n }\n \n & .button {\n -webkit-box-flex: 1;\n -ms-flex: 1 0 auto;\n flex: 1 0 auto;\n margin: 0em;\n border-radius: 0em;\n margin: 0px 0px 0px 0px;\n }\n\n & .button:first-child {\n border-left: none;\n margin-left: 0;\n border-top-left-radius: .28571429rem;\n border-bottom-left-radius: .28571429rem;\n }\n ",
button: "\n cursor: pointer;\n display: inline-block;\n min-height: 1em;\n outline: none;\n border: none;\n vertical-align: baseline;\n background: #E0E1E2 none;\n color: rgba(0, 0, 0, 0.6);\n margin: 0em 0.25em 0em 0em;\n padding: 0.78571429em;\n text-transform: none;\n text-shadow: none;\n font-weight: bold;\n line-height: 1em;\n font-style: normal;\n text-align: center;\n text-decoration: none;\n border-radius: 0.28571429rem;\n -webkit-box-shadow: 0px 0px 0px 1px transparent inset, 0px 0em 0px 0px rgba(34, 36, 38, 0.15) inset;\n box-shadow: 0px 0px 0px 1px transparent inset, 0px 0em 0px 0px rgba(34, 36, 38, 0.15) inset;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-transition: opacity 0.1s ease, background-color 0.1s ease, color 0.1s ease, background 0.1s ease, -webkit-box-shadow 0.1s ease;\n transition: opacity 0.1s ease, background-color 0.1s ease, color 0.1s ease, background 0.1s ease, -webkit-box-shadow 0.1s ease;\n transition: opacity 0.1s ease, background-color 0.1s ease, color 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;\n transition: opacity 0.1s ease, background-color 0.1s ease, color 0.1s ease, box-shadow 0.1s ease, background 0.1s ease, -webkit-box-shadow 0.1s ease;\n will-change: '';\n -webkit-tap-highlight-color: transparent;\n\n &:hover {\n background-color: #CACBCD;\n background-image: none;\n -webkit-box-shadow: 0px 0px 0px 1px transparent inset, 0px 0em 0px 0px rgba(34, 36, 38, 0.15) inset;\n box-shadow: 0px 0px 0px 1px transparent inset, 0px 0em 0px 0px rgba(34, 36, 38, 0.15) inset;\n color: rgba(0, 0, 0, 0.8);\n }\n &.active {\n background-color: #C0C1C2;\n background-image: none;\n -webkit-box-shadow: 0px 0px 0px 1px transparent inset;\n box-shadow: 0px 0px 0px 1px transparent inset;\n color: rgba(0, 0, 0, 0.95);\n }\n \n &.active:hover {\n background-color: #C0C1C2;\n background-image: none;\n color: rgba(0, 0, 0, 0.95);\n }\n \n &.active:active {\n background-color: #C0C1C2;\n background-image: none;\n }\n ",
};
export var createTheme = function (style) {
if (style === void 0) { style = defaultStyle; }
var Sbutton = styled.button.attrs({ className: 'button' })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n "], ["\n ",
"\n "])), function (props) {
return style.button;
});
var Button = function (props) { return React.createElement(Sbutton, __assign({}, props, { className: cx('button', props.active === true ? 'active' : '') })); };
Button.Group = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n "], ["\n ",
"\n "])), function (props) {
return style.buttonGroup;
});
return { Button: Button };
};
var Button = createTheme().Button;
export var ThemeContext = React.createContext({ Button: Button });
var templateObject_1, templateObject_2;
//# sourceMappingURL=theme.js.map