@inui/design-system 0.0.0-stage → 1.22.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 +360 -2
- package/dist/components/ui/accordion.d.ts +44 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +86 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/ai-avatar.d.ts +46 -0
- package/dist/components/ui/ai-avatar.d.ts.map +1 -0
- package/dist/components/ui/ai-avatar.js +43 -0
- package/dist/components/ui/ai-avatar.js.map +1 -0
- package/dist/components/ui/ai-label.d.ts +118 -0
- package/dist/components/ui/ai-label.d.ts.map +1 -0
- package/dist/components/ui/ai-label.js +184 -0
- package/dist/components/ui/ai-label.js.map +1 -0
- package/dist/components/ui/ai-sparkle.d.ts +91 -0
- package/dist/components/ui/ai-sparkle.d.ts.map +1 -0
- package/dist/components/ui/ai-sparkle.js +200 -0
- package/dist/components/ui/ai-sparkle.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +79 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +147 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +71 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +108 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +30 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +40 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/attachment.d.ts +74 -0
- package/dist/components/ui/attachment.d.ts.map +1 -0
- package/dist/components/ui/attachment.js +142 -0
- package/dist/components/ui/attachment.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +82 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +123 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +130 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +226 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +43 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +98 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/browser-tabs.d.ts +218 -0
- package/dist/components/ui/browser-tabs.d.ts.map +1 -0
- package/dist/components/ui/browser-tabs.js +528 -0
- package/dist/components/ui/browser-tabs.js.map +1 -0
- package/dist/components/ui/bubble.d.ts +80 -0
- package/dist/components/ui/bubble.d.ts.map +1 -0
- package/dist/components/ui/bubble.js +235 -0
- package/dist/components/ui/bubble.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +60 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +89 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +157 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +144 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +57 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +163 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +96 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +131 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +86 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +207 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +54 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +78 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +45 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +65 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +111 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +264 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command.d.ts +71 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +133 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +70 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +163 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/count-badge.d.ts +40 -0
- package/dist/components/ui/count-badge.d.ts.map +1 -0
- package/dist/components/ui/count-badge.js +43 -0
- package/dist/components/ui/count-badge.js.map +1 -0
- package/dist/components/ui/data-table.d.ts +1026 -0
- package/dist/components/ui/data-table.d.ts.map +1 -0
- package/dist/components/ui/data-table.js +3423 -0
- package/dist/components/ui/data-table.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +73 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +145 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/direction.d.ts +35 -0
- package/dist/components/ui/direction.d.ts.map +1 -0
- package/dist/components/ui/direction.js +35 -0
- package/dist/components/ui/direction.js.map +1 -0
- package/dist/components/ui/drawer.d.ts +53 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +115 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +75 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +173 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/dropzone.d.ts +141 -0
- package/dist/components/ui/dropzone.d.ts.map +1 -0
- package/dist/components/ui/dropzone.js +257 -0
- package/dist/components/ui/dropzone.js.map +1 -0
- package/dist/components/ui/empty.d.ts +94 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +149 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +122 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +254 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +51 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +101 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +62 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +115 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +52 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +89 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +47 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +47 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +74 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +176 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +41 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +58 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/key-value-pair.d.ts +56 -0
- package/dist/components/ui/key-value-pair.d.ts.map +1 -0
- package/dist/components/ui/key-value-pair.js +110 -0
- package/dist/components/ui/key-value-pair.js.map +1 -0
- package/dist/components/ui/label.d.ts +83 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +85 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/marker.d.ts +54 -0
- package/dist/components/ui/marker.d.ts.map +1 -0
- package/dist/components/ui/marker.js +79 -0
- package/dist/components/ui/marker.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +72 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +174 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/message-scroller.d.ts +53 -0
- package/dist/components/ui/message-scroller.d.ts.map +1 -0
- package/dist/components/ui/message-scroller.js +95 -0
- package/dist/components/ui/message-scroller.js.map +1 -0
- package/dist/components/ui/message.d.ts +63 -0
- package/dist/components/ui/message.d.ts.map +1 -0
- package/dist/components/ui/message.js +92 -0
- package/dist/components/ui/message.js.map +1 -0
- package/dist/components/ui/meta-list.d.ts +55 -0
- package/dist/components/ui/meta-list.d.ts.map +1 -0
- package/dist/components/ui/meta-list.js +75 -0
- package/dist/components/ui/meta-list.js.map +1 -0
- package/dist/components/ui/native-select.d.ts +51 -0
- package/dist/components/ui/native-select.d.ts.map +1 -0
- package/dist/components/ui/native-select.js +75 -0
- package/dist/components/ui/native-select.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +56 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +116 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/page-header.d.ts +223 -0
- package/dist/components/ui/page-header.d.ts.map +1 -0
- package/dist/components/ui/page-header.js +233 -0
- package/dist/components/ui/page-header.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +68 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +145 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +61 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +144 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +35 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +46 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/questionnaire.d.ts +92 -0
- package/dist/components/ui/questionnaire.d.ts.map +1 -0
- package/dist/components/ui/questionnaire.js +277 -0
- package/dist/components/ui/questionnaire.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +50 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +65 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +44 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +73 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +55 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +72 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +274 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +609 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +31 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +38 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +59 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +128 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +166 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +512 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +35 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +46 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +39 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +75 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +56 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +96 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +37 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +51 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/stepper.d.ts +84 -0
- package/dist/components/ui/stepper.d.ts.map +1 -0
- package/dist/components/ui/stepper.js +145 -0
- package/dist/components/ui/stepper.js.map +1 -0
- package/dist/components/ui/switch.d.ts +36 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +44 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +80 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +130 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +87 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +128 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +35 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +38 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/time-picker.d.ts +58 -0
- package/dist/components/ui/time-picker.d.ts.map +1 -0
- package/dist/components/ui/time-picker.js +188 -0
- package/dist/components/ui/time-picker.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +52 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +94 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +50 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +70 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +51 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +78 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/hooks/use-dark-mode.d.ts +2 -0
- package/dist/hooks/use-dark-mode.d.ts.map +1 -0
- package/dist/hooks/use-dark-mode.js +36 -0
- package/dist/hooks/use-dark-mode.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +20 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/index.d.ts +88 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/lib/scope.d.ts +64 -0
- package/dist/lib/scope.d.ts.map +1 -0
- package/dist/lib/scope.js +74 -0
- package/dist/lib/scope.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +11 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/theme-tokens.css +537 -0
- package/dist/theme.css +417 -0
- package/package.json +103 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NavigationMenu — top-level nav bar with dropdown panels for grouped links.
|
|
3
|
+
*
|
|
4
|
+
* Built on the Radix NavigationMenu primitive. The `viewport` prop opts out
|
|
5
|
+
* of the shared dropdown viewport (renders each NavigationMenuContent inline
|
|
6
|
+
* instead); it defaults to on.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui";
|
|
10
|
+
declare function NavigationMenu({ className, children, viewport, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
11
|
+
viewport?: boolean;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
declare function NavigationMenuList({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.List>): React.JSX.Element;
|
|
14
|
+
declare function NavigationMenuItem({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>): React.JSX.Element;
|
|
15
|
+
declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
16
|
+
declare function NavigationMenuTrigger({ className, children, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>): React.JSX.Element;
|
|
17
|
+
declare function NavigationMenuContent({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>): React.JSX.Element;
|
|
18
|
+
declare function NavigationMenuViewport({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>): React.JSX.Element;
|
|
19
|
+
declare function NavigationMenuLink({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>): React.JSX.Element;
|
|
20
|
+
declare function NavigationMenuIndicator({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>): React.JSX.Element;
|
|
21
|
+
export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, navigationMenuTriggerStyle, };
|
|
22
|
+
/**
|
|
23
|
+
* WHEN TO USE
|
|
24
|
+
* - Navigating between top-level sections or modules of the app, some of
|
|
25
|
+
* which expand into a dropdown of related links
|
|
26
|
+
*
|
|
27
|
+
* NOT WHEN
|
|
28
|
+
* - Switching views within one page — use Tabs
|
|
29
|
+
* - Persistent side navigation — use Sidebar
|
|
30
|
+
* - An action menu (not links) — use DropdownMenu
|
|
31
|
+
*
|
|
32
|
+
* KEY RULES
|
|
33
|
+
* - A plain link that should look like a trigger: wrap it in
|
|
34
|
+
* NavigationMenuLink asChild with className={navigationMenuTriggerStyle()}
|
|
35
|
+
* - Wrap real anchors in NavigationMenuLink with asChild
|
|
36
|
+
* - viewport (default true) controls whether all dropdown panels share one
|
|
37
|
+
* animated viewport under the bar; set false to render each inline instead
|
|
38
|
+
*
|
|
39
|
+
* USAGE
|
|
40
|
+
* <NavigationMenu>
|
|
41
|
+
* <NavigationMenuList>
|
|
42
|
+
* <NavigationMenuItem>
|
|
43
|
+
* <NavigationMenuTrigger>Components</NavigationMenuTrigger>
|
|
44
|
+
* <NavigationMenuContent>
|
|
45
|
+
* <NavigationMenuLink asChild><a href="/button">Button</a></NavigationMenuLink>
|
|
46
|
+
* </NavigationMenuContent>
|
|
47
|
+
* </NavigationMenuItem>
|
|
48
|
+
* <NavigationMenuItem>
|
|
49
|
+
* <NavigationMenuLink asChild className={navigationMenuTriggerStyle()}>
|
|
50
|
+
* <a href="/docs">Docs</a>
|
|
51
|
+
* </NavigationMenuLink>
|
|
52
|
+
* </NavigationMenuItem>
|
|
53
|
+
* </NavigationMenuList>
|
|
54
|
+
* </NavigationMenu>
|
|
55
|
+
*/
|
|
56
|
+
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/navigation-menu.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAKpE,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,QAAQ,EACR,QAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,uBAAuB,CAAC,IAAI,CAAC,GAAG;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,qBAeA;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,uBAAuB,CAAC,IAAI,CAAC,qBAW3D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,uBAAuB,CAAC,IAAI,CAAC,qBAQ3D;AAED,QAAA,MAAM,0BAA0B,oFAM/B,CAAA;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,uBAAuB,CAAC,OAAO,CAAC,qBAc9D;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,uBAAuB,CAAC,OAAO,CAAC,qBAW9D;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,uBAAuB,CAAC,QAAQ,CAAC,qBAiB/D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,uBAAuB,CAAC,IAAI,CAAC,qBAW3D;AAED,iBAAS,uBAAuB,CAAC,EAC/B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,uBAAuB,CAAC,SAAS,CAAC,qBAahE;AAED,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,GAC3B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { NavigationMenu as NavigationMenu$1 } from "radix-ui";
|
|
4
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/components/ui/navigation-menu.tsx
|
|
8
|
+
function NavigationMenu({ className, children, viewport = true, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs(NavigationMenu$1.Root, {
|
|
10
|
+
"data-slot": "navigation-menu",
|
|
11
|
+
"data-viewport": viewport,
|
|
12
|
+
className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className),
|
|
13
|
+
...props,
|
|
14
|
+
children: [children, viewport && /* @__PURE__ */ jsx(NavigationMenuViewport, {})]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function NavigationMenuList({ className, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.List, {
|
|
19
|
+
"data-slot": "navigation-menu-list",
|
|
20
|
+
className: cn("group flex flex-1 list-none items-center justify-center gap-0", className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function NavigationMenuItem({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Item, {
|
|
26
|
+
"data-slot": "navigation-menu-item",
|
|
27
|
+
className: cn("relative", className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
var navigationMenuTriggerStyle = cva("group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-lg px-2.5 py-1.5 text-sm font-medium transition-colors outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-muted/50 data-[state=open]:hover:bg-muted data-[state=open]:focus:bg-muted");
|
|
32
|
+
function NavigationMenuTrigger({ className, children, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsxs(NavigationMenu$1.Trigger, {
|
|
34
|
+
"data-slot": "navigation-menu-trigger",
|
|
35
|
+
className: cn(navigationMenuTriggerStyle(), "group", className),
|
|
36
|
+
...props,
|
|
37
|
+
children: [
|
|
38
|
+
children,
|
|
39
|
+
" ",
|
|
40
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
41
|
+
className: "relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]/navigation-menu-trigger:rotate-180",
|
|
42
|
+
"aria-hidden": "true"
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function NavigationMenuContent({ className, ...props }) {
|
|
48
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Content, {
|
|
49
|
+
"data-slot": "navigation-menu-content",
|
|
50
|
+
className: cn("top-0 left-0 w-full p-1 ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:duration-300 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none md:absolute md:w-auto group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95", className),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function NavigationMenuViewport({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
className: cn("absolute top-full left-0 isolate z-50 flex justify-center"),
|
|
57
|
+
children: /* @__PURE__ */ jsx(NavigationMenu$1.Viewport, {
|
|
58
|
+
"data-slot": "navigation-menu-viewport",
|
|
59
|
+
className: cn("origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-lg bg-popover text-popover-foreground shadow ring-1 ring-foreground/10 duration-100 md:w-(--radix-navigation-menu-viewport-width) data-[state=open]:animate-in data-[state=open]:zoom-in-90 data-[state=closed]:animate-out data-[state=closed]:zoom-out-90", className),
|
|
60
|
+
...props
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function NavigationMenuLink({ className, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Link, {
|
|
66
|
+
"data-slot": "navigation-menu-link",
|
|
67
|
+
className: cn("flex items-center gap-2 rounded-lg p-2 text-sm transition-colors outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-md data-active:bg-muted/50 data-active:hover:bg-muted data-active:focus:bg-muted [&_svg:not([class*='size-'])]:size-4", className),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function NavigationMenuIndicator({ className, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Indicator, {
|
|
73
|
+
"data-slot": "navigation-menu-indicator",
|
|
74
|
+
className: cn("top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in", className),
|
|
75
|
+
...props,
|
|
76
|
+
children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* WHEN TO USE
|
|
81
|
+
* - Navigating between top-level sections or modules of the app, some of
|
|
82
|
+
* which expand into a dropdown of related links
|
|
83
|
+
*
|
|
84
|
+
* NOT WHEN
|
|
85
|
+
* - Switching views within one page — use Tabs
|
|
86
|
+
* - Persistent side navigation — use Sidebar
|
|
87
|
+
* - An action menu (not links) — use DropdownMenu
|
|
88
|
+
*
|
|
89
|
+
* KEY RULES
|
|
90
|
+
* - A plain link that should look like a trigger: wrap it in
|
|
91
|
+
* NavigationMenuLink asChild with className={navigationMenuTriggerStyle()}
|
|
92
|
+
* - Wrap real anchors in NavigationMenuLink with asChild
|
|
93
|
+
* - viewport (default true) controls whether all dropdown panels share one
|
|
94
|
+
* animated viewport under the bar; set false to render each inline instead
|
|
95
|
+
*
|
|
96
|
+
* USAGE
|
|
97
|
+
* <NavigationMenu>
|
|
98
|
+
* <NavigationMenuList>
|
|
99
|
+
* <NavigationMenuItem>
|
|
100
|
+
* <NavigationMenuTrigger>Components</NavigationMenuTrigger>
|
|
101
|
+
* <NavigationMenuContent>
|
|
102
|
+
* <NavigationMenuLink asChild><a href="/button">Button</a></NavigationMenuLink>
|
|
103
|
+
* </NavigationMenuContent>
|
|
104
|
+
* </NavigationMenuItem>
|
|
105
|
+
* <NavigationMenuItem>
|
|
106
|
+
* <NavigationMenuLink asChild className={navigationMenuTriggerStyle()}>
|
|
107
|
+
* <a href="/docs">Docs</a>
|
|
108
|
+
* </NavigationMenuLink>
|
|
109
|
+
* </NavigationMenuItem>
|
|
110
|
+
* </NavigationMenuList>
|
|
111
|
+
* </NavigationMenu>
|
|
112
|
+
*/
|
|
113
|
+
//#endregion
|
|
114
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, navigationMenuTriggerStyle };
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=navigation-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-menu.js","names":[],"sources":["../../../src/components/ui/navigation-menu.tsx"],"sourcesContent":["/**\n * NavigationMenu — top-level nav bar with dropdown panels for grouped links.\n *\n * Built on the Radix NavigationMenu primitive. The `viewport` prop opts out\n * of the shared dropdown viewport (renders each NavigationMenuContent inline\n * instead); it defaults to on.\n */\n\nimport * as React from \"react\"\nimport { cva } from \"class-variance-authority\"\nimport { NavigationMenu as NavigationMenuPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\nimport { ChevronDownIcon } from \"lucide-react\"\n\nfunction NavigationMenu({\n className,\n children,\n viewport = true,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {\n viewport?: boolean\n}) {\n return (\n <NavigationMenuPrimitive.Root\n data-slot=\"navigation-menu\"\n data-viewport={viewport}\n className={cn(\n \"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n >\n {children}\n {viewport && <NavigationMenuViewport />}\n </NavigationMenuPrimitive.Root>\n )\n}\n\nfunction NavigationMenuList({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {\n return (\n <NavigationMenuPrimitive.List\n data-slot=\"navigation-menu-list\"\n className={cn(\n \"group flex flex-1 list-none items-center justify-center gap-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction NavigationMenuItem({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {\n return (\n <NavigationMenuPrimitive.Item\n data-slot=\"navigation-menu-item\"\n className={cn(\"relative\", className)}\n {...props}\n />\n )\n}\n\nconst navigationMenuTriggerStyle = cva(\n // Radix sets `data-state=\"open\"|\"closed\"` here (via its own getOpenState\n // helper) — never a literal `data-popup-open`/`data-open` attribute, so\n // both bare forms below used to be dead; one correct `data-[state=open]:`\n // set covers what they were both trying to express.\n \"group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-lg px-2.5 py-1.5 text-sm font-medium transition-colors outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-muted/50 data-[state=open]:hover:bg-muted data-[state=open]:focus:bg-muted\"\n)\n\nfunction NavigationMenuTrigger({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {\n return (\n <NavigationMenuPrimitive.Trigger\n data-slot=\"navigation-menu-trigger\"\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDownIcon\n className=\"relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]/navigation-menu-trigger:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n )\n}\n\nfunction NavigationMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {\n return (\n <NavigationMenuPrimitive.Content\n data-slot=\"navigation-menu-content\"\n className={cn(\n \"top-0 left-0 w-full p-1 ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:duration-300 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none md:absolute md:w-auto group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction NavigationMenuViewport({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {\n return (\n <div\n className={cn(\n \"absolute top-full left-0 isolate z-50 flex justify-center\"\n )}\n >\n <NavigationMenuPrimitive.Viewport\n data-slot=\"navigation-menu-viewport\"\n className={cn(\n \"origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-lg bg-popover text-popover-foreground shadow ring-1 ring-foreground/10 duration-100 md:w-(--radix-navigation-menu-viewport-width) data-[state=open]:animate-in data-[state=open]:zoom-in-90 data-[state=closed]:animate-out data-[state=closed]:zoom-out-90\",\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nfunction NavigationMenuLink({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {\n return (\n <NavigationMenuPrimitive.Link\n data-slot=\"navigation-menu-link\"\n className={cn(\n \"flex items-center gap-2 rounded-lg p-2 text-sm transition-colors outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-md data-active:bg-muted/50 data-active:hover:bg-muted data-active:focus:bg-muted [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction NavigationMenuIndicator({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {\n return (\n <NavigationMenuPrimitive.Indicator\n data-slot=\"navigation-menu-indicator\"\n className={cn(\n \"top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n )\n}\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n navigationMenuTriggerStyle,\n}\n\n/**\n * WHEN TO USE\n * - Navigating between top-level sections or modules of the app, some of\n * which expand into a dropdown of related links\n *\n * NOT WHEN\n * - Switching views within one page — use Tabs\n * - Persistent side navigation — use Sidebar\n * - An action menu (not links) — use DropdownMenu\n *\n * KEY RULES\n * - A plain link that should look like a trigger: wrap it in\n * NavigationMenuLink asChild with className={navigationMenuTriggerStyle()}\n * - Wrap real anchors in NavigationMenuLink with asChild\n * - viewport (default true) controls whether all dropdown panels share one\n * animated viewport under the bar; set false to render each inline instead\n *\n * USAGE\n * <NavigationMenu>\n * <NavigationMenuList>\n * <NavigationMenuItem>\n * <NavigationMenuTrigger>Components</NavigationMenuTrigger>\n * <NavigationMenuContent>\n * <NavigationMenuLink asChild><a href=\"/button\">Button</a></NavigationMenuLink>\n * </NavigationMenuContent>\n * </NavigationMenuItem>\n * <NavigationMenuItem>\n * <NavigationMenuLink asChild className={navigationMenuTriggerStyle()}>\n * <a href=\"/docs\">Docs</a>\n * </NavigationMenuLink>\n * </NavigationMenuItem>\n * </NavigationMenuList>\n * </NavigationMenu>\n */\n"],"mappings":";;;;;;;AAeA,SAAS,eAAe,EACtB,WACA,UACA,WAAW,MACX,GAAG,SAGF;CACD,OACE,qBAAC,iBAAwB,MAAzB;EACE,aAAU;EACV,iBAAe;EACf,WAAW,GACT,oFACA,SACF;EACA,GAAI;EAPN,UAAA,CASG,UACA,YAAY,oBAAC,wBAAD,CAAyB,CAAA,CACV;;AAElC;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,oBAAC,iBAAwB,MAAzB;EACE,aAAU;EACV,WAAW,GACT,iEACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,oBAAC,iBAAwB,MAAzB;EACE,aAAU;EACV,WAAW,GAAG,YAAY,SAAS;EACnC,GAAI;CACL,CAAA;AAEL;AAEA,IAAM,6BAA6B,IAKjC,oZACF;AAEA,SAAS,sBAAsB,EAC7B,WACA,UACA,GAAG,SAC4D;CAC/D,OACE,qBAAC,iBAAwB,SAAzB;EACE,aAAU;EACV,WAAW,GAAG,2BAA2B,GAAG,SAAS,SAAS;EAC9D,GAAI;EAHN,UAAA;GAKG;GAAU;GACX,oBAAC,iBAAD;IACE,WAAU;IACV,eAAY;GACb,CAAA;EAC8B;;AAErC;AAEA,SAAS,sBAAsB,EAC7B,WACA,GAAG,SAC4D;CAC/D,OACE,oBAAC,iBAAwB,SAAzB;EACE,aAAU;EACV,WAAW,GACT,y9CACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,uBAAuB,EAC9B,WACA,GAAG,SAC6D;CAChE,OACE,oBAAC,OAAD;EACE,WAAW,GACT,2DACF;EAEA,UAAA,oBAAC,iBAAwB,UAAzB;GACE,aAAU;GACV,WAAW,GACT,4WACA,SACF;GACA,GAAI;EACL,CAAA;CACE,CAAA;AAET;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,oBAAC,iBAAwB,MAAzB;EACE,aAAU;EACV,WAAW,GACT,4VACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,wBAAwB,EAC/B,WACA,GAAG,SAC8D;CACjE,OACE,oBAAC,iBAAwB,WAAzB;EACE,aAAU;EACV,WAAW,GACT,8LACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,OAAD,EAAK,WAAU,yEAA0E,CAAA;CACxD,CAAA;AAEvC"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PageHeader — the single top-of-page banner a page is known by.
|
|
3
|
+
*
|
|
4
|
+
* A composite: PageHeaderContent
|
|
5
|
+
* (title + description) on the left, PageHeaderActions on the right, with a
|
|
6
|
+
* border-b beneath the whole row. Deliberately has no background color of
|
|
7
|
+
* its own — it sits on whatever canvas/surface it's placed on, rather than
|
|
8
|
+
* painting its own tint.
|
|
9
|
+
*
|
|
10
|
+
* Responsive via `@container/page-header`, not a prop or a single narrow/wide
|
|
11
|
+
* switch: it tracks the header's own rendered width continuously, so it
|
|
12
|
+
* degrades in steps as room shrinks and recovers live if the host regrows it
|
|
13
|
+
* (a resizable split pane, a sidebar that collapses/expands, a sidecar panel
|
|
14
|
+
* vs. a full page) — there's no `isNarrow` boolean to compute or thread
|
|
15
|
+
* through, and no fixed viewport breakpoint that misses "narrow because of
|
|
16
|
+
* placement, not because of screen size":
|
|
17
|
+
* - below `md` (28rem): gap/padding tighten (gap-3, py-3), but the row can
|
|
18
|
+
* still wrap Actions to a second line if it doesn't fit
|
|
19
|
+
* - below `sm` (24rem): the row stops wrapping altogether and stays on one
|
|
20
|
+
* line (gap-2, px-3 — the same compact density Card uses at `size="sm"`),
|
|
21
|
+
* with the title truncating instead
|
|
22
|
+
* This stays a plain layout container the whole way down — safe for the
|
|
23
|
+
* scoped-CSS build (see Field's `orientation="responsive"` for the same
|
|
24
|
+
* `@container` idiom).
|
|
25
|
+
*/
|
|
26
|
+
import * as React from "react";
|
|
27
|
+
declare function PageHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
28
|
+
declare function PageHeaderContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
29
|
+
declare function PageHeaderTitle({ className, ...props }: React.ComponentProps<"h1">): React.JSX.Element;
|
|
30
|
+
declare function PageHeaderDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
31
|
+
declare function PageHeaderActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
32
|
+
export { PageHeader, PageHeaderContent, PageHeaderTitle, PageHeaderDescription, PageHeaderActions, };
|
|
33
|
+
/**
|
|
34
|
+
* WHEN TO USE
|
|
35
|
+
* - Top of a detail view, list page, or full-page flow — the one heading
|
|
36
|
+
* the whole page is known by
|
|
37
|
+
* - Compose a Breadcrumb above PageHeaderTitle for pages nested more than
|
|
38
|
+
* one level deep, or a status Badge inline inside PageHeaderTitle
|
|
39
|
+
*
|
|
40
|
+
* NOT WHEN
|
|
41
|
+
* - A row inside a list — use Item
|
|
42
|
+
* - A card's own heading — use CardHeader/CardTitle
|
|
43
|
+
* - A section label inside a page — use a plain heading or Item
|
|
44
|
+
*
|
|
45
|
+
* KEY RULES
|
|
46
|
+
* - PageHeaderTitle is always text-xl/font-medium — the one page-identity
|
|
47
|
+
* heading size; don't resize or reweight it per page. Size alone (not
|
|
48
|
+
* weight) is what separates it from CardTitle/DialogTitle/SheetTitle,
|
|
49
|
+
* which are all text-base/font-medium — stacking heavier weight on top
|
|
50
|
+
* of the larger size would double up the emphasis
|
|
51
|
+
* - PageHeaderActions is optional — omit it for a title-only header
|
|
52
|
+
* - Only one PageHeader per page
|
|
53
|
+
* - No background of its own — don't add bg-* here; let the page canvas or
|
|
54
|
+
* card it sits on show through
|
|
55
|
+
* - Padding is px-4 py-4 — the same standard surface padding as
|
|
56
|
+
* Card/Dialog/AlertDialog/Sheet/Drawer's `p-4`, not a wider page-edge
|
|
57
|
+
* gutter. Was px-6 previously; that was an outlier matching no other
|
|
58
|
+
* surface in the system
|
|
59
|
+
* - PageHeaderContent is flex-1 so it fills the row instead of shrinking to
|
|
60
|
+
* the title's own width — needed for anything wider than the title placed
|
|
61
|
+
* below it (e.g. a composed description row) to have room instead of
|
|
62
|
+
* wrapping inside a title-sized column
|
|
63
|
+
* - Responsive collapsing is automatic and gradual, via `@container/page-header`
|
|
64
|
+
* on the root — no prop, no `isNarrow` boolean to thread through. It tracks
|
|
65
|
+
* the header's own rendered width live, so it degrades (and recovers) in
|
|
66
|
+
* step with wherever it's actually placed — a resizable split pane, a
|
|
67
|
+
* collapsing sidebar, a sidecar panel vs. a full page — not just a small
|
|
68
|
+
* viewport. Below `md` (28rem) gap/padding tighten but Actions can still
|
|
69
|
+
* wrap to a second line; below `sm` (24rem) the row stays on one line and
|
|
70
|
+
* the title truncates instead. A title composed with an inline Badge (see
|
|
71
|
+
* Level 1's "Default" story) will clip the badge abruptly rather than
|
|
72
|
+
* ellipsis it in that collapsed state — a real trade-off of forcing one
|
|
73
|
+
* line, not a bug; avoid that composition if the header will commonly
|
|
74
|
+
* render in a narrow container.
|
|
75
|
+
* - Headers come in two buckets: Level 0 (top-level: resource lists/tables —
|
|
76
|
+
* no breadcrumb or back button, nowhere higher to go) and Level 1+
|
|
77
|
+
* (nested/detail pages — always has a Breadcrumb or back button on the
|
|
78
|
+
* left). Both are composition, not a "level" prop.
|
|
79
|
+
* - Level 1's right side is meta text + collaborator avatars + action
|
|
80
|
+
* buttons — not just a bare Edit button like Level 0. Don't wrap those
|
|
81
|
+
* buttons in a ButtonGroup: an overflow trigger, a deferral action, and a
|
|
82
|
+
* primary CTA are unrelated actions, exactly what ButtonGroup's own docs
|
|
83
|
+
* say not to use it for — and mixing an outline button's visible border
|
|
84
|
+
* against a borderless primary button inside one leaves a stray
|
|
85
|
+
* half-border at the seam. A back button is just an icon-only Button
|
|
86
|
+
* placed before PageHeaderContent.
|
|
87
|
+
* - Those three sections (meta, avatars, actions) are spaced apart by
|
|
88
|
+
* PageHeaderActions' own `gap-2` alone — no `•` divider between them; text
|
|
89
|
+
* vs. avatars vs. buttons already read as separate groups by shape, so a
|
|
90
|
+
* glyph between them would be redundant. The action buttons themselves
|
|
91
|
+
* sit inside one `gap-1` wrapper div, tighter than the `gap-2` between
|
|
92
|
+
* sections, since they're one related cluster — that div is just a plain
|
|
93
|
+
* flex container, not a ButtonGroup (still ruled out for the reason
|
|
94
|
+
* above). Level 0's actions are nothing but buttons, so that same
|
|
95
|
+
* `gap-1` goes directly on PageHeaderActions itself
|
|
96
|
+
* (`className="gap-1"`) instead of needing an inner wrapper — there's
|
|
97
|
+
* nothing else in there for it to be scoped apart from.
|
|
98
|
+
* - Level 1 supports the same two tab treatments as Level 0: a centered nav
|
|
99
|
+
* slot in the header row ("With Centered Navigation"), or a below-header
|
|
100
|
+
* `line`-variant Tabs row with the border-b moved to an outer wrapper
|
|
101
|
+
* ("With Tabs") — see Level 1's own stories for both, composed with
|
|
102
|
+
* Breadcrumb/back-button and PageHeaderActions exactly as any other
|
|
103
|
+
* Level 1 header.
|
|
104
|
+
* - Collaborator AvatarGroup in that same right side uses the default Avatar
|
|
105
|
+
* size, not "sm" — default is size-8 (32px), matching Button's own default
|
|
106
|
+
* height and iconOnly, so avatars and buttons line up in the row.
|
|
107
|
+
* "sm" (24px) sits visibly shorter than every button beside it.
|
|
108
|
+
* - "With Tabs" is NOT Tabs as a sibling below PageHeader — that puts
|
|
109
|
+
* PageHeader's own border-b between the title and the tabs. The
|
|
110
|
+
* divider belongs at the bottom of the whole block (title row + tabs
|
|
111
|
+
* together read as one header, and the border-b sits flush against the
|
|
112
|
+
* tabs' own bottom edge — no pb on Tabs). Strip PageHeader's own border
|
|
113
|
+
* with border-b-0 and move border-b onto an outer wrapper around both
|
|
114
|
+
* rows instead
|
|
115
|
+
* - The gap between the title and the tabs is PageHeader's own bottom
|
|
116
|
+
* padding, overridden down to pb-2 — not an addition on top of it. Adding
|
|
117
|
+
* Tabs its own pt-* stacks two independent paddings and reads as a visible
|
|
118
|
+
* gap between two blocks, not "one header"
|
|
119
|
+
*
|
|
120
|
+
* USAGE
|
|
121
|
+
*
|
|
122
|
+
* // Level 0 — top-level entry point, plain actions
|
|
123
|
+
* <PageHeader>
|
|
124
|
+
* <PageHeaderContent>
|
|
125
|
+
* <PageHeaderTitle>Care Gaps</PageHeaderTitle>
|
|
126
|
+
* <PageHeaderDescription>142 open gaps across your panel</PageHeaderDescription>
|
|
127
|
+
* </PageHeaderContent>
|
|
128
|
+
* <PageHeaderActions className="gap-1">
|
|
129
|
+
* <Button variant="outline">Export</Button>
|
|
130
|
+
* <Button>Add Gap</Button>
|
|
131
|
+
* </PageHeaderActions>
|
|
132
|
+
* </PageHeader>
|
|
133
|
+
*
|
|
134
|
+
* // Level 0, "With Tabs" — pb-2 replaces PageHeader's own pb-4 rather than
|
|
135
|
+
* // stacking Tabs' own top padding on top of it; two independent paddings
|
|
136
|
+
* // between the title and the tabs read as a gap, not "one header"
|
|
137
|
+
* <div className="border-b border-border">
|
|
138
|
+
* <PageHeader className="border-b-0 pb-2">
|
|
139
|
+
* <PageHeaderContent>
|
|
140
|
+
* <PageHeaderTitle>Care Gaps</PageHeaderTitle>
|
|
141
|
+
* </PageHeaderContent>
|
|
142
|
+
* </PageHeader>
|
|
143
|
+
* <Tabs defaultValue="open">
|
|
144
|
+
* <TabsList variant="line" className="px-4">
|
|
145
|
+
* <TabsTrigger value="open">Open</TabsTrigger>
|
|
146
|
+
* <TabsTrigger value="closed">Closed</TabsTrigger>
|
|
147
|
+
* </TabsList>
|
|
148
|
+
* </Tabs>
|
|
149
|
+
* </div>
|
|
150
|
+
*
|
|
151
|
+
* // Level 0, "With Navigation" — a centered nav slot. justify-between alone
|
|
152
|
+
* // won't truly center a middle child against asymmetric siblings, so
|
|
153
|
+
* // override to a grid
|
|
154
|
+
* <PageHeader className="grid grid-cols-[1fr_auto_1fr] justify-normal">
|
|
155
|
+
* <PageHeaderContent>
|
|
156
|
+
* <PageHeaderTitle>Dashboard</PageHeaderTitle>
|
|
157
|
+
* </PageHeaderContent>
|
|
158
|
+
* <ToggleGroup type="single" defaultValue="visits" spacing={0}>
|
|
159
|
+
* <ToggleGroupItem value="visits">Virtual Visits</ToggleGroupItem>
|
|
160
|
+
* <ToggleGroupItem value="assessments">Assessments</ToggleGroupItem>
|
|
161
|
+
* </ToggleGroup>
|
|
162
|
+
* <PageHeaderActions className="justify-self-end gap-1">
|
|
163
|
+
* <Button variant="outline">Export</Button>
|
|
164
|
+
* </PageHeaderActions>
|
|
165
|
+
* </PageHeader>
|
|
166
|
+
*
|
|
167
|
+
* // Level 1 — Breadcrumb, and the meta+avatars+actions right side
|
|
168
|
+
* <PageHeader>
|
|
169
|
+
* <PageHeaderContent>
|
|
170
|
+
* <Breadcrumb>...</Breadcrumb>
|
|
171
|
+
* <PageHeaderTitle>James Wilson</PageHeaderTitle>
|
|
172
|
+
* </PageHeaderContent>
|
|
173
|
+
* <PageHeaderActions>
|
|
174
|
+
* <MetaList size="sm">
|
|
175
|
+
* <MetaListItem>Few minutes ago</MetaListItem>
|
|
176
|
+
* </MetaList>
|
|
177
|
+
* <AvatarGroup>
|
|
178
|
+
* <Avatar><AvatarFallback>JD</AvatarFallback></Avatar>
|
|
179
|
+
* <Avatar><AvatarFallback>SP</AvatarFallback></Avatar>
|
|
180
|
+
* <AvatarGroupCount>+2</AvatarGroupCount>
|
|
181
|
+
* </AvatarGroup>
|
|
182
|
+
* <div className="flex items-center gap-1">
|
|
183
|
+
* <Button variant="outline" iconOnly aria-label="More options">
|
|
184
|
+
* <EllipsisIcon />
|
|
185
|
+
* </Button>
|
|
186
|
+
* <Button variant="outline">Finish later</Button>
|
|
187
|
+
* <Button>Next</Button>
|
|
188
|
+
* </div>
|
|
189
|
+
* </PageHeaderActions>
|
|
190
|
+
* </PageHeader>
|
|
191
|
+
*
|
|
192
|
+
* // Level 1 — back button instead of a Breadcrumb, for hierarchies under 3
|
|
193
|
+
* // levels deep. Same meta+avatars+actions right side as above
|
|
194
|
+
* <PageHeader>
|
|
195
|
+
* <PageHeaderContent className="flex-row items-center gap-3">
|
|
196
|
+
* <Button variant="ghost" iconOnly aria-label="Back">
|
|
197
|
+
* <ArrowLeftIcon />
|
|
198
|
+
* </Button>
|
|
199
|
+
* <PageHeaderTitle>James Wilson</PageHeaderTitle>
|
|
200
|
+
* </PageHeaderContent>
|
|
201
|
+
* </PageHeader>
|
|
202
|
+
*
|
|
203
|
+
* // Level 1 — a richer description row: an outlined Badge with a colored icon
|
|
204
|
+
* // for status, plus a dot-separated MetaList for channels, instead of plain
|
|
205
|
+
* // text. PageHeaderDescription is a <p>, so block-level children replace it
|
|
206
|
+
* // here rather than nesting inside it
|
|
207
|
+
* <PageHeader>
|
|
208
|
+
* <PageHeaderContent>
|
|
209
|
+
* <PageHeaderTitle>Covid-19</PageHeaderTitle>
|
|
210
|
+
* <div className="flex items-center gap-3">
|
|
211
|
+
* <Badge emphasis="outline">
|
|
212
|
+
* <CheckIcon className="text-success" data-icon="inline-start" />
|
|
213
|
+
* Ongoing
|
|
214
|
+
* </Badge>
|
|
215
|
+
* <MetaList size="sm">
|
|
216
|
+
* <MetaListItem>Text</MetaListItem>
|
|
217
|
+
* <MetaListItem>Email</MetaListItem>
|
|
218
|
+
* </MetaList>
|
|
219
|
+
* </div>
|
|
220
|
+
* </PageHeaderContent>
|
|
221
|
+
* </PageHeader>
|
|
222
|
+
*/
|
|
223
|
+
//# sourceMappingURL=page-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../../src/components/ui/page-header.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWvE;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ7B;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBAW3E;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,qBAW3B;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ7B;AAED,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,GAClB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6LG"}
|