ui-svelte 0.2.2 → 0.2.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/dist/control/Audio.svelte +8 -12
- package/dist/control/css/btn.css +1 -1
- package/dist/display/Code.svelte +28 -11
- package/dist/display/Code.svelte.d.ts +5 -3
- package/dist/display/css/card.css +0 -10
- package/dist/display/css/code.css +7 -1
- package/dist/form/ComboBox.svelte +17 -17
- package/dist/form/ComboBox.svelte.d.ts +2 -2
- package/dist/hooks/use-search.svelte.d.ts +2 -1
- package/dist/index.css +2 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/layout/AppBar.svelte +28 -1
- package/dist/layout/AppBar.svelte.d.ts +2 -0
- package/dist/layout/Footer.svelte +25 -1
- package/dist/layout/Footer.svelte.d.ts +1 -0
- package/dist/layout/Sidebar.svelte +33 -3
- package/dist/layout/Sidebar.svelte.d.ts +1 -0
- package/dist/layout/css/app-bar.css +63 -0
- package/dist/layout/css/bottom-bar.css +63 -0
- package/dist/layout/css/footer.css +63 -0
- package/dist/layout/css/sidebar.css +63 -0
- package/dist/navigation/FooterGroup.svelte +51 -0
- package/dist/navigation/FooterGroup.svelte.d.ts +15 -0
- package/dist/{layout/FooterLinks.svelte → navigation/FooterNav.svelte} +2 -2
- package/dist/navigation/FooterNav.svelte.d.ts +11 -0
- package/dist/navigation/NavMenu.svelte +2 -9
- package/dist/navigation/SideNav.svelte +0 -9
- package/dist/navigation/SideNav.svelte.d.ts +0 -1
- package/dist/navigation/css/footer-group.css +26 -0
- package/dist/{layout/css/footer-links.css → navigation/css/footer-nav.css} +3 -3
- package/dist/navigation/css/nav-menu.css +9 -39
- package/dist/navigation/css/side-nav.css +127 -66
- package/dist/overlay/css/modal.css +2 -2
- package/package.json +1 -1
- package/dist/layout/FooterLinks.svelte.d.ts +0 -11
|
@@ -194,18 +194,14 @@
|
|
|
194
194
|
aria-valuemin="0"
|
|
195
195
|
aria-valuemax="100"
|
|
196
196
|
>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
{
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
<div class="media-bar" class:active={isPlayed} style="height: {height * 100}%"></div>
|
|
206
|
-
{/each}
|
|
207
|
-
</div>
|
|
208
|
-
{/if}
|
|
197
|
+
<div class="media-bars">
|
|
198
|
+
{#each waveformData as height, i}
|
|
199
|
+
{@const progress = duration > 0 ? currentTime / duration : 0}
|
|
200
|
+
{@const barPosition = (i + 0.5) / waveformData.length}
|
|
201
|
+
{@const isPlayed = barPosition <= progress}
|
|
202
|
+
<div class="media-bar" class:active={isPlayed} style="height: {height * 100}%"></div>
|
|
203
|
+
{/each}
|
|
204
|
+
</div>
|
|
209
205
|
</div>
|
|
210
206
|
|
|
211
207
|
<span class="media-time">{duration > 0 ? formatTime(duration - currentTime) : '0:00'}</span>
|
package/dist/control/css/btn.css
CHANGED
package/dist/display/Code.svelte
CHANGED
|
@@ -1,31 +1,43 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { codeToHtml } from 'shiki';
|
|
3
3
|
import { useClipboard } from '../hooks/use-clipboard.svelte.js';
|
|
4
|
-
import {
|
|
4
|
+
import { IconButton } from '../index.js';
|
|
5
5
|
import { Checkmark24RegularIcon, Copy24RegularIcon } from '../icons/index.js';
|
|
6
|
+
import { theme } from '../stores/theme.svelte.js';
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
8
9
|
code: string;
|
|
9
|
-
lang
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
lang: string;
|
|
11
|
+
lightTheme?: string;
|
|
12
|
+
darkTheme?: string;
|
|
13
|
+
disableCopy?: boolean;
|
|
14
|
+
hideLang?: boolean;
|
|
12
15
|
};
|
|
13
16
|
|
|
14
|
-
let {
|
|
17
|
+
let {
|
|
18
|
+
code,
|
|
19
|
+
lang,
|
|
20
|
+
lightTheme = 'catppuccin-latte',
|
|
21
|
+
darkTheme = 'catppuccin-frappe',
|
|
22
|
+
disableCopy,
|
|
23
|
+
hideLang
|
|
24
|
+
}: Props = $props();
|
|
15
25
|
|
|
16
26
|
let html: string = $state('');
|
|
17
27
|
let open = $state(false);
|
|
28
|
+
let hover = $state(false);
|
|
18
29
|
|
|
19
|
-
const generateCode = async (value: string) => {
|
|
30
|
+
const generateCode = async (value: string, currentTheme: string) => {
|
|
20
31
|
html = await codeToHtml(value, {
|
|
21
32
|
lang,
|
|
22
|
-
theme
|
|
33
|
+
theme: currentTheme
|
|
23
34
|
});
|
|
24
35
|
open = true;
|
|
25
36
|
};
|
|
26
37
|
|
|
27
38
|
$effect(() => {
|
|
28
|
-
|
|
39
|
+
const currentTheme = theme.isDark ? darkTheme : lightTheme;
|
|
40
|
+
generateCode(code, currentTheme);
|
|
29
41
|
});
|
|
30
42
|
|
|
31
43
|
const clipboard = useClipboard();
|
|
@@ -36,13 +48,18 @@
|
|
|
36
48
|
</script>
|
|
37
49
|
|
|
38
50
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
39
|
-
<div class="code">
|
|
51
|
+
<div class="code" onmouseenter={() => (hover = true)} onmouseleave={() => (hover = false)}>
|
|
40
52
|
{#if open}
|
|
41
|
-
{#if
|
|
53
|
+
{#if !hover && !hideLang}
|
|
54
|
+
<div class="code-info">
|
|
55
|
+
<div class="code-lang">{lang}</div>
|
|
56
|
+
</div>
|
|
57
|
+
{/if}
|
|
58
|
+
{#if hover && !disableCopy}
|
|
42
59
|
<div class="code-info">
|
|
43
60
|
<IconButton
|
|
44
61
|
onclick={handleCopy}
|
|
45
|
-
variant="
|
|
62
|
+
variant="ghost"
|
|
46
63
|
size="sm"
|
|
47
64
|
icon={clipboard.copied ? Checkmark24RegularIcon : Copy24RegularIcon}
|
|
48
65
|
/>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
type Props = {
|
|
2
2
|
code: string;
|
|
3
|
-
lang
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
lang: string;
|
|
4
|
+
lightTheme?: string;
|
|
5
|
+
darkTheme?: string;
|
|
6
|
+
disableCopy?: boolean;
|
|
7
|
+
hideLang?: boolean;
|
|
6
8
|
};
|
|
7
9
|
declare const Code: import("svelte").Component<Props, {}, "">;
|
|
8
10
|
type Code = ReturnType<typeof Code>;
|
|
@@ -72,16 +72,6 @@
|
|
|
72
72
|
@apply bg-surface text-on-surface;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
.card.is-surface.has-divider {
|
|
76
|
-
.card-header {
|
|
77
|
-
@apply border-on-surface;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.card-footer {
|
|
81
|
-
@apply border-on-surface;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
75
|
.card.is-ghost {
|
|
86
76
|
@apply bg-transparent;
|
|
87
77
|
}
|
|
@@ -4,14 +4,20 @@
|
|
|
4
4
|
tab-size: 4;
|
|
5
5
|
-moz-tab-size: 4;
|
|
6
6
|
}
|
|
7
|
+
|
|
7
8
|
.code-content {
|
|
8
9
|
@apply size-full overflow-auto rounded-md;
|
|
9
10
|
background-color: inherit;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
.code-info {
|
|
13
|
-
@apply absolute top-2 right-2 flex justify-end items-center gap-2;
|
|
14
|
+
@apply absolute top-2 right-2 flex justify-end items-center gap-2 z-10;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.code-lang {
|
|
18
|
+
@apply text-sm font-medium text-on-muted;
|
|
14
19
|
}
|
|
20
|
+
|
|
15
21
|
.shiki {
|
|
16
22
|
@apply p-3 rounded-ui;
|
|
17
23
|
min-width: fit-content;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { SearchState, SearchOption } from '../hooks/use-search.svelte.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
ArrowDown24RegularIcon,
|
|
5
|
+
Dismiss24RegularIcon,
|
|
6
|
+
DotsMoveIcon,
|
|
7
|
+
Search24RegularIcon
|
|
8
|
+
} from '../icons/index.js';
|
|
9
|
+
import { Avatar, Icon, Item, type IconData } from '../index.js';
|
|
5
10
|
import { cn } from '../utils/class-names.js';
|
|
6
11
|
import { onMount, tick } from 'svelte';
|
|
7
12
|
|
|
@@ -27,7 +32,7 @@
|
|
|
27
32
|
isSolid?: boolean;
|
|
28
33
|
isClearable?: boolean;
|
|
29
34
|
isDisabled?: boolean;
|
|
30
|
-
arrowIcon?:
|
|
35
|
+
arrowIcon?: IconData;
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
let {
|
|
@@ -52,7 +57,7 @@
|
|
|
52
57
|
isSolid,
|
|
53
58
|
isClearable = false,
|
|
54
59
|
isDisabled = false,
|
|
55
|
-
arrowIcon =
|
|
60
|
+
arrowIcon = ArrowDown24RegularIcon
|
|
56
61
|
}: Props = $props();
|
|
57
62
|
|
|
58
63
|
const variantClasses = {
|
|
@@ -356,13 +361,8 @@
|
|
|
356
361
|
</span>
|
|
357
362
|
{/if}
|
|
358
363
|
|
|
359
|
-
{#if selected?.src
|
|
360
|
-
<Avatar
|
|
361
|
-
src={selected.src}
|
|
362
|
-
name={selected.label}
|
|
363
|
-
icon={selected.icon as IconName}
|
|
364
|
-
size={avatarSizes[size]}
|
|
365
|
-
/>
|
|
364
|
+
{#if selected?.src}
|
|
365
|
+
<Avatar src={selected.src} name={selected.label} size={avatarSizes[size]} />
|
|
366
366
|
{/if}
|
|
367
367
|
|
|
368
368
|
<div class="control-selected">
|
|
@@ -386,10 +386,10 @@
|
|
|
386
386
|
onclick={handleClear}
|
|
387
387
|
aria-label="Clear selection"
|
|
388
388
|
>
|
|
389
|
-
<Icon
|
|
389
|
+
<Icon icon={Dismiss24RegularIcon} />
|
|
390
390
|
</button>
|
|
391
391
|
{/if}
|
|
392
|
-
<Icon
|
|
392
|
+
<Icon icon={arrowIcon} class={cn('control-arrow', isOpen && 'is-active')} />
|
|
393
393
|
</div>
|
|
394
394
|
</button>
|
|
395
395
|
|
|
@@ -399,7 +399,7 @@
|
|
|
399
399
|
|
|
400
400
|
<div class:is-active={isOpen} class="combo-box-popover" bind:this={contentEl} {style}>
|
|
401
401
|
<div class={cn('combo-box-search', variantClasses[variant])}>
|
|
402
|
-
<Icon
|
|
402
|
+
<Icon icon={Search24RegularIcon} class="combo-box-search-icon" />
|
|
403
403
|
<input
|
|
404
404
|
type="text"
|
|
405
405
|
class="combo-box-search-input"
|
|
@@ -410,7 +410,7 @@
|
|
|
410
410
|
|
|
411
411
|
{#if search.isLoading}
|
|
412
412
|
<div class="combo-box-loading">
|
|
413
|
-
<Icon
|
|
413
|
+
<Icon icon={DotsMoveIcon} class="combo-box-loading-spinner" />
|
|
414
414
|
<span>{loadingText}</span>
|
|
415
415
|
</div>
|
|
416
416
|
{:else if search.options.length === 0 && hasSearched}
|
|
@@ -421,7 +421,7 @@
|
|
|
421
421
|
<li>
|
|
422
422
|
<Item
|
|
423
423
|
label={item.label}
|
|
424
|
-
icon={item.icon as
|
|
424
|
+
icon={item.icon as IconData}
|
|
425
425
|
src={item.src}
|
|
426
426
|
description={item.description}
|
|
427
427
|
id={item.id}
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
|
|
439
439
|
{#if search.isLoadingMore}
|
|
440
440
|
<li class="combo-box-loading-more">
|
|
441
|
-
<Icon
|
|
441
|
+
<Icon icon={DotsMoveIcon} class="combo-box-loading-spinner" />
|
|
442
442
|
<span>{loadingMoreText}</span>
|
|
443
443
|
</li>
|
|
444
444
|
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SearchState, SearchOption } from '../hooks/use-search.svelte.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type IconData } from '../index.js';
|
|
3
3
|
type Props = {
|
|
4
4
|
search: SearchState;
|
|
5
5
|
value?: string | number | null;
|
|
@@ -22,7 +22,7 @@ type Props = {
|
|
|
22
22
|
isSolid?: boolean;
|
|
23
23
|
isClearable?: boolean;
|
|
24
24
|
isDisabled?: boolean;
|
|
25
|
-
arrowIcon?:
|
|
25
|
+
arrowIcon?: IconData;
|
|
26
26
|
};
|
|
27
27
|
declare const ComboBox: import("svelte").Component<Props, {}, "value" | "selected">;
|
|
28
28
|
type ComboBox = ReturnType<typeof ComboBox>;
|
package/dist/index.css
CHANGED
|
@@ -51,12 +51,13 @@
|
|
|
51
51
|
@import './layout/css/app-bar.css';
|
|
52
52
|
@import './layout/css/bottom-bar.css';
|
|
53
53
|
@import './layout/css/footer.css';
|
|
54
|
-
@import './layout/css/footer-links.css';
|
|
55
54
|
@import './layout/css/scaffold.css';
|
|
56
55
|
@import './layout/css/sidebar.css';
|
|
57
56
|
|
|
58
57
|
@import './navigation/css/bottom-nav.css';
|
|
59
58
|
@import './navigation/css/nav-menu.css';
|
|
59
|
+
@import './navigation/css/footer-nav.css';
|
|
60
|
+
@import './navigation/css/footer-group.css';
|
|
60
61
|
@import './navigation/css/side-nav.css';
|
|
61
62
|
@import './navigation/css/tabs.css';
|
|
62
63
|
|
package/dist/index.d.ts
CHANGED
|
@@ -45,11 +45,12 @@ import Toggle from './form/Toggle.svelte';
|
|
|
45
45
|
import AppBar from './layout/AppBar.svelte';
|
|
46
46
|
import Provider from './layout/Provider.svelte';
|
|
47
47
|
import Footer from './layout/Footer.svelte';
|
|
48
|
-
import FooterLinks from './layout/FooterLinks.svelte';
|
|
49
48
|
import Scaffold from './layout/Scaffold.svelte';
|
|
50
49
|
import Sidebar from './layout/Sidebar.svelte';
|
|
51
50
|
import NavMenu from './navigation/NavMenu.svelte';
|
|
52
51
|
import BottomNav from './navigation/BottomNav.svelte';
|
|
52
|
+
import FooterNav from './navigation/FooterNav.svelte';
|
|
53
|
+
import FooterGroup from './navigation/FooterGroup.svelte';
|
|
53
54
|
import SideNav, { type SideNavItem, type SideNavSubItem } from './navigation/SideNav.svelte';
|
|
54
55
|
import Tabs from './navigation/Tabs.svelte';
|
|
55
56
|
import AlertDialog from './overlay/AlertDialog.svelte';
|
|
@@ -73,5 +74,5 @@ import { useAuth } from './hooks/use-auth.svelte.js';
|
|
|
73
74
|
import { theme } from './stores/theme.svelte.js';
|
|
74
75
|
import { useSearch } from './hooks/use-search.svelte.js';
|
|
75
76
|
import { useChat } from './hooks/use-chat.svelte.js';
|
|
76
|
-
export { AreaChart, ArcChart, BarChart, Candlestick, LineChart, PieChart, Alert, AlertDialog, AppBar, Accordion, Avatar, Audio, Badge, Button, BottomNav, Carousel, Card, ChatBox, Checkbox, Chip, Code, Collapsible, Command, ComboBox, CsvField, DateField, Drawer, Dropzone, Divider, Dropdown, Empty, Footer,
|
|
77
|
+
export { AreaChart, ArcChart, BarChart, Candlestick, LineChart, PieChart, Alert, AlertDialog, AppBar, Accordion, Avatar, Audio, Badge, Button, BottomNav, Carousel, Card, ChatBox, Checkbox, Chip, Code, Collapsible, Command, ComboBox, CsvField, DateField, Drawer, Dropzone, Divider, Dropdown, Empty, Footer, FooterNav, FooterGroup, formatCurrency, formatDate, formatNumber, getWeekdays, i18n, Icon, IconButton, ImageCropper, Item, initLanguage, Modal, Marquee, NavMenu, PasswordField, PhoneField, PinField, plural, PopoverStack, Provider, RadioGroup, Record, Scaffold, Section, Select, setLanguage, Sidebar, SideNav, Slider, t, Table, Tabs, TextField, Textarea, theme, Toast, toast, Toggle, ToggleTheme, Tooltip, useAuth, useChat, useClipboard, useFetch, useForm, useLocalStorage, useScroll, useSearch, useTable, useWebSocket, Video };
|
|
77
78
|
export type { IconData, SideNavItem, SideNavSubItem };
|
package/dist/index.js
CHANGED
|
@@ -45,11 +45,12 @@ import Toggle from './form/Toggle.svelte';
|
|
|
45
45
|
import AppBar from './layout/AppBar.svelte';
|
|
46
46
|
import Provider from './layout/Provider.svelte';
|
|
47
47
|
import Footer from './layout/Footer.svelte';
|
|
48
|
-
import FooterLinks from './layout/FooterLinks.svelte';
|
|
49
48
|
import Scaffold from './layout/Scaffold.svelte';
|
|
50
49
|
import Sidebar from './layout/Sidebar.svelte';
|
|
51
50
|
import NavMenu from './navigation/NavMenu.svelte';
|
|
52
51
|
import BottomNav from './navigation/BottomNav.svelte';
|
|
52
|
+
import FooterNav from './navigation/FooterNav.svelte';
|
|
53
|
+
import FooterGroup from './navigation/FooterGroup.svelte';
|
|
53
54
|
import SideNav, {} from './navigation/SideNav.svelte';
|
|
54
55
|
import Tabs from './navigation/Tabs.svelte';
|
|
55
56
|
import AlertDialog from './overlay/AlertDialog.svelte';
|
|
@@ -73,4 +74,4 @@ import { useAuth } from './hooks/use-auth.svelte.js';
|
|
|
73
74
|
import { theme } from './stores/theme.svelte.js';
|
|
74
75
|
import { useSearch } from './hooks/use-search.svelte.js';
|
|
75
76
|
import { useChat } from './hooks/use-chat.svelte.js';
|
|
76
|
-
export { AreaChart, ArcChart, BarChart, Candlestick, LineChart, PieChart, Alert, AlertDialog, AppBar, Accordion, Avatar, Audio, Badge, Button, BottomNav, Carousel, Card, ChatBox, Checkbox, Chip, Code, Collapsible, Command, ComboBox, CsvField, DateField, Drawer, Dropzone, Divider, Dropdown, Empty, Footer,
|
|
77
|
+
export { AreaChart, ArcChart, BarChart, Candlestick, LineChart, PieChart, Alert, AlertDialog, AppBar, Accordion, Avatar, Audio, Badge, Button, BottomNav, Carousel, Card, ChatBox, Checkbox, Chip, Code, Collapsible, Command, ComboBox, CsvField, DateField, Drawer, Dropzone, Divider, Dropdown, Empty, Footer, FooterNav, FooterGroup, formatCurrency, formatDate, formatNumber, getWeekdays, i18n, Icon, IconButton, ImageCropper, Item, initLanguage, Modal, Marquee, NavMenu, PasswordField, PhoneField, PinField, plural, PopoverStack, Provider, RadioGroup, Record, Scaffold, Section, Select, setLanguage, Sidebar, SideNav, Slider, t, Table, Tabs, TextField, Textarea, theme, Toast, toast, Toggle, ToggleTheme, Tooltip, useAuth, useChat, useClipboard, useFetch, useForm, useLocalStorage, useScroll, useSearch, useTable, useWebSocket, Video };
|
|
@@ -14,9 +14,20 @@
|
|
|
14
14
|
endClass?: string;
|
|
15
15
|
isBlurred?: boolean;
|
|
16
16
|
isBordered?: boolean;
|
|
17
|
+
borderOnScrollOnly?: boolean;
|
|
17
18
|
hideOnScroll?: boolean;
|
|
18
19
|
isSticky?: boolean;
|
|
19
20
|
isBoxed?: boolean;
|
|
21
|
+
variant?:
|
|
22
|
+
| 'primary'
|
|
23
|
+
| 'secondary'
|
|
24
|
+
| 'muted'
|
|
25
|
+
| 'success'
|
|
26
|
+
| 'info'
|
|
27
|
+
| 'warning'
|
|
28
|
+
| 'danger'
|
|
29
|
+
| 'surface'
|
|
30
|
+
| 'ghost';
|
|
20
31
|
};
|
|
21
32
|
|
|
22
33
|
const {
|
|
@@ -29,9 +40,11 @@
|
|
|
29
40
|
centerClass,
|
|
30
41
|
endClass,
|
|
31
42
|
isBordered,
|
|
43
|
+
borderOnScrollOnly = false,
|
|
32
44
|
isBlurred,
|
|
33
45
|
isSticky,
|
|
34
46
|
isBoxed,
|
|
47
|
+
variant = 'ghost',
|
|
35
48
|
hideOnScroll
|
|
36
49
|
}: Props = $props();
|
|
37
50
|
|
|
@@ -42,6 +55,18 @@
|
|
|
42
55
|
|
|
43
56
|
const scroll = useScroll();
|
|
44
57
|
|
|
58
|
+
const variantClasses = {
|
|
59
|
+
primary: 'is-primary',
|
|
60
|
+
secondary: 'is-secondary',
|
|
61
|
+
muted: 'is-muted',
|
|
62
|
+
success: 'is-success',
|
|
63
|
+
info: 'is-info',
|
|
64
|
+
warning: 'is-warning',
|
|
65
|
+
danger: 'is-danger',
|
|
66
|
+
surface: 'is-surface',
|
|
67
|
+
ghost: 'is-ghost'
|
|
68
|
+
};
|
|
69
|
+
|
|
45
70
|
$effect(() => {
|
|
46
71
|
if (headerElement) {
|
|
47
72
|
headerHeight = headerElement.offsetHeight;
|
|
@@ -70,13 +95,15 @@
|
|
|
70
95
|
});
|
|
71
96
|
|
|
72
97
|
const shouldBlur = $derived(isBlurred && scroll.isScrolled);
|
|
98
|
+
const shouldShowBorder = $derived(isBordered && (!borderOnScrollOnly || scroll.isScrolled));
|
|
73
99
|
</script>
|
|
74
100
|
|
|
75
101
|
<header
|
|
76
102
|
bind:this={headerElement}
|
|
77
103
|
class={cn(
|
|
78
104
|
'appbar',
|
|
79
|
-
|
|
105
|
+
variantClasses[variant],
|
|
106
|
+
shouldShowBorder && 'is-bordered',
|
|
80
107
|
shouldBlur && 'is-blurred',
|
|
81
108
|
isHidden && 'is-hidden',
|
|
82
109
|
isSticky && 'is-sticky',
|
|
@@ -10,9 +10,11 @@ type Props = {
|
|
|
10
10
|
endClass?: string;
|
|
11
11
|
isBlurred?: boolean;
|
|
12
12
|
isBordered?: boolean;
|
|
13
|
+
borderOnScrollOnly?: boolean;
|
|
13
14
|
hideOnScroll?: boolean;
|
|
14
15
|
isSticky?: boolean;
|
|
15
16
|
isBoxed?: boolean;
|
|
17
|
+
variant?: 'primary' | 'secondary' | 'muted' | 'success' | 'info' | 'warning' | 'danger' | 'surface' | 'ghost';
|
|
16
18
|
};
|
|
17
19
|
declare const AppBar: import("svelte").Component<Props, {}, "">;
|
|
18
20
|
type AppBar = ReturnType<typeof AppBar>;
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
isBordered?: boolean;
|
|
17
17
|
isBoxed?: boolean;
|
|
18
18
|
hideOnScroll?: boolean;
|
|
19
|
+
variant?:
|
|
20
|
+
| 'primary'
|
|
21
|
+
| 'secondary'
|
|
22
|
+
| 'muted'
|
|
23
|
+
| 'success'
|
|
24
|
+
| 'info'
|
|
25
|
+
| 'warning'
|
|
26
|
+
| 'danger'
|
|
27
|
+
| 'surface'
|
|
28
|
+
| 'ghost';
|
|
19
29
|
};
|
|
20
30
|
|
|
21
31
|
const {
|
|
@@ -30,7 +40,8 @@
|
|
|
30
40
|
isBordered,
|
|
31
41
|
isBlurred,
|
|
32
42
|
isBoxed,
|
|
33
|
-
hideOnScroll
|
|
43
|
+
hideOnScroll,
|
|
44
|
+
variant = 'ghost'
|
|
34
45
|
}: Props = $props();
|
|
35
46
|
|
|
36
47
|
let footerElement = $state<HTMLElement | null>(null);
|
|
@@ -40,6 +51,18 @@
|
|
|
40
51
|
|
|
41
52
|
const scroll = useScroll();
|
|
42
53
|
|
|
54
|
+
const variantClasses = {
|
|
55
|
+
primary: 'is-primary',
|
|
56
|
+
secondary: 'is-secondary',
|
|
57
|
+
muted: 'is-muted',
|
|
58
|
+
success: 'is-success',
|
|
59
|
+
info: 'is-info',
|
|
60
|
+
warning: 'is-warning',
|
|
61
|
+
danger: 'is-danger',
|
|
62
|
+
surface: 'is-surface',
|
|
63
|
+
ghost: 'is-ghost'
|
|
64
|
+
};
|
|
65
|
+
|
|
43
66
|
$effect(() => {
|
|
44
67
|
if (footerElement) {
|
|
45
68
|
footerHeight = footerElement.offsetHeight;
|
|
@@ -70,6 +93,7 @@
|
|
|
70
93
|
bind:this={footerElement}
|
|
71
94
|
class={cn(
|
|
72
95
|
'footer',
|
|
96
|
+
variantClasses[variant],
|
|
73
97
|
isBordered && 'is-bordered',
|
|
74
98
|
shouldBlur && 'is-blurred',
|
|
75
99
|
isHidden && 'is-hidden',
|
|
@@ -12,6 +12,7 @@ type Props = {
|
|
|
12
12
|
isBordered?: boolean;
|
|
13
13
|
isBoxed?: boolean;
|
|
14
14
|
hideOnScroll?: boolean;
|
|
15
|
+
variant?: 'primary' | 'secondary' | 'muted' | 'success' | 'info' | 'warning' | 'danger' | 'surface' | 'ghost';
|
|
15
16
|
};
|
|
16
17
|
declare const Footer: import("svelte").Component<Props, {}, "">;
|
|
17
18
|
type Footer = ReturnType<typeof Footer>;
|
|
@@ -10,13 +10,43 @@
|
|
|
10
10
|
contentClass?: string;
|
|
11
11
|
headerClass?: string;
|
|
12
12
|
footerClass?: string;
|
|
13
|
+
variant?:
|
|
14
|
+
| 'primary'
|
|
15
|
+
| 'secondary'
|
|
16
|
+
| 'muted'
|
|
17
|
+
| 'success'
|
|
18
|
+
| 'info'
|
|
19
|
+
| 'warning'
|
|
20
|
+
| 'danger'
|
|
21
|
+
| 'surface'
|
|
22
|
+
| 'ghost';
|
|
13
23
|
};
|
|
14
24
|
|
|
15
|
-
const {
|
|
16
|
-
|
|
25
|
+
const {
|
|
26
|
+
children,
|
|
27
|
+
header,
|
|
28
|
+
footer,
|
|
29
|
+
rootClass,
|
|
30
|
+
contentClass,
|
|
31
|
+
headerClass,
|
|
32
|
+
footerClass,
|
|
33
|
+
variant = 'ghost'
|
|
34
|
+
}: Props = $props();
|
|
35
|
+
|
|
36
|
+
const variantClasses = {
|
|
37
|
+
primary: 'is-primary',
|
|
38
|
+
secondary: 'is-secondary',
|
|
39
|
+
muted: 'is-muted',
|
|
40
|
+
success: 'is-success',
|
|
41
|
+
info: 'is-info',
|
|
42
|
+
warning: 'is-warning',
|
|
43
|
+
danger: 'is-danger',
|
|
44
|
+
surface: 'is-surface',
|
|
45
|
+
ghost: 'is-ghost'
|
|
46
|
+
};
|
|
17
47
|
</script>
|
|
18
48
|
|
|
19
|
-
<aside class={cn('sidebar', rootClass)}>
|
|
49
|
+
<aside class={cn('sidebar', variantClasses[variant], rootClass)}>
|
|
20
50
|
{#if header}
|
|
21
51
|
<div class={cn('sidebar-header', headerClass)}>
|
|
22
52
|
{@render header()}
|
|
@@ -7,6 +7,7 @@ type Props = {
|
|
|
7
7
|
contentClass?: string;
|
|
8
8
|
headerClass?: string;
|
|
9
9
|
footerClass?: string;
|
|
10
|
+
variant?: 'primary' | 'secondary' | 'muted' | 'success' | 'info' | 'warning' | 'danger' | 'surface' | 'ghost';
|
|
10
11
|
};
|
|
11
12
|
declare const Sidebar: import("svelte").Component<Props, {}, "">;
|
|
12
13
|
type Sidebar = ReturnType<typeof Sidebar>;
|
|
@@ -35,4 +35,67 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
.appbar.is-primary {
|
|
39
|
+
@apply bg-on-primary text-primary;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.appbar.is-primary.is-solid {
|
|
43
|
+
@apply bg-primary text-on-primary;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.appbar.is-secondary {
|
|
47
|
+
@apply bg-on-secondary text-secondary;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.appbar.is-secondary.is-solid {
|
|
51
|
+
@apply bg-secondary text-on-secondary;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.appbar.is-success {
|
|
55
|
+
@apply bg-on-success text-success;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.appbar.is-success.is-solid {
|
|
59
|
+
@apply bg-success text-on-success;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.appbar.is-info {
|
|
63
|
+
@apply bg-on-info text-info;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.appbar.is-info.is-solid {
|
|
67
|
+
@apply bg-info text-on-info;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.appbar.is-warning {
|
|
71
|
+
@apply bg-on-warning text-warning;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.appbar.is-warning.is-solid {
|
|
75
|
+
@apply bg-warning text-on-warning;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.appbar.is-danger {
|
|
79
|
+
@apply bg-on-danger text-danger;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.appbar.is-danger.is-solid {
|
|
83
|
+
@apply bg-danger text-on-danger;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.appbar.is-muted {
|
|
87
|
+
@apply bg-muted text-on-muted;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.appbar.is-muted.is-solid {
|
|
91
|
+
@apply bg-on-muted text-muted;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.appbar.is-ghost {
|
|
95
|
+
@apply bg-background text-on-background;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.appbar.is-surface {
|
|
99
|
+
@apply bg-surface text-on-surface;
|
|
100
|
+
}
|
|
38
101
|
}
|