@wq/material-native 3.0.0-alpha.1 → 3.0.0-alpha.3

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 CHANGED
@@ -1,10 +1,6 @@
1
- module.exports = {
2
- env: {
3
- test: {
4
- plugins: [
5
- ["@babel/plugin-transform-private-methods", { loose: true }],
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,6 +1,9 @@
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: [],
5
8
  moduleNameMapper: {
6
9
  "@wq/material-native": "<rootDir>/src/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wq/material-native",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "React Native and Expo bindings for @wq/material",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -27,14 +27,15 @@
27
27
  "url": "https://github.com/wq/material/issues"
28
28
  },
29
29
  "homepage": "https://material.wq.io/@wq/material-native",
30
- "dependencies": {
31
- "@wq/react": "^3.0.0-alpha.0"
32
- },
33
30
  "peerDependencies": {
31
+ "@wq/react": "^3.0.0-beta.2",
34
32
  "react-native-paper": "*"
35
33
  },
36
34
  "devDependencies": {
37
- "jest-expo": "^52.0.6",
38
- "react-native-paper": "^5.14.5"
35
+ "@react-native/assets-registry": "^0.87.1",
36
+ "babel-preset-expo": "^57.0.13",
37
+ "expo": "^57.0.25",
38
+ "jest-expo": "^57.0.5",
39
+ "react-native-paper": "^5.15.3"
39
40
  }
40
41
  }
package/src/Root.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useMemo } from "react";
1
+ import { useMemo } from "react";
2
2
  import { withWQ } from "@wq/react";
3
3
  import {
4
4
  MD2LightTheme,
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { List } from "react-native-paper";
3
2
  import PropTypes from "prop-types";
4
3
  import { withWQ } from "@wq/react";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { useIcon, withWQ } from "@wq/react";
3
2
  import { Button as PaperButton, useTheme } from "react-native-paper";
4
3
  import PropTypes from "prop-types";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { useComponents, withWQ } from "@wq/react";
3
2
  import { useNav } from "./Link.js";
4
3
  import Button from "./Button.js";
@@ -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 = {
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { useIcon, withWQ } from "@wq/react";
3
2
  import { Chip as PaperChip, useTheme } from "react-native-paper";
4
3
  import PropTypes from "prop-types";
@@ -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, setOpen] = useState(false);
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 = () => setOpen(!open);
24
+ toggleOpen = () => setInternalOpen(!open);
24
25
  }
25
26
 
26
27
  return (
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { FAB } from "react-native-paper";
3
2
  import { useComponents, useIcon, withWQ } from "@wq/react";
4
3
  import { useNav } from "./Link.js";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Text, ScrollView } from "react-native";
3
2
  import PropTypes from "prop-types";
4
3
  import { withWQ } from "@wq/react";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Appbar } from "react-native-paper";
3
2
  import { useComponents, withWQ, createFallbackComponent } from "@wq/react";
4
3
  import { useNav } from "./Link.js";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { View } from "react-native";
3
2
  import PropTypes from "prop-types";
4
3
  import { withWQ } from "@wq/react";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { useIcon, withWQ } from "@wq/react";
3
2
  import { IconButton as PaperIconButton, useTheme } from "react-native-paper";
4
3
  import PropTypes from "prop-types";
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from "react";
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
  }
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { useComponents, withWQ, createFallbackComponent } from "@wq/react";
3
2
  import { Button } from "react-native";
4
3
  import PropTypes from "prop-types";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { useIcon, withWQ } from "@wq/react";
3
2
  import { List } from "react-native-paper";
4
3
  import PropTypes from "prop-types";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { useComponents, withWQ } from "@wq/react";
3
2
  import { useNav } from "./Link.js";
4
3
  import ListItem from "./ListItem.js";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Modal, Portal } from "react-native-paper";
3
2
  import PropTypes from "prop-types";
4
3
  import { withWQ } from "@wq/react";
@@ -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 = {
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { ScrollView as PaperScrollView } from "react-native";
3
2
  import { useTheme } from "react-native-paper";
4
3
  import PropTypes from "prop-types";
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from "react";
1
+ import { useState, useEffect } from "react";
2
2
  import { useComponents, withWQ } from "@wq/react";
3
3
  import { View } from "react-native";
4
4
  import { useTheme } from "react-native-paper";
@@ -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),
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { View } from "react-native";
3
2
  import { DataTable } from "react-native-paper";
4
3
  import PropTypes from "prop-types";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import {
3
2
  Text,
4
3
  Subheading,