@yuktishaalaa/yuktai 4.0.0 → 4.1.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/LICENSE +674 -0
- package/dist/index.d.mts +177 -2
- package/dist/index.d.ts +177 -2
- package/dist/index.js +61 -61
- package/dist/index.mjs +28 -28
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
interface Plugin {
|
|
5
5
|
name: string;
|
|
@@ -111,6 +111,181 @@ 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
|
+
|
|
257
|
+
interface IconProps extends React.SVGAttributes<SVGSVGElement> {
|
|
258
|
+
/** Size in pixels — applied to both width and height. Default: 20 */
|
|
259
|
+
size?: number | string;
|
|
260
|
+
/** Stroke color — defaults to currentColor (inherits from parent) */
|
|
261
|
+
color?: string;
|
|
262
|
+
/** Stroke width override — default: 2.5 */
|
|
263
|
+
strokeWidth?: number;
|
|
264
|
+
/** Accessible label — if provided, icon becomes non-decorative */
|
|
265
|
+
label?: string;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Shared base for all yuktai icons.
|
|
269
|
+
* Children should be SVG path/circle/rect elements.
|
|
270
|
+
*/
|
|
271
|
+
declare function IconBase({ size, color, strokeWidth, label, children, ...rest }: IconProps & {
|
|
272
|
+
children: React.ReactNode;
|
|
273
|
+
}): react_jsx_runtime.JSX.Element;
|
|
274
|
+
|
|
275
|
+
declare function SearchIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
276
|
+
|
|
277
|
+
declare function SortUpIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
278
|
+
|
|
279
|
+
declare function SortDownIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
280
|
+
|
|
281
|
+
declare function ChevronLeftIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
282
|
+
|
|
283
|
+
declare function ChevronRightIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
284
|
+
|
|
285
|
+
declare function CheckIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
286
|
+
|
|
287
|
+
declare function CloseIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
288
|
+
|
|
114
289
|
declare global {
|
|
115
290
|
var __yuktai_runtime__: Runtime | undefined;
|
|
116
291
|
}
|
|
@@ -144,4 +319,4 @@ declare const YuktAI: {
|
|
|
144
319
|
scan(): A11yReport;
|
|
145
320
|
};
|
|
146
321
|
|
|
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 };
|
|
322
|
+
export { type A11yConfig, type A11yFix, type A11yReport, type AIFeatures, CheckIcon, ChevronLeftIcon, ChevronRightIcon, CloseIcon, type ColorBlindMode, type FilterConfig, type FilterOperator, type GridColumn, type GridLocale, type GridTheme, type GridTranslations, IconBase, type IconProps, type PaginationConfig, Runtime, SearchIcon, type Severity, type SortConfig, type SortDirection, SortDownIcon, SortUpIcon, 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
interface Plugin {
|
|
5
5
|
name: string;
|
|
@@ -111,6 +111,181 @@ 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
|
+
|
|
257
|
+
interface IconProps extends React.SVGAttributes<SVGSVGElement> {
|
|
258
|
+
/** Size in pixels — applied to both width and height. Default: 20 */
|
|
259
|
+
size?: number | string;
|
|
260
|
+
/** Stroke color — defaults to currentColor (inherits from parent) */
|
|
261
|
+
color?: string;
|
|
262
|
+
/** Stroke width override — default: 2.5 */
|
|
263
|
+
strokeWidth?: number;
|
|
264
|
+
/** Accessible label — if provided, icon becomes non-decorative */
|
|
265
|
+
label?: string;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Shared base for all yuktai icons.
|
|
269
|
+
* Children should be SVG path/circle/rect elements.
|
|
270
|
+
*/
|
|
271
|
+
declare function IconBase({ size, color, strokeWidth, label, children, ...rest }: IconProps & {
|
|
272
|
+
children: React.ReactNode;
|
|
273
|
+
}): react_jsx_runtime.JSX.Element;
|
|
274
|
+
|
|
275
|
+
declare function SearchIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
276
|
+
|
|
277
|
+
declare function SortUpIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
278
|
+
|
|
279
|
+
declare function SortDownIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
280
|
+
|
|
281
|
+
declare function ChevronLeftIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
282
|
+
|
|
283
|
+
declare function ChevronRightIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
284
|
+
|
|
285
|
+
declare function CheckIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
286
|
+
|
|
287
|
+
declare function CloseIcon(props: IconProps): react_jsx_runtime.JSX.Element;
|
|
288
|
+
|
|
114
289
|
declare global {
|
|
115
290
|
var __yuktai_runtime__: Runtime | undefined;
|
|
116
291
|
}
|
|
@@ -144,4 +319,4 @@ declare const YuktAI: {
|
|
|
144
319
|
scan(): A11yReport;
|
|
145
320
|
};
|
|
146
321
|
|
|
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 };
|
|
322
|
+
export { type A11yConfig, type A11yFix, type A11yReport, type AIFeatures, CheckIcon, ChevronLeftIcon, ChevronRightIcon, CloseIcon, type ColorBlindMode, type FilterConfig, type FilterOperator, type GridColumn, type GridLocale, type GridTheme, type GridTranslations, IconBase, type IconProps, type PaginationConfig, Runtime, SearchIcon, type Severity, type SortConfig, type SortDirection, SortDownIcon, SortUpIcon, type ViewMode, type VoiceFeatures, YuktAI, YuktAIWrapper, type YuktAIWrapperProps, YuktaiGrid, type YuktaiGridProps, aiPlugin, YuktAIWrapper as default, useGrid, voicePlugin, wcagPlugin as wcag, wcagPlugin };
|