>
-export type SymmetricRectInset = { dx?: number; dy?: number }
+export interface SymmetricRectInset {
+ dx?: number
+ dy?: number
+}
+
+export interface ScalingOptions {
+ scalingOriginMode: "center" | "extent"
+ lockAspectRatio: boolean
+}
+
+/* -----------------------------------------------------------------------------
+ * Alignment
+ * -----------------------------------------------------------------------------*/
+
+export interface AlignOptions {
+ h: HAlign
+ v: VAlign
+}
+
+export type HAlign = "left-inside" | "left-outside" | "center" | "right-inside" | "right-outside"
+
+export type VAlign = "top-inside" | "top-outside" | "center" | "bottom-inside" | "bottom-outside"
diff --git a/packages/utilities/rect/src/union.ts b/packages/utilities/rect/src/union.ts
index 298222de91..ede981476c 100644
--- a/packages/utilities/rect/src/union.ts
+++ b/packages/utilities/rect/src/union.ts
@@ -1,28 +1,16 @@
import { getRectFromPoints } from "./from-points"
-import type { Rect } from "./rect"
+import type { Rect } from "./types"
const { min, max } = Math
export function union(...rs: Rect[]): Rect {
const pMin = {
- x: min.apply(
- Math,
- rs.map((r) => r.minX),
- ),
- y: min.apply(
- Math,
- rs.map((r) => r.minY),
- ),
+ x: min(...rs.map((r) => r.minX)),
+ y: min(...rs.map((r) => r.minY)),
}
const pMax = {
- x: max.apply(
- Math,
- rs.map((r) => r.maxX),
- ),
- y: max.apply(
- Math,
- rs.map((r) => r.maxY),
- ),
+ x: max(...rs.map((r) => r.maxX)),
+ y: max(...rs.map((r) => r.maxY)),
}
return getRectFromPoints(pMin, pMax)
}
diff --git a/packages/utilities/tabbable/CHANGELOG.md b/packages/utilities/tabbable/CHANGELOG.md
index 08ad52b888..53a79d048a 100644
--- a/packages/utilities/tabbable/CHANGELOG.md
+++ b/packages/utilities/tabbable/CHANGELOG.md
@@ -411,20 +411,16 @@
element in DOM sequence.
```js
- import { proxyTabFocus } from "@zag-js/tabbable";
+ import { proxyTabFocus } from "@zag-js/tabbable"
export function App() {
- const referenceRef = useRef();
- const containerRef = useRef();
+ const referenceRef = useRef()
+ const containerRef = useRef()
useEffect(() => {
- const focusElement = (el) => el.focus({ preventScroll: true });
- return proxyTabFocus(
- containerRef.current,
- referenceRef.current,
- focusElement,
- );
- }, []);
+ const focusElement = (el) => el.focus({ preventScroll: true })
+ return proxyTabFocus(containerRef.current, referenceRef.current, focusElement)
+ }, [])
return (
@@ -437,7 +433,7 @@
- );
+ )
}
```
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d1b1050917..67c4365c34 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -225,6 +225,9 @@ importers:
'@zag-js/file-utils':
specifier: workspace:*
version: link:../../packages/utilities/file-utils
+ '@zag-js/floating-panel':
+ specifier: workspace:*
+ version: link:../../packages/machines/floating-panel
'@zag-js/focus-scope':
specifier: workspace:*
version: link:../../packages/utilities/focus-scope
@@ -475,6 +478,9 @@ importers:
'@zag-js/file-utils':
specifier: workspace:*
version: link:../../packages/utilities/file-utils
+ '@zag-js/floating-panel':
+ specifier: workspace:*
+ version: link:../../packages/machines/floating-panel
'@zag-js/focus-scope':
specifier: workspace:*
version: link:../../packages/utilities/focus-scope
@@ -713,6 +719,9 @@ importers:
'@zag-js/file-utils':
specifier: workspace:*
version: link:../../packages/utilities/file-utils
+ '@zag-js/floating-panel':
+ specifier: workspace:*
+ version: link:../../packages/machines/floating-panel
'@zag-js/focus-scope':
specifier: workspace:*
version: link:../../packages/utilities/focus-scope
@@ -954,6 +963,9 @@ importers:
'@zag-js/file-utils':
specifier: workspace:*
version: link:../../packages/utilities/file-utils
+ '@zag-js/floating-panel':
+ specifier: workspace:*
+ version: link:../../packages/machines/floating-panel
'@zag-js/focus-scope':
specifier: workspace:*
version: link:../../packages/utilities/focus-scope
@@ -1183,6 +1195,9 @@ importers:
'@zag-js/file-utils':
specifier: workspace:*
version: link:../../packages/utilities/file-utils
+ '@zag-js/floating-panel':
+ specifier: workspace:*
+ version: link:../../packages/machines/floating-panel
'@zag-js/focus-scope':
specifier: workspace:*
version: link:../../packages/utilities/focus-scope
@@ -1430,6 +1445,9 @@ importers:
'@zag-js/file-utils':
specifier: workspace:*
version: link:../../packages/utilities/file-utils
+ '@zag-js/floating-panel':
+ specifier: workspace:*
+ version: link:../../packages/machines/floating-panel
'@zag-js/focus-scope':
specifier: workspace:*
version: link:../../packages/utilities/focus-scope
@@ -2165,6 +2183,43 @@ importers:
specifier: 2.2.0
version: 2.2.0
+ packages/machines/floating-panel:
+ dependencies:
+ '@zag-js/anatomy':
+ specifier: workspace:*
+ version: link:../../anatomy
+ '@zag-js/core':
+ specifier: workspace:*
+ version: link:../../core
+ '@zag-js/dismissable':
+ specifier: workspace:*
+ version: link:../../utilities/dismissable
+ '@zag-js/dom-event':
+ specifier: workspace:*
+ version: link:../../utilities/dom-event
+ '@zag-js/dom-query':
+ specifier: workspace:*
+ version: link:../../utilities/dom-query
+ '@zag-js/numeric-range':
+ specifier: workspace:*
+ version: link:../../utilities/numeric-range
+ '@zag-js/popper':
+ specifier: workspace:*
+ version: link:../../utilities/popper
+ '@zag-js/rect-utils':
+ specifier: workspace:*
+ version: link:../../utilities/rect
+ '@zag-js/types':
+ specifier: workspace:*
+ version: link:../../types
+ '@zag-js/utils':
+ specifier: workspace:*
+ version: link:../../utilities/core
+ devDependencies:
+ clean-package:
+ specifier: 2.2.0
+ version: 2.2.0
+
packages/machines/hover-card:
dependencies:
'@zag-js/anatomy':
@@ -3453,7 +3508,7 @@ importers:
version: link:../packages/machines/tooltip
contentlayer:
specifier: 0.3.4
- version: 0.3.4(esbuild@0.20.1)
+ version: 0.3.4(esbuild@0.20.2)
hastscript:
specifier: 9.0.0
version: 9.0.0
@@ -3468,7 +3523,7 @@ importers:
version: 14.1.3(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0)
next-contentlayer:
specifier: 0.3.4
- version: 0.3.4(contentlayer@0.3.4)(esbuild@0.20.1)(next@14.1.3)(react-dom@18.2.0)(react@18.2.0)
+ version: 0.3.4(contentlayer@0.3.4)(esbuild@0.20.2)(next@14.1.3)(react-dom@18.2.0)(react@18.2.0)
next-seo:
specifier: 6.5.0
version: 6.5.0(next@14.1.3)(react-dom@18.2.0)(react@18.2.0)
@@ -4530,10 +4585,10 @@ packages:
chalk: 5.3.0
dev: false
- /@contentlayer/cli@0.3.4(esbuild@0.20.1):
+ /@contentlayer/cli@0.3.4(esbuild@0.20.2):
resolution: {integrity: sha512-vNDwgLuhYNu+m70NZ3XK9kexKNguuxPXg7Yvzj3B34cEilQjjzSrcTY/i+AIQm9V7uT5GGshx9ukzPf+SmoszQ==}
dependencies:
- '@contentlayer/core': 0.3.4(esbuild@0.20.1)
+ '@contentlayer/core': 0.3.4(esbuild@0.20.2)
'@contentlayer/utils': 0.3.4
clipanion: 3.2.1(typanion@3.14.0)
typanion: 3.14.0
@@ -4544,10 +4599,10 @@ packages:
- supports-color
dev: false
- /@contentlayer/client@0.3.4(esbuild@0.20.1):
+ /@contentlayer/client@0.3.4(esbuild@0.20.2):
resolution: {integrity: sha512-QSlLyc3y4PtdC5lFw0L4wTZUH8BQnv2nk37hNCsPAqGf+dRO7TLAzdc+2/mVIRgK+vSH+pSOzjLsQpFxxXRTZA==}
dependencies:
- '@contentlayer/core': 0.3.4(esbuild@0.20.1)
+ '@contentlayer/core': 0.3.4(esbuild@0.20.2)
transitivePeerDependencies:
- '@effect-ts/otel-node'
- esbuild
@@ -4555,7 +4610,7 @@ packages:
- supports-color
dev: false
- /@contentlayer/core@0.3.4(esbuild@0.20.1):
+ /@contentlayer/core@0.3.4(esbuild@0.20.2):
resolution: {integrity: sha512-o68oBLwfYZ+2vtgfk1lgHxOl3LoxvRNiUfeQ8IWFWy/L4wnIkKIqLZX01zlRE5IzYM+ZMMN5V0cKQlO7DsyR9g==}
peerDependencies:
esbuild: 0.17.x || 0.18.x
@@ -4569,9 +4624,9 @@ packages:
'@contentlayer/utils': 0.3.4
camel-case: 4.1.2
comment-json: 4.2.3
- esbuild: 0.20.1
+ esbuild: 0.20.2
gray-matter: 4.0.3
- mdx-bundler: 9.2.1(esbuild@0.20.1)
+ mdx-bundler: 9.2.1(esbuild@0.20.2)
rehype-stringify: 9.0.4
remark-frontmatter: 4.0.1
remark-parse: 10.0.2
@@ -4584,10 +4639,10 @@ packages:
- supports-color
dev: false
- /@contentlayer/source-files@0.3.4(esbuild@0.20.1):
+ /@contentlayer/source-files@0.3.4(esbuild@0.20.2):
resolution: {integrity: sha512-4njyn0OFPu7WY4tAjMxiJgWOKeiHuBOGdQ36EYE03iij/pPPRbiWbL+cmLccYXUFEW58mDwpqROZZm6pnxjRDQ==}
dependencies:
- '@contentlayer/core': 0.3.4(esbuild@0.20.1)
+ '@contentlayer/core': 0.3.4(esbuild@0.20.2)
'@contentlayer/utils': 0.3.4
chokidar: 3.6.0
fast-glob: 3.3.2
@@ -4605,11 +4660,11 @@ packages:
- supports-color
dev: false
- /@contentlayer/source-remote-files@0.3.4(esbuild@0.20.1):
+ /@contentlayer/source-remote-files@0.3.4(esbuild@0.20.2):
resolution: {integrity: sha512-cyiv4sNUySZvR0uAKlM+kSAELzNd2h2QT1R2e41dRKbwOUVxeLfmGiLugr0aVac6Q3xYcD99dbHyR1xWPV+w9w==}
dependencies:
- '@contentlayer/core': 0.3.4(esbuild@0.20.1)
- '@contentlayer/source-files': 0.3.4(esbuild@0.20.1)
+ '@contentlayer/core': 0.3.4(esbuild@0.20.2)
+ '@contentlayer/source-files': 0.3.4(esbuild@0.20.2)
'@contentlayer/utils': 0.3.4
transitivePeerDependencies:
- '@effect-ts/otel-node'
@@ -4821,14 +4876,14 @@ packages:
resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==}
dev: false
- /@esbuild-plugins/node-resolve@0.1.4(esbuild@0.20.1):
+ /@esbuild-plugins/node-resolve@0.1.4(esbuild@0.20.2):
resolution: {integrity: sha512-haFQ0qhxEpqtWWY0kx1Y5oE3sMyO1PcoSiWEPrAw6tm/ZOOLXjSs6Q+v1v9eyuVF0nNt50YEvrcrvENmyoMv5g==}
peerDependencies:
esbuild: '*'
dependencies:
'@types/resolve': 1.20.6
debug: 4.3.4
- esbuild: 0.20.1
+ esbuild: 0.20.2
escape-string-regexp: 4.0.0
resolve: 1.22.8
transitivePeerDependencies:
@@ -4843,22 +4898,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/aix-ppc64@0.20.1:
- resolution: {integrity: sha512-m55cpeupQ2DbuRGQMMZDzbv9J9PgVelPjlcmM5kxHnrBdBx6REaEd7LamYV7Dm8N7rCyR/XwU6rVP8ploKtIkA==}
- engines: {node: '>=12'}
- cpu: [ppc64]
- os: [aix]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/aix-ppc64@0.20.2:
resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [aix]
requiresBuild: true
- dev: true
optional: true
/@esbuild/android-arm64@0.17.19:
@@ -4878,22 +4923,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/android-arm64@0.20.1:
- resolution: {integrity: sha512-hCnXNF0HM6AjowP+Zou0ZJMWWa1VkD77BXe959zERgGJBBxB+sV+J9f/rcjeg2c5bsukD/n17RKWXGFCO5dD5A==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [android]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/android-arm64@0.20.2:
resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==}
engines: {node: '>=12'}
cpu: [arm64]
os: [android]
requiresBuild: true
- dev: true
optional: true
/@esbuild/android-arm@0.17.19:
@@ -4913,22 +4948,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/android-arm@0.20.1:
- resolution: {integrity: sha512-4j0+G27/2ZXGWR5okcJi7pQYhmkVgb4D7UKwxcqrjhvp5TKWx3cUjgB1CGj1mfdmJBQ9VnUGgUhign+FPF2Zgw==}
- engines: {node: '>=12'}
- cpu: [arm]
- os: [android]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/android-arm@0.20.2:
resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==}
engines: {node: '>=12'}
cpu: [arm]
os: [android]
requiresBuild: true
- dev: true
optional: true
/@esbuild/android-x64@0.17.19:
@@ -4948,22 +4973,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/android-x64@0.20.1:
- resolution: {integrity: sha512-MSfZMBoAsnhpS+2yMFYIQUPs8Z19ajwfuaSZx+tSl09xrHZCjbeXXMsUF/0oq7ojxYEpsSo4c0SfjxOYXRbpaA==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [android]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/android-x64@0.20.2:
resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==}
engines: {node: '>=12'}
cpu: [x64]
os: [android]
requiresBuild: true
- dev: true
optional: true
/@esbuild/darwin-arm64@0.17.19:
@@ -4983,22 +4998,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/darwin-arm64@0.20.1:
- resolution: {integrity: sha512-Ylk6rzgMD8klUklGPzS414UQLa5NPXZD5tf8JmQU8GQrj6BrFA/Ic9tb2zRe1kOZyCbGl+e8VMbDRazCEBqPvA==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [darwin]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/darwin-arm64@0.20.2:
resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==}
engines: {node: '>=12'}
cpu: [arm64]
os: [darwin]
requiresBuild: true
- dev: true
optional: true
/@esbuild/darwin-x64@0.17.19:
@@ -5018,22 +5023,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/darwin-x64@0.20.1:
- resolution: {integrity: sha512-pFIfj7U2w5sMp52wTY1XVOdoxw+GDwy9FsK3OFz4BpMAjvZVs0dT1VXs8aQm22nhwoIWUmIRaE+4xow8xfIDZA==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [darwin]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/darwin-x64@0.20.2:
resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==}
engines: {node: '>=12'}
cpu: [x64]
os: [darwin]
requiresBuild: true
- dev: true
optional: true
/@esbuild/freebsd-arm64@0.17.19:
@@ -5053,22 +5048,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/freebsd-arm64@0.20.1:
- resolution: {integrity: sha512-UyW1WZvHDuM4xDz0jWun4qtQFauNdXjXOtIy7SYdf7pbxSWWVlqhnR/T2TpX6LX5NI62spt0a3ldIIEkPM6RHw==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [freebsd]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/freebsd-arm64@0.20.2:
resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==}
engines: {node: '>=12'}
cpu: [arm64]
os: [freebsd]
requiresBuild: true
- dev: true
optional: true
/@esbuild/freebsd-x64@0.17.19:
@@ -5088,22 +5073,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/freebsd-x64@0.20.1:
- resolution: {integrity: sha512-itPwCw5C+Jh/c624vcDd9kRCCZVpzpQn8dtwoYIt2TJF3S9xJLiRohnnNrKwREvcZYx0n8sCSbvGH349XkcQeg==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [freebsd]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/freebsd-x64@0.20.2:
resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==}
engines: {node: '>=12'}
cpu: [x64]
os: [freebsd]
requiresBuild: true
- dev: true
optional: true
/@esbuild/linux-arm64@0.17.19:
@@ -5123,22 +5098,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/linux-arm64@0.20.1:
- resolution: {integrity: sha512-cX8WdlF6Cnvw/DO9/X7XLH2J6CkBnz7Twjpk56cshk9sjYVcuh4sXQBy5bmTwzBjNVZze2yaV1vtcJS04LbN8w==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [linux]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/linux-arm64@0.20.2:
resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==}
engines: {node: '>=12'}
cpu: [arm64]
os: [linux]
requiresBuild: true
- dev: true
optional: true
/@esbuild/linux-arm@0.17.19:
@@ -5158,22 +5123,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/linux-arm@0.20.1:
- resolution: {integrity: sha512-LojC28v3+IhIbfQ+Vu4Ut5n3wKcgTu6POKIHN9Wpt0HnfgUGlBuyDDQR4jWZUZFyYLiz4RBBBmfU6sNfn6RhLw==}
- engines: {node: '>=12'}
- cpu: [arm]
- os: [linux]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/linux-arm@0.20.2:
resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==}
engines: {node: '>=12'}
cpu: [arm]
os: [linux]
requiresBuild: true
- dev: true
optional: true
/@esbuild/linux-ia32@0.17.19:
@@ -5193,22 +5148,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/linux-ia32@0.20.1:
- resolution: {integrity: sha512-4H/sQCy1mnnGkUt/xszaLlYJVTz3W9ep52xEefGtd6yXDQbz/5fZE5dFLUgsPdbUOQANcVUa5iO6g3nyy5BJiw==}
- engines: {node: '>=12'}
- cpu: [ia32]
- os: [linux]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/linux-ia32@0.20.2:
resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==}
engines: {node: '>=12'}
cpu: [ia32]
os: [linux]
requiresBuild: true
- dev: true
optional: true
/@esbuild/linux-loong64@0.17.19:
@@ -5228,22 +5173,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/linux-loong64@0.20.1:
- resolution: {integrity: sha512-c0jgtB+sRHCciVXlyjDcWb2FUuzlGVRwGXgI+3WqKOIuoo8AmZAddzeOHeYLtD+dmtHw3B4Xo9wAUdjlfW5yYA==}
- engines: {node: '>=12'}
- cpu: [loong64]
- os: [linux]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/linux-loong64@0.20.2:
resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==}
engines: {node: '>=12'}
cpu: [loong64]
os: [linux]
requiresBuild: true
- dev: true
optional: true
/@esbuild/linux-mips64el@0.17.19:
@@ -5263,22 +5198,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/linux-mips64el@0.20.1:
- resolution: {integrity: sha512-TgFyCfIxSujyuqdZKDZ3yTwWiGv+KnlOeXXitCQ+trDODJ+ZtGOzLkSWngynP0HZnTsDyBbPy7GWVXWaEl6lhA==}
- engines: {node: '>=12'}
- cpu: [mips64el]
- os: [linux]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/linux-mips64el@0.20.2:
resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==}
engines: {node: '>=12'}
cpu: [mips64el]
os: [linux]
requiresBuild: true
- dev: true
optional: true
/@esbuild/linux-ppc64@0.17.19:
@@ -5298,22 +5223,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/linux-ppc64@0.20.1:
- resolution: {integrity: sha512-b+yuD1IUeL+Y93PmFZDZFIElwbmFfIKLKlYI8M6tRyzE6u7oEP7onGk0vZRh8wfVGC2dZoy0EqX1V8qok4qHaw==}
- engines: {node: '>=12'}
- cpu: [ppc64]
- os: [linux]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/linux-ppc64@0.20.2:
resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==}
engines: {node: '>=12'}
cpu: [ppc64]
os: [linux]
requiresBuild: true
- dev: true
optional: true
/@esbuild/linux-riscv64@0.17.19:
@@ -5333,22 +5248,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/linux-riscv64@0.20.1:
- resolution: {integrity: sha512-wpDlpE0oRKZwX+GfomcALcouqjjV8MIX8DyTrxfyCfXxoKQSDm45CZr9fanJ4F6ckD4yDEPT98SrjvLwIqUCgg==}
- engines: {node: '>=12'}
- cpu: [riscv64]
- os: [linux]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/linux-riscv64@0.20.2:
resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==}
engines: {node: '>=12'}
cpu: [riscv64]
os: [linux]
requiresBuild: true
- dev: true
optional: true
/@esbuild/linux-s390x@0.17.19:
@@ -5368,22 +5273,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/linux-s390x@0.20.1:
- resolution: {integrity: sha512-5BepC2Au80EohQ2dBpyTquqGCES7++p7G+7lXe1bAIvMdXm4YYcEfZtQrP4gaoZ96Wv1Ute61CEHFU7h4FMueQ==}
- engines: {node: '>=12'}
- cpu: [s390x]
- os: [linux]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/linux-s390x@0.20.2:
resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==}
engines: {node: '>=12'}
cpu: [s390x]
os: [linux]
requiresBuild: true
- dev: true
optional: true
/@esbuild/linux-x64@0.17.19:
@@ -5403,22 +5298,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/linux-x64@0.20.1:
- resolution: {integrity: sha512-5gRPk7pKuaIB+tmH+yKd2aQTRpqlf1E4f/mC+tawIm/CGJemZcHZpp2ic8oD83nKgUPMEd0fNanrnFljiruuyA==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [linux]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/linux-x64@0.20.2:
resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==}
engines: {node: '>=12'}
cpu: [x64]
os: [linux]
requiresBuild: true
- dev: true
optional: true
/@esbuild/netbsd-x64@0.17.19:
@@ -5438,22 +5323,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/netbsd-x64@0.20.1:
- resolution: {integrity: sha512-4fL68JdrLV2nVW2AaWZBv3XEm3Ae3NZn/7qy2KGAt3dexAgSVT+Hc97JKSZnqezgMlv9x6KV0ZkZY7UO5cNLCg==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [netbsd]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/netbsd-x64@0.20.2:
resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [netbsd]
requiresBuild: true
- dev: true
optional: true
/@esbuild/openbsd-x64@0.17.19:
@@ -5473,22 +5348,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/openbsd-x64@0.20.1:
- resolution: {integrity: sha512-GhRuXlvRE+twf2ES+8REbeCb/zeikNqwD3+6S5y5/x+DYbAQUNl0HNBs4RQJqrechS4v4MruEr8ZtAin/hK5iw==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [openbsd]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/openbsd-x64@0.20.2:
resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [openbsd]
requiresBuild: true
- dev: true
optional: true
/@esbuild/sunos-x64@0.17.19:
@@ -5508,22 +5373,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/sunos-x64@0.20.1:
- resolution: {integrity: sha512-ZnWEyCM0G1Ex6JtsygvC3KUUrlDXqOihw8RicRuQAzw+c4f1D66YlPNNV3rkjVW90zXVsHwZYWbJh3v+oQFM9Q==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [sunos]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/sunos-x64@0.20.2:
resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==}
engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
requiresBuild: true
- dev: true
optional: true
/@esbuild/win32-arm64@0.17.19:
@@ -5543,22 +5398,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/win32-arm64@0.20.1:
- resolution: {integrity: sha512-QZ6gXue0vVQY2Oon9WyLFCdSuYbXSoxaZrPuJ4c20j6ICedfsDilNPYfHLlMH7vGfU5DQR0czHLmJvH4Nzis/A==}
- engines: {node: '>=12'}
- cpu: [arm64]
- os: [win32]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/win32-arm64@0.20.2:
resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==}
engines: {node: '>=12'}
cpu: [arm64]
os: [win32]
requiresBuild: true
- dev: true
optional: true
/@esbuild/win32-ia32@0.17.19:
@@ -5578,22 +5423,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/win32-ia32@0.20.1:
- resolution: {integrity: sha512-HzcJa1NcSWTAU0MJIxOho8JftNp9YALui3o+Ny7hCh0v5f90nprly1U3Sj1Ldj/CvKKdvvFsCRvDkpsEMp4DNw==}
- engines: {node: '>=12'}
- cpu: [ia32]
- os: [win32]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/win32-ia32@0.20.2:
resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==}
engines: {node: '>=12'}
cpu: [ia32]
os: [win32]
requiresBuild: true
- dev: true
optional: true
/@esbuild/win32-x64@0.17.19:
@@ -5613,22 +5448,12 @@ packages:
requiresBuild: true
optional: true
- /@esbuild/win32-x64@0.20.1:
- resolution: {integrity: sha512-0MBh53o6XtI6ctDnRMeQ+xoCN8kD2qI1rY1KgF/xdWQwoFeKou7puvDfV8/Wv4Ctx2rRpET/gGdz3YlNtNACSA==}
- engines: {node: '>=12'}
- cpu: [x64]
- os: [win32]
- requiresBuild: true
- dev: false
- optional: true
-
/@esbuild/win32-x64@0.20.2:
resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==}
engines: {node: '>=12'}
cpu: [x64]
os: [win32]
requiresBuild: true
- dev: true
optional: true
/@eslint-community/eslint-utils@4.4.0(eslint@8.57.0):
@@ -5879,13 +5704,13 @@ packages:
resolution: {integrity: sha512-/AHFqy6OeNHS2NNZGFVRgQh+pnW8iAoV3d1fiO9b2PuQ3HzZpC30MrMrHtq1uOGy1/zcK4uPQEyI31jkM0NNAA==}
dev: true
- /@mdx-js/esbuild@2.3.0(esbuild@0.20.1):
+ /@mdx-js/esbuild@2.3.0(esbuild@0.20.2):
resolution: {integrity: sha512-r/vsqsM0E+U4Wr0DK+0EfmABE/eg+8ITW4DjvYdh3ve/tK2safaqHArNnaqbOk1DjYGrhxtoXoGaM3BY8fGBTA==}
peerDependencies:
esbuild: '>=0.11.0'
dependencies:
'@mdx-js/mdx': 2.3.0
- esbuild: 0.20.1
+ esbuild: 0.20.2
node-fetch: 3.3.2
vfile: 5.3.7
transitivePeerDependencies:
@@ -10046,17 +9871,17 @@ packages:
upper-case: 2.0.2
dev: false
- /contentlayer@0.3.4(esbuild@0.20.1):
+ /contentlayer@0.3.4(esbuild@0.20.2):
resolution: {integrity: sha512-FYDdTUFaN4yqep0waswrhcXjmMJnPD5iXDTtxcUCGdklfuIrXM2xLx51xl748cHmGA6IsC+27YZFxU6Ym13QIA==}
engines: {node: '>=14.18'}
hasBin: true
requiresBuild: true
dependencies:
- '@contentlayer/cli': 0.3.4(esbuild@0.20.1)
- '@contentlayer/client': 0.3.4(esbuild@0.20.1)
- '@contentlayer/core': 0.3.4(esbuild@0.20.1)
- '@contentlayer/source-files': 0.3.4(esbuild@0.20.1)
- '@contentlayer/source-remote-files': 0.3.4(esbuild@0.20.1)
+ '@contentlayer/cli': 0.3.4(esbuild@0.20.2)
+ '@contentlayer/client': 0.3.4(esbuild@0.20.2)
+ '@contentlayer/core': 0.3.4(esbuild@0.20.2)
+ '@contentlayer/source-files': 0.3.4(esbuild@0.20.2)
+ '@contentlayer/source-remote-files': 0.3.4(esbuild@0.20.2)
'@contentlayer/utils': 0.3.4
transitivePeerDependencies:
- '@effect-ts/otel-node'
@@ -10936,37 +10761,6 @@ packages:
'@esbuild/win32-ia32': 0.19.12
'@esbuild/win32-x64': 0.19.12
- /esbuild@0.20.1:
- resolution: {integrity: sha512-OJwEgrpWm/PCMsLVWXKqvcjme3bHNpOgN7Tb6cQnR5n0TPbQx1/Xrn7rqM+wn17bYeT6MGB5sn1Bh5YiGi70nA==}
- engines: {node: '>=12'}
- hasBin: true
- requiresBuild: true
- optionalDependencies:
- '@esbuild/aix-ppc64': 0.20.1
- '@esbuild/android-arm': 0.20.1
- '@esbuild/android-arm64': 0.20.1
- '@esbuild/android-x64': 0.20.1
- '@esbuild/darwin-arm64': 0.20.1
- '@esbuild/darwin-x64': 0.20.1
- '@esbuild/freebsd-arm64': 0.20.1
- '@esbuild/freebsd-x64': 0.20.1
- '@esbuild/linux-arm': 0.20.1
- '@esbuild/linux-arm64': 0.20.1
- '@esbuild/linux-ia32': 0.20.1
- '@esbuild/linux-loong64': 0.20.1
- '@esbuild/linux-mips64el': 0.20.1
- '@esbuild/linux-ppc64': 0.20.1
- '@esbuild/linux-riscv64': 0.20.1
- '@esbuild/linux-s390x': 0.20.1
- '@esbuild/linux-x64': 0.20.1
- '@esbuild/netbsd-x64': 0.20.1
- '@esbuild/openbsd-x64': 0.20.1
- '@esbuild/sunos-x64': 0.20.1
- '@esbuild/win32-arm64': 0.20.1
- '@esbuild/win32-ia32': 0.20.1
- '@esbuild/win32-x64': 0.20.1
- dev: false
-
/esbuild@0.20.2:
resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==}
engines: {node: '>=12'}
@@ -10996,7 +10790,6 @@ packages:
'@esbuild/win32-arm64': 0.20.2
'@esbuild/win32-ia32': 0.20.2
'@esbuild/win32-x64': 0.20.2
- dev: true
/escalade@3.1.2:
resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==}
@@ -14211,17 +14004,17 @@ packages:
resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==}
dev: true
- /mdx-bundler@9.2.1(esbuild@0.20.1):
+ /mdx-bundler@9.2.1(esbuild@0.20.2):
resolution: {integrity: sha512-hWEEip1KU9MCNqeH2rqwzAZ1pdqPPbfkx9OTJjADqGPQz4t9BO85fhI7AP9gVYrpmfArf9/xJZUN0yBErg/G/Q==}
engines: {node: '>=14', npm: '>=6'}
peerDependencies:
esbuild: 0.*
dependencies:
'@babel/runtime': 7.24.0
- '@esbuild-plugins/node-resolve': 0.1.4(esbuild@0.20.1)
+ '@esbuild-plugins/node-resolve': 0.1.4(esbuild@0.20.2)
'@fal-works/esbuild-plugin-global-externals': 2.1.2
- '@mdx-js/esbuild': 2.3.0(esbuild@0.20.1)
- esbuild: 0.20.1
+ '@mdx-js/esbuild': 2.3.0(esbuild@0.20.2)
+ esbuild: 0.20.2
gray-matter: 4.0.3
remark-frontmatter: 4.0.1
remark-mdx-frontmatter: 1.1.1
@@ -14976,7 +14769,7 @@ packages:
resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==}
dev: false
- /next-contentlayer@0.3.4(contentlayer@0.3.4)(esbuild@0.20.1)(next@14.1.3)(react-dom@18.2.0)(react@18.2.0):
+ /next-contentlayer@0.3.4(contentlayer@0.3.4)(esbuild@0.20.2)(next@14.1.3)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-UtUCwgAl159KwfhNaOwyiI7Lg6sdioyKMeh+E7jxx0CJ29JuXGxBEYmCI6+72NxFGIFZKx8lvttbbQhbnYWYSw==}
peerDependencies:
contentlayer: 0.3.4
@@ -14984,9 +14777,9 @@ packages:
react: '*'
react-dom: '*'
dependencies:
- '@contentlayer/core': 0.3.4(esbuild@0.20.1)
+ '@contentlayer/core': 0.3.4(esbuild@0.20.2)
'@contentlayer/utils': 0.3.4
- contentlayer: 0.3.4(esbuild@0.20.1)
+ contentlayer: 0.3.4(esbuild@0.20.2)
next: 14.1.3(@opentelemetry/api@1.8.0)(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
diff --git a/shared/src/controls.ts b/shared/src/controls.ts
index 7e20a97300..5ff8d5f9a4 100644
--- a/shared/src/controls.ts
+++ b/shared/src/controls.ts
@@ -246,3 +246,11 @@ export const tourControls = defineControls({
closeOnInteractOutside: { type: "boolean", defaultValue: true },
preventInteraction: { type: "boolean", defaultValue: true },
})
+
+export const floatingPanelControls = defineControls({
+ disabled: { type: "boolean", defaultValue: false },
+ resizable: { type: "boolean", defaultValue: true },
+ draggable: { type: "boolean", defaultValue: true },
+ lockAspectRatio: { type: "boolean", defaultValue: false },
+ closeOnEscape: { type: "boolean", defaultValue: true },
+})
diff --git a/shared/src/routes.ts b/shared/src/routes.ts
index e135679c0a..3c8e722afa 100644
--- a/shared/src/routes.ts
+++ b/shared/src/routes.ts
@@ -4,6 +4,7 @@ type RouteData = {
}
export const routesData: RouteData[] = [
+ { label: "Floating Panel", path: "/floating-panel" },
{ label: "Tour", path: "/tour" },
{ label: "Collapsible", path: "/collapsible" },
{ label: "Clipboard", path: "/clipboard" },
diff --git a/shared/src/style.css b/shared/src/style.css
index 00b5632063..9f23630b4d 100644
--- a/shared/src/style.css
+++ b/shared/src/style.css
@@ -26,6 +26,10 @@ ul {
padding-inline-start: 0;
}
+[hidden] {
+ display: none !important;
+}
+
.pre {
background: rgba(0, 0, 0, 0.05);
padding: 20px;
@@ -1980,6 +1984,84 @@ main [data-testid="scrubber"] {
height: 100px;
}
+/* -----------------------------------------------------------------------------
+* Floating Panel
+* -----------------------------------------------------------------------------*/
+
+[data-scope="floating-panel"][data-part="content"] {
+ border: 1px solid #ebebeb;
+ box-shadow:
+ rgba(0, 0, 0, 0.28) 0px 16px 18px 0px,
+ rgba(0, 0, 0, 0.12) 0px 4px 16px 0px;
+ outline: 0 !important;
+ background-color: white;
+ display: flex;
+ flex-direction: column;
+}
+
+[data-scope="floating-panel"][data-part="body"] {
+ position: relative;
+ overflow: auto;
+ flex: 1 1 auto;
+ padding-block: 16px;
+ padding-inline: 16px;
+ background-color: white;
+}
+
+[data-scope="floating-panel"][data-part="header"] {
+ padding-block: 4px;
+ padding-inline: 16px;
+ background-color: #f5f5f5;
+ border-bottom: 1px solid #ebebeb;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+[data-scope="floating-panel"][data-part="header"] button {
+ width: 24px;
+ height: 24px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 14px;
+ padding: 0;
+ svg {
+ width: 1em;
+ height: 1em;
+ }
+}
+
+[data-scope="floating-panel"][data-part="trigger-group"] {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+[data-scope="floating-panel"][data-part="resize-trigger"] {
+ background-color: rgba(154, 18, 18, 0.396);
+
+ &[data-axis="n"],
+ &[data-axis="s"] {
+ height: 6px;
+ max-width: 90%;
+ }
+
+ &[data-axis="e"],
+ &[data-axis="w"] {
+ width: 6px;
+ max-height: 90%;
+ }
+
+ &[data-axis="ne"],
+ &[data-axis="nw"],
+ &[data-axis="se"],
+ &[data-axis="sw"] {
+ width: 10px;
+ height: 10px;
+ }
+}
+
/* -----------------------------------------------------------------------------
* Page Shell
* -----------------------------------------------------------------------------*/