@vimeo/iris
Version:
Vimeo Design System
35 lines (28 loc) • 4.66 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var tslib_es6 = require('../../../tslib.es6-3ec409b7.js');
var styled = require('styled-components');
var polished = require('polished');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
var InputWrapper = styled__default["default"].div(templateObject_1 || (templateObject_1 = tslib_es6.__makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
var Dot = styled__default["default"].div(templateObject_2 || (templateObject_2 = tslib_es6.__makeTemplateObject(["\n border-radius: 50%;\n width: 1rem;\n height: 1rem;\n margin: 0 1rem;\n display: inline-flex;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n left: -0.375rem;\n z-index: 10;\n border: 0.5px solid ", ";\n"], ["\n border-radius: 50%;\n width: 1rem;\n height: 1rem;\n margin: 0 1rem;\n display: inline-flex;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n left: -0.375rem;\n z-index: 10;\n border: 0.5px solid ", ";\n"])), function (_a) {
var theme = _a.theme;
return polished.rgba(theme.content.color, 0.1);
});
var Wrapper = styled__default["default"].div(templateObject_3 || (templateObject_3 = tslib_es6.__makeTemplateObject(["\n padding: 0;\n position: relative;\n width: ", "px;\n border-radius: 0.25rem;\n overflow: hidden;\n"], ["\n padding: 0;\n position: relative;\n width: ", "px;\n border-radius: 0.25rem;\n overflow: hidden;\n"])), function (p) { return p.width; });
var SpectrumWrapper = styled__default["default"].div(templateObject_6 || (templateObject_6 = tslib_es6.__makeTemplateObject(["\n position: relative;\n width: calc(100% + 8rem);\n\n ", ";\n"], ["\n position: relative;\n width: calc(100% + 8rem);\n\n ", ";\n"])), function (p) {
return p.dragging
? styled.css(templateObject_4 || (templateObject_4 = tslib_es6.__makeTemplateObject(["\n padding: 4rem 8rem;\n top: -4rem;\n left: -8rem;\n "], ["\n padding: 4rem 8rem;\n top: -4rem;\n left: -8rem;\n "]))) : styled.css(templateObject_5 || (templateObject_5 = tslib_es6.__makeTemplateObject(["\n padding: 0 0;\n top: 0;\n left: 0;\n "], ["\n padding: 0 0;\n top: 0;\n left: 0;\n "])));
});
var Cursor = styled__default["default"].div(templateObject_7 || (templateObject_7 = tslib_es6.__makeTemplateObject(["\n width: 1.25rem;\n height: 1.25rem;\n pointer-events: none;\n border: 0.125rem solid white;\n border-radius: 50%;\n position: absolute;\n left: -0.625rem;\n top: -0.625rem;\n z-index: 4001;\n"], ["\n width: 1.25rem;\n height: 1.25rem;\n pointer-events: none;\n border: 0.125rem solid white;\n border-radius: 50%;\n position: absolute;\n left: -0.625rem;\n top: -0.625rem;\n z-index: 4001;\n"])));
var lightRay = function (color, dir, el) { return styled.css(templateObject_8 || (templateObject_8 = tslib_es6.__makeTemplateObject(["\n ", " {\n content: '';\n width: 100%;\n height: 100%;\n position: absolute;\n border-radius: 0.25rem 0.25rem 0 0;\n background: linear-gradient(to ", ", ", ", transparent);\n }\n"], ["\n ", " {\n content: '';\n width: 100%;\n height: 100%;\n position: absolute;\n border-radius: 0.25rem 0.25rem 0 0;\n background: linear-gradient(to ", ", ", ", transparent);\n }\n"])), el, dir, color); };
var HueSpectrum = styled__default["default"].div(templateObject_9 || (templateObject_9 = tslib_es6.__makeTemplateObject(["\n width: ", ";\n height: ", ";\n position: relative;\n border-radius: 0.25rem 0.25rem 0 0;\n cursor: pointer;\n\n ", ";\n ", ";\n\n &:active {\n cursor: none;\n }\n"], ["\n width: ", ";\n height: ", ";\n position: relative;\n border-radius: 0.25rem 0.25rem 0 0;\n cursor: pointer;\n\n ", ";\n ", ";\n\n &:active {\n cursor: none;\n }\n"])), function (props) { return polished.rem(props.width); }, function (props) { return polished.rem(props.height + 1); }, lightRay('#FFF', 'right', '&::before'), lightRay('#000', 'top', '&::after'));
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
exports.Cursor = Cursor;
exports.Dot = Dot;
exports.HueSpectrum = HueSpectrum;
exports.InputWrapper = InputWrapper;
exports.SpectrumWrapper = SpectrumWrapper;
exports.Wrapper = Wrapper;
exports.lightRay = lightRay;