igniteui-astro-components 0.0.5 → 0.0.6

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.
@@ -0,0 +1,105 @@
1
+ # SearchAdvanced
2
+
3
+ Client-side API search dialog that loads a JSON search index and performs all matching against symbol and member names. Supports configurable result tabs and optional package-scope filtering.
4
+
5
+ ## Import
6
+
7
+ ```astro
8
+ import SearchAdvanced from 'igniteui-astro-components/components/SearchAdvanced.astro';
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ |------|------|---------|-------------|
15
+ | `class` | `string` | — | CSS class for the outer element |
16
+ | `indexUrl` | `string` | `${BASE_URL}api-search-index.json` | URL to the JSON search index |
17
+ | `placeholder` | `string` | `"Search"` | Search input placeholder text |
18
+ | `showScope` | `boolean` | `false` | Show scope selector (current package / all packages) |
19
+ | `tabs` | `SearchTab[]` | `[]` | Tab categories (besides the always-present "All" tab) |
20
+ | `allTabLimit` | `number` | `10` | Max results per category in the "All" tab |
21
+
22
+ ### `SearchTab`
23
+
24
+ ```ts
25
+ interface SearchTab {
26
+ /** Unique identifier for this tab/category */
27
+ id: string;
28
+ /** Display label for the tab */
29
+ label: string;
30
+ /**
31
+ * Kind codes from the index that map to this category.
32
+ * Use '__name__' for the page-names category.
33
+ * Member kind codes: 'p' = property, 'a' = accessor, 'm' = method, 'e' = event, 'c' = constructor.
34
+ */
35
+ kindCodes: string[];
36
+ }
37
+ ```
38
+
39
+ ## Examples
40
+
41
+ ### Minimal (single "All" tab, no scope)
42
+
43
+ ```astro
44
+ ---
45
+ import SearchAdvanced from 'igniteui-astro-components/components/SearchAdvanced.astro';
46
+ ---
47
+ <SearchAdvanced indexUrl="/api-search-index.json" />
48
+ ```
49
+
50
+ ### With scope and full tab set (like api-docs)
51
+
52
+ ```astro
53
+ ---
54
+ import SearchAdvanced from 'igniteui-astro-components/components/SearchAdvanced.astro';
55
+
56
+ const tabs = [
57
+ { id: 'names', label: 'Names', kindCodes: ['__name__'] },
58
+ { id: 'properties', label: 'Properties', kindCodes: ['p'] },
59
+ { id: 'accessors', label: 'Accessors', kindCodes: ['a'] },
60
+ { id: 'methods', label: 'Methods', kindCodes: ['m'] },
61
+ { id: 'events', label: 'Events', kindCodes: ['e'] },
62
+ { id: 'constructors', label: 'Constructors', kindCodes: ['c'] },
63
+ ];
64
+ ---
65
+ <SearchAdvanced showScope tabs={tabs} />
66
+ ```
67
+
68
+ ### Custom subset of tabs
69
+
70
+ ```astro
71
+ ---
72
+ import SearchAdvanced from 'igniteui-astro-components/components/SearchAdvanced.astro';
73
+
74
+ const tabs = [
75
+ { id: 'names', label: 'Types', kindCodes: ['__name__'] },
76
+ { id: 'members', label: 'Members', kindCodes: ['p', 'a', 'm', 'e', 'c'] },
77
+ ];
78
+ ---
79
+ <SearchAdvanced tabs={tabs} indexUrl="/my-index.json" />
80
+ ```
81
+
82
+ ## Index Format
83
+
84
+ The component expects a JSON file with the following structure:
85
+
86
+ ```json
87
+ {
88
+ "pages": [
89
+ {
90
+ "u": "/path/to/page",
91
+ "n": "ClassName",
92
+ "k": "class",
93
+ "v": "1.0.0",
94
+ "p": "angular",
95
+ "g": "package-name",
96
+ "m": [["memberName", "p"], ["onClick", "e"]]
97
+ }
98
+ ]
99
+ }
100
+ ```
101
+
102
+ ## Keyboard Shortcuts
103
+
104
+ - `Ctrl+K` / `⌘K` — open/close the search dialog
105
+ - `Escape` — close the dialog