@makolabs/ripple 1.8.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/ai/ai-types.d.ts +44 -0
- package/dist/ai/ai-types.js +1 -0
- package/dist/button/button-types.d.ts +25 -0
- package/dist/button/button-types.js +1 -0
- package/dist/charts/Chart.svelte +7 -22
- package/dist/charts/chart-types.d.ts +137 -0
- package/dist/charts/chart-types.js +1 -0
- package/dist/drawer/drawer-types.d.ts +33 -0
- package/dist/drawer/drawer-types.js +1 -0
- package/dist/elements/accordion/accordion-types.d.ts +29 -0
- package/dist/elements/accordion/accordion-types.js +1 -0
- package/dist/elements/badge/badge-types.d.ts +11 -0
- package/dist/elements/badge/badge-types.js +1 -0
- package/dist/elements/dropdown/dropdown-types.d.ts +68 -0
- package/dist/elements/dropdown/dropdown-types.js +1 -0
- package/dist/elements/file-upload/file-upload-types.d.ts +68 -0
- package/dist/elements/file-upload/file-upload-types.js +1 -0
- package/dist/elements/progress/progress-types.d.ts +22 -0
- package/dist/elements/progress/progress-types.js +1 -0
- package/dist/elements/timeline/timeline-types.d.ts +11 -0
- package/dist/elements/timeline/timeline-types.js +1 -0
- package/dist/filters/filter-types.d.ts +24 -0
- package/dist/filters/filter-types.js +1 -0
- package/dist/forms/Input.svelte +4 -2
- package/dist/forms/form-types.d.ts +168 -0
- package/dist/forms/form-types.js +1 -0
- package/dist/header/header-types.d.ts +43 -0
- package/dist/header/header-types.js +1 -0
- package/dist/index.d.ts +35 -1105
- package/dist/index.js +37 -14
- package/dist/layout/activity-list/activity-list-types.d.ts +30 -0
- package/dist/layout/activity-list/activity-list-types.js +1 -0
- package/dist/layout/card/card-types.d.ts +43 -0
- package/dist/layout/card/card-types.js +1 -0
- package/dist/layout/card/metric-card.d.ts +3 -3
- package/dist/layout/navbar/navbar-types.d.ts +19 -0
- package/dist/layout/navbar/navbar-types.js +1 -0
- package/dist/layout/sidebar/Sidebar.svelte +10 -1
- package/dist/layout/sidebar/sidebar-types.d.ts +63 -0
- package/dist/layout/sidebar/sidebar-types.js +1 -0
- package/dist/layout/table/table-types.d.ts +82 -0
- package/dist/layout/table/table-types.js +1 -0
- package/dist/layout/tabs/tabs-types.d.ts +43 -0
- package/dist/layout/tabs/tabs-types.js +1 -0
- package/dist/modal/modal-types.d.ts +34 -0
- package/dist/modal/modal-types.js +1 -0
- package/dist/types/echarts.d.ts +27 -0
- package/dist/user-management/user-management-types.d.ts +156 -0
- package/dist/user-management/user-management-types.js +1 -0
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -9,10 +9,14 @@ import { ChartColor, Color, Size } from './variants.js';
|
|
|
9
9
|
*/
|
|
10
10
|
export { Color, Size, ChartColor };
|
|
11
11
|
export { buildTestId } from './helper/testid.js';
|
|
12
|
+
// ============================================================================
|
|
12
13
|
// Helper utilities
|
|
14
|
+
// ============================================================================
|
|
13
15
|
export { tv, cn } from './helper/cls.js';
|
|
14
16
|
export { isRouteActive } from './helper/nav.svelte.js';
|
|
17
|
+
// ============================================================================
|
|
15
18
|
// Direct Component Exports
|
|
19
|
+
// ============================================================================
|
|
16
20
|
// Button
|
|
17
21
|
export { default as Button } from './button/Button.svelte';
|
|
18
22
|
// Modal
|
|
@@ -35,6 +39,7 @@ export { default as RankedCard } from './layout/card/RankedCard.svelte';
|
|
|
35
39
|
// Elements - Alert
|
|
36
40
|
export { default as Alert } from './elements/alert/Alert.svelte';
|
|
37
41
|
export { default as Pagination } from './elements/pagination/Pagination.svelte';
|
|
42
|
+
// Elements - Tabs
|
|
38
43
|
export { default as Tab } from './layout/tabs/Tab.svelte';
|
|
39
44
|
export { default as TabContent } from './layout/tabs/TabContent.svelte';
|
|
40
45
|
export { default as TabGroup } from './layout/tabs/TabGroup.svelte';
|
|
@@ -49,18 +54,15 @@ export { default as NavItem } from './layout/sidebar/NavItem.svelte';
|
|
|
49
54
|
export { default as NavGroup } from './layout/sidebar/NavGroup.svelte';
|
|
50
55
|
// Elements - ActivityList
|
|
51
56
|
export { default as ActivityList } from './layout/activity-list/ActivityList.svelte';
|
|
52
|
-
//
|
|
53
|
-
export {
|
|
54
|
-
|
|
55
|
-
export {
|
|
56
|
-
|
|
57
|
-
export {
|
|
58
|
-
|
|
59
|
-
export { breadcrumbs } from './header/breadcrumbs.js';
|
|
60
|
-
export { metricCard } from './layout/card/metric-card.js';
|
|
61
|
-
export { rankedCard } from './layout/card/ranked-card.js';
|
|
62
|
-
export { activityList } from './layout/activity-list/activity-list.js';
|
|
57
|
+
// Elements - Progress
|
|
58
|
+
export { default as Progress } from './elements/progress/Progress.svelte';
|
|
59
|
+
// Elements - Accordion
|
|
60
|
+
export { default as Accordion } from './elements/accordion/Accordion.svelte';
|
|
61
|
+
// Elements - Timeline
|
|
62
|
+
export { default as Timeline } from './elements/timeline/Timeline.svelte';
|
|
63
|
+
// Chart
|
|
63
64
|
export { default as Chart } from './charts/Chart.svelte';
|
|
65
|
+
// File Upload
|
|
64
66
|
export { default as FileUpload } from './elements/file-upload/FileUpload.svelte';
|
|
65
67
|
export { default as FilesPreview } from './elements/file-upload/FilesPreview.svelte';
|
|
66
68
|
// Toaster: Should be registered in +layout.svelte
|
|
@@ -82,19 +84,40 @@ export { default as NumberInput } from './forms/NumberInput.svelte';
|
|
|
82
84
|
export { default as DateRange } from './forms/DateRange.svelte';
|
|
83
85
|
export { default as Tags } from './forms/Tags.svelte';
|
|
84
86
|
export { default as RadioPill } from './forms/RadioPill.svelte';
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
// ============================================================================
|
|
88
|
+
// Component Variant Utilities
|
|
89
|
+
// ============================================================================
|
|
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';
|
|
101
|
+
// ============================================================================
|
|
88
102
|
// Re-export filters
|
|
103
|
+
// ============================================================================
|
|
89
104
|
export { CompactFilters } from './filters/index.js';
|
|
105
|
+
// ============================================================================
|
|
90
106
|
// File Browser and Storage Adapters
|
|
107
|
+
// ============================================================================
|
|
91
108
|
export * from './file-browser/index.js';
|
|
92
109
|
export * from './adapters/storage/index.js';
|
|
110
|
+
// ============================================================================
|
|
93
111
|
// AI Adapters
|
|
112
|
+
// ============================================================================
|
|
94
113
|
export * from './adapters/ai/index.js';
|
|
114
|
+
// ============================================================================
|
|
95
115
|
// User Management Helper Functions
|
|
116
|
+
// ============================================================================
|
|
96
117
|
export { getUserDisplayName, getUserInitials } from './user-management/user-management.js';
|
|
118
|
+
// ============================================================================
|
|
97
119
|
// User Management Components
|
|
120
|
+
// ============================================================================
|
|
98
121
|
export { default as UserManagement } from './user-management/UserManagement.svelte';
|
|
99
122
|
export { default as UserTable } from './user-management/UserTable.svelte';
|
|
100
123
|
export { default as UserModal } from './user-management/UserModal.svelte';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { VariantColors } from '../../index.js';
|
|
4
|
+
export type ActivityItemBadge = {
|
|
5
|
+
text: string;
|
|
6
|
+
class: string;
|
|
7
|
+
};
|
|
8
|
+
export type ActivityItemAction = {
|
|
9
|
+
label: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
};
|
|
12
|
+
export type ActivityItem = {
|
|
13
|
+
title: string;
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
badges?: ActivityItemBadge[];
|
|
16
|
+
actions?: ActivityItemAction[];
|
|
17
|
+
};
|
|
18
|
+
export type ActivityListProps = {
|
|
19
|
+
title?: string;
|
|
20
|
+
items?: ActivityItem[];
|
|
21
|
+
color?: VariantColors;
|
|
22
|
+
class?: ClassValue;
|
|
23
|
+
headerClass?: ClassValue;
|
|
24
|
+
titleClass?: ClassValue;
|
|
25
|
+
contentClass?: ClassValue;
|
|
26
|
+
itemClass?: ClassValue;
|
|
27
|
+
onItemClick?: (item: ActivityItem, index: number) => void;
|
|
28
|
+
children?: Snippet;
|
|
29
|
+
testId?: string;
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { Component } from 'svelte';
|
|
4
|
+
import type { VariantColors } from '../../index.js';
|
|
5
|
+
import type { ProgressSegment } from '../../elements/progress/progress-types.js';
|
|
6
|
+
export type CardProps = {
|
|
7
|
+
color?: VariantColors;
|
|
8
|
+
title?: string;
|
|
9
|
+
class?: ClassValue;
|
|
10
|
+
/** @deprecated Use titleClass instead */
|
|
11
|
+
titleclass?: ClassValue;
|
|
12
|
+
titleClass?: ClassValue;
|
|
13
|
+
/** @deprecated Use bodyClass instead */
|
|
14
|
+
bodyclass?: ClassValue;
|
|
15
|
+
bodyClass?: ClassValue;
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
custom?: Snippet;
|
|
18
|
+
testId?: string;
|
|
19
|
+
};
|
|
20
|
+
export type AlertProps = {
|
|
21
|
+
title?: string;
|
|
22
|
+
message: string;
|
|
23
|
+
color?: VariantColors;
|
|
24
|
+
class?: ClassValue;
|
|
25
|
+
onclose?: () => void;
|
|
26
|
+
footer?: Snippet;
|
|
27
|
+
icon?: Component;
|
|
28
|
+
testId?: string;
|
|
29
|
+
};
|
|
30
|
+
export type MetricDetail = {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string | number;
|
|
33
|
+
color?: VariantColors;
|
|
34
|
+
};
|
|
35
|
+
export type MetricCardProps = {
|
|
36
|
+
title: string;
|
|
37
|
+
value: string | number;
|
|
38
|
+
details?: MetricDetail[];
|
|
39
|
+
percent?: number;
|
|
40
|
+
segments?: ProgressSegment[];
|
|
41
|
+
class?: ClassValue;
|
|
42
|
+
testId?: string;
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,8 +2,8 @@ export declare const metricCard: import("tailwind-variants").TVReturnType<{
|
|
|
2
2
|
[key: string]: {
|
|
3
3
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
4
4
|
base?: import("tailwind-merge").ClassNameValue;
|
|
5
|
-
title?: import("tailwind-merge").ClassNameValue;
|
|
6
5
|
value?: import("tailwind-merge").ClassNameValue;
|
|
6
|
+
title?: import("tailwind-merge").ClassNameValue;
|
|
7
7
|
progress?: import("tailwind-merge").ClassNameValue;
|
|
8
8
|
detail?: import("tailwind-merge").ClassNameValue;
|
|
9
9
|
};
|
|
@@ -12,8 +12,8 @@ export declare const metricCard: import("tailwind-variants").TVReturnType<{
|
|
|
12
12
|
[x: string]: {
|
|
13
13
|
[x: string]: import("tailwind-merge").ClassNameValue | {
|
|
14
14
|
base?: import("tailwind-merge").ClassNameValue;
|
|
15
|
-
title?: import("tailwind-merge").ClassNameValue;
|
|
16
15
|
value?: import("tailwind-merge").ClassNameValue;
|
|
16
|
+
title?: import("tailwind-merge").ClassNameValue;
|
|
17
17
|
progress?: import("tailwind-merge").ClassNameValue;
|
|
18
18
|
detail?: import("tailwind-merge").ClassNameValue;
|
|
19
19
|
};
|
|
@@ -28,8 +28,8 @@ export declare const metricCard: import("tailwind-variants").TVReturnType<{
|
|
|
28
28
|
[key: string]: {
|
|
29
29
|
[key: string]: import("tailwind-merge").ClassNameValue | {
|
|
30
30
|
base?: import("tailwind-merge").ClassNameValue;
|
|
31
|
-
title?: import("tailwind-merge").ClassNameValue;
|
|
32
31
|
value?: import("tailwind-merge").ClassNameValue;
|
|
32
|
+
title?: import("tailwind-merge").ClassNameValue;
|
|
33
33
|
progress?: import("tailwind-merge").ClassNameValue;
|
|
34
34
|
detail?: import("tailwind-merge").ClassNameValue;
|
|
35
35
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { Component } from 'svelte';
|
|
4
|
+
export type NavbarLinkItem = {
|
|
5
|
+
label: string;
|
|
6
|
+
href: string;
|
|
7
|
+
icon?: Component;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
children?: NavbarLinkItem[];
|
|
10
|
+
};
|
|
11
|
+
export type NavbarProps = {
|
|
12
|
+
logo?: string | Component;
|
|
13
|
+
links?: NavbarLinkItem[];
|
|
14
|
+
class?: ClassValue;
|
|
15
|
+
brand?: Snippet;
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
actions?: Snippet;
|
|
18
|
+
testId?: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { resolve } from '$app/paths';
|
|
7
7
|
import { buildTestId } from '../../helper/testid.js';
|
|
8
8
|
|
|
9
|
-
let { items = [], logo, footer, testId }: SidebarProps = $props();
|
|
9
|
+
let { items = [], logo, belowLogo, footer, testId }: SidebarProps = $props();
|
|
10
10
|
let menubar: MenuBar = $state({
|
|
11
11
|
collapsed: false
|
|
12
12
|
});
|
|
@@ -115,6 +115,15 @@
|
|
|
115
115
|
</button>
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
|
+
{#if belowLogo}
|
|
119
|
+
<div
|
|
120
|
+
class="shrink-0 border-b border-white/10 px-3 py-3"
|
|
121
|
+
data-testid={buildTestId('sidebar', 'below-logo', testId)}
|
|
122
|
+
>
|
|
123
|
+
{@render belowLogo({ collapsed: menubar.collapsed })}
|
|
124
|
+
</div>
|
|
125
|
+
{/if}
|
|
126
|
+
|
|
118
127
|
<div class="flex flex-1 flex-col overflow-y-auto bg-gradient-to-b from-transparent to-black/20">
|
|
119
128
|
<nav class="flex-1 space-y-6 px-2 py-4">
|
|
120
129
|
{#each navigationItems as item, index (index)}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { Component } from 'svelte';
|
|
4
|
+
export type MenuBar = {
|
|
5
|
+
collapsed: boolean;
|
|
6
|
+
};
|
|
7
|
+
export interface BaseNavigationItem {
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
export interface WithIcon {
|
|
11
|
+
Icon?: Component;
|
|
12
|
+
}
|
|
13
|
+
export interface Activatable {
|
|
14
|
+
active?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface LinkItem extends BaseNavigationItem, WithIcon, Activatable {
|
|
17
|
+
href: string;
|
|
18
|
+
meta?: string;
|
|
19
|
+
/**
|
|
20
|
+
* When true, the link will be active if the current route starts with this href.
|
|
21
|
+
* Example: href="/tushar" will be active for "/tushar/overview" and "/tushar/profile"
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
matchPartial?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface ParentItem extends BaseNavigationItem, Activatable {
|
|
27
|
+
children: LinkItem[];
|
|
28
|
+
}
|
|
29
|
+
export interface DividerItem {
|
|
30
|
+
type: 'horizontal-divider';
|
|
31
|
+
}
|
|
32
|
+
export type NavigationItem = LinkItem | ParentItem | DividerItem;
|
|
33
|
+
export type LogoType = {
|
|
34
|
+
src?: string;
|
|
35
|
+
title: string;
|
|
36
|
+
};
|
|
37
|
+
export interface NavGroupProps {
|
|
38
|
+
labelArea: Snippet<[string, string]>;
|
|
39
|
+
active?: boolean;
|
|
40
|
+
children?: Snippet;
|
|
41
|
+
class?: ClassValue;
|
|
42
|
+
testId?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface NavItemProps {
|
|
45
|
+
href: string;
|
|
46
|
+
active?: boolean;
|
|
47
|
+
children: Snippet<[ClassValue]>;
|
|
48
|
+
class?: ClassValue;
|
|
49
|
+
testId?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface SidebarProps {
|
|
52
|
+
items?: NavigationItem[];
|
|
53
|
+
logo: LogoType;
|
|
54
|
+
/** Optional snippet between the logo row and the navigation (receives collapse state) */
|
|
55
|
+
belowLogo?: Snippet<[{
|
|
56
|
+
collapsed: boolean;
|
|
57
|
+
}]>;
|
|
58
|
+
/** Optional footer snippet rendered at the bottom of the sidebar */
|
|
59
|
+
footer?: Snippet<[{
|
|
60
|
+
collapsed: boolean;
|
|
61
|
+
}]>;
|
|
62
|
+
testId?: string;
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export type DataRow = Record<string, any>;
|
|
4
|
+
export type KeyType = keyof DataRow;
|
|
5
|
+
export type StatusType = 'active' | 'inactive' | 'pending' | 'error' | 'default';
|
|
6
|
+
export type TableColumn<T extends DataRow = any> = {
|
|
7
|
+
key: KeyType;
|
|
8
|
+
header: string;
|
|
9
|
+
cell?: Snippet<[row: T, key: KeyType, index?: number]>;
|
|
10
|
+
sortable?: boolean;
|
|
11
|
+
sortKey?: string;
|
|
12
|
+
align?: 'left' | 'center' | 'right';
|
|
13
|
+
width?: string;
|
|
14
|
+
class?: ClassValue;
|
|
15
|
+
};
|
|
16
|
+
export type SortDirection = 'asc' | 'desc' | null;
|
|
17
|
+
export type SortState = {
|
|
18
|
+
column: string | null;
|
|
19
|
+
direction: SortDirection;
|
|
20
|
+
};
|
|
21
|
+
export type TableProps<T extends DataRow = any> = {
|
|
22
|
+
data: T[];
|
|
23
|
+
columns: TableColumn<T>[];
|
|
24
|
+
bordered?: boolean;
|
|
25
|
+
striped?: boolean;
|
|
26
|
+
pageSize?: number;
|
|
27
|
+
currentPage?: number;
|
|
28
|
+
totalItems?: number;
|
|
29
|
+
selectable?: boolean;
|
|
30
|
+
selected?: T[];
|
|
31
|
+
class?: ClassValue;
|
|
32
|
+
/** @deprecated Use wrapperClass instead */
|
|
33
|
+
wrapperclass?: ClassValue;
|
|
34
|
+
wrapperClass?: ClassValue;
|
|
35
|
+
/** @deprecated Use tableClass instead */
|
|
36
|
+
tableclass?: ClassValue;
|
|
37
|
+
tableClass?: ClassValue;
|
|
38
|
+
/** @deprecated Use theadClass instead */
|
|
39
|
+
theadclass?: ClassValue;
|
|
40
|
+
theadClass?: ClassValue;
|
|
41
|
+
/** @deprecated Use tbodyClass instead */
|
|
42
|
+
tbodyclass?: ClassValue;
|
|
43
|
+
tbodyClass?: ClassValue;
|
|
44
|
+
/** @deprecated Use trClass instead */
|
|
45
|
+
trclass?: ClassValue;
|
|
46
|
+
trClass?: ClassValue;
|
|
47
|
+
/** @deprecated Use thClass instead */
|
|
48
|
+
thclass?: ClassValue;
|
|
49
|
+
thClass?: ClassValue;
|
|
50
|
+
/** @deprecated Use tdClass instead */
|
|
51
|
+
tdclass?: ClassValue;
|
|
52
|
+
tdClass?: ClassValue;
|
|
53
|
+
/** @deprecated Use footerClass instead */
|
|
54
|
+
footerclass?: ClassValue;
|
|
55
|
+
footerClass?: ClassValue;
|
|
56
|
+
/** @deprecated Use paginationClass instead */
|
|
57
|
+
paginationclass?: ClassValue;
|
|
58
|
+
paginationClass?: ClassValue;
|
|
59
|
+
onrowclick?: (row: T, index: number) => void;
|
|
60
|
+
onsort?: (sortState: SortState) => void;
|
|
61
|
+
onselect?: (selected: T[]) => void;
|
|
62
|
+
onpagechange?: (page: number) => void;
|
|
63
|
+
/** @deprecated Use rowClass instead */
|
|
64
|
+
rowclass?: (row: T, index: number) => ClassValue;
|
|
65
|
+
rowClass?: (row: T, index: number) => ClassValue;
|
|
66
|
+
loading?: boolean;
|
|
67
|
+
expandedContent?: Snippet<[T]>;
|
|
68
|
+
pagination?: boolean;
|
|
69
|
+
showPagination?: boolean;
|
|
70
|
+
showPageSize?: boolean;
|
|
71
|
+
pageSizeOptions?: number[];
|
|
72
|
+
onpagesizechange?: (pageSize: number) => void;
|
|
73
|
+
paginationPosition?: 'top' | 'bottom' | 'both';
|
|
74
|
+
paginationTemplate?: 'simple' | 'full';
|
|
75
|
+
title?: string;
|
|
76
|
+
subtitle?: string;
|
|
77
|
+
headerActions?: Snippet;
|
|
78
|
+
selectAllScope?: 'page' | 'all';
|
|
79
|
+
rowKey?: string;
|
|
80
|
+
expandable?: boolean;
|
|
81
|
+
testId?: string;
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { Component } from 'svelte';
|
|
4
|
+
import type { VariantColors, VariantSizes } from '../../index.js';
|
|
5
|
+
export type TabItem = {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: Component;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type TabProps = {
|
|
12
|
+
value: string;
|
|
13
|
+
label: string;
|
|
14
|
+
icon?: Component;
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
color?: VariantColors;
|
|
18
|
+
size?: VariantSizes;
|
|
19
|
+
variant?: 'line' | 'pill';
|
|
20
|
+
onclick?: (event: Event) => void;
|
|
21
|
+
testId?: string;
|
|
22
|
+
};
|
|
23
|
+
export type TabsGroupProps = {
|
|
24
|
+
tabs: TabItem[];
|
|
25
|
+
selected?: string;
|
|
26
|
+
color?: VariantColors;
|
|
27
|
+
size?: VariantSizes;
|
|
28
|
+
variant?: 'line' | 'pill';
|
|
29
|
+
class?: ClassValue;
|
|
30
|
+
listClass?: ClassValue;
|
|
31
|
+
triggerClass?: ClassValue;
|
|
32
|
+
panelClass?: ClassValue;
|
|
33
|
+
children?: Snippet<[active: string]>;
|
|
34
|
+
onchange?: (value: string) => void;
|
|
35
|
+
testId?: string;
|
|
36
|
+
};
|
|
37
|
+
export type TabContentProps = {
|
|
38
|
+
value: string;
|
|
39
|
+
persisted?: boolean;
|
|
40
|
+
panelClass?: ClassValue;
|
|
41
|
+
children?: Snippet<[value: string]>;
|
|
42
|
+
testId?: string;
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { VariantSizes } from '../index.js';
|
|
4
|
+
export type ModalProps = {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
onclose?: () => void;
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
size?: VariantSizes;
|
|
10
|
+
hideCloseButton?: boolean;
|
|
11
|
+
class?: ClassValue;
|
|
12
|
+
/** @deprecated Use contentClass instead */
|
|
13
|
+
contentclass?: ClassValue;
|
|
14
|
+
contentClass?: ClassValue;
|
|
15
|
+
/** @deprecated Use bodyClass instead */
|
|
16
|
+
bodyclass?: ClassValue;
|
|
17
|
+
bodyClass?: ClassValue;
|
|
18
|
+
/** @deprecated Use titleClass instead */
|
|
19
|
+
titleclass?: ClassValue;
|
|
20
|
+
titleClass?: ClassValue;
|
|
21
|
+
/** @deprecated Use headerClass instead */
|
|
22
|
+
headerclass?: ClassValue;
|
|
23
|
+
headerClass?: ClassValue;
|
|
24
|
+
/** @deprecated Use backdropClass instead */
|
|
25
|
+
backdropclass?: ClassValue;
|
|
26
|
+
backdropClass?: ClassValue;
|
|
27
|
+
/** @deprecated Use footerClass instead */
|
|
28
|
+
footerclass?: ClassValue;
|
|
29
|
+
footerClass?: ClassValue;
|
|
30
|
+
children?: Snippet;
|
|
31
|
+
footer?: Snippet;
|
|
32
|
+
header?: Snippet;
|
|
33
|
+
testId?: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ambient module declarations for echarts tree-shakable imports.
|
|
3
|
+
*
|
|
4
|
+
* ECharts v6 ships .d.ts files for each subpath (core.d.ts, charts.d.ts,
|
|
5
|
+
* components.d.ts, renderers.d.ts), but its package.json "exports" map
|
|
6
|
+
* does not include "types" conditions for these subpaths. Under TypeScript's
|
|
7
|
+
* "nodenext" module resolution this prevents the types from being found.
|
|
8
|
+
*
|
|
9
|
+
* These declarations bridge the gap by re-exporting from the internal
|
|
10
|
+
* typed paths that ARE listed in the exports map.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
declare module 'echarts/core' {
|
|
14
|
+
export * from 'echarts/types/dist/core';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare module 'echarts/charts' {
|
|
18
|
+
export * from 'echarts/types/dist/charts';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module 'echarts/components' {
|
|
22
|
+
export * from 'echarts/types/dist/components';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare module 'echarts/renderers' {
|
|
26
|
+
export * from 'echarts/types/dist/renderers';
|
|
27
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
export interface GetUsersOptions {
|
|
3
|
+
page: number;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
sortBy?: string;
|
|
6
|
+
sortOrder?: 'asc' | 'desc';
|
|
7
|
+
query?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GetUsersResult {
|
|
10
|
+
users: User[];
|
|
11
|
+
totalUsers: number;
|
|
12
|
+
}
|
|
13
|
+
export interface UserEmail {
|
|
14
|
+
email_address: string;
|
|
15
|
+
verified?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface UserPhone {
|
|
18
|
+
phone_number: string;
|
|
19
|
+
verified?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface User {
|
|
22
|
+
id: string;
|
|
23
|
+
first_name?: string;
|
|
24
|
+
last_name?: string;
|
|
25
|
+
username?: string;
|
|
26
|
+
email_addresses?: UserEmail[];
|
|
27
|
+
phone_numbers?: UserPhone[];
|
|
28
|
+
image_url?: string;
|
|
29
|
+
created_at?: number;
|
|
30
|
+
last_sign_in_at?: number;
|
|
31
|
+
private_metadata?: Record<string, unknown>;
|
|
32
|
+
public_metadata?: Record<string, unknown>;
|
|
33
|
+
permissions?: string[];
|
|
34
|
+
role?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface Permission {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
category?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface Role {
|
|
43
|
+
value: string;
|
|
44
|
+
label: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
permissions: string[];
|
|
47
|
+
}
|
|
48
|
+
export interface UserTableProps {
|
|
49
|
+
users: User[];
|
|
50
|
+
loading?: boolean;
|
|
51
|
+
currentPage?: number;
|
|
52
|
+
pageSize?: number;
|
|
53
|
+
totalUsers?: number;
|
|
54
|
+
onPageChange: (page: number) => void;
|
|
55
|
+
onPageSizeChange: (size: number) => void;
|
|
56
|
+
onSort?: (state: {
|
|
57
|
+
column: string | null;
|
|
58
|
+
direction: 'asc' | 'desc' | null;
|
|
59
|
+
}) => void;
|
|
60
|
+
onView: (user: User) => void;
|
|
61
|
+
onEdit: (user: User) => void;
|
|
62
|
+
onDelete: (userId: string) => void;
|
|
63
|
+
class?: ClassValue;
|
|
64
|
+
testId?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface UserModalProps {
|
|
67
|
+
open?: boolean;
|
|
68
|
+
user?: User | null;
|
|
69
|
+
roles?: Role[];
|
|
70
|
+
adapter?: UserManagementAdapter;
|
|
71
|
+
loadingPermissions?: boolean;
|
|
72
|
+
onSave: (user: User, mode: 'create' | 'edit') => void | Promise<void>;
|
|
73
|
+
onClose?: () => void;
|
|
74
|
+
class?: ClassValue;
|
|
75
|
+
testId?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface UserViewModalProps {
|
|
78
|
+
open?: boolean;
|
|
79
|
+
user: User | null;
|
|
80
|
+
permissions?: Permission[];
|
|
81
|
+
roles?: Role[];
|
|
82
|
+
onEdit?: (user: User) => void;
|
|
83
|
+
onRegenerateApiKey?: (userId: string) => Promise<void>;
|
|
84
|
+
onClose: () => void;
|
|
85
|
+
class?: ClassValue;
|
|
86
|
+
testId?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* User Management Adapter Interface
|
|
90
|
+
*
|
|
91
|
+
* Defines the contract for user management adapters.
|
|
92
|
+
* Adapters can be remote function modules (returning RemoteQuery/RemoteCommand)
|
|
93
|
+
* or regular async function modules (returning Promise).
|
|
94
|
+
*
|
|
95
|
+
* Uses PromiseLike to accept both Promise and RemoteQuery/RemoteCommand types.
|
|
96
|
+
*/
|
|
97
|
+
export interface UserManagementAdapter {
|
|
98
|
+
getUsers: (options: GetUsersOptions) => PromiseLike<GetUsersResult>;
|
|
99
|
+
createUser: (userData: Partial<User>) => PromiseLike<User>;
|
|
100
|
+
updateUser: (options: {
|
|
101
|
+
userId: string;
|
|
102
|
+
userData: Partial<User>;
|
|
103
|
+
}) => PromiseLike<User>;
|
|
104
|
+
deleteUser: (userId: string) => PromiseLike<void>;
|
|
105
|
+
deleteUsers: (userIds: string[]) => PromiseLike<void>;
|
|
106
|
+
getUserPermissions: (userId: string) => PromiseLike<string[]>;
|
|
107
|
+
updateUserPermissions: (options: {
|
|
108
|
+
userId: string;
|
|
109
|
+
permissions: string[];
|
|
110
|
+
}) => PromiseLike<void>;
|
|
111
|
+
generateApiKey?: (options: {
|
|
112
|
+
userId: string;
|
|
113
|
+
permissions: string[];
|
|
114
|
+
revokeOld?: boolean;
|
|
115
|
+
}) => PromiseLike<{
|
|
116
|
+
success: boolean;
|
|
117
|
+
apiKey: string;
|
|
118
|
+
message: string;
|
|
119
|
+
verificationWarning?: string;
|
|
120
|
+
}>;
|
|
121
|
+
verifyToken?: (options: {
|
|
122
|
+
apiKey: string;
|
|
123
|
+
}) => PromiseLike<{
|
|
124
|
+
valid: boolean;
|
|
125
|
+
scopes?: string[];
|
|
126
|
+
error?: string;
|
|
127
|
+
token?: string;
|
|
128
|
+
}>;
|
|
129
|
+
}
|
|
130
|
+
export interface UserManagementProps {
|
|
131
|
+
/**
|
|
132
|
+
* Adapter module containing remote functions or async functions
|
|
133
|
+
* Should be imported from a .remote.ts file
|
|
134
|
+
* If not provided, uses the default adapter from @makolabs/ripple
|
|
135
|
+
*
|
|
136
|
+
* Example:
|
|
137
|
+
* ```ts
|
|
138
|
+
* import * as adapter from './adapter.remote';
|
|
139
|
+
* <UserManagement adapter={adapter} roles={roles} />
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
adapter: UserManagementAdapter;
|
|
143
|
+
/**
|
|
144
|
+
* Available roles for user assignment
|
|
145
|
+
*/
|
|
146
|
+
roles?: Role[];
|
|
147
|
+
/**
|
|
148
|
+
* Available permissions for display (optional)
|
|
149
|
+
*/
|
|
150
|
+
permissions?: Permission[];
|
|
151
|
+
class?: ClassValue;
|
|
152
|
+
testId?: string;
|
|
153
|
+
}
|
|
154
|
+
export interface FormErrors {
|
|
155
|
+
[key: string]: string;
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|