@yuktishaalaa/yuktai 3.0.16 → 4.0.1
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/LICENSE +674 -0
- package/dist/index.d.mts +144 -1
- package/dist/index.d.ts +144 -1
- package/dist/index.js +1145 -37
- package/dist/index.mjs +26 -26
- package/dist/zip-generator-D5EXBBNS.mjs +1109 -0
- package/package.json +22 -29
package/dist/index.d.mts
CHANGED
|
@@ -111,6 +111,149 @@ declare const voicePlugin: {
|
|
|
111
111
|
execute(input: string): Promise<string>;
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
+
interface GridColumn<T = Record<string, unknown>> {
|
|
115
|
+
/** Unique key — must match a property in your data */
|
|
116
|
+
key: keyof T & string;
|
|
117
|
+
/** Display label for the header */
|
|
118
|
+
label: string;
|
|
119
|
+
/** Allow sorting on this column (default: true) */
|
|
120
|
+
sortable?: boolean;
|
|
121
|
+
/** Allow filtering on this column (default: true) */
|
|
122
|
+
filterable?: boolean;
|
|
123
|
+
/** Hide this column on mobile (default: false) */
|
|
124
|
+
hiddenOnMobile?: boolean;
|
|
125
|
+
/** Pin this column on tablet view */
|
|
126
|
+
pinned?: boolean;
|
|
127
|
+
/** Column width — number (px) or string (%, fr) */
|
|
128
|
+
width?: number | string;
|
|
129
|
+
/** Custom cell renderer */
|
|
130
|
+
render?: (value: T[keyof T], row: T, index: number) => ReactNode;
|
|
131
|
+
/** Cell alignment */
|
|
132
|
+
align?: "left" | "center" | "right";
|
|
133
|
+
/** Type — affects default formatting and filter UI */
|
|
134
|
+
type?: "text" | "number" | "date" | "boolean" | "badge";
|
|
135
|
+
}
|
|
136
|
+
type SortDirection = "asc" | "desc" | null;
|
|
137
|
+
interface SortConfig {
|
|
138
|
+
key: string;
|
|
139
|
+
direction: SortDirection;
|
|
140
|
+
}
|
|
141
|
+
type FilterOperator = "contains" | "equals" | "startsWith" | "endsWith" | "greaterThan" | "lessThan" | "between";
|
|
142
|
+
interface FilterConfig {
|
|
143
|
+
key: string;
|
|
144
|
+
operator: FilterOperator;
|
|
145
|
+
value: string | number | [number, number];
|
|
146
|
+
}
|
|
147
|
+
type ViewMode = "table" | "card" | "auto";
|
|
148
|
+
type GridTheme = "default" | "high-contrast" | "dark" | "color-blind" | "dyslexia";
|
|
149
|
+
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";
|
|
150
|
+
interface AIFeatures {
|
|
151
|
+
/** Enable AI semantic search */
|
|
152
|
+
search?: boolean;
|
|
153
|
+
/** Enable AI row summary */
|
|
154
|
+
summary?: boolean;
|
|
155
|
+
/** Enable anomaly detection */
|
|
156
|
+
anomaly?: boolean;
|
|
157
|
+
/** Enable suggestions */
|
|
158
|
+
suggest?: boolean;
|
|
159
|
+
}
|
|
160
|
+
interface VoiceFeatures {
|
|
161
|
+
/** Voice commands for search/filter/sort */
|
|
162
|
+
control?: boolean;
|
|
163
|
+
/** Read rows aloud on focus */
|
|
164
|
+
speakOnFocus?: boolean;
|
|
165
|
+
/** Read filtered data summary aloud */
|
|
166
|
+
speakSummary?: boolean;
|
|
167
|
+
/** Voice language (defaults to locale) */
|
|
168
|
+
language?: string;
|
|
169
|
+
}
|
|
170
|
+
interface PaginationConfig {
|
|
171
|
+
pageSize?: number;
|
|
172
|
+
showSizeChanger?: boolean;
|
|
173
|
+
sizeOptions?: number[];
|
|
174
|
+
}
|
|
175
|
+
interface GridTranslations {
|
|
176
|
+
search: string;
|
|
177
|
+
noData: string;
|
|
178
|
+
loading: string;
|
|
179
|
+
rowsSelected: string;
|
|
180
|
+
page: string;
|
|
181
|
+
of: string;
|
|
182
|
+
showing: string;
|
|
183
|
+
to: string;
|
|
184
|
+
results: string;
|
|
185
|
+
sort: string;
|
|
186
|
+
filter: string;
|
|
187
|
+
export: string;
|
|
188
|
+
voice: string;
|
|
189
|
+
ask: string;
|
|
190
|
+
}
|
|
191
|
+
interface YuktaiGridProps<T = Record<string, unknown>> {
|
|
192
|
+
/** The data to display */
|
|
193
|
+
data: T[];
|
|
194
|
+
/** Column definitions */
|
|
195
|
+
columns: GridColumn<T>[];
|
|
196
|
+
/** View mode — "auto" picks based on screen size */
|
|
197
|
+
view?: ViewMode;
|
|
198
|
+
/** Mobile breakpoint in pixels (default: 768) */
|
|
199
|
+
mobileBreakpoint?: number;
|
|
200
|
+
/** WCAG theme (default: "default") */
|
|
201
|
+
theme?: GridTheme;
|
|
202
|
+
/** Locale (default: "en-US") */
|
|
203
|
+
locale?: GridLocale;
|
|
204
|
+
/** AI features */
|
|
205
|
+
ai?: boolean | AIFeatures;
|
|
206
|
+
/** Voice features */
|
|
207
|
+
voice?: boolean | VoiceFeatures;
|
|
208
|
+
/** Pagination */
|
|
209
|
+
pagination?: boolean | PaginationConfig;
|
|
210
|
+
/** Show search bar */
|
|
211
|
+
search?: boolean;
|
|
212
|
+
/** Multi-row selection */
|
|
213
|
+
selectable?: boolean;
|
|
214
|
+
/** Selected row keys */
|
|
215
|
+
selectedKeys?: string[];
|
|
216
|
+
/** Row key field (default: "id") */
|
|
217
|
+
rowKey?: keyof T & string;
|
|
218
|
+
/** Loading state */
|
|
219
|
+
loading?: boolean;
|
|
220
|
+
/** Custom empty state */
|
|
221
|
+
empty?: ReactNode;
|
|
222
|
+
/** Callbacks */
|
|
223
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
224
|
+
onRowClick?: (row: T, index: number) => void;
|
|
225
|
+
onSortChange?: (sort: SortConfig | null) => void;
|
|
226
|
+
/** Custom className */
|
|
227
|
+
className?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
declare function YuktaiGrid<T extends Record<string, unknown>>(props: YuktaiGridProps<T>): react_jsx_runtime.JSX.Element;
|
|
231
|
+
|
|
232
|
+
interface UseGridOptions<T> {
|
|
233
|
+
data: T[];
|
|
234
|
+
columns: GridColumn<T>[];
|
|
235
|
+
pagination?: boolean | PaginationConfig;
|
|
236
|
+
mobileBreakpoint?: number;
|
|
237
|
+
}
|
|
238
|
+
interface UseGridReturn<T> {
|
|
239
|
+
displayedData: T[];
|
|
240
|
+
totalCount: number;
|
|
241
|
+
filteredCount: number;
|
|
242
|
+
sort: SortConfig | null;
|
|
243
|
+
toggleSort: (key: string) => void;
|
|
244
|
+
clearSort: () => void;
|
|
245
|
+
searchQuery: string;
|
|
246
|
+
setSearchQuery: (q: string) => void;
|
|
247
|
+
page: number;
|
|
248
|
+
pageSize: number;
|
|
249
|
+
totalPages: number;
|
|
250
|
+
setPage: (p: number) => void;
|
|
251
|
+
setPageSize: (s: number) => void;
|
|
252
|
+
isMobile: boolean;
|
|
253
|
+
reset: () => void;
|
|
254
|
+
}
|
|
255
|
+
declare function useGrid<T extends Record<string, unknown>>(options: UseGridOptions<T>): UseGridReturn<T>;
|
|
256
|
+
|
|
114
257
|
declare global {
|
|
115
258
|
var __yuktai_runtime__: Runtime | undefined;
|
|
116
259
|
}
|
|
@@ -144,4 +287,4 @@ declare const YuktAI: {
|
|
|
144
287
|
scan(): A11yReport;
|
|
145
288
|
};
|
|
146
289
|
|
|
147
|
-
export { type A11yConfig, type A11yFix, type A11yReport, type ColorBlindMode, Runtime, type Severity, YuktAI, YuktAIWrapper, type YuktAIWrapperProps, aiPlugin, YuktAIWrapper as default, voicePlugin, wcagPlugin as wcag, wcagPlugin };
|
|
290
|
+
export { type A11yConfig, type A11yFix, type A11yReport, type AIFeatures, type ColorBlindMode, type FilterConfig, type FilterOperator, type GridColumn, type GridLocale, type GridTheme, type GridTranslations, type PaginationConfig, Runtime, type Severity, type SortConfig, type SortDirection, type ViewMode, type VoiceFeatures, YuktAI, YuktAIWrapper, type YuktAIWrapperProps, YuktaiGrid, type YuktaiGridProps, aiPlugin, YuktAIWrapper as default, useGrid, voicePlugin, wcagPlugin as wcag, wcagPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -111,6 +111,149 @@ declare const voicePlugin: {
|
|
|
111
111
|
execute(input: string): Promise<string>;
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
+
interface GridColumn<T = Record<string, unknown>> {
|
|
115
|
+
/** Unique key — must match a property in your data */
|
|
116
|
+
key: keyof T & string;
|
|
117
|
+
/** Display label for the header */
|
|
118
|
+
label: string;
|
|
119
|
+
/** Allow sorting on this column (default: true) */
|
|
120
|
+
sortable?: boolean;
|
|
121
|
+
/** Allow filtering on this column (default: true) */
|
|
122
|
+
filterable?: boolean;
|
|
123
|
+
/** Hide this column on mobile (default: false) */
|
|
124
|
+
hiddenOnMobile?: boolean;
|
|
125
|
+
/** Pin this column on tablet view */
|
|
126
|
+
pinned?: boolean;
|
|
127
|
+
/** Column width — number (px) or string (%, fr) */
|
|
128
|
+
width?: number | string;
|
|
129
|
+
/** Custom cell renderer */
|
|
130
|
+
render?: (value: T[keyof T], row: T, index: number) => ReactNode;
|
|
131
|
+
/** Cell alignment */
|
|
132
|
+
align?: "left" | "center" | "right";
|
|
133
|
+
/** Type — affects default formatting and filter UI */
|
|
134
|
+
type?: "text" | "number" | "date" | "boolean" | "badge";
|
|
135
|
+
}
|
|
136
|
+
type SortDirection = "asc" | "desc" | null;
|
|
137
|
+
interface SortConfig {
|
|
138
|
+
key: string;
|
|
139
|
+
direction: SortDirection;
|
|
140
|
+
}
|
|
141
|
+
type FilterOperator = "contains" | "equals" | "startsWith" | "endsWith" | "greaterThan" | "lessThan" | "between";
|
|
142
|
+
interface FilterConfig {
|
|
143
|
+
key: string;
|
|
144
|
+
operator: FilterOperator;
|
|
145
|
+
value: string | number | [number, number];
|
|
146
|
+
}
|
|
147
|
+
type ViewMode = "table" | "card" | "auto";
|
|
148
|
+
type GridTheme = "default" | "high-contrast" | "dark" | "color-blind" | "dyslexia";
|
|
149
|
+
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";
|
|
150
|
+
interface AIFeatures {
|
|
151
|
+
/** Enable AI semantic search */
|
|
152
|
+
search?: boolean;
|
|
153
|
+
/** Enable AI row summary */
|
|
154
|
+
summary?: boolean;
|
|
155
|
+
/** Enable anomaly detection */
|
|
156
|
+
anomaly?: boolean;
|
|
157
|
+
/** Enable suggestions */
|
|
158
|
+
suggest?: boolean;
|
|
159
|
+
}
|
|
160
|
+
interface VoiceFeatures {
|
|
161
|
+
/** Voice commands for search/filter/sort */
|
|
162
|
+
control?: boolean;
|
|
163
|
+
/** Read rows aloud on focus */
|
|
164
|
+
speakOnFocus?: boolean;
|
|
165
|
+
/** Read filtered data summary aloud */
|
|
166
|
+
speakSummary?: boolean;
|
|
167
|
+
/** Voice language (defaults to locale) */
|
|
168
|
+
language?: string;
|
|
169
|
+
}
|
|
170
|
+
interface PaginationConfig {
|
|
171
|
+
pageSize?: number;
|
|
172
|
+
showSizeChanger?: boolean;
|
|
173
|
+
sizeOptions?: number[];
|
|
174
|
+
}
|
|
175
|
+
interface GridTranslations {
|
|
176
|
+
search: string;
|
|
177
|
+
noData: string;
|
|
178
|
+
loading: string;
|
|
179
|
+
rowsSelected: string;
|
|
180
|
+
page: string;
|
|
181
|
+
of: string;
|
|
182
|
+
showing: string;
|
|
183
|
+
to: string;
|
|
184
|
+
results: string;
|
|
185
|
+
sort: string;
|
|
186
|
+
filter: string;
|
|
187
|
+
export: string;
|
|
188
|
+
voice: string;
|
|
189
|
+
ask: string;
|
|
190
|
+
}
|
|
191
|
+
interface YuktaiGridProps<T = Record<string, unknown>> {
|
|
192
|
+
/** The data to display */
|
|
193
|
+
data: T[];
|
|
194
|
+
/** Column definitions */
|
|
195
|
+
columns: GridColumn<T>[];
|
|
196
|
+
/** View mode — "auto" picks based on screen size */
|
|
197
|
+
view?: ViewMode;
|
|
198
|
+
/** Mobile breakpoint in pixels (default: 768) */
|
|
199
|
+
mobileBreakpoint?: number;
|
|
200
|
+
/** WCAG theme (default: "default") */
|
|
201
|
+
theme?: GridTheme;
|
|
202
|
+
/** Locale (default: "en-US") */
|
|
203
|
+
locale?: GridLocale;
|
|
204
|
+
/** AI features */
|
|
205
|
+
ai?: boolean | AIFeatures;
|
|
206
|
+
/** Voice features */
|
|
207
|
+
voice?: boolean | VoiceFeatures;
|
|
208
|
+
/** Pagination */
|
|
209
|
+
pagination?: boolean | PaginationConfig;
|
|
210
|
+
/** Show search bar */
|
|
211
|
+
search?: boolean;
|
|
212
|
+
/** Multi-row selection */
|
|
213
|
+
selectable?: boolean;
|
|
214
|
+
/** Selected row keys */
|
|
215
|
+
selectedKeys?: string[];
|
|
216
|
+
/** Row key field (default: "id") */
|
|
217
|
+
rowKey?: keyof T & string;
|
|
218
|
+
/** Loading state */
|
|
219
|
+
loading?: boolean;
|
|
220
|
+
/** Custom empty state */
|
|
221
|
+
empty?: ReactNode;
|
|
222
|
+
/** Callbacks */
|
|
223
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
224
|
+
onRowClick?: (row: T, index: number) => void;
|
|
225
|
+
onSortChange?: (sort: SortConfig | null) => void;
|
|
226
|
+
/** Custom className */
|
|
227
|
+
className?: string;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
declare function YuktaiGrid<T extends Record<string, unknown>>(props: YuktaiGridProps<T>): react_jsx_runtime.JSX.Element;
|
|
231
|
+
|
|
232
|
+
interface UseGridOptions<T> {
|
|
233
|
+
data: T[];
|
|
234
|
+
columns: GridColumn<T>[];
|
|
235
|
+
pagination?: boolean | PaginationConfig;
|
|
236
|
+
mobileBreakpoint?: number;
|
|
237
|
+
}
|
|
238
|
+
interface UseGridReturn<T> {
|
|
239
|
+
displayedData: T[];
|
|
240
|
+
totalCount: number;
|
|
241
|
+
filteredCount: number;
|
|
242
|
+
sort: SortConfig | null;
|
|
243
|
+
toggleSort: (key: string) => void;
|
|
244
|
+
clearSort: () => void;
|
|
245
|
+
searchQuery: string;
|
|
246
|
+
setSearchQuery: (q: string) => void;
|
|
247
|
+
page: number;
|
|
248
|
+
pageSize: number;
|
|
249
|
+
totalPages: number;
|
|
250
|
+
setPage: (p: number) => void;
|
|
251
|
+
setPageSize: (s: number) => void;
|
|
252
|
+
isMobile: boolean;
|
|
253
|
+
reset: () => void;
|
|
254
|
+
}
|
|
255
|
+
declare function useGrid<T extends Record<string, unknown>>(options: UseGridOptions<T>): UseGridReturn<T>;
|
|
256
|
+
|
|
114
257
|
declare global {
|
|
115
258
|
var __yuktai_runtime__: Runtime | undefined;
|
|
116
259
|
}
|
|
@@ -144,4 +287,4 @@ declare const YuktAI: {
|
|
|
144
287
|
scan(): A11yReport;
|
|
145
288
|
};
|
|
146
289
|
|
|
147
|
-
export { type A11yConfig, type A11yFix, type A11yReport, type ColorBlindMode, Runtime, type Severity, YuktAI, YuktAIWrapper, type YuktAIWrapperProps, aiPlugin, YuktAIWrapper as default, voicePlugin, wcagPlugin as wcag, wcagPlugin };
|
|
290
|
+
export { type A11yConfig, type A11yFix, type A11yReport, type AIFeatures, type ColorBlindMode, type FilterConfig, type FilterOperator, type GridColumn, type GridLocale, type GridTheme, type GridTranslations, type PaginationConfig, Runtime, type Severity, type SortConfig, type SortDirection, type ViewMode, type VoiceFeatures, YuktAI, YuktAIWrapper, type YuktAIWrapperProps, YuktaiGrid, type YuktaiGridProps, aiPlugin, YuktAIWrapper as default, useGrid, voicePlugin, wcagPlugin as wcag, wcagPlugin };
|