@makolabs/ripple 0.0.1-dev.6 → 0.0.1-dev.8
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 +393 -53
- package/dist/button/Button.svelte +5 -3
- package/dist/button/Button.svelte.d.ts +1 -1
- package/dist/button/button.d.ts +40 -63
- package/dist/button/button.js +15 -14
- package/dist/charts/Chart.svelte +533 -0
- package/dist/charts/Chart.svelte.d.ts +4 -0
- package/dist/drawer/Drawer.svelte +13 -2
- package/dist/drawer/Drawer.svelte.d.ts +1 -1
- package/dist/drawer/drawer.d.ts +0 -17
- package/dist/elements/alert/Alert.svelte +53 -0
- package/dist/elements/alert/Alert.svelte.d.ts +4 -0
- package/dist/elements/badge/Badge.svelte +13 -5
- package/dist/elements/badge/Badge.svelte.d.ts +1 -1
- package/dist/elements/badge/badge.d.ts +0 -12
- package/dist/elements/dropdown/Dropdown.svelte +32 -37
- package/dist/elements/dropdown/Dropdown.svelte.d.ts +1 -1
- package/dist/elements/dropdown/Select.svelte +143 -59
- package/dist/elements/dropdown/Select.svelte.d.ts +1 -1
- package/dist/elements/dropdown/dropdown.d.ts +34 -57
- package/dist/elements/dropdown/dropdown.js +10 -4
- package/dist/elements/dropdown/select.d.ts +34 -54
- package/dist/elements/dropdown/select.js +22 -14
- package/dist/elements/file-upload/FileUpload.svelte +213 -0
- package/dist/elements/file-upload/FileUpload.svelte.d.ts +4 -0
- package/dist/elements/progress/Progress.svelte +87 -0
- package/dist/elements/progress/Progress.svelte.d.ts +4 -0
- package/dist/elements/timeline/Timeline.svelte +92 -0
- package/dist/elements/timeline/Timeline.svelte.d.ts +7 -0
- package/dist/forms/Checkbox.svelte +54 -0
- package/dist/forms/Checkbox.svelte.d.ts +4 -0
- package/dist/forms/DateRange.svelte +493 -0
- package/dist/forms/DateRange.svelte.d.ts +4 -0
- package/dist/forms/Form.svelte +39 -0
- package/dist/forms/Form.svelte.d.ts +4 -0
- package/dist/forms/Input.svelte +86 -0
- package/dist/forms/Input.svelte.d.ts +4 -0
- package/dist/forms/NumberInput.svelte +159 -0
- package/dist/forms/NumberInput.svelte.d.ts +4 -0
- package/dist/forms/RadioInputs.svelte +64 -0
- package/dist/forms/RadioInputs.svelte.d.ts +4 -0
- package/dist/forms/RadioPill.svelte +66 -0
- package/dist/forms/RadioPill.svelte.d.ts +4 -0
- package/dist/forms/Slider.svelte +342 -0
- package/dist/forms/Slider.svelte.d.ts +4 -0
- package/dist/forms/Tags.svelte +181 -0
- package/dist/forms/Tags.svelte.d.ts +4 -0
- package/dist/forms/Toggle.svelte +132 -0
- package/dist/forms/Toggle.svelte.d.ts +4 -0
- package/dist/forms/slider.d.ts +143 -0
- package/dist/forms/slider.js +62 -0
- package/dist/header/Breadcrumbs.svelte +2 -1
- package/dist/header/Breadcrumbs.svelte.d.ts +1 -1
- package/dist/header/PageHeader.svelte +2 -2
- package/dist/header/PageHeader.svelte.d.ts +1 -1
- package/dist/header/breadcrumbs.d.ts +20 -14
- package/dist/header/breadcrumbs.js +6 -0
- package/dist/header/pageheaders.d.ts +1 -1
- package/dist/helper/date.d.ts +7 -0
- package/dist/helper/date.js +15 -0
- package/dist/index.d.ts +742 -9
- package/dist/index.js +59 -16
- package/dist/layout/card/Card.svelte +5 -8
- package/dist/layout/card/Card.svelte.d.ts +1 -1
- package/dist/layout/card/StatsCard.svelte +116 -87
- package/dist/layout/card/card.d.ts +22 -33
- package/dist/layout/card/card.js +9 -8
- package/dist/layout/card/stats-card.d.ts +23 -25
- package/dist/layout/card/stats-card.js +13 -13
- package/dist/layout/navbar/navbar.d.ts +0 -23
- package/dist/layout/sidebar/NavGroup.svelte +33 -41
- package/dist/layout/sidebar/NavGroup.svelte.d.ts +1 -1
- package/dist/layout/sidebar/NavItem.svelte +1 -1
- package/dist/layout/sidebar/NavItem.svelte.d.ts +1 -1
- package/dist/layout/sidebar/Sidebar.svelte +19 -25
- package/dist/layout/sidebar/Sidebar.svelte.d.ts +1 -1
- package/dist/layout/table/table.d.ts +1 -1
- package/dist/layout/tabs/tabs.d.ts +1 -1
- package/dist/modal/Modal.svelte +2 -1
- package/dist/modal/Modal.svelte.d.ts +1 -1
- package/dist/modal/modal.d.ts +0 -23
- package/dist/sonner/sonner.svelte +13 -0
- package/dist/sonner/sonner.svelte.d.ts +4 -0
- package/dist/types/variants.d.ts +1 -21
- package/dist/types/variants.js +1 -19
- package/dist/variants.d.ts +20 -0
- package/dist/variants.js +19 -0
- package/package.json +6 -2
- package/dist/button/index.d.ts +0 -1
- package/dist/button/index.js +0 -1
- package/dist/drawer/index.d.ts +0 -2
- package/dist/drawer/index.js +0 -1
- package/dist/elements/badge/index.d.ts +0 -2
- package/dist/elements/badge/index.js +0 -2
- package/dist/elements/dropdown/index.d.ts +0 -3
- package/dist/elements/dropdown/index.js +0 -2
- package/dist/header/index.d.ts +0 -4
- package/dist/header/index.js +0 -2
- package/dist/layout/card/index.d.ts +0 -4
- package/dist/layout/card/index.js +0 -2
- package/dist/layout/index.d.ts +0 -5
- package/dist/layout/index.js +0 -5
- package/dist/layout/navbar/index.d.ts +0 -2
- package/dist/layout/navbar/index.js +0 -2
- package/dist/layout/sidebar/index.d.ts +0 -2
- package/dist/layout/sidebar/index.js +0 -1
- package/dist/layout/sidebar/sidebar.d.ts +0 -46
- package/dist/layout/sidebar/sidebar.js +0 -1
- package/dist/layout/table/index.d.ts +0 -3
- package/dist/layout/table/index.js +0 -2
- package/dist/layout/tabs/index.d.ts +0 -3
- package/dist/layout/tabs/index.js +0 -3
- package/dist/modal/index.d.ts +0 -1
- package/dist/modal/index.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,743 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Color, type Size } from './variants.js';
|
|
2
|
+
export type VariantColors = (typeof Color)[keyof typeof Color];
|
|
3
|
+
export type VariantSizes = (typeof Size)[keyof typeof Size];
|
|
4
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
|
+
import type { Component } from 'svelte';
|
|
7
|
+
import type { HTMLButtonAttributes, HTMLAttributeAnchorTarget } from 'svelte/elements';
|
|
8
|
+
import type { ECharts } from 'echarts/types/src/export/core.js';
|
|
9
|
+
import type { SuperForm } from 'sveltekit-superforms';
|
|
10
|
+
export type BadgeProps = {
|
|
11
|
+
size?: VariantSizes;
|
|
12
|
+
color?: VariantColors;
|
|
13
|
+
class?: ClassValue;
|
|
14
|
+
children: Snippet;
|
|
15
|
+
onclose?: (event: MouseEvent) => void;
|
|
16
|
+
};
|
|
17
|
+
export type BaseButtonProps = {
|
|
18
|
+
class?: ClassValue;
|
|
19
|
+
variant?: 'solid' | 'outline' | 'ghost' | 'link';
|
|
20
|
+
color?: VariantColors;
|
|
21
|
+
size?: VariantSizes;
|
|
22
|
+
rounded?: 'none' | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | 'full';
|
|
23
|
+
disabled?: boolean | undefined | null;
|
|
24
|
+
isLoading?: boolean;
|
|
25
|
+
children?: Snippet;
|
|
26
|
+
};
|
|
27
|
+
export type ButtonHTMLProps = {
|
|
28
|
+
href?: never;
|
|
29
|
+
} & HTMLButtonAttributes;
|
|
30
|
+
export type AnchorHTMLProps = {
|
|
31
|
+
rel?: string | undefined | null;
|
|
32
|
+
target?: HTMLAttributeAnchorTarget | undefined | null;
|
|
33
|
+
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;
|
|
34
|
+
href: string;
|
|
35
|
+
} & Record<string, unknown>;
|
|
36
|
+
export type ButtonProps = BaseButtonProps & (ButtonHTMLProps | AnchorHTMLProps);
|
|
37
|
+
export type MakeModalProps = {
|
|
38
|
+
open?: boolean;
|
|
39
|
+
onclose?: () => void;
|
|
40
|
+
title?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
hideCloseButton?: boolean;
|
|
43
|
+
closeOnBackdropClick?: boolean;
|
|
44
|
+
closeOnEsc?: boolean;
|
|
45
|
+
position?: 'top' | 'center' | 'bottom';
|
|
46
|
+
size?: VariantSizes;
|
|
47
|
+
class?: string;
|
|
48
|
+
backdropclass?: string;
|
|
49
|
+
contentclass?: string;
|
|
50
|
+
headerclass?: string;
|
|
51
|
+
bodyclass?: string;
|
|
52
|
+
titleclass?: string;
|
|
53
|
+
children?: Snippet;
|
|
54
|
+
header?: Snippet;
|
|
55
|
+
footer?: Snippet;
|
|
56
|
+
custom?: Snippet;
|
|
57
|
+
};
|
|
58
|
+
export type DrawerProps = {
|
|
59
|
+
open?: boolean;
|
|
60
|
+
onclose?: () => void;
|
|
61
|
+
title?: string;
|
|
62
|
+
position?: 'left' | 'right';
|
|
63
|
+
size?: VariantSizes;
|
|
64
|
+
class?: string;
|
|
65
|
+
backdropclass?: string;
|
|
66
|
+
contentclass?: string;
|
|
67
|
+
headerclass?: string;
|
|
68
|
+
bodyclass?: string;
|
|
69
|
+
titleclass?: string;
|
|
70
|
+
footerclass?: string;
|
|
71
|
+
children?: Snippet;
|
|
72
|
+
header?: Snippet;
|
|
73
|
+
footer?: Snippet;
|
|
74
|
+
};
|
|
75
|
+
export type DropdownItem = {
|
|
76
|
+
label: string;
|
|
77
|
+
href?: string;
|
|
78
|
+
icon?: Component;
|
|
79
|
+
onclick?: () => void;
|
|
80
|
+
active?: boolean;
|
|
81
|
+
};
|
|
82
|
+
export type DropSection = {
|
|
83
|
+
items: DropdownItem[];
|
|
84
|
+
};
|
|
85
|
+
export type DropHeaderConfig = {
|
|
86
|
+
title?: string;
|
|
87
|
+
subtitle?: string;
|
|
88
|
+
content?: Snippet<[]>;
|
|
89
|
+
class?: ClassValue;
|
|
90
|
+
titleClass?: ClassValue;
|
|
91
|
+
subtitleClass?: ClassValue;
|
|
92
|
+
onclick?: () => void;
|
|
93
|
+
};
|
|
94
|
+
export type DropdownMenuProps = {
|
|
95
|
+
open?: boolean;
|
|
96
|
+
sections: DropSection[];
|
|
97
|
+
label?: string;
|
|
98
|
+
icon?: Component;
|
|
99
|
+
containerClass?: ClassValue;
|
|
100
|
+
itemClass?: ClassValue;
|
|
101
|
+
class?: ClassValue;
|
|
102
|
+
size?: VariantSizes;
|
|
103
|
+
disabled?: boolean;
|
|
104
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
105
|
+
width?: string;
|
|
106
|
+
header?: DropHeaderConfig;
|
|
107
|
+
};
|
|
108
|
+
export type SelectItem = {
|
|
109
|
+
label: string;
|
|
110
|
+
value: string;
|
|
111
|
+
disabled?: boolean;
|
|
112
|
+
icon?: Component;
|
|
113
|
+
};
|
|
114
|
+
export type SelectProps = {
|
|
115
|
+
items: SelectItem[];
|
|
116
|
+
value?: string | string[];
|
|
117
|
+
multiple?: boolean;
|
|
118
|
+
placeholder?: string;
|
|
119
|
+
searchable?: boolean;
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
size?: VariantSizes;
|
|
122
|
+
class?: ClassValue;
|
|
123
|
+
containerClass?: ClassValue;
|
|
124
|
+
listClass?: ClassValue;
|
|
125
|
+
itemClass?: ClassValue;
|
|
126
|
+
triggerClass?: ClassValue;
|
|
127
|
+
searchInputClass?: ClassValue;
|
|
128
|
+
clearable?: boolean;
|
|
129
|
+
icon?: Component;
|
|
130
|
+
iconClass?: ClassValue;
|
|
131
|
+
onselect?: ({ value }: {
|
|
132
|
+
value: string | string[];
|
|
133
|
+
}) => void;
|
|
134
|
+
onopen?: () => void;
|
|
135
|
+
onclose?: () => void;
|
|
136
|
+
};
|
|
137
|
+
export type CardProps = {
|
|
138
|
+
color?: VariantColors;
|
|
139
|
+
title?: string;
|
|
140
|
+
class?: ClassValue;
|
|
141
|
+
titleclass?: ClassValue;
|
|
142
|
+
bodyclass?: ClassValue;
|
|
143
|
+
children?: Snippet;
|
|
144
|
+
custom?: Snippet;
|
|
145
|
+
};
|
|
146
|
+
export type AlertProps = {
|
|
147
|
+
title?: string;
|
|
148
|
+
message: string;
|
|
149
|
+
color?: VariantColors;
|
|
150
|
+
class?: string;
|
|
151
|
+
onclose?: () => void;
|
|
152
|
+
};
|
|
153
|
+
export type StatsCardProps = {
|
|
154
|
+
title: string;
|
|
155
|
+
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;
|
|
166
|
+
class?: ClassValue;
|
|
167
|
+
titleClass?: ClassValue;
|
|
168
|
+
valueClass?: ClassValue;
|
|
169
|
+
deltaClass?: ClassValue;
|
|
170
|
+
descriptionClass?: ClassValue;
|
|
171
|
+
iconClass?: ClassValue;
|
|
172
|
+
contentClass?: ClassValue;
|
|
173
|
+
trendClass?: ClassValue;
|
|
174
|
+
};
|
|
175
|
+
export type KeyType = string | number;
|
|
176
|
+
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;
|
|
186
|
+
sortable?: boolean;
|
|
187
|
+
align?: 'left' | 'center' | 'right';
|
|
188
|
+
width?: string;
|
|
189
|
+
cell?: (value: any, row: DataRow) => string | Snippet;
|
|
190
|
+
};
|
|
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;
|
|
201
|
+
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;
|
|
209
|
+
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
|
+
};
|
|
222
|
+
export type BreadcrumbItem = {
|
|
223
|
+
label: string;
|
|
224
|
+
href: string;
|
|
225
|
+
current?: boolean;
|
|
226
|
+
};
|
|
227
|
+
export type BreadcrumbsProps = {
|
|
228
|
+
items: BreadcrumbItem[];
|
|
229
|
+
size?: 'xs' | 'sm' | 'base' | 'lg';
|
|
230
|
+
weight?: 'normal' | 'medium' | 'semibold' | 'bold';
|
|
231
|
+
color?: VariantColors;
|
|
232
|
+
icon?: Component;
|
|
233
|
+
class?: string;
|
|
234
|
+
listclass?: string;
|
|
235
|
+
itemclass?: string;
|
|
236
|
+
separatorclass?: string;
|
|
237
|
+
wrapperclass?: string;
|
|
238
|
+
};
|
|
239
|
+
export type PageHeaderProps = {
|
|
240
|
+
title: string;
|
|
241
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
242
|
+
children?: Snippet;
|
|
243
|
+
class?: ClassValue;
|
|
244
|
+
titleclass?: ClassValue;
|
|
245
|
+
};
|
|
246
|
+
export type TabItem = {
|
|
247
|
+
value: string;
|
|
248
|
+
label: string;
|
|
249
|
+
icon?: Component;
|
|
250
|
+
disabled?: boolean;
|
|
251
|
+
};
|
|
252
|
+
export type TabsProps = {
|
|
253
|
+
tabs: TabItem[];
|
|
254
|
+
selected?: string;
|
|
255
|
+
color?: VariantColors;
|
|
256
|
+
size?: VariantSizes;
|
|
257
|
+
class?: ClassValue;
|
|
258
|
+
listClass?: ClassValue;
|
|
259
|
+
panelClass?: ClassValue;
|
|
260
|
+
onchange?: (value: string) => void;
|
|
261
|
+
children?: Snippet<[string]>;
|
|
262
|
+
};
|
|
263
|
+
export type NavbarLinkItem = {
|
|
264
|
+
label: string;
|
|
265
|
+
href: string;
|
|
266
|
+
icon?: Component;
|
|
267
|
+
active?: boolean;
|
|
268
|
+
children?: NavbarLinkItem[];
|
|
269
|
+
};
|
|
270
|
+
export type NavbarProps = {
|
|
271
|
+
logo?: string | Component;
|
|
272
|
+
links?: NavbarLinkItem[];
|
|
273
|
+
class?: ClassValue;
|
|
274
|
+
brand?: Snippet;
|
|
275
|
+
children?: Snippet;
|
|
276
|
+
actions?: Snippet;
|
|
277
|
+
};
|
|
278
|
+
export type MenuBar = {
|
|
279
|
+
collapsed: boolean;
|
|
280
|
+
};
|
|
281
|
+
export interface BaseNavigationItem {
|
|
282
|
+
label: string;
|
|
283
|
+
}
|
|
284
|
+
export interface WithIcon {
|
|
285
|
+
Icon?: Component;
|
|
286
|
+
}
|
|
287
|
+
export interface Activatable {
|
|
288
|
+
active?: boolean;
|
|
289
|
+
}
|
|
290
|
+
export interface LinkItem extends BaseNavigationItem, WithIcon, Activatable {
|
|
291
|
+
href: string;
|
|
292
|
+
meta?: string;
|
|
293
|
+
}
|
|
294
|
+
export interface ParentItem extends BaseNavigationItem, Activatable {
|
|
295
|
+
children: LinkItem[];
|
|
296
|
+
}
|
|
297
|
+
export interface DividerItem {
|
|
298
|
+
type: 'horizontal-divider';
|
|
299
|
+
}
|
|
300
|
+
export type NavigationItem = LinkItem | ParentItem | DividerItem;
|
|
301
|
+
export type LogoType = {
|
|
302
|
+
src?: string;
|
|
303
|
+
title: string;
|
|
304
|
+
};
|
|
305
|
+
export interface NavGroupProps {
|
|
306
|
+
labelArea: Snippet<[string, string]>;
|
|
307
|
+
active?: boolean;
|
|
308
|
+
children?: Snippet;
|
|
309
|
+
class?: ClassValue;
|
|
310
|
+
}
|
|
311
|
+
export interface NavItemProps {
|
|
312
|
+
href: string;
|
|
313
|
+
active?: boolean;
|
|
314
|
+
children: Snippet<[ClassValue]>;
|
|
315
|
+
class?: ClassValue;
|
|
316
|
+
}
|
|
317
|
+
export interface SidebarProps {
|
|
318
|
+
items?: NavigationItem[];
|
|
319
|
+
logo: LogoType;
|
|
320
|
+
}
|
|
9
321
|
export { tv, cn } from './helper/cls.js';
|
|
10
|
-
export
|
|
322
|
+
export { isRouteActive } from './helper/nav.svelte.js';
|
|
323
|
+
export { default as Button } from './button/Button.svelte';
|
|
324
|
+
export { default as Modal } from './modal/Modal.svelte';
|
|
325
|
+
export { default as Drawer } from './drawer/Drawer.svelte';
|
|
326
|
+
export { default as PageHeader } from './header/PageHeader.svelte';
|
|
327
|
+
export { default as Breadcrumbs } from './header/Breadcrumbs.svelte';
|
|
328
|
+
export { default as Badge } from './elements/badge/Badge.svelte';
|
|
329
|
+
export { default as Dropdown } from './elements/dropdown/Dropdown.svelte';
|
|
330
|
+
export { default as Select } from './elements/dropdown/Select.svelte';
|
|
331
|
+
export { default as Card } from './layout/card/Card.svelte';
|
|
332
|
+
export { default as StatsCard } from './layout/card/StatsCard.svelte';
|
|
333
|
+
export { default as Alert } from './elements/alert/Alert.svelte';
|
|
334
|
+
export { default as Tab } from './layout/tabs/Tab.svelte';
|
|
335
|
+
export { default as TabContent } from './layout/tabs/TabContent.svelte';
|
|
336
|
+
export { default as TabGroup } from './layout/tabs/TabGroup.svelte';
|
|
337
|
+
export { default as Table } from './layout/table/Table.svelte';
|
|
338
|
+
export { default as Cells } from './layout/table/Cells.svelte';
|
|
339
|
+
export { default as Navbar } from './layout/navbar/Navbar.svelte';
|
|
340
|
+
export { default as Sidebar } from './layout/sidebar/Sidebar.svelte';
|
|
341
|
+
export { default as NavItem } from './layout/sidebar/NavItem.svelte';
|
|
342
|
+
export { default as NavGroup } from './layout/sidebar/NavGroup.svelte';
|
|
343
|
+
export { dropdownMenu } from './elements/dropdown/dropdown.js';
|
|
344
|
+
export { badge } from './elements/badge/badge.js';
|
|
345
|
+
export { buttonVariants } from './button/button.js';
|
|
346
|
+
export { modal } from './modal/modal.js';
|
|
347
|
+
export { drawer } from './drawer/drawer.js';
|
|
348
|
+
export { selectTV } from './elements/dropdown/select.js';
|
|
349
|
+
export { breadcrumbs } from './header/breadcrumbs.js';
|
|
350
|
+
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';
|
|
359
|
+
export type ChartColorString = `#${string}` | keyof ChartColors;
|
|
360
|
+
export interface YAxisConfig<T> {
|
|
361
|
+
dataKey: keyof T & string;
|
|
362
|
+
label?: string;
|
|
363
|
+
unit?: string;
|
|
364
|
+
min?: number;
|
|
365
|
+
max?: number;
|
|
366
|
+
position?: 'left' | 'right';
|
|
367
|
+
format?: (value: any) => string;
|
|
368
|
+
color?: ChartColorString;
|
|
369
|
+
}
|
|
370
|
+
export interface XAxisConfig<T> {
|
|
371
|
+
dataKey: keyof T & string;
|
|
372
|
+
label?: string;
|
|
373
|
+
tick?: {
|
|
374
|
+
fontSize?: number;
|
|
375
|
+
rotate?: number;
|
|
376
|
+
interval?: number | 'auto' | 'preserveStartEnd';
|
|
377
|
+
};
|
|
378
|
+
format?: (value: any) => string;
|
|
379
|
+
}
|
|
380
|
+
export interface SeriesConfig<T> {
|
|
381
|
+
dataKey: keyof T & string;
|
|
382
|
+
name?: string;
|
|
383
|
+
type?: ChartType;
|
|
384
|
+
color?: ChartColorString;
|
|
385
|
+
yAxisIndex?: number;
|
|
386
|
+
stack?: string;
|
|
387
|
+
barWidth?: string;
|
|
388
|
+
showArea?: boolean;
|
|
389
|
+
showSymbol?: boolean;
|
|
390
|
+
showLabel?: boolean;
|
|
391
|
+
smooth?: boolean;
|
|
392
|
+
areaOpacity?: number;
|
|
393
|
+
lineWidth?: number;
|
|
394
|
+
opacity?: number;
|
|
395
|
+
lineStyle?: {
|
|
396
|
+
type?: 'solid' | 'dashed' | 'dotted';
|
|
397
|
+
width?: number;
|
|
398
|
+
color?: string;
|
|
399
|
+
};
|
|
400
|
+
emphasis?: {
|
|
401
|
+
focus?: 'series' | 'self' | 'none';
|
|
402
|
+
};
|
|
403
|
+
radius?: [string, string];
|
|
404
|
+
centerText?: string;
|
|
405
|
+
}
|
|
406
|
+
export interface ChartConfig<T> {
|
|
407
|
+
xAxis: XAxisConfig<T>;
|
|
408
|
+
yAxis: YAxisConfig<T>[];
|
|
409
|
+
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
|
+
}
|
|
440
|
+
export interface PointClickType<T> {
|
|
441
|
+
detail: {
|
|
442
|
+
seriesIndex: number;
|
|
443
|
+
dataIndex: number;
|
|
444
|
+
seriesName: string;
|
|
445
|
+
name: string;
|
|
446
|
+
value?: number | string | null;
|
|
447
|
+
originalData: T;
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
export interface ChartRenderType<T> {
|
|
451
|
+
detail: {
|
|
452
|
+
chart: ECharts;
|
|
453
|
+
options: ChartConfig<T>;
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
export interface ChartProps<T> {
|
|
457
|
+
data: T[];
|
|
458
|
+
config: ChartConfig<T>;
|
|
459
|
+
colors?: Partial<ChartColors>;
|
|
460
|
+
height?: string;
|
|
461
|
+
width?: string;
|
|
462
|
+
class?: string;
|
|
463
|
+
onpointclick?: (event: PointClickType<T>) => void;
|
|
464
|
+
onchartrender?: (event: ChartRenderType<T>) => void;
|
|
465
|
+
}
|
|
466
|
+
export { default as Chart } from './charts/Chart.svelte';
|
|
467
|
+
export interface FileUploadProps {
|
|
468
|
+
/**
|
|
469
|
+
* Array of allowed file MIME types or extensions
|
|
470
|
+
* @example ['image/jpeg', 'image/png']
|
|
471
|
+
*/
|
|
472
|
+
allowedMimeTypes?: string[];
|
|
473
|
+
/**
|
|
474
|
+
* Maximum file size in bytes;
|
|
475
|
+
*/
|
|
476
|
+
maxSize?: number;
|
|
477
|
+
/**
|
|
478
|
+
* Maximum number of files that can be uploaded; maxFiles<=0 is disabled, maxFiles=1 is singular, maxFiles>1 is multiple
|
|
479
|
+
* @default 10
|
|
480
|
+
*/
|
|
481
|
+
maxFiles?: number;
|
|
482
|
+
/**
|
|
483
|
+
* CSS class for the component container
|
|
484
|
+
*/
|
|
485
|
+
class?: string;
|
|
486
|
+
/**
|
|
487
|
+
* CSS class for the dropzone
|
|
488
|
+
*/
|
|
489
|
+
dropzoneClass?: string;
|
|
490
|
+
/**
|
|
491
|
+
* CSS class for the preview area
|
|
492
|
+
*/
|
|
493
|
+
previewClass?: string;
|
|
494
|
+
/**
|
|
495
|
+
* ID for the file input element
|
|
496
|
+
* @default 'file-upload'
|
|
497
|
+
*/
|
|
498
|
+
id?: string;
|
|
499
|
+
/**
|
|
500
|
+
* Callback when files are selected or dropped
|
|
501
|
+
*/
|
|
502
|
+
onfiles?: (files: FileList | File[]) => void;
|
|
503
|
+
/**
|
|
504
|
+
* Callback when a file is deleted
|
|
505
|
+
*/
|
|
506
|
+
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>;
|
|
531
|
+
}
|
|
532
|
+
export interface UploadedFile {
|
|
533
|
+
FileID: string;
|
|
534
|
+
OriginalFilename: string;
|
|
535
|
+
Size: number;
|
|
536
|
+
ContentType: string;
|
|
537
|
+
MD5Hash: string;
|
|
538
|
+
UploadTimestamp: string;
|
|
539
|
+
Expiry?: string;
|
|
540
|
+
CustomMetadata?: Record<string, string>;
|
|
541
|
+
/**
|
|
542
|
+
* Current status of the file
|
|
543
|
+
*/
|
|
544
|
+
status: 'uploading' | 'success' | 'error';
|
|
545
|
+
/**
|
|
546
|
+
* Upload progress (0-100)
|
|
547
|
+
*/
|
|
548
|
+
progress?: number;
|
|
549
|
+
/**
|
|
550
|
+
* Error message if upload failed
|
|
551
|
+
*/
|
|
552
|
+
error?: string;
|
|
553
|
+
}
|
|
554
|
+
export { default as FileUpload } from './elements/file-upload/FileUpload.svelte';
|
|
555
|
+
export { default as Toaster } from './sonner/sonner.svelte';
|
|
556
|
+
export interface FormProps<T extends Record<string, unknown>> {
|
|
557
|
+
form: SuperForm<any>;
|
|
558
|
+
class?: string;
|
|
559
|
+
method?: 'GET' | 'POST' | 'dialog' | 'get' | 'post' | 'DIALOG' | null | undefined;
|
|
560
|
+
action?: string;
|
|
561
|
+
enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain' | null | undefined;
|
|
562
|
+
autocomplete?: 'on' | 'off';
|
|
563
|
+
novalidate?: boolean;
|
|
564
|
+
children?: Snippet;
|
|
565
|
+
}
|
|
566
|
+
export type BaseInputProps = {
|
|
567
|
+
name: string;
|
|
568
|
+
label?: string;
|
|
569
|
+
placeholder?: string;
|
|
570
|
+
required?: boolean;
|
|
571
|
+
disabled?: boolean;
|
|
572
|
+
class?: string;
|
|
573
|
+
size?: VariantSizes;
|
|
574
|
+
color?: VariantColors;
|
|
575
|
+
id?: string;
|
|
576
|
+
errors?: string[];
|
|
577
|
+
};
|
|
578
|
+
export type InputProps = {
|
|
579
|
+
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'date' | 'textarea';
|
|
580
|
+
value?: string | number;
|
|
581
|
+
} & BaseInputProps;
|
|
582
|
+
export type RadioOption = {
|
|
583
|
+
value: string;
|
|
584
|
+
label: string;
|
|
585
|
+
};
|
|
586
|
+
export type RadioInputsProps = {
|
|
587
|
+
name: string;
|
|
588
|
+
label?: string;
|
|
589
|
+
options: RadioOption[];
|
|
590
|
+
value?: string;
|
|
591
|
+
disabled?: boolean;
|
|
592
|
+
class?: string;
|
|
593
|
+
size?: VariantSizes;
|
|
594
|
+
color?: VariantColors;
|
|
595
|
+
errors?: string[];
|
|
596
|
+
required?: boolean;
|
|
597
|
+
};
|
|
598
|
+
export type CheckboxProps = {
|
|
599
|
+
name: string;
|
|
600
|
+
label?: string;
|
|
601
|
+
value?: boolean;
|
|
602
|
+
disabled?: boolean;
|
|
603
|
+
class?: string;
|
|
604
|
+
size?: VariantSizes;
|
|
605
|
+
color?: VariantColors;
|
|
606
|
+
errors?: string[];
|
|
607
|
+
required?: boolean;
|
|
608
|
+
};
|
|
609
|
+
export interface ToggleProps {
|
|
610
|
+
name: string;
|
|
611
|
+
label?: string;
|
|
612
|
+
disabled?: boolean;
|
|
613
|
+
class?: string;
|
|
614
|
+
value?: boolean;
|
|
615
|
+
size?: VariantSizes;
|
|
616
|
+
color?: VariantColors;
|
|
617
|
+
id?: string;
|
|
618
|
+
errors?: string[];
|
|
619
|
+
offColor?: string;
|
|
620
|
+
onColor?: string;
|
|
621
|
+
}
|
|
622
|
+
export type CurrencyOption = {
|
|
623
|
+
value: string;
|
|
624
|
+
icon?: any;
|
|
625
|
+
};
|
|
626
|
+
export type NumberInputProps = {
|
|
627
|
+
value?: number;
|
|
628
|
+
name?: string;
|
|
629
|
+
label?: string;
|
|
630
|
+
placeholder?: string;
|
|
631
|
+
size?: VariantSizes;
|
|
632
|
+
class?: string;
|
|
633
|
+
unit?: string;
|
|
634
|
+
units?: CurrencyOption[];
|
|
635
|
+
errors?: string[];
|
|
636
|
+
disabled?: boolean;
|
|
637
|
+
dropdownicon?: any;
|
|
638
|
+
onunitchange?: (prevUnit: string, newUnit: string) => void;
|
|
639
|
+
};
|
|
640
|
+
export interface DateRangeProps {
|
|
641
|
+
startDate?: Date;
|
|
642
|
+
endDate?: Date;
|
|
643
|
+
minDate?: Date;
|
|
644
|
+
maxDate?: Date;
|
|
645
|
+
disabled?: boolean;
|
|
646
|
+
class?: string;
|
|
647
|
+
placeholder?: string;
|
|
648
|
+
startLabel?: string;
|
|
649
|
+
endLabel?: string;
|
|
650
|
+
format?: string;
|
|
651
|
+
onselect?: ({ startDate, endDate }: {
|
|
652
|
+
startDate?: Date;
|
|
653
|
+
endDate?: Date;
|
|
654
|
+
}) => void;
|
|
655
|
+
id?: string;
|
|
656
|
+
name?: string;
|
|
657
|
+
}
|
|
658
|
+
export interface DateSelectEvent {
|
|
659
|
+
startDate: Date | null;
|
|
660
|
+
endDate: Date | null;
|
|
661
|
+
}
|
|
662
|
+
export type TagsProps = {
|
|
663
|
+
value?: string[];
|
|
664
|
+
name?: string;
|
|
665
|
+
label?: string;
|
|
666
|
+
errors?: string[];
|
|
667
|
+
placeholder?: string;
|
|
668
|
+
size?: VariantSizes;
|
|
669
|
+
class?: string;
|
|
670
|
+
suggestions?: string[];
|
|
671
|
+
onaddtag?: (tag: string) => void;
|
|
672
|
+
onremovetag?: (tag: string) => void;
|
|
673
|
+
};
|
|
674
|
+
export { default as Form } from './forms/Form.svelte';
|
|
675
|
+
export { default as Input } from './forms/Input.svelte';
|
|
676
|
+
export { default as RadioInputs } from './forms/RadioInputs.svelte';
|
|
677
|
+
export { default as Checkbox } from './forms/Checkbox.svelte';
|
|
678
|
+
export { default as Toggle } from './forms/Toggle.svelte';
|
|
679
|
+
export { default as Slider } from './forms/Slider.svelte';
|
|
680
|
+
export { default as NumberInput } from './forms/NumberInput.svelte';
|
|
681
|
+
export { default as DateRange } from './forms/DateRange.svelte';
|
|
682
|
+
export { default as Tags } from './forms/Tags.svelte';
|
|
683
|
+
export { default as RadioPill } from './forms/RadioPill.svelte';
|
|
684
|
+
export type SliderMode = 'single' | 'range' | 'enum';
|
|
685
|
+
export type NotationType = 'standard' | 'compact' | 'scientific' | 'engineering';
|
|
686
|
+
export type EnumOption = {
|
|
687
|
+
value: string | number;
|
|
688
|
+
label: string;
|
|
689
|
+
};
|
|
690
|
+
export interface SliderProps {
|
|
691
|
+
name: string;
|
|
692
|
+
label?: string;
|
|
693
|
+
mode?: SliderMode;
|
|
694
|
+
disabled?: boolean;
|
|
695
|
+
size?: VariantSizes;
|
|
696
|
+
errors?: string[];
|
|
697
|
+
class?: string;
|
|
698
|
+
min?: number;
|
|
699
|
+
max?: number;
|
|
700
|
+
step?: number;
|
|
701
|
+
value?: number | string;
|
|
702
|
+
valueStart?: number;
|
|
703
|
+
valueEnd?: number;
|
|
704
|
+
showValue?: boolean;
|
|
705
|
+
valuePrefix?: string;
|
|
706
|
+
valueSuffix?: string;
|
|
707
|
+
options?: EnumOption[];
|
|
708
|
+
formatOptions?: Intl.NumberFormatOptions & {
|
|
709
|
+
notation?: NotationType;
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
export type ProgressProps = {
|
|
713
|
+
value: number;
|
|
714
|
+
max?: number;
|
|
715
|
+
size?: VariantSizes;
|
|
716
|
+
color?: VariantColors;
|
|
717
|
+
showLabel?: boolean;
|
|
718
|
+
labelPosition?: 'top' | 'bottom' | 'right';
|
|
719
|
+
class?: string;
|
|
720
|
+
labelClass?: string;
|
|
721
|
+
barClass?: string;
|
|
722
|
+
};
|
|
723
|
+
export { default as Progress } from './elements/progress/Progress.svelte';
|
|
724
|
+
export interface TimelineItem {
|
|
725
|
+
title: string;
|
|
726
|
+
time: Date | string;
|
|
727
|
+
link?: {
|
|
728
|
+
text: string;
|
|
729
|
+
url: string;
|
|
730
|
+
};
|
|
731
|
+
Icon?: Component;
|
|
732
|
+
details?: string;
|
|
733
|
+
}
|
|
734
|
+
export { default as Timeline } from './elements/timeline/Timeline.svelte';
|
|
735
|
+
export type RadioPillProps = {
|
|
736
|
+
name: string;
|
|
737
|
+
options: RadioOption[];
|
|
738
|
+
value?: string;
|
|
739
|
+
label?: string;
|
|
740
|
+
class?: string;
|
|
741
|
+
errors?: string[];
|
|
742
|
+
onchange?: (value: string) => void;
|
|
743
|
+
};
|