@wq/material-native 3.0.0-alpha.0 → 3.0.0-alpha.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.
- package/babel.config.cjs +5 -9
- package/jest.config.js +6 -0
- package/package.json +7 -4
- package/src/Root.js +1 -1
- package/src/components/Accordion.js +0 -1
- package/src/components/Alert.js +3 -0
- package/src/components/Button.js +0 -1
- package/src/components/ButtonLink.js +0 -1
- package/src/components/CheckboxButton.js +1 -2
- package/src/components/Chip.js +0 -1
- package/src/components/CircularProgress.js +3 -0
- package/src/components/ExpandableListItem.js +3 -2
- package/src/components/Fab.js +0 -1
- package/src/components/FormatJson.js +0 -1
- package/src/components/Header.js +0 -1
- package/src/components/HorizontalView.js +0 -1
- package/src/components/IconButton.js +0 -1
- package/src/components/Img.js +2 -1
- package/src/components/LinearProgress.js +3 -0
- package/src/components/Link.js +0 -1
- package/src/components/ListItem.js +0 -1
- package/src/components/ListItemLink.js +0 -1
- package/src/components/Popup.js +0 -1
- package/src/components/RadioButton.js +1 -2
- package/src/components/ScrollView.js +0 -1
- package/src/components/SidePanel.js +1 -1
- package/src/components/Skeleton.js +3 -0
- package/src/components/Switch.js +1 -2
- package/src/components/TabGroup.js +1 -0
- package/src/components/TableCell.js +0 -1
- package/src/components/Typography.js +0 -1
- package/src/components/index.js +7 -0
package/babel.config.cjs
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
],
|
|
7
|
-
presets: ["module:metro-react-native-babel-preset"],
|
|
8
|
-
},
|
|
9
|
-
},
|
|
1
|
+
module.exports = function (api) {
|
|
2
|
+
api.cache(true);
|
|
3
|
+
return {
|
|
4
|
+
presets: ["babel-preset-expo"],
|
|
5
|
+
};
|
|
10
6
|
};
|
package/jest.config.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
preset: "jest-expo",
|
|
3
3
|
testMatch: ["**/__tests__/**/*.js?(x)"],
|
|
4
|
+
transform: {
|
|
5
|
+
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest",
|
|
6
|
+
},
|
|
4
7
|
transformIgnorePatterns: [],
|
|
8
|
+
moduleNameMapper: {
|
|
9
|
+
"@wq/material-native": "<rootDir>/src/index.js",
|
|
10
|
+
},
|
|
5
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wq/material-native",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"description": "React Native and Expo bindings for @wq/material",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -28,13 +28,16 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://material.wq.io/@wq/material-native",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@wq/react": "^3.0.0-
|
|
31
|
+
"@wq/react": "^3.0.0-beta.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react-native-paper": "*"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
37
|
+
"@react-native/assets-registry": "^0.87.1",
|
|
38
|
+
"babel-preset-expo": "^57.0.13",
|
|
39
|
+
"expo": "^57.0.25",
|
|
40
|
+
"jest-expo": "^57.0.5",
|
|
41
|
+
"react-native-paper": "^5.15.3"
|
|
39
42
|
}
|
|
40
43
|
}
|
package/src/Root.js
CHANGED
package/src/components/Button.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Checkbox, useTheme } from "react-native-paper";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { withWQ } from "@wq/react";
|
|
@@ -18,7 +17,7 @@ function CheckboxButton({ checked, color, ...props }) {
|
|
|
18
17
|
} else if (color === "secondary") {
|
|
19
18
|
color = theme.colors.accent;
|
|
20
19
|
}
|
|
21
|
-
return <Checkbox status={status} {...props} />;
|
|
20
|
+
return <Checkbox status={status} color={color} {...props} />;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
CheckboxButton.propTypes = {
|
package/src/components/Chip.js
CHANGED
|
@@ -12,15 +12,16 @@ function ExpandableListItem({
|
|
|
12
12
|
...rest
|
|
13
13
|
}) {
|
|
14
14
|
const Icon = useIcon(icon),
|
|
15
|
+
// eslint-disable-next-line @eslint-react/no-children-to-array
|
|
15
16
|
[summary, ...details] = React.Children.toArray(children),
|
|
16
|
-
[internalOpen,
|
|
17
|
+
[internalOpen, setInternalOpen] = useState(false);
|
|
17
18
|
|
|
18
19
|
let toggleOpen;
|
|
19
20
|
if (open === false || open || onToggle) {
|
|
20
21
|
toggleOpen = () => onToggle(!open);
|
|
21
22
|
} else {
|
|
22
23
|
open = internalOpen;
|
|
23
|
-
toggleOpen = () =>
|
|
24
|
+
toggleOpen = () => setInternalOpen(!open);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
return (
|
package/src/components/Fab.js
CHANGED
package/src/components/Header.js
CHANGED
package/src/components/Img.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
2
|
import { Image, TouchableOpacity, Dimensions } from "react-native";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { withWQ } from "@wq/react";
|
|
@@ -10,6 +10,7 @@ function Img({ src, onPress, onClick, style, ...props }) {
|
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
if (typeof src !== "string") {
|
|
13
|
+
// eslint-disable-next-line @eslint-react/set-state-in-effect
|
|
13
14
|
setSource(src);
|
|
14
15
|
return;
|
|
15
16
|
}
|
package/src/components/Link.js
CHANGED
package/src/components/Popup.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { RadioButton as PaperRadioButton, useTheme } from "react-native-paper";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { withWQ } from "@wq/react";
|
|
@@ -18,7 +17,7 @@ function RadioButton({ checked, color, ...rest }) {
|
|
|
18
17
|
} else if (color === "secondary") {
|
|
19
18
|
color = theme.colors.accent;
|
|
20
19
|
}
|
|
21
|
-
return <PaperRadioButton status={status} {...rest} />;
|
|
20
|
+
return <PaperRadioButton status={status} color={color} {...rest} />;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
RadioButton.propTypes = {
|
package/src/components/Switch.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Switch as PaperSwitch, useTheme } from "react-native-paper";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { withWQ } from "@wq/react";
|
|
@@ -10,7 +9,7 @@ function Switch({ checked: value, color, ...rest }) {
|
|
|
10
9
|
} else if (color === "secondary") {
|
|
11
10
|
color = theme.colors.accent;
|
|
12
11
|
}
|
|
13
|
-
return <PaperSwitch value={value} {...rest} />;
|
|
12
|
+
return <PaperSwitch value={value} color={color} {...rest} />;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
Switch.propTypes = {
|
|
@@ -5,6 +5,7 @@ import { SegmentedButtons } from "react-native-paper";
|
|
|
5
5
|
import PropTypes from "prop-types";
|
|
6
6
|
|
|
7
7
|
function TabGroup({ children, style, ...rest }) {
|
|
8
|
+
// eslint-disable-next-line @eslint-react/no-children-to-array
|
|
8
9
|
const tabs = React.Children.toArray(children),
|
|
9
10
|
[value, setValue] = useState(tabs[0].props.value),
|
|
10
11
|
activeTab = tabs.find((tab) => tab.props.value === value),
|
package/src/components/index.js
CHANGED
|
@@ -55,6 +55,11 @@ import Grid from "./Grid.js";
|
|
|
55
55
|
import Menu from "./Menu.js";
|
|
56
56
|
import MenuItem from "./MenuItem.js";
|
|
57
57
|
|
|
58
|
+
import Alert from "./Alert.js";
|
|
59
|
+
import CircularProgress from "./CircularProgress.js";
|
|
60
|
+
import LinearProgress from "./LinearProgress.js";
|
|
61
|
+
import Skeleton from "./Skeleton.js";
|
|
62
|
+
|
|
58
63
|
export {
|
|
59
64
|
Container,
|
|
60
65
|
Header,
|
|
@@ -113,3 +118,5 @@ export {
|
|
|
113
118
|
export { Popup, SidePanel, Breadcrumbs, Pagination };
|
|
114
119
|
|
|
115
120
|
export { Badge, Grid, Menu, MenuItem };
|
|
121
|
+
|
|
122
|
+
export { Alert, CircularProgress, LinearProgress, Skeleton };
|