UNPKG

@instructure/quiz-interactions

Version:

A React UI component Library for quiz interaction types.

39 lines 2.16 kB
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } var generateStyle = function generateStyle(componentTheme, props) { return { blankScreenReaderContentWrapper: { display: 'inline-block' }, '[contenteditable=true]:empty::before': { content: 'attr(placeholder)', color: componentTheme.tableColor, cursor: 'text' }, editableText: _objectSpread({ color: componentTheme.editStemColor, display: 'inline-block', fontFamily: componentTheme.editStemFontFamily, fontSize: componentTheme.editStemFontSize, fontWeight: componentTheme.editStemFontWeight, lineHeight: componentTheme.editStemLineHeight, whiteSpace: 'pre-wrap', '&:focus': { outline: '0 none' } }, props.stemItems.length <= 1 && { width: '100%' }), highlight: { border: "".concat(componentTheme.highlightBorder, " solid ").concat(componentTheme.highlightColor), borderRadius: componentTheme.highlightBorderRadius, padding: componentTheme.highlightPadding, position: 'relative', marginLeft: componentTheme.highlightMargin, marginRight: componentTheme.highlightMargin, wordWrap: 'break-word' } }; }; export default generateStyle;