@yuktishaalaa/yuktai 5.3.9 → 5.3.10

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 CHANGED
@@ -1,1057 +1,145 @@
1
1
  # @yuktishaalaa/yuktai
2
2
 
3
- > Universal accessibility, AI and data toolkit for Next.js, React **and plain HTML**. One install (or one script tag) brings WCAG 2.2 auto-fix, in-browser RAG, an AI agent, code generation, an accessible data grid with Agentic AI + WebMCP, and an agentic toolkit that audits, explains and fixes pages and answers questions about your data. Zero API keys, zero cost, works offline.
3
+ > Accessibility, AI and data toolkit for **Next.js, React and plain HTML**. One install or one script tag. Runs in the browser: no API keys, no server, no cost, works offline.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@yuktishaalaa/yuktai)](https://www.npmjs.com/package/@yuktishaalaa/yuktai)
6
6
  [![downloads](https://img.shields.io/npm/dm/@yuktishaalaa/yuktai)](https://www.npmjs.com/package/@yuktishaalaa/yuktai)
7
7
  [![license](https://img.shields.io/badge/license-GPL--3.0-blue)](./LICENSE)
8
- [![node](https://img.shields.io/badge/node-%3E%3D18-blue)](https://nodejs.org)
9
8
  [![Next.js](https://img.shields.io/badge/Next.js-13%2B-black)](https://nextjs.org)
9
+ [![Rust](https://img.shields.io/badge/engine-Rust%20%2B%20WebAssembly-orange)](./rust)
10
+ [![docs](https://img.shields.io/badge/docs-live%20demos-0a4a85)](https://yuktaidocs.netlify.app/)
10
11
  [![XERJ Corpus Hub contributor](https://hub.xerj.org/contributors/sandeepmiriyala03/badge.svg)](https://hub.xerj.org/contributors/sandeepmiriyala03)
11
12
 
12
- Built in free time by [Sandeep Miriyala](https://github.com/sandeepmiriyala03).
13
-
14
- **Live demos:**
15
- - Staff directory (Next.js): https://aksharatantra.miriyala.in/staffdirectory
16
- - Vanilla JS, plain HTML, installable PWA: https://sandeepmiriyala03.github.io/yuktai/vanilla/
17
- - Ratnalabala, a Telugu poetry app built on YuktAI Grid: https://ratnalabala.vercel.app/poems?view=grid
18
-
19
- **Recognition:** yuktai is part of the [XERJ Corpus Hub](https://hub.xerj.org). Contributor profile: [hub.xerj.org/contributors/sandeepmiriyala03](https://hub.xerj.org/contributors/sandeepmiriyala03).
20
-
21
- ---
13
+ 📖 **Docs and live demos:** https://yuktaidocs.netlify.app/
22
14
 
23
- ## The story
24
-
25
- I have been building web apps since 2013. In all those years, the same things kept breaking on almost every website I touched: missing ARIA labels, no keyboard navigation, forms that senior citizens couldn't figure out, data grids that broke on mobile, accessibility tools that cost money, and AI tools that needed API keys.
26
-
27
- I wanted something without any of those barriers. Free. Open source. One install. Works on every device. No account. No key. No server.
28
-
29
- So I built yuktai, one weekend and one late night at a time.
15
+ Built in free time by [Sandeep Miriyala](https://github.com/sandeepmiriyala03).
30
16
 
31
17
  ---
32
18
 
33
- ## What's inside
34
-
35
- Six modules ship in a single npm package, for React/Next.js and, since v5.3, for plain HTML pages with one script tag:
19
+ ## Features
36
20
 
37
- | Module | Features | What it does |
21
+ | | Feature | What it does |
38
22
  |---|---|---|
39
- | **1. Accessibility Engine** | 16 | WCAG 2.2 auto-fix, speak on focus, colour-blind modes, dyslexia font, skip links |
40
- | **2. YuktaiGrid** ⭐ | 19 | Accessible data grid with Agentic AI, WebMCP, 5 WCAG themes, English/Telugu UI |
41
- | **3. In-Tab RAG** | 11 | Ask questions about any page, offline, no API |
42
- | **4. Autonomous AI Agent** | 13 | Natural-language browser guidance |
43
- | **5. Vibe Coder** | 19 | Generate full Next.js projects from plain English |
44
- | **6. Agentic AI Toolkit** | 10 | Accessibility copilot, QA reports, form and design review, smart grid queries, BI answers, multi-step tasks, voice settings |
45
- | **Vanilla JS build** 🆕 | All | Every module above for plain HTML, CSS and JavaScript: no React, no build step, installable as a PWA |
46
-
47
- ---
48
-
49
- ## What's new in v5.3.9: `YuktAIWrapper` launcher, opt-in buttons, Rust Ask page
50
-
51
- Turn on only the buttons a site needs, put them behind one launcher, and let 💬 Ask page find answers with the Rust RAG first.
52
-
53
- ```tsx
54
- "use client";
55
- import type { ReactNode } from "react";
56
- import { YuktAIWrapper } from "@yuktishaalaa/yuktai";
57
-
58
- export default function YuktaiClient({ children }: { children: ReactNode }) {
59
- return (
60
- <YuktAIWrapper position="left" launcher showAccessibility showRag showAgent showVibeCoder engine="rust">
61
- {children}
62
- </YuktAIWrapper>
63
- );
64
- }
65
- ```
66
-
67
- | Prop | Button |
68
- |---|---|
69
- | `launcher` | ✨ one button that shows/hides the others. Remembers the visitor's choice, closes with Esc, sets `<html data-yuktai-tools="open\|closed">` for styling |
70
- | `showAccessibility` | ♿ Accessibility preferences |
71
- | `showRag` | 💬 Ask page |
72
- | `showAgent` | 🤖 AI Agent |
73
- | `showVibeCoder` | ⚡ Vibe Coder (a developer tool; leave it off on public sites) |
74
- | `engine` | 💬 Ask page search: `"rust"`, `"auto"` or `"ts"` |
75
-
76
- - **Opt-in:** as soon as you set `launcher`, `showAccessibility` or `showVibeCoder`, only the buttons you turn on are shown, stacked with no gaps. Without those props the wrapper behaves exactly as before (♿ always; ⚡ with `showAgent`).
77
- - **💬 with `engine`:** the page RAG finds the best passages first (Rust: fast, offline, Telugu-aware) and shows them at once with "From this page" and the search time. If Gemini Nano or Transformers.js is available, the model then writes the answer from **only those passages**, instead of reading the whole page (Gemini) or embedding every chunk for each question (Transformers.js). It works even with no model at all. Without `engine`, 💬 works exactly as before.
78
- - **Fixes:** ⚡ Vibe Coder can now be turned off on its own (it used to follow `showAgent`); Esc now closes the Vibe Coder panel too.
79
-
80
- ---
81
-
82
- ## What's new in v5.3.8: Rust RAG for "Ask page" (optional)
83
-
84
- The page + data search behind **Ask page** (`createContextIndex`, used after `askAboutPage`) can now run in **Rust**. Same passages, same BM25 scores (bit for bit), same answers: only faster. Free, offline, and it works in PWAs: the engine (about 33 KB of WebAssembly) is embedded in the package.
85
-
86
- ```tsx
87
- <AgenticPanel engine="rust" /> // React / Next.js: Ask page tab
88
- ```
89
-
90
- ```js
91
- yuktai.mountAgenticPanel("#tools", { engine: "rust" }) // plain HTML
92
- const index = yuktai.createContextIndex({ rows, columns, engine: "rust" })
93
- await index.ask("Which office handles leave requests?")
94
- ```
95
-
96
- | `engine` | What runs |
97
- |---|---|
98
- | `"ts"` (default) | TypeScript, unchanged |
99
- | `"rust"` | Rust inverted index for every search |
100
- | `"auto"` | Rust from 1,000 passages |
101
-
102
- - **How it is faster:** TypeScript scans every word of every passage for each question. Rust builds an inverted index once and jumps straight to the passages that contain the question's words (and their longer/shorter forms, as before).
103
- - **Same results, tested:** TypeScript still tokenizes (Telugu-aware) and computes `idf` with `Math.log`; Rust does the counting and the BM25 arithmetic in the same order, so scores match bit for bit. Tests compare both engines on English and Telugu documents, grid rows and real page text (1,000+ searches).
104
- - **Measured** (Node 22, median, per question):
105
-
106
- | Content | TypeScript | Rust | Speed-up |
107
- |---|---|---|---|
108
- | Long page, 500 passages | 2.3 ms | 0.08 ms | 27× |
109
- | Help docs, 5,000 passages | 18.8 ms | 0.45 ms | 42× |
110
- | Grid, 1,00,000 rows | 46.2 ms | 3.4 ms | 14× |
111
-
112
- Rust builds its index once per content change (240 ms for 1 lakh rows); every question after that is fast.
113
- - **Also faster for everyone (both engines):** asking again on an unchanged page no longer rebuilds the index (6 ms instead of 183 ms for 5,000 passages). The React Ask tab now reuses its index between questions, like the vanilla panel.
114
- - **PWA:** the demo's service worker cache is now `yuktai-vanilla-v5.3.8`, so installed apps pick up the new engine.
115
-
116
- Source: [`rust/rag-core`](./rust/rag-core) (no dependencies, `no_std` + `alloc`). Rust tests: `npm run test:rust`.
117
-
118
- ---
119
-
120
- ## What's new in v5.3.5: Rust grid engine (optional)
121
-
122
- The grid's existing search and number/date sorting can now run in **Rust**, compiled to WebAssembly. Nothing else changes: same rows, same order, same API. The default is still TypeScript, so existing apps behave exactly as before.
123
-
124
- ```tsx
125
- <YuktaiGrid data={rows} columns={columns} engine="auto" /> // Rust from 10,000 rows
126
- ```
127
-
128
- ```js
129
- yuktai.renderGrid("#staff", { data: rows, columns, engine: "auto" })
130
- ```
131
-
132
- | `engine` | What runs |
133
- |---|---|
134
- | `"ts"` (default) | TypeScript, unchanged |
135
- | `"rust"` | Rust for search and number/date sorting |
136
- | `"auto"` | Rust from 10,000 rows, TypeScript below |
137
-
138
- - **Same results, tested:** every grid (`<YuktaiGrid>`, `useGrid`, vanilla `renderGrid`) runs its real code with both engines on random mixed data (Telugu text, empty values, NaN, dates, duplicates) and must return identical rows. Text sorting stays in TypeScript, because Telugu order comes from the browser's locale rules.
139
- - **Faster on big data** (100,000 rows, Chromium, median of 7 runs):
140
-
141
- | Operation | Grid | TypeScript | Rust | Speed-up |
142
- |---|---|---|---|---|
143
- | Search "hyd" | vanilla `renderGrid` | 342 ms | 9 ms | 36× |
144
- | Search "సీత" | vanilla `renderGrid` | 332 ms | 9 ms | 37× |
145
- | Sort by date (desc) | vanilla `renderGrid` | 523 ms | 26 ms | 20× |
146
- | Sort by number | vanilla `renderGrid` | 43 ms | 13 ms | 3× |
147
- | Search "hyd" | `<YuktaiGrid>` | 25 ms | 4 ms | 6× |
148
- | Sort by number | `<YuktaiGrid>` | 47 ms | 14 ms | 3× |
149
-
150
- Rust prepares the search text once per data change (about 130 ms for 100,000 rows), so every keystroke after that is fast. Run it yourself: `node vanilla/test/bench.mjs 100000`.
151
- - **Small and self-contained:** about 13 KB of WebAssembly, embedded in the package. No extra files, no bundler setup, no Rust needed to use it.
152
- - **Safe fallback:** if WebAssembly is unavailable, the grid quietly uses TypeScript.
153
-
154
- **Search time (v5.3.7, optional):** show how long each search or sort took and which engine answered, next to the row count, e.g. `12 rows · 0.9 ms · Rust`.
155
-
156
- ```tsx
157
- <YuktaiGrid data={rows} columns={columns} engine="rust" showSearchTime
158
- onSearchTime={({ query, ms, rows, engine }) => console.log(query, ms, rows, engine)} />
159
- ```
23
+ | ♿ | **Accessibility** | WCAG 2.2 auto-fix, contrast, dark mode, text size, dyslexia font, colour-blind filters, speak on focus |
24
+ | 📊 | **YuktaiGrid** | Search, sort, pages, CSV export, 5 WCAG themes, Telugu UI, keyboard navigation |
25
+ | 🤖 | **Ask your data** | "salary over 1 lakh in Hyderabad", BI answers, unusual rows, multi-step tasks, WebMCP |
26
+ | 💬 | **Ask page (RAG)** | Answers from your page and data, offline |
27
+ | 🛠 | **Page tools** | QA audit (15 WCAG checks), form and design review, voice commands |
28
+ | 🦀 | **Rust engine** | Up to 42× faster search on big data (optional) |
29
+ | 🎨 | **163 icons** | Any size and colour, outline or filled, safe in Server Components |
30
+ | ⚡ | **Vibe Coder** | Plain English → a full Next.js project ZIP (developer tool) |
31
+ | 📱 | **PWA** | Installable, works offline |
160
32
 
161
- ```js
162
- yuktai.renderGrid("#staff", { data: rows, columns, engine: "rust", showSearchTime: true })
163
- grid.getSearchTime() // { query: "hyd", ms: 0.9, rows: 12, engine: "rust" }
164
- ```
165
-
166
- `useGrid` returns the same object as `grid.searchTime`. The label says **TS** whenever TypeScript did the work (for example a Telugu text sort), so it is always truthful.
33
+ ## Supported languages
167
34
 
168
- Source: [`rust/grid-core`](./rust/grid-core) (no dependencies, `no_std`). To rebuild it: `rustup target add wasm32-unknown-unknown`, then `npm run build:rust`. Rust tests: `npm run test:rust`.
35
+ **Use it with:** HTML · JavaScript · TypeScript · React (JSX) · Next.js (TSX)
36
+ **Built with:** TypeScript + Rust (WebAssembly, embedded; no setup needed)
37
+ **Interface:** English and Telugu. All 22 Indian languages for number and date formats, sorting and voice input.
169
38
 
170
39
  ---
171
40
 
172
- ## What's new in v5.3: Vanilla JS (plain HTML)
41
+ ## Quick start
173
42
 
174
- All of yuktai now works on any HTML page, without React or a build step. The vanilla build is bundled from the same source as the npm package, so a question gets the same answer in React and in plain HTML.
43
+ **Plain HTML:** one line, no build step
175
44
 
176
45
  ```html
46
+ <script src="https://cdn.jsdelivr.net/npm/@yuktishaalaa/yuktai@5.3.9/vanilla/index.min.js"></script>
177
47
  <script>
178
- window.YUKTAI_CONFIG = { position: "right", showPageTools: true } // optional
48
+ yuktai.renderGrid("#staff", { data: rows, columns, engine: "auto", showSearchTime: true })
179
49
  </script>
180
- <script src="https://cdn.jsdelivr.net/npm/@yuktishaalaa/yuktai@5.3.0/vanilla/index.min.js"></script>
181
-
182
- <div id="staff"></div>
183
- <script>
184
- const grid = yuktai.renderGrid("#staff", {
185
- data: rows,
186
- rowKey: "id",
187
- columns: [
188
- { key: "name", label: "Name" },
189
- { key: "salary", label: "Salary", type: "number" },
190
- { key: "joined", label: "Joined", type: "date" },
191
- ],
192
- agentic: true, // question bar: "salary over 1 lakh", "average salary by department"
193
- ai: true, // assistant: custom rules, phrases, grid tools, voice input
194
- locale: "en-IN", // or "te-IN" for Telugu UI and messages
195
- webmcp: true,
196
- })
197
-
198
- await grid.ask("salary over 1 lakh in Hyderabad")
199
- yuktai.mountAgenticPanel("#tools", { defaultTab: "qa" }) // Copilot, QA, Forms, Design, Ask, Voice
200
- </script>
201
- ```
202
-
203
- | React / Next.js | Vanilla JS |
204
- |---|---|
205
- | `<YuktaiGrid>` | `yuktai.renderGrid(container, options)` |
206
- | `useAgenticGrid` + `<AgenticGridBar>` | `yuktai.createAgenticGrid()` + `yuktai.mountAgenticGridBar()`, or `agentic: true` |
207
- | `useYuktaiGridAgent` | `yuktai.createGridAgent()` |
208
- | `<YuktaiGridWebMCP>` | `yuktai.registerWebMCP()`, or `webmcp: true` |
209
- | `<AgenticPanel>` | `yuktai.mountAgenticPanel()` |
210
- | `<YuktAIWrapper>` | Automatic floating accessibility button (and a page tools button with `showPageTools: true`) |
211
- | Every function (`runQaAudit`, `askInsight`, `parseAmount`, …) | Same names on `window.yuktai` |
212
-
213
- **Grid features in the vanilla build:**
214
- - search, sort, page-size switching, row selection and CSV export (Excel-safe)
215
- - table, card or auto view; 5 WCAG themes; Telugu UI
216
- - loading and empty states; row highlighting that scrolls to the row
217
- - ARIA grid keyboard navigation: arrow keys, Home/End, Page Up/Down, Space to select, Enter to open
218
-
219
- **Live demo:** https://sandeepmiriyala03.github.io/yuktai/vanilla/. It shows every feature, including a Telugu grid of the 27 poems from *Rangu Rangula Ratnadeepalu*. It is an installable PWA that works offline after the first visit, and it uses only yuktai's own inline SVG icons and the yuktai teal palette.
220
-
221
- **Tested** in Chromium: 37 end-to-end checks pass, with axe-core reporting 0 violations and no console errors (`node vanilla/test/e2e.mjs`). Full API: [`vanilla/README.md`](./vanilla/README.md).
222
-
223
- ### Accessibility engine fixes in v5.3 (React and vanilla)
224
-
225
- - Auto-fix no longer adds an `aria-label` to form fields that already have a `<label>`. Before this, it replaced the name that screen readers announce.
226
- - Buttons and links hidden at scan time are no longer labelled "button" or "link".
227
- - `<header>` and `<footer>` inside sections and dialogs no longer become page-level banner and contentinfo landmarks.
228
- - The fix count only includes fixes that were actually applied.
229
- - Visual alert and skip-link colours use the yuktai teal palette and meet a 4.5:1 contrast ratio.
230
-
231
- ---
232
-
233
- ## What's new in v5.2: Agentic AI Toolkit
234
-
235
- Ten agentic features, all running in the browser. No API keys, and no page or grid data leaves the device unless you plug in your own model through a `generate` or `summarize` hook.
236
-
237
- | # | Feature | What it does | Main export |
238
- |---|---|---|---|
239
- | 1 | Accessibility Copilot | Watches the page live, explains each issue in plain English, applies safe fixes and undoes them | `createA11yCopilot` |
240
- | 2 | Page Understanding | Answers "What does this page do?" and "Which form fields are missing labels?" | `analyzePage`, `askAboutPage` |
241
- | 3 | Smart Data Grid | Turns "overdue and over ₹10,000" into real filters, finds unusual rows, summarises data | `runGridQuery`, `detectAnomalies`, `summarizeRows` |
242
- | 4 | Voice Accessibility | "Turn on high contrast", "bigger text", "next row", plus Telugu phrases like "పెద్ద అక్షరాలు" | `createVoiceA11yController` |
243
- | 5 | QA Tester | 15 checks with WCAG references, a score, pass/fail, and a Markdown or JSON report | `runQaAudit`, `auditToMarkdown` |
244
- | 6 | Forms Agent | Reviews labels, autocomplete, error messages and senior-friendliness | `reviewForms` |
245
- | 7 | Page + Data RAG | Answers from page text and grid rows, Telugu-aware, offline | `createContextIndex` |
246
- | 8 | Multi-Step Tasks | "Show overdue, highlight the errors, then summarise what changed" | `runTasks` |
247
- | 9 | BI Copilot | "Which region had the highest drop in conversion this week?" | `askInsight`, `comparePeriods` |
248
- | 10 | Design Review | Hierarchy, readability, focus states, clutter, consistency | `reviewDesign` |
249
-
250
- ### Page tools in one panel
251
-
252
- ```tsx
253
- "use client";
254
- import { AgenticPanel } from "@yuktishaalaa/yuktai";
255
-
256
- export default function A11yTools() {
257
- return <AgenticPanel defaultTab="copilot" voiceLang="en-IN" />;
258
- }
259
- ```
260
-
261
- Tabs: **Copilot**, **QA report**, **Forms**, **Design**, **Ask page**, **Voice**. The panel marks itself with `data-yuktai-panel`, so it never audits its own UI.
262
-
263
- ### Ask your grid
264
-
265
- ```tsx
266
- "use client";
267
- import { YuktaiGrid, useAgenticGrid, AgenticGridBar } from "@yuktishaalaa/yuktai";
268
-
269
- const columns = [
270
- { key: "name", label: "Customer" },
271
- { key: "status", label: "Status" },
272
- { key: "region", label: "Region" },
273
- { key: "balance", label: "Balance", type: "number" as const },
274
- { key: "dueDate", label: "Due date", type: "date" as const },
275
- ];
276
-
277
- export default function Customers({ rows }: { rows: Customer[] }) {
278
- const grid = useAgenticGrid({ data: rows, columns, rowKey: "id" });
279
-
280
- return (
281
- <>
282
- <AgenticGridBar
283
- grid={grid}
284
- examples={[
285
- "overdue and over ₹10,000",
286
- "anything unusual?",
287
- "total balance by region",
288
- "show overdue, then sort by balance desc, then summarize what changed",
289
- ]}
290
- />
291
- <YuktaiGrid
292
- data={grid.gridData}
293
- columns={columns}
294
- rowKey="id"
295
- highlightIds={grid.highlightIds}
296
- autoScrollToHighlight
297
- />
298
- </>
299
- );
300
- }
301
- ```
302
-
303
- `grid.ask(text)` picks the right tool for the question:
304
-
305
- | Question type | Example | Handled by |
306
- |---|---|---|
307
- | Filters and lookups | "customer starting with A and balance between 1k and 9k" | Smart grid query |
308
- | Unusual data | "anything unusual?" | Outliers and duplicate rows |
309
- | Group and period questions | "which region had the highest drop in conversion this week?" | BI copilot |
310
- | Several steps | "show overdue, then highlight errors, then summarise" | Task runner, with a before/after report |
311
-
312
- Amounts like `₹10,000`, `10k`, `1.5 lakh` and `2 crore` are understood.
313
-
314
- ### Use the functions directly
315
-
316
- ```ts
317
- import { runQaAudit, auditToMarkdown, askInsight, runGridQuery } from "@yuktishaalaa/yuktai";
318
-
319
- // In the browser: accessibility QA report
320
- const report = runQaAudit();
321
- console.log(report.score, report.passed);
322
- const md = auditToMarkdown(report); // attach to a ticket or PR
323
-
324
- // Anywhere: data questions
325
- askInsight("which region had the highest drop in conversion this week", rows, columns).answer;
326
- runGridQuery("overdue and over 10k", { data: rows, columns }).ids;
327
- ```
328
-
329
- ### Plug in your own model (optional)
330
-
331
- Everything works offline with rules and keyword search. To get model-written answers, pass a `generate` hook, for example Gemini Nano or your own API:
332
-
333
- ```tsx
334
- <AgenticPanel generate={async (question, context) => myModel(question, context)} />
335
- ```
336
-
337
- ### Honest limits
338
-
339
- - Questions are understood with rules, not a language model, so unusual phrasing may need rewording. The parser returns `notes` explaining any assumption it made.
340
- - The QA and design checks are automatic heuristics. They catch common problems but don't replace testing with real users and assistive technology.
341
- - Smart grid queries, page answers and BI answers are in English today. Telugu and Hindi data questions are not parsed yet; use `customRules` with your own phrases for them.
342
- - Voice accessibility commands understand English and Telugu, not yet Hindi or other languages.
343
-
344
- ---
345
-
346
- ## What's new in v4.6.4: YuktaiGrid Agentic AI + WebMCP
347
-
348
- - Shared Grid Tools used by both the Agent and WebMCP
349
- - Tools: search, count, columns, get row, highlight, select, open
350
- - WebMCP registration through `document.modelContext`
351
- - `useYuktaiGridAgent` hook for programmatic tool execution
352
- - Embedded Grid AI Assistant inside YuktaiGrid
353
- - English and Telugu AI UI, with English or Telugu voice input
354
- - Working page-size switching (10 → 20 → 50 → 100)
355
- - Seven inline SVG icons, no external icon dependency
356
-
357
- **Architecture:** User → Agent / WebMCP → Grid Tools → YuktaiGrid → Data
358
-
359
- ---
360
-
361
- ## Works on every device
362
-
363
- | Device | Browser | Core features | AI engine |
364
- |---|---|---|---|
365
- | 🖥 Desktop | Chrome 147+ (needed only for Gemini Nano) | ✅ All | Gemini Nano |
366
- | 🖥 Desktop | Firefox / Edge / Safari | ✅ All | Transformers.js |
367
- | 📱 Android | Chrome Mobile | ✅ All | Transformers.js |
368
- | 📱 iOS | Safari Mobile | ✅ All | Transformers.js |
369
- | 📲 PWA offline | All browsers | ✅ All | Offline after first load |
370
-
371
- yuktai picks the best AI engine automatically. Users never need to know which one is running.
372
-
373
- ---
374
-
375
- ## Install
376
-
377
- **Next.js 16 + React 19 (recommended)**
378
-
379
- ```bash
380
- npm install @yuktishaalaa/yuktai --legacy-peer-deps
381
50
  ```
382
51
 
383
- **Next.js 13, 14, 15**
52
+ **Next.js / React**
384
53
 
385
54
  ```bash
386
55
  npm install @yuktishaalaa/yuktai
387
56
  ```
388
57
 
389
- **Yarn / pnpm**
390
-
391
- ```bash
392
- yarn add @yuktishaalaa/yuktai
393
- pnpm add @yuktishaalaa/yuktai
394
- ```
395
-
396
- **Plain HTML (no install)**
397
-
398
- ```html
399
- <script src="https://cdn.jsdelivr.net/npm/@yuktishaalaa/yuktai@5.3.0/vanilla/index.min.js"></script>
400
- ```
401
-
402
- Requirements: Node.js 18+, npm 8+, Next.js 13+ (React builds only; the vanilla build needs only a browser).
403
-
404
- ---
405
-
406
- ## Quick start
407
-
408
- ### Step 1: `next.config.js`
409
-
410
- ```js
411
- const nextConfig = {
412
- transpilePackages: ["@yuktishaalaa/yuktai"],
413
- async headers() {
414
- return [
415
- {
416
- source: "/(.*)",
417
- headers: [
418
- // Needed for voice control and voice input
419
- { key: "Permissions-Policy", value: "microphone=*, speaker=*" },
420
- ],
421
- },
422
- ];
423
- },
424
- };
425
-
426
- module.exports = nextConfig;
427
- ```
428
-
429
- ### Step 2: Client wrapper
430
-
431
58
  ```tsx
432
- // components/YuktaiClient.tsx
433
- "use client";
434
-
435
- import { useState, useEffect, type ReactNode } from "react";
436
- import { YuktAIWrapper } from "@yuktishaalaa/yuktai";
59
+ // app/YuktaiClient.tsx
60
+ "use client"
61
+ import { YuktAIWrapper } from "@yuktishaalaa/yuktai"
62
+ import type { ReactNode } from "react"
437
63
 
438
64
  export default function YuktaiClient({ children }: { children: ReactNode }) {
439
- const [mounted, setMounted] = useState(false);
440
- useEffect(() => setMounted(true), []);
441
-
442
- if (!mounted) return <>{children}</>;
443
-
444
65
  return (
445
- <YuktAIWrapper position="left" showRag showAgent>
66
+ <YuktAIWrapper position="left" launcher showAccessibility showRag engine="rust">
446
67
  {children}
447
68
  </YuktAIWrapper>
448
- );
449
- }
450
- ```
451
-
452
- ### Step 3: `app/layout.tsx`
453
-
454
- ```tsx
455
- import YuktaiClient from "@/components/YuktaiClient";
456
-
457
- export default function RootLayout({ children }: { children: React.ReactNode }) {
458
- return (
459
- <html lang="en">
460
- <body>
461
- <YuktaiClient>
462
- <main>{children}</main>
463
- </YuktaiClient>
464
- </body>
465
- </html>
466
- );
467
- }
468
- ```
469
-
470
- That's it. Floating buttons appear on every page: ♿ opens the accessibility panel, 💬 opens "Ask this page", and the agent button opens the AI agent.
471
-
472
- To add the v5.2 agentic tools, place `<AgenticPanel />` or `useAgenticGrid` in any client component (see [What's new in v5.2](#whats-new-in-v52-agentic-ai-toolkit)).
473
-
474
- ### Wrapper props
475
-
476
- | Prop | Type | Default | Description |
477
- |---|---|---|---|
478
- | `position` | `"left" \| "right"` | `"left"` | Which side the buttons appear on |
479
- | `showRag` | `boolean` | `false` | Show the 💬 Ask-this-page button |
480
- | `showAgent` | `boolean` | `false` | Show the AI agent button |
481
- | `config` | `Partial<A11yConfig>` | `undefined` | Accessibility config overrides |
482
- | `children` | `ReactNode` | required | Your app content |
483
-
484
- ---
485
-
486
- ## Module 1: Accessibility Engine
487
-
488
- Scans every element and injects missing accessibility attributes automatically. Covers headings, images, forms, tables, lists, landmarks, and ARIA widgets. Watches for new DOM elements with `MutationObserver`.
489
-
490
- **Features**
491
-
492
- - WCAG 2.2 auto-fix: ARIA, roles, tabindex, scope, autocomplete, alt text
493
- - Speak on focus using browser SpeechSynthesis
494
- - Voice control using the SpeechRecognition API
495
- - Visual alerts for deaf and hard-of-hearing users
496
- - High contrast, dark mode, reduce motion, large targets (44×44)
497
- - Colour-blind modes: Deuteranopia, Protanopia, Tritanopia, Greyscale
498
- - Dyslexia font: Atkinson Hyperlegible
499
- - Local font picker and font scaling from 80% to 130%
500
- - Audit badge with a WCAG score from 0 to 100 (localhost only)
501
- - Skip links, focus trap, saved preferences, reset
502
-
503
- **Direct API**
504
-
505
- ```ts
506
- import { wcagPlugin, type A11yConfig } from "@yuktishaalaa/yuktai";
507
-
508
- const config: A11yConfig = {
509
- enabled: true,
510
- highContrast: false,
511
- darkMode: false,
512
- reduceMotion: false,
513
- largeTargets: false,
514
- speechEnabled: false,
515
- colorBlindMode: "none", // none | deuteranopia | protanopia | tritanopia | achromatopsia
516
- autoFix: true,
517
- showPreferencePanel: true,
518
- showSkipLinks: true,
519
- showAuditBadge: false, // dev only (localhost)
520
- fontSizeMultiplier: 1,
521
- timeoutWarning: 0, // seconds, 0 = off
522
- };
523
-
524
- const report = wcagPlugin.applyFixes(config);
525
- console.log(report.fixed); // number of fixes applied
526
- console.log(report.score); // 0–100
527
- ```
528
-
529
- ### WCAG coverage
530
-
531
- | Standard | Criteria | Examples |
532
- |---|---|---|
533
- | WCAG 2.0 | 19 | Alt text, roles, labels, tables, landmarks, focus |
534
- | WCAG 2.1 | 7 | Touch targets, reflow, motion, orientation |
535
- | WCAG 2.2 | 3 | Focus appearance, target size, timeout warning |
536
- | Beyond WCAG | Extras | Speech, visual alerts, colour-blind modes, dyslexia font, audit score |
537
-
538
- ---
539
-
540
- ## Module 2: YuktaiGrid ⭐
541
-
542
- An accessible data grid for Next.js, with an embedded AI assistant, agent tools, and WebMCP support.
543
-
544
- ### Basic usage
545
-
546
- ```tsx
547
- "use client";
548
-
549
- import { YuktaiGrid } from "@yuktishaalaa/yuktai";
550
-
551
- const data = [
552
- { id: 1, name: "Sandeep", role: "Developer", salary: 85000 },
553
- { id: 2, name: "Priya", role: "Designer", salary: 90000 },
554
- ];
555
-
556
- export default function EmployeesPage() {
557
- return (
558
- <YuktaiGrid
559
- data={data}
560
- rowKey="id"
561
- columns={[
562
- { key: "name", label: "Name", sortable: true },
563
- { key: "role", label: "Role" },
564
- { key: "salary", label: "Salary", type: "number", align: "right" },
565
- ]}
566
- theme="default" // default | high-contrast | dark | color-blind | dyslexia
567
- locale="en-US" // en-US | te-IN
568
- view="auto" // auto | table | card
569
- search
570
- ai
571
- pagination={{
572
- pageSize: 20,
573
- showSizeChanger: true,
574
- sizeOptions: [10, 20, 50, 100],
575
- }}
576
- />
577
- );
69
+ )
578
70
  }
579
71
  ```
580
72
 
581
- ### Grid features
582
-
583
- - Real-time search, column sorting, client-side pagination with page-size switching
584
- - Mobile card view below a configurable breakpoint
585
- - Loading and empty states
586
- - 5 WCAG themes
587
- - Row selection, custom cell render, `rowKey`
588
- - Row highlighting with optional auto-scroll
589
- - Keyboard navigation, ARIA grid semantics, 44×44 targets
590
- - English and Telugu UI
591
- - Embedded Grid AI Assistant with voice and chat
592
- - **New in v5.2:** compound natural-language questions, anomaly detection and BI answers through `useAgenticGrid`
593
-
594
- ### Grid AI Assistant
595
-
596
- Runs embedded in the grid or as a standalone component. Intent parsing runs locally and supports search, sort, count, highest, lowest, average, total, and row lookup.
597
-
598
- ```tsx
599
- <YuktaiGridAI
600
- data={data}
601
- columns={columns}
602
- onSearch={handleSearch}
603
- onSort={handleSort}
604
- language="te-IN" // AI UI and responses: en-US | te-IN
605
- inputLanguage="te-IN" // voice input: en-IN, en-US or any of the 22 Indian languages
606
- embedded
607
- />
608
- ```
609
-
610
- Voice recognition depends on browser Web Speech API support.
611
-
612
- ### Agent tools
613
-
614
- Generic, reusable grid operations shared by the Agent and WebMCP:
615
-
616
- ```ts
617
- import {
618
- searchGrid,
619
- countGrid,
620
- getColumns,
621
- getRow,
622
- highlightRows,
623
- selectRow,
624
- openRow,
625
- } from "@yuktishaalaa/yuktai";
626
- ```
627
-
628
- Run tools programmatically:
629
-
630
- ```tsx
631
- import { useYuktaiGridAgent, type GridAgentTool } from "@yuktishaalaa/yuktai";
632
-
633
- const tools: GridAgentTool[] = [
634
- {
635
- name: "search",
636
- description: "Search grid rows by a text query",
637
- execute: async ({ query }) => searchGrid(data, query),
638
- },
639
- ];
640
-
641
- const { executeTool, loading } = useYuktaiGridAgent({ tools });
642
- ```
643
-
644
- **Design principle:** keep generic tools in the package and put app-specific rules in your app.
645
-
646
- ```text
647
- Generic YuktAI tools + Your domain rules = Your application agent
648
- ```
649
-
650
- ### WebMCP
651
-
652
- Exposes grid tools to browser AI agents through `document.modelContext`, so agents call real operations instead of guessing from the DOM. Registration is invisible in the UI.
653
-
654
- ```tsx
655
- <YuktaiGrid
656
- data={rows}
657
- columns={columns}
658
- ai
659
- webmcp
660
- toolName="my_grid"
661
- toolDescriptions={TOOL_DESCRIPTIONS}
662
- onWebMCPStatusChange={setStatus} // unsupported | registering | ready | partial | error
663
- />
664
- ```
665
-
666
- Or standalone:
667
-
668
73
  ```tsx
669
- <YuktaiGridWebMCP data={data} columns={columns} />
670
- ```
671
-
672
- WebMCP is not available in every browser, so always handle the `unsupported` status gracefully.
673
-
674
- ### Large datasets (100K+ rows)
675
-
676
- Client-side pagination handles a few thousand rows well. For anything larger, use server-side pagination and disable the grid's built-in search and pagination.
677
-
678
- `src/app/api/employees/route.ts`:
679
-
680
- ```ts
681
- import { NextRequest, NextResponse } from "next/server";
682
-
683
- let cachedData: any[] | null = null;
684
- let cacheTime = 0;
685
- const TTL_MS = 60_000;
686
-
687
- async function fetchAll(): Promise<any[]> {
688
- const now = Date.now();
689
- if (cachedData && now - cacheTime < TTL_MS) return cachedData;
690
- const res = await fetch("https://your-api.com/employees", { cache: "no-store" });
691
- const json = await res.json();
692
- cachedData = Array.isArray(json) ? json : json.employees ?? json.data ?? [];
693
- cacheTime = now;
694
- return cachedData;
695
- }
696
-
697
- export async function GET(req: NextRequest) {
698
- const p = req.nextUrl.searchParams;
699
- const page = Math.max(1, parseInt(p.get("page") || "1"));
700
- const pageSize = Math.max(1, parseInt(p.get("pageSize") || "5000"));
701
- const search = (p.get("search") || "").toLowerCase().trim();
702
-
703
- const all = await fetchAll();
704
- const filtered = search
705
- ? all.filter((r) => Object.values(r).some((v) => String(v).toLowerCase().includes(search)))
706
- : all;
707
-
708
- const total = filtered.length;
709
- const rows = filtered.slice((page - 1) * pageSize, page * pageSize);
710
-
711
- return NextResponse.json({
712
- rows,
713
- pagination: { page, pageSize, totalRows: total, totalPages: Math.ceil(total / pageSize) },
714
- });
715
- }
74
+ // app/layout.tsx: wrap your app
75
+ <body><YuktaiClient>{children}</YuktaiClient></body>
716
76
  ```
717
77
 
718
- Page:
78
+ **Grid and icons**
719
79
 
720
80
  ```tsx
721
- const [apiResp, setApiResp] = useState<any>(null);
722
- const [currentPage, setPage] = useState(1);
723
-
724
- useEffect(() => {
725
- fetch(`/api/employees?page=${currentPage}&pageSize=5000`)
726
- .then((r) => r.json())
727
- .then(setApiResp);
728
- }, [currentPage]);
81
+ import { YuktaiGrid } from "@yuktishaalaa/yuktai"
82
+ import { SearchIcon } from "@yuktishaalaa/yuktai/icons"
729
83
 
730
- <YuktaiGrid
731
- data={apiResp?.rows ?? []}
732
- columns={columns}
733
- search={false} // handled server-side
734
- pagination={false} // handled server-side
735
- loading={!apiResp}
736
- />;
84
+ <YuktaiGrid data={rows} columns={columns} rowKey="id" engine="auto" showSearchTime />
85
+ <SearchIcon size={24} color="#0a4a85" label="Search" />
737
86
  ```
738
87
 
739
- Render your own pagination bar from `apiResp.pagination`. The browser only ever holds one page in memory.
88
+ More examples for every feature: **https://yuktaidocs.netlify.app/**
740
89
 
741
- ---
90
+ ### Wrapper buttons
742
91
 
743
- ## Showcase: Ratnalabala (Telugu poetry)
744
-
745
- [Ratnalabala](https://ratnalabala.vercel.app/poems?view=grid) shows that an agentic grid is more than a chatbot next to a table. Users type or speak in Telugu, and the grid acts.
746
-
747
- | User says | Agent action |
92
+ | Prop | Button |
748
93
  |---|---|
749
- | `ఎన్ని పద్యాలు` (how many poems) | `count` → "మొత్తం 36 పద్యాలు ఉన్నాయి." |
750
- | `గర్వం తెరువు` (open "Garvam") | `open` |
751
- | `"బుద్ధి" ఉన్న పద్యాలు` (poems with "buddhi") | `search` + highlight |
752
- | `అక్షర క్రమంలో` (alphabetical) | `sort(title, asc)` |
753
- | `ఈరోజు పద్యం` (poem of the day) | custom rule + highlight |
754
-
755
- **Stack:** Next.js · React + TypeScript · MUI · YuktAI Grid · FastAPI (Python) · PostgreSQL on Neon · Vercel · Web Speech API · WebMCP
756
-
757
- ```text
758
- PostgreSQL → FastAPI → Next.js API proxy → Ratnalabala UI → YuktAI Grid
759
- ├── Agent
760
- └── WebMCP
761
- ```
762
-
763
- ```tsx
764
- <YuktaiGrid<PoemRow>
765
- data={rows}
766
- columns={COLUMNS}
767
- rowKey="id"
768
- locale="te-IN"
769
- inputLanguage="te-IN"
770
- customRules={POEM_RULES}
771
- search
772
- highlightIds={highlightIds}
773
- autoScrollToHighlight
774
- onRowClick={(row) => onOpenPoem(row.title)}
775
- ai
776
- webmcp
777
- toolName="ratnalabala_poems"
778
- toolDescriptions={TOOL_DESCRIPTIONS}
779
- onWebMCPStatusChange={setWebmcp}
780
- />
781
- ```
782
-
783
- ---
784
-
785
- ## Module 3: In-Tab RAG (Ask This Page)
786
-
787
- Retrieval-Augmented Generation running entirely in the browser. It extracts text chunks from the current page, embeds them, finds the best match for the question, and answers. Offline, no API key.
788
-
789
- | Device | Engine | How it works |
790
- |---|---|---|
791
- | Desktop Chrome with Gemini Nano | `window.LanguageModel` | Page text sent as context, instant answer |
792
- | Mobile and all other browsers | Transformers.js | Embeddings + `flan-t5-small`, q4 quantized |
793
-
794
- - About 30 MB one-time model download on mobile, cached in IndexedDB
795
- - Works fully offline after first load
796
- - All processing on device, no data sent anywhere
797
-
798
- **What I learned:** Transformers.js kept crashing on iOS Safari with out-of-memory errors. Quantization (same model, 75% smaller) fixed it. DistilBERT gave short, useless spans; `flan-t5-small` gives real sentences.
799
-
800
- **New in v5.2:** `createContextIndex` also searches grid rows (including rows on other pages of the grid) and your own documents, with keyword search that handles Telugu and Hindi script correctly.
801
-
802
- ---
803
-
804
- ## Module 4: Autonomous AI Agent
805
-
806
- Type a goal in plain English. yuktai reads the page, finds the right elements, plans the steps, and highlights what to do.
807
-
808
- - 9 DOM traversal strategies and 11 form-label strategies
809
- - Works on static HTML, React, WordPress, and old government portals
810
- - Gemini Nano planning on desktop, Transformers.js on mobile, rule-based fallback
811
- - Highlights target fields, scrolls to sections, shows a numbered plan, handles iframes
812
-
813
- Every label strategy came from a real website: old portals put labels in the previous table cell, modern apps use `aria-label`, static pages use `placeholder`.
814
-
815
- ---
816
-
817
- ## Module 5: Vibe Coder
818
-
819
- Type a business requirement and download a full Next.js 16 project as a ZIP.
820
-
821
- - Detects website type (12), pages (21), features (14), theme colour (8), and site name
822
- - Preview before generating
823
- - TypeScript, Tailwind + CSS Modules, mobile responsive
824
- - Navbar, Footer, Home, About, Contact, Services, Pricing, Auth, Dashboard
825
- - `npm run dev` works immediately
826
-
827
- No AI writes the code. It's pure template engineering.
828
-
829
- ---
830
-
831
- ## Module 6: Agentic AI Toolkit
832
-
833
- The ten v5.2 features, described in detail in [What's new in v5.2](#whats-new-in-v52-agentic-ai-toolkit).
834
-
835
- - **Copilot and QA:** 15 WCAG checks, plain-English explanations, safe fixes with undo, downloadable reports
836
- - **Forms and design review:** labels, autocomplete, error messages, focus states, hierarchy, clutter, senior-friendly tips
837
- - **Data:** compound grid questions, outliers and duplicates, group-by, period comparison, trends
838
- - **Automation:** multi-step instructions with a before/after summary
839
- - **Voice:** accessibility settings and grid row navigation by voice, in English and Telugu
840
- - **React:** `AgenticPanel`, `AgenticGridBar`, `useAgenticGrid`
841
-
842
- ---
843
-
844
- ## Gemini Nano setup (desktop Chrome, one time)
845
-
846
- Needed only for Gemini Nano features on desktop Chrome. Mobile and other browsers use Transformers.js automatically.
847
-
848
- 1. Open `chrome://flags` and enable: Prompt API for Gemini Nano, Summarization API, Writer API, Rewriter API, Translation API.
849
- 2. Click **Relaunch**.
850
- 3. Open `chrome://components`, find **Optimization Guide On Device Model**, and click **Check for update**.
851
- 4. Refresh your page. AI features unlock automatically.
852
-
853
- **Gemini Nano features:** plain-English rewriting, 3-sentence page summary, AI-generated ARIA labels, page translation in 18 languages.
854
-
855
- > Chrome 147 moved the APIs from `window.ai` to standalone globals such as `window.LanguageModel`. yuktai supports both.
94
+ | `launcher` | ✨ One button that shows or hides the others |
95
+ | `showAccessibility` | ♿ Accessibility |
96
+ | `showRag` | 💬 Ask page |
97
+ | `showAgent` | 🤖 AI agent |
98
+ | `showVibeCoder` | ⚡ Vibe Coder (keep it off on public sites) |
99
+ | `engine` | Ask page search: `"ts"`, `"rust"` or `"auto"` |
856
100
 
857
101
  ---
858
102
 
859
- ## Icons
860
-
861
- 163 yuktai SVG icons for Next.js and React, with no icon library needed. They are the same icons the vanilla build draws with `yuktai.icon()`.
862
-
863
- ### Next.js setup
103
+ ## Rust engine (optional)
864
104
 
865
- ```bash
866
- npm install @yuktishaalaa/yuktai@5.3.4
867
- ```
105
+ Set `engine="rust"` or `"auto"`. Results are identical to TypeScript, proven by tests, only faster. If WebAssembly is unavailable, it falls back to TypeScript.
868
106
 
869
- Import from **`@yuktishaalaa/yuktai/icons`**. This entry has no hooks and no browser code, so the icons work in **Server Components** (no `"use client"` needed), in Client Components, and in the Pages Router.
870
-
871
- ```tsx
872
- // app/page.tsx — a Server Component
873
- import { MicIcon, SearchIcon, AccessibilityIcon, YuktaiIcon } from "@yuktishaalaa/yuktai/icons"
874
-
875
- export default function Page() {
876
- return (
877
- <>
878
- {/* decorative: the button text or aria-label names it */}
879
- <button type="button" aria-label="Start voice input"><MicIcon /></button>
880
-
881
- {/* meaningful on its own: give it a label */}
882
- <SearchIcon size={24} label="Search" />
883
-
884
- {/* filled variant: blue square, glyph colour picked for contrast */}
885
- <AccessibilityIcon variant="filled" color="#005A9C" size={32} label="Accessibility settings" />
886
-
887
- {/* any icon by name */}
888
- <YuktaiIcon name="wand" />
889
- </>
890
- )
891
- }
892
- ```
893
-
894
- Importing from the main entry (`@yuktishaalaa/yuktai`) still works, but the `/icons` entry is smaller (about 30 KB) and safe on the server.
895
-
896
- ### Props
897
-
898
- | Prop | Default | What it does |
899
- |---|---|---|
900
- | `size` | `20` | Width and height in pixels |
901
- | `color` | `currentColor` | Outline: the line colour. Filled: the background colour |
902
- | `variant` | `"outline"` | `"outline"` or `"filled"` |
903
- | `glyphColor` | auto | Filled only. White or near-black, whichever has more contrast |
904
- | `shape` | `"rounded"` | Filled only. `"rounded"` square or `"circle"` |
905
- | `strokeWidth` | `2.5` | Line thickness |
906
- | `label` | none | Adds `role="img"` and `aria-label`. Without it the icon is decorative (`aria-hidden`) |
907
-
908
- Any other SVG attribute (`className`, `style`, `id`) is passed through.
909
-
910
- ### All 163 icons
911
-
912
- | Component | `name` | Component | `name` |
107
+ | Task | TypeScript | Rust | Speed-up |
913
108
  |---|---|---|---|
914
- | `AccessibilityIcon` | accessibility | `CopyIcon` | copy |
915
- | `ContrastIcon` | contrast | `FilterIcon` | filter |
916
- | `MoonIcon` | moon | `CheckIcon` | check |
917
- | `MotionIcon` | motion | `ChevronLeftIcon` | left |
918
- | `ReadingIcon` | reading | `ChevronRightIcon` | right |
919
- | `TargetIcon` | target | `FirstIcon` | first |
920
- | `SpeakerIcon` | speaker | `LastIcon` | last |
921
- | `PaletteIcon` | palette | `SparkIcon` | spark |
922
- | `SkipIcon` | skip | `AlertIcon` | alert |
923
- | `CloseIcon` | close | `InfoIcon` | info |
924
- | `PlusIcon` | plus | `FormIcon` | form |
925
- | `MinusIcon` | minus | `EyeIcon` | eye |
926
- | `ResetIcon` | reset | `LayoutIcon` | layout |
927
- | `SearchIcon` | search | `WandIcon` | wand |
928
- | `SortIcon` | sort | `UndoIcon` | undo |
929
- | `SortUpIcon` | sortUp | `ToolsIcon` | tools |
930
- | `SortDownIcon` | sortDown | `PlugIcon` | plug |
931
- | `ChevronsIcon` | chevrons | `GridIcon` | grid |
932
- | `CardsIcon` | cards | `ChatIcon` | chat |
933
- | `MicIcon` | mic | `StopIcon` | stop |
934
- | `DownloadIcon` | download | | |
935
-
936
- **New in v5.3.2 (33):** `HomeIcon` (home), `MenuIcon` (menu), `BookIcon` (book), `CalendarIcon` (calendar), `ClockIcon` (clock), `PersonIcon` (person), `UsersIcon` (users), `GlobeIcon` (globe), `LampIcon` (lamp), `PlayIcon` (play), `PauseIcon` (pause), `SendIcon` (send), `ShareIcon` (share), `GiftIcon` (gift), `ImageIcon` (image), `FileIcon` (file), `ExternalIcon` (external), `ArrowUpIcon` (arrowUp), `ArrowLeftIcon` (arrowLeft), `ArrowRightIcon` (arrowRight), `HeadphonesIcon` (headphones), `MusicIcon` (music), `PinIcon` (pin), `MapIcon` (map), `PenIcon` (pen), `WalletIcon` (wallet), `InstallIcon` (install), `HelpIcon` (help), `TempleIcon` (temple), `MeditateIcon` (meditate), `TrophyIcon` (trophy), `BulbIcon` (bulb), `SunIcon` (sun).
937
-
938
- **New in v5.3.3 (58):** `DeleteIcon` (delete), `RobotIcon` (robot), `HeartIcon` (heart), `HeartFilledIcon` (heartFilled), `HubIcon` (hub), `CodeIcon` (code), `TextIcon` (text), `BoldIcon` (bold), `ItalicIcon` (italic), `UnderlineIcon` (underline), `AlignLeftIcon` (alignLeft), `AlignCenterIcon` (alignCenter), `AlignRightIcon` (alignRight), `AlignJustifyIcon` (alignJustify), `QuoteIcon` (quote), `TitleIcon` (title), `FontIcon` (font), `SpellcheckIcon` (spellcheck), `AbcIcon` (abc), `PageBreakIcon` (pageBreak), `LinkIcon` (link), `StyleIcon` (style), `LockIcon` (lock), `UnlockIcon` (unlock), `KeyIcon` (key), `RedoIcon` (redo), `SwapIcon` (swap), `ShuffleIcon` (shuffle), `FullscreenIcon` (fullscreen), `FullscreenExitIcon` (fullscreenExit), `MergeIcon` (merge), `JoinIcon` (join), `TouchIcon` (touch), `VolumeOffIcon` (volumeOff), `MusicOffIcon` (musicOff), `MusicVideoIcon` (musicVideo), `MovieIcon` (movie), `SlideshowIcon` (slideshow), `StorageIcon` (storage), `ApiIcon` (api), `DataObjectIcon` (dataObject), `ComputerIcon` (computer), `PhoneIcon` (phone), `CloudIcon` (cloud), `WifiIcon` (wifi), `WifiOffIcon` (wifiOff), `SearchOffIcon` (searchOff), `EyeOffIcon` (eyeOff), `BookmarkIcon` (bookmark), `SchoolIcon` (school), `GavelIcon` (gavel), `ArchitectureIcon` (architecture), `BrainIcon` (brain), `VolunteerIcon` (volunteer), `RadioIcon` (radio), `RadioCheckedIcon` (radioChecked), `UploadIcon` (upload), `ArrowDownIcon` (arrowDown).
939
-
940
- **New in v5.3.4 (31):** `FactCheckIcon` (factCheck), `ImageSearchIcon` (imageSearch), `DocumentScannerIcon` (documentScanner), `DashboardIcon` (dashboard), `CleaningIcon` (cleaning), `DragHandleIcon` (dragHandle), `ZoomInIcon` (zoomIn), `ZoomOutIcon` (zoomOut), `InsightsIcon` (insights), `ExploreIcon` (explore), `SaveIcon` (save), `LabelIcon` (label), `KeyboardIcon` (keyboard), `TrendingUpIcon` (trendingUp), `TrendingDownIcon` (trendingDown), `CakeIcon` (cake), `BarChartIcon` (barChart), `AdminIcon` (admin), `BugReportIcon` (bugReport), `SentimentSadIcon` (sentimentSad), `IntegrationIcon` (integration), `NamaskarIcon` (namaskar), `SunriseIcon` (sunrise), `SunsetIcon` (sunset), `LoginIcon` (login), `LogoutIcon` (logout), `SpeedIcon` (speed), `RepeatIcon` (repeat), `LoaderIcon` (loader), `StarIcon` (star), `ShieldCheckIcon` (shieldCheck).
941
-
942
- `heartFilled` and `radioChecked` have a filled part that follows the icon colour, also in the filled variant.
943
-
944
- `ICON_NAMES` lists every name, and the `IconName` type checks it, so `<YuktaiIcon name="mike" />` is a type error.
945
-
946
- ### WCAG built in
947
-
948
- - **1.1.1 Non-text content:** decorative by default; pass `label` when the icon carries meaning on its own.
949
- - **1.4.11 Non-text contrast:** the filled variant picks a glyph colour with at least 3:1 contrast, and warns in the console if a custom `glyphColor` falls below that. For outline icons, choose a `color` with 3:1 against your background, for example W3C blue `#005A9C` on white (7.1:1).
950
- - **Forced colours (Windows High Contrast):** outline icons follow the text colour; filled icons switch to system colours.
951
- - **2.5.8 Target size:** an icon is not a target. Put it inside a `<button>` of at least 24×24 px (44×44 is better on touch screens).
952
-
953
- Helpers: `iconContrast(fg, bg)` returns the contrast ratio, `pickGlyphColor(bg)` returns the best glyph colour, and `iconSvg(name, options)` returns SVG markup as a string (for emails or `dangerouslySetInnerHTML`).
954
-
955
- ### Plain HTML
956
-
957
- ```html
958
- <span id="mic"></span>
959
- <script src="https://cdn.jsdelivr.net/npm/@yuktishaalaa/yuktai@5/vanilla/index.min.js"></script>
960
- <script>
961
- document.getElementById("mic").innerHTML = yuktai.icon("mic", { size: 24, label: "Voice input" })
962
- </script>
963
- ```
109
+ | Grid search, 1 lakh rows | 342 ms | 9 ms | 36× |
110
+ | Ask page, 5,000 passages | 18.8 ms | 0.45 ms | 42× |
964
111
 
965
112
  ---
966
113
 
967
- ## Design principles
114
+ ## Live demos
968
115
 
969
- - **Zero API keys, zero cost, zero telemetry.** Everything runs in the browser.
970
- - **Zero injected ids.** Injected nodes are tracked by JavaScript references, so they never collide with your app's ids.
971
- - **Zero framework lock-in.** `core/renderer.ts` has no framework imports, and the vanilla build runs on any HTML page.
972
- - **Never reads its own UI.** Panels are marked with `data-yuktai-panel`.
973
- - **SSR safe.** No `window` errors on the server.
974
- - **Every automatic fix can be undone.** The v5.2 copilot records each change it makes.
975
- - **Honest limits.** Client-side pagination is for a few thousand rows; use server-side beyond that.
976
-
977
- ---
116
+ - 📖 Docs and playgrounds: https://yuktaidocs.netlify.app/
117
+ - Staff directory (Next.js): https://aksharatantra.miriyala.in/staffdirectory
118
+ - Plain HTML PWA: https://sandeepmiriyala03.github.io/yuktai/vanilla/
119
+ - Ratnalabala, a Telugu poetry app: https://ratnalabala.vercel.app/poems?view=grid
978
120
 
979
121
  ## Compatibility
980
122
 
981
- | | Supported |
982
- |---|---|
983
- | Next.js | 13, 14, 15, 16 |
984
- | Plain HTML | Any page, one script tag (vanilla build) |
985
- | React | 17, 18, 19 (19 needs `--legacy-peer-deps`) |
986
- | Node.js | 18+ |
987
- | Browsers | Chrome 90+, Firefox 90+, Safari 15+, Edge 90+, Samsung Internet 14+ |
988
-
989
- ---
990
-
991
- ## Roadmap
992
-
993
- ### Completed
994
-
995
- | Version | What shipped |
996
- |---|---|
997
- | **v5.3.4** | 31 more icons (163 in total): charts, zoom, save, login/logout, sunrise/sunset, namaskar, star, shield and more, so AIHACK and VajasaneyaSandhya use yuktai icons everywhere |
998
- | **v5.3.3** | 58 more icons (132 in total): delete, robot, heart, text-editor set, lock, link, storage, cloud, Wi-Fi and more, so Ratnalabala uses yuktai icons everywhere |
999
- | **v5.3.2** | 33 more icons (home, menu, book, calendar, sun, lamp, temple, meditate, share, play, pause and more), first used on the Sri Yagnavalkya Jayanti site in place of Font Awesome and Material Icons |
1000
- | **v5.3.1** | **74 icons for Next.js and React** (41 in 5.3.1, 33 more in 5.3.2) from the new `@yuktishaalaa/yuktai/icons` entry, safe in Server Components; outline and filled variants with WCAG 1.4.11 contrast checks; same icons in the vanilla build |
1001
- | | Yuktisárathi brand on the demo: navy and gold logo, W3C blue `#005A9C` for links and controls |
1002
- | **v5.3** | **Vanilla JS build:** every module for plain HTML with one script tag, built from the same source as the npm package |
1003
- | | Vanilla grid: themes, card view, Telugu UI, ARIA grid keyboard navigation, question bar, assistant with custom rules and voice, WebMCP |
1004
- | | Vanilla page tools panel and floating accessibility button |
1005
- | | Live demo on GitHub Pages as an installable, offline PWA with the XERJ contributor badge |
1006
- | | Accessibility engine fixes: real labels are no longer overridden, hidden buttons are named correctly, nested landmarks, honest fix count, teal palette at 4.5:1 contrast |
1007
- | | CDN builds on jsDelivr and unpkg; 37 end-to-end browser checks with axe-core |
1008
- | **v5.2** | **Agentic AI Toolkit:** accessibility copilot, QA tester (15 WCAG checks), form review, design review, page understanding, page and data RAG |
1009
- | | Smart grid queries (lakh, crore, 10k), anomaly finder, BI copilot, multi-step task runner, voice accessibility commands in English and Telugu |
1010
- | | React: `AgenticPanel`, `AgenticGridBar`, `useAgenticGrid` |
1011
- | **v4.6.4** | YuktaiGrid Agentic AI + WebMCP, embedded Grid AI Assistant, English and Telugu UI, page-size switching, 7 inline SVG icons |
1012
- | **v4.x** | Accessibility engine, In-tab RAG (Gemini Nano + Transformers.js), autonomous AI agent, Vibe Coder |
1013
-
1014
- ### Next (v5.4)
1015
-
1016
- - Expose the v5.2 agentic tools (QA, forms, design, page Q&A) to browser AI agents through WebMCP
1017
- - Telugu and Hindi data questions in the smart grid parser, without needing custom rules
1018
- - Hindi voice accessibility commands
1019
- - More grid agent tools: group, export and compare
1020
- - Server-side paging helpers for the vanilla grid (100K+ rows)
1021
-
1022
- ### Later
1023
-
1024
- - Multilingual RAG: Telugu, Hindi, Tamil, Bengali
1025
- - RTL layout support (Urdu, Sindhi, Kashmiri)
1026
- - Richer browser-native AI as Chrome's built-in APIs mature
1027
- - Multimodal grid experiences (images and charts in rows)
1028
- - A web component build (`<yuktai-grid>`) for any framework
123
+ Next.js 13–16 · React 17–19 (19 needs `--legacy-peer-deps`) · Node 18+ · Chrome, Edge, Firefox, Safari, Samsung Internet
1029
124
 
1030
- ---
1031
-
1032
- ## Contributing
125
+ ## Honest limits
1033
126
 
1034
- Issues and pull requests are welcome at [github.com/sandeepmiriyala03/yuktai](https://github.com/sandeepmiriyala03/yuktai). For security issues, see [SECURITY.md](./SECURITY.md).
127
+ - Grid questions use rules, not a language model; unusual phrasing may need rewording.
128
+ - Ask page uses keyword search (BM25), not embeddings.
129
+ - Telugu and Hindi data questions need `customRules` for now.
130
+ - Automatic checks don't replace testing with real users and screen readers.
1035
131
 
1036
- ---
1037
-
1038
- ## Links
132
+ ## Roadmap
1039
133
 
1040
- - npm: [@yuktishaalaa/yuktai](https://www.npmjs.com/package/@yuktishaalaa/yuktai)
1041
- - GitHub: [sandeepmiriyala03/yuktai](https://github.com/sandeepmiriyala03/yuktai)
1042
- - Demo: [aksharatantra.miriyala.in/staffdirectory](https://aksharatantra.miriyala.in/staffdirectory)
1043
- - Showcase: [ratnalabala.vercel.app](https://ratnalabala.vercel.app/poems?view=grid)
1044
- - Vanilla JS demo (PWA): [sandeepmiriyala03.github.io/yuktai/vanilla](https://sandeepmiriyala03.github.io/yuktai/vanilla/)
1045
- - Vanilla JS (CDN): [cdn.jsdelivr.net/npm/@yuktishaalaa/yuktai/vanilla/index.min.js](https://cdn.jsdelivr.net/npm/@yuktishaalaa/yuktai/vanilla/index.min.js)
1046
- - XERJ Corpus Hub: [hub.xerj.org](https://hub.xerj.org)
1047
- - XERJ contributor profile: [hub.xerj.org/contributors/sandeepmiriyala03](https://hub.xerj.org/contributors/sandeepmiriyala03)
134
+ - **Next:** more Rust (filters, BI, typo-tolerant search, Telugu typed in English letters), Hindi voice commands
135
+ - **Later:** semantic RAG (hybrid search), a Python package, Angular/Vue and .NET support, more Indian-language interfaces
1048
136
 
1049
137
  ---
1050
138
 
1051
- ## License
139
+ **Recognition:** part of the [XERJ Corpus Hub](https://hub.xerj.org) · [contributor profile](https://hub.xerj.org/contributors/sandeepmiriyala03)
1052
140
 
1053
- GPL-3.0 © Sandeep Miriyala, [Yuktishaalaa AI Lab](https://github.com/sandeepmiriyala03)
141
+ **Contributing:** issues and PRs welcome at [GitHub](https://github.com/sandeepmiriyala03/yuktai). Security: [SECURITY.md](./SECURITY.md)
1054
142
 
1055
- Built in free time. AI coding assistants (Claude, GPT and Gemini) helped me learn, and helped write and test parts of the code. Every design decision, review and release is mine.
143
+ **License:** GPL-3.0 © Sandeep Miriyala, Yuktishaalaa AI Lab. AI coding assistants helped with learning, writing and testing; every design decision and release is mine.
1056
144
 
1057
- **Free forever. Open source. Built for every user.**
145
+ **Free forever. Open source. Built for every user.**