Skip to content

Commit 61ec937

Browse files
committed
refactor: cleanup & upgrade
1 parent 1fc84bd commit 61ec937

File tree

15 files changed

+1755
-2160
lines changed

15 files changed

+1755
-2160
lines changed

package-lock.json

Lines changed: 1665 additions & 1814 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,40 @@
1010
"test": "tsc --noEmit && eslint --ext=tsx,ts ."
1111
},
1212
"dependencies": {
13-
"@tabler/icons-react": "^3.10.0",
14-
"@tanstack/react-form": "^1.0.0",
15-
"preact": "^10.22.0",
13+
"@tabler/icons-react": "^3.31.0",
14+
"preact": "^10.26.4",
1615
"webextension-polyfill": "^0.12.0",
17-
"wouter": "^3.3.1",
18-
"zod": "^3.24.2"
16+
"wouter": "^3.6.0"
1917
},
2018
"devDependencies": {
21-
"@commitlint/cli": "^19.3.0",
22-
"@commitlint/config-conventional": "^19.2.2",
19+
"@commitlint/cli": "^19.8.0",
20+
"@commitlint/config-conventional": "^19.8.0",
2321
"@csstools/postcss-cascade-layers": "^4.0.6",
2422
"@pandacss/dev": "^0.41.0",
2523
"@seldszar/yael": "^2.2.0",
26-
"@swc/core": "^1.4.16",
27-
"@types/react": "^18.3.3",
28-
"@types/react-dom": "^18.3.0",
24+
"@swc/core": "^1.11.8",
25+
"@types/react": "^18.3.18",
26+
"@types/react-dom": "^18.3.5",
2927
"@types/webextension-polyfill": "^0.10.7",
30-
"@types/webpack-env": "^1.18.4",
31-
"@typescript-eslint/eslint-plugin": "^6.2.1",
32-
"@typescript-eslint/parser": "^6.2.1",
28+
"@types/webpack-env": "^1.18.8",
29+
"@typescript-eslint/eslint-plugin": "^6.21.0",
30+
"@typescript-eslint/parser": "^6.21.0",
3331
"copy-webpack-plugin": "^12.0.2",
3432
"css-loader": "^7.1.2",
35-
"eslint": "^8.46.0",
33+
"eslint": "^8.57.1",
3634
"eslint-config-prettier": "^9.1.0",
37-
"eslint-plugin-prettier": "^5.1.3",
38-
"graphql": "^16.9.0",
39-
"html-webpack-plugin": "^5.6.0",
40-
"husky": "^9.0.11",
41-
"lint-staged": "^15.2.2",
42-
"mini-css-extract-plugin": "^2.9.0",
43-
"postcss": "^8.4.39",
35+
"eslint-plugin-prettier": "^5.2.3",
36+
"graphql": "^16.10.0",
37+
"html-webpack-plugin": "^5.6.3",
38+
"husky": "^9.1.7",
39+
"lint-staged": "^15.4.3",
40+
"mini-css-extract-plugin": "^2.9.2",
41+
"postcss": "^8.5.3",
4442
"postcss-loader": "^8.1.1",
45-
"prettier": "^3.2.5",
43+
"prettier": "^3.5.3",
4644
"swc-loader": "^0.2.6",
47-
"typescript": "^5.4.5",
48-
"webpack": "^5.91.0",
45+
"typescript": "^5.8.2",
46+
"webpack": "^5.98.0",
4947
"webpack-cli": "^5.1.4",
5048
"webpack-merge": "^5.10.0"
5149
},

src/browser/popup/components/Button.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export const Button = styled("button", {
88
px: 5,
99
py: 2.5,
1010
rounded: "md",
11+
12+
_disabled: {
13+
cursor: "not-allowed",
14+
opacity: 0.5,
15+
},
1116
},
1217
variants: {
1318
color: {

src/browser/popup/components/Form.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/browser/popup/components/FormField.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { ReactNode } from "react";
33
import { css, cx, sva } from "~/browser/styled-system/css";
44

55
const recipe = sva({
6-
slots: ["header"],
6+
slots: ["label"],
77

88
base: {
9-
header: {
9+
label: {
1010
color: { base: "neutral.600", _dark: "neutral.400" },
1111
fontSize: "sm",
1212
fontWeight: "bold",
@@ -18,8 +18,9 @@ const recipe = sva({
1818

1919
export interface FormFieldProps {
2020
className?: string;
21+
22+
label?: ReactNode;
2123
children?: ReactNode;
22-
header?: ReactNode;
2324
}
2425

2526
export function FormField(props: FormFieldProps) {
@@ -29,7 +30,7 @@ export function FormField(props: FormFieldProps) {
2930

3031
return (
3132
<label className={cx(css({ display: "block" }), props.className)}>
32-
<div className={styles.header}>{props.header}</div>
33+
{props.label && <div className={styles.label}>{props.label}</div>}
3334
{props.children}
3435
</label>
3536
);

src/browser/popup/components/Radio.tsx

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/browser/popup/components/RadioGroup.tsx

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/browser/popup/components/Switch.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactNode } from "react";
1+
import { HTMLProps, ReactNode } from "react";
22

33
import { cx, sva } from "~/browser/styled-system/css";
44
import { Circle } from "~/browser/styled-system/jsx";
@@ -37,11 +37,8 @@ const recipe = sva({
3737
},
3838
});
3939

40-
export interface SwitchProps {
40+
export interface SwitchProps extends HTMLProps<HTMLInputElement> {
4141
children?: ReactNode;
42-
43-
checked: boolean;
44-
onChecked(checked: boolean): void;
4542
}
4643

4744
export function Switch(props: SwitchProps) {
@@ -51,12 +48,7 @@ export function Switch(props: SwitchProps) {
5148

5249
return (
5350
<label className={styles.root}>
54-
<input
55-
type="checkbox"
56-
checked={props.checked}
57-
onChange={() => props.onChecked(!props.checked)}
58-
className={cx("peer", styles.input)}
59-
/>
51+
<input {...props} type="checkbox" className={cx("peer", styles.input)} />
6052

6153
<div className={styles.icon}>
6254
<Circle bg="white" size="14px" />

0 commit comments

Comments
 (0)