@makolabs/ripple 1.8.0 → 1.9.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.
Files changed (51) hide show
  1. package/README.md +16 -0
  2. package/dist/ai/ai-types.d.ts +44 -0
  3. package/dist/ai/ai-types.js +1 -0
  4. package/dist/button/button-types.d.ts +25 -0
  5. package/dist/button/button-types.js +1 -0
  6. package/dist/charts/Chart.svelte +7 -22
  7. package/dist/charts/chart-types.d.ts +137 -0
  8. package/dist/charts/chart-types.js +1 -0
  9. package/dist/drawer/drawer-types.d.ts +33 -0
  10. package/dist/drawer/drawer-types.js +1 -0
  11. package/dist/elements/accordion/accordion-types.d.ts +29 -0
  12. package/dist/elements/accordion/accordion-types.js +1 -0
  13. package/dist/elements/badge/badge-types.d.ts +11 -0
  14. package/dist/elements/badge/badge-types.js +1 -0
  15. package/dist/elements/dropdown/dropdown-types.d.ts +68 -0
  16. package/dist/elements/dropdown/dropdown-types.js +1 -0
  17. package/dist/elements/file-upload/file-upload-types.d.ts +68 -0
  18. package/dist/elements/file-upload/file-upload-types.js +1 -0
  19. package/dist/elements/progress/progress-types.d.ts +22 -0
  20. package/dist/elements/progress/progress-types.js +1 -0
  21. package/dist/elements/timeline/timeline-types.d.ts +11 -0
  22. package/dist/elements/timeline/timeline-types.js +1 -0
  23. package/dist/filters/filter-types.d.ts +24 -0
  24. package/dist/filters/filter-types.js +1 -0
  25. package/dist/forms/Input.svelte +4 -2
  26. package/dist/forms/form-types.d.ts +168 -0
  27. package/dist/forms/form-types.js +1 -0
  28. package/dist/header/header-types.d.ts +43 -0
  29. package/dist/header/header-types.js +1 -0
  30. package/dist/index.d.ts +35 -1105
  31. package/dist/index.js +37 -14
  32. package/dist/layout/activity-list/activity-list-types.d.ts +30 -0
  33. package/dist/layout/activity-list/activity-list-types.js +1 -0
  34. package/dist/layout/card/card-types.d.ts +43 -0
  35. package/dist/layout/card/card-types.js +1 -0
  36. package/dist/layout/card/metric-card.d.ts +3 -3
  37. package/dist/layout/navbar/navbar-types.d.ts +19 -0
  38. package/dist/layout/navbar/navbar-types.js +1 -0
  39. package/dist/layout/sidebar/Sidebar.svelte +10 -1
  40. package/dist/layout/sidebar/sidebar-types.d.ts +63 -0
  41. package/dist/layout/sidebar/sidebar-types.js +1 -0
  42. package/dist/layout/table/table-types.d.ts +82 -0
  43. package/dist/layout/table/table-types.js +1 -0
  44. package/dist/layout/tabs/tabs-types.d.ts +43 -0
  45. package/dist/layout/tabs/tabs-types.js +1 -0
  46. package/dist/modal/modal-types.d.ts +34 -0
  47. package/dist/modal/modal-types.js +1 -0
  48. package/dist/types/echarts.d.ts +27 -0
  49. package/dist/user-management/user-management-types.d.ts +156 -0
  50. package/dist/user-management/user-management-types.js +1 -0
  51. package/package.json +1 -2
package/dist/index.d.ts CHANGED
@@ -15,404 +15,29 @@ export type VariantColors = (typeof Color)[keyof typeof Color];
15
15
  */
16
16
  export { Color, Size, ChartColor };
17
17
  export { buildTestId } from './helper/testid.js';
18
- import type { ClassValue } from 'tailwind-variants';
19
18
  export type { ClassValue } from 'tailwind-variants';
20
- import type { Snippet } from 'svelte';
21
- import type { Component } from 'svelte';
22
- import type { HTMLButtonAttributes, HTMLAttributeAnchorTarget, DOMAttributes } from 'svelte/elements';
23
- import type { ECharts } from 'echarts/types/src/export/core.js';
24
- import type { SuperForm } from 'sveltekit-superforms';
25
- import type { FileAction, StorageAdapter } from './adapters/storage/types.js';
26
- export type BadgeProps = {
27
- size?: VariantSizes;
28
- color?: VariantColors;
29
- class?: ClassValue;
30
- children: Snippet;
31
- onclose?: (event: MouseEvent) => void;
32
- testId?: string;
33
- };
34
- export type BaseButtonProps = {
35
- class?: ClassValue;
36
- variant?: 'solid' | 'outline' | 'ghost' | 'link';
37
- color?: VariantColors;
38
- size?: VariantSizes;
39
- rounded?: 'none' | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | 'full';
40
- disabled?: boolean | undefined | null;
41
- isLoading?: boolean;
42
- children?: Snippet;
43
- testId?: string;
44
- };
45
- export type ButtonHTMLProps = {
46
- href?: never;
47
- } & HTMLButtonAttributes;
48
- export type AnchorHTMLProps = {
49
- rel?: string | undefined | null;
50
- target?: HTMLAttributeAnchorTarget | undefined | null;
51
- referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url' | undefined | null;
52
- href: string;
53
- } & Record<string, unknown>;
54
- export type ButtonProps = BaseButtonProps & (ButtonHTMLProps | AnchorHTMLProps);
55
- export type ModalProps = {
56
- open?: boolean;
57
- onclose?: () => void;
58
- title?: string;
59
- description?: string;
60
- size?: VariantSizes;
61
- hideCloseButton?: boolean;
62
- class?: ClassValue;
63
- /** @deprecated Use contentClass instead */
64
- contentclass?: ClassValue;
65
- contentClass?: ClassValue;
66
- /** @deprecated Use bodyClass instead */
67
- bodyclass?: ClassValue;
68
- bodyClass?: ClassValue;
69
- /** @deprecated Use titleClass instead */
70
- titleclass?: ClassValue;
71
- titleClass?: ClassValue;
72
- /** @deprecated Use headerClass instead */
73
- headerclass?: ClassValue;
74
- headerClass?: ClassValue;
75
- /** @deprecated Use backdropClass instead */
76
- backdropclass?: ClassValue;
77
- backdropClass?: ClassValue;
78
- /** @deprecated Use footerClass instead */
79
- footerclass?: ClassValue;
80
- footerClass?: ClassValue;
81
- children?: Snippet;
82
- footer?: Snippet;
83
- header?: Snippet;
84
- testId?: string;
85
- };
86
- export type DrawerProps = {
87
- open?: boolean;
88
- onclose?: () => void;
89
- title?: string;
90
- position?: 'left' | 'right';
91
- size?: VariantSizes;
92
- class?: ClassValue;
93
- /** @deprecated Use backdropClass instead */
94
- backdropclass?: ClassValue;
95
- backdropClass?: ClassValue;
96
- /** @deprecated Use contentClass instead */
97
- contentclass?: ClassValue;
98
- contentClass?: ClassValue;
99
- /** @deprecated Use headerClass instead */
100
- headerclass?: ClassValue;
101
- headerClass?: ClassValue;
102
- /** @deprecated Use bodyClass instead */
103
- bodyclass?: ClassValue;
104
- bodyClass?: ClassValue;
105
- /** @deprecated Use titleClass instead */
106
- titleclass?: ClassValue;
107
- titleClass?: ClassValue;
108
- /** @deprecated Use footerClass instead */
109
- footerclass?: ClassValue;
110
- footerClass?: ClassValue;
111
- children?: Snippet;
112
- header?: Snippet;
113
- footer?: Snippet;
114
- testId?: string;
115
- };
116
- export type DropdownItem = {
117
- label: string;
118
- href?: `/${string}`;
119
- icon?: Component;
120
- onclick?: () => void;
121
- active?: boolean;
122
- };
123
- export type DropSection = {
124
- items: DropdownItem[];
125
- };
126
- export type DropHeaderConfig = {
127
- title?: string;
128
- subtitle?: string;
129
- content?: Snippet<[]>;
130
- class?: ClassValue;
131
- titleClass?: ClassValue;
132
- subtitleClass?: ClassValue;
133
- onclick?: () => void;
134
- };
135
- export type DropdownMenuProps = {
136
- open?: boolean;
137
- sections: DropSection[];
138
- label?: string;
139
- icon?: Component;
140
- containerClass?: ClassValue;
141
- itemClass?: ClassValue;
142
- class?: ClassValue;
143
- size?: VariantSizes;
144
- disabled?: boolean;
145
- position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
146
- width?: string;
147
- header?: DropHeaderConfig;
148
- testId?: string;
149
- };
150
- export type SelectItem = {
151
- label: string;
152
- value: string;
153
- disabled?: boolean;
154
- icon?: Component;
155
- };
156
- export type SelectProps = {
157
- items: SelectItem[];
158
- value?: string | string[];
159
- multiple?: boolean;
160
- placeholder?: string;
161
- searchable?: boolean;
162
- disabled?: boolean;
163
- size?: VariantSizes;
164
- class?: ClassValue;
165
- containerClass?: ClassValue;
166
- listClass?: ClassValue;
167
- itemClass?: ClassValue;
168
- triggerClass?: ClassValue;
169
- searchInputClass?: ClassValue;
170
- clearable?: boolean;
171
- icon?: Component;
172
- iconClass?: ClassValue;
173
- onselect?: ({ value }: {
174
- value: string | string[];
175
- }) => void;
176
- onopen?: () => void;
177
- onclose?: () => void;
178
- testId?: string;
179
- };
180
- export type CardProps = {
181
- color?: VariantColors;
182
- title?: string;
183
- class?: ClassValue;
184
- /** @deprecated Use titleClass instead */
185
- titleclass?: ClassValue;
186
- titleClass?: ClassValue;
187
- /** @deprecated Use bodyClass instead */
188
- bodyclass?: ClassValue;
189
- bodyClass?: ClassValue;
190
- children?: Snippet;
191
- custom?: Snippet;
192
- testId?: string;
193
- };
194
- export type AlertProps = {
195
- title?: string;
196
- message: string;
197
- color?: VariantColors;
198
- class?: ClassValue;
199
- onclose?: () => void;
200
- footer?: Snippet;
201
- icon?: Component;
202
- testId?: string;
203
- };
204
- export type MetricDetail = {
205
- label: string;
206
- value: string | number;
207
- color?: VariantColors;
208
- };
209
- export type MetricCardProps = {
210
- title: string;
211
- value: string | number;
212
- details?: MetricDetail[];
213
- percent?: number;
214
- segments?: ProgressSegment[];
215
- class?: ClassValue;
216
- testId?: string;
217
- };
19
+ export type { BadgeProps } from './elements/badge/badge-types.js';
20
+ export type { BaseButtonProps, ButtonHTMLProps, AnchorHTMLProps, ButtonProps } from './button/button-types.js';
21
+ export type { ModalProps } from './modal/modal-types.js';
22
+ export type { DrawerProps } from './drawer/drawer-types.js';
23
+ export type { DropdownItem, DropSection, DropHeaderConfig, DropdownMenuProps, SelectItem, SelectProps } from './elements/dropdown/dropdown-types.js';
24
+ export type { CardProps, AlertProps, MetricDetail, MetricCardProps } from './layout/card/card-types.js';
218
25
  export type { RankedCardProps, RankedCardItem, RankedCardMetric } from './layout/card/ranked-card.js';
219
- export type DataRow = Record<string, any>;
220
- export type KeyType = keyof DataRow;
221
- export type StatusType = 'active' | 'inactive' | 'pending' | 'error' | 'default';
222
- export type TableColumn<T extends DataRow = any> = {
223
- key: KeyType;
224
- header: string;
225
- cell?: Snippet<[row: T, key: KeyType, index?: number]>;
226
- sortable?: boolean;
227
- sortKey?: string;
228
- align?: 'left' | 'center' | 'right';
229
- width?: string;
230
- class?: ClassValue;
231
- };
232
- export type SortDirection = 'asc' | 'desc' | null;
233
- export type SortState = {
234
- column: string | null;
235
- direction: SortDirection;
236
- };
237
- export type TableProps<T extends DataRow = any> = {
238
- data: T[];
239
- columns: TableColumn<T>[];
240
- bordered?: boolean;
241
- striped?: boolean;
242
- pageSize?: number;
243
- currentPage?: number;
244
- totalItems?: number;
245
- selectable?: boolean;
246
- selected?: T[];
247
- class?: ClassValue;
248
- /** @deprecated Use wrapperClass instead */
249
- wrapperclass?: ClassValue;
250
- wrapperClass?: ClassValue;
251
- /** @deprecated Use tableClass instead */
252
- tableclass?: ClassValue;
253
- tableClass?: ClassValue;
254
- /** @deprecated Use theadClass instead */
255
- theadclass?: ClassValue;
256
- theadClass?: ClassValue;
257
- /** @deprecated Use tbodyClass instead */
258
- tbodyclass?: ClassValue;
259
- tbodyClass?: ClassValue;
260
- /** @deprecated Use trClass instead */
261
- trclass?: ClassValue;
262
- trClass?: ClassValue;
263
- /** @deprecated Use thClass instead */
264
- thclass?: ClassValue;
265
- thClass?: ClassValue;
266
- /** @deprecated Use tdClass instead */
267
- tdclass?: ClassValue;
268
- tdClass?: ClassValue;
269
- /** @deprecated Use footerClass instead */
270
- footerclass?: ClassValue;
271
- footerClass?: ClassValue;
272
- /** @deprecated Use paginationClass instead */
273
- paginationclass?: ClassValue;
274
- paginationClass?: ClassValue;
275
- onrowclick?: (row: T, index: number) => void;
276
- onsort?: (sortState: SortState) => void;
277
- onselect?: (selected: T[]) => void;
278
- onpagechange?: (page: number) => void;
279
- /** @deprecated Use rowClass instead */
280
- rowclass?: (row: T, index: number) => ClassValue;
281
- rowClass?: (row: T, index: number) => ClassValue;
282
- loading?: boolean;
283
- expandedContent?: Snippet<[T]>;
284
- pagination?: boolean;
285
- showPagination?: boolean;
286
- showPageSize?: boolean;
287
- pageSizeOptions?: number[];
288
- onpagesizechange?: (pageSize: number) => void;
289
- paginationPosition?: 'top' | 'bottom' | 'both';
290
- paginationTemplate?: 'simple' | 'full';
291
- title?: string;
292
- subtitle?: string;
293
- headerActions?: Snippet;
294
- selectAllScope?: 'page' | 'all';
295
- rowKey?: string;
296
- expandable?: boolean;
297
- testId?: string;
298
- };
299
- export type BreadcrumbItem = {
300
- label: string;
301
- href: string;
302
- current?: boolean;
303
- icon?: Component;
304
- };
305
- export type BreadcrumbsProps = {
306
- items: BreadcrumbItem[];
307
- size?: 'xs' | 'sm' | 'base' | 'lg';
308
- weight?: 'normal' | 'medium' | 'semibold' | 'bold';
309
- color?: VariantColors;
310
- icon?: Component;
311
- class?: ClassValue;
312
- /** @deprecated Use listClass instead */
313
- listclass?: ClassValue;
314
- listClass?: ClassValue;
315
- /** @deprecated Use itemClass instead */
316
- itemclass?: ClassValue;
317
- itemClass?: ClassValue;
318
- /** @deprecated Use separatorClass instead */
319
- separatorclass?: ClassValue;
320
- separatorClass?: ClassValue;
321
- /** @deprecated Use wrapperClass instead */
322
- wrapperclass?: ClassValue;
323
- wrapperClass?: ClassValue;
324
- testId?: string;
325
- };
326
- export type PageHeaderProps = {
327
- title: string;
328
- subtitle?: string;
329
- breadcrumbs?: BreadcrumbItem[];
330
- children?: Snippet;
331
- class?: ClassValue;
332
- /** @deprecated Use titleClass instead */
333
- titleclass?: ClassValue;
334
- titleClass?: ClassValue;
335
- layout?: 'vertical' | 'horizontal';
336
- testId?: string;
337
- };
338
- export type TabItem = {
339
- value: string;
340
- label: string;
341
- icon?: Component;
342
- disabled?: boolean;
343
- };
344
- export type NavbarLinkItem = {
345
- label: string;
346
- href: string;
347
- icon?: Component;
348
- active?: boolean;
349
- children?: NavbarLinkItem[];
350
- };
351
- export type NavbarProps = {
352
- logo?: string | Component;
353
- links?: NavbarLinkItem[];
354
- class?: ClassValue;
355
- brand?: Snippet;
356
- children?: Snippet;
357
- actions?: Snippet;
358
- testId?: string;
359
- };
360
- export type MenuBar = {
361
- collapsed: boolean;
362
- };
363
- export interface BaseNavigationItem {
364
- label: string;
365
- }
366
- export interface WithIcon {
367
- Icon?: Component;
368
- }
369
- export interface Activatable {
370
- active?: boolean;
371
- }
372
- export interface LinkItem extends BaseNavigationItem, WithIcon, Activatable {
373
- href: string;
374
- meta?: string;
375
- /**
376
- * When true, the link will be active if the current route starts with this href.
377
- * Example: href="/tushar" will be active for "/tushar/overview" and "/tushar/profile"
378
- * @default false
379
- */
380
- matchPartial?: boolean;
381
- }
382
- export interface ParentItem extends BaseNavigationItem, Activatable {
383
- children: LinkItem[];
384
- }
385
- export interface DividerItem {
386
- type: 'horizontal-divider';
387
- }
388
- export type NavigationItem = LinkItem | ParentItem | DividerItem;
389
- export type LogoType = {
390
- src?: string;
391
- title: string;
392
- };
393
- export interface NavGroupProps {
394
- labelArea: Snippet<[string, string]>;
395
- active?: boolean;
396
- children?: Snippet;
397
- class?: ClassValue;
398
- testId?: string;
399
- }
400
- export interface NavItemProps {
401
- href: string;
402
- active?: boolean;
403
- children: Snippet<[ClassValue]>;
404
- class?: ClassValue;
405
- testId?: string;
406
- }
407
- export interface SidebarProps {
408
- items?: NavigationItem[];
409
- logo: LogoType;
410
- /** Optional footer snippet rendered at the bottom of the sidebar */
411
- footer?: Snippet<[{
412
- collapsed: boolean;
413
- }]>;
414
- testId?: string;
415
- }
26
+ export type { DataRow, KeyType, StatusType, TableColumn, SortDirection, SortState, TableProps } from './layout/table/table-types.js';
27
+ export type { BreadcrumbItem, BreadcrumbsProps, PageHeaderProps } from './header/header-types.js';
28
+ export type { TabItem, TabProps, TabsGroupProps, TabContentProps } from './layout/tabs/tabs-types.js';
29
+ export type { NavbarLinkItem, NavbarProps } from './layout/navbar/navbar-types.js';
30
+ export type { MenuBar, BaseNavigationItem, WithIcon, Activatable, LinkItem, ParentItem, DividerItem, NavigationItem, LogoType, NavGroupProps, NavItemProps, SidebarProps } from './layout/sidebar/sidebar-types.js';
31
+ export type { ChartColorKey, ChartColorValue, ChartColors, ChartType, ChartColorString, XAxisConfig, YAxisConfig, SeriesConfig, GridConfig, LegendConfig, TooltipConfig, ToolboxConfig, ChartConfig, PointClickType, ChartRenderType, ChartProps } from './charts/chart-types.js';
32
+ export type { FormProps, InputProps, RadioOption, RadioInputsProps, CheckboxProps, ToggleProps, CurrencyOption, NumberInputProps, DateRangeProps, DateSelectEvent, TagsProps, SliderMode, NotationType, EnumOption, SliderProps, RadioPillProps } from './forms/form-types.js';
33
+ export type { ProgressSegment, ProgressProps } from './elements/progress/progress-types.js';
34
+ export type { AccordionProps } from './elements/accordion/accordion-types.js';
35
+ export type { TimelineItem } from './elements/timeline/timeline-types.js';
36
+ export type { FilterTab, FilterGroup, CompactFiltersProps } from './filters/filter-types.js';
37
+ export type { ActivityItemBadge, ActivityItemAction, ActivityItem, ActivityListProps } from './layout/activity-list/activity-list-types.js';
38
+ export type { FileUploadProps, FilePreviewProps, UploadedFile } from './elements/file-upload/file-upload-types.js';
39
+ export type { ChatMessageType, StreamingCallback, ChatAction, ChatMessage, ChatResponse, QuickAction, FileBrowserProps } from './ai/ai-types.js';
40
+ export type { GetUsersOptions, GetUsersResult, UserEmail, UserPhone, User, Permission, Role, UserTableProps, UserModalProps, UserViewModalProps, UserManagementAdapter, UserManagementProps, FormErrors } from './user-management/user-management-types.js';
416
41
  export { tv, cn } from './helper/cls.js';
417
42
  export { isRouteActive } from './helper/nav.svelte.js';
418
43
  export { default as Button } from './button/Button.svelte';
@@ -431,39 +56,6 @@ export { default as RankedCard } from './layout/card/RankedCard.svelte';
431
56
  export { default as Alert } from './elements/alert/Alert.svelte';
432
57
  export { default as Pagination } from './elements/pagination/Pagination.svelte';
433
58
  export type { PaginationProps } from './elements/pagination/Pagination.svelte';
434
- export type TabProps = {
435
- value: string;
436
- label: string;
437
- icon?: Component;
438
- selected?: boolean;
439
- disabled?: boolean;
440
- color?: VariantColors;
441
- size?: VariantSizes;
442
- variant?: 'line' | 'pill';
443
- onclick?: (event: Event) => void;
444
- testId?: string;
445
- };
446
- export type TabsGroupProps = {
447
- tabs: TabItem[];
448
- selected?: string;
449
- color?: VariantColors;
450
- size?: VariantSizes;
451
- variant?: 'line' | 'pill';
452
- class?: ClassValue;
453
- listClass?: ClassValue;
454
- triggerClass?: ClassValue;
455
- panelClass?: ClassValue;
456
- children?: Snippet<[active: string]>;
457
- onchange?: (value: string) => void;
458
- testId?: string;
459
- };
460
- export type TabContentProps = {
461
- value: string;
462
- persisted?: boolean;
463
- panelClass?: ClassValue;
464
- children?: Snippet<[value: string]>;
465
- testId?: string;
466
- };
467
59
  export { default as Tab } from './layout/tabs/Tab.svelte';
468
60
  export { default as TabContent } from './layout/tabs/TabContent.svelte';
469
61
  export { default as TabGroup } from './layout/tabs/TabGroup.svelte';
@@ -474,217 +66,10 @@ export { default as Sidebar } from './layout/sidebar/Sidebar.svelte';
474
66
  export { default as NavItem } from './layout/sidebar/NavItem.svelte';
475
67
  export { default as NavGroup } from './layout/sidebar/NavGroup.svelte';
476
68
  export { default as ActivityList } from './layout/activity-list/ActivityList.svelte';
477
- export { dropdownMenu } from './elements/dropdown/dropdown.js';
478
- export { badge } from './elements/badge/badge.js';
479
- export { buttonVariants } from './button/button.js';
480
- export { modal } from './modal/modal.js';
481
- export { drawer } from './drawer/drawer.js';
482
- export { selectTV } from './elements/dropdown/select.js';
483
- export { breadcrumbs } from './header/breadcrumbs.js';
484
- export { metricCard } from './layout/card/metric-card.js';
485
- export { rankedCard } from './layout/card/ranked-card.js';
486
- export { activityList } from './layout/activity-list/activity-list.js';
487
- export type ChartColorKey = keyof typeof ChartColor;
488
- export type ChartColorValue = (typeof ChartColor)[ChartColorKey];
489
- export type ChartColors = {
490
- [K in ChartColorValue]: string;
491
- };
492
- export type ChartType = 'line' | 'bar' | 'horizontal-bar' | 'pie' | 'stacked-bar';
493
- export type ChartColorString = `#${string}` | keyof ChartColors;
494
- export type XAxisConfig<T> = {
495
- dataKey: keyof T;
496
- label?: string;
497
- format?: (value: any) => string;
498
- tick?: {
499
- fontSize?: number;
500
- rotate?: number;
501
- interval?: number | 'auto' | Function;
502
- };
503
- axisLine?: {
504
- show?: boolean;
505
- lineStyle?: {
506
- color?: string;
507
- width?: number;
508
- type?: 'solid' | 'dashed' | 'dotted';
509
- };
510
- };
511
- };
512
- export type YAxisConfig<T> = {
513
- dataKey: keyof T;
514
- label?: string;
515
- format?: (value: any) => string;
516
- unit?: string;
517
- position?: 'left' | 'right';
518
- min?: number;
519
- max?: number;
520
- axisLine?: {
521
- show?: boolean;
522
- lineStyle?: {
523
- color?: string;
524
- width?: number;
525
- type?: 'solid' | 'dashed' | 'dotted';
526
- };
527
- };
528
- };
529
- export interface SeriesConfig<T> {
530
- dataKey: keyof T;
531
- name?: string;
532
- type?: ChartType;
533
- color?: ChartColorString;
534
- yAxisIndex?: number;
535
- stack?: string;
536
- barWidth?: string;
537
- showArea?: boolean;
538
- showSymbol?: boolean;
539
- showLabel?: boolean;
540
- smooth?: boolean;
541
- areaOpacity?: number;
542
- lineWidth?: number;
543
- opacity?: number;
544
- lineStyle?: {
545
- type?: 'solid' | 'dashed' | 'dotted';
546
- width?: number;
547
- color?: string;
548
- };
549
- emphasis?: {
550
- focus?: 'series' | 'self' | 'none';
551
- };
552
- radius?: [string, string];
553
- centerText?: string;
554
- }
555
- export interface GridConfig {
556
- horizontal?: boolean;
557
- vertical?: boolean;
558
- containLabel?: boolean;
559
- top?: number | string;
560
- right?: number | string;
561
- bottom?: number | string;
562
- left?: number | string;
563
- }
564
- export interface LegendConfig {
565
- show?: boolean;
566
- position?: 'top' | 'bottom' | 'left' | 'right';
567
- orient?: 'horizontal' | 'vertical';
568
- }
569
- export interface TooltipConfig {
570
- show?: boolean;
571
- trigger?: 'item' | 'axis' | 'none';
572
- formatter?: string | ((params: any) => string);
573
- }
574
- export interface ToolboxConfig {
575
- show?: boolean;
576
- features?: {
577
- saveAsImage?: boolean;
578
- dataView?: boolean;
579
- dataZoom?: boolean;
580
- magicType?: boolean;
581
- restore?: boolean;
582
- };
583
- }
584
- export type ChartConfig<T> = {
585
- xAxis: XAxisConfig<T>;
586
- yAxis: YAxisConfig<T>[];
587
- series: SeriesConfig<T>[];
588
- grid?: GridConfig;
589
- legend?: LegendConfig;
590
- tooltip?: TooltipConfig;
591
- toolbox?: ToolboxConfig;
592
- showAxisLines?: boolean;
593
- };
594
- export interface PointClickType<T> {
595
- detail: {
596
- seriesIndex: number;
597
- dataIndex: number;
598
- seriesName: string;
599
- name: string;
600
- value?: number | string | null;
601
- originalData: T;
602
- };
603
- }
604
- export interface ChartRenderType<T> {
605
- detail: {
606
- chart: ECharts;
607
- options: ChartConfig<T>;
608
- };
609
- }
610
- export interface ChartProps<T> {
611
- data: T[];
612
- config: ChartConfig<T>;
613
- colors?: Partial<ChartColors>;
614
- height?: string;
615
- width?: string;
616
- class?: ClassValue;
617
- onpointclick?: (event: PointClickType<T>) => void;
618
- onchartrender?: (event: ChartRenderType<T>) => void;
619
- testId?: string;
620
- }
69
+ export { default as Progress } from './elements/progress/Progress.svelte';
70
+ export { default as Accordion } from './elements/accordion/Accordion.svelte';
71
+ export { default as Timeline } from './elements/timeline/Timeline.svelte';
621
72
  export { default as Chart } from './charts/Chart.svelte';
622
- export interface FileUploadProps {
623
- /**
624
- * Array of allowed file MIME types or extensions
625
- * @example ['image/jpeg', 'image/png']
626
- */
627
- allowedMimeTypes?: string[];
628
- /**
629
- * Maximum file size in bytes
630
- */
631
- maxSize?: number;
632
- /**
633
- * Maximum number of files that can be uploaded; maxFiles<=0 is disabled, maxFiles=1 is singular, maxFiles>1 is multiple
634
- * @default 10
635
- */
636
- maxFiles?: number;
637
- /**
638
- * CSS class for the component container
639
- */
640
- class?: ClassValue;
641
- /**
642
- * CSS class for the dropzone
643
- */
644
- dropzoneClass?: ClassValue;
645
- /**
646
- * ID for the file input element
647
- * @default 'file-upload'
648
- */
649
- id?: string;
650
- /**
651
- * Callback when files are selected or dropped
652
- */
653
- onfiles?: (files: FileList | File[]) => void;
654
- /**
655
- * Content to display when no files are uploaded
656
- */
657
- uploadContent?: Snippet;
658
- testId?: string;
659
- }
660
- export interface FilePreviewProps {
661
- files: UploadedFile[];
662
- ondelete?: (fileId: string, index: number) => void;
663
- class?: ClassValue;
664
- testId?: string;
665
- }
666
- export interface UploadedFile {
667
- FileID: string;
668
- OriginalFilename: string;
669
- Size: number;
670
- ContentType: string;
671
- MD5Hash: string;
672
- UploadTimestamp: string;
673
- Expiry?: string;
674
- CustomMetadata?: Record<string, string>;
675
- /**
676
- * Current status of the file
677
- */
678
- status: 'uploading' | 'success' | 'error';
679
- /**
680
- * Upload progress (0-100)
681
- */
682
- progress?: number;
683
- /**
684
- * Error message if upload failed
685
- */
686
- error?: string;
687
- }
688
73
  export { default as FileUpload } from './elements/file-upload/FileUpload.svelte';
689
74
  export { default as FilesPreview } from './elements/file-upload/FilesPreview.svelte';
690
75
  export { default as Toaster } from './sonner/sonner.svelte';
@@ -692,129 +77,6 @@ export { default as AIChatInterface } from './ai/AIChatInterface.svelte';
692
77
  export { default as MermaidRenderer } from './ai/MermaidRenderer.svelte';
693
78
  export { default as CodeRenderer } from './ai/CodeRenderer.svelte';
694
79
  export * from './ai/content-detector.js';
695
- export interface FormProps<T extends Record<string, unknown>> {
696
- form: SuperForm<any>;
697
- class?: ClassValue;
698
- method?: 'GET' | 'POST' | 'dialog' | 'get' | 'post' | 'DIALOG' | null | undefined;
699
- action?: string;
700
- enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain' | null | undefined;
701
- autocomplete?: 'on' | 'off';
702
- novalidate?: boolean;
703
- children?: Snippet;
704
- testId?: string;
705
- }
706
- export type InputProps = {
707
- type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'date' | 'textarea';
708
- value?: string | number;
709
- name: string;
710
- label?: string;
711
- placeholder?: string;
712
- required?: boolean;
713
- disabled?: boolean;
714
- class?: ClassValue;
715
- size?: VariantSizes;
716
- id?: string;
717
- errors?: string[];
718
- testId?: string;
719
- } & DOMAttributes<HTMLInputElement>;
720
- export type RadioOption = {
721
- value: string;
722
- label: string;
723
- };
724
- export type RadioInputsProps = {
725
- name: string;
726
- label?: string;
727
- options: RadioOption[];
728
- value?: string;
729
- disabled?: boolean;
730
- class?: ClassValue;
731
- size?: VariantSizes;
732
- color?: VariantColors;
733
- errors?: string[];
734
- required?: boolean;
735
- testId?: string;
736
- };
737
- export type CheckboxProps = {
738
- name: string;
739
- label?: string;
740
- value?: boolean;
741
- disabled?: boolean;
742
- class?: ClassValue;
743
- size?: VariantSizes;
744
- color?: VariantColors;
745
- errors?: string[];
746
- required?: boolean;
747
- testId?: string;
748
- };
749
- export interface ToggleProps {
750
- name: string;
751
- label?: string;
752
- disabled?: boolean;
753
- class?: ClassValue;
754
- value?: boolean;
755
- size?: VariantSizes;
756
- color?: VariantColors;
757
- id?: string;
758
- errors?: string[];
759
- offColor?: string;
760
- onColor?: string;
761
- testId?: string;
762
- }
763
- export type CurrencyOption = {
764
- value: string;
765
- icon?: Component;
766
- };
767
- export type NumberInputProps = {
768
- value?: number;
769
- name?: string;
770
- label?: string;
771
- placeholder?: string;
772
- size?: VariantSizes;
773
- class?: ClassValue;
774
- unit?: string;
775
- units?: CurrencyOption[];
776
- errors?: string[];
777
- disabled?: boolean;
778
- dropdownicon?: Component;
779
- onunitchange?: (prevUnit: string, newUnit: string) => void;
780
- testId?: string;
781
- };
782
- export interface DateRangeProps {
783
- startDate?: Date;
784
- endDate?: Date;
785
- minDate?: Date;
786
- maxDate?: Date;
787
- disabled?: boolean;
788
- class?: ClassValue;
789
- placeholder?: string;
790
- startLabel?: string;
791
- endLabel?: string;
792
- format?: string;
793
- onselect?: ({ startDate, endDate }: {
794
- startDate?: Date;
795
- endDate?: Date;
796
- }) => void;
797
- id?: string;
798
- name?: string;
799
- testId?: string;
800
- }
801
- export interface DateSelectEvent {
802
- startDate: Date | null;
803
- endDate: Date | null;
804
- }
805
- export type TagsProps = {
806
- value?: string[];
807
- name?: string;
808
- label?: string;
809
- errors?: string[];
810
- placeholder?: string;
811
- size?: VariantSizes;
812
- class?: ClassValue;
813
- suggestions?: string[];
814
- onaddtag?: (tag: string) => void;
815
- onremovetag?: (tag: string) => void;
816
- testId?: string;
817
- };
818
80
  export { default as Form } from './forms/Form.svelte';
819
81
  export { default as Input } from './forms/Input.svelte';
820
82
  export { default as RadioInputs } from './forms/RadioInputs.svelte';
@@ -825,353 +87,21 @@ export { default as NumberInput } from './forms/NumberInput.svelte';
825
87
  export { default as DateRange } from './forms/DateRange.svelte';
826
88
  export { default as Tags } from './forms/Tags.svelte';
827
89
  export { default as RadioPill } from './forms/RadioPill.svelte';
828
- export type SliderMode = 'single' | 'range' | 'enum';
829
- export type NotationType = 'standard' | 'compact' | 'scientific' | 'engineering';
830
- export type EnumOption = {
831
- value: string | number;
832
- label: string;
833
- };
834
- export interface SliderProps {
835
- name: string;
836
- label?: string;
837
- mode?: SliderMode;
838
- disabled?: boolean;
839
- size?: VariantSizes;
840
- errors?: string[];
841
- class?: ClassValue;
842
- min?: number;
843
- max?: number;
844
- step?: number;
845
- value?: number | string;
846
- valueStart?: number;
847
- valueEnd?: number;
848
- showValue?: boolean;
849
- valuePrefix?: string;
850
- valueSuffix?: string;
851
- options?: EnumOption[];
852
- formatOptions?: Intl.NumberFormatOptions & {
853
- notation?: NotationType;
854
- };
855
- testId?: string;
856
- }
857
- export type ProgressSegment = {
858
- value: number;
859
- color: VariantColors;
860
- label?: string;
861
- };
862
- export type ProgressProps = {
863
- value: number;
864
- max?: number;
865
- size?: VariantSizes;
866
- color?: VariantColors;
867
- showLabel?: boolean;
868
- labelPosition?: 'top' | 'bottom' | 'right';
869
- segments?: ProgressSegment[];
870
- showLabels?: boolean;
871
- showValues?: boolean;
872
- class?: ClassValue;
873
- labelClass?: ClassValue;
874
- barClass?: ClassValue;
875
- testId?: string;
876
- };
877
- export { default as Progress } from './elements/progress/Progress.svelte';
878
- export type AccordionProps = {
879
- id?: string;
880
- title?: string;
881
- description?: string;
882
- children?: Snippet;
883
- summary?: Snippet;
884
- open?: boolean;
885
- color?: VariantColors;
886
- class?: ClassValue;
887
- /** @deprecated Use titleClass instead */
888
- titleclass?: ClassValue;
889
- titleClass?: ClassValue;
890
- /** @deprecated Use bodyClass instead */
891
- bodyclass?: ClassValue;
892
- bodyClass?: ClassValue;
893
- /** @deprecated Use headerClass instead */
894
- headerclass?: ClassValue;
895
- headerClass?: ClassValue;
896
- icon?: Component;
897
- iconPosition?: 'start' | 'end';
898
- bordered?: boolean;
899
- onexpand?: () => void;
900
- oncollapse?: () => void;
901
- testId?: string;
902
- };
903
- export { default as Accordion } from './elements/accordion/Accordion.svelte';
904
- export interface TimelineItem {
905
- title: string;
906
- time: Date | string;
907
- link?: {
908
- text: string;
909
- url: string;
910
- };
911
- Icon?: Component;
912
- details?: string;
913
- }
914
- export { default as Timeline } from './elements/timeline/Timeline.svelte';
915
- export type RadioPillProps = {
916
- name: string;
917
- options: RadioOption[];
918
- value?: string;
919
- label?: string;
920
- class?: ClassValue;
921
- errors?: string[];
922
- onchange?: (value: string) => void;
923
- testId?: string;
924
- };
925
- export type FilterTab = {
926
- value: string;
927
- label: string;
928
- };
929
- export type FilterGroup = {
930
- key: string;
931
- label: string;
932
- tabs: FilterTab[];
933
- selectedValue: string;
934
- onChange: (value: string) => void;
935
- minWidth?: string;
936
- };
937
- export type CompactFiltersProps = {
938
- filterGroups: FilterGroup[];
939
- isExpanded?: boolean;
940
- title?: string;
941
- class?: ClassValue;
942
- summaryClass?: ClassValue;
943
- expandedClass?: ClassValue;
944
- FilterIcon?: Component;
945
- testId?: string;
946
- };
947
- export type ActivityItemBadge = {
948
- text: string;
949
- class: string;
950
- };
951
- export type ActivityItemAction = {
952
- label: string;
953
- onClick?: () => void;
954
- };
955
- export type ActivityItem = {
956
- title: string;
957
- subtitle?: string;
958
- badges?: ActivityItemBadge[];
959
- actions?: ActivityItemAction[];
960
- };
961
- export type ActivityListProps = {
962
- title?: string;
963
- items?: ActivityItem[];
964
- color?: VariantColors;
965
- class?: ClassValue;
966
- headerClass?: ClassValue;
967
- titleClass?: ClassValue;
968
- contentClass?: ClassValue;
969
- itemClass?: ClassValue;
970
- onItemClick?: (item: ActivityItem, index: number) => void;
971
- children?: Snippet;
972
- testId?: string;
973
- };
90
+ export { dropdownMenu } from './elements/dropdown/dropdown.js';
91
+ export { badge } from './elements/badge/badge.js';
92
+ export { buttonVariants } from './button/button.js';
93
+ export { modal } from './modal/modal.js';
94
+ export { drawer } from './drawer/drawer.js';
95
+ export { selectTV } from './elements/dropdown/select.js';
96
+ export { breadcrumbs } from './header/breadcrumbs.js';
97
+ export { metricCard } from './layout/card/metric-card.js';
98
+ export { rankedCard } from './layout/card/ranked-card.js';
99
+ export { activityList } from './layout/activity-list/activity-list.js';
100
+ export { slider } from './forms/slider.js';
974
101
  export { CompactFilters } from './filters/index.js';
975
102
  export * from './file-browser/index.js';
976
103
  export * from './adapters/storage/index.js';
977
104
  export * from './adapters/ai/index.js';
978
- export type ChatMessageType = 'chat' | 'action' | 'thinking';
979
- export type StreamingCallback = (response: ChatResponse) => void;
980
- export interface ChatAction {
981
- type: string;
982
- data: any;
983
- metadata?: Record<string, any>;
984
- }
985
- export interface ChatMessage {
986
- id: string;
987
- type: ChatMessageType;
988
- content: string;
989
- timestamp: Date;
990
- action?: ChatAction;
991
- thinkingContent?: string;
992
- isThinkingComplete?: boolean;
993
- }
994
- export interface ChatResponse {
995
- type: ChatMessageType;
996
- content: string;
997
- action?: ChatAction;
998
- messageId?: string;
999
- isStreaming?: boolean;
1000
- isStreamEnd?: boolean;
1001
- thinkingContent?: string;
1002
- isThinkingComplete?: boolean;
1003
- }
1004
- export interface QuickAction {
1005
- label: string;
1006
- prompt: string;
1007
- icon?: Component;
1008
- }
1009
- export interface FileBrowserProps {
1010
- adapter: StorageAdapter;
1011
- startPath?: string;
1012
- actions?: FileAction[];
1013
- selectedFiles?: string[];
1014
- infoSection?: (props: {
1015
- selectedFiles: string[];
1016
- navToFileFolder: (fileKey: string) => void;
1017
- }) => any;
1018
- testId?: string;
1019
- }
1020
- export interface GetUsersOptions {
1021
- page: number;
1022
- pageSize: number;
1023
- sortBy?: string;
1024
- sortOrder?: 'asc' | 'desc';
1025
- query?: string;
1026
- }
1027
- export interface GetUsersResult {
1028
- users: User[];
1029
- totalUsers: number;
1030
- }
1031
- export interface UserEmail {
1032
- email_address: string;
1033
- verified?: boolean;
1034
- }
1035
- export interface UserPhone {
1036
- phone_number: string;
1037
- verified?: boolean;
1038
- }
1039
- export interface User {
1040
- id: string;
1041
- first_name?: string;
1042
- last_name?: string;
1043
- username?: string;
1044
- email_addresses?: UserEmail[];
1045
- phone_numbers?: UserPhone[];
1046
- image_url?: string;
1047
- created_at?: number;
1048
- last_sign_in_at?: number;
1049
- private_metadata?: Record<string, unknown>;
1050
- public_metadata?: Record<string, unknown>;
1051
- permissions?: string[];
1052
- role?: string;
1053
- }
1054
- export interface Permission {
1055
- id: string;
1056
- name: string;
1057
- description?: string;
1058
- category?: string;
1059
- }
1060
- export interface Role {
1061
- value: string;
1062
- label: string;
1063
- description?: string;
1064
- permissions: string[];
1065
- }
1066
- export interface UserTableProps {
1067
- users: User[];
1068
- loading?: boolean;
1069
- currentPage?: number;
1070
- pageSize?: number;
1071
- totalUsers?: number;
1072
- onPageChange: (page: number) => void;
1073
- onPageSizeChange: (size: number) => void;
1074
- onSort?: (state: {
1075
- column: string | null;
1076
- direction: 'asc' | 'desc' | null;
1077
- }) => void;
1078
- onView: (user: User) => void;
1079
- onEdit: (user: User) => void;
1080
- onDelete: (userId: string) => void;
1081
- class?: ClassValue;
1082
- testId?: string;
1083
- }
1084
- export interface UserModalProps {
1085
- open?: boolean;
1086
- user?: User | null;
1087
- roles?: Role[];
1088
- adapter?: UserManagementAdapter;
1089
- loadingPermissions?: boolean;
1090
- onSave: (user: User, mode: 'create' | 'edit') => void | Promise<void>;
1091
- onClose?: () => void;
1092
- class?: ClassValue;
1093
- testId?: string;
1094
- }
1095
- export interface UserViewModalProps {
1096
- open?: boolean;
1097
- user: User | null;
1098
- permissions?: Permission[];
1099
- roles?: Role[];
1100
- onEdit?: (user: User) => void;
1101
- onRegenerateApiKey?: (userId: string) => Promise<void>;
1102
- onClose: () => void;
1103
- class?: ClassValue;
1104
- testId?: string;
1105
- }
1106
- /**
1107
- * User Management Adapter Interface
1108
- *
1109
- * Defines the contract for user management adapters.
1110
- * Adapters can be remote function modules (returning RemoteQuery/RemoteCommand)
1111
- * or regular async function modules (returning Promise).
1112
- *
1113
- * Uses PromiseLike to accept both Promise and RemoteQuery/RemoteCommand types.
1114
- */
1115
- export interface UserManagementAdapter {
1116
- getUsers: (options: GetUsersOptions) => PromiseLike<GetUsersResult>;
1117
- createUser: (userData: Partial<User>) => PromiseLike<User>;
1118
- updateUser: (options: {
1119
- userId: string;
1120
- userData: Partial<User>;
1121
- }) => PromiseLike<User>;
1122
- deleteUser: (userId: string) => PromiseLike<void>;
1123
- deleteUsers: (userIds: string[]) => PromiseLike<void>;
1124
- getUserPermissions: (userId: string) => PromiseLike<string[]>;
1125
- updateUserPermissions: (options: {
1126
- userId: string;
1127
- permissions: string[];
1128
- }) => PromiseLike<void>;
1129
- generateApiKey?: (options: {
1130
- userId: string;
1131
- permissions: string[];
1132
- revokeOld?: boolean;
1133
- }) => PromiseLike<{
1134
- success: boolean;
1135
- apiKey: string;
1136
- message: string;
1137
- verificationWarning?: string;
1138
- }>;
1139
- verifyToken?: (options: {
1140
- apiKey: string;
1141
- }) => PromiseLike<{
1142
- valid: boolean;
1143
- scopes?: string[];
1144
- error?: string;
1145
- token?: string;
1146
- }>;
1147
- }
1148
- export interface UserManagementProps {
1149
- /**
1150
- * Adapter module containing remote functions or async functions
1151
- * Should be imported from a .remote.ts file
1152
- * If not provided, uses the default adapter from @makolabs/ripple
1153
- *
1154
- * Example:
1155
- * ```ts
1156
- * import * as adapter from './adapter.remote';
1157
- * <UserManagement adapter={adapter} roles={roles} />
1158
- * ```
1159
- */
1160
- adapter: UserManagementAdapter;
1161
- /**
1162
- * Available roles for user assignment
1163
- */
1164
- roles?: Role[];
1165
- /**
1166
- * Available permissions for display (optional)
1167
- */
1168
- permissions?: Permission[];
1169
- class?: ClassValue;
1170
- testId?: string;
1171
- }
1172
- export interface FormErrors {
1173
- [key: string]: string;
1174
- }
1175
105
  export { getUserDisplayName, getUserInitials } from './user-management/user-management.js';
1176
106
  export { default as UserManagement } from './user-management/UserManagement.svelte';
1177
107
  export { default as UserTable } from './user-management/UserTable.svelte';