Skip to content

Commit

Permalink
Merge pull request #336 from csandman/fix/switch-to-chakra-ui-react-i…
Browse files Browse the repository at this point in the history
…mports
  • Loading branch information
csandman authored Oct 9, 2024
2 parents c68d4a7 + f9822c4 commit 12d7cc6
Show file tree
Hide file tree
Showing 20 changed files with 1,402 additions and 1,889 deletions.
5 changes: 0 additions & 5 deletions .codesandbox/ci.json

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"unnamedComponents": "arrow-function"
}
],
"react/react-in-jsx-scope": "off",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/consistent-type-imports": [
"warn",
Expand Down
3,135 changes: 1,332 additions & 1,803 deletions package-lock.json

Large diffs are not rendered by default.

49 changes: 18 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
".": {
"module": "./dist/index.mjs",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"default": "./dist/index.js"
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
Expand All @@ -42,55 +41,43 @@
"start": "nodemon --watch src --exec npm run build -e ts,tsx"
},
"dependencies": {
"react-select": "5.8.0"
"react-select": "5.8.1"
},
"peerDependencies": {
"@chakra-ui/form-control": "^2.0.0",
"@chakra-ui/icon": "^3.0.0",
"@chakra-ui/layout": "^2.0.0",
"@chakra-ui/media-query": "^3.0.0",
"@chakra-ui/menu": "^2.0.0",
"@chakra-ui/spinner": "^2.0.0",
"@chakra-ui/system": "^2.0.0",
"@chakra-ui/react": "2.x",
"@emotion/react": "^11.8.1",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.4",
"@chakra-ui/form-control": "^2.2.0",
"@chakra-ui/icon": "^3.2.0",
"@chakra-ui/layout": "^2.3.1",
"@chakra-ui/media-query": "^3.3.0",
"@chakra-ui/menu": "^2.2.1",
"@chakra-ui/spinner": "^2.1.0",
"@chakra-ui/system": "^2.6.2",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@arethetypeswrong/cli": "^0.16.4",
"@chakra-ui/react": "^2.10.2",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/react": "^18.3.3",
"@types/react": "^18.3.11",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"concurrently": "^8.2.2",
"concurrently": "^9.0.1",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"nodemon": "^3.1.4",
"prettier": "^3.3.2",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"nodemon": "^3.1.7",
"prettier": "^3.3.3",
"prettier-package-json": "^2.8.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tsup": "^8.1.0",
"typescript": "^5.5.2"
"tsup": "^8.3.0",
"typescript": "^5.6.3"
},
"keywords": [
"accessibility",
Expand Down
6 changes: 2 additions & 4 deletions src/chakra-components/containers.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from "react";
import { Box } from "@chakra-ui/layout";
import type { SystemStyleObject } from "@chakra-ui/system";
import { useMultiStyleConfig } from "@chakra-ui/system";
import { Box, useMultiStyleConfig } from "@chakra-ui/react";
import type { SystemStyleObject } from "@chakra-ui/react";
import type {
ContainerProps,
GroupBase,
Expand Down
16 changes: 9 additions & 7 deletions src/chakra-components/control.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from "react";
import type { IconProps } from "@chakra-ui/icon";
import { Icon } from "@chakra-ui/icon";
import { Box, Divider } from "@chakra-ui/layout";
import { Spinner } from "@chakra-ui/spinner";
import { useMultiStyleConfig, useStyleConfig } from "@chakra-ui/system";
import type { SystemStyleObject } from "@chakra-ui/system";
import type { IconProps, SystemStyleObject } from "@chakra-ui/react";
import {
Box,
Divider,
Icon,
Spinner,
useMultiStyleConfig,
useStyleConfig,
} from "@chakra-ui/react";
import type {
ClearIndicatorProps,
ControlProps,
Expand Down
6 changes: 2 additions & 4 deletions src/chakra-components/input.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from "react";
import { Box } from "@chakra-ui/layout";
import type { SystemStyleObject } from "@chakra-ui/system";
import { chakra } from "@chakra-ui/system";
import { Box, chakra } from "@chakra-ui/react";
import type { SystemStyleObject } from "@chakra-ui/react";
import type { GroupBase, InputProps } from "react-select";
import { cleanCommonProps } from "../utils";

Expand Down
13 changes: 8 additions & 5 deletions src/chakra-components/menu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from "react";
import { Box } from "@chakra-ui/layout";
import { Menu as ChakraMenu, MenuIcon } from "@chakra-ui/menu";
import type { PropsOf, SystemStyleObject } from "@chakra-ui/system";
import { useColorModeValue, useMultiStyleConfig } from "@chakra-ui/system";
import {
Box,
Menu as ChakraMenu,
MenuIcon,
useColorModeValue,
useMultiStyleConfig,
} from "@chakra-ui/react";
import type { PropsOf, SystemStyleObject } from "@chakra-ui/react";
import type {
CoercedMenuPlacement,
GroupBase,
Expand Down
8 changes: 2 additions & 6 deletions src/chakra-components/multi-value.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React from "react";
import type { IconProps } from "@chakra-ui/icon";
import { Icon } from "@chakra-ui/icon";
import { Box } from "@chakra-ui/layout";
import type { SystemStyleObject } from "@chakra-ui/system";
import { chakra, useMultiStyleConfig } from "@chakra-ui/system";
import type { IconProps, SystemStyleObject } from "@chakra-ui/react";
import { Box, Icon, chakra, useMultiStyleConfig } from "@chakra-ui/react";
import type {
GroupBase,
MultiValueGenericProps,
Expand Down
5 changes: 2 additions & 3 deletions src/chakra-components/placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import { Box } from "@chakra-ui/layout";
import type { SystemStyleObject } from "@chakra-ui/system";
import { Box } from "@chakra-ui/react";
import type { SystemStyleObject } from "@chakra-ui/react";
import type { GroupBase, PlaceholderProps } from "react-select";

const Placeholder = <
Expand Down
5 changes: 2 additions & 3 deletions src/chakra-components/single-value.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import { Box } from "@chakra-ui/layout";
import type { SystemStyleObject } from "@chakra-ui/system";
import { Box } from "@chakra-ui/react";
import type { SystemStyleObject } from "@chakra-ui/react";
import type { GroupBase, SingleValueProps } from "react-select";

const SingleValue = <
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { SystemStyleObject } from "@chakra-ui/system";
import type { SystemStyleObject } from "@chakra-ui/react";
import type { GroupBase, StylesConfig, ThemeConfig } from "react-select";
import type {
ChakraStylesConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/select/async-creatable-select.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef } from "react";
import { forwardRef } from "react";
import type { MutableRefObject, ReactElement, RefAttributes } from "react";
import type { GroupBase, SelectInstance } from "react-select";
import AsyncCreatableReactSelect from "react-select/async-creatable";
Expand Down
2 changes: 1 addition & 1 deletion src/select/async-select.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef } from "react";
import { forwardRef } from "react";
import type { MutableRefObject, ReactElement, RefAttributes } from "react";
import type { GroupBase, SelectInstance } from "react-select";
import AsyncReactSelect from "react-select/async";
Expand Down
2 changes: 1 addition & 1 deletion src/select/creatable-select.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef } from "react";
import { forwardRef } from "react";
import type { MutableRefObject, ReactElement, RefAttributes } from "react";
import type { GroupBase, SelectInstance } from "react-select";
import CreatableReactSelect from "react-select/creatable";
Expand Down
2 changes: 1 addition & 1 deletion src/select/select.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef } from "react";
import { forwardRef } from "react";
import type { MutableRefObject, ReactElement, RefAttributes } from "react";
import ReactSelect from "react-select";
import type { GroupBase, Props, SelectInstance } from "react-select";
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
ResponsiveObject,
SystemStyleObject,
ThemeTypings,
} from "@chakra-ui/system";
} from "@chakra-ui/react";
import type {
ClearIndicatorProps,
ContainerProps,
Expand Down
3 changes: 1 addition & 2 deletions src/use-chakra-select-props.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useFormControl } from "@chakra-ui/form-control";
import { useTheme } from "@chakra-ui/system";
import { useFormControl, useTheme } from "@chakra-ui/react";
import type { GroupBase, Props } from "react-select";
import chakraComponents from "./chakra-components";
import type { SelectedOptionStyle } from "./types";
Expand Down
3 changes: 1 addition & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useBreakpointValue } from "@chakra-ui/media-query";
import { useTheme } from "@chakra-ui/system";
import { useBreakpointValue, useTheme } from "@chakra-ui/react";
import type { CommonPropsAndClassName, GroupBase } from "react-select";
import type { Size, SizeProp } from "./types";

Expand Down
24 changes: 16 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"lib": ["dom", "esnext"],
"target": "ESNext",
"module": "ESNext",
"lib": ["DOM", "ESNext"],
"declaration": true,
"sourceMap": true,
"moduleResolution": "node10",
"strict": true,
"isolatedModules": true,
"noFallthroughCasesInSwitch": true,
"jsx": "react-jsx",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "Bundler",
"isolatedModules": true,
"jsx": "react-jsx",
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src"],
Expand Down

0 comments on commit 12d7cc6

Please sign in to comment.