@khanacademy/math-input 2.0.0 → 4.0.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/CHANGELOG.md +55 -0
- package/dist/components/input/__tests__/test-math-wrapper.d.ts +1 -1
- package/dist/components/input/__tests__/test-math-wrapper.js.flow +1 -1
- package/dist/components/input/key-handlers/handle-arrow.d.ts +3 -0
- package/dist/components/input/key-handlers/handle-arrow.js.flow +12 -0
- package/dist/components/input/key-handlers/handle-backspace.d.ts +7 -0
- package/dist/components/input/key-handlers/handle-backspace.js.flow +14 -0
- package/dist/components/input/key-handlers/handle-exponent.d.ts +3 -0
- package/dist/components/input/key-handlers/handle-exponent.js.flow +12 -0
- package/dist/components/input/key-handlers/handle-jump-out.d.ts +7 -0
- package/dist/components/input/key-handlers/handle-jump-out.js.flow +14 -0
- package/dist/components/input/math-input.d.ts +1 -1
- package/dist/components/input/math-input.js.flow +1 -1
- package/dist/components/input/math-wrapper.d.ts +7 -78
- package/dist/components/input/math-wrapper.js.flow +16 -78
- package/dist/components/input/mathquill-helpers.d.ts +46 -0
- package/dist/components/input/mathquill-helpers.js.flow +56 -0
- package/dist/components/input/mathquill-instance.d.ts +3 -0
- package/dist/components/input/mathquill-instance.js.flow +9 -0
- package/dist/components/input/mathquill-types.d.ts +25 -0
- package/dist/components/input/mathquill-types.js.flow +34 -0
- package/dist/components/key-translator.d.ts +4 -0
- package/dist/components/key-translator.js.flow +10 -0
- package/dist/components/keypad/button-assets.d.ts +2 -2
- package/dist/components/keypad/button-assets.js.flow +2 -2
- package/dist/components/keypad/button.d.ts +1 -2
- package/dist/components/keypad/button.js.flow +1 -1
- package/dist/components/keypad/{pre-algebra-page.d.ts → geometry-page/index.d.ts} +1 -1
- package/dist/components/keypad/{pre-algebra-page.js.flow → geometry-page/index.js.flow} +1 -1
- package/dist/components/keypad/index.d.ts +5 -4
- package/dist/components/keypad/index.js.flow +9 -4
- package/dist/components/keypad/keypad-page-items.d.ts +9 -3
- package/dist/components/keypad/keypad-page-items.js.flow +9 -3
- package/dist/components/keypad/{numeric-input-page.d.ts → numbers-page/index.d.ts} +3 -2
- package/dist/components/keypad/numbers-page/index.js.flow +17 -0
- package/dist/components/keypad/numbers-page/types.d.ts +4 -0
- package/dist/components/keypad/numbers-page/types.js.flow +10 -0
- package/dist/components/keypad/operators-page/advanced-relations-buttons.d.ts +7 -0
- package/dist/components/keypad/{numeric-input-page.js.flow → operators-page/advanced-relations-buttons.js.flow} +3 -4
- package/dist/components/keypad/operators-page/basic-relations-buttons.d.ts +7 -0
- package/dist/components/keypad/{trigonometry-page.js.flow → operators-page/basic-relations-buttons.js.flow} +3 -6
- package/dist/components/keypad/operators-page/index.d.ts +9 -0
- package/dist/components/keypad/operators-page/index.js.flow +17 -0
- package/dist/components/keypad/operators-page/logarithms-buttons.d.ts +7 -0
- package/dist/components/keypad/operators-page/logarithms-buttons.js.flow +12 -0
- package/dist/components/keypad/operators-page/pre-algebra-buttons.d.ts +7 -0
- package/dist/components/keypad/operators-page/pre-algebra-buttons.js.flow +12 -0
- package/dist/components/keypad/operators-page/types.d.ts +6 -0
- package/dist/components/keypad/operators-page/types.js.flow +12 -0
- package/dist/components/{compute-layout-parameters.d.ts → keypad-legacy/compute-layout-parameters.d.ts} +1 -1
- package/dist/components/{compute-layout-parameters.js.flow → keypad-legacy/compute-layout-parameters.js.flow} +1 -1
- package/dist/components/{echo-manager.d.ts → keypad-legacy/echo-manager.d.ts} +2 -11
- package/dist/components/{echo-manager.js.flow → keypad-legacy/echo-manager.js.flow} +2 -11
- package/dist/components/{expression-keypad.d.ts → keypad-legacy/expression-keypad.d.ts} +3 -4
- package/dist/components/{expression-keypad.js.flow → keypad-legacy/expression-keypad.js.flow} +3 -4
- package/dist/components/{fraction-keypad.d.ts → keypad-legacy/fraction-keypad.d.ts} +2 -2
- package/dist/components/{fraction-keypad.js.flow → keypad-legacy/fraction-keypad.js.flow} +2 -2
- package/dist/components/{gesture-manager.d.ts → keypad-legacy/gesture-manager.d.ts} +22 -10
- package/dist/components/{gesture-manager.js.flow → keypad-legacy/gesture-manager.js.flow} +28 -13
- package/dist/components/{gesture-state-machine.d.ts → keypad-legacy/gesture-state-machine.d.ts} +9 -9
- package/dist/components/{gesture-state-machine.js.flow → keypad-legacy/gesture-state-machine.js.flow} +10 -10
- package/dist/components/{icon.d.ts → keypad-legacy/icon.d.ts} +1 -1
- package/dist/components/{icon.js.flow → keypad-legacy/icon.js.flow} +1 -1
- package/dist/components/{keypad-button.d.ts → keypad-legacy/keypad-button.d.ts} +6 -6
- package/dist/components/{keypad-button.js.flow → keypad-legacy/keypad-button.js.flow} +7 -7
- package/dist/components/{keypad-container.d.ts → keypad-legacy/keypad-container.d.ts} +2 -2
- package/dist/components/{keypad-container.js.flow → keypad-legacy/keypad-container.js.flow} +3 -3
- package/dist/components/{keypad.d.ts → keypad-legacy/keypad.d.ts} +3 -3
- package/dist/components/{keypad.js.flow → keypad-legacy/keypad.js.flow} +3 -3
- package/dist/components/{multi-symbol-grid.d.ts → keypad-legacy/multi-symbol-grid.d.ts} +1 -1
- package/dist/components/{multi-symbol-grid.js.flow → keypad-legacy/multi-symbol-grid.js.flow} +1 -1
- package/dist/components/{multi-symbol-popover.d.ts → keypad-legacy/multi-symbol-popover.d.ts} +1 -1
- package/dist/components/{multi-symbol-popover.js.flow → keypad-legacy/multi-symbol-popover.js.flow} +1 -1
- package/dist/components/{node-manager.d.ts → keypad-legacy/node-manager.d.ts} +3 -4
- package/dist/components/{node-manager.js.flow → keypad-legacy/node-manager.js.flow} +3 -5
- package/dist/components/{popover-manager.d.ts → keypad-legacy/popover-manager.d.ts} +1 -1
- package/dist/components/{popover-manager.js.flow → keypad-legacy/popover-manager.js.flow} +1 -1
- package/dist/components/{popover-state-machine.d.ts → keypad-legacy/popover-state-machine.d.ts} +1 -1
- package/dist/components/{popover-state-machine.js.flow → keypad-legacy/popover-state-machine.js.flow} +1 -1
- package/dist/components/{provided-keypad.d.ts → keypad-legacy/provided-keypad.d.ts} +1 -1
- package/dist/components/{provided-keypad.js.flow → keypad-legacy/provided-keypad.js.flow} +1 -1
- package/dist/{store → components/keypad-legacy/store}/actions.d.ts +6 -17
- package/dist/{store → components/keypad-legacy/store}/actions.js.flow +7 -22
- package/dist/{store → components/keypad-legacy/store}/index.d.ts +0 -1
- package/dist/{store → components/keypad-legacy/store}/index.js.flow +0 -1
- package/dist/components/keypad-legacy/store/shared.d.ts +7 -0
- package/dist/components/keypad-legacy/store/shared.js.flow +14 -0
- package/dist/{store → components/keypad-legacy/store}/types.d.ts +5 -15
- package/dist/{store → components/keypad-legacy/store}/types.js.flow +5 -15
- package/dist/components/keypad-legacy/touchable-keypad-button.d.ts +37 -0
- package/dist/components/keypad-legacy/touchable-keypad-button.js.flow +59 -0
- package/dist/components/{two-page-keypad.d.ts → keypad-legacy/two-page-keypad.d.ts} +0 -1
- package/dist/components/{two-page-keypad.js.flow → keypad-legacy/two-page-keypad.js.flow} +0 -1
- package/dist/data/key-configs.d.ts +4 -5
- package/dist/data/key-configs.js.flow +3 -6
- package/dist/data/keys.d.ts +2 -56
- package/dist/data/keys.js.flow +116 -57
- package/dist/enums.d.ts +2 -9
- package/dist/enums.js.flow +2 -11
- package/dist/es/index.js +6393 -5116
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +6868 -5330
- package/dist/index.js.flow +6 -3
- package/dist/index.js.map +1 -1
- package/dist/strings.js +26 -10
- package/dist/types.d.ts +19 -17
- package/dist/types.js.flow +28 -23
- package/package.json +1 -1
- package/src/components/input/__tests__/context-tracking.test.ts +43 -44
- package/src/components/input/__tests__/mathquill.test.ts +133 -135
- package/src/components/input/key-handlers/handle-arrow.ts +70 -0
- package/src/components/input/key-handlers/handle-backspace.ts +275 -0
- package/src/components/input/key-handlers/handle-exponent.ts +52 -0
- package/src/components/input/key-handlers/handle-jump-out.ts +103 -0
- package/src/components/input/math-input.tsx +12 -13
- package/src/components/input/math-wrapper.ts +88 -837
- package/src/components/input/mathquill-helpers.ts +268 -0
- package/src/components/input/mathquill-instance.ts +5 -0
- package/src/components/input/mathquill-types.ts +55 -0
- package/src/components/key-translator.ts +209 -0
- package/src/components/keypad/button-assets.tsx +452 -116
- package/src/components/keypad/button.stories.tsx +61 -13
- package/src/components/keypad/button.tsx +1 -1
- package/src/components/keypad/{trigonometry-page.tsx → geometry-page/index.tsx} +4 -5
- package/src/components/keypad/index.tsx +19 -14
- package/src/components/keypad/keypad-mathquill.stories.tsx +69 -0
- package/src/components/keypad/keypad-page-items.tsx +36 -22
- package/src/components/keypad/keypad-pages.stories.tsx +5 -5
- package/src/components/keypad/keypad.stories.tsx +75 -17
- package/src/components/keypad/{numeric-input-page.tsx → numbers-page/index.tsx} +47 -11
- package/src/components/keypad/numbers-page/types.ts +4 -0
- package/src/components/keypad/operators-page/advanced-relations-buttons.tsx +32 -0
- package/src/components/keypad/operators-page/basic-relations-buttons.tsx +32 -0
- package/src/components/keypad/{pre-algebra-page.tsx → operators-page/index.tsx} +26 -30
- package/src/components/keypad/operators-page/logarithms-buttons.tsx +32 -0
- package/src/components/keypad/operators-page/pre-algebra-buttons.tsx +36 -0
- package/src/components/keypad/operators-page/types.ts +6 -0
- package/src/components/{__tests__ → keypad-legacy/__tests__}/two-page-keypad.test.tsx +0 -2
- package/src/components/{compute-layout-parameters.ts → keypad-legacy/compute-layout-parameters.ts} +2 -3
- package/src/components/{corner-decal.tsx → keypad-legacy/corner-decal.tsx} +2 -3
- package/src/components/{echo-manager.tsx → keypad-legacy/echo-manager.tsx} +8 -21
- package/src/components/{empty-keypad-button.tsx → keypad-legacy/empty-keypad-button.tsx} +8 -6
- package/src/components/{expression-keypad.tsx → keypad-legacy/expression-keypad.tsx} +8 -17
- package/src/components/{fraction-keypad.tsx → keypad-legacy/fraction-keypad.tsx} +6 -6
- package/src/components/{gesture-manager.ts → keypad-legacy/gesture-manager.ts} +34 -11
- package/src/components/{gesture-state-machine.ts → keypad-legacy/gesture-state-machine.ts} +14 -14
- package/src/components/{icon.tsx → keypad-legacy/icon.tsx} +3 -3
- package/src/components/{keypad-button.tsx → keypad-legacy/keypad-button.tsx} +26 -26
- package/src/components/{keypad-container.tsx → keypad-legacy/keypad-container.tsx} +6 -6
- package/src/components/{keypad.tsx → keypad-legacy/keypad.tsx} +5 -5
- package/src/components/{many-keypad-button.tsx → keypad-legacy/many-keypad-button.tsx} +13 -6
- package/src/components/{math-icon.tsx → keypad-legacy/math-icon.tsx} +2 -2
- package/src/components/{multi-symbol-grid.tsx → keypad-legacy/multi-symbol-grid.tsx} +4 -4
- package/src/components/{multi-symbol-popover.tsx → keypad-legacy/multi-symbol-popover.tsx} +3 -4
- package/src/components/{navigation-pad.tsx → keypad-legacy/navigation-pad.tsx} +5 -5
- package/src/components/{node-manager.ts → keypad-legacy/node-manager.ts} +2 -10
- package/src/components/{popover-manager.tsx → keypad-legacy/popover-manager.tsx} +2 -2
- package/src/components/{popover-state-machine.ts → keypad-legacy/popover-state-machine.ts} +1 -1
- package/src/components/{provided-keypad.tsx → keypad-legacy/provided-keypad.tsx} +4 -5
- package/src/{store → components/keypad-legacy/store}/actions.ts +7 -36
- package/src/{store → components/keypad-legacy/store}/echo-reducer.ts +3 -7
- package/src/{store → components/keypad-legacy/store}/index.ts +7 -20
- package/src/{store → components/keypad-legacy/store}/input-reducer.ts +4 -5
- package/src/{store → components/keypad-legacy/store}/keypad-reducer.ts +3 -4
- package/src/{store → components/keypad-legacy/store}/layout-reducer.ts +3 -3
- package/src/{store → components/keypad-legacy/store}/shared.ts +3 -3
- package/src/{store → components/keypad-legacy/store}/types.ts +15 -19
- package/src/components/{styles.ts → keypad-legacy/styles.ts} +1 -1
- package/src/components/{text-icon.tsx → keypad-legacy/text-icon.tsx} +2 -2
- package/src/components/{touchable-keypad-button.tsx → keypad-legacy/touchable-keypad-button.tsx} +35 -21
- package/src/components/{two-page-keypad.tsx → keypad-legacy/two-page-keypad.tsx} +5 -6
- package/src/components/tabbar/icons.tsx +0 -2
- package/src/data/key-configs.ts +751 -309
- package/src/data/keys.ts +118 -70
- package/src/enums.ts +10 -9
- package/src/index.ts +6 -3
- package/src/math-input.stories.tsx +3 -3
- package/src/types.ts +21 -16
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/components/keypad/trigonometry-page.d.ts +0 -8
- package/dist/components/touchable-keypad-button.d.ts +0 -30
- package/dist/components/touchable-keypad-button.js.flow +0 -35
- package/dist/components/velocity-tracker.d.ts +0 -48
- package/dist/components/velocity-tracker.js.flow +0 -54
- package/dist/store/pager-reducer.d.ts +0 -4
- package/dist/store/pager-reducer.js.flow +0 -13
- package/dist/store/shared.d.ts +0 -7
- package/dist/store/shared.js.flow +0 -14
- package/src/components/velocity-tracker.ts +0 -86
- package/src/store/pager-reducer.ts +0 -125
- /package/dist/components/{corner-decal.d.ts → keypad-legacy/corner-decal.d.ts} +0 -0
- /package/dist/components/{corner-decal.js.flow → keypad-legacy/corner-decal.js.flow} +0 -0
- /package/dist/components/{empty-keypad-button.d.ts → keypad-legacy/empty-keypad-button.d.ts} +0 -0
- /package/dist/components/{empty-keypad-button.js.flow → keypad-legacy/empty-keypad-button.js.flow} +0 -0
- /package/dist/components/{many-keypad-button.d.ts → keypad-legacy/many-keypad-button.d.ts} +0 -0
- /package/dist/components/{many-keypad-button.js.flow → keypad-legacy/many-keypad-button.js.flow} +0 -0
- /package/dist/components/{math-icon.d.ts → keypad-legacy/math-icon.d.ts} +0 -0
- /package/dist/components/{math-icon.js.flow → keypad-legacy/math-icon.js.flow} +0 -0
- /package/dist/components/{navigation-pad.d.ts → keypad-legacy/navigation-pad.d.ts} +0 -0
- /package/dist/components/{navigation-pad.js.flow → keypad-legacy/navigation-pad.js.flow} +0 -0
- /package/dist/{store → components/keypad-legacy/store}/echo-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/echo-reducer.js.flow +0 -0
- /package/dist/{store → components/keypad-legacy/store}/input-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/input-reducer.js.flow +0 -0
- /package/dist/{store → components/keypad-legacy/store}/keypad-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/keypad-reducer.js.flow +0 -0
- /package/dist/{store → components/keypad-legacy/store}/layout-reducer.d.ts +0 -0
- /package/dist/{store → components/keypad-legacy/store}/layout-reducer.js.flow +0 -0
- /package/dist/components/{styles.d.ts → keypad-legacy/styles.d.ts} +0 -0
- /package/dist/components/{styles.js.flow → keypad-legacy/styles.js.flow} +0 -0
- /package/dist/components/{svg-icon.d.ts → keypad-legacy/svg-icon.d.ts} +0 -0
- /package/dist/components/{svg-icon.js.flow → keypad-legacy/svg-icon.js.flow} +0 -0
- /package/dist/components/{text-icon.d.ts → keypad-legacy/text-icon.d.ts} +0 -0
- /package/dist/components/{text-icon.js.flow → keypad-legacy/text-icon.js.flow} +0 -0
- /package/dist/components/{z-indexes.d.ts → keypad-legacy/z-indexes.d.ts} +0 -0
- /package/dist/components/{z-indexes.js.flow → keypad-legacy/z-indexes.js.flow} +0 -0
- /package/src/components/{__tests__ → keypad-legacy/__tests__}/gesture-state-machine.test.ts +0 -0
- /package/src/components/{__tests__ → keypad-legacy/__tests__}/node-manager.test.ts +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/arrow.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/backspace.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/cdot.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/cos.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/cube-root.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/dismiss.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/divide.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/down.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/equal.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/exp-2.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/exp-3.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/exp.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/frac.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/geq.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/gt.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/index.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-into-numerator.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-base.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-denominator.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-exponent.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-numerator.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/jump-out-parentheses.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/left-paren.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/left.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/leq.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/ln.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/log-n.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/log.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/lt.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/minus.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/neq.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/parens.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/percent.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/period.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/plus.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/radical.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/right-paren.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/right.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/sin.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/sqrt.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/tan.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/times.js +0 -0
- /package/src/components/{iconography → keypad-legacy/iconography}/up.js +0 -0
- /package/src/components/{svg-icon.tsx → keypad-legacy/svg-icon.tsx} +0 -0
- /package/src/components/{z-indexes.ts → keypad-legacy/z-indexes.ts} +0 -0
|
@@ -12,10 +12,9 @@ no copying and pasting is necessary.
|
|
|
12
12
|
*/
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
type KeyId = string;
|
|
15
|
+
import Key from "../../data/keys";
|
|
17
16
|
|
|
18
|
-
type Props = {id:
|
|
17
|
+
type Props = {id: Key};
|
|
19
18
|
|
|
20
19
|
export default function ButtonAsset({id}: Props): React.ReactElement {
|
|
21
20
|
switch (id) {
|
|
@@ -181,9 +180,9 @@ export default function ButtonAsset({id}: Props): React.ReactElement {
|
|
|
181
180
|
<path
|
|
182
181
|
d="M22 10C17 16 17 24 22 30"
|
|
183
182
|
stroke="#21242C"
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
strokeWidth="2"
|
|
184
|
+
strokeLinecap="round"
|
|
185
|
+
strokeLinejoin="round"
|
|
187
186
|
/>
|
|
188
187
|
</svg>
|
|
189
188
|
);
|
|
@@ -199,115 +198,106 @@ export default function ButtonAsset({id}: Props): React.ReactElement {
|
|
|
199
198
|
<path
|
|
200
199
|
d="M19 10C24 16 24 24 19 30"
|
|
201
200
|
stroke="#21242C"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
201
|
+
strokeWidth="2"
|
|
202
|
+
strokeLinecap="round"
|
|
203
|
+
strokeLinejoin="round"
|
|
205
204
|
/>
|
|
206
205
|
</svg>
|
|
207
206
|
);
|
|
208
207
|
case "MINUS":
|
|
209
208
|
return (
|
|
210
209
|
<svg
|
|
211
|
-
width="40"
|
|
212
|
-
height="40"
|
|
213
|
-
viewBox="0 0 40 40"
|
|
214
|
-
fill="none"
|
|
215
210
|
xmlns="http://www.w3.org/2000/svg"
|
|
211
|
+
width="20"
|
|
212
|
+
height="20"
|
|
213
|
+
fill="currentColor"
|
|
214
|
+
viewBox="0 0 256 256"
|
|
216
215
|
>
|
|
217
|
-
<path
|
|
218
|
-
d="M27 20H13"
|
|
219
|
-
stroke="#21242C"
|
|
220
|
-
stroke-width="2"
|
|
221
|
-
stroke-linecap="round"
|
|
222
|
-
stroke-linejoin="round"
|
|
223
|
-
/>
|
|
216
|
+
<path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z" />
|
|
224
217
|
</svg>
|
|
225
218
|
);
|
|
226
219
|
case "PLUS":
|
|
227
220
|
return (
|
|
221
|
+
// Phosphor Icons - Plus Bold
|
|
228
222
|
<svg
|
|
229
|
-
width="40"
|
|
230
|
-
height="40"
|
|
231
|
-
viewBox="0 0 40 40"
|
|
232
|
-
fill="none"
|
|
233
223
|
xmlns="http://www.w3.org/2000/svg"
|
|
224
|
+
width="20"
|
|
225
|
+
height="20"
|
|
226
|
+
fill="currentColor"
|
|
227
|
+
viewBox="0 0 256 256"
|
|
234
228
|
>
|
|
235
|
-
<path
|
|
236
|
-
d="M27 20H13"
|
|
237
|
-
stroke="#21242C"
|
|
238
|
-
stroke-width="2"
|
|
239
|
-
stroke-linecap="round"
|
|
240
|
-
stroke-linejoin="round"
|
|
241
|
-
/>
|
|
242
|
-
<path
|
|
243
|
-
d="M20 13V27"
|
|
244
|
-
stroke="#21242C"
|
|
245
|
-
stroke-width="2"
|
|
246
|
-
stroke-linecap="round"
|
|
247
|
-
stroke-linejoin="round"
|
|
248
|
-
/>
|
|
229
|
+
<path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z" />{" "}
|
|
249
230
|
</svg>
|
|
250
231
|
);
|
|
251
232
|
case "TIMES":
|
|
252
233
|
return (
|
|
234
|
+
// Phosphor Icons - X Bold
|
|
253
235
|
<svg
|
|
254
|
-
width="40"
|
|
255
|
-
height="40"
|
|
256
|
-
viewBox="0 0 40 40"
|
|
257
|
-
fill="none"
|
|
258
236
|
xmlns="http://www.w3.org/2000/svg"
|
|
237
|
+
width="20"
|
|
238
|
+
height="20"
|
|
239
|
+
fill="#000000"
|
|
240
|
+
viewBox="0 0 256 256"
|
|
259
241
|
>
|
|
260
|
-
<path
|
|
261
|
-
d="M24.9498 24.9493L15.0503 15.0498"
|
|
262
|
-
stroke="#21242C"
|
|
263
|
-
stroke-width="2"
|
|
264
|
-
stroke-linecap="round"
|
|
265
|
-
stroke-linejoin="round"
|
|
266
|
-
/>
|
|
267
|
-
<path
|
|
268
|
-
d="M24.9498 15.0507L15.0503 24.9502"
|
|
269
|
-
stroke="#21242C"
|
|
270
|
-
stroke-width="2"
|
|
271
|
-
stroke-linecap="round"
|
|
272
|
-
stroke-linejoin="round"
|
|
273
|
-
/>
|
|
242
|
+
<path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z" />
|
|
274
243
|
</svg>
|
|
275
244
|
);
|
|
276
245
|
|
|
277
246
|
case "BACKSPACE":
|
|
278
247
|
return (
|
|
279
248
|
<svg
|
|
280
|
-
width="40"
|
|
281
|
-
height="40"
|
|
282
|
-
viewBox="0 0 40 40"
|
|
283
|
-
fill="none"
|
|
284
249
|
xmlns="http://www.w3.org/2000/svg"
|
|
250
|
+
width="20"
|
|
251
|
+
height="20"
|
|
252
|
+
fill="currentColor"
|
|
253
|
+
viewBox="0 0 256 256"
|
|
285
254
|
>
|
|
286
|
-
<path
|
|
287
|
-
fill-rule="evenodd"
|
|
288
|
-
clip-rule="evenodd"
|
|
289
|
-
d="M10 20L16 14H28.1716V26L16 26L10 20ZM8.58579 18.5858L14.5858 12.5858C14.9609 12.2107 15.4696 12 16 12H28.1716C29.2761 12 30.1716 12.8954 30.1716 14V26C30.1716 27.1046 29.2761 28 28.1716 28H16C15.4696 28 14.9609 27.7893 14.5858 27.4142L8.58579 21.4142C7.80474 20.6332 7.80474 19.3668 8.58579 18.5858ZM22.4645 17.2929L21.1716 18.5858L19.8787 17.2929C19.4882 16.9024 18.855 16.9024 18.4645 17.2929C18.074 17.6834 18.074 18.3166 18.4645 18.7071L19.7574 20L18.4645 21.2929C18.074 21.6834 18.074 22.3166 18.4645 22.7071C18.855 23.0976 19.4882 23.0976 19.8787 22.7071L21.1716 21.4142L22.4645 22.7071C22.855 23.0976 23.4882 23.0976 23.8787 22.7071C24.2693 22.3166 24.2693 21.6834 23.8787 21.2929L22.5858 20L23.8787 18.7071C24.2693 18.3166 24.2693 17.6834 23.8787 17.2929C23.4882 16.9024 22.855 16.9024 22.4645 17.2929Z"
|
|
290
|
-
fill="#21242C"
|
|
291
|
-
/>
|
|
255
|
+
<path d="M216,40H68.53a16.08,16.08,0,0,0-13.72,7.77L9.14,123.88a8,8,0,0,0,0,8.24l45.67,76.11A16.08,16.08,0,0,0,68.53,216H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM61.67,204.12,68.53,200h0ZM216,200H68.53l-43.2-72,43.2-72H216ZM106.34,146.34,124.69,128l-18.35-18.34a8,8,0,0,1,11.32-11.32L136,116.69l18.34-18.35a8,8,0,0,1,11.32,11.32L147.31,128l18.35,18.34a8,8,0,0,1-11.32,11.32L136,139.31l-18.34,18.35a8,8,0,0,1-11.32-11.32Z" />
|
|
292
256
|
</svg>
|
|
293
257
|
);
|
|
294
258
|
case "DISMISS":
|
|
295
259
|
return (
|
|
296
260
|
<svg
|
|
297
|
-
width="40"
|
|
298
|
-
height="40"
|
|
299
|
-
viewBox="0 0 40 40"
|
|
300
|
-
fill="none"
|
|
301
261
|
xmlns="http://www.w3.org/2000/svg"
|
|
262
|
+
width="20"
|
|
263
|
+
height="20"
|
|
264
|
+
fill="currentColor"
|
|
265
|
+
viewBox="0 0 256 256"
|
|
302
266
|
>
|
|
303
267
|
<path
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
d="
|
|
307
|
-
fill="#21242C"
|
|
268
|
+
// flip to point down
|
|
269
|
+
transform="scale(1,-1) translate(0, -260)"
|
|
270
|
+
d="M205.66,125.66a8,8,0,0,1-11.32,0L128,59.31,61.66,125.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,125.66Z"
|
|
308
271
|
/>
|
|
309
272
|
</svg>
|
|
310
273
|
);
|
|
274
|
+
case "FRAC":
|
|
275
|
+
return (
|
|
276
|
+
<svg width="48" height="48" viewBox="0 0 48 48">
|
|
277
|
+
<g fill="none" fillRule="evenodd">
|
|
278
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
279
|
+
<g transform="translate(12 12)">
|
|
280
|
+
<path fill="none" d="M0 0h24v24H0z" />
|
|
281
|
+
<path
|
|
282
|
+
d="M8 16.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997H8.997c-.55 0-.997-.453-.997-.997v-6.006zM10 18h4v4h-4v-4z"
|
|
283
|
+
fill="currentColor"
|
|
284
|
+
/>
|
|
285
|
+
<rect
|
|
286
|
+
fill="currentColor"
|
|
287
|
+
x="2"
|
|
288
|
+
y="11"
|
|
289
|
+
width="20"
|
|
290
|
+
height="2"
|
|
291
|
+
rx="1"
|
|
292
|
+
/>
|
|
293
|
+
<path
|
|
294
|
+
d="M8 .997C8 .447 8.453 0 8.997 0h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997H8.997C8.447 8 8 7.547 8 7.003V.997zM10 2h4v4h-4V2z"
|
|
295
|
+
fill="currentColor"
|
|
296
|
+
/>
|
|
297
|
+
</g>
|
|
298
|
+
</g>
|
|
299
|
+
</svg>
|
|
300
|
+
);
|
|
311
301
|
case "FRAC_INCLUSIVE":
|
|
312
302
|
return (
|
|
313
303
|
<svg
|
|
@@ -318,8 +308,8 @@ export default function ButtonAsset({id}: Props): React.ReactElement {
|
|
|
318
308
|
xmlns="http://www.w3.org/2000/svg"
|
|
319
309
|
>
|
|
320
310
|
<path
|
|
321
|
-
|
|
322
|
-
|
|
311
|
+
fillRule="evenodd"
|
|
312
|
+
clipRule="evenodd"
|
|
323
313
|
d="M16 10C16 9.44772 16.4477 9 17 9H23C23.5523 9 24 9.44772 24 10V16C24 16.5523 23.5523 17 23 17H17C16.4477 17 16 16.5523 16 16V10ZM18 11H22V15H18V11ZM14 20C14 19.4477 14.4477 19 15 19H25C25.5523 19 26 19.4477 26 20C26 20.5523 25.5523 21 25 21H15C14.4477 21 14 20.5523 14 20ZM17 23C16.4477 23 16 23.4477 16 24V30C16 30.5523 16.4477 31 17 31H23C23.5523 31 24 30.5523 24 30V24C24 23.4477 23.5523 23 23 23H17ZM22 25H18V29H22V25Z"
|
|
324
314
|
fill="#21242C"
|
|
325
315
|
/>
|
|
@@ -335,33 +325,31 @@ export default function ButtonAsset({id}: Props): React.ReactElement {
|
|
|
335
325
|
xmlns="http://www.w3.org/2000/svg"
|
|
336
326
|
>
|
|
337
327
|
<path
|
|
338
|
-
|
|
339
|
-
|
|
328
|
+
fillRule="evenodd"
|
|
329
|
+
clipRule="evenodd"
|
|
340
330
|
d="M12.9571 13.2929C13.3476 13.6834 13.3476 14.3166 12.9571 14.7071C11.6871 15.9771 11 17.9485 11 20C11 22.0515 11.6871 24.0229 12.9571 25.2929C13.3476 25.6834 13.3476 26.3166 12.9571 26.7071C12.5666 27.0976 11.9334 27.0976 11.5429 26.7071C9.81292 24.9771 9 22.4485 9 20C9 17.5515 9.81292 15.0229 11.5429 13.2929C11.9334 12.9024 12.5666 12.9024 12.9571 13.2929ZM14 20C14 19.4477 14.4477 19 15 19H25C25.5523 19 26 19.4477 26 20C26 20.5523 25.5523 21 25 21H15C14.4477 21 14 20.5523 14 20ZM28.4571 13.2929C28.0666 12.9024 27.4334 12.9024 27.0429 13.2929C26.6524 13.6834 26.6524 14.3166 27.0429 14.7071C28.3129 15.9771 29 17.9485 29 20C29 22.0515 28.3129 24.0229 27.0429 25.2929C26.6524 25.6834 26.6524 26.3166 27.0429 26.7071C27.4334 27.0976 28.0666 27.0976 28.4571 26.7071C30.1871 24.9771 31 22.4485 31 20C31 17.5515 30.1871 15.0229 28.4571 13.2929Z"
|
|
341
331
|
fill="#21242C"
|
|
342
332
|
/>
|
|
343
333
|
</svg>
|
|
344
334
|
);
|
|
335
|
+
// TODO(ned): Per the notes in `KeyConfigs`, shouldn't this be a comma
|
|
336
|
+
// that we replace with the period icon for i18n? Duplicating for now.
|
|
345
337
|
case "DECIMAL":
|
|
338
|
+
case "PERIOD":
|
|
346
339
|
return (
|
|
347
340
|
<svg
|
|
348
|
-
width="40"
|
|
349
|
-
height="40"
|
|
350
|
-
viewBox="0 0 40 40"
|
|
351
|
-
fill="none"
|
|
352
341
|
xmlns="http://www.w3.org/2000/svg"
|
|
342
|
+
width="20"
|
|
343
|
+
height="20"
|
|
344
|
+
fill="currentColor"
|
|
345
|
+
viewBox="0 0 256 256"
|
|
353
346
|
>
|
|
354
|
-
<
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
d="M18.5 18.5H21.5V21.5H18.5V18.5Z"
|
|
361
|
-
fill="white"
|
|
362
|
-
/>
|
|
363
|
-
</clipPath>
|
|
364
|
-
</defs>
|
|
347
|
+
<path
|
|
348
|
+
d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Z"
|
|
349
|
+
// moves decimal down to baseline of number icons,
|
|
350
|
+
// otherwise indistinguishable from cdot
|
|
351
|
+
transform="translate(0 80)"
|
|
352
|
+
/>
|
|
365
353
|
</svg>
|
|
366
354
|
);
|
|
367
355
|
case "RADICAL":
|
|
@@ -374,14 +362,49 @@ export default function ButtonAsset({id}: Props): React.ReactElement {
|
|
|
374
362
|
xmlns="http://www.w3.org/2000/svg"
|
|
375
363
|
>
|
|
376
364
|
<path
|
|
377
|
-
|
|
378
|
-
|
|
365
|
+
fillRule="evenodd"
|
|
366
|
+
clipRule="evenodd"
|
|
379
367
|
d="M9.00012 9C9.00012 8.44772 9.44784 8 10.0001 8H16.0001C16.5524 8 17.0001 8.44772 17.0001 9V15C17.0001 15.5523 16.5524 16 16.0001 16H10.0001C9.44784 16 9.00012 15.5523 9.00012 15V9ZM11.0001 10H15.0001V14H11.0001V10ZM23.0001 12C22.6598 12 22.3429 12.173 22.1589 12.4592L13.9849 25.1744L10.8322 20.4453C10.5258 19.9858 9.90493 19.8616 9.44541 20.1679C8.98588 20.4743 8.8617 21.0952 9.16806 21.5547L13.1681 27.5547C13.3552 27.8354 13.6711 28.0028 14.0084 28C14.3457 27.9972 14.6589 27.8245 14.8413 27.5408L23.5461 14H30.0001C30.5524 14 31.0001 13.5523 31.0001 13C31.0001 12.4477 30.5524 12 30.0001 12H23.0001Z"
|
|
380
368
|
fill="#21242C"
|
|
381
369
|
/>
|
|
382
370
|
</svg>
|
|
383
371
|
);
|
|
384
372
|
case "SQRT":
|
|
373
|
+
return (
|
|
374
|
+
<svg
|
|
375
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
376
|
+
width="20"
|
|
377
|
+
height="20"
|
|
378
|
+
fill="currentColor"
|
|
379
|
+
viewBox="0 0 256 256"
|
|
380
|
+
>
|
|
381
|
+
<path d="M240,72V96a8,8,0,0,1-16,0V80H125.55L79.49,202.81a8,8,0,0,1-15,0l-48-128a8,8,0,1,1,15-5.62L72,177.22l40.51-108A8,8,0,0,1,120,64H232A8,8,0,0,1,240,72Z" />
|
|
382
|
+
</svg>
|
|
383
|
+
);
|
|
384
|
+
case "CUBE_ROOT":
|
|
385
|
+
return (
|
|
386
|
+
<svg width="48" height="48" viewBox="0 0 48 48">
|
|
387
|
+
<g
|
|
388
|
+
fill="none"
|
|
389
|
+
fillRule="evenodd"
|
|
390
|
+
transform="translate(0, -4)"
|
|
391
|
+
>
|
|
392
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
393
|
+
<path
|
|
394
|
+
d="M17.91 23.12c1.66 0 2.76-.81 2.76-1.98 0-.96-.86-1.51-1.57-1.58.79-.13 1.46-.72 1.46-1.5 0-1.1-.95-1.83-2.65-1.83-1.23 0-2.11.45-2.67 1.08l.83 1.08c.47-.42 1.05-.64 1.66-.64.64 0 1.12.19 1.12.61 0 .35-.39.52-1.08.52-.25 0-.77 0-.9-.01v1.53c.1-.01.61-.01.9-.01.91 0 1.19.18 1.19.56 0 .37-.38.65-1.12.65-.58 0-1.34-.23-1.82-.7l-.87 1.17c.52.6 1.48 1.05 2.76 1.05z"
|
|
395
|
+
fill="currentColor"
|
|
396
|
+
/>
|
|
397
|
+
<path
|
|
398
|
+
stroke="currentColor"
|
|
399
|
+
strokeWidth="2"
|
|
400
|
+
strokeLinecap="round"
|
|
401
|
+
strokeLinejoin="round"
|
|
402
|
+
d="M14 29l4 6 9-14h7"
|
|
403
|
+
/>
|
|
404
|
+
</g>
|
|
405
|
+
</svg>
|
|
406
|
+
);
|
|
407
|
+
case "EXP":
|
|
385
408
|
return (
|
|
386
409
|
<svg
|
|
387
410
|
width="40"
|
|
@@ -391,11 +414,10 @@ export default function ButtonAsset({id}: Props): React.ReactElement {
|
|
|
391
414
|
xmlns="http://www.w3.org/2000/svg"
|
|
392
415
|
>
|
|
393
416
|
<path
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
stroke-linejoin="round"
|
|
417
|
+
fillRule="evenodd"
|
|
418
|
+
clipRule="evenodd"
|
|
419
|
+
fill="#21242C"
|
|
420
|
+
d="M28 8C28 7.44772 28.4477 7 29 7H35C35.5523 7 36 7.44772 36 8V14C36 14.5523 35.5523 15 35 15H29C28.4477 15 28 14.5523 28 14V8ZM30 9H34V13H30V9ZM14 13C14 12.4477 14.4477 12 15 12H25C25.5523 12 26 12.4477 26 13V27C26 27.5523 25.5523 28 25 28H15C14.4477 28 14 27.5523 14 27V13ZM16 14H24V26H16V14Z"
|
|
399
421
|
/>
|
|
400
422
|
</svg>
|
|
401
423
|
);
|
|
@@ -409,37 +431,31 @@ export default function ButtonAsset({id}: Props): React.ReactElement {
|
|
|
409
431
|
xmlns="http://www.w3.org/2000/svg"
|
|
410
432
|
>
|
|
411
433
|
<path
|
|
412
|
-
|
|
413
|
-
|
|
434
|
+
fillRule="evenodd"
|
|
435
|
+
clipRule="evenodd"
|
|
414
436
|
d="M33.5791 13.7461C33.4874 13.6545 33.3591 13.6086 33.1941 13.6086H31.4011C31.2397 13.6086 31.0674 13.6251 30.8841 13.6581C30.7007 13.6875 30.5156 13.7296 30.3286 13.7846L32.0226 12.0521C32.2352 11.8358 32.4369 11.6213 32.6276 11.4086C32.8182 11.196 32.9851 10.9778 33.1281 10.7541C33.2747 10.5268 33.3902 10.2885 33.4746 10.0391C33.5589 9.78981 33.6011 9.51847 33.6011 9.22514C33.6011 8.88414 33.5406 8.57247 33.4196 8.29014C33.2986 8.00781 33.1281 7.76764 32.9081 7.56964C32.6881 7.36797 32.4222 7.21214 32.1106 7.10214C31.8026 6.98847 31.4597 6.93164 31.0821 6.93164C30.7227 6.93164 30.3872 6.98114 30.0756 7.08014C29.7639 7.17547 29.4871 7.32031 29.2451 7.51464C29.0031 7.70897 28.8014 7.95281 28.6401 8.24614C28.4787 8.53947 28.3687 8.88047 28.3101 9.26914L29.1131 9.41214C29.3184 9.44514 29.4761 9.43231 29.5861 9.37364C29.6997 9.31131 29.7896 9.18847 29.8556 9.00514C29.8886 8.88781 29.9399 8.77964 30.0096 8.68064C30.0792 8.58164 30.1617 8.49547 30.2571 8.42214C30.3561 8.34881 30.4661 8.29197 30.5871 8.25164C30.7117 8.20764 30.8474 8.18564 30.9941 8.18564C31.3277 8.18564 31.5862 8.27914 31.7696 8.46614C31.9529 8.64947 32.0446 8.91897 32.0446 9.27464C32.0446 9.47631 32.0189 9.66881 31.9676 9.85214C31.9162 10.0355 31.8392 10.217 31.7366 10.3966C31.6339 10.5726 31.5056 10.7541 31.3516 10.9411C31.1976 11.1245 31.0197 11.317 30.8181 11.5186L28.4531 13.8891C28.3577 13.9808 28.2899 14.0835 28.2496 14.1971C28.2092 14.3071 28.1891 14.4098 28.1891 14.5051V15.0001H33.7221V14.1091C33.7221 13.9588 33.6744 13.8378 33.5791 13.7461ZM14 13.0001C14 12.4479 14.4477 12.0001 15 12.0001H25C25.5523 12.0001 26 12.4479 26 13.0001V27.0001C26 27.5524 25.5523 28.0001 25 28.0001H15C14.4477 28.0001 14 27.5524 14 27.0001V13.0001ZM16 14.0001H24V26.0001H16V14.0001Z"
|
|
415
437
|
fill="#21242C"
|
|
416
438
|
/>
|
|
417
439
|
</svg>
|
|
418
440
|
);
|
|
419
|
-
case "
|
|
441
|
+
case "EXP_3":
|
|
420
442
|
return (
|
|
421
443
|
<svg
|
|
422
|
-
width="
|
|
423
|
-
height="
|
|
444
|
+
width="42"
|
|
445
|
+
height="42"
|
|
424
446
|
viewBox="0 0 40 40"
|
|
425
447
|
fill="none"
|
|
426
448
|
xmlns="http://www.w3.org/2000/svg"
|
|
427
449
|
>
|
|
428
450
|
<path
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
451
|
+
transform="translate(0, -8)"
|
|
452
|
+
fillRule="evenodd"
|
|
453
|
+
clipRule="evenodd"
|
|
432
454
|
fill="#21242C"
|
|
455
|
+
d="M14 21c0-.552.456-1 1.002-1h9.996A1 1 0 0 1 26 21v14c0 .552-.456 1-1.002 1h-9.996A1 1 0 0 1 14 35V21zm2 1h8v12h-8V22zM30.92 23.12c1.66 0 2.76-.81 2.76-1.98 0-.96-.86-1.51-1.57-1.58.79-.13 1.46-.72 1.46-1.5 0-1.1-.95-1.83-2.65-1.83-1.23 0-2.11.45-2.67 1.08l.83 1.08c.47-.42 1.05-.64 1.66-.64.64 0 1.12.19 1.12.61 0 .35-.39.52-1.08.52-.25 0-.77 0-.9-.01v1.53c.1-.01.61-.01.9-.01.91 0 1.19.18 1.19.56 0 .37-.38.65-1.12.65-.58 0-1.34-.23-1.82-.7l-.87 1.17c.52.6 1.48 1.05 2.76 1.05z"
|
|
433
456
|
/>
|
|
434
457
|
</svg>
|
|
435
458
|
);
|
|
436
|
-
case "PI":
|
|
437
|
-
//TODO(NickR): use correct font, size, and color for this. It's not an SVG asset
|
|
438
|
-
return <span>pi</span>;
|
|
439
|
-
case "X":
|
|
440
|
-
//TODO(NickR): use correct font, size, and color for this. It's not an SVG asset
|
|
441
|
-
return <span>x</span>;
|
|
442
|
-
|
|
443
459
|
case "TAN":
|
|
444
460
|
return (
|
|
445
461
|
<svg
|
|
@@ -485,8 +501,328 @@ export default function ButtonAsset({id}: Props): React.ReactElement {
|
|
|
485
501
|
/>
|
|
486
502
|
</svg>
|
|
487
503
|
);
|
|
504
|
+
case "DIVIDE":
|
|
505
|
+
return (
|
|
506
|
+
<svg
|
|
507
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
508
|
+
width="20"
|
|
509
|
+
height="20"
|
|
510
|
+
fill="currentColor"
|
|
511
|
+
viewBox="0 0 256 256"
|
|
512
|
+
>
|
|
513
|
+
<path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM128,80a16,16,0,1,0-16-16A16,16,0,0,0,128,80Zm0,96a16,16,0,1,0,16,16A16,16,0,0,0,128,176Z" />
|
|
514
|
+
</svg>
|
|
515
|
+
);
|
|
516
|
+
case "EQUAL":
|
|
517
|
+
return (
|
|
518
|
+
<svg
|
|
519
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
520
|
+
width="20"
|
|
521
|
+
height="20"
|
|
522
|
+
fill="currentColor"
|
|
523
|
+
viewBox="0 0 256 256"
|
|
524
|
+
>
|
|
525
|
+
<path d="M224,160a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,160ZM40,104H216a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Z" />
|
|
526
|
+
</svg>
|
|
527
|
+
);
|
|
528
|
+
case "GT":
|
|
529
|
+
return (
|
|
530
|
+
<svg width="44" height="44" viewBox="0 0 48 48">
|
|
531
|
+
<g fill="none" fillRule="evenodd">
|
|
532
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
533
|
+
<path fill="none" d="M12 12h24v24H12z" />
|
|
534
|
+
<path
|
|
535
|
+
stroke="currentColor"
|
|
536
|
+
strokeWidth="2"
|
|
537
|
+
strokeLinecap="round"
|
|
538
|
+
strokeLinejoin="round"
|
|
539
|
+
d="M16 30l16-6-16-6"
|
|
540
|
+
/>
|
|
541
|
+
</g>
|
|
542
|
+
</svg>
|
|
543
|
+
);
|
|
544
|
+
case "LT":
|
|
545
|
+
return (
|
|
546
|
+
<svg width="44" height="44" viewBox="0 0 48 48">
|
|
547
|
+
<g fill="none" fillRule="evenodd">
|
|
548
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
549
|
+
<path fill="none" d="M12 12h24v24H12z" />
|
|
550
|
+
<path
|
|
551
|
+
stroke="currentColor"
|
|
552
|
+
strokeWidth="2"
|
|
553
|
+
strokeLinecap="round"
|
|
554
|
+
strokeLinejoin="round"
|
|
555
|
+
d="M32 30l-16-6 16-6"
|
|
556
|
+
/>
|
|
557
|
+
</g>
|
|
558
|
+
</svg>
|
|
559
|
+
);
|
|
560
|
+
case "GEQ":
|
|
561
|
+
return (
|
|
562
|
+
<svg width="44" height="44" viewBox="0 0 48 48">
|
|
563
|
+
<g fill="none" fillRule="evenodd">
|
|
564
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
565
|
+
<path fill="none" d="M12 12h24v24H12z" />
|
|
566
|
+
<path
|
|
567
|
+
d="M16 33h16M16 30l16-6-16-6"
|
|
568
|
+
stroke="currentColor"
|
|
569
|
+
strokeWidth="2"
|
|
570
|
+
strokeLinecap="round"
|
|
571
|
+
strokeLinejoin="round"
|
|
572
|
+
/>
|
|
573
|
+
</g>
|
|
574
|
+
</svg>
|
|
575
|
+
);
|
|
576
|
+
case "LEQ":
|
|
577
|
+
return (
|
|
578
|
+
<svg width="44" height="44" viewBox="0 0 48 48">
|
|
579
|
+
<g fill="none" fillRule="evenodd">
|
|
580
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
581
|
+
<path fill="none" d="M12 12h24v24H12z" />
|
|
582
|
+
<path
|
|
583
|
+
d="M16 33h16M32 30l-16-6 16-6"
|
|
584
|
+
stroke="currentColor"
|
|
585
|
+
strokeWidth="2"
|
|
586
|
+
strokeLinecap="round"
|
|
587
|
+
strokeLinejoin="round"
|
|
588
|
+
/>
|
|
589
|
+
</g>
|
|
590
|
+
</svg>
|
|
591
|
+
);
|
|
592
|
+
case "NEQ":
|
|
593
|
+
return (
|
|
594
|
+
<svg width="44" height="44" viewBox="0 0 48 48">
|
|
595
|
+
<g fill="none" fillRule="evenodd">
|
|
596
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
597
|
+
<path fill="none" d="M12 12h24v24H12z" />
|
|
598
|
+
<path
|
|
599
|
+
d="M19 33l10-18M16 21h17M16 27h17"
|
|
600
|
+
stroke="currentColor"
|
|
601
|
+
strokeWidth="2"
|
|
602
|
+
strokeLinecap="round"
|
|
603
|
+
strokeLinejoin="round"
|
|
604
|
+
/>
|
|
605
|
+
</g>
|
|
606
|
+
</svg>
|
|
607
|
+
);
|
|
608
|
+
case "LN":
|
|
609
|
+
return (
|
|
610
|
+
<svg width="48" height="48" viewBox="0 0 48 48">
|
|
611
|
+
<g fill="none" fillRule="evenodd">
|
|
612
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
613
|
+
<path
|
|
614
|
+
d="M20.836 29v-9.338h-1.778V29h1.778zm8.106 0v-4.774c0-1.316-.714-2.156-2.198-2.156-1.106 0-1.932.532-2.366 1.05v-.882H22.6V29h1.778v-4.55c.294-.406.84-.798 1.54-.798.756 0 1.246.322 1.246 1.26V29h1.778z"
|
|
615
|
+
fill="currentColor"
|
|
616
|
+
/>
|
|
617
|
+
</g>
|
|
618
|
+
</svg>
|
|
619
|
+
);
|
|
620
|
+
case "LOG":
|
|
621
|
+
return (
|
|
622
|
+
<svg width="48" height="48" viewBox="0 0 48 48">
|
|
623
|
+
<g fill="none" fillRule="evenodd">
|
|
624
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
625
|
+
<path
|
|
626
|
+
d="M16.776 29v-9.338h-1.778V29h1.778zm4.9.168c2.24 0 3.584-1.624 3.584-3.556 0-1.918-1.344-3.542-3.584-3.542-2.226 0-3.57 1.624-3.57 3.542 0 1.932 1.344 3.556 3.57 3.556zm0-1.582c-1.106 0-1.722-.91-1.722-1.974 0-1.05.616-1.96 1.722-1.96 1.106 0 1.736.91 1.736 1.96 0 1.064-.63 1.974-1.736 1.974zm7.672 4.158c1.666 0 3.654-.63 3.654-3.206v-6.3H31.21v.868c-.546-.686-1.274-1.036-2.086-1.036-1.708 0-2.982 1.232-2.982 3.444 0 2.254 1.288 3.444 2.982 3.444.826 0 1.554-.392 2.086-1.064v.686c0 1.33-1.008 1.708-1.862 1.708-.854 0-1.568-.238-2.114-.84l-.798 1.288c.854.742 1.75 1.008 2.912 1.008zm.336-4.368c-1.008 0-1.708-.7-1.708-1.862 0-1.162.7-1.862 1.708-1.862.588 0 1.232.322 1.526.77v2.184c-.294.434-.938.77-1.526.77z"
|
|
627
|
+
fill="currentColor"
|
|
628
|
+
/>
|
|
629
|
+
</g>
|
|
630
|
+
</svg>
|
|
631
|
+
);
|
|
632
|
+
case "LOG_N":
|
|
633
|
+
return (
|
|
634
|
+
<svg width="48" height="48" viewBox="0 0 48 48">
|
|
635
|
+
<g fill="none" fillRule="evenodd">
|
|
636
|
+
<path fill="none" d="M0 0h48v48H0z" />
|
|
637
|
+
<path
|
|
638
|
+
d="M30 28.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM32 30h4v4h-4v-4zM12.776 29v-9.338h-1.778V29h1.778zm4.9.168c2.24 0 3.584-1.624 3.584-3.556 0-1.918-1.344-3.542-3.584-3.542-2.226 0-3.57 1.624-3.57 3.542 0 1.932 1.344 3.556 3.57 3.556zm0-1.582c-1.106 0-1.722-.91-1.722-1.974 0-1.05.616-1.96 1.722-1.96 1.106 0 1.736.91 1.736 1.96 0 1.064-.63 1.974-1.736 1.974zm7.672 4.158c1.666 0 3.654-.63 3.654-3.206v-6.3H27.21v.868c-.546-.686-1.274-1.036-2.086-1.036-1.708 0-2.982 1.232-2.982 3.444 0 2.254 1.288 3.444 2.982 3.444.826 0 1.554-.392 2.086-1.064v.686c0 1.33-1.008 1.708-1.862 1.708-.854 0-1.568-.238-2.114-.84l-.798 1.288c.854.742 1.75 1.008 2.912 1.008zm.336-4.368c-1.008 0-1.708-.7-1.708-1.862 0-1.162.7-1.862 1.708-1.862.588 0 1.232.322 1.526.77v2.184c-.294.434-.938.77-1.526.77z"
|
|
639
|
+
fill="currentColor"
|
|
640
|
+
/>
|
|
641
|
+
</g>
|
|
642
|
+
</svg>
|
|
643
|
+
);
|
|
644
|
+
case "PERCENT":
|
|
645
|
+
return (
|
|
646
|
+
<svg
|
|
647
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
648
|
+
width="20"
|
|
649
|
+
height="20"
|
|
650
|
+
fill="currentColor"
|
|
651
|
+
viewBox="0 0 256 256"
|
|
652
|
+
>
|
|
653
|
+
<path d="M205.66,61.64l-144,144a8,8,0,0,1-11.32-11.32l144-144a8,8,0,0,1,11.32,11.31ZM50.54,101.44a36,36,0,0,1,50.92-50.91h0a36,36,0,0,1-50.92,50.91ZM56,76A20,20,0,1,0,90.14,61.84h0A20,20,0,0,0,56,76ZM216,180a36,36,0,1,1-10.54-25.46h0A35.76,35.76,0,0,1,216,180Zm-16,0a20,20,0,1,0-5.86,14.14A19.87,19.87,0,0,0,200,180Z" />
|
|
654
|
+
</svg>
|
|
655
|
+
);
|
|
656
|
+
case "CDOT":
|
|
657
|
+
return (
|
|
658
|
+
<svg
|
|
659
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
660
|
+
width="20"
|
|
661
|
+
height="20"
|
|
662
|
+
fill="currentColor"
|
|
663
|
+
viewBox="0 0 256 256"
|
|
664
|
+
>
|
|
665
|
+
<path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Z" />
|
|
666
|
+
</svg>
|
|
667
|
+
);
|
|
668
|
+
case "PI":
|
|
669
|
+
return (
|
|
670
|
+
<svg
|
|
671
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
672
|
+
width="20"
|
|
673
|
+
height="20"
|
|
674
|
+
fill="currentColor"
|
|
675
|
+
viewBox="0 0 256 256"
|
|
676
|
+
>
|
|
677
|
+
<path d="M232,172a36,36,0,0,1-72,0V72H96V200a8,8,0,0,1-16,0V72H72a40,40,0,0,0-40,40,8,8,0,0,1-16,0A56.06,56.06,0,0,1,72,56H224a8,8,0,0,1,0,16H176V172a20,20,0,0,0,40,0,8,8,0,0,1,16,0Z" />
|
|
678
|
+
</svg>
|
|
679
|
+
);
|
|
680
|
+
case "x":
|
|
681
|
+
// MATHEMATICAL ITALIC SMALL CHI
|
|
682
|
+
// https://en.wikipedia.org/wiki/Chi_(letter)#Mathematical_chi
|
|
683
|
+
return (
|
|
684
|
+
<svg
|
|
685
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
686
|
+
width="20"
|
|
687
|
+
height="20"
|
|
688
|
+
fill="currentColor"
|
|
689
|
+
viewBox="0 0 256 256"
|
|
690
|
+
>
|
|
691
|
+
<text
|
|
692
|
+
fontSize="200px"
|
|
693
|
+
x="50%"
|
|
694
|
+
y="50%"
|
|
695
|
+
dominantBaseline="middle"
|
|
696
|
+
textAnchor="middle"
|
|
697
|
+
>
|
|
698
|
+
𝜒
|
|
699
|
+
</text>
|
|
700
|
+
</svg>
|
|
701
|
+
);
|
|
702
|
+
case "X":
|
|
703
|
+
// MATHEMATICAL ITALIC CAPITAL CHI
|
|
704
|
+
// https://en.wikipedia.org/wiki/Chi_(letter)#Mathematical_chi
|
|
705
|
+
return (
|
|
706
|
+
<svg
|
|
707
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
708
|
+
width="20"
|
|
709
|
+
height="20"
|
|
710
|
+
fill="currentColor"
|
|
711
|
+
viewBox="0 0 256 256"
|
|
712
|
+
>
|
|
713
|
+
<text
|
|
714
|
+
fontSize="200px"
|
|
715
|
+
x="50%"
|
|
716
|
+
y="50%"
|
|
717
|
+
dominantBaseline="middle"
|
|
718
|
+
textAnchor="middle"
|
|
719
|
+
>
|
|
720
|
+
𝛸
|
|
721
|
+
</text>
|
|
722
|
+
</svg>
|
|
723
|
+
);
|
|
488
724
|
|
|
725
|
+
/**
|
|
726
|
+
* ANYTHING BELOW IS NOT YET HANDLED
|
|
727
|
+
*/
|
|
728
|
+
case "MANY":
|
|
729
|
+
case "FRAC_EXCLUSIVE":
|
|
730
|
+
case "THETA":
|
|
731
|
+
case "NOOP":
|
|
732
|
+
case "UP":
|
|
733
|
+
case "DOWN":
|
|
734
|
+
case "LEFT":
|
|
735
|
+
case "RIGHT":
|
|
736
|
+
case "JUMP_OUT_PARENTHESES":
|
|
737
|
+
case "JUMP_OUT_EXPONENT":
|
|
738
|
+
case "JUMP_OUT_BASE":
|
|
739
|
+
case "JUMP_INTO_NUMERATOR":
|
|
740
|
+
case "JUMP_OUT_NUMERATOR":
|
|
741
|
+
case "JUMP_OUT_DENOMINATOR":
|
|
742
|
+
case "PHI":
|
|
743
|
+
case "NTHROOT3":
|
|
744
|
+
case "POW":
|
|
745
|
+
case "LOG_B":
|
|
746
|
+
case "a":
|
|
747
|
+
case "b":
|
|
748
|
+
case "c":
|
|
749
|
+
case "d":
|
|
750
|
+
case "e":
|
|
751
|
+
case "f":
|
|
752
|
+
case "g":
|
|
753
|
+
case "h":
|
|
754
|
+
case "i":
|
|
755
|
+
case "j":
|
|
756
|
+
case "k":
|
|
757
|
+
case "l":
|
|
758
|
+
case "m":
|
|
759
|
+
case "n":
|
|
760
|
+
case "o":
|
|
761
|
+
case "p":
|
|
762
|
+
case "q":
|
|
763
|
+
case "r":
|
|
764
|
+
case "s":
|
|
765
|
+
case "t":
|
|
766
|
+
case "u":
|
|
767
|
+
case "v":
|
|
768
|
+
case "w":
|
|
769
|
+
case "y":
|
|
770
|
+
case "z":
|
|
771
|
+
case "A":
|
|
772
|
+
case "B":
|
|
773
|
+
case "C":
|
|
774
|
+
case "D":
|
|
775
|
+
case "E":
|
|
776
|
+
case "F":
|
|
777
|
+
case "G":
|
|
778
|
+
case "H":
|
|
779
|
+
case "I":
|
|
780
|
+
case "J":
|
|
781
|
+
case "K":
|
|
782
|
+
case "L":
|
|
783
|
+
case "M":
|
|
784
|
+
case "N":
|
|
785
|
+
case "O":
|
|
786
|
+
case "P":
|
|
787
|
+
case "Q":
|
|
788
|
+
case "R":
|
|
789
|
+
case "S":
|
|
790
|
+
case "T":
|
|
791
|
+
case "U":
|
|
792
|
+
case "V":
|
|
793
|
+
case "W":
|
|
794
|
+
case "Y":
|
|
795
|
+
case "Z":
|
|
796
|
+
// placeholder
|
|
797
|
+
return (
|
|
798
|
+
<svg
|
|
799
|
+
width="40"
|
|
800
|
+
height="40"
|
|
801
|
+
viewBox="0 0 40 40"
|
|
802
|
+
fill="black"
|
|
803
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
804
|
+
>
|
|
805
|
+
<text
|
|
806
|
+
y="20"
|
|
807
|
+
textLength="100%"
|
|
808
|
+
lengthAdjust="spacingAndGlyphs"
|
|
809
|
+
>
|
|
810
|
+
{id}
|
|
811
|
+
</text>
|
|
812
|
+
<text
|
|
813
|
+
y="35"
|
|
814
|
+
textLength="100%"
|
|
815
|
+
lengthAdjust="spacingAndGlyphs"
|
|
816
|
+
fill="red"
|
|
817
|
+
>
|
|
818
|
+
placeholder
|
|
819
|
+
</text>
|
|
820
|
+
</svg>
|
|
821
|
+
);
|
|
489
822
|
default:
|
|
490
|
-
|
|
823
|
+
// this line forces an exhaustive check of all keys;
|
|
824
|
+
// if a key is not handled, the compiler will complain.
|
|
825
|
+
const unhandledKey: never = id;
|
|
826
|
+
throw new Error(`Unhandled key: ${unhandledKey}`);
|
|
491
827
|
}
|
|
492
828
|
}
|