shadcn-app-dock 0.1.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 +100 -0
- package/dist/components/dock.d.ts +48 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/index.cjs +41 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +5567 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/shadcn-app-dock-context.d.ts +19 -0
- package/dist/shadcn-app-dock.d.ts +37 -0
- package/dist/theme-menu.d.ts +15 -0
- package/package.json +65 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
interface CategoryState {
|
|
3
|
+
currentCategory: any;
|
|
4
|
+
onCategoryChange: (category: any) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function CategoryDockProvider({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Hook for pages to register their category state into the global dock.
|
|
11
|
+
* Call from a page to add category items to the shared dock.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useCategoryDock(currentCategory: any, onCategoryChange: (category: any) => void): void;
|
|
14
|
+
export declare function useCategoryDockState(): CategoryState | null;
|
|
15
|
+
export declare function useCategoryDockVisibility(): {
|
|
16
|
+
dockHidden: boolean;
|
|
17
|
+
toggleDock: () => void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface CategoryDockMenu {
|
|
3
|
+
/** Trigger icon — string src (via `renderImage`) or a node. Falls back to the item's own icon when used inline. */
|
|
4
|
+
triggerIcon?: ReactNode | string;
|
|
5
|
+
triggerLabel?: string;
|
|
6
|
+
contentClassName?: string;
|
|
7
|
+
/** Full control over the dropdown body. Compose `<ThemeMenu />` here for the theme switcher. */
|
|
8
|
+
renderContent: (ctx: {
|
|
9
|
+
side: "top" | "bottom";
|
|
10
|
+
close: () => void;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export interface DockNavItem {
|
|
14
|
+
/** Stable identity for the item (also used for React keys). */
|
|
15
|
+
key: string;
|
|
16
|
+
label: string;
|
|
17
|
+
/** A string is treated as an image src (rendered via `renderImage`); a node is rendered as-is. */
|
|
18
|
+
icon: ReactNode | string;
|
|
19
|
+
active?: boolean;
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
/** Optional inline dropdown menu. When set, the item renders as a dropdown trigger instead of a nav button. */
|
|
22
|
+
menu?: CategoryDockMenu;
|
|
23
|
+
}
|
|
24
|
+
export interface CategoryDockProps {
|
|
25
|
+
items: DockNavItem[];
|
|
26
|
+
/** Renders string icons. Defaults to a plain `<img>`; pass next/image for Next apps. */
|
|
27
|
+
renderImage?: (src: string, alt: string, size: number) => ReactNode;
|
|
28
|
+
/** Alt+1..n triggers the matching item's `onClick`. Default false. */
|
|
29
|
+
enableKeyboardShortcuts?: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
/** Which fixed placements to render. Defaults to both. */
|
|
32
|
+
placements?: {
|
|
33
|
+
desktop?: boolean;
|
|
34
|
+
mobile?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export declare function CategoryDock({ items, renderImage, enableKeyboardShortcuts, className, placements, }: CategoryDockProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ThemeMenuProps {
|
|
2
|
+
/** Show the light/dark/system appearance toggle above the color themes. Default true. */
|
|
3
|
+
showAppearance?: boolean;
|
|
4
|
+
/** Default color theme applied when nothing is persisted. Default "modern-minimal". */
|
|
5
|
+
defaultColorTheme?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Composable shadcn theme switcher rendered as a fragment of dropdown items.
|
|
9
|
+
* Drop it inside any `DropdownMenuContent` (e.g. via `CategoryDock`'s menu render prop).
|
|
10
|
+
*
|
|
11
|
+
* Handles the light/dark/system appearance toggle (via next-themes) and the shadcn
|
|
12
|
+
* color-theme picker with hover preview, persisting the selection to localStorage and a
|
|
13
|
+
* cookie and toggling the `theme-<name>` class on the document element.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ThemeMenu({ showAppearance, defaultColorTheme, }?: ThemeMenuProps): import("react").JSX.Element;
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "shadcn-app-dock",
|
|
3
|
+
"description": "Prop-driven macOS-style category dock with magnification, a custom dropdown menu, and a built-in shadcn theme switcher",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"author": "vtempest",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/OpenSourceAGI/qwksearch-research-agent.git",
|
|
9
|
+
"directory": "packages/shadcn-app-dock"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.mjs",
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "vite build && tsc --project tsconfig.build.json",
|
|
29
|
+
"type-check": "tsc --noEmit",
|
|
30
|
+
"prepublishOnly": "bun run build"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"dock",
|
|
34
|
+
"macos-dock",
|
|
35
|
+
"navigation",
|
|
36
|
+
"shadcn",
|
|
37
|
+
"theme-switcher",
|
|
38
|
+
"react"
|
|
39
|
+
],
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"next-themes": ">=0.3",
|
|
42
|
+
"react": ">=18",
|
|
43
|
+
"react-dom": ">=18"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@radix-ui/react-dropdown-menu": "^2.1.17",
|
|
47
|
+
"@radix-ui/react-slot": "^1.2.5",
|
|
48
|
+
"class-variance-authority": "^0.7.1",
|
|
49
|
+
"clsx": "^2.1.1",
|
|
50
|
+
"framer-motion": "^12.40.0",
|
|
51
|
+
"lucide-react": "^1.17.0",
|
|
52
|
+
"shadcn-theme-menu": "^1.1.13",
|
|
53
|
+
"tailwind-merge": "^3.0.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/react": "^19.0.0",
|
|
57
|
+
"@types/react-dom": "^19.0.0",
|
|
58
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
59
|
+
"next-themes": "^0.4.6",
|
|
60
|
+
"react": "^19.2.7",
|
|
61
|
+
"react-dom": "^19.2.7",
|
|
62
|
+
"typescript": "^5.7.2",
|
|
63
|
+
"vite": "^8.1.3"
|
|
64
|
+
}
|
|
65
|
+
}
|