linkedunion-design-kit 1.10.6-beta.2 → 1.10.7-beta.1

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.
Files changed (39) hide show
  1. package/dist/index.d.ts +5 -0
  2. package/dist/index.js +5 -0
  3. package/dist/src/components/Alerts/Alert/alert.js +1 -0
  4. package/dist/src/components/Button/Button/Button.d.ts +2 -1
  5. package/dist/src/components/Button/Button/Button.js +18 -6
  6. package/dist/src/components/Button/Button/Button.stories.d.ts +4 -2
  7. package/dist/src/components/Button/index.d.ts +1 -0
  8. package/dist/src/components/Button/index.js +3 -3
  9. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.d.ts +6 -2
  10. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.js +7 -6
  11. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.d.ts +8 -1
  12. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.js +48 -3
  13. package/dist/src/components/Dropdown/DropdownMenu/index.d.ts +5 -0
  14. package/dist/src/components/Dropdown/DropdownMenu/index.js +5 -0
  15. package/dist/src/components/Dropdown/select.js +1 -1
  16. package/dist/src/components/MenuBar/menubar.d.ts +26 -0
  17. package/dist/src/components/MenuBar/menubar.js +92 -0
  18. package/dist/src/components/MenuBar/menubar.stories.d.ts +14 -0
  19. package/dist/src/components/MenuBar/menubar.stories.js +59 -0
  20. package/dist/src/components/NavigationMenu/index.d.ts +1 -0
  21. package/dist/src/components/NavigationMenu/index.js +1 -0
  22. package/dist/src/components/NavigationMenu/navigation-menu.d.ts +14 -0
  23. package/dist/src/components/NavigationMenu/navigation-menu.js +62 -0
  24. package/dist/src/components/NavigationMenu/navigation-menu.stories.d.ts +29 -0
  25. package/dist/src/components/NavigationMenu/navigation-menu.stories.js +91 -0
  26. package/dist/src/components/Separator/Separator.stories.d.ts +15 -0
  27. package/dist/src/components/Separator/Separator.stories.js +79 -0
  28. package/dist/src/components/Separator/index.d.ts +1 -0
  29. package/dist/src/components/Separator/index.js +1 -0
  30. package/dist/src/components/Separator/separator.d.ts +4 -0
  31. package/dist/src/components/Separator/separator.js +32 -0
  32. package/dist/src/components/Sheet/index.d.ts +1 -0
  33. package/dist/src/components/Sheet/index.js +1 -0
  34. package/dist/src/components/Sheet/sheet.d.ts +25 -0
  35. package/dist/src/components/Sheet/sheet.js +76 -0
  36. package/dist/src/components/Sheet/sheet.stories.d.ts +7 -0
  37. package/dist/src/components/Sheet/sheet.stories.js +21 -0
  38. package/dist/styles/global.css +524 -0
  39. package/package.json +4 -1
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent, MenubarShortcut, MenubarGroup, } from "./menubar";
4
+ var meta = {
5
+ title: "Components/MenuBar",
6
+ component: Menubar,
7
+ parameters: {
8
+ layout: "centered",
9
+ docs: {
10
+ description: {
11
+ component: "A visually persistent menu common in desktop applications that provides quick access to a consistent set of commands. Built on top of Radix UI Menubar primitive.",
12
+ },
13
+ },
14
+ },
15
+ tags: ["autodocs"],
16
+ };
17
+ export default meta;
18
+ // Basic menubar with File and Edit menus
19
+ export var Basic = function () { return (_jsxs(Menubar, { children: [_jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "File" }), _jsxs(MenubarContent, { children: [_jsxs(MenubarItem, { children: ["New Tab ", _jsx(MenubarShortcut, { children: "\u2318T" })] }), _jsxs(MenubarItem, { children: ["New Window ", _jsx(MenubarShortcut, { children: "\u2318N" })] }), _jsx(MenubarSeparator, {}), _jsxs(MenubarItem, { children: ["Open File... ", _jsx(MenubarShortcut, { children: "\u2318O" })] })] })] }), _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "Edit" }), _jsxs(MenubarContent, { children: [_jsxs(MenubarItem, { children: ["Undo ", _jsx(MenubarShortcut, { children: "\u2318Z" })] }), _jsxs(MenubarItem, { children: ["Redo ", _jsx(MenubarShortcut, { children: "\u21E7\u2318Z" })] }), _jsx(MenubarSeparator, {}), _jsxs(MenubarItem, { children: ["Cut ", _jsx(MenubarShortcut, { children: "\u2318X" })] }), _jsxs(MenubarItem, { children: ["Copy ", _jsx(MenubarShortcut, { children: "\u2318C" })] }), _jsxs(MenubarItem, { children: ["Paste ", _jsx(MenubarShortcut, { children: "\u2318V" })] })] })] })] })); };
20
+ // Complete desktop-style menubar example from shadcn docs
21
+ export var Complete = function () {
22
+ var _a = useState(false), showBookmarks = _a[0], setShowBookmarks = _a[1];
23
+ var _b = useState(true), showFullUrls = _b[0], setShowFullUrls = _b[1];
24
+ var _c = useState("benoit"), selectedProfile = _c[0], setSelectedProfile = _c[1];
25
+ return (_jsxs(Menubar, { children: [_jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "File" }), _jsxs(MenubarContent, { children: [_jsxs(MenubarItem, { children: ["New Tab ", _jsx(MenubarShortcut, { children: "\u2318T" })] }), _jsxs(MenubarItem, { children: ["New Window ", _jsx(MenubarShortcut, { children: "\u2318N" })] }), _jsx(MenubarItem, { disabled: true, children: "New Incognito Window" }), _jsx(MenubarSeparator, {}), _jsxs(MenubarSub, { children: [_jsx(MenubarSubTrigger, { children: "Share" }), _jsxs(MenubarSubContent, { children: [_jsx(MenubarItem, { children: "Email link" }), _jsx(MenubarItem, { children: "Messages" }), _jsx(MenubarItem, { children: "Notes" })] })] }), _jsx(MenubarSeparator, {}), _jsxs(MenubarItem, { children: ["Print... ", _jsx(MenubarShortcut, { children: "\u2318P" })] })] })] }), _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "Edit" }), _jsxs(MenubarContent, { children: [_jsxs(MenubarItem, { children: ["Undo ", _jsx(MenubarShortcut, { children: "\u2318Z" })] }), _jsxs(MenubarItem, { children: ["Redo ", _jsx(MenubarShortcut, { children: "\u21E7\u2318Z" })] }), _jsx(MenubarSeparator, {}), _jsxs(MenubarSub, { children: [_jsx(MenubarSubTrigger, { children: "Find" }), _jsxs(MenubarSubContent, { children: [_jsx(MenubarItem, { children: "Search the web" }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { children: "Find..." }), _jsx(MenubarItem, { children: "Find Next" }), _jsx(MenubarItem, { children: "Find Previous" })] })] }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { children: "Cut" }), _jsx(MenubarItem, { children: "Copy" }), _jsx(MenubarItem, { children: "Paste" })] })] }), _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "View" }), _jsxs(MenubarContent, { children: [_jsx(MenubarCheckboxItem, { checked: showBookmarks, onCheckedChange: setShowBookmarks, children: "Always Show Bookmarks Bar" }), _jsx(MenubarCheckboxItem, { checked: showFullUrls, onCheckedChange: setShowFullUrls, children: "Always Show Full URLs" }), _jsx(MenubarSeparator, {}), _jsxs(MenubarItem, { inset: true, children: ["Reload ", _jsx(MenubarShortcut, { children: "\u2318R" })] }), _jsxs(MenubarItem, { disabled: true, inset: true, children: ["Force Reload ", _jsx(MenubarShortcut, { children: "\u21E7\u2318R" })] }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { inset: true, children: "Toggle Fullscreen" }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { inset: true, children: "Hide Sidebar" })] })] }), _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "Profiles" }), _jsxs(MenubarContent, { children: [_jsxs(MenubarRadioGroup, { value: selectedProfile, onValueChange: setSelectedProfile, children: [_jsx(MenubarRadioItem, { value: "andy", children: "Andy" }), _jsx(MenubarRadioItem, { value: "benoit", children: "Benoit" }), _jsx(MenubarRadioItem, { value: "luis", children: "Luis" })] }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { inset: true, children: "Edit..." }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { inset: true, children: "Add Profile..." })] })] })] }));
26
+ };
27
+ // Menubar with checkbox items
28
+ export var WithCheckboxItems = function () {
29
+ var _a = useState(false), showBookmarks = _a[0], setShowBookmarks = _a[1];
30
+ var _b = useState(true), showFullUrls = _b[0], setShowFullUrls = _b[1];
31
+ var _c = useState(false), showDeveloperTools = _c[0], setShowDeveloperTools = _c[1];
32
+ return (_jsx(Menubar, { children: _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "View" }), _jsxs(MenubarContent, { children: [_jsx(MenubarCheckboxItem, { checked: showBookmarks, onCheckedChange: setShowBookmarks, children: "Show Bookmarks Bar" }), _jsx(MenubarCheckboxItem, { checked: showFullUrls, onCheckedChange: setShowFullUrls, children: "Show Full URLs" }), _jsx(MenubarCheckboxItem, { checked: showDeveloperTools, onCheckedChange: setShowDeveloperTools, children: "Developer Tools" })] })] }) }));
33
+ };
34
+ // Menubar with radio group
35
+ export var WithRadioGroup = function () {
36
+ var _a = useState("system"), theme = _a[0], setTheme = _a[1];
37
+ return (_jsx(Menubar, { children: _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "Theme" }), _jsx(MenubarContent, { children: _jsxs(MenubarRadioGroup, { value: theme, onValueChange: setTheme, children: [_jsx(MenubarRadioItem, { value: "light", children: "Light" }), _jsx(MenubarRadioItem, { value: "dark", children: "Dark" }), _jsx(MenubarRadioItem, { value: "system", children: "System" })] }) })] }) }));
38
+ };
39
+ // Menubar with submenu
40
+ export var WithSubMenus = {
41
+ render: function () { return (_jsx(Menubar, { children: _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "File" }), _jsxs(MenubarContent, { children: [_jsx(MenubarItem, { children: "New" }), _jsx(MenubarSeparator, {}), _jsxs(MenubarSub, { children: [_jsx(MenubarSubTrigger, { children: "Share" }), _jsxs(MenubarSubContent, { children: [_jsx(MenubarItem, { children: "Email link" }), _jsx(MenubarItem, { children: "Copy link" }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { children: "More..." })] })] }), _jsxs(MenubarSub, { children: [_jsx(MenubarSubTrigger, { children: "Export" }), _jsxs(MenubarSubContent, { children: [_jsx(MenubarItem, { children: "PDF" }), _jsx(MenubarItem, { children: "HTML" }), _jsx(MenubarItem, { children: "Markdown" })] })] }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { children: "Print..." })] })] }) })); },
42
+ };
43
+ // Menubar with disabled items
44
+ export var WithDisabledItems = {
45
+ render: function () { return (_jsxs(Menubar, { children: [_jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "File" }), _jsxs(MenubarContent, { children: [_jsx(MenubarItem, { children: "New Tab" }), _jsx(MenubarItem, { children: "New Window" }), _jsx(MenubarItem, { disabled: true, children: "New Incognito Window" }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { children: "Open File..." }), _jsx(MenubarItem, { disabled: true, children: "Open Recent" })] })] }), _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "Edit" }), _jsxs(MenubarContent, { children: [_jsx(MenubarItem, { disabled: true, children: "Undo" }), _jsx(MenubarItem, { disabled: true, children: "Redo" }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { children: "Cut" }), _jsx(MenubarItem, { children: "Copy" }), _jsx(MenubarItem, { children: "Paste" })] })] })] })); },
46
+ };
47
+ // Menubar with labels and groups
48
+ export var WithLabelsAndGroups = {
49
+ render: function () { return (_jsx(Menubar, { children: _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "Edit" }), _jsxs(MenubarContent, { children: [_jsx(MenubarLabel, { children: "Actions" }), _jsxs(MenubarItem, { children: ["Undo ", _jsx(MenubarShortcut, { children: "\u2318Z" })] }), _jsxs(MenubarItem, { children: ["Redo ", _jsx(MenubarShortcut, { children: "\u21E7\u2318Z" })] }), _jsx(MenubarSeparator, {}), _jsx(MenubarLabel, { children: "Clipboard" }), _jsxs(MenubarGroup, { children: [_jsxs(MenubarItem, { children: ["Cut ", _jsx(MenubarShortcut, { children: "\u2318X" })] }), _jsxs(MenubarItem, { children: ["Copy ", _jsx(MenubarShortcut, { children: "\u2318C" })] }), _jsxs(MenubarItem, { children: ["Paste ", _jsx(MenubarShortcut, { children: "\u2318V" })] })] }), _jsx(MenubarSeparator, {}), _jsx(MenubarLabel, { children: "Selection" }), _jsxs(MenubarItem, { children: ["Select All ", _jsx(MenubarShortcut, { children: "\u2318A" })] })] })] }) })); },
50
+ };
51
+ // Menubar with inset items (items with left padding for alignment)
52
+ export var WithInsetItems = function () {
53
+ var _a = useState(true), showStatus = _a[0], setShowStatus = _a[1];
54
+ return (_jsx(Menubar, { children: _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "View" }), _jsxs(MenubarContent, { children: [_jsx(MenubarCheckboxItem, { checked: showStatus, onCheckedChange: setShowStatus, children: "Show Status Bar" }), _jsx(MenubarSeparator, {}), _jsxs(MenubarItem, { inset: true, children: ["Zoom In ", _jsx(MenubarShortcut, { children: "\u2318+" })] }), _jsxs(MenubarItem, { inset: true, children: ["Zoom Out ", _jsx(MenubarShortcut, { children: "\u2318-" })] }), _jsxs(MenubarItem, { inset: true, children: ["Reset Zoom ", _jsx(MenubarShortcut, { children: "\u23180" })] })] })] }) }));
55
+ };
56
+ // Nested submenus example
57
+ export var NestedSubMenus = {
58
+ render: function () { return (_jsx(Menubar, { children: _jsxs(MenubarMenu, { children: [_jsx(MenubarTrigger, { children: "File" }), _jsxs(MenubarContent, { children: [_jsx(MenubarItem, { children: "New" }), _jsx(MenubarSeparator, {}), _jsxs(MenubarSub, { children: [_jsx(MenubarSubTrigger, { children: "Open Recent" }), _jsxs(MenubarSubContent, { children: [_jsx(MenubarItem, { children: "document.txt" }), _jsx(MenubarItem, { children: "image.png" }), _jsx(MenubarSeparator, {}), _jsxs(MenubarSub, { children: [_jsx(MenubarSubTrigger, { children: "More..." }), _jsxs(MenubarSubContent, { children: [_jsx(MenubarItem, { children: "Last Week" }), _jsx(MenubarItem, { children: "Last Month" }), _jsx(MenubarItem, { children: "Last Year" })] })] }), _jsx(MenubarSeparator, {}), _jsx(MenubarItem, { children: "Clear Recent" })] })] })] })] }) })); },
59
+ };
@@ -0,0 +1 @@
1
+ export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, } from "./navigation-menu";
@@ -0,0 +1 @@
1
+ export { navigationMenuTriggerStyle, NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, } from "./navigation-menu";
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
+ declare function NavigationMenu({ className, children, viewport, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
4
+ viewport?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ declare function NavigationMenuList({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.List>): import("react/jsx-runtime").JSX.Element;
7
+ declare function NavigationMenuItem({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
8
+ declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ declare function NavigationMenuTrigger({ className, children, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
10
+ declare function NavigationMenuContent({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
11
+ declare function NavigationMenuViewport({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>): import("react/jsx-runtime").JSX.Element;
12
+ declare function NavigationMenuLink({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>): import("react/jsx-runtime").JSX.Element;
13
+ declare function NavigationMenuIndicator({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>): import("react/jsx-runtime").JSX.Element;
14
+ export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, navigationMenuTriggerStyle, };
@@ -0,0 +1,62 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
25
+ import { cva } from "class-variance-authority";
26
+ import { ChevronDownIcon } from "lucide-react";
27
+ import { cn } from "../../lib/utils";
28
+ import { Reset_BS } from "../../utils/constants";
29
+ function NavigationMenu(_a) {
30
+ var className = _a.className, children = _a.children, _b = _a.viewport, viewport = _b === void 0 ? true : _b, props = __rest(_a, ["className", "children", "viewport"]);
31
+ return (_jsxs(NavigationMenuPrimitive.Root, __assign({ "data-slot": "navigation-menu", "data-viewport": viewport, className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className) }, props, { children: [children, viewport && _jsx(NavigationMenuViewport, {})] })));
32
+ }
33
+ function NavigationMenuList(_a) {
34
+ var className = _a.className, props = __rest(_a, ["className"]);
35
+ return (_jsx(NavigationMenuPrimitive.List, __assign({ "data-slot": "navigation-menu-list", "data-reset-list": "reset-bs-ul", "data-reset": Reset_BS, className: cn("group flex flex-1 list-none items-center justify-center gap-1", className) }, props)));
36
+ }
37
+ function NavigationMenuItem(_a) {
38
+ var className = _a.className, props = __rest(_a, ["className"]);
39
+ return (_jsx(NavigationMenuPrimitive.Item, __assign({ "data-slot": "navigation-menu-item", className: cn("relative", className) }, props)));
40
+ }
41
+ var navigationMenuTriggerStyle = cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");
42
+ function NavigationMenuTrigger(_a) {
43
+ var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
44
+ return (_jsxs(NavigationMenuPrimitive.Trigger, __assign({ "data-slot": "navigation-menu-trigger", className: cn(navigationMenuTriggerStyle(), "group", className) }, props, { children: [children, " ", _jsx(ChevronDownIcon, { className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180", "aria-hidden": "true" })] })));
45
+ }
46
+ function NavigationMenuContent(_a) {
47
+ var className = _a.className, props = __rest(_a, ["className"]);
48
+ return (_jsx(NavigationMenuPrimitive.Content, __assign({ "data-slot": "navigation-menu-content", className: cn("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out 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 top-0 left-0 w-full !p-2 pr-2.5 md:absolute md:w-auto", "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 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-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none", className) }, props)));
49
+ }
50
+ function NavigationMenuViewport(_a) {
51
+ var className = _a.className, props = __rest(_a, ["className"]);
52
+ return (_jsx("div", { className: cn("absolute top-full left-0 isolate z-50 flex justify-center"), children: _jsx(NavigationMenuPrimitive.Viewport, __assign({ "data-slot": "navigation-menu-viewport", className: cn("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]", className) }, props)) }));
53
+ }
54
+ function NavigationMenuLink(_a) {
55
+ var className = _a.className, props = __rest(_a, ["className"]);
56
+ return (_jsx(NavigationMenuPrimitive.Link, __assign({ "data-slot": "navigation-menu-link", className: cn("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm !p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4", className) }, props)));
57
+ }
58
+ function NavigationMenuIndicator(_a) {
59
+ var className = _a.className, props = __rest(_a, ["className"]);
60
+ return (_jsx(NavigationMenuPrimitive.Indicator, __assign({ "data-slot": "navigation-menu-indicator", className: cn("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden", className) }, props, { children: _jsx("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" }) })));
61
+ }
62
+ export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, navigationMenuTriggerStyle, };
@@ -0,0 +1,29 @@
1
+ import { NavigationMenu } from "./navigation-menu";
2
+ declare const _default: {
3
+ title: string;
4
+ component: typeof NavigationMenu;
5
+ tags: string[];
6
+ parameters: {
7
+ docs: {
8
+ story: {
9
+ height: string;
10
+ };
11
+ };
12
+ };
13
+ };
14
+ export default _default;
15
+ export declare const Default: {
16
+ render: () => import("react/jsx-runtime").JSX.Element;
17
+ };
18
+ export declare const WithIcons: {
19
+ render: () => import("react/jsx-runtime").JSX.Element;
20
+ };
21
+ export declare const WithSubmenu: {
22
+ render: () => import("react/jsx-runtime").JSX.Element;
23
+ };
24
+ export declare const DisabledItem: {
25
+ render: () => import("react/jsx-runtime").JSX.Element;
26
+ };
27
+ export declare const RightAlignedContent: {
28
+ render: () => import("react/jsx-runtime").JSX.Element;
29
+ };
@@ -0,0 +1,91 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle, } from "./navigation-menu";
25
+ export default {
26
+ title: "Components/NavigationMenu",
27
+ component: NavigationMenu,
28
+ tags: ["autodocs"],
29
+ parameters: {
30
+ docs: {
31
+ story: {
32
+ height: "400px",
33
+ },
34
+ },
35
+ },
36
+ };
37
+ var components = [
38
+ {
39
+ title: "Alert Dialog",
40
+ href: "#",
41
+ description: "A modal dialog that interrupts the user with important content and expects a response.",
42
+ },
43
+ {
44
+ title: "Hover Card",
45
+ href: "#",
46
+ description: "For sighted users to preview content available behind a link.",
47
+ },
48
+ {
49
+ title: "Progress",
50
+ href: "#",
51
+ description: "Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.",
52
+ },
53
+ {
54
+ title: "Scroll-area",
55
+ href: "#",
56
+ description: "Visually or semantically separates content.",
57
+ },
58
+ {
59
+ title: "Tabs",
60
+ href: "#",
61
+ description: "A set of layered sections of content—known as tab panels—that are displayed one at a time.",
62
+ },
63
+ {
64
+ title: "Tooltip",
65
+ href: "#",
66
+ description: "A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.",
67
+ },
68
+ ];
69
+ function ListItem(_a) {
70
+ var title = _a.title, children = _a.children, href = _a.href, props = __rest(_a, ["title", "children", "href"]);
71
+ return (_jsx("li", __assign({}, props, { children: _jsxs(NavigationMenuLink, { href: href, className: "block p-2 rounded hover:bg-accent", children: [_jsx("div", { className: "text-sm font-medium leading-none", children: title }), _jsx("p", { className: "text-muted-foreground line-clamp-2 text-sm leading-snug", children: children })] }) })));
72
+ }
73
+ export var Default = {
74
+ render: function () { return (_jsx(NavigationMenu, { children: _jsxs(NavigationMenuList, { className: "flex-wrap", children: [_jsxs(NavigationMenuItem, { children: [_jsx(NavigationMenuTrigger, { children: "Home" }), _jsx(NavigationMenuContent, { children: _jsxs("ul", { className: "grid gap-2 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]", children: [_jsx("li", { className: "row-span-3", children: _jsxs(NavigationMenuLink, { href: "#", className: "block p-4 rounded bg-accent", children: [_jsx("div", { className: "mb-2 text-lg font-medium sm:mt-4", children: "shadcn/ui" }), _jsx("p", { className: "text-muted-foreground text-sm leading-tight", children: "Beautifully designed components built with Tailwind CSS." })] }) }), _jsx(ListItem, { href: "#", title: "Introduction", children: "Re-usable components built using Radix UI and Tailwind CSS." }), _jsx(ListItem, { href: "#", title: "Installation", children: "How to install dependencies and structure your app." }), _jsx(ListItem, { href: "#", title: "Typography", children: "Styles for headings, paragraphs, lists...etc" })] }) })] }), _jsxs(NavigationMenuItem, { children: [_jsx(NavigationMenuTrigger, { children: "Components" }), _jsx(NavigationMenuContent, { children: _jsx("ul", { className: "grid gap-2 sm:w-[400px] md:w-[500px] md:grid-cols-2 lg:w-[600px]", children: components.map(function (component) { return (_jsx(ListItem, { title: component.title, href: component.href, children: component.description }, component.title)); }) }) })] }), _jsx(NavigationMenuItem, { children: _jsx(NavigationMenuLink, { href: "#", className: navigationMenuTriggerStyle(), children: "Docs" }) })] }) })); },
75
+ };
76
+ // Story: With Icons
77
+ export var WithIcons = {
78
+ render: function () { return (_jsx(NavigationMenu, { children: _jsxs(NavigationMenuList, { children: [_jsxs(NavigationMenuItem, { children: [_jsxs(NavigationMenuTrigger, { children: [_jsx("span", { role: "img", "aria-label": "home", className: "mr-2", children: "\uD83C\uDFE0" }), "Home"] }), _jsx(NavigationMenuContent, { children: _jsxs("ul", { className: "p-2", children: [_jsxs(ListItem, { href: "#", title: "Dashboard", children: [_jsx("span", { role: "img", "aria-label": "dashboard", className: "mr-2", children: "\uD83D\uDCCA" }), "View your dashboard"] }), _jsxs(ListItem, { href: "#", title: "Profile", children: [_jsx("span", { role: "img", "aria-label": "profile", className: "mr-2", children: "\uD83D\uDC64" }), "Manage your profile"] })] }) })] }), _jsx(NavigationMenuItem, { children: _jsxs(NavigationMenuLink, { href: "#", className: navigationMenuTriggerStyle(), children: [_jsx("span", { role: "img", "aria-label": "docs", className: "mr-2", children: "\uD83D\uDCC4" }), "Docs"] }) })] }) })); },
79
+ };
80
+ // Story: With Submenu
81
+ export var WithSubmenu = {
82
+ render: function () { return (_jsx(NavigationMenu, { children: _jsx(NavigationMenuList, { children: _jsxs(NavigationMenuItem, { children: [_jsx(NavigationMenuTrigger, { children: "Services" }), _jsx(NavigationMenuContent, { children: _jsxs("ul", { className: "p-2", children: [_jsx(ListItem, { href: "#", title: "Design", children: "UI/UX Design services" }), _jsx(ListItem, { href: "#", title: "Development", children: "Web Development" }), _jsxs("li", { children: [_jsx(NavigationMenuTrigger, { className: "w-full", children: "More" }), _jsx(NavigationMenuContent, { children: _jsxs("ul", { className: "p-2", children: [_jsx(ListItem, { href: "#", title: "Consulting", children: "Business Consulting" }), _jsx(ListItem, { href: "#", title: "Support", children: "Customer Support" })] }) })] })] }) })] }) }) })); },
83
+ };
84
+ // Story: Disabled Item
85
+ export var DisabledItem = {
86
+ render: function () { return (_jsx(NavigationMenu, { children: _jsx(NavigationMenuList, { children: _jsxs(NavigationMenuItem, { children: [_jsx(NavigationMenuTrigger, { children: "Active" }), _jsx(NavigationMenuContent, { children: _jsxs("ul", { className: "p-2", children: [_jsx(ListItem, { href: "#", title: "Enabled", children: "This item is enabled" }), _jsx("li", { children: _jsx(NavigationMenuLink, { href: "#", className: "block p-2 rounded text-muted-foreground cursor-not-allowed opacity-50", "aria-disabled": "true", tabIndex: -1, children: "Disabled Item" }) })] }) })] }) }) })); },
87
+ };
88
+ // Story: Right Aligned Content
89
+ export var RightAlignedContent = {
90
+ render: function () { return (_jsx("div", { className: "flex justify-end", children: _jsx(NavigationMenu, { viewport: false, children: _jsx(NavigationMenuList, { children: _jsxs(NavigationMenuItem, { children: [_jsx(NavigationMenuTrigger, { children: "Right Align" }), _jsx(NavigationMenuContent, { className: "left-auto right-0 min-w-[320px]", children: _jsxs("ul", { className: "grid gap-2 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]", children: [_jsx("li", { className: "row-span-3", children: _jsxs(NavigationMenuLink, { href: "#", className: "block p-4 rounded bg-accent", children: [_jsx("div", { className: "mb-2 text-lg font-medium sm:mt-4", children: "shadcn/ui" }), _jsx("p", { className: "text-muted-foreground text-sm leading-tight", children: "Beautifully designed components built with Tailwind CSS." })] }) }), _jsx(ListItem, { href: "#", title: "Introduction", children: "Re-usable components built using Radix UI and Tailwind CSS." }), _jsx(ListItem, { href: "#", title: "Installation", children: "How to install dependencies and structure your app." }), _jsx(ListItem, { href: "#", title: "Typography", children: "Styles for headings, paragraphs, lists...etc" })] }) })] }) }) }) })); },
91
+ };
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Separator } from "../../components/Separator/separator";
3
+ declare const meta: Meta<typeof Separator>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Separator>;
6
+ export declare function SeparatorDemo({ orientation, decorative, className, }: {
7
+ orientation?: "horizontal" | "vertical";
8
+ decorative?: boolean;
9
+ className?: string;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export declare const Horizontal: Story;
12
+ export declare const Vertical: Story;
13
+ export declare const Demo: Story;
14
+ export declare const DecorativeTrue: Story;
15
+ export declare const DecorativeFalse: Story;
@@ -0,0 +1,79 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Separator } from "../../components/Separator/separator";
14
+ var meta = {
15
+ title: "UI/Separator",
16
+ component: Separator,
17
+ tags: ["autodocs"],
18
+ argTypes: {
19
+ orientation: {
20
+ control: { type: "radio" },
21
+ options: ["horizontal", "vertical"],
22
+ description: "Separator orientation",
23
+ table: { type: { summary: '"horizontal" | "vertical"' } },
24
+ },
25
+ decorative: {
26
+ control: { type: "boolean" },
27
+ description: "Accessibility: purely visual separator",
28
+ table: { type: { summary: "boolean" } },
29
+ },
30
+ className: {
31
+ control: { type: "text" },
32
+ description: "Custom CSS classes",
33
+ table: { type: { summary: "string" } },
34
+ },
35
+ },
36
+ };
37
+ export default meta;
38
+ export function SeparatorDemo(_a) {
39
+ var _b = _a.orientation, orientation = _b === void 0 ? "horizontal" : _b, _c = _a.decorative, decorative = _c === void 0 ? true : _c, _d = _a.className, className = _d === void 0 ? "my-4" : _d;
40
+ return (_jsxs("div", { children: [_jsxs("div", { className: "space-y-1", children: [_jsx("h4", { className: "text-sm leading-none font-medium", children: "Radix Primitives" }), _jsx("p", { className: "text-muted-foreground text-sm", children: "An open-source UI component library." })] }), _jsx("div", { className: "h-20 flex items-center", children: _jsx(Separator, { className: className, orientation: orientation, decorative: decorative }) }), _jsxs("div", { className: "flex h-5 items-center space-x-4 text-sm", children: [_jsx("div", { children: "Blog" }), _jsx(Separator, { orientation: "vertical", decorative: decorative, className: className }), _jsx("div", { children: "Docs" }), _jsx(Separator, { orientation: "vertical", decorative: decorative, className: className }), _jsx("div", { children: "Source" })] })] }));
41
+ }
42
+ export var Horizontal = {
43
+ args: {
44
+ orientation: "horizontal",
45
+ decorative: true,
46
+ className: "my-4",
47
+ },
48
+ render: function (args) { return (_jsx("div", { style: { width: 300 }, children: _jsx(Separator, __assign({}, args)) })); },
49
+ };
50
+ export var Vertical = {
51
+ args: {
52
+ orientation: "vertical",
53
+ decorative: true,
54
+ className: "mx-4 h-20",
55
+ },
56
+ render: function (args) { return _jsx(Separator, __assign({}, args)); },
57
+ };
58
+ export var Demo = {
59
+ args: {
60
+ orientation: "horizontal",
61
+ decorative: true,
62
+ className: "my-4",
63
+ },
64
+ render: function (args) { return _jsx(SeparatorDemo, __assign({}, args)); },
65
+ };
66
+ export var DecorativeTrue = {
67
+ args: {
68
+ decorative: true,
69
+ className: "my-4",
70
+ },
71
+ render: function (args) { return (_jsxs("div", { children: [_jsx("p", { children: "Above separator " }), _jsx(Separator, __assign({}, args)), _jsx("p", { children: "Below separator" })] })); },
72
+ };
73
+ export var DecorativeFalse = {
74
+ args: {
75
+ decorative: false,
76
+ className: "my-4",
77
+ },
78
+ render: function (args) { return (_jsxs("div", { children: [_jsx("p", { children: "Above separator (decorative=false)" }), _jsx(Separator, __assign({}, args)), _jsx("p", { children: "Below separator" })] })); },
79
+ };
@@ -0,0 +1 @@
1
+ export { Separator } from "./separator";
@@ -0,0 +1 @@
1
+ export { Separator } from "./separator";
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
+ declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ export { Separator };
@@ -0,0 +1,32 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import * as React from "react";
25
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
26
+ import { cn } from "../../lib/utils";
27
+ var Separator = React.forwardRef(function (_a, ref) {
28
+ var className = _a.className, _b = _a.orientation, orientation = _b === void 0 ? "horizontal" : _b, _c = _a.decorative, decorative = _c === void 0 ? true : _c, props = __rest(_a, ["className", "orientation", "decorative"]);
29
+ return (_jsx(SeparatorPrimitive.Root, __assign({ ref: ref, decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className) }, props)));
30
+ });
31
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
32
+ export { Separator };
@@ -0,0 +1 @@
1
+ export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, } from "./sheet";
@@ -0,0 +1 @@
1
+ export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, } from "./sheet";
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
5
+ declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
8
+ declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const sheetVariants: (props?: ({
10
+ side?: "top" | "bottom" | "left" | "right" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
13
+ }
14
+ declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
15
+ declare const SheetHeader: {
16
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
17
+ displayName: string;
18
+ };
19
+ declare const SheetFooter: {
20
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
21
+ displayName: string;
22
+ };
23
+ declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
24
+ declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
25
+ export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -0,0 +1,76 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import * as React from "react";
25
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
26
+ import { cva } from "class-variance-authority";
27
+ import { X } from "lucide-react";
28
+ import { cn } from "../../lib/utils";
29
+ var Sheet = SheetPrimitive.Root;
30
+ var SheetTrigger = SheetPrimitive.Trigger;
31
+ var SheetClose = SheetPrimitive.Close;
32
+ var SheetPortal = SheetPrimitive.Portal;
33
+ var SheetOverlay = React.forwardRef(function (_a, ref) {
34
+ var className = _a.className, props = __rest(_a, ["className"]);
35
+ return (_jsx(SheetPrimitive.Overlay, __assign({ className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props, { ref: ref })));
36
+ });
37
+ SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
38
+ var sheetVariants = cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out", {
39
+ variants: {
40
+ side: {
41
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
42
+ bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
43
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
44
+ right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
45
+ },
46
+ },
47
+ defaultVariants: {
48
+ side: "right",
49
+ },
50
+ });
51
+ var SheetContent = React.forwardRef(function (_a, ref) {
52
+ var _b = _a.side, side = _b === void 0 ? "right" : _b, className = _a.className, children = _a.children, props = __rest(_a, ["side", "className", "children"]);
53
+ return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Content, __assign({ ref: ref, className: cn(sheetVariants({ side: side }), className) }, props, { children: [_jsxs(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] }), children] }))] }));
54
+ });
55
+ SheetContent.displayName = SheetPrimitive.Content.displayName;
56
+ var SheetHeader = function (_a) {
57
+ var className = _a.className, props = __rest(_a, ["className"]);
58
+ return (_jsx("div", __assign({ className: cn("flex flex-col space-y-2 text-center sm:text-left", className) }, props)));
59
+ };
60
+ SheetHeader.displayName = "SheetHeader";
61
+ var SheetFooter = function (_a) {
62
+ var className = _a.className, props = __rest(_a, ["className"]);
63
+ return (_jsx("div", __assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className) }, props)));
64
+ };
65
+ SheetFooter.displayName = "SheetFooter";
66
+ var SheetTitle = React.forwardRef(function (_a, ref) {
67
+ var className = _a.className, props = __rest(_a, ["className"]);
68
+ return (_jsx(SheetPrimitive.Title, __assign({ ref: ref, className: cn("text-lg font-semibold text-foreground", className) }, props)));
69
+ });
70
+ SheetTitle.displayName = SheetPrimitive.Title.displayName;
71
+ var SheetDescription = React.forwardRef(function (_a, ref) {
72
+ var className = _a.className, props = __rest(_a, ["className"]);
73
+ return (_jsx(SheetPrimitive.Description, __assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)));
74
+ });
75
+ SheetDescription.displayName = SheetPrimitive.Description.displayName;
76
+ export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ export declare const Default: StoryObj;
5
+ export declare const LeftSide: StoryObj;
6
+ export declare const TopSide: StoryObj;
7
+ export declare const BottomSide: StoryObj;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, SheetClose, } from "./sheet";
3
+ import { Button } from "../Button/Button/Button";
4
+ var meta = {
5
+ title: "Components/Sheet",
6
+ component: Sheet,
7
+ tags: ["autodocs"],
8
+ };
9
+ export default meta;
10
+ export var Default = {
11
+ render: function () { return (_jsxs(Sheet, { children: [_jsx(SheetTrigger, { asChild: true, children: _jsx(Button, { children: "Open Sheet" }) }), _jsxs(SheetContent, { side: "right", children: [_jsxs(SheetHeader, { children: [_jsx(SheetTitle, { children: "Sheet Title" }), _jsx(SheetDescription, { children: "This is a description for the sheet component. You can put any content here." })] }), _jsx("div", { className: "my-4", children: "Main sheet content goes here." }), _jsx(SheetFooter, { children: _jsx(SheetClose, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }) })] })] })); },
12
+ };
13
+ export var LeftSide = {
14
+ render: function () { return (_jsxs(Sheet, { children: [_jsx(SheetTrigger, { asChild: true, children: _jsx(Button, { children: "Open Left Sheet" }) }), _jsxs(SheetContent, { side: "left", children: [_jsxs(SheetHeader, { children: [_jsx(SheetTitle, { children: "Left Sheet" }), _jsx(SheetDescription, { children: "This sheet slides in from the left." })] }), _jsx("div", { className: "my-4", children: "You can customize the content and side." }), _jsx(SheetFooter, { children: _jsx(SheetClose, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }) })] })] })); },
15
+ };
16
+ export var TopSide = {
17
+ render: function () { return (_jsxs(Sheet, { children: [_jsx(SheetTrigger, { asChild: true, children: _jsx(Button, { children: "Open Top Sheet" }) }), _jsxs(SheetContent, { side: "top", children: [_jsxs(SheetHeader, { children: [_jsx(SheetTitle, { children: "Top Sheet" }), _jsx(SheetDescription, { children: "This sheet slides in from the top." })] }), _jsx("div", { className: "my-4", children: "Any content can go here." }), _jsx(SheetFooter, { children: _jsx(SheetClose, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }) })] })] })); },
18
+ };
19
+ export var BottomSide = {
20
+ render: function () { return (_jsxs(Sheet, { children: [_jsx(SheetTrigger, { asChild: true, children: _jsx(Button, { children: "Open Bottom Sheet" }) }), _jsxs(SheetContent, { side: "bottom", children: [_jsxs(SheetHeader, { children: [_jsx(SheetTitle, { children: "Bottom Sheet" }), _jsx(SheetDescription, { children: "This sheet slides in from the bottom." })] }), _jsx("div", { className: "my-4", children: "Flexible content for bottom sheet." }), _jsx(SheetFooter, { children: _jsx(SheetClose, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }) })] })] })); },
21
+ };