Skip to content

Commit af5c475

Browse files
committed
rewrite components
1 parent 0f7fb28 commit af5c475

File tree

115 files changed

+3360
-1770
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3360
-1770
lines changed

.eslintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"root": true,
33
"env": { "browser": true, "es2020": true, "node": true },
44
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:react-hooks/recommended"],
5-
"ignorePatterns": ["dist", "package.json", "yarn.lock", "src/styles", "src/router.ts"],
5+
"ignorePatterns": ["dist", "package.json", "yarn.lock", "index.html", "src/styles", "src/router.ts"],
66
"parser": "@typescript-eslint/parser",
77
"parserOptions": {
88
"project": ["./tsconfig.json"],
@@ -14,5 +14,6 @@
1414
"@typescript-eslint/ban-ts-comment": "off",
1515
"@typescript-eslint/no-unused-vars": "warn",
1616
"@typescript-eslint/no-explicit-any": "warn",
17+
"@typescript-eslint/ban-types": "warn",
1718
},
1819
}

index.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<script src="https://kit.fontawesome.com/890a5ffe43.js" crossorigin="anonymous"></script>
87
<title>Beat Saber Map Analysis</title>
98
</head>
109
<body>

package.json

+17-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,19 @@
1414
"format": "prettier src \"!src/router.ts\""
1515
},
1616
"dependencies": {
17-
"@floating-ui/react": "^0.26.7",
1817
"@generouted/react-router": "^1.18.2",
18+
"@radix-ui/primitive": "^1.0.1",
19+
"@radix-ui/react-checkbox": "^1.0.4",
20+
"@radix-ui/react-collapsible": "^1.0.3",
21+
"@radix-ui/react-context": "^1.0.1",
22+
"@radix-ui/react-dialog": "^1.0.5",
23+
"@radix-ui/react-popover": "^1.0.7",
24+
"@radix-ui/react-select": "^2.0.0",
1925
"@radix-ui/react-slot": "^1.0.2",
26+
"@radix-ui/react-tabs": "^1.0.4",
27+
"@radix-ui/react-toggle": "^1.0.3",
28+
"@radix-ui/react-tooltip": "^1.0.7",
29+
"@radix-ui/react-use-controllable-state": "^1.0.1",
2030
"@tanstack/react-form": "^0.13.4",
2131
"@tanstack/react-table": "^8.11.7",
2232
"@tanstack/valibot-form-adapter": "^0.13.4",
@@ -27,11 +37,17 @@
2737
"pako": "^2.1.0",
2838
"react": "^18.2.0",
2939
"react-dom": "^18.2.0",
40+
"react-dropzone": "^14.2.3",
3041
"react-router-dom": "^6.21.3",
3142
"slugify": "^1.6.6",
3243
"valibot": "^0.30.0"
3344
},
3445
"devDependencies": {
46+
"@fortawesome/fontawesome-svg-core": "^6.5.1",
47+
"@fortawesome/free-brands-svg-icons": "^6.5.1",
48+
"@fortawesome/free-regular-svg-icons": "^6.5.1",
49+
"@fortawesome/free-solid-svg-icons": "^6.5.1",
50+
"@fortawesome/react-fontawesome": "^0.2.0",
3551
"@pandacss/dev": "^0.17.5",
3652
"@types/file-saver": "^2.0.7",
3753
"@types/node": "^20.11.8",

panda.config.ts

+33-28
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export default defineConfig({
1515
maxWidth: "6xl",
1616
marginX: "auto",
1717
},
18+
// HACK: radix-ui portals do not respect margin/padding values.
19+
"body[data-scroll-locked]": {
20+
padding: "0 !important",
21+
marginX: "auto !important",
22+
},
1823
main: {
1924
margin: 8,
2025
},
@@ -28,29 +33,6 @@ export default defineConfig({
2833
color: "indigo.400",
2934
},
3035
},
31-
"button, input, select, textarea": {
32-
backgroundColor: "element",
33-
color: "text",
34-
border: "1px solid transparent",
35-
transition: "border-color 0.25s",
36-
"&:not([disabled]):hover": {
37-
borderColor: "primary",
38-
},
39-
"&[disabled]": {
40-
backgroundColor: "container",
41-
color: "subtext",
42-
cursor: "not-allowed",
43-
},
44-
"&[disabled] > *": {
45-
cursor: "not-allowed",
46-
},
47-
},
48-
button: {
49-
paddingY: 1,
50-
paddingX: 4,
51-
borderRadius: "md",
52-
cursor: "pointer",
53-
},
5436
"code, pre": {
5537
fontFamily: "monospace",
5638
fontSize: "md",
@@ -89,9 +71,6 @@ export default defineConfig({
8971
marginX: 4,
9072
},
9173
},
92-
"h1, h2, h3, h4, h5, h6": {
93-
fontWeight: "bold",
94-
},
9574
hr: {
9675
marginY: 4,
9776
},
@@ -114,8 +93,6 @@ export default defineConfig({
11493
},
11594
select: {
11695
paddingX: "0.5em",
117-
cursor: "pointer",
118-
WebkitAppearance: "none",
11996
},
12097
table: {
12198
borderCollapse: "separate",
@@ -138,6 +115,7 @@ export default defineConfig({
138115
text: { value: { base: "{colors.zinc.900}", _osDark: "{colors.zinc.100}" } },
139116
subtext: { value: { base: "{colors.zinc.600}", _osDark: "{colors.zinc.400}" } },
140117
neutral: { value: { base: "{colors.zinc.500}" } },
118+
light: { value: { base: "{colors.zinc.800}", _osDark: "{colors.zinc.200}" } },
141119
primary: { value: { base: "{colors.blue.500}" } },
142120
danger: { value: { base: "{colors.red.600}" } },
143121
link: { value: { base: "{colors.indigo.500}" } },
@@ -154,6 +132,33 @@ export default defineConfig({
154132
},
155133
patterns: {
156134
extend: {
135+
interactable: {
136+
transform: ({ ...rest }) => {
137+
return {
138+
backgroundColor: rest.backgroundColor ?? "element",
139+
color: "text",
140+
border: rest.border ?? "1px solid transparent",
141+
transition: "border-color 0.25s",
142+
cursor: "pointer",
143+
WebkitAppearance: "none",
144+
['&[data-state="on"]']: {
145+
backgroundColor: "primary",
146+
},
147+
"&:not([disabled]):hover": {
148+
borderColor: "primary",
149+
},
150+
"&[disabled]": {
151+
backgroundColor: "container",
152+
color: "subtext",
153+
cursor: "not-allowed",
154+
},
155+
"&[disabled] > *": {
156+
cursor: "not-allowed",
157+
},
158+
...rest,
159+
};
160+
},
161+
},
157162
scrollable: {
158163
description: "A container that allows for scrolling",
159164
properties: {

src/components/badge/index.tsx

-36
This file was deleted.

src/components/context/floating.tsx

-13
This file was deleted.

src/components/context/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * as Storage from "./storage";

src/components/context/storage.tsx src/components/context/storage/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const storage = Object.entries(localStorage).reduce((record: State, [key, value]
4545

4646
const Context = createContext<{ state: State; dispatch: Dispatch<Actions> }>({ state: {}, dispatch: () => null });
4747

48-
function StorageProvider({ children }: PropsWithChildren) {
48+
function Provider({ children }: PropsWithChildren) {
4949
const [state, dispatch] = useReducer<Reducer<State, Actions>>(reducer, storage);
5050
useEffect(() => {
5151
Object.entries(datasets).forEach(([key, contents]) => {
@@ -57,4 +57,4 @@ function StorageProvider({ children }: PropsWithChildren) {
5757
return <Context.Provider value={{ state, dispatch }}>{children}</Context.Provider>;
5858
}
5959

60-
export { Context as StorageContext, StorageProvider };
60+
export { Context, Provider, type State };

src/components/field/form.tsx

-66
This file was deleted.

src/components/field/index.ts

-4
This file was deleted.

src/components/field/tags.tsx

-63
This file was deleted.

0 commit comments

Comments
 (0)