Skip to content

Commit c068e44

Browse files
build(babel): 👷 fix build errors (#82)
1 parent 8c25246 commit c068e44

File tree

10 files changed

+1074
-1145
lines changed

10 files changed

+1074
-1145
lines changed

babel.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ module.exports = function (api) {
1111
"@babel/env",
1212
{
1313
modules: isCommonJS ? "commonjs" : false,
14+
loose: true,
1415
targets: {
1516
esmodules: isESM ? true : undefined,
1617
},
1718
},
1819
],
19-
"@babel/preset-typescript",
2020
"@babel/preset-react",
21+
"@babel/preset-typescript",
2122
];
2223

2324
const plugins = [
24-
"@chakra-ui/babel-plugin",
25-
"@babel/plugin-proposal-class-properties",
25+
["@babel/plugin-proposal-class-properties", { loose: true }],
2626
isBuild
2727
? [
2828
"babel-plugin-jsx-remove-data-test-id",

package.json

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67,48 +67,47 @@
6767
"reakit": "^1.3.5"
6868
},
6969
"devDependencies": {
70-
"@babel/cli": "7.12.16",
71-
"@babel/core": "^7.12.16",
72-
"@babel/plugin-proposal-class-properties": "7.12.13",
73-
"@babel/preset-env": "7.12.16",
70+
"@babel/cli": "7.13.0",
71+
"@babel/core": "^7.13.1",
72+
"@babel/plugin-proposal-class-properties": "7.13.0",
73+
"@babel/preset-env": "7.13.5",
7474
"@babel/preset-react": "7.12.13",
75-
"@babel/preset-typescript": "7.12.16",
76-
"@chakra-ui/babel-plugin": "1.0.0",
77-
"@commitlint/cli": "^11.0.0",
78-
"@commitlint/config-conventional": "^11.0.0",
79-
"@storybook/addon-a11y": "^6.1.18",
80-
"@storybook/addon-actions": "^6.1.18",
81-
"@storybook/addon-essentials": "^6.1.18",
82-
"@storybook/addon-links": "^6.1.18",
83-
"@storybook/react": "^6.1.18",
84-
"@testing-library/dom": "^7.29.4",
75+
"@babel/preset-typescript": "7.13.0",
76+
"@commitlint/cli": "^12.0.0",
77+
"@commitlint/config-conventional": "^12.0.0",
78+
"@storybook/addon-a11y": "^6.1.20",
79+
"@storybook/addon-actions": "^6.1.20",
80+
"@storybook/addon-essentials": "^6.1.20",
81+
"@storybook/addon-links": "^6.1.20",
82+
"@storybook/react": "^6.1.20",
83+
"@testing-library/dom": "^7.29.6",
8584
"@testing-library/jest-dom": "^5.11.9",
8685
"@testing-library/react": "^11.2.5",
8786
"@testing-library/react-hooks": "^5.0.3",
88-
"@testing-library/user-event": "^12.7.1",
87+
"@testing-library/user-event": "^12.7.3",
8988
"@types/jest": "^26.0.20",
9089
"@types/jest-axe": "^3.5.1",
91-
"@types/node": "^14.14.28",
90+
"@types/node": "^14.14.31",
9291
"@types/react": "^17.0.2",
9392
"@types/react-dom": "^17.0.1",
9493
"@types/testing-library__jest-dom": "^5.9.5",
95-
"@typescript-eslint/eslint-plugin": "^4.15.1",
96-
"@typescript-eslint/parser": "^4.15.1",
94+
"@typescript-eslint/eslint-plugin": "^4.15.2",
95+
"@typescript-eslint/parser": "^4.15.2",
9796
"all-contributors-cli": "^6.20.0",
9897
"autoprefixer": "9.8.6",
9998
"babel-eslint": "^10.1.0",
10099
"babel-jest": "^26.6.3",
101100
"babel-loader": "^8.2.2",
102101
"babel-plugin-jsx-remove-data-test-id": "^3.0.0",
103-
"concurrently": "^5.3.0",
102+
"concurrently": "^6.0.0",
104103
"conventional-github-releaser": "^3.1.5",
105104
"cross-env": "^7.0.3",
106105
"date-fns": "^2.17.0",
107106
"deepmerge": "^4.2.2",
108107
"eslint": "^7.20.0",
109-
"eslint-config-prettier": "^7.2.0",
108+
"eslint-config-prettier": "^8.0.0",
110109
"eslint-config-react-app": "^6.0.0",
111-
"eslint-plugin-flowtype": "^5.2.0",
110+
"eslint-plugin-flowtype": "^5.3.1",
112111
"eslint-plugin-import": "^2.22.1",
113112
"eslint-plugin-jest": "^24.1.5",
114113
"eslint-plugin-jsx-a11y": "^6.4.1",
@@ -121,20 +120,20 @@
121120
"jest": "^26.6.3",
122121
"jest-axe": "^4.1.0",
123122
"lint-staged": "^10.5.4",
124-
"lodash": "^4.17.20",
123+
"lodash": "^4.17.21",
125124
"postcss": "^7.0.35",
126125
"prettier": "^2.2.1",
127126
"react": "^17.0.1",
128127
"react-dom": "^17.0.1",
129128
"react-icons": "^4.2.0",
130129
"reakit-test-utils": "^0.15.1",
131130
"rimraf": "^3.0.2",
132-
"sort-package-json": "^1.48.1",
133-
"standard-version": "^9.1.0",
131+
"sort-package-json": "^1.49.0",
132+
"standard-version": "^9.1.1",
134133
"tailwindcss": "npm:@tailwindcss/postcss7-compat@2.0.3",
135134
"ts-node": "^9.1.1",
136135
"tsd": "^0.14.0",
137-
"typescript": "^4.1.5"
136+
"typescript": "^4.2.2"
138137
},
139138
"peer-dependencies": {
140139
"react": "16.x || 17.x",

src/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ export * from "./badge";
44
export * from "./box";
55
export * from "./button";
66
export * from "./calendar";
7+
export * from "./checkbox";
8+
export * from "./circular-progress";
79
export * from "./datepicker";
10+
export * from "./hooks";
811
export * from "./icon";
912
export * from "./icons";
13+
export * from "./progress";
14+
export * from "./radio";
15+
export * from "./slider";
1016
export * from "./spinner";
17+
export * from "./switch";
1118
export * from "./tag";
1219
export * from "./theme";
1320
export * from "./theme/types";

src/radio/Radio.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ import { forwardRefWithAs, RenderProp } from "../utils/types";
1111

1212
export type RadioStateContext = RadioInitialState;
1313

14-
const [RadioStateProvider, useRadioState] = createContext<RadioStateContext>({
14+
const [
15+
RadioStateProvider,
16+
useRadioStateContext,
17+
] = createContext<RadioStateContext>({
1518
errorMessage: "RadioState must be used within RadioStateProvider",
1619
name: "RadioState",
1720
strict: false,
1821
});
1922

20-
export { useRadioState };
23+
export { useRadioStateContext };
2124

2225
export type RadioPropsContext = RadioInitialProps &
2326
Pick<RadioGroupProps, "size">;

src/radio/RadioIcon.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import { useTheme } from "../index";
1010
import { Box, BoxProps } from "../box";
1111
import { forwardRefWithAs } from "../utils/types";
12-
import { RadioProps, useRadioProps, useRadioState } from "./Radio";
12+
import { RadioProps, useRadioProps, useRadioStateContext } from "./Radio";
1313

1414
export type RadioIconProps = BoxProps &
1515
Pick<RadioProps, "value" | "disabled"> & {
@@ -25,7 +25,7 @@ export const RadioIcon = forwardRefWithAs<
2525
>((props, ref) => {
2626
const { className, children, ...rest } = props;
2727
const { value, disabled, size = "md" } = useRadioProps();
28-
const { state } = useRadioState();
28+
const { state } = useRadioStateContext();
2929
const stateProp = state === value;
3030

3131
const theme = useTheme();

src/radio/RadioInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { RadioProps as ReakitRadioProps, Radio as ReakitRadio } from "reakit";
44

55
import { useTheme } from "../theme";
66
import { forwardRefWithAs } from "../utils/types";
7-
import { useRadioProps, useRadioState } from "./Radio";
7+
import { useRadioProps, useRadioStateContext } from "./Radio";
88

99
export type RadioInputProps = Partial<ReakitRadioProps> & {};
1010

1111
export const RadioInput = forwardRefWithAs<RadioInputProps>((props, ref) => {
1212
const { className, ...rest } = props;
13-
const state = useRadioState();
13+
const state = useRadioStateContext();
1414
const {
1515
size,
1616
checkedIcon,

src/slider/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from "./Slider";
2+
export * from "./SliderThumb";
3+
export * from "./SliderTrack";

src/switch/Switch.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ import { BoxProps } from "../box";
77
import { SwitchIcon } from "./SwitchIcon";
88
import { SwitchLabel } from "./SwitchLabel";
99
import { SwitchInput } from "./SwitchInput";
10+
import { CheckboxStatus } from "../checkbox";
1011
import { createContext, runIfFn } from "../utils";
1112
import { forwardRefWithAs, RenderProp } from "../utils/types";
1213

13-
export type CheckboxStatus = CheckboxStateReturn["state"];
14-
1514
export type SwitchContext = {
1615
state: ReakitCheckboxOptions;
1716
size: SwitchProps["size"];

src/theme/theme.test-d.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { expectAssignable, expectType } from "tsd";
2+
23
import theme from "./defaultTheme";
34

45
// TODO: Test global renderlesskit namespace
@@ -14,15 +15,16 @@ expectType<Renderlesskit.GetThemeValue<"button", "variant">>({
1415
outline: "",
1516
});
1617
expectType<Renderlesskit.GetThemeValue<"button", "size">>({
18+
sm: "",
1719
md: "",
1820
lg: "",
19-
sm: "",
2021
xl: "",
2122
});
2223
expectType<Renderlesskit.GetThemeValue<"switch", "icon", "wrapper">["size"]>({
23-
lg: "",
2424
sm: "",
25-
xs: "",
25+
md: "",
26+
lg: "",
27+
xl: "",
2628
});
2729

2830
// user extended theme

0 commit comments

Comments
 (0)