@makolabs/ripple 0.0.1-dev.3 → 0.0.1-dev.4
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 +229 -96
- package/dist/button/Button.svelte +46 -0
- package/dist/button/Button.svelte.d.ts +4 -0
- package/dist/button/button.d.ts +136 -0
- package/dist/button/button.js +167 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +1 -0
- package/dist/drawer/Drawer.svelte +213 -0
- package/dist/drawer/Drawer.svelte.d.ts +4 -0
- package/dist/drawer/drawer.d.ts +177 -0
- package/dist/drawer/drawer.js +80 -0
- package/dist/drawer/index.d.ts +2 -0
- package/dist/drawer/index.js +1 -0
- package/dist/elements/badge/Badge.svelte +35 -0
- package/dist/elements/badge/Badge.svelte.d.ts +4 -0
- package/dist/elements/badge/badge.d.ts +193 -0
- package/dist/elements/badge/badge.js +65 -0
- package/dist/elements/badge/index.d.ts +2 -0
- package/dist/elements/badge/index.js +2 -0
- package/dist/elements/dropdown/Dropdown.svelte +272 -0
- package/dist/elements/dropdown/Dropdown.svelte.d.ts +4 -0
- package/dist/elements/dropdown/Select.svelte +230 -0
- package/dist/elements/dropdown/Select.svelte.d.ts +4 -0
- package/dist/elements/dropdown/dropdown.d.ts +274 -0
- package/dist/elements/dropdown/dropdown.js +89 -0
- package/dist/elements/dropdown/index.d.ts +3 -0
- package/dist/elements/dropdown/index.js +2 -0
- package/dist/elements/dropdown/select.d.ts +220 -0
- package/dist/elements/dropdown/select.js +74 -0
- package/dist/header/Breadcrumbs.svelte +72 -0
- package/dist/header/Breadcrumbs.svelte.d.ts +4 -0
- package/dist/header/PageHeader.svelte +30 -0
- package/dist/header/PageHeader.svelte.d.ts +4 -0
- package/dist/header/breadcrumbs.d.ts +220 -0
- package/dist/header/breadcrumbs.js +81 -0
- package/dist/header/index.d.ts +4 -0
- package/dist/header/index.js +2 -0
- package/dist/header/pageheaders.d.ts +10 -0
- package/dist/header/pageheaders.js +1 -0
- package/dist/helper/cls.d.ts +1 -0
- package/dist/helper/cls.js +4 -0
- package/dist/helper/nav.svelte.d.ts +6 -0
- package/dist/helper/nav.svelte.js +23 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +18 -1
- package/dist/layout/card/Card.svelte +44 -0
- package/dist/layout/card/Card.svelte.d.ts +4 -0
- package/dist/layout/card/StatsCard.svelte +236 -0
- package/dist/layout/card/StatsCard.svelte.d.ts +4 -0
- package/dist/layout/card/card.d.ts +139 -0
- package/dist/layout/card/card.js +50 -0
- package/dist/layout/card/index.d.ts +4 -0
- package/dist/layout/card/index.js +2 -0
- package/dist/layout/card/stats-card.d.ts +208 -0
- package/dist/layout/card/stats-card.js +73 -0
- package/dist/layout/index.d.ts +7 -1
- package/dist/layout/index.js +7 -1
- package/dist/layout/navbar/Navbar.svelte +206 -0
- package/dist/layout/navbar/Navbar.svelte.d.ts +4 -0
- package/dist/layout/navbar/index.d.ts +2 -0
- package/dist/layout/navbar/index.js +2 -0
- package/dist/layout/navbar/navbar.d.ts +228 -0
- package/dist/layout/navbar/navbar.js +98 -0
- package/dist/layout/sidebar/NavGroup.svelte +101 -0
- package/dist/layout/sidebar/NavGroup.svelte.d.ts +4 -0
- package/dist/layout/sidebar/NavItem.svelte +29 -0
- package/dist/layout/sidebar/NavItem.svelte.d.ts +4 -0
- package/dist/layout/sidebar/Sidebar.svelte +145 -0
- package/dist/layout/sidebar/Sidebar.svelte.d.ts +4 -0
- package/dist/layout/sidebar/index.d.ts +2 -0
- package/dist/layout/sidebar/index.js +1 -0
- package/dist/layout/sidebar/sidebar.d.ts +46 -0
- package/dist/layout/sidebar/sidebar.js +1 -0
- package/dist/layout/table/Cells.svelte +111 -0
- package/dist/layout/table/Cells.svelte.d.ts +27 -0
- package/dist/layout/table/Table.svelte +413 -0
- package/dist/layout/table/Table.svelte.d.ts +4 -0
- package/dist/layout/table/index.d.ts +3 -0
- package/dist/layout/table/index.js +2 -0
- package/dist/layout/table/table.d.ts +303 -0
- package/dist/layout/table/table.js +149 -0
- package/dist/layout/tabs/Tab.svelte +57 -0
- package/dist/layout/tabs/Tab.svelte.d.ts +4 -0
- package/dist/layout/tabs/TabContent.svelte +31 -0
- package/dist/layout/tabs/TabContent.svelte.d.ts +4 -0
- package/dist/layout/tabs/TabGroup.svelte +57 -0
- package/dist/layout/tabs/TabGroup.svelte.d.ts +4 -0
- package/dist/layout/tabs/index.d.ts +3 -0
- package/dist/layout/tabs/index.js +3 -0
- package/dist/layout/tabs/tabs.d.ts +155 -0
- package/dist/layout/tabs/tabs.js +156 -0
- package/dist/modal/Modal.svelte +206 -0
- package/dist/modal/Modal.svelte.d.ts +4 -0
- package/dist/modal/index.d.ts +1 -0
- package/dist/modal/index.js +1 -0
- package/dist/modal/modal.d.ts +234 -0
- package/dist/modal/modal.js +81 -0
- package/dist/types/variants.d.ts +21 -0
- package/dist/types/variants.js +19 -0
- package/package.json +100 -102
- package/dist/layout/Card.svelte +0 -179
- package/dist/layout/Card.svelte.d.ts +0 -208
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { VariantSizes } from '../../types/variants.js';
|
|
3
|
+
import type { Component, Snippet } from 'svelte';
|
|
4
|
+
export declare const selectTV: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
size: {
|
|
6
|
+
xs: {
|
|
7
|
+
trigger: string;
|
|
8
|
+
triggerIcon: string;
|
|
9
|
+
container: string;
|
|
10
|
+
item: string;
|
|
11
|
+
base: string;
|
|
12
|
+
};
|
|
13
|
+
sm: {
|
|
14
|
+
trigger: string;
|
|
15
|
+
triggerIcon: string;
|
|
16
|
+
container: string;
|
|
17
|
+
item: string;
|
|
18
|
+
base: string;
|
|
19
|
+
};
|
|
20
|
+
base: {
|
|
21
|
+
trigger: string;
|
|
22
|
+
triggerIcon: string;
|
|
23
|
+
container: string;
|
|
24
|
+
item: string;
|
|
25
|
+
base: string;
|
|
26
|
+
};
|
|
27
|
+
lg: {
|
|
28
|
+
trigger: string;
|
|
29
|
+
triggerIcon: string;
|
|
30
|
+
container: string;
|
|
31
|
+
item: string;
|
|
32
|
+
base: string;
|
|
33
|
+
};
|
|
34
|
+
xl: {
|
|
35
|
+
trigger: string;
|
|
36
|
+
triggerIcon: string;
|
|
37
|
+
container: string;
|
|
38
|
+
item: string;
|
|
39
|
+
base: string;
|
|
40
|
+
};
|
|
41
|
+
'2xl': {
|
|
42
|
+
trigger: string;
|
|
43
|
+
triggerIcon: string;
|
|
44
|
+
container: string;
|
|
45
|
+
item: string;
|
|
46
|
+
base: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
disabled: {
|
|
50
|
+
true: {
|
|
51
|
+
trigger: string;
|
|
52
|
+
container: string;
|
|
53
|
+
item: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}, {
|
|
57
|
+
base: string;
|
|
58
|
+
trigger: string;
|
|
59
|
+
triggerIcon: string;
|
|
60
|
+
container: string;
|
|
61
|
+
searchInput: string;
|
|
62
|
+
list: string;
|
|
63
|
+
item: string;
|
|
64
|
+
emptyMessage: string;
|
|
65
|
+
}, undefined, {
|
|
66
|
+
size: {
|
|
67
|
+
xs: {
|
|
68
|
+
trigger: string;
|
|
69
|
+
triggerIcon: string;
|
|
70
|
+
container: string;
|
|
71
|
+
item: string;
|
|
72
|
+
base: string;
|
|
73
|
+
};
|
|
74
|
+
sm: {
|
|
75
|
+
trigger: string;
|
|
76
|
+
triggerIcon: string;
|
|
77
|
+
container: string;
|
|
78
|
+
item: string;
|
|
79
|
+
base: string;
|
|
80
|
+
};
|
|
81
|
+
base: {
|
|
82
|
+
trigger: string;
|
|
83
|
+
triggerIcon: string;
|
|
84
|
+
container: string;
|
|
85
|
+
item: string;
|
|
86
|
+
base: string;
|
|
87
|
+
};
|
|
88
|
+
lg: {
|
|
89
|
+
trigger: string;
|
|
90
|
+
triggerIcon: string;
|
|
91
|
+
container: string;
|
|
92
|
+
item: string;
|
|
93
|
+
base: string;
|
|
94
|
+
};
|
|
95
|
+
xl: {
|
|
96
|
+
trigger: string;
|
|
97
|
+
triggerIcon: string;
|
|
98
|
+
container: string;
|
|
99
|
+
item: string;
|
|
100
|
+
base: string;
|
|
101
|
+
};
|
|
102
|
+
'2xl': {
|
|
103
|
+
trigger: string;
|
|
104
|
+
triggerIcon: string;
|
|
105
|
+
container: string;
|
|
106
|
+
item: string;
|
|
107
|
+
base: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
disabled: {
|
|
111
|
+
true: {
|
|
112
|
+
trigger: string;
|
|
113
|
+
container: string;
|
|
114
|
+
item: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}, {
|
|
118
|
+
base: string;
|
|
119
|
+
trigger: string;
|
|
120
|
+
triggerIcon: string;
|
|
121
|
+
container: string;
|
|
122
|
+
searchInput: string;
|
|
123
|
+
list: string;
|
|
124
|
+
item: string;
|
|
125
|
+
emptyMessage: string;
|
|
126
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
127
|
+
size: {
|
|
128
|
+
xs: {
|
|
129
|
+
trigger: string;
|
|
130
|
+
triggerIcon: string;
|
|
131
|
+
container: string;
|
|
132
|
+
item: string;
|
|
133
|
+
base: string;
|
|
134
|
+
};
|
|
135
|
+
sm: {
|
|
136
|
+
trigger: string;
|
|
137
|
+
triggerIcon: string;
|
|
138
|
+
container: string;
|
|
139
|
+
item: string;
|
|
140
|
+
base: string;
|
|
141
|
+
};
|
|
142
|
+
base: {
|
|
143
|
+
trigger: string;
|
|
144
|
+
triggerIcon: string;
|
|
145
|
+
container: string;
|
|
146
|
+
item: string;
|
|
147
|
+
base: string;
|
|
148
|
+
};
|
|
149
|
+
lg: {
|
|
150
|
+
trigger: string;
|
|
151
|
+
triggerIcon: string;
|
|
152
|
+
container: string;
|
|
153
|
+
item: string;
|
|
154
|
+
base: string;
|
|
155
|
+
};
|
|
156
|
+
xl: {
|
|
157
|
+
trigger: string;
|
|
158
|
+
triggerIcon: string;
|
|
159
|
+
container: string;
|
|
160
|
+
item: string;
|
|
161
|
+
base: string;
|
|
162
|
+
};
|
|
163
|
+
'2xl': {
|
|
164
|
+
trigger: string;
|
|
165
|
+
triggerIcon: string;
|
|
166
|
+
container: string;
|
|
167
|
+
item: string;
|
|
168
|
+
base: string;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
disabled: {
|
|
172
|
+
true: {
|
|
173
|
+
trigger: string;
|
|
174
|
+
container: string;
|
|
175
|
+
item: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
}, {
|
|
179
|
+
base: string;
|
|
180
|
+
trigger: string;
|
|
181
|
+
triggerIcon: string;
|
|
182
|
+
container: string;
|
|
183
|
+
searchInput: string;
|
|
184
|
+
list: string;
|
|
185
|
+
item: string;
|
|
186
|
+
emptyMessage: string;
|
|
187
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
188
|
+
export type SelectItem = {
|
|
189
|
+
label: string;
|
|
190
|
+
value: string;
|
|
191
|
+
disabled?: boolean;
|
|
192
|
+
icon?: Component;
|
|
193
|
+
};
|
|
194
|
+
export type SelectProps = {
|
|
195
|
+
items: SelectItem[];
|
|
196
|
+
value?: string;
|
|
197
|
+
placeholder?: string;
|
|
198
|
+
searchable?: boolean;
|
|
199
|
+
disabled?: boolean;
|
|
200
|
+
size?: VariantSizes;
|
|
201
|
+
class?: ClassValue;
|
|
202
|
+
triggerClass?: ClassValue;
|
|
203
|
+
containerClass?: ClassValue;
|
|
204
|
+
listClass?: ClassValue;
|
|
205
|
+
itemClass?: ClassValue;
|
|
206
|
+
searchInputClass?: ClassValue;
|
|
207
|
+
emptyMessageText?: string;
|
|
208
|
+
clearable?: boolean;
|
|
209
|
+
icon?: Component;
|
|
210
|
+
iconClass?: ClassValue;
|
|
211
|
+
triggerContent?: Snippet<[{
|
|
212
|
+
selectedItem?: SelectItem;
|
|
213
|
+
open: boolean;
|
|
214
|
+
}]>;
|
|
215
|
+
onselect?: ({ value }: {
|
|
216
|
+
value?: string;
|
|
217
|
+
}) => void;
|
|
218
|
+
onopen?: () => void;
|
|
219
|
+
onclose?: () => void;
|
|
220
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
export const selectTV = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
base: 'relative inline-block',
|
|
5
|
+
trigger: `flex items-center justify-between w-full text-left focus:outline-none bg-white border
|
|
6
|
+
border-default-200 text-default-700 hover:border-default-300 rounded-md cursor-pointer`,
|
|
7
|
+
triggerIcon: 'transition-transform duration-200 text-default-500',
|
|
8
|
+
container: 'absolute z-50 w-full mt-1 bg-white overflow-clip border border-default-200 rounded-md shadow-md',
|
|
9
|
+
searchInput: 'w-full outline-none px-2 py-1.5 text-sm h-10 border-b border-b-default-200',
|
|
10
|
+
list: 'py-1 max-h-60 overflow-auto h-full',
|
|
11
|
+
item: `w-full px-3 py-2 text-sm text-left hover:bg-default-100 focus:bg-default-100
|
|
12
|
+
data-[selected=true]:bg-info-100 data-[selected=true]:text-info-500 truncate
|
|
13
|
+
data-[selected=true]:font-medium cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed
|
|
14
|
+
data-[highlighted=true]:bg-default-100 data-[highlighted=true]:text-default-700`,
|
|
15
|
+
emptyMessage: 'px-3 py-2 text-sm text-default-500'
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
size: {
|
|
19
|
+
xs: {
|
|
20
|
+
trigger: 'h-6 px-2 py-1 text-xs gap-1',
|
|
21
|
+
triggerIcon: 'h-3 w-3',
|
|
22
|
+
container: 'max-h-40',
|
|
23
|
+
item: 'px-2 py-1 text-xs',
|
|
24
|
+
base: 'w-24'
|
|
25
|
+
},
|
|
26
|
+
sm: {
|
|
27
|
+
trigger: 'h-8 px-2.5 py-1.5 text-xs gap-1.5',
|
|
28
|
+
triggerIcon: 'h-3.5 w-3.5',
|
|
29
|
+
container: 'max-h-48',
|
|
30
|
+
item: 'px-2.5 py-1.5 text-xs',
|
|
31
|
+
base: 'w-32'
|
|
32
|
+
},
|
|
33
|
+
base: {
|
|
34
|
+
trigger: 'h-10 px-3 py-2 text-sm gap-2',
|
|
35
|
+
triggerIcon: 'h-4 w-4',
|
|
36
|
+
container: 'max-h-60',
|
|
37
|
+
item: 'px-3 py-2 text-sm',
|
|
38
|
+
base: 'w-40'
|
|
39
|
+
},
|
|
40
|
+
lg: {
|
|
41
|
+
trigger: 'h-11 px-4 py-2.5 text-base gap-2.5',
|
|
42
|
+
triggerIcon: 'h-5 w-5',
|
|
43
|
+
container: 'max-h-72',
|
|
44
|
+
item: 'px-4 py-2.5 text-base',
|
|
45
|
+
base: 'w-48'
|
|
46
|
+
},
|
|
47
|
+
xl: {
|
|
48
|
+
trigger: 'h-12 px-5 py-3 text-lg gap-3',
|
|
49
|
+
triggerIcon: 'h-6 w-6',
|
|
50
|
+
container: 'max-h-80',
|
|
51
|
+
item: 'px-5 py-3 text-lg',
|
|
52
|
+
base: 'w-56'
|
|
53
|
+
},
|
|
54
|
+
'2xl': {
|
|
55
|
+
trigger: 'h-14 px-6 py-3.5 text-xl gap-4',
|
|
56
|
+
triggerIcon: 'h-7 w-7',
|
|
57
|
+
container: 'max-h-96',
|
|
58
|
+
item: 'px-6 py-3.5 text-xl',
|
|
59
|
+
base: 'w-64'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
disabled: {
|
|
63
|
+
true: {
|
|
64
|
+
trigger: 'opacity-50 cursor-not-allowed hover:border-default-200',
|
|
65
|
+
container: 'pointer-events-none',
|
|
66
|
+
item: 'disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
defaultVariants: {
|
|
71
|
+
size: 'base',
|
|
72
|
+
disabled: false
|
|
73
|
+
}
|
|
74
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../helper/cls.js';
|
|
3
|
+
import { breadcrumbs, type BreadcrumbsProps } from './breadcrumbs.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
items = [],
|
|
7
|
+
size = 'sm',
|
|
8
|
+
color = 'default',
|
|
9
|
+
weight = 'medium',
|
|
10
|
+
icon: Icon,
|
|
11
|
+
class: className = '',
|
|
12
|
+
listclass: listClassName = '',
|
|
13
|
+
itemclass: itemClassName = '',
|
|
14
|
+
separatorclass: separatorClassName = '',
|
|
15
|
+
wrapperclass: wrapperClassName = ''
|
|
16
|
+
}: BreadcrumbsProps = $props();
|
|
17
|
+
|
|
18
|
+
// Get the slots from the breadcrumbs
|
|
19
|
+
const { base, list, item, separator, wrapper } = $derived(
|
|
20
|
+
breadcrumbs({
|
|
21
|
+
size,
|
|
22
|
+
weight,
|
|
23
|
+
color
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const baseClass = $derived(cn(base(), className));
|
|
28
|
+
const listClass = $derived(cn(list(), listClassName));
|
|
29
|
+
const itemClasses = $derived(cn(item(), itemClassName));
|
|
30
|
+
const separatorClasses = $derived(cn(separator(), separatorClassName));
|
|
31
|
+
const wrapperClasses = $derived(cn(wrapper(), wrapperClassName));
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<nav class={baseClass} aria-label="Breadcrumb">
|
|
35
|
+
<ol role="list" class={listClass}>
|
|
36
|
+
{#each items as breadcrumbItem, index (index)}
|
|
37
|
+
<li>
|
|
38
|
+
<div class={wrapperClasses}>
|
|
39
|
+
{#if index > 0}
|
|
40
|
+
<span class={separatorClasses}>
|
|
41
|
+
{#if Icon}
|
|
42
|
+
<Icon />
|
|
43
|
+
{:else}
|
|
44
|
+
<svg
|
|
45
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
+
width="0.8em"
|
|
47
|
+
height="0.8em"
|
|
48
|
+
viewBox="0 0 16 16"
|
|
49
|
+
>
|
|
50
|
+
<path
|
|
51
|
+
fill="currentColor"
|
|
52
|
+
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"
|
|
53
|
+
/>
|
|
54
|
+
</svg>
|
|
55
|
+
{/if}
|
|
56
|
+
</span>
|
|
57
|
+
{/if}
|
|
58
|
+
<a
|
|
59
|
+
href={breadcrumbItem.href}
|
|
60
|
+
class={cn(
|
|
61
|
+
itemClasses,
|
|
62
|
+
breadcrumbItem.current ? breadcrumbs({ active: true }).item() : ''
|
|
63
|
+
)}
|
|
64
|
+
aria-current={breadcrumbItem.current ? 'page' : undefined}
|
|
65
|
+
>
|
|
66
|
+
{breadcrumbItem.label}
|
|
67
|
+
</a>
|
|
68
|
+
</div>
|
|
69
|
+
</li>
|
|
70
|
+
{/each}
|
|
71
|
+
</ol>
|
|
72
|
+
</nav>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../helper/cls.js';
|
|
3
|
+
import { type PageHeaderProps } from './pageheaders.js';
|
|
4
|
+
import Breadcrumbs from './Breadcrumbs.svelte';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
title,
|
|
8
|
+
breadcrumbs = [],
|
|
9
|
+
children,
|
|
10
|
+
class: className = '',
|
|
11
|
+
titleclass: titleClassName = ''
|
|
12
|
+
}: PageHeaderProps = $props();
|
|
13
|
+
|
|
14
|
+
const defaultTitleClasses =
|
|
15
|
+
'font-bold text-default-900 sm:tracking-tight sm:truncate text-2xl/7 sm:text-3xl mt-1';
|
|
16
|
+
const headerClasses = $derived(cn('space-y-3', className));
|
|
17
|
+
const hasBreadcrumbs = $derived(breadcrumbs && breadcrumbs.length > 0);
|
|
18
|
+
const titleClasses = $derived(cn(defaultTitleClasses, titleClassName));
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class={headerClasses}>
|
|
22
|
+
<div class="min-w-0 flex-1">
|
|
23
|
+
{#if hasBreadcrumbs}
|
|
24
|
+
<Breadcrumbs items={breadcrumbs} />
|
|
25
|
+
{/if}
|
|
26
|
+
<h2 class={titleClasses}>{title}</h2>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
{@render children?.()}
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
export type BreadcrumbItem = {
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
current?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const breadcrumbs: import("tailwind-variants").TVReturnType<{
|
|
8
|
+
size: {
|
|
9
|
+
sm: {
|
|
10
|
+
base: string;
|
|
11
|
+
};
|
|
12
|
+
base: {
|
|
13
|
+
base: string;
|
|
14
|
+
};
|
|
15
|
+
lg: {
|
|
16
|
+
base: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
weight: {
|
|
20
|
+
normal: {
|
|
21
|
+
item: string;
|
|
22
|
+
};
|
|
23
|
+
medium: {
|
|
24
|
+
item: string;
|
|
25
|
+
};
|
|
26
|
+
semibold: {
|
|
27
|
+
item: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
color: {
|
|
31
|
+
default: {
|
|
32
|
+
item: string;
|
|
33
|
+
wrapper: string;
|
|
34
|
+
};
|
|
35
|
+
primary: {
|
|
36
|
+
item: string;
|
|
37
|
+
wrapper: string;
|
|
38
|
+
};
|
|
39
|
+
secondary: {
|
|
40
|
+
item: string;
|
|
41
|
+
wrapper: string;
|
|
42
|
+
};
|
|
43
|
+
info: {
|
|
44
|
+
item: string;
|
|
45
|
+
wrapper: string;
|
|
46
|
+
};
|
|
47
|
+
success: {
|
|
48
|
+
item: string;
|
|
49
|
+
wrapper: string;
|
|
50
|
+
};
|
|
51
|
+
warning: {
|
|
52
|
+
item: string;
|
|
53
|
+
wrapper: string;
|
|
54
|
+
};
|
|
55
|
+
danger: {
|
|
56
|
+
item: string;
|
|
57
|
+
wrapper: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
active: {
|
|
61
|
+
true: {
|
|
62
|
+
item: string;
|
|
63
|
+
};
|
|
64
|
+
false: {
|
|
65
|
+
item: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}, {
|
|
69
|
+
base: string;
|
|
70
|
+
list: string;
|
|
71
|
+
item: string;
|
|
72
|
+
separator: string;
|
|
73
|
+
wrapper: string;
|
|
74
|
+
}, undefined, {
|
|
75
|
+
size: {
|
|
76
|
+
sm: {
|
|
77
|
+
base: string;
|
|
78
|
+
};
|
|
79
|
+
base: {
|
|
80
|
+
base: string;
|
|
81
|
+
};
|
|
82
|
+
lg: {
|
|
83
|
+
base: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
weight: {
|
|
87
|
+
normal: {
|
|
88
|
+
item: string;
|
|
89
|
+
};
|
|
90
|
+
medium: {
|
|
91
|
+
item: string;
|
|
92
|
+
};
|
|
93
|
+
semibold: {
|
|
94
|
+
item: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
color: {
|
|
98
|
+
default: {
|
|
99
|
+
item: string;
|
|
100
|
+
wrapper: string;
|
|
101
|
+
};
|
|
102
|
+
primary: {
|
|
103
|
+
item: string;
|
|
104
|
+
wrapper: string;
|
|
105
|
+
};
|
|
106
|
+
secondary: {
|
|
107
|
+
item: string;
|
|
108
|
+
wrapper: string;
|
|
109
|
+
};
|
|
110
|
+
info: {
|
|
111
|
+
item: string;
|
|
112
|
+
wrapper: string;
|
|
113
|
+
};
|
|
114
|
+
success: {
|
|
115
|
+
item: string;
|
|
116
|
+
wrapper: string;
|
|
117
|
+
};
|
|
118
|
+
warning: {
|
|
119
|
+
item: string;
|
|
120
|
+
wrapper: string;
|
|
121
|
+
};
|
|
122
|
+
danger: {
|
|
123
|
+
item: string;
|
|
124
|
+
wrapper: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
active: {
|
|
128
|
+
true: {
|
|
129
|
+
item: string;
|
|
130
|
+
};
|
|
131
|
+
false: {
|
|
132
|
+
item: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
}, {
|
|
136
|
+
base: string;
|
|
137
|
+
list: string;
|
|
138
|
+
item: string;
|
|
139
|
+
separator: string;
|
|
140
|
+
wrapper: string;
|
|
141
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
142
|
+
size: {
|
|
143
|
+
sm: {
|
|
144
|
+
base: string;
|
|
145
|
+
};
|
|
146
|
+
base: {
|
|
147
|
+
base: string;
|
|
148
|
+
};
|
|
149
|
+
lg: {
|
|
150
|
+
base: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
weight: {
|
|
154
|
+
normal: {
|
|
155
|
+
item: string;
|
|
156
|
+
};
|
|
157
|
+
medium: {
|
|
158
|
+
item: string;
|
|
159
|
+
};
|
|
160
|
+
semibold: {
|
|
161
|
+
item: string;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
color: {
|
|
165
|
+
default: {
|
|
166
|
+
item: string;
|
|
167
|
+
wrapper: string;
|
|
168
|
+
};
|
|
169
|
+
primary: {
|
|
170
|
+
item: string;
|
|
171
|
+
wrapper: string;
|
|
172
|
+
};
|
|
173
|
+
secondary: {
|
|
174
|
+
item: string;
|
|
175
|
+
wrapper: string;
|
|
176
|
+
};
|
|
177
|
+
info: {
|
|
178
|
+
item: string;
|
|
179
|
+
wrapper: string;
|
|
180
|
+
};
|
|
181
|
+
success: {
|
|
182
|
+
item: string;
|
|
183
|
+
wrapper: string;
|
|
184
|
+
};
|
|
185
|
+
warning: {
|
|
186
|
+
item: string;
|
|
187
|
+
wrapper: string;
|
|
188
|
+
};
|
|
189
|
+
danger: {
|
|
190
|
+
item: string;
|
|
191
|
+
wrapper: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
active: {
|
|
195
|
+
true: {
|
|
196
|
+
item: string;
|
|
197
|
+
};
|
|
198
|
+
false: {
|
|
199
|
+
item: string;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
}, {
|
|
203
|
+
base: string;
|
|
204
|
+
list: string;
|
|
205
|
+
item: string;
|
|
206
|
+
separator: string;
|
|
207
|
+
wrapper: string;
|
|
208
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
209
|
+
export type BreadcrumbsProps = {
|
|
210
|
+
items: BreadcrumbItem[];
|
|
211
|
+
size?: keyof typeof breadcrumbs.variants.size;
|
|
212
|
+
weight?: keyof typeof breadcrumbs.variants.weight;
|
|
213
|
+
color?: keyof typeof breadcrumbs.variants.color;
|
|
214
|
+
icon?: Component;
|
|
215
|
+
class?: string;
|
|
216
|
+
listclass?: string;
|
|
217
|
+
itemclass?: string;
|
|
218
|
+
separatorclass?: string;
|
|
219
|
+
wrapperclass?: string;
|
|
220
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
export const breadcrumbs = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
base: 'flex',
|
|
5
|
+
list: 'flex flex-wrap items-center space-x-2.5',
|
|
6
|
+
item: 'flex items-center whitespace-nowrap',
|
|
7
|
+
separator: 'flex items-center',
|
|
8
|
+
wrapper: 'flex items-center gap-2.5'
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
sm: {
|
|
13
|
+
base: 'items-center text-sm'
|
|
14
|
+
},
|
|
15
|
+
base: {
|
|
16
|
+
base: 'items-center text-base'
|
|
17
|
+
},
|
|
18
|
+
lg: {
|
|
19
|
+
base: 'items-center text-lg'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
weight: {
|
|
23
|
+
normal: {
|
|
24
|
+
item: 'font-normal'
|
|
25
|
+
},
|
|
26
|
+
medium: {
|
|
27
|
+
item: 'font-medium'
|
|
28
|
+
},
|
|
29
|
+
semibold: {
|
|
30
|
+
item: 'font-semibold'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
color: {
|
|
34
|
+
default: {
|
|
35
|
+
item: 'hover:text-default-700',
|
|
36
|
+
wrapper: 'text-default-500'
|
|
37
|
+
},
|
|
38
|
+
primary: {
|
|
39
|
+
item: 'hover:text-primary-700',
|
|
40
|
+
wrapper: 'text-primary-500'
|
|
41
|
+
},
|
|
42
|
+
secondary: {
|
|
43
|
+
item: 'hover:text-secondary-700',
|
|
44
|
+
wrapper: 'text-secondary-500'
|
|
45
|
+
},
|
|
46
|
+
info: {
|
|
47
|
+
item: 'hover:text-info-700',
|
|
48
|
+
wrapper: 'text-info-500'
|
|
49
|
+
},
|
|
50
|
+
success: {
|
|
51
|
+
item: 'hover:text-success-700',
|
|
52
|
+
wrapper: 'text-success-500'
|
|
53
|
+
},
|
|
54
|
+
warning: {
|
|
55
|
+
item: 'hover:text-warning-700',
|
|
56
|
+
wrapper: 'text-warning-500'
|
|
57
|
+
},
|
|
58
|
+
danger: {
|
|
59
|
+
item: 'hover:text-danger-700',
|
|
60
|
+
wrapper: 'text-danger-500'
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
active: {
|
|
64
|
+
true: {
|
|
65
|
+
item: 'text-current font-semibold'
|
|
66
|
+
},
|
|
67
|
+
false: {
|
|
68
|
+
item: ''
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
compoundVariants: [
|
|
73
|
+
// Additional compound variants can be added here if needed
|
|
74
|
+
],
|
|
75
|
+
defaultVariants: {
|
|
76
|
+
size: 'sm',
|
|
77
|
+
weight: 'medium',
|
|
78
|
+
color: 'default',
|
|
79
|
+
active: false
|
|
80
|
+
}
|
|
81
|
+
});
|