@yuktishaalaa/yuktai 4.6.2 → 4.6.4

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/dist/index.d.mts CHANGED
@@ -111,40 +111,16 @@ declare const voicePlugin: {
111
111
  execute(input: string): Promise<string>;
112
112
  };
113
113
 
114
- interface YuktaiGridAIProps$1<T> {
115
- data: T[];
116
- columns: {
117
- key: string;
118
- label: string;
119
- type?: "number" | "text" | "date";
120
- }[];
121
- onSearch: (query: string) => void;
122
- onSort?: (key: string, dir: "asc" | "desc") => void;
123
- theme?: "light" | "dark";
124
- language?: "en-US" | "en-IN" | "hi-IN" | "te-IN";
125
- }
126
- declare function YuktaiGrid<T extends Record<string, unknown>>({ data, columns, onSearch, onSort, theme, language, }: YuktaiGridAIProps$1<T>): react_jsx_runtime.JSX.Element;
127
-
128
114
  interface GridColumn<T = Record<string, unknown>> {
129
- /** Unique key — must match a property in your data */
130
115
  key: keyof T & string;
131
- /** Display label for the header */
132
116
  label: string;
133
- /** Allow sorting on this column (default: true) */
134
117
  sortable?: boolean;
135
- /** Allow filtering on this column (default: true) */
136
118
  filterable?: boolean;
137
- /** Hide this column on mobile (default: false) */
138
119
  hiddenOnMobile?: boolean;
139
- /** Pin this column on tablet view */
140
120
  pinned?: boolean;
141
- /** Column width — number (px) or string (%, fr) */
142
121
  width?: number | string;
143
- /** Custom cell renderer */
144
122
  render?: (value: T[keyof T], row: T, index: number) => ReactNode;
145
- /** Cell alignment */
146
123
  align?: "left" | "center" | "right";
147
- /** Type — affects default formatting and filter UI */
148
124
  type?: "text" | "number" | "date" | "boolean" | "badge";
149
125
  }
150
126
  type SortDirection = "asc" | "desc" | null;
@@ -162,23 +138,15 @@ type ViewMode = "table" | "card" | "auto";
162
138
  type GridTheme = "default" | "high-contrast" | "dark" | "color-blind" | "dyslexia";
163
139
  type GridLocale = "en-IN" | "en-US" | "te-IN" | "hi-IN" | "ta-IN" | "bn-IN" | "mr-IN" | "kn-IN" | "ml-IN" | "gu-IN" | "pa-IN" | "ur-IN";
164
140
  interface AIFeatures {
165
- /** Enable AI semantic search */
166
141
  search?: boolean;
167
- /** Enable AI row summary */
168
142
  summary?: boolean;
169
- /** Enable anomaly detection */
170
143
  anomaly?: boolean;
171
- /** Enable suggestions */
172
144
  suggest?: boolean;
173
145
  }
174
146
  interface VoiceFeatures {
175
- /** Voice commands for search/filter/sort */
176
147
  control?: boolean;
177
- /** Read rows aloud on focus */
178
148
  speakOnFocus?: boolean;
179
- /** Read filtered data summary aloud */
180
149
  speakSummary?: boolean;
181
- /** Voice language (defaults to locale) */
182
150
  language?: string;
183
151
  }
184
152
  interface PaginationConfig {
@@ -203,44 +171,32 @@ interface GridTranslations {
203
171
  ask: string;
204
172
  }
205
173
  interface YuktaiGridProps<T = Record<string, unknown>> {
206
- /** The data to display */
207
174
  data: T[];
208
- /** Column definitions */
209
175
  columns: GridColumn<T>[];
210
- /** View mode — "auto" picks based on screen size */
211
176
  view?: ViewMode;
212
- /** Mobile breakpoint in pixels (default: 768) */
213
177
  mobileBreakpoint?: number;
214
- /** WCAG theme (default: "default") */
215
178
  theme?: GridTheme;
216
- /** Locale (default: "en-US") */
217
179
  locale?: GridLocale;
218
- /** AI features */
219
180
  ai?: boolean | AIFeatures;
220
- /** Voice features */
221
181
  voice?: boolean | VoiceFeatures;
222
- /** Pagination */
223
182
  pagination?: boolean | PaginationConfig;
224
- /** Show search bar */
225
183
  search?: boolean;
226
- /** Multi-row selection */
227
184
  selectable?: boolean;
228
- /** Selected row keys */
229
185
  selectedKeys?: string[];
230
- /** Row key field (default: "id") */
231
186
  rowKey?: keyof T & string;
232
- /** Loading state */
233
187
  loading?: boolean;
234
- /** Custom empty state */
235
188
  empty?: ReactNode;
236
- /** Callbacks */
189
+ highlightIds?: (string | number)[];
190
+ highlightColor?: string;
191
+ autoScrollToHighlight?: boolean;
237
192
  onSelectionChange?: (keys: string[]) => void;
238
193
  onRowClick?: (row: T, index: number) => void;
239
194
  onSortChange?: (sort: SortConfig | null) => void;
240
- /** Custom className */
241
195
  className?: string;
242
196
  }
243
197
 
198
+ declare function YuktaiGrid<T extends Record<string, unknown>>({ data, columns, rowKey, view, mobileBreakpoint, theme, locale, ai, search, selectable, selectedKeys, onSelectionChange, pagination, loading, highlightIds, highlightColor, autoScrollToHighlight, onRowClick, onSortChange, empty, className, }: YuktaiGridProps<T>): react_jsx_runtime.JSX.Element;
199
+
244
200
  interface UseGridOptions<T> {
245
201
  data: T[];
246
202
  columns: GridColumn<T>[];
@@ -266,6 +222,7 @@ interface UseGridReturn<T> {
266
222
  }
267
223
  declare function useGrid<T extends Record<string, unknown>>(options: UseGridOptions<T>): UseGridReturn<T>;
268
224
 
225
+ type Language = "en-US" | "te-IN";
269
226
  interface YuktaiGridAIProps<T> {
270
227
  data: T[];
271
228
  columns: {
@@ -276,9 +233,23 @@ interface YuktaiGridAIProps<T> {
276
233
  onSearch: (query: string) => void;
277
234
  onSort?: (key: string, dir: "asc" | "desc") => void;
278
235
  theme?: "light" | "dark";
279
- language?: "en-US" | "en-IN" | "hi-IN" | "te-IN";
236
+ /**
237
+ * Language of AI UI and AI responses.
238
+ * Default: English.
239
+ */
240
+ language?: Language;
241
+ /**
242
+ * Language used by browser voice recognition.
243
+ * Default: English.
244
+ */
245
+ inputLanguage?: Language;
246
+ /**
247
+ * When true, AI is rendered inside the grid.
248
+ * When false, AI uses the floating assistant UI.
249
+ */
250
+ embedded?: boolean;
280
251
  }
281
- declare function YuktaiGridAI<T extends Record<string, unknown>>({ data, columns, onSearch, onSort, theme, language, }: YuktaiGridAIProps<T>): react_jsx_runtime.JSX.Element;
252
+ declare function YuktaiGridAI<T extends Record<string, unknown>>({ data, columns, onSearch, onSort, theme, language, inputLanguage, embedded, }: YuktaiGridAIProps<T>): react_jsx_runtime.JSX.Element;
282
253
 
283
254
  declare global {
284
255
  interface Document {
package/dist/index.d.ts CHANGED
@@ -111,40 +111,16 @@ declare const voicePlugin: {
111
111
  execute(input: string): Promise<string>;
112
112
  };
113
113
 
114
- interface YuktaiGridAIProps$1<T> {
115
- data: T[];
116
- columns: {
117
- key: string;
118
- label: string;
119
- type?: "number" | "text" | "date";
120
- }[];
121
- onSearch: (query: string) => void;
122
- onSort?: (key: string, dir: "asc" | "desc") => void;
123
- theme?: "light" | "dark";
124
- language?: "en-US" | "en-IN" | "hi-IN" | "te-IN";
125
- }
126
- declare function YuktaiGrid<T extends Record<string, unknown>>({ data, columns, onSearch, onSort, theme, language, }: YuktaiGridAIProps$1<T>): react_jsx_runtime.JSX.Element;
127
-
128
114
  interface GridColumn<T = Record<string, unknown>> {
129
- /** Unique key — must match a property in your data */
130
115
  key: keyof T & string;
131
- /** Display label for the header */
132
116
  label: string;
133
- /** Allow sorting on this column (default: true) */
134
117
  sortable?: boolean;
135
- /** Allow filtering on this column (default: true) */
136
118
  filterable?: boolean;
137
- /** Hide this column on mobile (default: false) */
138
119
  hiddenOnMobile?: boolean;
139
- /** Pin this column on tablet view */
140
120
  pinned?: boolean;
141
- /** Column width — number (px) or string (%, fr) */
142
121
  width?: number | string;
143
- /** Custom cell renderer */
144
122
  render?: (value: T[keyof T], row: T, index: number) => ReactNode;
145
- /** Cell alignment */
146
123
  align?: "left" | "center" | "right";
147
- /** Type — affects default formatting and filter UI */
148
124
  type?: "text" | "number" | "date" | "boolean" | "badge";
149
125
  }
150
126
  type SortDirection = "asc" | "desc" | null;
@@ -162,23 +138,15 @@ type ViewMode = "table" | "card" | "auto";
162
138
  type GridTheme = "default" | "high-contrast" | "dark" | "color-blind" | "dyslexia";
163
139
  type GridLocale = "en-IN" | "en-US" | "te-IN" | "hi-IN" | "ta-IN" | "bn-IN" | "mr-IN" | "kn-IN" | "ml-IN" | "gu-IN" | "pa-IN" | "ur-IN";
164
140
  interface AIFeatures {
165
- /** Enable AI semantic search */
166
141
  search?: boolean;
167
- /** Enable AI row summary */
168
142
  summary?: boolean;
169
- /** Enable anomaly detection */
170
143
  anomaly?: boolean;
171
- /** Enable suggestions */
172
144
  suggest?: boolean;
173
145
  }
174
146
  interface VoiceFeatures {
175
- /** Voice commands for search/filter/sort */
176
147
  control?: boolean;
177
- /** Read rows aloud on focus */
178
148
  speakOnFocus?: boolean;
179
- /** Read filtered data summary aloud */
180
149
  speakSummary?: boolean;
181
- /** Voice language (defaults to locale) */
182
150
  language?: string;
183
151
  }
184
152
  interface PaginationConfig {
@@ -203,44 +171,32 @@ interface GridTranslations {
203
171
  ask: string;
204
172
  }
205
173
  interface YuktaiGridProps<T = Record<string, unknown>> {
206
- /** The data to display */
207
174
  data: T[];
208
- /** Column definitions */
209
175
  columns: GridColumn<T>[];
210
- /** View mode — "auto" picks based on screen size */
211
176
  view?: ViewMode;
212
- /** Mobile breakpoint in pixels (default: 768) */
213
177
  mobileBreakpoint?: number;
214
- /** WCAG theme (default: "default") */
215
178
  theme?: GridTheme;
216
- /** Locale (default: "en-US") */
217
179
  locale?: GridLocale;
218
- /** AI features */
219
180
  ai?: boolean | AIFeatures;
220
- /** Voice features */
221
181
  voice?: boolean | VoiceFeatures;
222
- /** Pagination */
223
182
  pagination?: boolean | PaginationConfig;
224
- /** Show search bar */
225
183
  search?: boolean;
226
- /** Multi-row selection */
227
184
  selectable?: boolean;
228
- /** Selected row keys */
229
185
  selectedKeys?: string[];
230
- /** Row key field (default: "id") */
231
186
  rowKey?: keyof T & string;
232
- /** Loading state */
233
187
  loading?: boolean;
234
- /** Custom empty state */
235
188
  empty?: ReactNode;
236
- /** Callbacks */
189
+ highlightIds?: (string | number)[];
190
+ highlightColor?: string;
191
+ autoScrollToHighlight?: boolean;
237
192
  onSelectionChange?: (keys: string[]) => void;
238
193
  onRowClick?: (row: T, index: number) => void;
239
194
  onSortChange?: (sort: SortConfig | null) => void;
240
- /** Custom className */
241
195
  className?: string;
242
196
  }
243
197
 
198
+ declare function YuktaiGrid<T extends Record<string, unknown>>({ data, columns, rowKey, view, mobileBreakpoint, theme, locale, ai, search, selectable, selectedKeys, onSelectionChange, pagination, loading, highlightIds, highlightColor, autoScrollToHighlight, onRowClick, onSortChange, empty, className, }: YuktaiGridProps<T>): react_jsx_runtime.JSX.Element;
199
+
244
200
  interface UseGridOptions<T> {
245
201
  data: T[];
246
202
  columns: GridColumn<T>[];
@@ -266,6 +222,7 @@ interface UseGridReturn<T> {
266
222
  }
267
223
  declare function useGrid<T extends Record<string, unknown>>(options: UseGridOptions<T>): UseGridReturn<T>;
268
224
 
225
+ type Language = "en-US" | "te-IN";
269
226
  interface YuktaiGridAIProps<T> {
270
227
  data: T[];
271
228
  columns: {
@@ -276,9 +233,23 @@ interface YuktaiGridAIProps<T> {
276
233
  onSearch: (query: string) => void;
277
234
  onSort?: (key: string, dir: "asc" | "desc") => void;
278
235
  theme?: "light" | "dark";
279
- language?: "en-US" | "en-IN" | "hi-IN" | "te-IN";
236
+ /**
237
+ * Language of AI UI and AI responses.
238
+ * Default: English.
239
+ */
240
+ language?: Language;
241
+ /**
242
+ * Language used by browser voice recognition.
243
+ * Default: English.
244
+ */
245
+ inputLanguage?: Language;
246
+ /**
247
+ * When true, AI is rendered inside the grid.
248
+ * When false, AI uses the floating assistant UI.
249
+ */
250
+ embedded?: boolean;
280
251
  }
281
- declare function YuktaiGridAI<T extends Record<string, unknown>>({ data, columns, onSearch, onSort, theme, language, }: YuktaiGridAIProps<T>): react_jsx_runtime.JSX.Element;
252
+ declare function YuktaiGridAI<T extends Record<string, unknown>>({ data, columns, onSearch, onSort, theme, language, inputLanguage, embedded, }: YuktaiGridAIProps<T>): react_jsx_runtime.JSX.Element;
282
253
 
283
254
  declare global {
284
255
  interface Document {