@khanacademy/math-input 17.4.0 → 17.5.0

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.
package/dist/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-core';
2
- import Color from '@khanacademy/wonder-blocks-color';
3
2
  import * as i18n from '@khanacademy/wonder-blocks-i18n';
4
3
  import { getDecimalSeparator, getLocale } from '@khanacademy/wonder-blocks-i18n';
4
+ import { color } from '@khanacademy/wonder-blocks-tokens';
5
5
  import { entries } from '@khanacademy/wonder-stuff-core';
6
6
  import { StyleSheet, css } from 'aphrodite';
7
7
  import * as React from 'react';
@@ -17,21 +17,19 @@ import PropTypes from 'prop-types';
17
17
 
18
18
  // This file is processed by a Rollup plugin (replace) to inject the production
19
19
  const libName = "@khanacademy/math-input";
20
- const libVersion = "17.4.0";
20
+ const libVersion = "17.5.0";
21
21
  addLibraryVersionToPerseusDebug(libName, libVersion);
22
22
 
23
23
  function _extends() {
24
24
  _extends = Object.assign ? Object.assign.bind() : function (target) {
25
25
  for (var i = 1; i < arguments.length; i++) {
26
26
  var source = arguments[i];
27
-
28
27
  for (var key in source) {
29
28
  if (Object.prototype.hasOwnProperty.call(source, key)) {
30
29
  target[key] = source[key];
31
30
  }
32
31
  }
33
32
  }
34
-
35
33
  return target;
36
34
  };
37
35
  return _extends.apply(this, arguments);
@@ -2205,7 +2203,7 @@ class MathInput extends React.Component {
2205
2203
  const innerStyle = _extends({}, inlineStyles.innerContainer, {
2206
2204
  borderWidth: this.getBorderWidthPx()
2207
2205
  }, showInputFocusStyle ? {
2208
- borderColor: Color.blue
2206
+ borderColor: color.blue
2209
2207
  } : {}, style);
2210
2208
 
2211
2209
  // NOTE(diedra): This label explicitly refers to tapping because this field
@@ -2300,9 +2298,9 @@ const inlineStyles = {
2300
2298
  boxSizing: "border-box",
2301
2299
  position: "relative",
2302
2300
  borderStyle: "solid",
2303
- borderColor: Color.offBlack50,
2301
+ borderColor: color.offBlack50,
2304
2302
  borderRadius: 4,
2305
- color: Color.offBlack
2303
+ color: color.offBlack
2306
2304
  }
2307
2305
  };
2308
2306
 
@@ -2427,7 +2425,7 @@ const styles$6 = StyleSheet.create({
2427
2425
  marginLeft: 1
2428
2426
  },
2429
2427
  hovered: {
2430
- background: `linear-gradient(0deg, rgba(24, 101, 242, 0.32), rgba(24, 101, 242, 0.32)), ${Color.white}`,
2428
+ background: `linear-gradient(0deg, rgba(24, 101, 242, 0.32), rgba(24, 101, 242, 0.32)), ${color.white}`,
2431
2429
  border: "1px solid #1865F2"
2432
2430
  },
2433
2431
  pressed: {
@@ -2435,7 +2433,7 @@ const styles$6 = StyleSheet.create({
2435
2433
  },
2436
2434
  focused: {
2437
2435
  outline: "none",
2438
- border: `2px solid ${Color.blue}`
2436
+ border: `2px solid ${color.blue}`
2439
2437
  },
2440
2438
  innerBox: {
2441
2439
  boxSizing: "border-box",
@@ -2447,7 +2445,7 @@ const styles$6 = StyleSheet.create({
2447
2445
  alignItems: "center"
2448
2446
  },
2449
2447
  innerBoxPressed: {
2450
- border: `1px solid ${Color.white}`
2448
+ border: `1px solid ${color.white}`
2451
2449
  },
2452
2450
  activeIndicator: {
2453
2451
  position: "absolute",
@@ -2465,15 +2463,15 @@ const styles$6 = StyleSheet.create({
2465
2463
  });
2466
2464
  function imageTintColor(itemState, hovered, focused, pressed) {
2467
2465
  if (itemState === "disabled") {
2468
- return Color.offBlack64;
2466
+ return color.offBlack64;
2469
2467
  } else if (pressed) {
2470
- return Color.white;
2468
+ return color.white;
2471
2469
  } else if (itemState === "active") {
2472
- return Color.blue;
2470
+ return color.blue;
2473
2471
  } else if (hovered) {
2474
- return Color.blue;
2472
+ return color.blue;
2475
2473
  }
2476
- return Color.offBlack64;
2474
+ return color.offBlack64;
2477
2475
  }
2478
2476
  class TabbarItem extends React.Component {
2479
2477
  render() {
@@ -3199,7 +3197,7 @@ function ButtonAsset({
3199
3197
  viewBox: "0 0 32 32",
3200
3198
  fill: "none",
3201
3199
  xmlns: "http://www.w3.org/2000/svg",
3202
- "data-test-id": "comma-decimal"
3200
+ "data-testid": "comma-decimal"
3203
3201
  }, /*#__PURE__*/React.createElement("path", {
3204
3202
  d: "M11.5559 25.3544C11.8679 24.661 12.1799 23.933 12.4919 23.1704C12.8039 22.425 13.0986 21.6884 13.3759 20.9604C13.6706 20.2324 13.9219 19.5737 14.1299 18.9844H16.6259L16.7299 19.2704C16.4526 19.877 16.1232 20.5357 15.7419 21.2464C15.3606 21.9397 14.9619 22.633 14.5459 23.3264C14.1299 24.037 13.7139 24.713 13.2979 25.3544H11.5559Z",
3205
3203
  fill: "#21242C"
@@ -3212,7 +3210,7 @@ function ButtonAsset({
3212
3210
  viewBox: "0 0 40 40",
3213
3211
  fill: "none",
3214
3212
  xmlns: "http://www.w3.org/2000/svg",
3215
- "data-test-id": "period-decimal"
3213
+ "data-testid": "period-decimal"
3216
3214
  }, /*#__PURE__*/React.createElement("path", {
3217
3215
  d: "M18.3401 27.512c0-.232.04-.448.12-.648.088-.208.204-.388.348-.54.152-.152.328-.272.528-.36.208-.088.428-.132.66-.132.232 0 .448.044.648.132.208.088.388.208.54.36.152.152.272.332.36.54.088.2.132.416.132.648 0 .24-.044.46-.132.66-.088.2-.208.376-.36.528-.152.152-.332.268-.54.348-.2.088-.416.132-.648.132-.232 0-.452-.044-.66-.132-.2-.08-.376-.196-.528-.348-.144-.152-.26-.328-.348-.528-.08-.2-.12-.42-.12-.66z",
3218
3216
  fill: "#21242C"
@@ -4552,9 +4550,9 @@ const styles$4 = StyleSheet.create({
4552
4550
  display: "flex",
4553
4551
  justifyContent: "center",
4554
4552
  alignItems: "center",
4555
- boxShadow: `0px 1px 0px ${Color.offBlack32}`,
4553
+ boxShadow: `0px 1px 0px ${color.offBlack32}`,
4556
4554
  boxSizing: "border-box",
4557
- background: Color.white,
4555
+ background: color.white,
4558
4556
  borderRadius: 4,
4559
4557
  borderWidth: 2,
4560
4558
  borderStyle: "solid",
@@ -4565,19 +4563,19 @@ const styles$4 = StyleSheet.create({
4565
4563
  padding: 1
4566
4564
  },
4567
4565
  hovered: {
4568
- borderColor: Color.blue,
4566
+ borderColor: color.blue,
4569
4567
  padding: 1,
4570
4568
  boxShadow: "none"
4571
4569
  },
4572
4570
  focused: {
4573
- borderColor: Color.blue,
4571
+ borderColor: color.blue,
4574
4572
  padding: 0,
4575
4573
  boxShadow: "none"
4576
4574
  },
4577
4575
  pressed: {
4578
4576
  border: "2px solid #1B50B3",
4579
4577
  padding: 0,
4580
- background: `linear-gradient(0deg, rgba(24, 101, 242, 0.32), rgba(24, 101, 242, 0.32)), ${Color.white}`,
4578
+ background: `linear-gradient(0deg, rgba(24, 101, 242, 0.32), rgba(24, 101, 242, 0.32)), ${color.white}`,
4581
4579
  boxShadow: "none"
4582
4580
  },
4583
4581
  outerBoxBase: {
@@ -4932,13 +4930,13 @@ const styles$3 = StyleSheet.create({
4932
4930
  width: "100%"
4933
4931
  },
4934
4932
  base: {
4935
- boxShadow: `0px 1px 0px ${Color.offBlack32}`,
4933
+ boxShadow: `0px 1px 0px ${color.offBlack32}`,
4936
4934
  display: "flex",
4937
4935
  justifyContent: "center",
4938
4936
  alignItems: "center",
4939
- background: Color.white,
4937
+ background: color.white,
4940
4938
  borderWidth: 2,
4941
- borderColor: Color.white
4939
+ borderColor: color.white
4942
4940
  },
4943
4941
  up: {
4944
4942
  borderTopLeftRadius: borderRadiusPx,
@@ -4957,16 +4955,16 @@ const styles$3 = StyleSheet.create({
4957
4955
  borderBottomLeftRadius: borderRadiusPx
4958
4956
  },
4959
4957
  hovered: {
4960
- borderColor: Color.blue,
4958
+ borderColor: color.blue,
4961
4959
  boxShadow: "none"
4962
4960
  },
4963
4961
  focused: {
4964
- borderColor: Color.blue,
4962
+ borderColor: color.blue,
4965
4963
  boxShadow: "none"
4966
4964
  },
4967
4965
  pressed: {
4968
4966
  border: "2px solid #1B50B3",
4969
- background: `linear-gradient(0deg, rgba(24, 101, 242, 0.32), rgba(24, 101, 242, 0.32)), ${Color.white}`,
4967
+ background: `linear-gradient(0deg, rgba(24, 101, 242, 0.32), rgba(24, 101, 242, 0.32)), ${color.white}`,
4970
4968
  boxShadow: "none"
4971
4969
  }
4972
4970
  });
@@ -5016,7 +5014,7 @@ const styles$2 = StyleSheet.create({
5016
5014
  spacer: {
5017
5015
  gridColumn: 2,
5018
5016
  gridRow: 2,
5019
- background: Color.white
5017
+ background: color.white
5020
5018
  }
5021
5019
  });
5022
5020
 
@@ -5210,11 +5208,11 @@ const styles$1 = StyleSheet.create({
5210
5208
  alignItems: "center"
5211
5209
  },
5212
5210
  wrapper: {
5213
- background: Color.white
5211
+ background: color.white
5214
5212
  },
5215
5213
  expandedWrapper: {
5216
5214
  borderWidth: "1px 1px 0 1px",
5217
- borderColor: Color.offBlack32,
5215
+ borderColor: color.offBlack32,
5218
5216
  maxWidth: expandedViewThreshold,
5219
5217
  borderRadius: "3px 3px 0 0"
5220
5218
  },