From f9326181ccd22087bd459cbccba629b6857cac79 Mon Sep 17 00:00:00 2001 From: Eli <88557639+lishaduck@users.noreply.github.com> Date: Fri, 10 May 2024 13:57:54 -0500 Subject: [PATCH] feat: bump headless And get ourselves a floating ui! --- biome.json | 3 +- deno.json | 36 +++++++++++++++----- src/components/Checkbox.tsx | 31 ----------------- src/components/Header.tsx | 6 ++-- src/fresh.gen.ts | 2 ++ src/islands/Chatbot.tsx | 68 ++++++++++++++++++------------------- src/islands/Checkbox.tsx | 30 ++++++++++++++++ src/islands/HeaderMenu.tsx | 68 ++++++++++++++++++++++--------------- src/islands/Selector.tsx | 37 ++++++++++++-------- src/routes/calculator.tsx | 45 ++++++++++-------------- 10 files changed, 180 insertions(+), 146 deletions(-) delete mode 100644 src/components/Checkbox.tsx create mode 100644 src/islands/Checkbox.tsx diff --git a/biome.json b/biome.json index 9e2bdac2..b4961d8e 100644 --- a/biome.json +++ b/biome.json @@ -17,7 +17,8 @@ "useImportRestrictions": "off", "useSortedClasses": "off", "noConsole": "off", - "useDefaultSwitchClause": "off" + "useDefaultSwitchClause": "off", + "noReactSpecificProps": "off" }, "style": { "noImplicitBoolean": "off", diff --git a/deno.json b/deno.json index ab98ac66..b64dd460 100644 --- a/deno.json +++ b/deno.json @@ -26,7 +26,7 @@ "$fresh/": "https://deno.land/x/fresh@1.6.8/", "$tabler_icons/": "https://deno.land/x/tabler_icons_tsx@0.0.6/tsx/", "@deno/gfm": "https://deno.land/x/gfm@0.6.0/mod.ts", - "@headlessui/react": "https://esm.sh/v135/*@headlessui/react@1.7.17", + "@headlessui/react": "https://esm.sh/v135/*@headlessui/react@2.0.3", "@headlessui/tailwindcss": "npm:@headlessui/tailwindcss@0.2.0", "@mdx-js/mdx": "npm:@mdx-js/mdx@3.0.1", "@preact/signals": "https://esm.sh/v135/*@preact/signals@1.2.3", @@ -35,11 +35,12 @@ "@std/path": "jsr:@std/path@^0.224.0", "@tailwindcss/forms": "npm:@tailwindcss/forms@0.5.7", "@tailwindcss/typography": "npm:@tailwindcss/typography@0.5.13", + "clsx": "npm:clsx@2.1.1", "idb-keyval": "npm:idb-keyval@6.2.1", "openai": "https://deno.land/x/openai@v4.43.0/mod.ts", "openai/": "https://deno.land/x/openai@v4.43.0/", - "preact": "https://esm.sh/v135/preact@10.21.0", - "preact/": "https://esm.sh/v135/preact@10.21.0/", + "preact": "https://esm.sh/v135/*preact@10.21.0", + "preact/": "https://esm.sh/v135/*preact@10.21.0/", "rehype-mathjax": "npm:rehype-mathjax@6.0.0", "remark-frontmatter": "npm:remark-frontmatter@5.0.0", "remark-lint-checkbox-content-indent": "npm:remark-lint-checkbox-content-indent@5.0.0", @@ -59,16 +60,33 @@ "vfile": "npm:vfile@6.0.1", "vfile-matter": "npm:vfile-matter@5.0.0", "vfile-reporter": "npm:vfile-reporter@8.1.1", - "zod": "https://deno.land/x/zod@v3.23.7/mod.ts" + "zod": "https://deno.land/x/zod@v3.23.8/mod.ts" }, "scopes": { "https://esm.sh/v135/": { + "@floating-ui/core": "npm:@floating-ui/core@1.6.1", + "@floating-ui/dom": "npm:@floating-ui/dom@1.6.5", + "@floating-ui/react": "https://esm.sh/v135/*@floating-ui/react@0.26.13", + "@floating-ui/react/": "https://esm.sh/v135/*@floating-ui/react@0.26.13/", + "@floating-ui/react-dom": "https://esm.sh/v135/*@floating-ui/react-dom@2.0.9", + "@floating-ui/utils": "https://esm.sh/v135/*@floating-ui/utils@0.2.2", + "@floating-ui/utils/": "https://esm.sh/v135/*@floating-ui/utils@0.2.2/", + "@react-aria/focus": "https://esm.sh/v135/*@react-aria/focus@3.17.0", + "@react-aria/interactions": "https://esm.sh/v135/*@react-aria/interactions@3.21.2", + "@react-aria/ssr": "https://esm.sh/v135/*@react-aria/ssr@3.9.3", + "@react-aria/utils": "https://esm.sh/v135/*@react-aria/utils@3.24.0", + "@react-stately/utils": "npm:@react-stately/utils@3.10.0", "@preact/signals-react": "https://esm.sh/v135/*@preact/signals@1.2.3", - "client-only": "https://esm.sh/v135/client-only@0.0.1", - "react-dom": "https://esm.sh/v135/preact@10.21.0/compat", - "react": "https://esm.sh/v135/preact@10.21.0/compat", - "react/jsx-runtime": "https://esm.sh/v135/preact@10.21.0/jsx-runtime", - "react-dom/test-utils": "https://esm.sh/v135/preact@10.21.0/test-utils" + "@swc/helpers/": "https://esm.sh/v135/*@swc/helpers@0.5.11/", + "@tanstack/react-virtual": "https://esm.sh/v135/*@tanstack/react-virtual@3.5.0", + "@tanstack/virtual-core": "npm:@tanstack/virtual-core@3.5.0", + "client-only": "npm:client-only@0.0.1", + "node:process": "https://esm.sh/v135/*node_process.js", + "react-dom": "https://esm.sh/v135/*preact@10.21.0/compat", + "react": "https://esm.sh/v135/*preact@10.21.0/compat", + "react/jsx-runtime": "https://esm.sh/v135/*preact@10.21.0/jsx-runtime", + "react-dom/test-utils": "https://esm.sh/v135/*preact@10.21.0/test-utils", + "tabbable": "npm:tabbable@6.2.0" } }, "compilerOptions": { diff --git a/src/components/Checkbox.tsx b/src/components/Checkbox.tsx deleted file mode 100644 index 98050021..00000000 --- a/src/components/Checkbox.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import type { JSX } from "preact"; - -export interface CheckboxProps { - name: string; - id: string; - labelText: string; - required?: boolean; -} - -export function Checkbox({ - name, - id, - labelText, - required, -}: CheckboxProps): JSX.Element { - return ( -
- - -
- ); -} diff --git a/src/components/Header.tsx b/src/components/Header.tsx index c68dd942..853058c1 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -29,7 +29,9 @@ export interface HeaderProps { export function Header({ active }: HeaderProps): JSX.Element { return (
- +
+ +