diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d6aa982..a60283d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,3 +13,4 @@ jobs: - run: bun run build - run: bun run lint --format=github - run: bun run fmt --check + - run: bun run are-the-types-wrong diff --git a/.oxfmtrc.json b/.oxfmtrc.json index a6a699f..8c31900 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -1,6 +1,5 @@ { "$schema": "./node_modules/oxfmt/configuration_schema.json", - "ignorePatterns": [], "printWidth": 100, "tabWidth": 2, "useTabs": false, @@ -15,6 +14,28 @@ "sortImports": { "newlinesBetween": false }, + "ignorePatterns": [ + // Hidden(ish) files + "**/.*", + // Generated + "*Parser.js", + // Binaries + "*.jpeg", + "*.jpg", + "*.png", + "*.svg", + "bun.lockb", + // Unsupported + "*.jison", + "*.toml", + "CNAME", + "*.go", + "go.mod", + "go.sum", + // Misc + "lerna.json", + "bun.lock" + ], "overrides": [{ "files": ["example/**/*.ts{,x}"], "options": { diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index ea5b8f5..0000000 --- a/.prettierignore +++ /dev/null @@ -1,24 +0,0 @@ -# Hidden(ish) files -**/.* - -# Generated -*Parser.js - -# Binaries -*.jpeg -*.jpg -*.png -*.svg -bun.lockb - -# Unsupported -*.jison -*.toml -CNAME -*.go -go.mod -go.sum - -# Misc -lerna.json -bun.lock diff --git a/README.md b/README.md index 85477c3..6f08e5b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Official [react-querybuilder](https://npmjs.com/package/react-querybuilder) comp ## Installation ```bash -npm i react-querybuilder @react-querybuilder/chakra @chakra-ui/icons@2 @chakra-ui/react@2 @chakra-ui/system@2 @emotion/react @emotion/styled framer-motion +npm i react-querybuilder @react-querybuilder/chakra2 @chakra-ui/icons@2 @chakra-ui/react@2 @chakra-ui/system@2 @emotion/react @emotion/styled framer-motion # OR yarn add / pnpm add / bun add ``` @@ -27,7 +27,7 @@ To configure the query builder to use Chakra-compatible components, place `Query ```tsx import { ChakraProvider, extendTheme } from '@chakra-ui/react'; -import { QueryBuilderChakra } from '@react-querybuilder/chakra'; +import { QueryBuilderChakra } from '@react-querybuilder/chakra2'; import { useState } from 'react'; import { type Field, QueryBuilder, type RuleGroupType } from 'react-querybuilder'; @@ -83,6 +83,7 @@ export function App() { | `ChakraActionElement` | `controlElements.actionElement` | | `ChakraDragHandle` | `controlElements.dragHandle` | | `ChakraNotToggle` | `controlElements.notToggle` | +| `ChakraShiftActions` | `controlElements.shiftActions` | | `ChakraValueEditor` | `controlElements.valueEditor` | | `ChakraValueSelector` | `controlElements.valueSelector` | diff --git a/bun.lock b/bun.lock index a88389f..e0dcb75 100644 --- a/bun.lock +++ b/bun.lock @@ -32,10 +32,6 @@ "peerDependencies": { "@chakra-ui/icons": "^2", "@chakra-ui/react": "^2", - "@chakra-ui/system": "^2", - "@emotion/react": "^11", - "@emotion/styled": "^11", - "framer-motion": "^11", "react": ">=18", "react-querybuilder": "^8", }, diff --git a/example/package.json b/example/package.json index 5d4281d..82b546b 100644 --- a/example/package.json +++ b/example/package.json @@ -2,11 +2,7 @@ "dependencies": { "@chakra-ui/icons": "^2", "@chakra-ui/react": "^2", - "@chakra-ui/system": "^2", - "@emotion/react": "^11", - "@emotion/styled": "^11", "@react-querybuilder/chakra2": "8.24.0", - "framer-motion": "^11", "react": "^18.3.1", "react-dom": "^18.3.1", "react-querybuilder": "8.24.0" diff --git a/package.json b/package.json index 87153ba..65d01c8 100644 --- a/package.json +++ b/package.json @@ -82,10 +82,6 @@ "peerDependencies": { "@chakra-ui/icons": "^2", "@chakra-ui/react": "^2", - "@chakra-ui/system": "^2", - "@emotion/react": "^11", - "@emotion/styled": "^11", - "framer-motion": "^11", "react": ">=18", "react-querybuilder": "^8" } diff --git a/prettier.config.mjs b/prettier.config.mjs deleted file mode 100644 index 21294ea..0000000 --- a/prettier.config.mjs +++ /dev/null @@ -1,20 +0,0 @@ -/** @type {import("prettier").Options} */ -export default { - printWidth: 100, - tabWidth: 2, - useTabs: false, - semi: true, - singleQuote: true, - trailingComma: 'es5', - bracketSpacing: true, - bracketSameLine: true, - arrowParens: 'avoid', - overrides: [ - { - files: 'example/**/*.!(css|scss)*', - options: { - printWidth: 80, - }, - }, - ], -}; diff --git a/src/ChakraActionElement.tsx b/src/ChakraActionElement.tsx index 4b7def1..5e68a4e 100644 --- a/src/ChakraActionElement.tsx +++ b/src/ChakraActionElement.tsx @@ -12,8 +12,8 @@ export const ChakraActionElement = ({ title, disabled, disabledTranslation, + testID, // Props that should not be in extraProps - testID: _testID, rules: _rules, level: _level, path: _path, @@ -24,6 +24,7 @@ export const ChakraActionElement = ({ ...extraProps }: ChakraActionProps): React.JSX.Element => (