@makolabs/ripple 0.0.1-dev.8 → 0.0.1-dev.80

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 (77) 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 +837 -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/index.d.ts +254 -143
  43. package/dist/index.js +19 -2
  44. package/dist/layout/card/MetricCard.svelte +64 -0
  45. package/dist/layout/card/MetricCard.svelte.d.ts +4 -0
  46. package/dist/layout/card/StatsCard.svelte +4 -3
  47. package/dist/layout/card/StatsCard.svelte.d.ts +1 -1
  48. package/dist/layout/card/metric-card.d.ts +49 -0
  49. package/dist/layout/card/metric-card.js +10 -0
  50. package/dist/layout/card/stats-card.d.ts +0 -15
  51. package/dist/layout/card/stats-card.js +1 -1
  52. package/dist/layout/sidebar/NavGroup.svelte +8 -9
  53. package/dist/layout/sidebar/NavItem.svelte +2 -2
  54. package/dist/layout/sidebar/Sidebar.svelte +102 -49
  55. package/dist/layout/table/Table.svelte +464 -87
  56. package/dist/layout/table/Table.svelte.d.ts +1 -1
  57. package/dist/layout/table/table.d.ts +0 -47
  58. package/dist/layout/table/table.js +0 -8
  59. package/dist/layout/tabs/Tab.svelte +9 -6
  60. package/dist/layout/tabs/Tab.svelte.d.ts +1 -1
  61. package/dist/layout/tabs/TabContent.svelte +1 -2
  62. package/dist/layout/tabs/TabContent.svelte.d.ts +1 -1
  63. package/dist/layout/tabs/TabGroup.svelte +10 -5
  64. package/dist/layout/tabs/TabGroup.svelte.d.ts +2 -2
  65. package/dist/layout/tabs/tabs.d.ts +61 -76
  66. package/dist/layout/tabs/tabs.js +170 -28
  67. package/dist/modal/Modal.svelte +3 -3
  68. package/dist/modal/modal.js +3 -3
  69. package/dist/utils/Portal.svelte +108 -0
  70. package/dist/utils/Portal.svelte.d.ts +8 -0
  71. package/dist/utils/dateUtils.d.ts +7 -0
  72. package/dist/utils/dateUtils.js +26 -0
  73. package/dist/variants.d.ts +11 -1
  74. package/dist/variants.js +17 -0
  75. package/package.json +2 -2
  76. package/dist/header/pageheaders.d.ts +0 -10
  77. 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;
@@ -330,7 +353,38 @@ export { default as Dropdown } from './elements/dropdown/Dropdown.svelte';
330
353
  export { default as Select } from './elements/dropdown/Select.svelte';
331
354
  export { default as Card } from './layout/card/Card.svelte';
332
355
  export { default as StatsCard } from './layout/card/StatsCard.svelte';
356
+ export { default as MetricCard } from './layout/card/MetricCard.svelte';
333
357
  export { default as Alert } from './elements/alert/Alert.svelte';
358
+ export type TabProps = {
359
+ value: string;
360
+ label: string;
361
+ icon?: Component;
362
+ selected?: boolean;
363
+ disabled?: boolean;
364
+ color?: VariantColors;
365
+ size?: VariantSizes;
366
+ variant?: 'line' | 'pill';
367
+ onclick?: (event: Event) => void;
368
+ };
369
+ export type TabsGroupProps = {
370
+ tabs: TabItem[];
371
+ selected?: string;
372
+ color?: VariantColors;
373
+ size?: VariantSizes;
374
+ variant?: 'line' | 'pill';
375
+ class?: ClassValue;
376
+ listClass?: ClassValue;
377
+ triggerClass?: ClassValue;
378
+ panelClass?: ClassValue;
379
+ children?: Snippet<[active: string]>;
380
+ onchange?: (value: string) => void;
381
+ };
382
+ export type TabContentProps = {
383
+ value: string;
384
+ persisted?: boolean;
385
+ panelClass?: ClassValue;
386
+ children?: Snippet<[value: string]>;
387
+ };
334
388
  export { default as Tab } from './layout/tabs/Tab.svelte';
335
389
  export { default as TabContent } from './layout/tabs/TabContent.svelte';
336
390
  export { default as TabGroup } from './layout/tabs/TabGroup.svelte';
@@ -347,38 +401,51 @@ export { modal } from './modal/modal.js';
347
401
  export { drawer } from './drawer/drawer.js';
348
402
  export { selectTV } from './elements/dropdown/select.js';
349
403
  export { breadcrumbs } from './header/breadcrumbs.js';
404
+ export { metricCard } from './layout/card/metric-card.js';
405
+ export type ChartColorKey = keyof typeof ChartColor;
406
+ export type ChartColorValue = (typeof ChartColor)[ChartColorKey];
350
407
  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';
408
+ [K in ChartColorValue]: string;
409
+ };
410
+ export type ChartType = 'line' | 'bar' | 'horizontal-bar' | 'pie' | 'stacked-bar';
359
411
  export type ChartColorString = `#${string}` | keyof ChartColors;
360
- export interface YAxisConfig<T> {
361
- dataKey: keyof T & string;
412
+ export type XAxisConfig<T> = {
413
+ dataKey: keyof T;
362
414
  label?: string;
363
- unit?: string;
364
- min?: number;
365
- max?: number;
366
- position?: 'left' | 'right';
367
415
  format?: (value: any) => string;
368
- color?: ChartColorString;
369
- }
370
- export interface XAxisConfig<T> {
371
- dataKey: keyof T & string;
372
- label?: string;
373
416
  tick?: {
374
417
  fontSize?: number;
375
418
  rotate?: number;
376
- interval?: number | 'auto' | 'preserveStartEnd';
419
+ interval?: number | 'auto' | Function;
420
+ };
421
+ axisLine?: {
422
+ show?: boolean;
423
+ lineStyle?: {
424
+ color?: string;
425
+ width?: number;
426
+ type?: 'solid' | 'dashed' | 'dotted';
427
+ };
377
428
  };
429
+ };
430
+ export type YAxisConfig<T> = {
431
+ dataKey: keyof T;
432
+ label?: string;
378
433
  format?: (value: any) => string;
379
- }
434
+ unit?: string;
435
+ position?: 'left' | 'right';
436
+ min?: number;
437
+ max?: number;
438
+ axisLine?: {
439
+ show?: boolean;
440
+ lineStyle?: {
441
+ color?: string;
442
+ width?: number;
443
+ type?: 'solid' | 'dashed' | 'dotted';
444
+ };
445
+ };
446
+ };
380
447
  export interface SeriesConfig<T> {
381
- dataKey: keyof T & string;
448
+ dataKey: keyof T;
382
449
  name?: string;
383
450
  type?: ChartType;
384
451
  color?: ChartColorString;
@@ -403,40 +470,45 @@ export interface SeriesConfig<T> {
403
470
  radius?: [string, string];
404
471
  centerText?: string;
405
472
  }
406
- export interface ChartConfig<T> {
473
+ export interface GridConfig {
474
+ horizontal?: boolean;
475
+ vertical?: boolean;
476
+ containLabel?: boolean;
477
+ top?: number | string;
478
+ right?: number | string;
479
+ bottom?: number | string;
480
+ left?: number | string;
481
+ }
482
+ export interface LegendConfig {
483
+ show?: boolean;
484
+ position?: 'top' | 'bottom' | 'left' | 'right';
485
+ orient?: 'horizontal' | 'vertical';
486
+ }
487
+ export interface TooltipConfig {
488
+ show?: boolean;
489
+ trigger?: 'item' | 'axis' | 'none';
490
+ formatter?: string | ((params: any) => string);
491
+ }
492
+ export interface ToolboxConfig {
493
+ show?: boolean;
494
+ features?: {
495
+ saveAsImage?: boolean;
496
+ dataView?: boolean;
497
+ dataZoom?: boolean;
498
+ magicType?: boolean;
499
+ restore?: boolean;
500
+ };
501
+ }
502
+ export type ChartConfig<T> = {
407
503
  xAxis: XAxisConfig<T>;
408
504
  yAxis: YAxisConfig<T>[];
409
505
  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
- }
506
+ grid?: GridConfig;
507
+ legend?: LegendConfig;
508
+ tooltip?: TooltipConfig;
509
+ toolbox?: ToolboxConfig;
510
+ showAxisLines?: boolean;
511
+ };
440
512
  export interface PointClickType<T> {
441
513
  detail: {
442
514
  seriesIndex: number;
@@ -471,7 +543,7 @@ export interface FileUploadProps {
471
543
  */
472
544
  allowedMimeTypes?: string[];
473
545
  /**
474
- * Maximum file size in bytes;
546
+ * Maximum file size in bytes
475
547
  */
476
548
  maxSize?: number;
477
549
  /**
@@ -487,10 +559,6 @@ export interface FileUploadProps {
487
559
  * CSS class for the dropzone
488
560
  */
489
561
  dropzoneClass?: string;
490
- /**
491
- * CSS class for the preview area
492
- */
493
- previewClass?: string;
494
562
  /**
495
563
  * ID for the file input element
496
564
  * @default 'file-upload'
@@ -501,33 +569,14 @@ export interface FileUploadProps {
501
569
  */
502
570
  onfiles?: (files: FileList | File[]) => void;
503
571
  /**
504
- * Callback when a file is deleted
572
+ * Content to display when no files are uploaded
505
573
  */
574
+ uploadContent?: Snippet;
575
+ }
576
+ export interface FilePreviewProps {
577
+ files: UploadedFile[];
506
578
  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>;
579
+ class?: string;
531
580
  }
532
581
  export interface UploadedFile {
533
582
  FileID: string;
@@ -552,6 +601,7 @@ export interface UploadedFile {
552
601
  error?: string;
553
602
  }
554
603
  export { default as FileUpload } from './elements/file-upload/FileUpload.svelte';
604
+ export { default as FilesPreview } from './elements/file-upload/FilesPreview.svelte';
555
605
  export { default as Toaster } from './sonner/sonner.svelte';
556
606
  export interface FormProps<T extends Record<string, unknown>> {
557
607
  form: SuperForm<any>;
@@ -709,6 +759,11 @@ export interface SliderProps {
709
759
  notation?: NotationType;
710
760
  };
711
761
  }
762
+ export type ProgressSegment = {
763
+ value: number;
764
+ color: VariantColors;
765
+ label?: string;
766
+ };
712
767
  export type ProgressProps = {
713
768
  value: number;
714
769
  max?: number;
@@ -716,11 +771,33 @@ export type ProgressProps = {
716
771
  color?: VariantColors;
717
772
  showLabel?: boolean;
718
773
  labelPosition?: 'top' | 'bottom' | 'right';
719
- class?: string;
774
+ segments?: ProgressSegment[];
775
+ showLabels?: boolean;
776
+ showValues?: boolean;
777
+ class?: ClassValue;
720
778
  labelClass?: string;
721
779
  barClass?: string;
722
780
  };
723
781
  export { default as Progress } from './elements/progress/Progress.svelte';
782
+ export type AccordionProps = {
783
+ id?: string;
784
+ title?: string;
785
+ description?: string;
786
+ children?: Snippet;
787
+ summary?: Snippet;
788
+ open?: boolean;
789
+ color?: VariantColors;
790
+ class?: ClassValue;
791
+ titleclass?: ClassValue;
792
+ bodyclass?: ClassValue;
793
+ headerclass?: ClassValue;
794
+ icon?: Component;
795
+ iconPosition?: 'start' | 'end';
796
+ bordered?: boolean;
797
+ onexpand?: () => void;
798
+ oncollapse?: () => void;
799
+ };
800
+ export { default as Accordion } from './elements/accordion/Accordion.svelte';
724
801
  export interface TimelineItem {
725
802
  title: string;
726
803
  time: Date | string;
@@ -741,3 +818,37 @@ export type RadioPillProps = {
741
818
  errors?: string[];
742
819
  onchange?: (value: string) => void;
743
820
  };
821
+ export type FilterTab = {
822
+ value: string;
823
+ label: string;
824
+ };
825
+ export type FilterGroup = {
826
+ key: string;
827
+ label: string;
828
+ tabs: FilterTab[];
829
+ selectedValue: string;
830
+ onChange: (value: string) => void;
831
+ minWidth?: string;
832
+ };
833
+ export type CompactFiltersProps = {
834
+ filterGroups: FilterGroup[];
835
+ isExpanded?: boolean;
836
+ title?: string;
837
+ class?: ClassValue;
838
+ summaryClass?: ClassValue;
839
+ expandedClass?: ClassValue;
840
+ FilterIcon?: Component;
841
+ };
842
+ export { CompactFilters } from './filters/index.js';
843
+ export * from './file-browser/index.js';
844
+ export * from './adapters/storage/index.js';
845
+ export interface FileBrowserProps {
846
+ adapter: any;
847
+ startPath?: string;
848
+ actions?: any[];
849
+ selectedFiles?: string[];
850
+ infoSection?: (props: {
851
+ selectedFiles: string[];
852
+ navToFileFolder: (fileKey: string) => void;
853
+ }) => any;
854
+ }
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(), details.length > 0 ? '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(), details.length > 0 ? '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;