From b06037a7c562ef57ef342b54d1acb6036e72eb30 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:51:22 -0500 Subject: [PATCH 01/13] feat: custom inputs --- src/components/CustomInput.astro | 14 ++++++++++++++ src/components/CustomTextarea.astro | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/components/CustomInput.astro create mode 100644 src/components/CustomTextarea.astro diff --git a/src/components/CustomInput.astro b/src/components/CustomInput.astro new file mode 100644 index 0000000..3ea7c97 --- /dev/null +++ b/src/components/CustomInput.astro @@ -0,0 +1,14 @@ +--- +interface Props { + label: String + placeholder: String +} + +const { label, placeholder } = Astro.props +--- + + + + diff --git a/src/components/CustomTextarea.astro b/src/components/CustomTextarea.astro new file mode 100644 index 0000000..9d103cf --- /dev/null +++ b/src/components/CustomTextarea.astro @@ -0,0 +1,14 @@ +--- +interface Props { + label: String + placeholder: String +} + +const { label, placeholder } = Astro.props +--- + + + + \ No newline at end of file From 205a3a463446977be5f6eb0d8a142fd404355387 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 11 Mar 2024 11:08:45 -0400 Subject: [PATCH 02/13] chore: add react compatibility, radix modal --- astro.config.mjs | 13 ++--- package-lock.json | 133 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 6 +++ tsconfig.json | 4 +- 4 files changed, 146 insertions(+), 10 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index b6ed592..2a862b3 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,11 +1,12 @@ -import { defineConfig } from 'astro/config'; -import mdx from '@astrojs/mdx'; -import sitemap from '@astrojs/sitemap'; - +import { defineConfig } from "astro/config"; +import mdx from "@astrojs/mdx"; +import sitemap from "@astrojs/sitemap"; import tailwind from "@astrojs/tailwind"; +import react from "@astrojs/react"; + // https://astro.build/config export default defineConfig({ - site: 'https://example.com', - integrations: [mdx(), sitemap(), tailwind()] + site: "https://example.com", + integrations: [mdx(), sitemap(), tailwind(), react()] }); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f5249e0..9e4655c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,13 +10,19 @@ "dependencies": { "@astrojs/check": "^0.5.3", "@astrojs/mdx": "^2.1.1", + "@astrojs/react": "^3.1.0", "@astrojs/rss": "^4.0.5", "@astrojs/sitemap": "^3.0.5", "@astrojs/tailwind": "^5.1.0", + "@radix-ui/react-dialog": "^1.0.5", "@staticcms/core": "^4.1.2", "@staticcms/proxy-server": "^4.0.4", + "@types/react": "^18.2.64", + "@types/react-dom": "^18.2.21", "astro": "^4.3.6", "i": "^0.3.7", + "react": "^18.2.0", + "react-dom": "^18.2.0", "tailwindcss": "^3.4.1", "typescript": "^5.3.3" }, @@ -185,6 +191,24 @@ "node": ">=18.14.1" } }, + "node_modules/@astrojs/react": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@astrojs/react/-/react-3.1.0.tgz", + "integrity": "sha512-KZhZyV+sUDZEjlrmPWNiPGeYowG9uq6/aMbCgVaeKEBlWT4Kg32TNwBOhZk6AcE4LY1l3mIwt3orUGE2JV96/g==", + "dependencies": { + "@vitejs/plugin-react": "^4.2.0", + "ultrahtml": "^1.3.0" + }, + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "@types/react": "^17.0.50 || ^18.0.21", + "@types/react-dom": "^17.0.17 || ^18.0.6", + "react": "^17.0.2 || ^18.0.0", + "react-dom": "^17.0.2 || ^18.0.0" + } + }, "node_modules/@astrojs/rss": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@astrojs/rss/-/rss-4.0.5.tgz", @@ -561,6 +585,34 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.23.3.tgz", + "integrity": "sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.23.3.tgz", + "integrity": "sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==", + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/runtime": { "version": "7.23.7", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.7.tgz", @@ -2740,6 +2792,42 @@ } } }, + "node_modules/@radix-ui/react-dialog": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.0.5.tgz", + "integrity": "sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.1", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-context": "1.0.1", + "@radix-ui/react-dismissable-layer": "1.0.5", + "@radix-ui/react-focus-guards": "1.0.1", + "@radix-ui/react-focus-scope": "1.0.4", + "@radix-ui/react-id": "1.0.1", + "@radix-ui/react-portal": "1.0.4", + "@radix-ui/react-presence": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-slot": "1.0.2", + "@radix-ui/react-use-controllable-state": "1.0.1", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "2.5.5" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-direction": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.0.1.tgz", @@ -3978,15 +4066,23 @@ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/react": { - "version": "18.2.55", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz", - "integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==", + "version": "18.2.64", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.64.tgz", + "integrity": "sha512-MlmPvHgjj2p3vZaxbQgFUQFvD8QiZwACfGqEdDSWou5yISWxDQ4/74nCAwsUiX7UFLKZz3BbVSPj+YxeoGGCfg==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", "csstype": "^3.0.2" } }, + "node_modules/@types/react-dom": { + "version": "18.2.21", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.21.tgz", + "integrity": "sha512-gnvBA/21SA4xxqNXEwNiVcP0xSGHh/gi1VhWv9Bl46a0ItbTT5nFY+G9VSQpaG/8N/qdJpJ+vftQ4zflTtnjLw==", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/react-transition-group": { "version": "4.4.10", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", @@ -5396,6 +5492,24 @@ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, + "node_modules/@vitejs/plugin-react": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.2.1.tgz", + "integrity": "sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==", + "dependencies": { + "@babel/core": "^7.23.5", + "@babel/plugin-transform-react-jsx-self": "^7.23.3", + "@babel/plugin-transform-react-jsx-source": "^7.23.3", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.14.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0" + } + }, "node_modules/@volar/kit": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@volar/kit/-/kit-2.0.3.tgz", @@ -13220,6 +13334,14 @@ } } }, + "node_modules/react-refresh": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", + "integrity": "sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react-remove-scroll": { "version": "2.5.5", "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz", @@ -15619,6 +15741,11 @@ "semver": "^7.3.8" } }, + "node_modules/ultrahtml": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.5.3.tgz", + "integrity": "sha512-GykOvZwgDWZlTQMtp5jrD4BVL+gNn2NVlVafjcFUJ7taY20tqYdwdoWBFy6GBJsNTZe1GkGPkSl5knQAjtgceg==" + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", diff --git a/package.json b/package.json index b703422..0d3de8d 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,19 @@ "dependencies": { "@astrojs/check": "^0.5.3", "@astrojs/mdx": "^2.1.1", + "@astrojs/react": "^3.1.0", "@astrojs/rss": "^4.0.5", "@astrojs/sitemap": "^3.0.5", "@astrojs/tailwind": "^5.1.0", + "@radix-ui/react-dialog": "^1.0.5", "@staticcms/core": "^4.1.2", "@staticcms/proxy-server": "^4.0.4", + "@types/react": "^18.2.64", + "@types/react-dom": "^18.2.21", "astro": "^4.3.6", "i": "^0.3.7", + "react": "^18.2.0", + "react-dom": "^18.2.0", "tailwindcss": "^3.4.1", "typescript": "^5.3.3" }, diff --git a/tsconfig.json b/tsconfig.json index 7a36ca0..6bed1f7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,8 @@ { "extends": "astro/tsconfigs/strict", "compilerOptions": { - "strictNullChecks": true + "strictNullChecks": true, + "jsx": "react-jsx", + "jsxImportSource": "react" } } \ No newline at end of file From 634026c4a57c4eae777a5e5749c6555a830be721 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 11 Mar 2024 12:34:33 -0400 Subject: [PATCH 03/13] chore: use react instead of astro for components --- package-lock.json | 9 ++++ package.json | 1 + src/components/CustomInput.astro | 14 ----- src/components/CustomInput.tsx | 20 ++++++++ src/components/CustomTextarea.astro | 14 ----- src/components/CustomTextarea.tsx | 18 +++++++ src/components/DownloadModal.tsx | 79 +++++++++++++++++++++++++++++ 7 files changed, 127 insertions(+), 28 deletions(-) delete mode 100644 src/components/CustomInput.astro create mode 100644 src/components/CustomInput.tsx delete mode 100644 src/components/CustomTextarea.astro create mode 100644 src/components/CustomTextarea.tsx create mode 100644 src/components/DownloadModal.tsx diff --git a/package-lock.json b/package-lock.json index 9e4655c..a4fd68c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@astrojs/sitemap": "^3.0.5", "@astrojs/tailwind": "^5.1.0", "@radix-ui/react-dialog": "^1.0.5", + "@radix-ui/react-icons": "^1.3.0", "@staticcms/core": "^4.1.2", "@staticcms/proxy-server": "^4.0.4", "@types/react": "^18.2.64", @@ -2943,6 +2944,14 @@ } } }, + "node_modules/@radix-ui/react-icons": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-icons/-/react-icons-1.3.0.tgz", + "integrity": "sha512-jQxj/0LKgp+j9BiTXz3O3sgs26RNet2iLWmsPyRz2SIcR4q/4SbazXfnYwbAr+vLYKSfc7qxzyGQA1HLlYiuNw==", + "peerDependencies": { + "react": "^16.x || ^17.x || ^18.x" + } + }, "node_modules/@radix-ui/react-id": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.0.1.tgz", diff --git a/package.json b/package.json index 0d3de8d..bb82dd7 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@astrojs/sitemap": "^3.0.5", "@astrojs/tailwind": "^5.1.0", "@radix-ui/react-dialog": "^1.0.5", + "@radix-ui/react-icons": "^1.3.0", "@staticcms/core": "^4.1.2", "@staticcms/proxy-server": "^4.0.4", "@types/react": "^18.2.64", diff --git a/src/components/CustomInput.astro b/src/components/CustomInput.astro deleted file mode 100644 index 3ea7c97..0000000 --- a/src/components/CustomInput.astro +++ /dev/null @@ -1,14 +0,0 @@ ---- -interface Props { - label: String - placeholder: String -} - -const { label, placeholder } = Astro.props ---- - - - - diff --git a/src/components/CustomInput.tsx b/src/components/CustomInput.tsx new file mode 100644 index 0000000..7a31e08 --- /dev/null +++ b/src/components/CustomInput.tsx @@ -0,0 +1,20 @@ +import React from "react" + +interface CustomInputProps { + label: string + placeholder: string +} + +export const CustomInput: React.FC = ({ label, placeholder }) => { + return ( + <> + + + ) +} diff --git a/src/components/CustomTextarea.astro b/src/components/CustomTextarea.astro deleted file mode 100644 index 9d103cf..0000000 --- a/src/components/CustomTextarea.astro +++ /dev/null @@ -1,14 +0,0 @@ ---- -interface Props { - label: String - placeholder: String -} - -const { label, placeholder } = Astro.props ---- - - - - \ No newline at end of file diff --git a/src/components/CustomTextarea.tsx b/src/components/CustomTextarea.tsx new file mode 100644 index 0000000..dc150fa --- /dev/null +++ b/src/components/CustomTextarea.tsx @@ -0,0 +1,18 @@ +import React from "react" + +interface CustomTextareaProps { + label: string + placeholder: string +} + +export const CustomTextarea: React.FC = ({ label, placeholder }) => { + return ( + <> +