@makolabs/ripple 0.0.1-dev.7 → 0.0.1-dev.9
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 +25 -44
- 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 +20 -26
- 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
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import type { ClassValue } from 'tailwind-variants';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { VariantColors } from '../../
|
|
3
|
+
import type { VariantColors } from '../../index.js';
|
|
4
|
+
import { Color } from '../../variants.js';
|
|
4
5
|
export declare const statsCard: import("tailwind-variants").TVReturnType<{
|
|
5
6
|
color: {
|
|
6
|
-
|
|
7
|
+
[Color.DEFAULT]: {
|
|
7
8
|
label: string;
|
|
8
9
|
value: string;
|
|
9
10
|
trend: string;
|
|
10
11
|
previousValue: string;
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
[Color.PRIMARY]: {
|
|
13
14
|
label: string;
|
|
14
15
|
value: string;
|
|
15
16
|
trend: string;
|
|
16
17
|
previousValue: string;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
[Color.SECONDARY]: {
|
|
19
20
|
label: string;
|
|
20
21
|
value: string;
|
|
21
22
|
trend: string;
|
|
22
23
|
previousValue: string;
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
[Color.INFO]: {
|
|
25
26
|
label: string;
|
|
26
27
|
value: string;
|
|
27
28
|
trend: string;
|
|
28
29
|
previousValue: string;
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
[Color.SUCCESS]: {
|
|
31
32
|
label: string;
|
|
32
33
|
value: string;
|
|
33
34
|
trend: string;
|
|
34
35
|
previousValue: string;
|
|
35
36
|
};
|
|
36
|
-
|
|
37
|
+
[Color.WARNING]: {
|
|
37
38
|
label: string;
|
|
38
39
|
value: string;
|
|
39
40
|
trend: string;
|
|
40
41
|
previousValue: string;
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
+
[Color.DANGER]: {
|
|
43
44
|
label: string;
|
|
44
45
|
value: string;
|
|
45
46
|
trend: string;
|
|
@@ -64,46 +65,45 @@ export declare const statsCard: import("tailwind-variants").TVReturnType<{
|
|
|
64
65
|
trend: string;
|
|
65
66
|
previousValue: string;
|
|
66
67
|
unit: string;
|
|
67
|
-
chartContainer: string;
|
|
68
68
|
}, undefined, {
|
|
69
69
|
color: {
|
|
70
|
-
|
|
70
|
+
[Color.DEFAULT]: {
|
|
71
71
|
label: string;
|
|
72
72
|
value: string;
|
|
73
73
|
trend: string;
|
|
74
74
|
previousValue: string;
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
[Color.PRIMARY]: {
|
|
77
77
|
label: string;
|
|
78
78
|
value: string;
|
|
79
79
|
trend: string;
|
|
80
80
|
previousValue: string;
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
[Color.SECONDARY]: {
|
|
83
83
|
label: string;
|
|
84
84
|
value: string;
|
|
85
85
|
trend: string;
|
|
86
86
|
previousValue: string;
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
[Color.INFO]: {
|
|
89
89
|
label: string;
|
|
90
90
|
value: string;
|
|
91
91
|
trend: string;
|
|
92
92
|
previousValue: string;
|
|
93
93
|
};
|
|
94
|
-
|
|
94
|
+
[Color.SUCCESS]: {
|
|
95
95
|
label: string;
|
|
96
96
|
value: string;
|
|
97
97
|
trend: string;
|
|
98
98
|
previousValue: string;
|
|
99
99
|
};
|
|
100
|
-
|
|
100
|
+
[Color.WARNING]: {
|
|
101
101
|
label: string;
|
|
102
102
|
value: string;
|
|
103
103
|
trend: string;
|
|
104
104
|
previousValue: string;
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
[Color.DANGER]: {
|
|
107
107
|
label: string;
|
|
108
108
|
value: string;
|
|
109
109
|
trend: string;
|
|
@@ -128,46 +128,45 @@ export declare const statsCard: import("tailwind-variants").TVReturnType<{
|
|
|
128
128
|
trend: string;
|
|
129
129
|
previousValue: string;
|
|
130
130
|
unit: string;
|
|
131
|
-
chartContainer: string;
|
|
132
131
|
}, import("tailwind-variants").TVReturnType<{
|
|
133
132
|
color: {
|
|
134
|
-
|
|
133
|
+
[Color.DEFAULT]: {
|
|
135
134
|
label: string;
|
|
136
135
|
value: string;
|
|
137
136
|
trend: string;
|
|
138
137
|
previousValue: string;
|
|
139
138
|
};
|
|
140
|
-
|
|
139
|
+
[Color.PRIMARY]: {
|
|
141
140
|
label: string;
|
|
142
141
|
value: string;
|
|
143
142
|
trend: string;
|
|
144
143
|
previousValue: string;
|
|
145
144
|
};
|
|
146
|
-
|
|
145
|
+
[Color.SECONDARY]: {
|
|
147
146
|
label: string;
|
|
148
147
|
value: string;
|
|
149
148
|
trend: string;
|
|
150
149
|
previousValue: string;
|
|
151
150
|
};
|
|
152
|
-
|
|
151
|
+
[Color.INFO]: {
|
|
153
152
|
label: string;
|
|
154
153
|
value: string;
|
|
155
154
|
trend: string;
|
|
156
155
|
previousValue: string;
|
|
157
156
|
};
|
|
158
|
-
|
|
157
|
+
[Color.SUCCESS]: {
|
|
159
158
|
label: string;
|
|
160
159
|
value: string;
|
|
161
160
|
trend: string;
|
|
162
161
|
previousValue: string;
|
|
163
162
|
};
|
|
164
|
-
|
|
163
|
+
[Color.WARNING]: {
|
|
165
164
|
label: string;
|
|
166
165
|
value: string;
|
|
167
166
|
trend: string;
|
|
168
167
|
previousValue: string;
|
|
169
168
|
};
|
|
170
|
-
|
|
169
|
+
[Color.DANGER]: {
|
|
171
170
|
label: string;
|
|
172
171
|
value: string;
|
|
173
172
|
trend: string;
|
|
@@ -192,7 +191,6 @@ export declare const statsCard: import("tailwind-variants").TVReturnType<{
|
|
|
192
191
|
trend: string;
|
|
193
192
|
previousValue: string;
|
|
194
193
|
unit: string;
|
|
195
|
-
chartContainer: string;
|
|
196
194
|
}, undefined, unknown, unknown, undefined>>;
|
|
197
195
|
export type StatsCardProps = {
|
|
198
196
|
label?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
|
+
import { Color } from '../../variants.js';
|
|
2
3
|
export const statsCard = tv({
|
|
3
4
|
slots: {
|
|
4
5
|
base: '',
|
|
@@ -7,47 +8,46 @@ export const statsCard = tv({
|
|
|
7
8
|
trend: '',
|
|
8
9
|
previousValue: '',
|
|
9
10
|
unit: '',
|
|
10
|
-
chartContainer: ''
|
|
11
11
|
},
|
|
12
12
|
variants: {
|
|
13
13
|
color: {
|
|
14
|
-
|
|
15
|
-
label: 'text-
|
|
16
|
-
value: 'text-
|
|
17
|
-
trend: 'text-
|
|
18
|
-
previousValue: 'text-
|
|
14
|
+
[Color.DEFAULT]: {
|
|
15
|
+
label: 'text-default-500',
|
|
16
|
+
value: 'text-default-900',
|
|
17
|
+
trend: 'text-default-600',
|
|
18
|
+
previousValue: 'text-default-500'
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
[Color.PRIMARY]: {
|
|
21
21
|
label: 'text-primary-500',
|
|
22
22
|
value: 'text-primary-600',
|
|
23
23
|
trend: 'text-primary-600',
|
|
24
24
|
previousValue: 'text-primary-400'
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
[Color.SECONDARY]: {
|
|
27
27
|
label: 'text-secondary-500',
|
|
28
28
|
value: 'text-secondary-600',
|
|
29
29
|
trend: 'text-secondary-600',
|
|
30
30
|
previousValue: 'text-secondary-400'
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
[Color.INFO]: {
|
|
33
33
|
label: 'text-info-500',
|
|
34
34
|
value: 'text-info-600',
|
|
35
35
|
trend: 'text-info-600',
|
|
36
36
|
previousValue: 'text-info-400'
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
[Color.SUCCESS]: {
|
|
39
39
|
label: 'text-success-500',
|
|
40
40
|
value: 'text-success-600',
|
|
41
41
|
trend: 'text-success-600',
|
|
42
42
|
previousValue: 'text-success-400'
|
|
43
43
|
},
|
|
44
|
-
|
|
44
|
+
[Color.WARNING]: {
|
|
45
45
|
label: 'text-warning-500',
|
|
46
46
|
value: 'text-warning-600',
|
|
47
47
|
trend: 'text-warning-600',
|
|
48
48
|
previousValue: 'text-warning-400'
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
[Color.DANGER]: {
|
|
51
51
|
label: 'text-danger-500',
|
|
52
52
|
value: 'text-danger-600',
|
|
53
53
|
trend: 'text-danger-600',
|
|
@@ -67,7 +67,7 @@ export const statsCard = tv({
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
defaultVariants: {
|
|
70
|
-
color:
|
|
70
|
+
color: Color.DEFAULT,
|
|
71
71
|
trendDirection: 'neutral'
|
|
72
72
|
}
|
|
73
73
|
});
|
|
@@ -198,31 +198,8 @@ export declare const navbar: import("tailwind-variants").TVReturnType<{
|
|
|
198
198
|
export type NavbarProps = {
|
|
199
199
|
logo?: string | Component;
|
|
200
200
|
links?: NavbarLinkItem[];
|
|
201
|
-
color?: keyof typeof navbar.variants.color;
|
|
202
|
-
size?: keyof typeof navbar.variants.size;
|
|
203
201
|
class?: ClassValue;
|
|
204
|
-
wrapperClass?: ClassValue;
|
|
205
|
-
brandClass?: ClassValue;
|
|
206
|
-
menuClass?: ClassValue;
|
|
207
|
-
mobileMenuClass?: ClassValue;
|
|
208
|
-
linksClass?: ClassValue;
|
|
209
|
-
linkClass?: ClassValue;
|
|
210
|
-
mobileLinkClass?: ClassValue;
|
|
211
|
-
actionsClass?: ClassValue;
|
|
212
|
-
sticky?: boolean;
|
|
213
202
|
brand?: Snippet;
|
|
214
203
|
children?: Snippet;
|
|
215
204
|
actions?: Snippet;
|
|
216
|
-
userMenu?: boolean;
|
|
217
|
-
username?: string;
|
|
218
|
-
userAvatar?: string;
|
|
219
|
-
userMenuItems?: {
|
|
220
|
-
label: string;
|
|
221
|
-
href: string;
|
|
222
|
-
onClick?: () => void;
|
|
223
|
-
}[];
|
|
224
|
-
onmenuitemclick?: (item: {
|
|
225
|
-
label: string;
|
|
226
|
-
href: string;
|
|
227
|
-
}) => void;
|
|
228
205
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from 'svelte';
|
|
3
|
-
import type { MenuBar, NavGroupProps } from '
|
|
3
|
+
import type { MenuBar, NavGroupProps } from '../../index.js';
|
|
4
4
|
import { cn } from '../../helper/cls.js';
|
|
5
5
|
|
|
6
6
|
let {
|
|
@@ -28,15 +28,18 @@
|
|
|
28
28
|
|
|
29
29
|
const navGroupClasses = $derived(
|
|
30
30
|
cn(
|
|
31
|
-
`
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
`items-center gap-x-3 p-1.5 rounded-md w-full cursor-pointer text-gray-400 text-sm/6 text-left font-medium`,
|
|
32
|
+
{
|
|
33
|
+
'font-semibold ': isActive,
|
|
34
|
+
hidden: menubar.collapsed,
|
|
35
|
+
'hidden xl:flex': !menubar.collapsed
|
|
36
|
+
},
|
|
34
37
|
className
|
|
35
38
|
)
|
|
36
39
|
);
|
|
37
40
|
|
|
38
41
|
const chevronIconClasses = $derived(
|
|
39
|
-
cn('size-4 text-
|
|
42
|
+
cn('size-4 text-default-600 shrink-0', {
|
|
40
43
|
'rotate-90': isActive,
|
|
41
44
|
'-ml-2 xl:ml-auto': !menubar.collapsed,
|
|
42
45
|
'-ml-2': menubar.collapsed
|
|
@@ -50,57 +53,35 @@
|
|
|
50
53
|
})
|
|
51
54
|
);
|
|
52
55
|
|
|
53
|
-
const
|
|
54
|
-
cn('
|
|
55
|
-
'
|
|
56
|
-
'xl:static xl:shadow-none xl:bg-transparent mt-0 xl:mt-1 xl:w-auto xl:h-auto':
|
|
57
|
-
!menubar.collapsed
|
|
58
|
-
})
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const toggleButtonClasses = $derived(
|
|
62
|
-
cn('bg-slate-900 w-72 pl-3 h-8 flex p-2', {
|
|
63
|
-
'xl:hidden': isActive && !menubar.collapsed
|
|
56
|
+
const iconClasses = $derived(
|
|
57
|
+
cn('size-6 shrink-0 text-default-600', {
|
|
58
|
+
'flex xl:hidden': !menubar.collapsed
|
|
64
59
|
})
|
|
65
60
|
);
|
|
66
61
|
|
|
67
|
-
const
|
|
68
|
-
cn('
|
|
69
|
-
'bg-
|
|
70
|
-
'xl:
|
|
62
|
+
const topDivClasses = $derived(
|
|
63
|
+
cn('overflow-hidden transition-all duration-200', {
|
|
64
|
+
'bg-transparent mt-0 mt-1 w-auto': !menubar.collapsed,
|
|
65
|
+
'xl:hidden': !isActive,
|
|
66
|
+
'hidden xl:block': menubar.collapsed
|
|
71
67
|
})
|
|
72
68
|
);
|
|
73
69
|
</script>
|
|
74
70
|
|
|
75
|
-
<svelte:window onresize={resetIsActive} />
|
|
76
|
-
|
|
77
71
|
<div>
|
|
78
72
|
<button type="button" class={navGroupClasses} onclick={toggle}>
|
|
79
|
-
{@render labelArea(labelClasses)}
|
|
80
|
-
{@render
|
|
73
|
+
{@render labelArea(labelClasses, iconClasses)}
|
|
74
|
+
{@render ChevronIcon(chevronIconClasses, 0.7)}
|
|
81
75
|
</button>
|
|
82
76
|
|
|
83
|
-
{
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class="flex h-7 w-7 cursor-pointer items-center justify-center gap-x-3
|
|
89
|
-
rounded-md bg-slate-800 text-left text-sm/6 text-gray-700"
|
|
90
|
-
onclick={toggle}
|
|
91
|
-
>
|
|
92
|
-
{@render Icon('size-4 shrink-0 -rotate-180 text-gray-600', 0.7)}
|
|
93
|
-
</button>
|
|
94
|
-
</div>
|
|
95
|
-
<ul class={navUlClasses}>
|
|
96
|
-
{@render children?.()}
|
|
97
|
-
</ul>
|
|
98
|
-
</div>
|
|
99
|
-
{/if}
|
|
77
|
+
<div class={topDivClasses}>
|
|
78
|
+
<ul>
|
|
79
|
+
{@render children?.()}
|
|
80
|
+
</ul>
|
|
81
|
+
</div>
|
|
100
82
|
</div>
|
|
101
83
|
|
|
102
|
-
|
|
103
|
-
{#snippet Icon(className: string, size: number)}
|
|
84
|
+
{#snippet ChevronIcon(className: string, size: number)}
|
|
104
85
|
<svg
|
|
105
86
|
xmlns="http://www.w3.org/2000/svg"
|
|
106
87
|
width="{size}em"
|
|
@@ -113,4 +94,4 @@
|
|
|
113
94
|
d="M5.74 3.2a.75.75 0 0 0-.04 1.06L9.227 8L5.7 11.74a.75.75 0 1 0 1.1 1.02l4-4.25a.75.75 0 0 0 0-1.02l-4-4.25a.75.75 0 0 0-1.06-.04"
|
|
114
95
|
/>
|
|
115
96
|
</svg>
|
|
116
|
-
{/snippet}
|
|
97
|
+
{/snippet}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { getContext } from 'svelte';
|
|
4
|
-
import type { MenuBar, NavItemProps } from '
|
|
4
|
+
import type { MenuBar, NavItemProps } from '../../index.js';
|
|
5
5
|
import { cn } from '../../helper/cls.js';
|
|
6
6
|
|
|
7
7
|
let { href, children, active, class: className = '' }: NavItemProps = $props();
|
|
@@ -2,13 +2,7 @@
|
|
|
2
2
|
import NavGroup from './NavGroup.svelte';
|
|
3
3
|
import NavItem from './NavItem.svelte';
|
|
4
4
|
import { setContext } from 'svelte';
|
|
5
|
-
import type {
|
|
6
|
-
MenuBar,
|
|
7
|
-
NavigationItem,
|
|
8
|
-
SidebarProps,
|
|
9
|
-
ParentItem,
|
|
10
|
-
LinkItem
|
|
11
|
-
} from './sidebar.js';
|
|
5
|
+
import type { MenuBar, NavigationItem, SidebarProps, ParentItem, LinkItem } from '../../index.js';
|
|
12
6
|
import clsx from 'clsx';
|
|
13
7
|
import { cn } from '../../helper/cls.js';
|
|
14
8
|
import { isRouteActive } from '../../helper/nav.svelte.js';
|
|
@@ -36,7 +30,7 @@
|
|
|
36
30
|
let anyChildActive = false;
|
|
37
31
|
|
|
38
32
|
const updatedChildren = parentItem.children.map((child) => {
|
|
39
|
-
const childActive = isRouteActive(child.href);
|
|
33
|
+
const childActive = isRouteActive(child.href, true);
|
|
40
34
|
if (childActive) {
|
|
41
35
|
anyChildActive = true;
|
|
42
36
|
}
|
|
@@ -69,7 +63,7 @@
|
|
|
69
63
|
);
|
|
70
64
|
|
|
71
65
|
const logoTextClasses = $derived(
|
|
72
|
-
clsx('text-xl font-semibold hidden text-white', { 'xl:block': !menubar.collapsed })
|
|
66
|
+
clsx('text-xl font-semibold hidden text-white truncate', { 'xl:block': !menubar.collapsed })
|
|
73
67
|
);
|
|
74
68
|
|
|
75
69
|
const logoWrapperClasses = $derived(
|
|
@@ -90,18 +84,7 @@
|
|
|
90
84
|
{/if}
|
|
91
85
|
</div>
|
|
92
86
|
<button onclick={toggle} class="hidden cursor-pointer xl:block" aria-label="Toggle Sidebar">
|
|
93
|
-
|
|
94
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
95
|
-
width="0.8em"
|
|
96
|
-
height="0.8em"
|
|
97
|
-
viewBox="0 0 24 24"
|
|
98
|
-
class="size-6 shrink-0 text-gray-600"
|
|
99
|
-
>
|
|
100
|
-
<path
|
|
101
|
-
fill="currentColor"
|
|
102
|
-
d="M3 17h18a1 1 0 0 1 .117 1.993L21 19H3a1 1 0 0 1-.117-1.993zh18zm0-6l18-.002a1 1 0 0 1 .117 1.993l-.117.007L3 13a1 1 0 0 1-.117-1.993zl18-.002zm0-6h18a1 1 0 0 1 .117 1.993L21 7H3a1 1 0 0 1-.117-1.993zh18z"
|
|
103
|
-
/>
|
|
104
|
-
</svg>
|
|
87
|
+
{@render ToggleIcon()}
|
|
105
88
|
</button>
|
|
106
89
|
</div>
|
|
107
90
|
<nav class="flex flex-1 flex-col">
|
|
@@ -112,11 +95,7 @@
|
|
|
112
95
|
{:else if 'children' in item}
|
|
113
96
|
<NavGroup active={item.active}>
|
|
114
97
|
{#snippet labelArea(classes)}
|
|
115
|
-
{
|
|
116
|
-
{@const Icon = item.Icon}
|
|
117
|
-
<Icon class="size-6 shrink-0 text-gray-600" />
|
|
118
|
-
{/if}
|
|
119
|
-
<span class={cn(classes)}>{item.label}</span>
|
|
98
|
+
<span class={classes}>{item.label}</span>
|
|
120
99
|
{/snippet}
|
|
121
100
|
{#each item.children as child (child.label)}
|
|
122
101
|
<NavItem href={child.href} active={child.active}>
|
|
@@ -143,3 +122,18 @@
|
|
|
143
122
|
</ul>
|
|
144
123
|
</nav>
|
|
145
124
|
</div>
|
|
125
|
+
|
|
126
|
+
{#snippet ToggleIcon(classes = 'size-6 shrink-0 text-gray-600')}
|
|
127
|
+
<svg
|
|
128
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
129
|
+
width="0.8em"
|
|
130
|
+
height="0.8em"
|
|
131
|
+
viewBox="0 0 24 24"
|
|
132
|
+
class={classes}
|
|
133
|
+
>
|
|
134
|
+
<path
|
|
135
|
+
fill="currentColor"
|
|
136
|
+
d="M3 17h18a1 1 0 0 1 .117 1.993L21 19H3a1 1 0 0 1-.117-1.993zh18zm0-6l18-.002a1 1 0 0 1 .117 1.993l-.117.007L3 13a1 1 0 0 1-.117-1.993zl18-.002zm0-6h18a1 1 0 0 1 .117 1.993L21 7H3a1 1 0 0 1-.117-1.993zh18z"
|
|
137
|
+
/>
|
|
138
|
+
</svg>
|
|
139
|
+
{/snippet}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ClassValue } from 'tailwind-variants';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { VariantColors, VariantSizes } from '../../
|
|
3
|
+
import type { VariantColors, VariantSizes } from '../../index.js';
|
|
4
4
|
export type DataRow = Record<string, any>;
|
|
5
5
|
export type KeyType = keyof DataRow;
|
|
6
6
|
export type StatusType = 'active' | 'inactive' | 'pending' | 'error' | 'default';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ClassValue } from 'tailwind-variants';
|
|
2
2
|
import type { Component, Snippet } from 'svelte';
|
|
3
|
-
import type { VariantColors, VariantSizes } from '../../
|
|
3
|
+
import type { VariantColors, VariantSizes } from '../../index.js';
|
|
4
4
|
export type TabItem = {
|
|
5
5
|
value: string;
|
|
6
6
|
label: string;
|
package/dist/modal/Modal.svelte
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
import { fade, scale } from 'svelte/transition';
|
|
5
5
|
import { quintOut } from 'svelte/easing';
|
|
6
6
|
import { cn } from '../helper/cls.js';
|
|
7
|
-
import { modal
|
|
7
|
+
import { modal } from './modal.js';
|
|
8
|
+
import type { MakeModalProps } from '../index.js';
|
|
8
9
|
|
|
9
10
|
let {
|
|
10
11
|
open = $bindable(false),
|
package/dist/modal/modal.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { VariantSizes } from '../types/variants.js';
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
1
|
export declare const modal: import("tailwind-variants").TVReturnType<{
|
|
4
2
|
open: {
|
|
5
3
|
true: {
|
|
@@ -211,24 +209,3 @@ export declare const modal: import("tailwind-variants").TVReturnType<{
|
|
|
211
209
|
title: string;
|
|
212
210
|
closeButton: string;
|
|
213
211
|
}, undefined, unknown, unknown, undefined>>;
|
|
214
|
-
export type MakeModalProps = {
|
|
215
|
-
open?: boolean;
|
|
216
|
-
onclose?: () => void;
|
|
217
|
-
title?: string;
|
|
218
|
-
description?: string;
|
|
219
|
-
hideCloseButton?: boolean;
|
|
220
|
-
closeOnBackdropClick?: boolean;
|
|
221
|
-
closeOnEsc?: boolean;
|
|
222
|
-
position?: keyof typeof modal.variants.position;
|
|
223
|
-
size?: VariantSizes;
|
|
224
|
-
class?: string;
|
|
225
|
-
backdropclass?: string;
|
|
226
|
-
contentclass?: string;
|
|
227
|
-
headerclass?: string;
|
|
228
|
-
bodyclass?: string;
|
|
229
|
-
titleclass?: string;
|
|
230
|
-
children?: Snippet;
|
|
231
|
-
header?: Snippet;
|
|
232
|
-
footer?: Snippet;
|
|
233
|
-
custom?: Snippet;
|
|
234
|
-
};
|
package/dist/types/variants.d.ts
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
readonly DEFAULT: "default";
|
|
3
|
-
readonly PRIMARY: "primary";
|
|
4
|
-
readonly SECONDARY: "secondary";
|
|
5
|
-
readonly INFO: "info";
|
|
6
|
-
readonly SUCCESS: "success";
|
|
7
|
-
readonly WARNING: "warning";
|
|
8
|
-
readonly DANGER: "danger";
|
|
9
|
-
};
|
|
10
|
-
export type VariantColors = (typeof Color)[keyof typeof Color];
|
|
11
|
-
export declare const Size: {
|
|
12
|
-
readonly XS: "xs";
|
|
13
|
-
readonly SM: "sm";
|
|
14
|
-
readonly BASE: "base";
|
|
15
|
-
readonly LG: "lg";
|
|
16
|
-
readonly XL: "xl";
|
|
17
|
-
readonly XXL: "2xl";
|
|
18
|
-
};
|
|
19
|
-
export type VariantSizes = (typeof Size)[keyof typeof Size];
|
|
20
|
-
export declare const colors: VariantColors[];
|
|
21
|
-
export declare const sizes: VariantSizes[];
|
|
1
|
+
export {};
|
package/dist/types/variants.js
CHANGED
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
DEFAULT: 'default',
|
|
3
|
-
PRIMARY: 'primary',
|
|
4
|
-
SECONDARY: 'secondary',
|
|
5
|
-
INFO: 'info',
|
|
6
|
-
SUCCESS: 'success',
|
|
7
|
-
WARNING: 'warning',
|
|
8
|
-
DANGER: 'danger'
|
|
9
|
-
};
|
|
10
|
-
export const Size = {
|
|
11
|
-
XS: 'xs',
|
|
12
|
-
SM: 'sm',
|
|
13
|
-
BASE: 'base',
|
|
14
|
-
LG: 'lg',
|
|
15
|
-
XL: 'xl',
|
|
16
|
-
XXL: '2xl'
|
|
17
|
-
};
|
|
18
|
-
export const colors = Object.values(Color);
|
|
19
|
-
export const sizes = Object.values(Size);
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { VariantColors, VariantSizes } from './index.js';
|
|
2
|
+
export declare const Color: {
|
|
3
|
+
DEFAULT: string;
|
|
4
|
+
PRIMARY: string;
|
|
5
|
+
SECONDARY: string;
|
|
6
|
+
INFO: string;
|
|
7
|
+
SUCCESS: string;
|
|
8
|
+
WARNING: string;
|
|
9
|
+
DANGER: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const Size: {
|
|
12
|
+
XS: string;
|
|
13
|
+
SM: string;
|
|
14
|
+
BASE: string;
|
|
15
|
+
LG: string;
|
|
16
|
+
XL: string;
|
|
17
|
+
XXL: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const colors: VariantColors[];
|
|
20
|
+
export declare const sizes: VariantSizes[];
|
package/dist/variants.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const Color = {
|
|
2
|
+
DEFAULT: 'default',
|
|
3
|
+
PRIMARY: 'primary',
|
|
4
|
+
SECONDARY: 'secondary',
|
|
5
|
+
INFO: 'info',
|
|
6
|
+
SUCCESS: 'success',
|
|
7
|
+
WARNING: 'warning',
|
|
8
|
+
DANGER: 'danger'
|
|
9
|
+
};
|
|
10
|
+
export const Size = {
|
|
11
|
+
XS: 'xs',
|
|
12
|
+
SM: 'sm',
|
|
13
|
+
BASE: 'base',
|
|
14
|
+
LG: 'lg',
|
|
15
|
+
XL: 'xl',
|
|
16
|
+
XXL: '2xl'
|
|
17
|
+
};
|
|
18
|
+
export const colors = Object.values(Color);
|
|
19
|
+
export const sizes = Object.values(Size);
|