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