Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix radix popover and dialog bug

Steven Tey57660956754e
diff --git a/app/ui/modal.tsx b/app/ui/modal.tsx
index 26484e909b..31ada54987 100644
--- a/app/ui/modal.tsx
+++ b/app/ui/modal.tsx
@@ -82,6 +82,7 @@ export default function Modal({
>
<Dialog.Portal>
<Dialog.Overlay
+ // for detecting when there's an active opened modal
id="modal-backdrop"
className="fixed inset-0 z-40 animate-fade-in bg-gray-100 bg-opacity-50 backdrop-blur-md"
/>
diff --git a/app/ui/switch.tsx b/app/ui/switch.tsx
index fc3a9785bb..ef5185fe44 100644
--- a/app/ui/switch.tsx
+++ b/app/ui/switch.tsx
@@ -40,9 +40,9 @@ const Switch = ({
disabled={disabled}
className={cn(
disabled
- ? "cursor-not-allowed radix-state-checked:bg-gray-300"
+ ? "cursor-not-allowed bg-gray-300"
: "cursor-pointer focus:outline-none focus-visible:ring focus-visible:ring-blue-500 focus-visible:ring-opacity-75 radix-state-checked:bg-blue-500 radix-state-unchecked:bg-gray-200",
- `relative inline-flex h-4 w-8 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out`,
+ "relative inline-flex h-4 w-8 flex-shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out",
trackDimensions,
)}
>
diff --git a/components/app/links/link-filters.tsx b/components/app/links/link-filters.tsx
index f3be9f1a19..6dbcda8347 100644
--- a/components/app/links/link-filters.tsx
+++ b/components/app/links/link-filters.tsx
@@ -426,10 +426,7 @@ const TagPopover = ({ tag, count }: { tag: TagProps; count: number }) => {
) : (
<Popover
content={
- <div
- data-exclude-click
- className="flex w-48 flex-col divide-y divide-gray-200"
- >
+ <div className="flex w-48 flex-col divide-y divide-gray-200">
<div className="p-2">
<form
onClick={(e) => e.stopPropagation()} // prevent triggering <Command.Item> onClick
diff --git a/package.json b/package.json
index be00e8b48a..c9f9febc77 100644
--- a/package.json
+++ b/package.json
@@ -15,8 +15,9 @@
"@planetscale/database": "^1.7.0",
"@prisma/client": "^5.2.0",
"@radix-ui/react-accordion": "^1.0.1",
+ "@radix-ui/react-dialog": "1.0.3",
"@radix-ui/react-navigation-menu": "^1.1.2",
- "@radix-ui/react-popover": "^1.0.5",
+ "@radix-ui/react-popover": "1.0.5",
"@radix-ui/react-slider": "^1.1.0",
"@radix-ui/react-switch": "^1.0.1",
"@radix-ui/react-tooltip": "^1.0.2",
diff --git a/yarn.lock b/yarn.lock
index f5fe48e45d..c89a12d8c8 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1368,7 +1368,7 @@
"@floating-ui/core@^0.7.3":
version "0.7.3"
- resolved "https://registry.npmjs.org/@floating-ui/core/-/core-0.7.3.tgz"
+ resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-0.7.3.tgz#d274116678ffae87f6b60e90f88cc4083eefab86"
integrity sha512-buc8BXHmG9l82+OQXOFU3Kr2XQx9ys01U/Q9HMIrZ300iLc8HLMgh7dcCqgYzAzf4BkoQvDcXf5Y+CuEZ5JBYg==
"@floating-ui/core@^1.2.6":
@@ -1378,7 +1378,7 @@
"@floating-ui/dom@^0.5.3":
version "0.5.4"
- resolved "https://registry.npmjs.org/@floating-ui/dom/-/dom-0.5.4.tgz"
+ resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-0.5.4.tgz#4eae73f78bcd4bd553ae2ade30e6f1f9c73fe3f1"
integrity sha512-419BMceRLq0RrmTSDxn8hf9R3VCJv2K9PUfugh5JyEFmdjzDo+e8U5EdR8nzKq8Yj1htzLm3b6eQEEam3/rrtg==
dependencies:
"@floating-ui/core" "^0.7.3"
@@ -1392,7 +1392,7 @@
"@floating-ui/[email protected]":
version "0.7.2"
- resolved "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-0.7.2.tgz"
+ resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-0.7.2.tgz#0bf4ceccb777a140fc535c87eb5d6241c8e89864"
integrity sha512-1T0sJcpHgX/u4I1OzIEhlcrvkUN8ln39nz7fMoE/2HDHrPiMFoOGR7++GYyfUmIQHkkrTinaeQsO3XWubjSvGg==
dependencies:
"@floating-ui/dom" "^0.5.3"
@@ -2322,7 +2322,7 @@
"@radix-ui/[email protected]":
version "1.0.2"
- resolved "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.0.2.tgz"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-arrow/-/react-arrow-1.0.2.tgz#93b0ff95f65e2264a05b14ef1031ec798243dd6f"
integrity sha512-fqYwhhI9IarZ0ll2cUSfKuXHlJK0qE4AfnRrPBbRwEH/4mGQn04/QFGomLi8TXWIdv9WJk//KgGm+aDxVIr1wA==
dependencies:
"@babel/runtime" "^7.13.10"
@@ -2422,6 +2422,27 @@
aria-hidden "^1.1.1"
react-remove-scroll "2.5.4"
+"@radix-ui/[email protected]":
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.0.3.tgz#a715bf30f35fcd80476c0a07fcc073c1968e6d3e"
+ integrity sha512-owNhq36kNPqC2/a+zJRioPg6HHnTn5B/sh/NjTY8r4W9g1L5VJlrzZIVcBr7R9Mg8iLjVmh6MGgMlfoVf/WO/A==
+ dependencies:
+ "@babel/runtime" "^7.13.10"
+ "@radix-ui/primitive" "1.0.0"
+ "@radix-ui/react-compose-refs" "1.0.0"
+ "@radix-ui/react-context" "1.0.0"
+ "@radix-ui/react-dismissable-layer" "1.0.3"
+ "@radix-ui/react-focus-guards" "1.0.0"
+ "@radix-ui/react-focus-scope" "1.0.2"
+ "@radix-ui/react-id" "1.0.0"
+ "@radix-ui/react-portal" "1.0.2"
+ "@radix-ui/react-presence" "1.0.0"
+ "@radix-ui/react-primitive" "1.0.2"
+ "@radix-ui/react-slot" "1.0.1"
+ "@radix-ui/react-use-controllable-state" "1.0.0"
+ aria-hidden "^1.1.1"
+ react-remove-scroll "2.5.5"
+
"@radix-ui/react-dialog@^1.0.4":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.0.4.tgz#06bce6c16bb93eb36d7a8589e665a20f4c1c52c1"
@@ -2512,7 +2533,7 @@
"@radix-ui/[email protected]":
version "1.0.2"
- resolved "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.2.tgz"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.2.tgz#5fe129cbdb5986d0a3ae16d14c473c243fe3bc79"
integrity sha512-spwXlNTfeIprt+kaEWE/qYuYT3ZAqJiAGjN/JgdvgVDTu8yc+HuX+WOWXrKliKnLnwck0F6JDkqIERncnih+4A==
dependencies:
"@babel/runtime" "^7.13.10"
@@ -2567,9 +2588,9 @@
"@radix-ui/react-use-previous" "1.0.0"
"@radix-ui/react-visually-hidden" "1.0.2"
-"@radix-ui/react-popover@^1.0.5":
+"@radix-ui/[email protected]":
version "1.0.5"
- resolved "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.0.5.tgz"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-popover/-/react-popover-1.0.5.tgz#9c58100ed6809eb611c0acbf032f9ab58c0b55d1"
integrity sha512-GRHZ8yD12MrN2NLobHPE8Rb5uHTxd9x372DE9PPNnBjpczAQHcZ5ne0KXG4xpf+RDdXSzdLv9ym6mYJCDTaUZg==
dependencies:
"@babel/runtime" "^7.13.10"
@@ -2591,7 +2612,7 @@
"@radix-ui/[email protected]":
version "1.1.1"
- resolved "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.1.1.tgz"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-popper/-/react-popper-1.1.1.tgz#54f060941c981e965ff5d6b64e152d6298d2326e"
integrity sha512-keYDcdMPNMjSC8zTsZ8wezUMiWM9Yj14wtF3s0PTIs9srnEPC9Kt2Gny1T3T81mmSeyDjZxsD9N5WCwNNb712w==
dependencies:
"@babel/runtime" "^7.13.10"
@@ -2633,7 +2654,7 @@
"@radix-ui/[email protected]":
version "1.0.2"
- resolved "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.2.tgz"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.0.2.tgz#102370b1027a767a371cab0243be4bc664f72330"
integrity sha512-swu32idoCW7KA2VEiUZGBSu9nB6qwGdV6k6HYhUoOo3M1FFpD+VgLzUqtt3mwL1ssz7r2x8MggpLSQach2Xy/Q==
dependencies:
"@babel/runtime" "^7.13.10"
@@ -2849,7 +2870,7 @@
"@radix-ui/[email protected]":
version "1.0.0"
- resolved "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.0.0.tgz"
+ resolved "https://registry.yarnpkg.com/@radix-ui/react-use-rect/-/react-use-rect-1.0.0.tgz#b040cc88a4906b78696cd3a32b075ed5b1423b3e"
integrity sha512-TB7pID8NRMEHxb/qQJpvSt3hQU4sqNPM1VCTjTRjEOa7cEop/QMuq8S6fb/5Tsz64kqSvB9WnwsDHtjnrM9qew==
dependencies:
"@babel/runtime" "^7.13.10"
@@ -2897,7 +2918,7 @@
"@radix-ui/[email protected]":
version "1.0.0"
- resolved "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.0.0.tgz"
+ resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.0.0.tgz#0dc8e6a829ea2828d53cbc94b81793ba6383bf3c"
integrity sha512-d0O68AYy/9oeEy1DdC07bz1/ZXX+DqCskRd3i4JzLSTXwefzaepQrKjXC7aNM8lTHjFLDO0pDgaEiQ7jEk+HVg==
dependencies:
"@babel/runtime" "^7.13.10"