aura-omni-search 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # aura-omni-search 🔍 (v3.0.0)
2
+
3
+ A professional, **Tailwind-Native** Spotlight Search component for React and Next.js. Engineered to blend perfectly into your existing design system without shipping any global CSS resets or side effects.
4
+
5
+ ## 🏛 Architecture (v3.0.0)
6
+
7
+ Version 3 is "Tailwind-Native". Instead of shipping a giant, compiled CSS file with internal resets, this library uses standard Tailwind classes that are compiled by **YOUR** application's Tailwind build.
8
+
9
+ ### Key Benefits:
10
+
11
+ - **Zero Style Leaks**: No bundled resets. Your `body`, `button`, and `h1` styles remain yours.
12
+ - **Microscopic Bundle Size**: Only ships the logic. Your Tailwind build handles the styles.
13
+ - **Perfect Design Parity**: Inherits your fonts, colors, and layout rules natively.
14
+
15
+ ---
16
+
17
+ ## 📦 Installation
18
+
19
+ ```bash
20
+ npm install aura-omni-search
21
+ ```
22
+
23
+ ## 🛠 Integration (Required)
24
+
25
+ Because v3 uses standard Tailwind classes, you **must** tell Tailwind to scan the library for styles.
26
+
27
+ ### 1. Update `tailwind.config.js`
28
+
29
+ Add the library path to your `content` array:
30
+
31
+ ```javascript
32
+ /** @type {import('tailwindcss').Config} */
33
+ export default {
34
+ content: [
35
+ "./index.html",
36
+ "./src/**/*.{js,ts,jsx,tsx}",
37
+ "./node_modules/aura-omni-search/**/*.{js,ts,jsx,tsx}", // <--- ADD THIS
38
+ ],
39
+ // ...
40
+ };
41
+ ```
42
+
43
+ ### 2. (Optional) Import Default Variables
44
+
45
+ If you want to use our default colors, import the minimal variable sheet in your `layout.tsx` or `index.css`:
46
+
47
+ ```tsx
48
+ import "aura-omni-search/dist/style.css";
49
+ ```
50
+
51
+ ---
52
+
53
+ ## 🌓 Customization
54
+
55
+ Since we use standard Tailwind, you can customize the theme using CSS variables in your global CSS:
56
+
57
+ ```css
58
+ :root {
59
+ --spotlight-primary: #3b82f6;
60
+ --spotlight-background: #ffffff;
61
+ }
62
+
63
+ .dark {
64
+ --spotlight-background: #0f172a;
65
+ }
66
+ ```
67
+
68
+ ---
69
+
70
+ ## 📄 License
71
+
72
+ MIT © Dhruv
@@ -0,0 +1,2 @@
1
+ import { SpotlightProps } from './types';
2
+ export declare function Spotlight({ isOpen, onClose, items, onNavigate, searchPlaceholder, }: SpotlightProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from "react";
2
+ import { SpotlightItem } from "../types";
3
+ export interface RouteConfig {
4
+ path: string;
5
+ label?: string;
6
+ name?: string;
7
+ title?: string;
8
+ icon?: ReactNode;
9
+ children?: RouteConfig[];
10
+ [key: string]: unknown;
11
+ }
12
+ /**
13
+ * Recursively extracts spotlight items from a route configuration.
14
+ * @param routes The list of routes to traverse.
15
+ * @param baseUrl The base URL for the current level (used for recursion).
16
+ * @param parentGroup The group name to assign (defaults to "Pages").
17
+ */
18
+ export declare function getSpotlightItemsFromRoutes(routes: RouteConfig[], baseUrl?: string, parentGroup?: string): SpotlightItem[];
@@ -0,0 +1,8 @@
1
+ import { RouteObject } from "react-router-dom";
2
+ import { SpotlightItem } from "../types";
3
+ /**
4
+ * Recursively extracts spotlight items from route configuration
5
+ * @param routes The React Router route definitions
6
+ * @param parentPath The path accumulator for recursion
7
+ */
8
+ export declare function getSpotlightItemsFromRoutes(routes: RouteObject[], parentPath?: string): SpotlightItem[];
@@ -0,0 +1 @@
1
+ :root{--spotlight-background: #ffffff;--spotlight-foreground: #020817;--spotlight-muted: #f1f5f9;--spotlight-muted-foreground: #64748b;--spotlight-popover: #ffffff;--spotlight-border: #e2e8f0;--spotlight-accent: #f1f5f9;--spotlight-accent-foreground: #0f172a;--spotlight-ring: #94a3b8;--spotlight-primary: #0f172a}.dark{--spotlight-background: #020817;--spotlight-foreground: #f8fafc;--spotlight-muted: #1e293b;--spotlight-muted-foreground: #94a3b8;--spotlight-popover: #020817;--spotlight-border: #1e293b;--spotlight-accent: #1e293b;--spotlight-accent-foreground: #f8fafc;--spotlight-ring: #1e293b;--spotlight-primary: #f8fafc}@media(prefers-color-scheme:dark){:root:not(.light){--spotlight-background: #020817;--spotlight-foreground: #f8fafc;--spotlight-muted: #1e293b;--spotlight-muted-foreground: #94a3b8;--spotlight-popover: #020817;--spotlight-border: #1e293b;--spotlight-accent: #1e293b;--spotlight-accent-foreground: #f8fafc;--spotlight-ring: #1e293b;--spotlight-primary: #f8fafc}}
@@ -0,0 +1,4 @@
1
+ import "./index.css";
2
+ export * from "./types";
3
+ export * from "./Spotlight";
4
+ export * from "./adapters/routes";