@khanacademy/math-input 4.0.0 → 4.1.1
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/.eslintrc.js +7 -1
- package/CHANGELOG.md +14 -0
- package/dist/components/keypad/button.d.ts +1 -0
- package/dist/components/keypad/button.js.flow +1 -0
- package/dist/components/keypad/extras-page/index.d.ts +10 -0
- package/dist/components/keypad/extras-page/index.js.flow +15 -0
- package/dist/components/keypad/geometry-page/index.d.ts +2 -1
- package/dist/components/keypad/geometry-page/index.js.flow +2 -1
- package/dist/components/keypad/index.d.ts +9 -2
- package/dist/components/keypad/index.js.flow +9 -2
- package/dist/components/keypad/keypad-page-items.d.ts +8 -16
- package/dist/components/keypad/keypad-page-items.js.flow +11 -16
- package/dist/components/keypad/numbers-page/index.d.ts +2 -1
- package/dist/components/keypad/numbers-page/index.js.flow +2 -1
- package/dist/components/keypad/operators-page/advanced-relations-buttons.d.ts +2 -1
- package/dist/components/keypad/operators-page/advanced-relations-buttons.js.flow +2 -1
- package/dist/components/keypad/operators-page/basic-relations-buttons.d.ts +2 -1
- package/dist/components/keypad/operators-page/basic-relations-buttons.js.flow +2 -1
- package/dist/components/keypad/operators-page/index.d.ts +2 -1
- package/dist/components/keypad/operators-page/index.js.flow +2 -1
- package/dist/components/keypad/operators-page/logarithms-buttons.d.ts +2 -1
- package/dist/components/keypad/operators-page/logarithms-buttons.js.flow +2 -1
- package/dist/components/keypad/operators-page/pre-algebra-buttons.d.ts +2 -1
- package/dist/components/keypad/operators-page/pre-algebra-buttons.js.flow +2 -1
- package/dist/components/keypad-legacy/two-page-keypad.d.ts +6 -4
- package/dist/components/keypad-legacy/two-page-keypad.js.flow +6 -4
- package/dist/components/tabbar/tabbar.d.ts +6 -9
- package/dist/components/tabbar/tabbar.js.flow +6 -9
- package/dist/components/tabbar/types.d.ts +1 -1
- package/dist/components/tabbar/types.js.flow +1 -1
- package/dist/es/index.js +223 -154
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +223 -154
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.js.flow +1 -0
- package/package.json +2 -1
- package/src/components/keypad/__tests__/Button.test.tsx +51 -0
- package/src/components/keypad/__tests__/KeypadButton.test.tsx +41 -0
- package/src/components/keypad/__tests__/keypad-v2.cypress.ts +33 -0
- package/src/components/keypad/button-assets.tsx +33 -3
- package/src/components/keypad/button.tsx +7 -2
- package/src/components/keypad/extras-page/index.tsx +27 -0
- package/src/components/keypad/geometry-page/index.tsx +2 -1
- package/src/components/keypad/index.tsx +36 -8
- package/src/components/keypad/keypad-mathquill.stories.tsx +28 -15
- package/src/components/keypad/keypad-page-items.tsx +10 -18
- package/src/components/keypad/numbers-page/index.tsx +2 -1
- package/src/components/keypad/operators-page/advanced-relations-buttons.tsx +2 -1
- package/src/components/keypad/operators-page/basic-relations-buttons.tsx +2 -1
- package/src/components/keypad/operators-page/index.tsx +2 -1
- package/src/components/keypad/operators-page/logarithms-buttons.tsx +2 -1
- package/src/components/keypad/operators-page/pre-algebra-buttons.tsx +2 -1
- package/src/components/keypad-legacy/two-page-keypad.tsx +18 -6
- package/src/components/tabbar/__tests__/tabbar.test.tsx +36 -36
- package/src/components/tabbar/icons.tsx +68 -50
- package/src/components/tabbar/item.tsx +5 -1
- package/src/components/tabbar/tabbar.stories.tsx +23 -12
- package/src/components/tabbar/tabbar.tsx +22 -38
- package/src/components/tabbar/types.ts +1 -1
- package/src/types.ts +2 -0
- package/tsconfig-build.json +1 -2
- package/tsconfig-build.tsbuildinfo +1 -1
- package/dist/components/input/__tests__/test-math-wrapper.d.ts +0 -8
- package/dist/components/input/__tests__/test-math-wrapper.js.flow +0 -14
package/.eslintrc.js
CHANGED
|
@@ -6,7 +6,13 @@ module.exports = {
|
|
|
6
6
|
rules: {
|
|
7
7
|
"import/no-extraneous-dependencies": [
|
|
8
8
|
"error",
|
|
9
|
-
{
|
|
9
|
+
{
|
|
10
|
+
packageDir: [__dirname, path.join(__dirname, "../../")],
|
|
11
|
+
// note(matthewc): I changed this in a time pinch and I'm not sure
|
|
12
|
+
// it's right so I made a ticket to circle back to it
|
|
13
|
+
// https://khanacademy.atlassian.net/browse/LC-864
|
|
14
|
+
devDependencies: ["**/*.stories.tsx", "**/*.test.tsx"],
|
|
15
|
+
},
|
|
10
16
|
],
|
|
11
17
|
},
|
|
12
18
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @khanacademy/math-input
|
|
2
2
|
|
|
3
|
+
## 4.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 31ed8380: Add math-input v2 keypad tests
|
|
8
|
+
- 937d2308: Added basic Cypress testing for the v2 math-input keypad
|
|
9
|
+
|
|
10
|
+
## 4.1.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- a7f56710: add support for extraKeys to the v2 MathInput Keypad
|
|
15
|
+
- a7f56710: Make tabbar accept styles, create v2 keypad popover example
|
|
16
|
+
|
|
3
17
|
## 4.0.0
|
|
4
18
|
|
|
5
19
|
### Major Changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import Key from "../../../data/keys";
|
|
3
|
+
type Props = {
|
|
4
|
+
extraKeys: ReadonlyArray<Key>;
|
|
5
|
+
onClickKey: (keyConfig: string) => void;
|
|
6
|
+
};
|
|
7
|
+
export default class ExtrasPage extends React.Component<Props> {
|
|
8
|
+
render(): React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flowtype definitions for data
|
|
3
|
+
* Generated by Flowgen from a Typescript Definition
|
|
4
|
+
* Flowgen v1.21.0
|
|
5
|
+
* @flow
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import Key from "../../../data/keys";
|
|
9
|
+
declare type Props = {|
|
|
10
|
+
extraKeys: $ReadOnlyArray<Key>,
|
|
11
|
+
onClickKey: (keyConfig: string) => void,
|
|
12
|
+
|};
|
|
13
|
+
declare export default class ExtrasPage extends React.Component<Props> {
|
|
14
|
+
render(): React.Node;
|
|
15
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
};
|
|
5
6
|
export default class GeometryPage extends React.Component<Props> {
|
|
6
7
|
render(): React.ReactNode;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
|};
|
|
11
12
|
declare export default class GeometryPage extends React.Component<Props> {
|
|
12
13
|
render(): React.Node;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import Key from "../../data/keys";
|
|
3
|
+
import { ClickKeyCallback } from "../../types";
|
|
4
|
+
import { TabbarItemType } from "../tabbar/types";
|
|
2
5
|
import { NumbersPageOptions } from "./numbers-page/types";
|
|
3
6
|
import { OperatorsButtonSets } from "./operators-page/types";
|
|
4
|
-
import type { TabbarItemType } from "../tabbar/types";
|
|
5
7
|
export type Props = {
|
|
6
|
-
onClickKey:
|
|
8
|
+
onClickKey: ClickKeyCallback;
|
|
7
9
|
trigonometry?: boolean;
|
|
10
|
+
extraKeys: ReadonlyArray<Key>;
|
|
8
11
|
} & OperatorsButtonSets & NumbersPageOptions;
|
|
9
12
|
type State = {
|
|
10
13
|
selectedPage: TabbarItemType;
|
|
11
14
|
};
|
|
15
|
+
type DefaultProps = {
|
|
16
|
+
extraKeys: Props["extraKeys"];
|
|
17
|
+
};
|
|
12
18
|
export default class Keypad extends React.Component<Props, State> {
|
|
13
19
|
state: State;
|
|
20
|
+
static defaultProps: DefaultProps;
|
|
14
21
|
render(): React.ReactNode;
|
|
15
22
|
}
|
|
16
23
|
export {};
|
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
import Key from "../../data/keys";
|
|
9
|
+
import { ClickKeyCallback } from "../../types";
|
|
10
|
+
import { TabbarItemType } from "../tabbar/types";
|
|
8
11
|
import { NumbersPageOptions } from "./numbers-page/types";
|
|
9
12
|
import { OperatorsButtonSets } from "./operators-page/types";
|
|
10
|
-
import type { TabbarItemType } from "../tabbar/types";
|
|
11
13
|
export type Props = {|
|
|
12
14
|
...{|
|
|
13
|
-
onClickKey:
|
|
15
|
+
onClickKey: ClickKeyCallback,
|
|
14
16
|
trigonometry?: boolean,
|
|
17
|
+
extraKeys: $ReadOnlyArray<Key>,
|
|
15
18
|
|},
|
|
16
19
|
...OperatorsButtonSets,
|
|
17
20
|
...NumbersPageOptions,
|
|
@@ -19,7 +22,11 @@ export type Props = {|
|
|
|
19
22
|
declare type State = {|
|
|
20
23
|
selectedPage: TabbarItemType,
|
|
21
24
|
|};
|
|
25
|
+
declare type DefaultProps = {|
|
|
26
|
+
extraKeys: $PropertyType<Props, "extraKeys">,
|
|
27
|
+
|};
|
|
22
28
|
declare export default class Keypad extends React.Component<Props, State> {
|
|
23
29
|
state: State;
|
|
30
|
+
static defaultProps: DefaultProps;
|
|
24
31
|
render(): React.Node;
|
|
25
32
|
}
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { KeyConfig } from "../../types";
|
|
2
|
+
import { KeyConfig, ClickKeyCallback } from "../../types";
|
|
3
3
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
4
4
|
type KeypadPageContainerProps = {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
};
|
|
7
7
|
export declare const KeypadPageContainer: ({ children, }: KeypadPageContainerProps) => React.ReactElement;
|
|
8
|
-
|
|
9
|
-
keyConfig: KeyConfig;
|
|
10
|
-
tintColor?: string;
|
|
11
|
-
style?: StyleType;
|
|
12
|
-
onClickKey: (keyConfig: string) => void;
|
|
13
|
-
};
|
|
14
|
-
export declare const KeypadButton: ({ keyConfig, onClickKey, tintColor, style, }: KeypadButtonProps) => React.ReactElement;
|
|
15
|
-
type SecondaryKeypadButtonProps = {
|
|
8
|
+
type SharedButtonProps = {
|
|
16
9
|
keyConfig: KeyConfig;
|
|
17
10
|
style?: StyleType;
|
|
18
|
-
onClickKey:
|
|
11
|
+
onClickKey: ClickKeyCallback;
|
|
19
12
|
};
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
keyConfig: KeyConfig;
|
|
23
|
-
style?: StyleType;
|
|
24
|
-
onClickKey: (keyConfig: string) => void;
|
|
13
|
+
export type KeypadButtonProps = SharedButtonProps & {
|
|
14
|
+
tintColor?: string;
|
|
25
15
|
};
|
|
26
|
-
export declare const
|
|
16
|
+
export declare const KeypadButton: ({ keyConfig, onClickKey, tintColor, style, }: KeypadButtonProps) => React.ReactElement;
|
|
17
|
+
export declare const SecondaryKeypadButton: ({ keyConfig, onClickKey, style, }: SharedButtonProps) => React.ReactElement;
|
|
18
|
+
export declare const KeypadActionButton: ({ keyConfig, onClickKey, style, }: SharedButtonProps) => React.ReactElement;
|
|
27
19
|
/**
|
|
28
20
|
* A placeholder button for the keypad. Optional count prop to render multiple
|
|
29
21
|
* buttons. Defaults to 1.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
-
import { KeyConfig } from "../../types";
|
|
8
|
+
import { KeyConfig, ClickKeyCallback } from "../../types";
|
|
9
9
|
import type { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
10
10
|
declare type KeypadPageContainerProps = {|
|
|
11
11
|
children: React.Node,
|
|
@@ -13,28 +13,23 @@ declare type KeypadPageContainerProps = {|
|
|
|
13
13
|
declare export var KeypadPageContainer: (
|
|
14
14
|
x: KeypadPageContainerProps
|
|
15
15
|
) => React.Element<any>;
|
|
16
|
-
|
|
16
|
+
declare type SharedButtonProps = {|
|
|
17
17
|
keyConfig: KeyConfig,
|
|
18
|
-
tintColor?: string,
|
|
19
18
|
style?: StyleType,
|
|
20
|
-
onClickKey:
|
|
19
|
+
onClickKey: ClickKeyCallback,
|
|
21
20
|
|};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
export type KeypadButtonProps = {|
|
|
22
|
+
...SharedButtonProps,
|
|
23
|
+
...{|
|
|
24
|
+
tintColor?: string,
|
|
25
|
+
|},
|
|
27
26
|
|};
|
|
27
|
+
declare export var KeypadButton: (x: KeypadButtonProps) => React.Element<any>;
|
|
28
28
|
declare export var SecondaryKeypadButton: (
|
|
29
|
-
x:
|
|
29
|
+
x: SharedButtonProps
|
|
30
30
|
) => React.Element<any>;
|
|
31
|
-
declare type KeypadActionButtonProps = {|
|
|
32
|
-
keyConfig: KeyConfig,
|
|
33
|
-
style?: StyleType,
|
|
34
|
-
onClickKey: (keyConfig: string) => void,
|
|
35
|
-
|};
|
|
36
31
|
declare export var KeypadActionButton: (
|
|
37
|
-
x:
|
|
32
|
+
x: SharedButtonProps
|
|
38
33
|
) => React.Element<any>;
|
|
39
34
|
/**
|
|
40
35
|
* A placeholder button for the keypad. Optional count prop to render multiple
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
import { NumbersPageOptions } from "./types";
|
|
3
4
|
type Props = {
|
|
4
|
-
onClickKey:
|
|
5
|
+
onClickKey: ClickKeyCallback;
|
|
5
6
|
} & NumbersPageOptions;
|
|
6
7
|
export default class NumbersPage extends React.Component<Props> {
|
|
7
8
|
render(): React.ReactNode;
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
import { NumbersPageOptions } from "./types";
|
|
9
10
|
declare type Props = {|
|
|
10
11
|
...{|
|
|
11
|
-
onClickKey:
|
|
12
|
+
onClickKey: ClickKeyCallback,
|
|
12
13
|
|},
|
|
13
14
|
...NumbersPageOptions,
|
|
14
15
|
|};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
placeholder?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const AdvancedRelations: ({ onClickKey, placeholder, }: Props) => React.ReactElement;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
placeholder?: boolean,
|
|
11
12
|
|};
|
|
12
13
|
declare export var AdvancedRelations: (x: Props) => React.ReactElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
placeholder?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const BasicRelations: ({ onClickKey, placeholder, }: Props) => React.ReactElement;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
placeholder?: boolean,
|
|
11
12
|
|};
|
|
12
13
|
declare export var BasicRelations: (x: Props) => React.ReactElement;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
import { OperatorsButtonSets } from "./types";
|
|
3
4
|
type Props = {
|
|
4
|
-
onClickKey:
|
|
5
|
+
onClickKey: ClickKeyCallback;
|
|
5
6
|
} & OperatorsButtonSets;
|
|
6
7
|
export default class OperatorsPage extends React.Component<Props> {
|
|
7
8
|
render(): React.ReactNode;
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
import { OperatorsButtonSets } from "./types";
|
|
9
10
|
declare type Props = {|
|
|
10
11
|
...{|
|
|
11
|
-
onClickKey:
|
|
12
|
+
onClickKey: ClickKeyCallback,
|
|
12
13
|
|},
|
|
13
14
|
...OperatorsButtonSets,
|
|
14
15
|
|};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
placeholder?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const Logarithms: ({ onClickKey, placeholder, }: Props) => React.ReactElement;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
placeholder?: boolean,
|
|
11
12
|
|};
|
|
12
13
|
declare export var Logarithms: (x: Props) => React.ReactElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ClickKeyCallback } from "../../../types";
|
|
2
3
|
type Props = {
|
|
3
|
-
onClickKey:
|
|
4
|
+
onClickKey: ClickKeyCallback;
|
|
4
5
|
placeholder?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare const PreAlgebra: ({ onClickKey, placeholder, }: Props) => React.ReactElement;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { ClickKeyCallback } from "../../../types";
|
|
8
9
|
declare type Props = {|
|
|
9
|
-
onClickKey:
|
|
10
|
+
onClickKey: ClickKeyCallback,
|
|
10
11
|
placeholder?: boolean,
|
|
11
12
|
|};
|
|
12
13
|
declare export var PreAlgebra: (x: Props) => React.ReactElement;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* A keypad with two pages of keys.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
+
import { TabbarItemType } from "../tabbar/types";
|
|
5
6
|
interface ReduxProps {
|
|
6
7
|
paginationEnabled: boolean;
|
|
7
8
|
}
|
|
@@ -9,10 +10,11 @@ interface Props extends ReduxProps {
|
|
|
9
10
|
leftPage: React.ReactNode;
|
|
10
11
|
rightPage: React.ReactNode;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
type State = {
|
|
14
|
+
selectedPage: TabbarItemType;
|
|
15
|
+
};
|
|
16
|
+
declare class TwoPageKeypad extends React.Component<Props, State> {
|
|
17
|
+
state: State;
|
|
16
18
|
render(): JSX.Element;
|
|
17
19
|
}
|
|
18
20
|
declare const _default: import("react-redux").ConnectedComponent<typeof TwoPageKeypad, import("react-redux").Omit<React.ClassAttributes<TwoPageKeypad> & Props, "paginationEnabled">>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as $Flowgen$Import$react_2d_redux from "react-redux";
|
|
8
8
|
import * as React from "react";
|
|
9
|
+
import { TabbarItemType } from "../tabbar/types";
|
|
9
10
|
declare interface ReduxProps {
|
|
10
11
|
paginationEnabled: boolean;
|
|
11
12
|
}
|
|
@@ -13,10 +14,11 @@ declare type Props = {
|
|
|
13
14
|
leftPage: React.Node,
|
|
14
15
|
rightPage: React.Node,
|
|
15
16
|
} & ReduxProps;
|
|
16
|
-
declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
declare type State = {|
|
|
18
|
+
selectedPage: TabbarItemType,
|
|
19
|
+
|};
|
|
20
|
+
declare class TwoPageKeypad extends React.Component<Props, State> {
|
|
21
|
+
state: State;
|
|
20
22
|
render(): React$Node;
|
|
21
23
|
}
|
|
22
24
|
declare var _default: $Flowgen$Import$react_2d_redux.ConnectedComponent<
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
+
import { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
import
|
|
3
|
-
type TabbarState = {
|
|
4
|
-
selectedItem: number;
|
|
5
|
-
};
|
|
3
|
+
import { TabbarItemType } from "./types";
|
|
6
4
|
type Props = {
|
|
7
5
|
items: ReadonlyArray<TabbarItemType>;
|
|
8
|
-
|
|
6
|
+
selectedItem: TabbarItemType;
|
|
7
|
+
onSelectItem: (item: TabbarItemType) => void;
|
|
8
|
+
style?: StyleType;
|
|
9
9
|
};
|
|
10
|
-
declare
|
|
11
|
-
state: TabbarState;
|
|
12
|
-
render(): React.ReactNode;
|
|
13
|
-
}
|
|
10
|
+
declare function Tabbar(props: Props): React.ReactElement;
|
|
14
11
|
export default Tabbar;
|
|
@@ -4,17 +4,14 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
+
import { StyleType } from "@khanacademy/wonder-blocks-core";
|
|
7
8
|
import * as React from "react";
|
|
8
|
-
import
|
|
9
|
-
declare type TabbarState = {|
|
|
10
|
-
selectedItem: number,
|
|
11
|
-
|};
|
|
9
|
+
import { TabbarItemType } from "./types";
|
|
12
10
|
declare type Props = {|
|
|
13
11
|
items: $ReadOnlyArray<TabbarItemType>,
|
|
14
|
-
|
|
12
|
+
selectedItem: TabbarItemType,
|
|
13
|
+
onSelectItem: (item: TabbarItemType) => void,
|
|
14
|
+
style?: StyleType,
|
|
15
15
|
|};
|
|
16
|
-
declare
|
|
17
|
-
state: TabbarState;
|
|
18
|
-
render(): React.Node;
|
|
19
|
-
}
|
|
16
|
+
declare function Tabbar(props: Props): React.Element<any>;
|
|
20
17
|
declare export default typeof Tabbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TabbarItemType = "Geometry" | "Operators" | "Numbers";
|
|
1
|
+
export type TabbarItemType = "Geometry" | "Operators" | "Numbers" | "Extras";
|