@gridui/navigation-flyout 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/dist/index.d.ts +20 -0
- package/dist/index.js +185 -0
- package/dist/index.js.map +7 -0
- package/dist/navigation-flyout/navigation-flyout.d.ts +10 -0
- package/dist/navigation-flyout-content/navigation-flyout-content.d.ts +12 -0
- package/dist/navigation-flyout-item/navigation-flyout-item.d.ts +10 -0
- package/dist/navigation-flyout-link/navigation-flyout-link.d.ts +10 -0
- package/dist/navigation-flyout-list/navigation-flyout-list.d.ts +10 -0
- package/dist/navigation-flyout-trigger/navigation-flyout-trigger.d.ts +10 -0
- package/dist/navigation-flyout-viewport/navigation-flyout-viewport.d.ts +10 -0
- package/dist/styled.js +3 -0
- package/dist/styles.css +297 -0
- package/dist/styles.local.css +100 -0
- package/docs/catalog.json +101 -0
- package/docs/reference/README.md +10 -0
- package/docs/reference/navigation-flyout-content.md +102 -0
- package/docs/reference/navigation-flyout-item.md +67 -0
- package/docs/reference/navigation-flyout-link.md +71 -0
- package/docs/reference/navigation-flyout-list.md +61 -0
- package/docs/reference/navigation-flyout-trigger.md +61 -0
- package/docs/reference/navigation-flyout-viewport.md +51 -0
- package/docs/reference/navigation-flyout.md +106 -0
- package/package.json +55 -3
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gridui/navigation-flyout
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Horizontal site navigation with a shared floating viewport. Use it when several triggers reveal different groups of destinations in one place. It does not depend on Popover and is not an action menu.
|
|
4
|
+
|
|
5
|
+
## Import and styles
|
|
6
|
+
|
|
7
|
+
Load `@gridui/theme/styles.css` once, followed by `@gridui/navigation-flyout/styles.css`. Alternatively, use `@gridui/navigation-flyout/styled` in a CSS-aware bundler and load only Theme separately. Both JavaScript entries expose the same public API.
|
|
8
|
+
|
|
9
|
+
## Composition
|
|
10
|
+
|
|
11
|
+
- Put `NavigationFlyoutItem` components in a `NavigationFlyoutList`. Each item contains `NavigationFlyoutTrigger` with `NavigationFlyoutContent`, or a direct `NavigationFlyoutLink`.
|
|
12
|
+
- Render one `NavigationFlyoutViewport` after the list. It anchors at the navigation's inline start, stays mounted when changing between open panels, and sizes to the active content. Use an unclipped header region for the inline viewport.
|
|
13
|
+
- Give `NavigationFlyout` an accessible label. `value`, `defaultValue`, and `onValueChange` support controlled or uncontrolled use. An empty string is the closed value. `dir` supports explicit left-to-right or right-to-left navigation.
|
|
14
|
+
- `NavigationFlyoutContent.width` accepts a number in CSS pixels, a CSS length such as `28rem`, or a standalone percentage such as `100%`. A percentage is relative to the available width, not to the measured panel. The default is `40rem`. Available width and height follow the anchor while open; tall content scrolls. The default content has no padding so grids can reach the panel edges.
|
|
15
|
+
- Use `NavigationFlyoutLink` for native destinations. Use `asChild` to compose it with a link that forwards native anchor props and its ref. Use its `active` prop for the current destination. Open triggers and current links are distinct states.
|
|
16
|
+
|
|
17
|
+
The flyout uses a hover delay for mouse input and opens by click or keyboard. An ordinary same-context link activation closes it. Cancelled clicks, modified clicks, downloads, and links targeting another browsing context retain their native behavior without dismissing the flyout. The active panel follows the shared GridUI motion policy. Switching content never adds an independent popup. The component does not choose routes, group layouts, or a compact navigation pattern.
|
|
18
|
+
|
|
19
|
+
Pass a complete `NavigationFlyout` to `SiteNavigation.desktopNavigation` for a desktop panel and a separate compact drawer. Compose content with Grid, Menu, or native HTML. Use `NavigationLinks` separately for ordinary horizontal links that do not need a shared panel.
|
|
20
|
+
|
|
21
|
+
[Component reference](docs/reference/README.md) contains focused API pages. See [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-navigation/navigation-flyout/.changeset/history).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Navigation Flyout
|
|
4
|
+
* @namespace Root
|
|
5
|
+
* @description Index
|
|
6
|
+
*/
|
|
7
|
+
export { NavigationFlyout } from "./navigation-flyout/navigation-flyout";
|
|
8
|
+
export type { NavigationFlyoutProps } from "./navigation-flyout/navigation-flyout";
|
|
9
|
+
export { NavigationFlyoutContent } from "./navigation-flyout-content/navigation-flyout-content";
|
|
10
|
+
export type { NavigationFlyoutContentProps } from "./navigation-flyout-content/navigation-flyout-content";
|
|
11
|
+
export { NavigationFlyoutItem } from "./navigation-flyout-item/navigation-flyout-item";
|
|
12
|
+
export type { NavigationFlyoutItemProps } from "./navigation-flyout-item/navigation-flyout-item";
|
|
13
|
+
export { NavigationFlyoutLink } from "./navigation-flyout-link/navigation-flyout-link";
|
|
14
|
+
export type { NavigationFlyoutLinkProps } from "./navigation-flyout-link/navigation-flyout-link";
|
|
15
|
+
export { NavigationFlyoutList } from "./navigation-flyout-list/navigation-flyout-list";
|
|
16
|
+
export type { NavigationFlyoutListProps } from "./navigation-flyout-list/navigation-flyout-list";
|
|
17
|
+
export { NavigationFlyoutTrigger } from "./navigation-flyout-trigger/navigation-flyout-trigger";
|
|
18
|
+
export type { NavigationFlyoutTriggerProps } from "./navigation-flyout-trigger/navigation-flyout-trigger";
|
|
19
|
+
export { NavigationFlyoutViewport } from "./navigation-flyout-viewport/navigation-flyout-viewport";
|
|
20
|
+
export type { NavigationFlyoutViewportProps } from "./navigation-flyout-viewport/navigation-flyout-viewport";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// src/navigation-flyout/navigation-flyout.tsx
|
|
2
|
+
import { useMotionStyle } from "@gridui/motion/policy";
|
|
3
|
+
import { cn } from "@gridui/style-utils";
|
|
4
|
+
import { Root } from "@radix-ui/react-navigation-menu";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var NavigationFlyout = ({ className, style, ...props }) => {
|
|
7
|
+
const motionStyle = useMotionStyle();
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Root,
|
|
10
|
+
{
|
|
11
|
+
...props,
|
|
12
|
+
orientation: "horizontal",
|
|
13
|
+
className: cn("gridui-navigation-flyout", className),
|
|
14
|
+
style: { ...style, ...motionStyle }
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// src/navigation-flyout-content/navigation-flyout-content.tsx
|
|
20
|
+
import { useInteractionOutline, useScrollbars } from "@gridui/overlay";
|
|
21
|
+
import { cn as cn2 } from "@gridui/style-utils";
|
|
22
|
+
import { Content } from "@radix-ui/react-navigation-menu";
|
|
23
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
24
|
+
var contentWidth = (width) => {
|
|
25
|
+
if (typeof width === "number") {
|
|
26
|
+
return `${width}px`;
|
|
27
|
+
}
|
|
28
|
+
const percentage = /^(\d+(?:\.\d+)?|\.\d+)%$/.exec(width.trim())?.[1];
|
|
29
|
+
return percentage === void 0 ? width : `calc(var(--gridui-navigation-flyout-max-width) * ${Number(percentage) / 100})`;
|
|
30
|
+
};
|
|
31
|
+
var NavigationFlyoutContent = ({ className, ref, style, width, ...props }) => {
|
|
32
|
+
const scrollbarRef = useScrollbars({ ref });
|
|
33
|
+
const contentRef = useInteractionOutline({ ref: scrollbarRef });
|
|
34
|
+
const contentStyle = width === void 0 ? { ...style } : {
|
|
35
|
+
"--gridui-navigation-flyout-content-width": contentWidth(width),
|
|
36
|
+
...style
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ jsx2(
|
|
39
|
+
Content,
|
|
40
|
+
{
|
|
41
|
+
...props,
|
|
42
|
+
ref: contentRef,
|
|
43
|
+
className: cn2("gridui-navigation-flyout-content", className),
|
|
44
|
+
style: contentStyle
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// src/navigation-flyout-item/navigation-flyout-item.tsx
|
|
50
|
+
import { Item } from "@radix-ui/react-navigation-menu";
|
|
51
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
52
|
+
var NavigationFlyoutItem = (props) => /* @__PURE__ */ jsx3(Item, { ...props });
|
|
53
|
+
|
|
54
|
+
// src/navigation-flyout-link/navigation-flyout-link.tsx
|
|
55
|
+
import { getNavigationActivation } from "@gridui/interaction";
|
|
56
|
+
import { cn as cn3 } from "@gridui/style-utils";
|
|
57
|
+
import { Link } from "@radix-ui/react-navigation-menu";
|
|
58
|
+
import { useRef } from "react";
|
|
59
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
60
|
+
var NavigationFlyoutLink = ({ className, onClick, onSelect, ...props }) => {
|
|
61
|
+
const dismissForClick = useRef(false);
|
|
62
|
+
return /* @__PURE__ */ jsx4(
|
|
63
|
+
Link,
|
|
64
|
+
{
|
|
65
|
+
...props,
|
|
66
|
+
className: cn3("gridui-navigation-flyout-link", className),
|
|
67
|
+
onClick: (event) => {
|
|
68
|
+
onClick?.(event);
|
|
69
|
+
dismissForClick.current = getNavigationActivation(event) !== null;
|
|
70
|
+
},
|
|
71
|
+
onSelect: (event) => {
|
|
72
|
+
const dismiss = dismissForClick.current;
|
|
73
|
+
dismissForClick.current = false;
|
|
74
|
+
onSelect?.(event);
|
|
75
|
+
if (!dismiss) {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// src/navigation-flyout-list/navigation-flyout-list.tsx
|
|
84
|
+
import { cn as cn4 } from "@gridui/style-utils";
|
|
85
|
+
import { List } from "@radix-ui/react-navigation-menu";
|
|
86
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
87
|
+
var NavigationFlyoutList = ({ className, ...props }) => {
|
|
88
|
+
return /* @__PURE__ */ jsx5(
|
|
89
|
+
List,
|
|
90
|
+
{
|
|
91
|
+
...props,
|
|
92
|
+
className: cn4("gridui-navigation-flyout-list", className)
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// src/navigation-flyout-trigger/navigation-flyout-trigger.tsx
|
|
98
|
+
import { cn as cn5 } from "@gridui/style-utils";
|
|
99
|
+
import { Trigger } from "@radix-ui/react-navigation-menu";
|
|
100
|
+
import { ChevronDown } from "lucide-react";
|
|
101
|
+
import { Fragment, jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
102
|
+
var NavigationFlyoutTrigger = ({ asChild, children, className, ...props }) => {
|
|
103
|
+
return /* @__PURE__ */ jsx6(
|
|
104
|
+
Trigger,
|
|
105
|
+
{
|
|
106
|
+
...props,
|
|
107
|
+
asChild: asChild ?? false,
|
|
108
|
+
className: cn5("gridui-navigation-flyout-trigger", className),
|
|
109
|
+
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
110
|
+
children,
|
|
111
|
+
/* @__PURE__ */ jsx6(
|
|
112
|
+
ChevronDown,
|
|
113
|
+
{
|
|
114
|
+
"aria-hidden": "true",
|
|
115
|
+
className: "gridui-navigation-flyout-chevron"
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] })
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// src/navigation-flyout-viewport/navigation-flyout-viewport.tsx
|
|
124
|
+
import { interactionLayerProps, overlaySurfaceStyles } from "@gridui/overlay";
|
|
125
|
+
import { cn as cn6 } from "@gridui/style-utils";
|
|
126
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
127
|
+
import { Viewport } from "@radix-ui/react-navigation-menu";
|
|
128
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
129
|
+
var trackAvailableSpace = (viewport) => {
|
|
130
|
+
const anchor = viewport?.parentElement;
|
|
131
|
+
const view = anchor?.ownerDocument.defaultView;
|
|
132
|
+
const navigation = anchor?.parentElement;
|
|
133
|
+
if (!anchor || !navigation || !view) {
|
|
134
|
+
return void 0;
|
|
135
|
+
}
|
|
136
|
+
const documentRoot = anchor.ownerDocument.documentElement;
|
|
137
|
+
const style = view.getComputedStyle(anchor);
|
|
138
|
+
let frame = 0;
|
|
139
|
+
let width = -1;
|
|
140
|
+
let height = -1;
|
|
141
|
+
const measure = () => {
|
|
142
|
+
const bounds = anchor.getBoundingClientRect();
|
|
143
|
+
const navigationBounds = navigation.getBoundingClientRect();
|
|
144
|
+
const scaleX = navigation.offsetWidth ? navigationBounds.width / navigation.offsetWidth : 1;
|
|
145
|
+
const scaleY = navigation.offsetHeight ? navigationBounds.height / navigation.offsetHeight : 1;
|
|
146
|
+
const available = style.direction === "rtl" ? bounds.right : documentRoot.clientWidth - bounds.left;
|
|
147
|
+
const nextWidth = Math.max(0, available / (scaleX || 1));
|
|
148
|
+
const nextHeight = Math.max(0, (documentRoot.clientHeight - bounds.top) / (scaleY || 1));
|
|
149
|
+
if (nextWidth !== width) {
|
|
150
|
+
width = nextWidth;
|
|
151
|
+
anchor.style.setProperty("--gridui-navigation-flyout-available-width", `${width}px`);
|
|
152
|
+
}
|
|
153
|
+
if (nextHeight !== height) {
|
|
154
|
+
height = nextHeight;
|
|
155
|
+
anchor.style.setProperty("--gridui-navigation-flyout-available-height", `${height}px`);
|
|
156
|
+
}
|
|
157
|
+
frame = view.requestAnimationFrame(measure);
|
|
158
|
+
};
|
|
159
|
+
measure();
|
|
160
|
+
return () => {
|
|
161
|
+
view.cancelAnimationFrame(frame);
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
var NavigationFlyoutViewport = ({ className, ref: forwardedRef, ...props }) => {
|
|
165
|
+
const ref = useComposedRefs(forwardedRef, trackAvailableSpace);
|
|
166
|
+
return /* @__PURE__ */ jsx7("div", { className: "gridui-navigation-flyout-anchor", children: /* @__PURE__ */ jsx7(
|
|
167
|
+
Viewport,
|
|
168
|
+
{
|
|
169
|
+
...interactionLayerProps,
|
|
170
|
+
...props,
|
|
171
|
+
ref,
|
|
172
|
+
className: cn6(overlaySurfaceStyles(), "gridui-navigation-flyout-viewport", className)
|
|
173
|
+
}
|
|
174
|
+
) });
|
|
175
|
+
};
|
|
176
|
+
export {
|
|
177
|
+
NavigationFlyout,
|
|
178
|
+
NavigationFlyoutContent,
|
|
179
|
+
NavigationFlyoutItem,
|
|
180
|
+
NavigationFlyoutLink,
|
|
181
|
+
NavigationFlyoutList,
|
|
182
|
+
NavigationFlyoutTrigger,
|
|
183
|
+
NavigationFlyoutViewport
|
|
184
|
+
};
|
|
185
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/navigation-flyout/navigation-flyout.tsx", "../src/navigation-flyout-content/navigation-flyout-content.tsx", "../src/navigation-flyout-item/navigation-flyout-item.tsx", "../src/navigation-flyout-link/navigation-flyout-link.tsx", "../src/navigation-flyout-list/navigation-flyout-list.tsx", "../src/navigation-flyout-trigger/navigation-flyout-trigger.tsx", "../src/navigation-flyout-viewport/navigation-flyout-viewport.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Navigation Flyout\n * @namespace NavigationFlyout\n * @description Navigation Flyout\n */\n\nimport { useMotionStyle } from \"@gridui/motion/policy\";\nimport { cn } from \"@gridui/style-utils\";\nimport { Root } from \"@radix-ui/react-navigation-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type NavigationFlyoutProps = Omit<ComponentPropsWithRef<typeof Root>, \"orientation\">;\n\nexport const NavigationFlyout: FC<NavigationFlyoutProps> = ({ className, style, ...props }) => {\n const motionStyle = useMotionStyle();\n return (<Root\n {...props}\n orientation=\"horizontal\"\n className={cn(\"gridui-navigation-flyout\", className)}\n style={{ ...style, ...motionStyle }}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Navigation Flyout\n * @namespace NavigationFlyoutContent\n * @description Navigation Flyout Content\n */\n\nimport { useInteractionOutline, useScrollbars } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { Content } from \"@radix-ui/react-navigation-menu\";\nimport type { ComponentPropsWithRef, CSSProperties, FC } from \"react\";\n\nexport type NavigationFlyoutContentProps = Omit<ComponentPropsWithRef<typeof Content>, \"forceMount\"> & {\n readonly width?: string | number;\n};\n\ntype FlyoutContentStyle = CSSProperties & { \"--gridui-navigation-flyout-content-width\"?: string };\n\nconst contentWidth = (width: string | number): string => {\n if (typeof width === \"number\") {\n return `${width}px`;\n }\n const percentage = /^(\\d+(?:\\.\\d+)?|\\.\\d+)%$/.exec(width.trim())?.[1];\n return percentage === undefined ? width : `calc(var(--gridui-navigation-flyout-max-width) * ${Number(percentage) / 100})`;\n};\n\nexport const NavigationFlyoutContent: FC<NavigationFlyoutContentProps> = ({ className, ref, style, width, ...props }) => {\n const scrollbarRef = useScrollbars({ ref });\n const contentRef = useInteractionOutline({ ref: scrollbarRef });\n const contentStyle: FlyoutContentStyle = width === undefined ? { ...style } : {\n \"--gridui-navigation-flyout-content-width\": contentWidth(width),\n ...style,\n };\n return (<Content\n {...props}\n ref={contentRef}\n className={cn(\"gridui-navigation-flyout-content\", className)}\n style={contentStyle}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Navigation Flyout\n * @namespace NavigationFlyoutItem\n * @description Navigation Flyout Item\n */\n\nimport { Item } from \"@radix-ui/react-navigation-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type NavigationFlyoutItemProps = ComponentPropsWithRef<typeof Item>;\n\nexport const NavigationFlyoutItem: FC<NavigationFlyoutItemProps> = (props) => <Item {...props} />;\n", "/**\n * @author WMXPY\n * @package Navigation Flyout\n * @namespace NavigationFlyoutLink\n * @description Navigation Flyout Link\n */\n\nimport { getNavigationActivation } from \"@gridui/interaction\";\nimport { cn } from \"@gridui/style-utils\";\nimport { Link } from \"@radix-ui/react-navigation-menu\";\nimport { type ComponentPropsWithRef, type FC, useRef } from \"react\";\n\nexport type NavigationFlyoutLinkProps = ComponentPropsWithRef<typeof Link>;\n\nexport const NavigationFlyoutLink: FC<NavigationFlyoutLinkProps> = ({ className, onClick, onSelect, ...props }) => {\n const dismissForClick = useRef(false);\n return (<Link\n {...props}\n className={cn(\"gridui-navigation-flyout-link\", className)}\n onClick={(event) => {\n onClick?.(event);\n dismissForClick.current = getNavigationActivation(event) !== null;\n }}\n onSelect={(event) => {\n // Radix dispatches its selection event synchronously after the anchor click.\n const dismiss = dismissForClick.current;\n dismissForClick.current = false;\n onSelect?.(event);\n if (!dismiss) {\n event.preventDefault();\n }\n }}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Navigation Flyout\n * @namespace NavigationFlyoutList\n * @description Navigation Flyout List\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { List } from \"@radix-ui/react-navigation-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type NavigationFlyoutListProps = ComponentPropsWithRef<typeof List>;\n\nexport const NavigationFlyoutList: FC<NavigationFlyoutListProps> = ({ className, ...props }) => {\n return (<List\n {...props}\n className={cn(\"gridui-navigation-flyout-list\", className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Navigation Flyout\n * @namespace NavigationFlyoutTrigger\n * @description Navigation Flyout Trigger\n */\n\nimport { cn } from \"@gridui/style-utils\";\nimport { Trigger } from \"@radix-ui/react-navigation-menu\";\nimport { ChevronDown } from \"lucide-react\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type NavigationFlyoutTriggerProps = ComponentPropsWithRef<typeof Trigger>;\n\nexport const NavigationFlyoutTrigger: FC<NavigationFlyoutTriggerProps> = ({ asChild, children, className, ...props }) => {\n return (<Trigger\n {...props}\n asChild={asChild ?? false}\n className={cn(\"gridui-navigation-flyout-trigger\", className)}\n >\n {asChild ? children : (<>\n {children}\n <ChevronDown\n aria-hidden=\"true\"\n className=\"gridui-navigation-flyout-chevron\"\n />\n </>)}\n </Trigger>);\n};\n", "/**\n * @author WMXPY\n * @package Navigation Flyout\n * @namespace NavigationFlyoutViewport\n * @description Navigation Flyout Viewport\n */\n\nimport { interactionLayerProps, overlaySurfaceStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Viewport } from \"@radix-ui/react-navigation-menu\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type NavigationFlyoutViewportProps = Omit<ComponentPropsWithRef<typeof Viewport>, \"asChild\" | \"children\" | \"forceMount\">;\n\nconst trackAvailableSpace = (viewport: HTMLDivElement | null): (() => void) | undefined => {\n const anchor = viewport?.parentElement;\n const view = anchor?.ownerDocument.defaultView;\n const navigation = anchor?.parentElement;\n if (!anchor || !navigation || !view) {\n return undefined;\n }\n const documentRoot = anchor.ownerDocument.documentElement;\n const style = view.getComputedStyle(anchor);\n let frame = 0;\n let width = -1;\n let height = -1;\n const measure = () => {\n const bounds = anchor.getBoundingClientRect();\n // Viewport distances include ancestor scaling; CSS lengths inside the navigation do not.\n const navigationBounds = navigation.getBoundingClientRect();\n const scaleX = navigation.offsetWidth ? navigationBounds.width / navigation.offsetWidth : 1;\n const scaleY = navigation.offsetHeight ? navigationBounds.height / navigation.offsetHeight : 1;\n const available = style.direction === \"rtl\" ? bounds.right : documentRoot.clientWidth - bounds.left;\n const nextWidth = Math.max(0, available / (scaleX || 1));\n const nextHeight = Math.max(0, (documentRoot.clientHeight - bounds.top) / (scaleY || 1));\n if (nextWidth !== width) {\n width = nextWidth;\n anchor.style.setProperty(\"--gridui-navigation-flyout-available-width\", `${width}px`);\n }\n if (nextHeight !== height) {\n height = nextHeight;\n anchor.style.setProperty(\"--gridui-navigation-flyout-available-height\", `${height}px`);\n }\n frame = view.requestAnimationFrame(measure);\n };\n // Radix mounts the viewport only while open. Track position-only layout shifts until it closes.\n measure();\n return () => {\n view.cancelAnimationFrame(frame);\n };\n};\n\nexport const NavigationFlyoutViewport: FC<NavigationFlyoutViewportProps> = ({ className, ref: forwardedRef, ...props }) => {\n const ref = useComposedRefs(forwardedRef, trackAvailableSpace);\n return (<div className=\"gridui-navigation-flyout-anchor\">\n <Viewport\n {...interactionLayerProps}\n {...props}\n ref={ref}\n className={cn(overlaySurfaceStyles(), \"gridui-navigation-flyout-viewport\", className)}\n />\n </div>);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["cn", "jsx", "jsx", "cn", "jsx", "cn", "jsx", "cn", "jsx", "cn", "jsx"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Navigation Flyout
|
|
4
|
+
* @namespace NavigationFlyout
|
|
5
|
+
* @description Navigation Flyout
|
|
6
|
+
*/
|
|
7
|
+
import { Root } from "@radix-ui/react-navigation-menu";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type NavigationFlyoutProps = Omit<ComponentPropsWithRef<typeof Root>, "orientation">;
|
|
10
|
+
export declare const NavigationFlyout: FC<NavigationFlyoutProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Navigation Flyout
|
|
4
|
+
* @namespace NavigationFlyoutContent
|
|
5
|
+
* @description Navigation Flyout Content
|
|
6
|
+
*/
|
|
7
|
+
import { Content } from "@radix-ui/react-navigation-menu";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type NavigationFlyoutContentProps = Omit<ComponentPropsWithRef<typeof Content>, "forceMount"> & {
|
|
10
|
+
readonly width?: string | number;
|
|
11
|
+
};
|
|
12
|
+
export declare const NavigationFlyoutContent: FC<NavigationFlyoutContentProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Navigation Flyout
|
|
4
|
+
* @namespace NavigationFlyoutItem
|
|
5
|
+
* @description Navigation Flyout Item
|
|
6
|
+
*/
|
|
7
|
+
import { Item } from "@radix-ui/react-navigation-menu";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type NavigationFlyoutItemProps = ComponentPropsWithRef<typeof Item>;
|
|
10
|
+
export declare const NavigationFlyoutItem: FC<NavigationFlyoutItemProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Navigation Flyout
|
|
4
|
+
* @namespace NavigationFlyoutLink
|
|
5
|
+
* @description Navigation Flyout Link
|
|
6
|
+
*/
|
|
7
|
+
import { Link } from "@radix-ui/react-navigation-menu";
|
|
8
|
+
import { type ComponentPropsWithRef, type FC } from "react";
|
|
9
|
+
export type NavigationFlyoutLinkProps = ComponentPropsWithRef<typeof Link>;
|
|
10
|
+
export declare const NavigationFlyoutLink: FC<NavigationFlyoutLinkProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Navigation Flyout
|
|
4
|
+
* @namespace NavigationFlyoutList
|
|
5
|
+
* @description Navigation Flyout List
|
|
6
|
+
*/
|
|
7
|
+
import { List } from "@radix-ui/react-navigation-menu";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type NavigationFlyoutListProps = ComponentPropsWithRef<typeof List>;
|
|
10
|
+
export declare const NavigationFlyoutList: FC<NavigationFlyoutListProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Navigation Flyout
|
|
4
|
+
* @namespace NavigationFlyoutTrigger
|
|
5
|
+
* @description Navigation Flyout Trigger
|
|
6
|
+
*/
|
|
7
|
+
import { Trigger } from "@radix-ui/react-navigation-menu";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type NavigationFlyoutTriggerProps = ComponentPropsWithRef<typeof Trigger>;
|
|
10
|
+
export declare const NavigationFlyoutTrigger: FC<NavigationFlyoutTriggerProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Navigation Flyout
|
|
4
|
+
* @namespace NavigationFlyoutViewport
|
|
5
|
+
* @description Navigation Flyout Viewport
|
|
6
|
+
*/
|
|
7
|
+
import { Viewport } from "@radix-ui/react-navigation-menu";
|
|
8
|
+
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
|
+
export type NavigationFlyoutViewportProps = Omit<ComponentPropsWithRef<typeof Viewport>, "asChild" | "children" | "forceMount">;
|
|
10
|
+
export declare const NavigationFlyoutViewport: FC<NavigationFlyoutViewportProps>;
|
package/dist/styled.js
ADDED
package/dist/styles.css
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer theme, base, components, utilities;
|
|
4
|
+
@layer utilities {
|
|
5
|
+
.gridui-u-overlay--z-\(--gridui-z-popover\) {
|
|
6
|
+
z-index: var(--gridui-z-popover);
|
|
7
|
+
}
|
|
8
|
+
.gridui-u-overlay--flex {
|
|
9
|
+
display: flex;
|
|
10
|
+
}
|
|
11
|
+
.gridui-u-overlay--inline-flex {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
}
|
|
14
|
+
.gridui-u-overlay--size-gridui-16 {
|
|
15
|
+
width: var(--gridui-space-16);
|
|
16
|
+
height: var(--gridui-space-16);
|
|
17
|
+
}
|
|
18
|
+
.gridui-u-overlay--min-w-0 {
|
|
19
|
+
min-width: 0px;
|
|
20
|
+
}
|
|
21
|
+
.gridui-u-overlay--shrink-0 {
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
}
|
|
24
|
+
.gridui-u-overlay--cursor-pointer {
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
.gridui-u-overlay--items-center {
|
|
28
|
+
align-items: center;
|
|
29
|
+
}
|
|
30
|
+
.gridui-u-overlay--justify-center {
|
|
31
|
+
justify-content: center;
|
|
32
|
+
}
|
|
33
|
+
.gridui-u-overlay--gap-gridui-8 {
|
|
34
|
+
gap: var(--gridui-space-8);
|
|
35
|
+
}
|
|
36
|
+
.gridui-u-overlay--rounded-control {
|
|
37
|
+
border-radius: var(--gridui-control-radius);
|
|
38
|
+
}
|
|
39
|
+
.gridui-u-overlay--border {
|
|
40
|
+
border-style: var(--tw-border-style);
|
|
41
|
+
border-width: 1px;
|
|
42
|
+
}
|
|
43
|
+
.gridui-u-overlay--border-solid {
|
|
44
|
+
--tw-border-style: solid;
|
|
45
|
+
border-style: solid;
|
|
46
|
+
}
|
|
47
|
+
.gridui-u-overlay--border-border {
|
|
48
|
+
border-color: var(--gridui-border);
|
|
49
|
+
}
|
|
50
|
+
.gridui-u-overlay--bg-background {
|
|
51
|
+
background-color: var(--gridui-background);
|
|
52
|
+
}
|
|
53
|
+
.gridui-u-overlay--p-0 {
|
|
54
|
+
padding: 0px;
|
|
55
|
+
}
|
|
56
|
+
.gridui-u-overlay--px-gridui-8 {
|
|
57
|
+
padding-inline: var(--gridui-space-8);
|
|
58
|
+
}
|
|
59
|
+
.gridui-u-overlay--type-data {
|
|
60
|
+
font: var(--gridui-type-data);
|
|
61
|
+
font-family: var(--gridui-font-body);
|
|
62
|
+
letter-spacing: normal;
|
|
63
|
+
font-variant-numeric: tabular-nums;
|
|
64
|
+
}
|
|
65
|
+
.gridui-u-overlay--type-caption {
|
|
66
|
+
font: var(--gridui-type-caption);
|
|
67
|
+
font-family: var(--gridui-font-body);
|
|
68
|
+
letter-spacing: normal;
|
|
69
|
+
}
|
|
70
|
+
.gridui-u-overlay--wrap-anywhere {
|
|
71
|
+
overflow-wrap: anywhere;
|
|
72
|
+
}
|
|
73
|
+
.gridui-u-overlay--whitespace-normal {
|
|
74
|
+
white-space: normal;
|
|
75
|
+
}
|
|
76
|
+
.gridui-u-overlay--text-foreground {
|
|
77
|
+
color: var(--gridui-foreground);
|
|
78
|
+
}
|
|
79
|
+
.gridui-u-overlay--text-inherit {
|
|
80
|
+
color: inherit;
|
|
81
|
+
}
|
|
82
|
+
.gridui-u-overlay--text-muted {
|
|
83
|
+
color: var(--gridui-muted);
|
|
84
|
+
}
|
|
85
|
+
.gridui-u-overlay--no-underline {
|
|
86
|
+
text-decoration-line: none;
|
|
87
|
+
}
|
|
88
|
+
.gridui-u-overlay--aria-selected\:bg-selection-background[aria-selected="true"] {
|
|
89
|
+
background-color: var(--gridui-selection-background);
|
|
90
|
+
}
|
|
91
|
+
.gridui-u-overlay--aria-\[current\=page\]\:bg-selection-background[aria-current="page"] {
|
|
92
|
+
background-color: var(--gridui-selection-background);
|
|
93
|
+
}
|
|
94
|
+
.gridui-u-overlay--data-disabled\:pointer-events-none[data-disabled] {
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
}
|
|
97
|
+
.gridui-u-overlay--data-disabled\:opacity-50[data-disabled] {
|
|
98
|
+
opacity: 50%;
|
|
99
|
+
}
|
|
100
|
+
.gridui-u-overlay--data-\[state\=checked\]\:bg-selection-background[data-state="checked"] {
|
|
101
|
+
background-color: var(--gridui-selection-background);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
@layer components {
|
|
105
|
+
.gridui-overlay-surface {
|
|
106
|
+
--gridui-surface-offset-x: 0px;
|
|
107
|
+
--gridui-surface-offset-y: 0px;
|
|
108
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
|
|
109
|
+
--gridui-overlay-fill-mode: both;
|
|
110
|
+
transform-origin: var(--gridui-overlay-origin, center);
|
|
111
|
+
}
|
|
112
|
+
.gridui-overlay-dialog {
|
|
113
|
+
--gridui-overlay-fill-mode: none;
|
|
114
|
+
transform-origin: center;
|
|
115
|
+
}
|
|
116
|
+
.gridui-overlay-tooltip {
|
|
117
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-quick);
|
|
118
|
+
}
|
|
119
|
+
.gridui-overlay-floating[data-side="bottom"] {
|
|
120
|
+
--gridui-surface-offset-y: calc(-1 * var(--gridui-motion-distance));
|
|
121
|
+
}
|
|
122
|
+
.gridui-overlay-floating[data-side="top"] {
|
|
123
|
+
--gridui-surface-offset-y: var(--gridui-motion-distance);
|
|
124
|
+
}
|
|
125
|
+
.gridui-overlay-floating[data-side="left"] {
|
|
126
|
+
--gridui-surface-offset-x: var(--gridui-motion-distance);
|
|
127
|
+
}
|
|
128
|
+
.gridui-overlay-floating[data-side="right"] {
|
|
129
|
+
--gridui-surface-offset-x: calc(-1 * var(--gridui-motion-distance));
|
|
130
|
+
}
|
|
131
|
+
.gridui-overlay-surface[data-state="closed"] {
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
}
|
|
134
|
+
.gridui-overlay-surface:not([data-side="none"]):is([data-state="open"], [data-state="delayed-open"], [data-state="instant-open"]) {
|
|
135
|
+
animation: var(--gridui-motion-animation, gridui-surface-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
|
|
136
|
+
}
|
|
137
|
+
.gridui-overlay-surface:not([data-side="none"])[data-state="closed"] {
|
|
138
|
+
animation: var(--gridui-motion-animation, gridui-surface-exit calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
|
|
139
|
+
}
|
|
140
|
+
.gridui-overlay-backdrop {
|
|
141
|
+
background: var(--gridui-backdrop);
|
|
142
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
143
|
+
background: color-mix(in srgb, var(--gridui-backdrop) var(--gridui-backdrop-opacity), transparent);
|
|
144
|
+
}
|
|
145
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
|
|
146
|
+
--gridui-overlay-exit-duration: var(--gridui-motion-duration-quick);
|
|
147
|
+
--gridui-overlay-fill-mode: none;
|
|
148
|
+
}
|
|
149
|
+
.gridui-overlay-backdrop-deliberate {
|
|
150
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-deliberate);
|
|
151
|
+
--gridui-overlay-exit-duration: var(--gridui-motion-duration-normal);
|
|
152
|
+
--gridui-overlay-fill-mode: both;
|
|
153
|
+
}
|
|
154
|
+
.gridui-overlay-backdrop[data-state="open"] {
|
|
155
|
+
animation: var(--gridui-motion-animation, gridui-fade-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
|
|
156
|
+
}
|
|
157
|
+
.gridui-overlay-backdrop[data-state="closed"] {
|
|
158
|
+
animation: var(--gridui-motion-animation, gridui-fade-exit calc(var(--gridui-overlay-exit-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
|
|
159
|
+
}
|
|
160
|
+
@media (prefers-reduced-motion: reduce) {
|
|
161
|
+
.gridui-overlay-surface:not([data-side="none"])[data-state], .gridui-overlay-backdrop[data-state] {
|
|
162
|
+
animation: none;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
.gridui-overlay-list {
|
|
166
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
167
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
168
|
+
}
|
|
169
|
+
.gridui-overlay-density-compact {
|
|
170
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-small);
|
|
171
|
+
--gridui-overlay-row-padding: var(--gridui-space-4);
|
|
172
|
+
}
|
|
173
|
+
.gridui-overlay-density-comfortable {
|
|
174
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
175
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
176
|
+
}
|
|
177
|
+
.gridui-overlay-list-item {
|
|
178
|
+
min-block-size: max(var(--gridui-overlay-row-min, var(--gridui-control-min-height-medium)), var(--gridui-target-min-size));
|
|
179
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
180
|
+
}
|
|
181
|
+
.gridui-overlay-list-label {
|
|
182
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
@property --tw-border-style {
|
|
186
|
+
syntax: "*";
|
|
187
|
+
inherits: false;
|
|
188
|
+
initial-value: solid;
|
|
189
|
+
}
|
|
190
|
+
@layer properties {
|
|
191
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
192
|
+
*, ::before, ::after, ::backdrop {
|
|
193
|
+
--tw-border-style: solid;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
199
|
+
@layer theme, base, components, utilities;
|
|
200
|
+
@layer utilities;
|
|
201
|
+
@layer components {
|
|
202
|
+
.gridui-navigation-flyout {
|
|
203
|
+
position: relative;
|
|
204
|
+
min-inline-size: 0;
|
|
205
|
+
--gridui-navigation-flyout-offset: var(--gridui-space-8);
|
|
206
|
+
--gridui-navigation-flyout-duration: calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1));
|
|
207
|
+
}
|
|
208
|
+
.gridui-navigation-flyout-list {
|
|
209
|
+
display: flex;
|
|
210
|
+
flex-wrap: wrap;
|
|
211
|
+
align-items: center;
|
|
212
|
+
gap: var(--gridui-space-4);
|
|
213
|
+
margin: 0;
|
|
214
|
+
padding: 0;
|
|
215
|
+
list-style: none;
|
|
216
|
+
}
|
|
217
|
+
.gridui-navigation-flyout-link {
|
|
218
|
+
color: var(--gridui-foreground);
|
|
219
|
+
text-decoration: none;
|
|
220
|
+
}
|
|
221
|
+
.gridui-navigation-flyout-trigger, .gridui-navigation-flyout-list > li > .gridui-navigation-flyout-link {
|
|
222
|
+
position: relative;
|
|
223
|
+
display: inline-flex;
|
|
224
|
+
align-items: center;
|
|
225
|
+
justify-content: center;
|
|
226
|
+
gap: var(--gridui-space-8);
|
|
227
|
+
min-block-size: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
228
|
+
padding: var(--gridui-space-8) var(--gridui-space-16);
|
|
229
|
+
border: 1px solid transparent;
|
|
230
|
+
border-radius: var(--gridui-control-radius);
|
|
231
|
+
background: transparent;
|
|
232
|
+
color: var(--gridui-foreground);
|
|
233
|
+
font: var(--gridui-type-ui);
|
|
234
|
+
font-family: var(--gridui-font-body);
|
|
235
|
+
letter-spacing: normal;
|
|
236
|
+
white-space: nowrap;
|
|
237
|
+
}
|
|
238
|
+
.gridui-navigation-flyout-trigger[data-state="open"], .gridui-navigation-flyout-list > li > .gridui-navigation-flyout-link[aria-current="page"] {
|
|
239
|
+
background: var(--gridui-selection-background);
|
|
240
|
+
}
|
|
241
|
+
.gridui-navigation-flyout-chevron {
|
|
242
|
+
flex: none;
|
|
243
|
+
inline-size: var(--gridui-icon-size);
|
|
244
|
+
block-size: var(--gridui-icon-size);
|
|
245
|
+
transition: transform var(--gridui-navigation-flyout-duration) var(--gridui-motion-ease-out);
|
|
246
|
+
}
|
|
247
|
+
.gridui-navigation-flyout-trigger[data-state="open"] .gridui-navigation-flyout-chevron {
|
|
248
|
+
transform: rotate(180deg);
|
|
249
|
+
}
|
|
250
|
+
.gridui-navigation-flyout-anchor {
|
|
251
|
+
position: absolute;
|
|
252
|
+
inset-block-start: 100%;
|
|
253
|
+
inset-inline-start: 0;
|
|
254
|
+
z-index: var(--gridui-z-popover);
|
|
255
|
+
padding-block-start: var(--gridui-navigation-flyout-offset);
|
|
256
|
+
--gridui-navigation-flyout-max-width: max(0px, calc(var(--gridui-navigation-flyout-available-width, 100dvw) - var(--gridui-page-gutter) - 2px));
|
|
257
|
+
--gridui-navigation-flyout-max-height: max(0px, calc(var(--gridui-navigation-flyout-available-height, 100dvh) - var(--gridui-navigation-flyout-offset) - var(--gridui-page-gutter) - 2px));
|
|
258
|
+
}
|
|
259
|
+
.gridui-navigation-flyout-viewport {
|
|
260
|
+
position: relative;
|
|
261
|
+
z-index: var(--gridui-z-popover);
|
|
262
|
+
box-sizing: content-box;
|
|
263
|
+
inline-size: min(var(--radix-navigation-menu-viewport-width, 0px), var(--gridui-navigation-flyout-max-width));
|
|
264
|
+
block-size: min(var(--radix-navigation-menu-viewport-height, 0px), var(--gridui-navigation-flyout-max-height));
|
|
265
|
+
overflow: clip;
|
|
266
|
+
transition: inline-size var(--gridui-navigation-flyout-duration) var(--gridui-motion-ease-out), block-size var(--gridui-navigation-flyout-duration) var(--gridui-motion-ease-out);
|
|
267
|
+
}
|
|
268
|
+
.gridui-navigation-flyout-content {
|
|
269
|
+
position: absolute;
|
|
270
|
+
inset-block-start: 0;
|
|
271
|
+
inset-inline-start: 0;
|
|
272
|
+
box-sizing: border-box;
|
|
273
|
+
inline-size: min(var(--gridui-navigation-flyout-content-width, 40rem), var(--gridui-navigation-flyout-max-width));
|
|
274
|
+
max-block-size: var(--gridui-navigation-flyout-max-height);
|
|
275
|
+
overflow: auto;
|
|
276
|
+
overscroll-behavior: contain;
|
|
277
|
+
}
|
|
278
|
+
.gridui-navigation-flyout-content[data-motion^="from-"] {
|
|
279
|
+
animation: gridui-navigation-flyout-enter var(--gridui-navigation-flyout-duration) var(--gridui-motion-ease-out);
|
|
280
|
+
}
|
|
281
|
+
.gridui-navigation-flyout-content[data-motion="from-start"] {
|
|
282
|
+
--gridui-navigation-flyout-enter-x: calc(-1 * var(--gridui-space-8));
|
|
283
|
+
}
|
|
284
|
+
.gridui-navigation-flyout-content[data-motion="from-end"] {
|
|
285
|
+
--gridui-navigation-flyout-enter-x: var(--gridui-space-8);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
@keyframes gridui-navigation-flyout-enter {
|
|
289
|
+
from {
|
|
290
|
+
opacity: 0;
|
|
291
|
+
transform: translateX(var(--gridui-navigation-flyout-enter-x));
|
|
292
|
+
}
|
|
293
|
+
to {
|
|
294
|
+
opacity: 1;
|
|
295
|
+
transform: translateX(0);
|
|
296
|
+
}
|
|
297
|
+
}
|