@pie-lib/math-toolbar 1.11.31-next.135 → 1.12.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+
4
+ import MathPreview from '../math-preview';
5
+
6
+ describe('snapshot', () => {
7
+ let wrapper;
8
+
9
+ beforeAll(() => {
10
+ wrapper = (extras) => {
11
+ const defaults = {
12
+ node: {
13
+ data: {
14
+ get: jest.fn().mockReturnValue('sqrt(5)'),
15
+ },
16
+ },
17
+ classes: {},
18
+ isSelected: false,
19
+ onFocus: jest.fn(),
20
+ onBlur: jest.fn(),
21
+ };
22
+ const props = { ...defaults, ...extras };
23
+
24
+ return shallow(<MathPreview {...props} />);
25
+ };
26
+ });
27
+
28
+ it('renders', () => {
29
+ expect(wrapper()).toMatchSnapshot();
30
+ });
31
+ });
@@ -1,17 +1,20 @@
1
- import { HorizontalKeypad, mq } from '@pie-lib/math-input';
2
1
  import React from 'react';
3
2
  import debug from 'debug';
4
3
  import PropTypes from 'prop-types';
5
4
  import cx from 'classnames';
6
5
  import Button from '@material-ui/core/Button';
7
6
  import { withStyles } from '@material-ui/core/styles';
8
- const log = debug('@pie-lib:math-toolbar:editor-and-pad');
9
- import { color, InputContainer } from '@pie-lib/render-ui';
10
7
  import MenuItem from '@material-ui/core/MenuItem';
11
8
  import Select from '@material-ui/core/Select';
12
- import { updateSpans } from '@pie-lib/math-input';
13
9
  import isEqual from 'lodash/isEqual';
14
10
 
11
+ import { HorizontalKeypad, mq, updateSpans } from '@pie-lib/math-input';
12
+ import { color, InputContainer } from '@pie-lib/render-ui';
13
+ import { markFractionBaseSuperscripts } from './utils';
14
+
15
+ const { commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles } = mq.CommonMqStyles;
16
+ const log = debug('@pie-lib:math-toolbar:editor-and-pad');
17
+
15
18
  const decimalRegex = /\.|,/g;
16
19
 
17
20
  const toNodeData = (data) => {
@@ -54,6 +57,7 @@ export class EditorAndPad extends React.Component {
54
57
  onBlur: PropTypes.func,
55
58
  onChange: PropTypes.func.isRequired,
56
59
  classes: PropTypes.object,
60
+ setKeypadInteraction: PropTypes.func,
57
61
  };
58
62
 
59
63
  constructor(props) {
@@ -124,6 +128,7 @@ export class EditorAndPad extends React.Component {
124
128
  const { onChange, noDecimal } = this.props;
125
129
 
126
130
  updateSpans();
131
+ markFractionBaseSuperscripts();
127
132
 
128
133
  this.updateDisable(true);
129
134
 
@@ -206,6 +211,7 @@ export class EditorAndPad extends React.Component {
206
211
  controlledKeypad,
207
212
  controlledKeypadMode,
208
213
  showKeypad,
214
+ setKeypadInteraction,
209
215
  noDecimal,
210
216
  hideInput,
211
217
  layoutForKeyPad,
@@ -273,11 +279,13 @@ export class EditorAndPad extends React.Component {
273
279
  {shouldShowKeypad && (
274
280
  <HorizontalKeypad
275
281
  className={cx(classes[keypadMode], classes.keyboard)}
282
+ controlledKeypadMode={controlledKeypadMode}
276
283
  layoutForKeyPad={layoutForKeyPad}
277
284
  additionalKeys={additionalKeys}
278
285
  mode={controlledKeypadMode ? this.state.equationEditor : keypadMode}
279
286
  onClick={this.onClick}
280
287
  noDecimal={noDecimal}
288
+ setKeypadInteraction={setKeypadInteraction}
281
289
  />
282
290
  )}
283
291
  </div>
@@ -311,7 +319,7 @@ const styles = (theme) => ({
311
319
  left: '-1px',
312
320
  },
313
321
  '&:after': {
314
- position: 'absolute',
322
+ position: 'absolute !important',
315
323
  top: '0px !important',
316
324
  right: '-2px',
317
325
  },
@@ -325,22 +333,11 @@ const styles = (theme) => ({
325
333
  right: '-1px',
326
334
  },
327
335
  },
328
- '& *': {
329
- fontFamily: 'MJXZERO, MJXTEX !important',
330
-
331
- '& .mq-math-mode > span > var': {
332
- fontFamily: 'MJXZERO, MJXTEX-I !important',
333
- },
334
- '& .mq-math-mode span var': {
335
- fontFamily: 'MJXZERO, MJXTEX-I !important',
336
- },
337
- '& .mq-math-mode .mq-nonSymbola': {
338
- fontFamily: 'MJXZERO, MJXTEX-I !important',
339
- },
340
- '& .mq-math-mode > span > var.mq-operator-name': {
341
- fontFamily: 'MJXZERO, MJXTEX !important',
342
- },
343
336
 
337
+ '& *': {
338
+ ...commonMqFontStyles,
339
+ ...supsubStyles,
340
+ ...longdivStyles,
344
341
  '& .mq-math-mode .mq-sqrt-prefix': {
345
342
  verticalAlign: 'baseline !important',
346
343
  top: '1px !important',
@@ -351,12 +348,6 @@ const styles = (theme) => ({
351
348
  paddingTop: '0.45em !important',
352
349
  },
353
350
 
354
- '& .mq-math-mode sup.mq-nthroot': {
355
- fontSize: '70% !important',
356
- verticalAlign: '0.5em !important',
357
- paddingRight: '0.15em',
358
- },
359
-
360
351
  '& .mq-math-mode .mq-empty': {
361
352
  padding: '9px 1px !important',
362
353
  },
@@ -369,31 +360,12 @@ const styles = (theme) => ({
369
360
  top: '0 !important',
370
361
  },
371
362
 
372
- '& .mq-longdiv-inner': {
373
- marginTop: '-1px',
374
- marginLeft: '5px !important;',
375
-
376
- '& > .mq-empty': {
377
- padding: '0 !important',
378
- marginLeft: '0px !important',
379
- marginTop: '2px',
380
- },
381
- },
382
-
383
- '& .mq-math-mode .mq-longdiv': {
384
- display: 'inline-flex !important',
385
- },
386
-
387
363
  '& .mq-math-mode .mq-longdiv .mq-longdiv-inner': {
388
364
  marginLeft: '4px !important',
389
365
  paddingTop: '6px !important',
390
366
  paddingLeft: '6px !important',
391
367
  },
392
368
 
393
- '& .mq-math-mode .mq-supsub': {
394
- fontSize: '70.7% !important',
395
- },
396
-
397
369
  '& .mq-math-mode .mq-paren': {
398
370
  verticalAlign: 'top !important',
399
371
  padding: '1px 0.1em !important',
@@ -406,18 +378,6 @@ const styles = (theme) => ({
406
378
  paddingTop: '5px !important',
407
379
  },
408
380
 
409
- '& .mq-supsub ': {
410
- fontSize: '70.7%',
411
- },
412
-
413
- '& .mq-math-mode .mq-supsub.mq-sup-only': {
414
- verticalAlign: '-0.1em !important',
415
-
416
- '& .mq-sup': {
417
- marginBottom: '0px !important',
418
- },
419
- },
420
-
421
381
  '& .mq-math-mode .mq-denominator': {
422
382
  marginTop: '-5px !important',
423
383
  padding: '0.5em 0.1em 0.1em !important',
@@ -428,8 +388,10 @@ const styles = (theme) => ({
428
388
  paddingBottom: '0 !important',
429
389
  marginBottom: '-2px',
430
390
  },
391
+ },
431
392
 
432
- '-webkit-font-smoothing': 'antialiased !important',
393
+ '& span[data-prime="true"]': {
394
+ fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',
433
395
  },
434
396
  },
435
397
  hide: {
@@ -526,68 +488,7 @@ const styles = (theme) => ({
526
488
  error: {
527
489
  border: '2px solid red',
528
490
  },
529
- keyboard: {
530
- '& *': {
531
- fontFamily: 'MJXZERO, MJXTEX !important',
532
-
533
- '& .mq-math-mode > span > var': {
534
- fontFamily: 'MJXZERO, MJXTEX-I !important',
535
- },
536
- '& .mq-math-mode span var': {
537
- fontFamily: 'MJXZERO, MJXTEX-I !important',
538
- },
539
- '& .mq-math-mode .mq-nonSymbola': {
540
- fontFamily: 'MJXZERO, MJXTEX-I !important',
541
- },
542
- '& .mq-math-mode > span > var.mq-operator-name': {
543
- fontFamily: 'MJXZERO, MJXTEX !important',
544
- },
545
-
546
- '& .mq-math-mode .mq-sqrt-prefix': {
547
- top: '0 !important',
548
- },
549
-
550
- '& .mq-math-mode .mq-empty': {
551
- padding: '9px 1px !important',
552
- },
553
-
554
- '& .mq-longdiv-inner': {
555
- marginTop: '-1px',
556
- marginLeft: '5px !important;',
557
-
558
- '& > .mq-empty': {
559
- padding: '0 !important',
560
- marginLeft: '0px !important',
561
- marginTop: '2px',
562
- },
563
- },
564
-
565
- '& .mq-math-mode .mq-longdiv': {
566
- display: 'inline-flex !important',
567
- },
568
-
569
- '& .mq-math-mode .mq-supsub': {
570
- fontSize: '70.7% !important',
571
- },
572
-
573
- '& .mq-math-mode .mq-sqrt-stem': {
574
- marginTop: '-5px',
575
- paddingTop: '4px',
576
- },
577
-
578
- '& .mq-math-mode .mq-paren': {
579
- verticalAlign: 'middle !important',
580
- },
581
-
582
- '& .mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-empty': {
583
- padding: '0 !important',
584
- },
585
-
586
- '& .mq-math-mode .mq-overline .mq-overline-inner .mq-empty ': {
587
- padding: '0 !important',
588
- },
589
- },
590
- },
491
+ keyboard: commonMqKeyboardStyles,
591
492
  language: {
592
493
  '& *': {
593
494
  fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',
package/src/index.jsx CHANGED
@@ -28,6 +28,8 @@ export class MathToolbar extends React.Component {
28
28
  onFocus: PropTypes.func,
29
29
  onBlur: PropTypes.func,
30
30
  hideDoneButton: PropTypes.bool,
31
+ keyPadCharacterRef: PropTypes.func,
32
+ setKeypadInteraction: PropTypes.func,
31
33
  };
32
34
 
33
35
  static defaultProps = {
@@ -83,6 +85,8 @@ export class MathToolbar extends React.Component {
83
85
  onBlur,
84
86
  hideDoneButton,
85
87
  error,
88
+ keyPadCharacterRef,
89
+ setKeypadInteraction,
86
90
  maxResponseAreas,
87
91
  } = this.props;
88
92
 
@@ -96,6 +100,8 @@ export class MathToolbar extends React.Component {
96
100
  additionalKeys={additionalKeys}
97
101
  noDecimal={noDecimal}
98
102
  keypadMode={keypadMode}
103
+ keyPadCharacterRef={keyPadCharacterRef}
104
+ setKeypadInteraction={setKeypadInteraction}
99
105
  onChange={this.onChange}
100
106
  onDone={this.done}
101
107
  onFocus={onFocus}
@@ -136,6 +142,8 @@ export class RawPureToolbar extends React.Component {
136
142
  hideDoneButtonBackground: PropTypes.bool,
137
143
  error: PropTypes.any,
138
144
  maxResponseAreas: PropTypes.number,
145
+ keyPadCharacterRef: PropTypes.object,
146
+ setKeypadInteraction: PropTypes.func,
139
147
  };
140
148
 
141
149
  static defaultProps = {
@@ -158,6 +166,8 @@ export class RawPureToolbar extends React.Component {
158
166
  hideInput,
159
167
  noLatexHandling,
160
168
  layoutForKeyPad,
169
+ keyPadCharacterRef,
170
+ setKeypadInteraction,
161
171
  latex,
162
172
  onChange,
163
173
  onDone,
@@ -171,7 +181,7 @@ export class RawPureToolbar extends React.Component {
171
181
  } = this.props;
172
182
 
173
183
  return (
174
- <div className={cx(classes.pureToolbar, (classNames || {}).toolbar)}>
184
+ <div className={cx(classes.pureToolbar, (classNames || {}).toolbar)} ref={keyPadCharacterRef}>
175
185
  <div />
176
186
  <EditorAndPad
177
187
  autoFocus={autoFocus}
@@ -193,6 +203,7 @@ export class RawPureToolbar extends React.Component {
193
203
  onBlur={onBlur}
194
204
  error={error}
195
205
  maxResponseAreas={maxResponseAreas}
206
+ setKeypadInteraction={setKeypadInteraction}
196
207
  />
197
208
  {(!controlledKeypad || (controlledKeypad && showKeypad)) && !hideDoneButton && (
198
209
  <DoneButton hideBackground={hideDoneButtonBackground} onClick={onDone} />
@@ -4,6 +4,9 @@ import debug from 'debug';
4
4
  import { withStyles } from '@material-ui/core/styles';
5
5
  import PropTypes from 'prop-types';
6
6
  import { mq } from '@pie-lib/math-input';
7
+ import { markFractionBaseSuperscripts } from './utils';
8
+
9
+ const { commonMqFontStyles, longdivStyles, supsubStyles } = mq.CommonMqStyles;
7
10
 
8
11
  const log = debug('@pie-lib:math-toolbar:math-preview');
9
12
 
@@ -17,6 +20,17 @@ export class RawMathPreview extends React.Component {
17
20
  onBlur: PropTypes.func,
18
21
  };
19
22
 
23
+ componentDidMount() {
24
+ markFractionBaseSuperscripts();
25
+ }
26
+
27
+ componentDidUpdate(prevProps) {
28
+ // Re-run only if LaTeX changed
29
+ if (this.props.node.data.get('latex') !== prevProps.node.data.get('latex')) {
30
+ markFractionBaseSuperscripts();
31
+ }
32
+ }
33
+
20
34
  render() {
21
35
  log('[render] data: ', this.props.node.data);
22
36
  const latex = this.props.node.data.get('latex');
@@ -36,22 +50,9 @@ const mp = (theme) => ({
36
50
  display: 'inline-flex',
37
51
  alignItems: 'center',
38
52
  position: 'relative',
39
- '& *': {
40
- fontFamily: 'MJXZERO, MJXTEX !important',
41
- '-webkit-font-smoothing': 'antialiased !important',
42
- },
43
- '& > .mq-math-mode > span > var': {
44
- fontFamily: 'MJXZERO, MJXTEX-I !important',
45
- },
46
- '& > .mq-math-mode span var': {
47
- fontFamily: 'MJXZERO, MJXTEX-I !important',
48
- },
49
- '& > .mq-math-mode .mq-nonSymbola': {
50
- fontFamily: 'MJXZERO, MJXTEX-I !important',
51
- },
52
- '& > .mq-math-mode > span > var.mq-operator-name': {
53
- fontFamily: 'MJXZERO, MJXTEX !important',
54
- },
53
+ '& *': commonMqFontStyles,
54
+ ...supsubStyles,
55
+ ...longdivStyles,
55
56
  '& > .mq-math-mode': {
56
57
  border: 'solid 1px lightgrey',
57
58
  },
@@ -81,24 +82,6 @@ const mp = (theme) => ({
81
82
  paddingBottom: '0 !important',
82
83
  marginBottom: '-2px',
83
84
  },
84
- '& > .mq-math-mode sup.mq-nthroot': {
85
- fontSize: '70.7% !important',
86
- verticalAlign: '0.5em !important',
87
- paddingRight: '0.15em',
88
- },
89
- '& > .mq-longdiv-inner': {
90
- marginTop: '-1px',
91
- marginLeft: '5px !important;',
92
-
93
- '& > .mq-empty': {
94
- padding: '0 !important',
95
- marginLeft: '0px !important',
96
- marginTop: '2px',
97
- },
98
- },
99
- '& > .mq-math-mode .mq-longdiv': {
100
- display: 'inline-flex !important',
101
- },
102
85
  '& > .mq-math-mode .mq-longdiv .mq-longdiv-inner .mq-empty': {
103
86
  paddingTop: '6px !important',
104
87
  paddingLeft: '4px !important',
@@ -106,9 +89,6 @@ const mp = (theme) => ({
106
89
  '& > .mq-math-mode .mq-longdiv .mq-longdiv-inner': {
107
90
  marginLeft: '0 !important',
108
91
  },
109
- '& > .mq-math-mode .mq-supsub': {
110
- fontSize: '70.7% !important',
111
- },
112
92
  '& > .mq-math-mode .mq-overarrow': {
113
93
  fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',
114
94
  },
@@ -123,17 +103,7 @@ const mp = (theme) => ({
123
103
  marginTop: '-2px !important',
124
104
  paddingTop: '5px !important',
125
105
  },
126
- '& > .mq-supsub ': {
127
- fontSize: '70.7%',
128
- },
129
106
 
130
- '& > .mq-math-mode .mq-supsub.mq-sup-only': {
131
- verticalAlign: '-0.1em !important',
132
-
133
- '& .mq-sup': {
134
- marginBottom: '0px !important',
135
- },
136
- },
137
107
  '& .mq-overarrow-inner': {
138
108
  paddingTop: '0 !important',
139
109
  border: 'none !important',
@@ -152,9 +122,16 @@ const mp = (theme) => ({
152
122
  top: '-0.4em',
153
123
  left: '-1px',
154
124
  },
125
+ // NOTE: This workaround adds `!important` to enforce the correct positioning and styling
126
+ // of `.mq-overarrow.mq-arrow-both` elements in MathQuill. This ensures consistent display
127
+ // regardless of the order in which MathQuill is initialized on our websites.
128
+ //
129
+ // In the future, investigate why MathQuill scripts and styles are being initialized
130
+ // more than once and address the root cause to prevent potential conflicts and ensure
131
+ // optimal performance.
155
132
  '&:after': {
156
133
  top: '0px !important',
157
- position: 'absolute',
134
+ position: 'absolute !important',
158
135
  right: '-2px',
159
136
  },
160
137
  '&.mq-empty:after': {
@@ -180,6 +157,9 @@ const mp = (theme) => ({
180
157
  '& .mq-parallelogram': {
181
158
  lineHeight: 0.85,
182
159
  },
160
+ '& span[data-prime="true"]': {
161
+ fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',
162
+ },
183
163
  },
184
164
  selected: {
185
165
  border: `solid 1px ${theme.palette.primary.main}`,
package/src/utils.js ADDED
@@ -0,0 +1,11 @@
1
+ export const markFractionBaseSuperscripts = () => {
2
+ document.querySelectorAll('.mq-supsub.mq-sup-only').forEach((supsub) => {
3
+ const prev = supsub.previousElementSibling;
4
+
5
+ if (prev && prev.classList.contains('mq-non-leaf') && prev.querySelector('.mq-fraction')) {
6
+ supsub.classList.add('mq-after-fraction-group');
7
+ } else {
8
+ supsub.classList.remove('mq-after-fraction-group');
9
+ }
10
+ });
11
+ };
@@ -1,68 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.RawDoneButton = exports.DoneButton = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _react = _interopRequireDefault(require("react"));
13
-
14
- var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
15
-
16
- var _Check = _interopRequireDefault(require("@material-ui/icons/Check"));
17
-
18
- var _styles = require("@material-ui/core/styles");
19
-
20
- var _propTypes = _interopRequireDefault(require("prop-types"));
21
-
22
- var _classnames = _interopRequireDefault(require("classnames"));
23
-
24
- var RawDoneButton = function RawDoneButton(_ref) {
25
- var classes = _ref.classes,
26
- onClick = _ref.onClick,
27
- hideBackground = _ref.hideBackground;
28
- return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
29
- "aria-label": "Done",
30
- className: classes.iconRoot,
31
- onClick: onClick,
32
- classes: {
33
- label: classes.label,
34
- root: (0, _classnames["default"])(classes.iconRoot, (0, _defineProperty2["default"])({}, classes.hideBackground, hideBackground))
35
- }
36
- }, /*#__PURE__*/_react["default"].createElement(_Check["default"], null));
37
- };
38
-
39
- exports.RawDoneButton = RawDoneButton;
40
- RawDoneButton.propTypes = {
41
- classes: _propTypes["default"].object.isRequired,
42
- onClick: _propTypes["default"].func
43
- };
44
-
45
- var styles = function styles(theme) {
46
- return {
47
- iconRoot: {
48
- verticalAlign: 'top',
49
- width: '28px',
50
- height: '28px',
51
- color: '#00bb00'
52
- },
53
- hideBackground: {
54
- backgroundColor: theme.palette.common.white,
55
- '&:hover': {
56
- backgroundColor: theme.palette.grey[200]
57
- }
58
- },
59
- label: {
60
- position: 'absolute',
61
- top: '2px'
62
- }
63
- };
64
- };
65
-
66
- var DoneButton = (0, _styles.withStyles)(styles)(RawDoneButton);
67
- exports.DoneButton = DoneButton;
68
- //# sourceMappingURL=done-button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/done-button.jsx"],"names":["RawDoneButton","classes","onClick","hideBackground","iconRoot","label","root","propTypes","PropTypes","object","isRequired","func","styles","theme","verticalAlign","width","height","color","backgroundColor","palette","common","white","grey","position","top","DoneButton"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB;AAAA,MAAGC,OAAH,QAAGA,OAAH;AAAA,MAAYC,OAAZ,QAAYA,OAAZ;AAAA,MAAqBC,cAArB,QAAqBA,cAArB;AAAA,sBAC3B,gCAAC,sBAAD;AACE,kBAAW,MADb;AAEE,IAAA,SAAS,EAAEF,OAAO,CAACG,QAFrB;AAGE,IAAA,OAAO,EAAEF,OAHX;AAIE,IAAA,OAAO,EAAE;AACPG,MAAAA,KAAK,EAAEJ,OAAO,CAACI,KADR;AAEPC,MAAAA,IAAI,EAAE,4BAAWL,OAAO,CAACG,QAAnB,uCAAgCH,OAAO,CAACE,cAAxC,EAAyDA,cAAzD;AAFC;AAJX,kBASE,gCAAC,iBAAD,OATF,CAD2B;AAAA,CAAtB;;;AAcPH,aAAa,CAACO,SAAd,GAA0B;AACxBN,EAAAA,OAAO,EAAEO,sBAAUC,MAAV,CAAiBC,UADF;AAExBR,EAAAA,OAAO,EAAEM,sBAAUG;AAFK,CAA1B;;AAKA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBT,IAAAA,QAAQ,EAAE;AACRU,MAAAA,aAAa,EAAE,KADP;AAERC,MAAAA,KAAK,EAAE,MAFC;AAGRC,MAAAA,MAAM,EAAE,MAHA;AAIRC,MAAAA,KAAK,EAAE;AAJC,KADe;AAOzBd,IAAAA,cAAc,EAAE;AACde,MAAAA,eAAe,EAAEL,KAAK,CAACM,OAAN,CAAcC,MAAd,CAAqBC,KADxB;AAGd,iBAAW;AACTH,QAAAA,eAAe,EAAEL,KAAK,CAACM,OAAN,CAAcG,IAAd,CAAmB,GAAnB;AADR;AAHG,KAPS;AAczBjB,IAAAA,KAAK,EAAE;AACLkB,MAAAA,QAAQ,EAAE,UADL;AAELC,MAAAA,GAAG,EAAE;AAFA;AAdkB,GAAZ;AAAA,CAAf;;AAmBO,IAAMC,UAAU,GAAG,wBAAWb,MAAX,EAAmBZ,aAAnB,CAAnB","sourcesContent":["import React from 'react';\n\nimport IconButton from '@material-ui/core/IconButton';\nimport Check from '@material-ui/icons/Check';\nimport { withStyles } from '@material-ui/core/styles';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nexport const RawDoneButton = ({ classes, onClick, hideBackground }) => (\n <IconButton\n aria-label=\"Done\"\n className={classes.iconRoot}\n onClick={onClick}\n classes={{\n label: classes.label,\n root: classNames(classes.iconRoot, { [classes.hideBackground]: hideBackground }),\n }}\n >\n <Check />\n </IconButton>\n);\n\nRawDoneButton.propTypes = {\n classes: PropTypes.object.isRequired,\n onClick: PropTypes.func,\n};\n\nconst styles = (theme) => ({\n iconRoot: {\n verticalAlign: 'top',\n width: '28px',\n height: '28px',\n color: '#00bb00',\n },\n hideBackground: {\n backgroundColor: theme.palette.common.white,\n\n '&:hover': {\n backgroundColor: theme.palette.grey[200],\n },\n },\n label: {\n position: 'absolute',\n top: '2px',\n },\n});\nexport const DoneButton = withStyles(styles)(RawDoneButton);\n"],"file":"done-button.js"}