@makolabs/ripple 0.0.1-dev.9 → 0.0.3

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 (78) hide show
  1. package/README.md +1 -1
  2. package/dist/adapters/storage/BaseAdapter.d.ts +20 -0
  3. package/dist/adapters/storage/BaseAdapter.js +171 -0
  4. package/dist/adapters/storage/S3Adapter.d.ts +21 -0
  5. package/dist/adapters/storage/S3Adapter.js +194 -0
  6. package/dist/adapters/storage/index.d.ts +3 -0
  7. package/dist/adapters/storage/index.js +3 -0
  8. package/dist/adapters/storage/types.d.ts +102 -0
  9. package/dist/adapters/storage/types.js +4 -0
  10. package/dist/charts/Chart.svelte +59 -47
  11. package/dist/charts/Chart.svelte.d.ts +1 -1
  12. package/dist/drawer/drawer.js +3 -3
  13. package/dist/elements/accordion/Accordion.svelte +98 -0
  14. package/dist/elements/accordion/Accordion.svelte.d.ts +4 -0
  15. package/dist/elements/accordion/accordion.d.ts +227 -0
  16. package/dist/elements/accordion/accordion.js +138 -0
  17. package/dist/elements/alert/Alert.svelte +7 -3
  18. package/dist/elements/dropdown/Dropdown.svelte +74 -107
  19. package/dist/elements/dropdown/Select.svelte +81 -62
  20. package/dist/elements/dropdown/dropdown.js +1 -1
  21. package/dist/elements/dropdown/select.js +8 -8
  22. package/dist/elements/file-upload/FileUpload.svelte +17 -95
  23. package/dist/elements/file-upload/FilesPreview.svelte +93 -0
  24. package/dist/elements/file-upload/FilesPreview.svelte.d.ts +4 -0
  25. package/dist/elements/progress/Progress.svelte +83 -25
  26. package/dist/file-browser/FileBrowser.svelte +877 -0
  27. package/dist/file-browser/FileBrowser.svelte.d.ts +14 -0
  28. package/dist/file-browser/index.d.ts +1 -0
  29. package/dist/file-browser/index.js +1 -0
  30. package/dist/filters/CompactFilters.svelte +147 -0
  31. package/dist/filters/CompactFilters.svelte.d.ts +4 -0
  32. package/dist/filters/index.d.ts +1 -0
  33. package/dist/filters/index.js +1 -0
  34. package/dist/forms/Checkbox.svelte +2 -2
  35. package/dist/forms/DateRange.svelte +21 -21
  36. package/dist/forms/Input.svelte +3 -3
  37. package/dist/forms/NumberInput.svelte +1 -1
  38. package/dist/forms/RadioInputs.svelte +3 -3
  39. package/dist/forms/Tags.svelte +5 -5
  40. package/dist/forms/Toggle.svelte +3 -3
  41. package/dist/forms/slider.js +4 -4
  42. package/dist/header/PageHeader.svelte +49 -11
  43. package/dist/index.d.ts +256 -143
  44. package/dist/index.js +19 -2
  45. package/dist/layout/card/MetricCard.svelte +64 -0
  46. package/dist/layout/card/MetricCard.svelte.d.ts +4 -0
  47. package/dist/layout/card/StatsCard.svelte +4 -3
  48. package/dist/layout/card/StatsCard.svelte.d.ts +1 -1
  49. package/dist/layout/card/metric-card.d.ts +49 -0
  50. package/dist/layout/card/metric-card.js +10 -0
  51. package/dist/layout/card/stats-card.d.ts +0 -15
  52. package/dist/layout/card/stats-card.js +1 -1
  53. package/dist/layout/sidebar/NavGroup.svelte +1 -7
  54. package/dist/layout/sidebar/NavItem.svelte +2 -2
  55. package/dist/layout/sidebar/Sidebar.svelte +103 -49
  56. package/dist/layout/table/Table.svelte +465 -88
  57. package/dist/layout/table/Table.svelte.d.ts +1 -1
  58. package/dist/layout/table/table.d.ts +0 -47
  59. package/dist/layout/table/table.js +0 -8
  60. package/dist/layout/tabs/Tab.svelte +9 -6
  61. package/dist/layout/tabs/Tab.svelte.d.ts +1 -1
  62. package/dist/layout/tabs/TabContent.svelte +1 -2
  63. package/dist/layout/tabs/TabContent.svelte.d.ts +1 -1
  64. package/dist/layout/tabs/TabGroup.svelte +10 -5
  65. package/dist/layout/tabs/TabGroup.svelte.d.ts +2 -2
  66. package/dist/layout/tabs/tabs.d.ts +61 -76
  67. package/dist/layout/tabs/tabs.js +170 -28
  68. package/dist/modal/Modal.svelte +3 -3
  69. package/dist/modal/modal.js +3 -3
  70. package/dist/utils/Portal.svelte +108 -0
  71. package/dist/utils/Portal.svelte.d.ts +8 -0
  72. package/dist/utils/dateUtils.d.ts +7 -0
  73. package/dist/utils/dateUtils.js +26 -0
  74. package/dist/variants.d.ts +11 -1
  75. package/dist/variants.js +17 -0
  76. package/package.json +4 -3
  77. package/dist/header/pageheaders.d.ts +0 -10
  78. package/dist/header/pageheaders.js +0 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,19 @@
1
- import { Color, type Size } from './variants.js';
2
- export type VariantColors = (typeof Color)[keyof typeof Color];
1
+ import { ChartColor, Color, Size } from './variants.js';
2
+ /**
3
+ * Size System:
4
+ * - Size.*: Component dimensions (XS, SM, BASE, LG, XL, XXL)
5
+ */
3
6
  export type VariantSizes = (typeof Size)[keyof typeof Size];
7
+ export type VariantColors = (typeof Color)[keyof typeof Color];
8
+ /**
9
+ * Color System:
10
+ * - Color.*: UI component colors (buttons, text, backgrounds)
11
+ * Options: DEFAULT, PRIMARY, SECONDARY, INFO, SUCCESS, WARNING, DANGER
12
+ * - ChartColor.*: Chart-specific colors, only supported within series configurations (lines, areas, bars)
13
+ * Options: HEALTH, PROPERTY, AUTO, LIFE, OTHER, DEFAULT
14
+ * - ChartColors: Record type mapping ChartColor enum to string values
15
+ */
16
+ export { Color, Size, ChartColor };
4
17
  import type { ClassValue } from 'tailwind-variants';
5
18
  import type { Snippet } from 'svelte';
6
19
  import type { Component } from 'svelte';
@@ -43,7 +56,6 @@ export type MakeModalProps = {
43
56
  closeOnBackdropClick?: boolean;
44
57
  closeOnEsc?: boolean;
45
58
  position?: 'top' | 'center' | 'bottom';
46
- size?: VariantSizes;
47
59
  class?: string;
48
60
  backdropclass?: string;
49
61
  contentclass?: string;
@@ -149,75 +161,86 @@ export type AlertProps = {
149
161
  color?: VariantColors;
150
162
  class?: string;
151
163
  onclose?: () => void;
164
+ footer?: Snippet;
165
+ icon?: Component;
152
166
  };
153
167
  export type StatsCardProps = {
168
+ label?: string;
169
+ value?: string | number;
170
+ previousValue?: string | number;
171
+ previousValuePrefix?: string;
172
+ trend?: number;
173
+ color?: VariantColors;
174
+ chartData?: number[];
175
+ children?: Snippet;
176
+ class?: ClassValue;
177
+ formatLargeNumbers?: boolean;
178
+ };
179
+ export type MetricDetail = {
180
+ label: string;
181
+ value: string | number;
182
+ color?: VariantColors;
183
+ };
184
+ export type MetricCardProps = {
154
185
  title: string;
155
186
  value: string | number;
156
- prefix?: string;
157
- suffix?: string;
158
- delta?: number;
159
- deltaType?: 'increase' | 'decrease' | 'neutral';
160
- description?: string;
161
- icon?: Component;
162
- loading?: boolean;
163
- trend?: number[];
164
- trendColor?: VariantColors;
165
- trendFill?: boolean;
187
+ details?: MetricDetail[];
188
+ percent?: number;
189
+ segments?: ProgressSegment[];
166
190
  class?: ClassValue;
167
- titleClass?: ClassValue;
168
- valueClass?: ClassValue;
169
- deltaClass?: ClassValue;
170
- descriptionClass?: ClassValue;
171
- iconClass?: ClassValue;
172
- contentClass?: ClassValue;
173
- trendClass?: ClassValue;
174
191
  };
175
- export type KeyType = string | number;
176
192
  export type DataRow = Record<string, any>;
177
- export type StatusType = 'idle' | 'loading' | 'error' | 'success' | 'empty';
178
- export type SortDirection = 'asc' | 'desc';
179
- export type SortState = {
180
- column: string;
181
- direction: SortDirection;
182
- };
183
- export type TableColumn = {
184
- key: string;
185
- title: string;
193
+ export type KeyType = keyof DataRow;
194
+ export type StatusType = 'active' | 'inactive' | 'pending' | 'error' | 'default';
195
+ export type TableColumn<T extends DataRow = any> = {
196
+ key: KeyType;
197
+ header: string;
198
+ cell?: Snippet<[row: T, key: KeyType, index?: number]>;
186
199
  sortable?: boolean;
200
+ sortKey?: string;
187
201
  align?: 'left' | 'center' | 'right';
188
202
  width?: string;
189
- cell?: (value: any, row: DataRow) => string | Snippet;
203
+ class?: ClassValue;
190
204
  };
191
- export type TableProps = {
192
- data: DataRow[];
193
- columns: TableColumn[];
194
- keyField?: string;
195
- status?: StatusType;
196
- searchable?: boolean;
197
- pagination?: boolean;
198
- rowsPerPage?: number;
199
- sortable?: boolean;
200
- defaultSort?: SortState;
205
+ export type SortDirection = 'asc' | 'desc' | null;
206
+ export type SortState = {
207
+ column: string | null;
208
+ direction: SortDirection;
209
+ };
210
+ export type TableProps<T extends DataRow = any> = {
211
+ data: T[];
212
+ columns: TableColumn<T>[];
213
+ bordered?: boolean;
214
+ striped?: boolean;
215
+ pageSize?: number;
216
+ currentPage?: number;
217
+ totalItems?: number;
201
218
  selectable?: boolean;
202
- onRowClick?: (row: DataRow) => void;
203
- onSelectionChange?: (selectedRows: DataRow[]) => void;
204
- onSortChange?: (sortState: SortState) => void;
205
- onPageChange?: (page: number) => void;
206
- emptyMessage?: string;
207
- errorMessage?: string;
208
- searchPlaceholder?: string;
219
+ selected?: T[];
209
220
  class?: ClassValue;
210
- headerClass?: ClassValue;
211
- rowClass?: ClassValue | ((row: DataRow) => ClassValue);
212
- cellClass?: ClassValue | ((value: any, row: DataRow, columnKey: string) => ClassValue);
213
- searchClass?: ClassValue;
214
- paginationClass?: ClassValue;
215
- loadingTemplate?: Snippet;
216
- emptyTemplate?: Snippet;
217
- errorTemplate?: Snippet;
218
- searchDebounceMs?: number;
219
- showCount?: boolean;
220
- rowsPerPageOptions?: number[];
221
+ wrapperclass?: ClassValue;
222
+ tableclass?: ClassValue;
223
+ theadclass?: ClassValue;
224
+ tbodyclass?: ClassValue;
225
+ trclass?: ClassValue;
226
+ thclass?: ClassValue;
227
+ tdclass?: ClassValue;
228
+ footerclass?: ClassValue;
229
+ paginationclass?: ClassValue;
230
+ onrowclick?: (row: T, index: number) => void;
231
+ onsort?: (sortState: SortState) => void;
232
+ onselect?: (selected: T[]) => void;
233
+ onpagechange?: (page: number) => void;
234
+ rowclass?: (row: T, index: number) => ClassValue;
235
+ loading?: boolean;
236
+ expandedContent?: Snippet<[T]>;
237
+ pagination?: boolean;
238
+ showPagination?: boolean;
239
+ showPageSize?: boolean;
240
+ pageSizeOptions?: number[];
241
+ onpagesizechange?: (pageSize: number) => void;
242
+ paginationPosition?: 'top' | 'bottom' | 'both';
243
+ paginationTemplate?: 'simple' | 'full';
221
244
  };
222
245
  export type BreadcrumbItem = {
223
246
  label: string;
@@ -238,10 +261,12 @@ export type BreadcrumbsProps = {
238
261
  };
239
262
  export type PageHeaderProps = {
240
263
  title: string;
264
+ subtitle?: string;
241
265
  breadcrumbs?: BreadcrumbItem[];
242
266
  children?: Snippet;
243
267
  class?: ClassValue;
244
268
  titleclass?: ClassValue;
269
+ layout?: 'vertical' | 'horizontal';
245
270
  };
246
271
  export type TabItem = {
247
272
  value: string;
@@ -330,7 +355,38 @@ export { default as Dropdown } from './elements/dropdown/Dropdown.svelte';
330
355
  export { default as Select } from './elements/dropdown/Select.svelte';
331
356
  export { default as Card } from './layout/card/Card.svelte';
332
357
  export { default as StatsCard } from './layout/card/StatsCard.svelte';
358
+ export { default as MetricCard } from './layout/card/MetricCard.svelte';
333
359
  export { default as Alert } from './elements/alert/Alert.svelte';
360
+ export type TabProps = {
361
+ value: string;
362
+ label: string;
363
+ icon?: Component;
364
+ selected?: boolean;
365
+ disabled?: boolean;
366
+ color?: VariantColors;
367
+ size?: VariantSizes;
368
+ variant?: 'line' | 'pill';
369
+ onclick?: (event: Event) => void;
370
+ };
371
+ export type TabsGroupProps = {
372
+ tabs: TabItem[];
373
+ selected?: string;
374
+ color?: VariantColors;
375
+ size?: VariantSizes;
376
+ variant?: 'line' | 'pill';
377
+ class?: ClassValue;
378
+ listClass?: ClassValue;
379
+ triggerClass?: ClassValue;
380
+ panelClass?: ClassValue;
381
+ children?: Snippet<[active: string]>;
382
+ onchange?: (value: string) => void;
383
+ };
384
+ export type TabContentProps = {
385
+ value: string;
386
+ persisted?: boolean;
387
+ panelClass?: ClassValue;
388
+ children?: Snippet<[value: string]>;
389
+ };
334
390
  export { default as Tab } from './layout/tabs/Tab.svelte';
335
391
  export { default as TabContent } from './layout/tabs/TabContent.svelte';
336
392
  export { default as TabGroup } from './layout/tabs/TabGroup.svelte';
@@ -347,38 +403,51 @@ export { modal } from './modal/modal.js';
347
403
  export { drawer } from './drawer/drawer.js';
348
404
  export { selectTV } from './elements/dropdown/select.js';
349
405
  export { breadcrumbs } from './header/breadcrumbs.js';
406
+ export { metricCard } from './layout/card/metric-card.js';
407
+ export type ChartColorKey = keyof typeof ChartColor;
408
+ export type ChartColorValue = (typeof ChartColor)[ChartColorKey];
350
409
  export type ChartColors = {
351
- health: string;
352
- property: string;
353
- auto: string;
354
- life: string;
355
- other: string;
356
- default: string;
357
- };
358
- export type ChartType = 'line' | 'bar' | 'horizontal-bar' | 'pie';
410
+ [K in ChartColorValue]: string;
411
+ };
412
+ export type ChartType = 'line' | 'bar' | 'horizontal-bar' | 'pie' | 'stacked-bar';
359
413
  export type ChartColorString = `#${string}` | keyof ChartColors;
360
- export interface YAxisConfig<T> {
361
- dataKey: keyof T & string;
414
+ export type XAxisConfig<T> = {
415
+ dataKey: keyof T;
362
416
  label?: string;
363
- unit?: string;
364
- min?: number;
365
- max?: number;
366
- position?: 'left' | 'right';
367
417
  format?: (value: any) => string;
368
- color?: ChartColorString;
369
- }
370
- export interface XAxisConfig<T> {
371
- dataKey: keyof T & string;
372
- label?: string;
373
418
  tick?: {
374
419
  fontSize?: number;
375
420
  rotate?: number;
376
- interval?: number | 'auto' | 'preserveStartEnd';
421
+ interval?: number | 'auto' | Function;
422
+ };
423
+ axisLine?: {
424
+ show?: boolean;
425
+ lineStyle?: {
426
+ color?: string;
427
+ width?: number;
428
+ type?: 'solid' | 'dashed' | 'dotted';
429
+ };
377
430
  };
431
+ };
432
+ export type YAxisConfig<T> = {
433
+ dataKey: keyof T;
434
+ label?: string;
378
435
  format?: (value: any) => string;
379
- }
436
+ unit?: string;
437
+ position?: 'left' | 'right';
438
+ min?: number;
439
+ max?: number;
440
+ axisLine?: {
441
+ show?: boolean;
442
+ lineStyle?: {
443
+ color?: string;
444
+ width?: number;
445
+ type?: 'solid' | 'dashed' | 'dotted';
446
+ };
447
+ };
448
+ };
380
449
  export interface SeriesConfig<T> {
381
- dataKey: keyof T & string;
450
+ dataKey: keyof T;
382
451
  name?: string;
383
452
  type?: ChartType;
384
453
  color?: ChartColorString;
@@ -403,40 +472,45 @@ export interface SeriesConfig<T> {
403
472
  radius?: [string, string];
404
473
  centerText?: string;
405
474
  }
406
- export interface ChartConfig<T> {
475
+ export interface GridConfig {
476
+ horizontal?: boolean;
477
+ vertical?: boolean;
478
+ containLabel?: boolean;
479
+ top?: number | string;
480
+ right?: number | string;
481
+ bottom?: number | string;
482
+ left?: number | string;
483
+ }
484
+ export interface LegendConfig {
485
+ show?: boolean;
486
+ position?: 'top' | 'bottom' | 'left' | 'right';
487
+ orient?: 'horizontal' | 'vertical';
488
+ }
489
+ export interface TooltipConfig {
490
+ show?: boolean;
491
+ trigger?: 'item' | 'axis' | 'none';
492
+ formatter?: string | ((params: any) => string);
493
+ }
494
+ export interface ToolboxConfig {
495
+ show?: boolean;
496
+ features?: {
497
+ saveAsImage?: boolean;
498
+ dataView?: boolean;
499
+ dataZoom?: boolean;
500
+ magicType?: boolean;
501
+ restore?: boolean;
502
+ };
503
+ }
504
+ export type ChartConfig<T> = {
407
505
  xAxis: XAxisConfig<T>;
408
506
  yAxis: YAxisConfig<T>[];
409
507
  series: SeriesConfig<T>[];
410
- grid?: {
411
- horizontal?: boolean;
412
- vertical?: boolean;
413
- containLabel?: boolean;
414
- top?: number | string;
415
- right?: number | string;
416
- bottom?: number | string;
417
- left?: number | string;
418
- };
419
- legend?: {
420
- show?: boolean;
421
- position?: 'top' | 'bottom' | 'left' | 'right';
422
- orient?: 'horizontal' | 'vertical';
423
- };
424
- tooltip?: {
425
- show?: boolean;
426
- trigger?: 'item' | 'axis' | 'none';
427
- formatter?: string | ((params: any) => string);
428
- };
429
- toolbox?: {
430
- show?: boolean;
431
- features?: {
432
- saveAsImage?: boolean;
433
- dataView?: boolean;
434
- dataZoom?: boolean;
435
- magicType?: boolean;
436
- restore?: boolean;
437
- };
438
- };
439
- }
508
+ grid?: GridConfig;
509
+ legend?: LegendConfig;
510
+ tooltip?: TooltipConfig;
511
+ toolbox?: ToolboxConfig;
512
+ showAxisLines?: boolean;
513
+ };
440
514
  export interface PointClickType<T> {
441
515
  detail: {
442
516
  seriesIndex: number;
@@ -471,7 +545,7 @@ export interface FileUploadProps {
471
545
  */
472
546
  allowedMimeTypes?: string[];
473
547
  /**
474
- * Maximum file size in bytes;
548
+ * Maximum file size in bytes
475
549
  */
476
550
  maxSize?: number;
477
551
  /**
@@ -487,10 +561,6 @@ export interface FileUploadProps {
487
561
  * CSS class for the dropzone
488
562
  */
489
563
  dropzoneClass?: string;
490
- /**
491
- * CSS class for the preview area
492
- */
493
- previewClass?: string;
494
564
  /**
495
565
  * ID for the file input element
496
566
  * @default 'file-upload'
@@ -501,33 +571,14 @@ export interface FileUploadProps {
501
571
  */
502
572
  onfiles?: (files: FileList | File[]) => void;
503
573
  /**
504
- * Callback when a file is deleted
574
+ * Content to display when no files are uploaded
505
575
  */
576
+ uploadContent?: Snippet;
577
+ }
578
+ export interface FilePreviewProps {
579
+ files: UploadedFile[];
506
580
  ondelete?: (fileId: string, index: number) => void;
507
- /**
508
- * Current files array to display
509
- */
510
- files?: UploadedFile[];
511
- /**
512
- * API URL for file upload
513
- */
514
- apiUrl?: string;
515
- /**
516
- * Authorization token for API requests
517
- */
518
- apiToken?: string;
519
- /**
520
- * Handler for unsuccessful file uploads
521
- */
522
- onerror?: (error: string) => void;
523
- /**
524
- * Expired time in days
525
- */
526
- expiry?: `${string}d`;
527
- /**
528
- * Additional metadata to be sent with the file
529
- */
530
- metadata?: Record<string, string>;
581
+ class?: string;
531
582
  }
532
583
  export interface UploadedFile {
533
584
  FileID: string;
@@ -552,6 +603,7 @@ export interface UploadedFile {
552
603
  error?: string;
553
604
  }
554
605
  export { default as FileUpload } from './elements/file-upload/FileUpload.svelte';
606
+ export { default as FilesPreview } from './elements/file-upload/FilesPreview.svelte';
555
607
  export { default as Toaster } from './sonner/sonner.svelte';
556
608
  export interface FormProps<T extends Record<string, unknown>> {
557
609
  form: SuperForm<any>;
@@ -709,6 +761,11 @@ export interface SliderProps {
709
761
  notation?: NotationType;
710
762
  };
711
763
  }
764
+ export type ProgressSegment = {
765
+ value: number;
766
+ color: VariantColors;
767
+ label?: string;
768
+ };
712
769
  export type ProgressProps = {
713
770
  value: number;
714
771
  max?: number;
@@ -716,11 +773,33 @@ export type ProgressProps = {
716
773
  color?: VariantColors;
717
774
  showLabel?: boolean;
718
775
  labelPosition?: 'top' | 'bottom' | 'right';
719
- class?: string;
776
+ segments?: ProgressSegment[];
777
+ showLabels?: boolean;
778
+ showValues?: boolean;
779
+ class?: ClassValue;
720
780
  labelClass?: string;
721
781
  barClass?: string;
722
782
  };
723
783
  export { default as Progress } from './elements/progress/Progress.svelte';
784
+ export type AccordionProps = {
785
+ id?: string;
786
+ title?: string;
787
+ description?: string;
788
+ children?: Snippet;
789
+ summary?: Snippet;
790
+ open?: boolean;
791
+ color?: VariantColors;
792
+ class?: ClassValue;
793
+ titleclass?: ClassValue;
794
+ bodyclass?: ClassValue;
795
+ headerclass?: ClassValue;
796
+ icon?: Component;
797
+ iconPosition?: 'start' | 'end';
798
+ bordered?: boolean;
799
+ onexpand?: () => void;
800
+ oncollapse?: () => void;
801
+ };
802
+ export { default as Accordion } from './elements/accordion/Accordion.svelte';
724
803
  export interface TimelineItem {
725
804
  title: string;
726
805
  time: Date | string;
@@ -741,3 +820,37 @@ export type RadioPillProps = {
741
820
  errors?: string[];
742
821
  onchange?: (value: string) => void;
743
822
  };
823
+ export type FilterTab = {
824
+ value: string;
825
+ label: string;
826
+ };
827
+ export type FilterGroup = {
828
+ key: string;
829
+ label: string;
830
+ tabs: FilterTab[];
831
+ selectedValue: string;
832
+ onChange: (value: string) => void;
833
+ minWidth?: string;
834
+ };
835
+ export type CompactFiltersProps = {
836
+ filterGroups: FilterGroup[];
837
+ isExpanded?: boolean;
838
+ title?: string;
839
+ class?: ClassValue;
840
+ summaryClass?: ClassValue;
841
+ expandedClass?: ClassValue;
842
+ FilterIcon?: Component;
843
+ };
844
+ export { CompactFilters } from './filters/index.js';
845
+ export * from './file-browser/index.js';
846
+ export * from './adapters/storage/index.js';
847
+ export interface FileBrowserProps {
848
+ adapter: any;
849
+ startPath?: string;
850
+ actions?: any[];
851
+ selectedFiles?: string[];
852
+ infoSection?: (props: {
853
+ selectedFiles: string[];
854
+ navToFileFolder: (fileKey: string) => void;
855
+ }) => any;
856
+ }
package/dist/index.js CHANGED
@@ -1,4 +1,13 @@
1
- import { Color } from './variants.js';
1
+ import { ChartColor, Color, Size } from './variants.js';
2
+ /**
3
+ * Color System:
4
+ * - Color.*: UI component colors (buttons, text, backgrounds)
5
+ * Options: DEFAULT, PRIMARY, SECONDARY, INFO, SUCCESS, WARNING, DANGER
6
+ * - ChartColor.*: Chart-specific colors, only supported within series configurations (lines, areas, bars)
7
+ * Options: HEALTH, PROPERTY, AUTO, LIFE, OTHER, DEFAULT
8
+ * - ChartColors: Record type mapping ChartColor enum to string values
9
+ */
10
+ export { Color, Size, ChartColor };
2
11
  // Helper utilities
3
12
  export { tv, cn } from './helper/cls.js';
4
13
  export { isRouteActive } from './helper/nav.svelte.js';
@@ -19,9 +28,9 @@ export { default as Select } from './elements/dropdown/Select.svelte';
19
28
  // Elements - Card
20
29
  export { default as Card } from './layout/card/Card.svelte';
21
30
  export { default as StatsCard } from './layout/card/StatsCard.svelte';
31
+ export { default as MetricCard } from './layout/card/MetricCard.svelte';
22
32
  // Elements - Alert
23
33
  export { default as Alert } from './elements/alert/Alert.svelte';
24
- // Elements - Tabs
25
34
  export { default as Tab } from './layout/tabs/Tab.svelte';
26
35
  export { default as TabContent } from './layout/tabs/TabContent.svelte';
27
36
  export { default as TabGroup } from './layout/tabs/TabGroup.svelte';
@@ -42,8 +51,10 @@ export { modal } from './modal/modal.js';
42
51
  export { drawer } from './drawer/drawer.js';
43
52
  export { selectTV } from './elements/dropdown/select.js';
44
53
  export { breadcrumbs } from './header/breadcrumbs.js';
54
+ export { metricCard } from './layout/card/metric-card.js';
45
55
  export { default as Chart } from './charts/Chart.svelte';
46
56
  export { default as FileUpload } from './elements/file-upload/FileUpload.svelte';
57
+ export { default as FilesPreview } from './elements/file-upload/FilesPreview.svelte';
47
58
  // Toaster: Should be registered in +layout.svelte
48
59
  export { default as Toaster } from './sonner/sonner.svelte';
49
60
  // Form Component Exports
@@ -58,4 +69,10 @@ export { default as DateRange } from './forms/DateRange.svelte';
58
69
  export { default as Tags } from './forms/Tags.svelte';
59
70
  export { default as RadioPill } from './forms/RadioPill.svelte';
60
71
  export { default as Progress } from './elements/progress/Progress.svelte';
72
+ export { default as Accordion } from './elements/accordion/Accordion.svelte';
61
73
  export { default as Timeline } from './elements/timeline/Timeline.svelte';
74
+ // Re-export filters
75
+ export { CompactFilters } from './filters/index.js';
76
+ // File Browser and Storage Adapters
77
+ export * from './file-browser/index.js';
78
+ export * from './adapters/storage/index.js';
@@ -0,0 +1,64 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../helper/cls.js';
3
+ import { metricCard } from './metric-card.js';
4
+ import type { MetricCardProps } from '../../index.js';
5
+ import Progress from '../../elements/progress/Progress.svelte';
6
+ import { Size, Color } from '../../variants.js';
7
+
8
+ let {
9
+ title,
10
+ value,
11
+ details = [],
12
+ percent,
13
+ segments,
14
+ class: className = ''
15
+ }: MetricCardProps = $props();
16
+
17
+ const {
18
+ base,
19
+ title: titleSlot,
20
+ value: valueSlot,
21
+ detail: detailSlot,
22
+ progress: progressSlot
23
+ } = $derived(metricCard());
24
+
25
+ const baseClass = $derived(cn(base(), 'flex flex-col h-full', className));
26
+ </script>
27
+
28
+ <div class={baseClass}>
29
+ {#if title}
30
+ <div class={titleSlot()}>{title}</div>
31
+ {/if}
32
+
33
+ {#if value !== undefined}
34
+ <div class={valueSlot()}>{value}</div>
35
+ {/if}
36
+
37
+ {#if details.length > 0}
38
+ <div class={detailSlot()}>
39
+ {#each details as detail, index (detail.label + index)}
40
+ <div class="flex justify-between text-xs">
41
+ <span class="text-default-500">{detail.label}</span>
42
+ <span class="font-medium {detail.color || 'text-default-900'}">{detail.value}</span>
43
+ </div>
44
+ {/each}
45
+ </div>
46
+ {/if}
47
+
48
+ {#if segments}
49
+ <div class={cn(progressSlot(), 'pt-2')}>
50
+ <Progress
51
+ value={0}
52
+ {segments}
53
+ size={Size.SM}
54
+ showLabels={false}
55
+ showValues={false}
56
+ showLabel={false}
57
+ />
58
+ </div>
59
+ {:else if percent !== undefined}
60
+ <div class={cn(progressSlot(), 'pt-2')}>
61
+ <Progress value={percent} size={Size.SM} color={Color.SUCCESS} showLabel={false} />
62
+ </div>
63
+ {/if}
64
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { MetricCardProps } from '../../index.js';
2
+ declare const MetricCard: import("svelte").Component<MetricCardProps, {}, "">;
3
+ type MetricCard = ReturnType<typeof MetricCard>;
4
+ export default MetricCard;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { cn } from '../../helper/cls.js';
3
- import { statsCard, type StatsCardProps } from './stats-card.js';
3
+ import { statsCard } from './stats-card.js';
4
4
  import { onMount } from 'svelte';
5
5
  import * as echarts from 'echarts/core';
6
6
 
@@ -12,6 +12,7 @@
12
12
  // @ts-expect-error - ECharts types are not available
13
13
  import { SVGRenderer } from 'echarts/renderers';
14
14
  import { Color } from '../../variants.js';
15
+ import type { StatsCardProps } from '../../index.js';
15
16
 
16
17
  // @ts-expect-error - ECharts types are not available
17
18
  echarts.use([LineChart, GridComponent, SVGRenderer]);
@@ -134,7 +135,7 @@
134
135
  const labelClasses = $derived(cn(labelSlot(), 'text-sm font-medium mb-1'));
135
136
  const valueClasses = $derived(cn(valueSlot(), 'text-4xl font-bold'));
136
137
  const trendClasses = $derived(cn(trendSlot(), 'text-sm font-medium ml-2'));
137
- const previousValueClasses = $derived(cn(previousValueSlot(), 'text-sm text-gray-500 mt-1'));
138
+ const previousValueClasses = $derived(cn(previousValueSlot(), 'text-sm text-default-500 mt-1'));
138
139
 
139
140
  const trendFormatted = $derived.by(() => {
140
141
  if (trend === undefined || trend === null) return '';
@@ -221,7 +222,7 @@
221
222
  <div
222
223
  class={cn(
223
224
  base(),
224
- '@container flex flex-col rounded-lg border border-gray-200 bg-white p-6 shadow-sm',
225
+ '@container flex flex-col rounded-lg border border-default-200 bg-white p-6 shadow-sm',
225
226
  className
226
227
  )}
227
228
  >
@@ -1,4 +1,4 @@
1
- import { type StatsCardProps } from './stats-card.js';
1
+ import type { StatsCardProps } from '../../index.js';
2
2
  declare const StatsCard: import("svelte").Component<StatsCardProps, {}, "">;
3
3
  type StatsCard = ReturnType<typeof StatsCard>;
4
4
  export default StatsCard;