ui-svelte 0.2.1 → 0.2.3
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/charts/ArcChart.svelte +3 -3
- package/dist/charts/ArcChart.svelte.d.ts +1 -1
- package/dist/charts/AreaChart.svelte +3 -3
- package/dist/charts/AreaChart.svelte.d.ts +1 -1
- package/dist/charts/BarChart.svelte +3 -3
- package/dist/charts/BarChart.svelte.d.ts +1 -1
- package/dist/charts/Candlestick.svelte +3 -3
- package/dist/charts/Candlestick.svelte.d.ts +1 -1
- package/dist/charts/LineChart.svelte +3 -3
- package/dist/charts/LineChart.svelte.d.ts +1 -1
- package/dist/charts/PieChart.svelte +3 -3
- package/dist/charts/PieChart.svelte.d.ts +1 -1
- package/dist/control/Button.svelte +2 -8
- package/dist/control/Button.svelte.d.ts +0 -2
- package/dist/control/IconButton.svelte +0 -3
- package/dist/control/IconButton.svelte.d.ts +0 -1
- package/dist/control/css/btn.css +0 -4
- package/dist/css/base.css +262 -45
- package/dist/css/utilities.css +0 -4
- package/dist/display/Accordion.svelte +3 -3
- package/dist/display/Accordion.svelte.d.ts +1 -1
- package/dist/display/Alert.svelte +0 -2
- package/dist/display/Card.svelte +4 -17
- package/dist/display/Card.svelte.d.ts +1 -3
- package/dist/display/Carousel.svelte +3 -3
- package/dist/display/Carousel.svelte.d.ts +1 -1
- package/dist/display/ChatBox.svelte +3 -3
- package/dist/display/ChatBox.svelte.d.ts +1 -1
- package/dist/display/Code.svelte +28 -11
- package/dist/display/Code.svelte.d.ts +5 -3
- package/dist/display/Collapsible.svelte +3 -3
- package/dist/display/Collapsible.svelte.d.ts +1 -1
- package/dist/display/Empty.svelte +11 -5
- package/dist/display/Marquee.svelte +3 -3
- package/dist/display/Marquee.svelte.d.ts +1 -1
- package/dist/display/Section.svelte +3 -3
- package/dist/display/Section.svelte.d.ts +1 -1
- package/dist/display/css/alert.css +1 -1
- package/dist/display/css/card.css +7 -126
- package/dist/display/css/code.css +7 -1
- package/dist/display/css/section.css +5 -1
- package/dist/form/ComboBox.svelte +17 -17
- package/dist/form/ComboBox.svelte.d.ts +2 -2
- package/dist/form/Select.svelte +3 -3
- package/dist/form/Select.svelte.d.ts +1 -1
- package/dist/form/TextField.svelte +4 -6
- package/dist/form/TextField.svelte.d.ts +2 -2
- package/dist/form/css/control.css +1 -1
- package/dist/hooks/use-search.svelte.d.ts +2 -1
- package/dist/index.css +2 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +5 -4
- package/dist/layout/AppBar.svelte +3 -3
- package/dist/layout/AppBar.svelte.d.ts +1 -1
- package/dist/layout/Footer.svelte +3 -3
- package/dist/layout/Footer.svelte.d.ts +1 -1
- package/dist/layout/Sidebar.svelte +4 -11
- package/dist/layout/Sidebar.svelte.d.ts +1 -1
- package/dist/navigation/BottomNav.svelte +80 -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/SideNav.svelte +17 -16
- package/dist/navigation/SideNav.svelte.d.ts +33 -0
- package/dist/navigation/Tabs.svelte +3 -3
- package/dist/navigation/Tabs.svelte.d.ts +1 -1
- package/dist/navigation/css/bottom-nav.css +134 -0
- package/dist/navigation/css/footer-group.css +27 -0
- package/dist/{layout/css/footer-links.css → navigation/css/footer-nav.css} +3 -3
- package/package.json +2 -2
- package/dist/layout/FooterLinks.svelte.d.ts +0 -11
- package/dist/navigation/BottomNav.svelte.d.ts +0 -26
- /package/dist/{types.d.ts → types.svelte.d.ts} +0 -0
- /package/dist/{types.js → types.svelte.js} +0 -0
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
|
@@ -22,7 +22,7 @@ import Code from './display/Code.svelte';
|
|
|
22
22
|
import Collapsible from './display/Collapsible.svelte';
|
|
23
23
|
import Divider from './display/Divider.svelte';
|
|
24
24
|
import Empty from './display/Empty.svelte';
|
|
25
|
-
import Icon from './display/Icon.svelte';
|
|
25
|
+
import Icon, { type IconData } from './display/Icon.svelte';
|
|
26
26
|
import Item from './display/Item.svelte';
|
|
27
27
|
import Marquee from './display/Marquee.svelte';
|
|
28
28
|
import Section from './display/Section.svelte';
|
|
@@ -45,12 +45,13 @@ 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';
|
|
53
|
-
import
|
|
52
|
+
import FooterNav from './navigation/FooterNav.svelte';
|
|
53
|
+
import FooterGroup from './navigation/FooterGroup.svelte';
|
|
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';
|
|
56
57
|
import Command from './overlay/Command.svelte';
|
|
@@ -73,4 +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 };
|
|
78
|
+
export type { IconData, SideNavItem, SideNavSubItem };
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import Code from './display/Code.svelte';
|
|
|
22
22
|
import Collapsible from './display/Collapsible.svelte';
|
|
23
23
|
import Divider from './display/Divider.svelte';
|
|
24
24
|
import Empty from './display/Empty.svelte';
|
|
25
|
-
import Icon from './display/Icon.svelte';
|
|
25
|
+
import Icon, {} from './display/Icon.svelte';
|
|
26
26
|
import Item from './display/Item.svelte';
|
|
27
27
|
import Marquee from './display/Marquee.svelte';
|
|
28
28
|
import Section from './display/Section.svelte';
|
|
@@ -45,12 +45,13 @@ 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';
|
|
53
|
-
import
|
|
52
|
+
import FooterNav from './navigation/FooterNav.svelte';
|
|
53
|
+
import FooterGroup from './navigation/FooterGroup.svelte';
|
|
54
|
+
import SideNav, {} from './navigation/SideNav.svelte';
|
|
54
55
|
import Tabs from './navigation/Tabs.svelte';
|
|
55
56
|
import AlertDialog from './overlay/AlertDialog.svelte';
|
|
56
57
|
import Command from './overlay/Command.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 };
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
start?: Snippet;
|
|
8
8
|
center?: Snippet;
|
|
9
9
|
end?: Snippet;
|
|
10
|
-
|
|
10
|
+
rootClass?: string;
|
|
11
11
|
contentClass?: string;
|
|
12
12
|
startClass?: string;
|
|
13
13
|
centerClass?: string;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
start,
|
|
24
24
|
center,
|
|
25
25
|
end,
|
|
26
|
-
|
|
26
|
+
rootClass,
|
|
27
27
|
contentClass,
|
|
28
28
|
startClass,
|
|
29
29
|
centerClass,
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
shouldBlur && 'is-blurred',
|
|
81
81
|
isHidden && 'is-hidden',
|
|
82
82
|
isSticky && 'is-sticky',
|
|
83
|
-
|
|
83
|
+
rootClass
|
|
84
84
|
)}
|
|
85
85
|
>
|
|
86
86
|
<div class={cn('appbar-content', isBoxed && 'boxed', contentClass)}>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
start?: Snippet;
|
|
8
8
|
center?: Snippet;
|
|
9
9
|
end?: Snippet;
|
|
10
|
-
|
|
10
|
+
rootClass?: string;
|
|
11
11
|
contentClass?: string;
|
|
12
12
|
startClass?: string;
|
|
13
13
|
centerClass?: string;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
start,
|
|
23
23
|
center,
|
|
24
24
|
end,
|
|
25
|
-
|
|
25
|
+
rootClass,
|
|
26
26
|
contentClass,
|
|
27
27
|
startClass,
|
|
28
28
|
centerClass,
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
isBordered && 'is-bordered',
|
|
74
74
|
shouldBlur && 'is-blurred',
|
|
75
75
|
isHidden && 'is-hidden',
|
|
76
|
-
|
|
76
|
+
rootClass
|
|
77
77
|
)}
|
|
78
78
|
>
|
|
79
79
|
<div class={cn('footer-content', isBoxed && 'boxed', contentClass)}>
|
|
@@ -6,24 +6,17 @@
|
|
|
6
6
|
children: Snippet;
|
|
7
7
|
header?: Snippet;
|
|
8
8
|
footer?: Snippet;
|
|
9
|
-
|
|
9
|
+
rootClass?: string;
|
|
10
10
|
contentClass?: string;
|
|
11
11
|
headerClass?: string;
|
|
12
12
|
footerClass?: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
header,
|
|
18
|
-
footer,
|
|
19
|
-
class: className,
|
|
20
|
-
contentClass,
|
|
21
|
-
headerClass,
|
|
22
|
-
footerClass
|
|
23
|
-
}: Props = $props();
|
|
15
|
+
const { children, header, footer, rootClass, contentClass, headerClass, footerClass }: Props =
|
|
16
|
+
$props();
|
|
24
17
|
</script>
|
|
25
18
|
|
|
26
|
-
<aside class={cn('sidebar',
|
|
19
|
+
<aside class={cn('sidebar', rootClass)}>
|
|
27
20
|
{#if header}
|
|
28
21
|
<div class={cn('sidebar-header', headerClass)}>
|
|
29
22
|
{@render header()}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { page } from '$app/state';
|
|
3
|
+
import { Icon, type IconData } from '../index.js';
|
|
4
|
+
import { cn } from '../utils/class-names.js';
|
|
5
|
+
|
|
6
|
+
type BottomNavItem = {
|
|
7
|
+
id: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
icon: IconData;
|
|
10
|
+
href?: string;
|
|
11
|
+
onclick?: (item: BottomNavItem) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type Props = {
|
|
15
|
+
items: BottomNavItem[];
|
|
16
|
+
variant?: 'primary' | 'secondary' | 'muted';
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
showLabels?: boolean;
|
|
19
|
+
class?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
items = [],
|
|
24
|
+
class: className,
|
|
25
|
+
variant = 'primary',
|
|
26
|
+
size = 'md',
|
|
27
|
+
showLabels = true
|
|
28
|
+
}: Props = $props();
|
|
29
|
+
|
|
30
|
+
const variantClasses = {
|
|
31
|
+
primary: 'bottomnav-primary',
|
|
32
|
+
secondary: 'bottomnav-secondary',
|
|
33
|
+
muted: 'bottomnav-muted'
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const sizeClasses = {
|
|
37
|
+
sm: 'is-sm',
|
|
38
|
+
md: 'is-md',
|
|
39
|
+
lg: 'is-lg'
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function isItemActive(href?: string): boolean {
|
|
43
|
+
if (!href) return false;
|
|
44
|
+
return page.url.pathname === href || page.url.pathname.startsWith(href + '/');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function handleItemClick(item: BottomNavItem) {
|
|
48
|
+
if (item.onclick) {
|
|
49
|
+
item.onclick(item);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<nav
|
|
55
|
+
class={cn(
|
|
56
|
+
'bottomnav',
|
|
57
|
+
variantClasses[variant],
|
|
58
|
+
sizeClasses[size],
|
|
59
|
+
!showLabels && 'is-icon-only',
|
|
60
|
+
className
|
|
61
|
+
)}
|
|
62
|
+
>
|
|
63
|
+
{#each items as item}
|
|
64
|
+
{#if item.href}
|
|
65
|
+
<a href={item.href} class={cn('bottomnav-item', isItemActive(item.href) && 'is-active')}>
|
|
66
|
+
<Icon icon={item.icon} class="bottomnav-icon" />
|
|
67
|
+
{#if showLabels && item.label}
|
|
68
|
+
<span class="bottomnav-label">{item.label}</span>
|
|
69
|
+
{/if}
|
|
70
|
+
</a>
|
|
71
|
+
{:else}
|
|
72
|
+
<button type="button" class="bottomnav-item" onclick={() => handleItemClick(item)}>
|
|
73
|
+
<Icon icon={item.icon} class="bottomnav-icon" />
|
|
74
|
+
{#if showLabels && item.label}
|
|
75
|
+
<span class="bottomnav-label">{item.label}</span>
|
|
76
|
+
{/if}
|
|
77
|
+
</button>
|
|
78
|
+
{/if}
|
|
79
|
+
{/each}
|
|
80
|
+
</nav>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from '../utils/class-names.js';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type FooterLink = {
|
|
6
|
+
label: string;
|
|
7
|
+
href: string;
|
|
8
|
+
external?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type Props = {
|
|
12
|
+
title?: string;
|
|
13
|
+
links?: FooterLink[];
|
|
14
|
+
children?: Snippet;
|
|
15
|
+
class?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const { title, links = [], children, class: className }: Props = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class={cn('footer-group', className)}>
|
|
22
|
+
{#if title}
|
|
23
|
+
<h3 class="footer-group-title">{title}</h3>
|
|
24
|
+
{/if}
|
|
25
|
+
|
|
26
|
+
{#if links.length > 0}
|
|
27
|
+
<ul class="footer-group-links">
|
|
28
|
+
{#each links as link}
|
|
29
|
+
<li>
|
|
30
|
+
<a
|
|
31
|
+
href={link.href}
|
|
32
|
+
class="footer-group-link"
|
|
33
|
+
target={link.external ? '_blank' : undefined}
|
|
34
|
+
rel={link.external ? 'noopener noreferrer' : undefined}
|
|
35
|
+
>
|
|
36
|
+
{link.label}
|
|
37
|
+
{#if link.external}
|
|
38
|
+
<span class="sr-only">(abre en nueva ventana)</span>
|
|
39
|
+
{/if}
|
|
40
|
+
</a>
|
|
41
|
+
</li>
|
|
42
|
+
{/each}
|
|
43
|
+
</ul>
|
|
44
|
+
{/if}
|
|
45
|
+
|
|
46
|
+
{#if children}
|
|
47
|
+
<div class="footer-group-content">
|
|
48
|
+
{@render children()}
|
|
49
|
+
</div>
|
|
50
|
+
{/if}
|
|
51
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type FooterLink = {
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
external?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type Props = {
|
|
8
|
+
title?: string;
|
|
9
|
+
links?: FooterLink[];
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
class?: string;
|
|
12
|
+
};
|
|
13
|
+
declare const FooterGroup: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type FooterGroup = ReturnType<typeof FooterGroup>;
|
|
15
|
+
export default FooterGroup;
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
}
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
|
-
<div class={cn('footer-
|
|
22
|
+
<div class={cn('footer-nav', className)}>
|
|
23
23
|
{#each links as link}
|
|
24
|
-
<a href={link.href} class={cn('footer-link', isLinkActive(link.href) && 'is-active')}>
|
|
24
|
+
<a href={link.href} class={cn('footer-nav-link', isLinkActive(link.href) && 'is-active')}>
|
|
25
25
|
{link.label}
|
|
26
26
|
</a>
|
|
27
27
|
{/each}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type FooterLink = {
|
|
2
|
+
label: string;
|
|
3
|
+
href: string;
|
|
4
|
+
};
|
|
5
|
+
type Props = {
|
|
6
|
+
links: FooterLink[];
|
|
7
|
+
class?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const FooterNav: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type FooterNav = ReturnType<typeof FooterNav>;
|
|
11
|
+
export default FooterNav;
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
import type { IconData } from '../display/Icon.svelte';
|
|
4
|
-
import { ChevronRight24RegularIcon } from '../icons/index.js';
|
|
5
|
-
import { Icon } from '../index.js';
|
|
6
|
-
import { cn } from '../utils/class-names.js';
|
|
7
|
-
import type { Snippet } from 'svelte';
|
|
8
|
-
import { slide } from 'svelte/transition';
|
|
9
|
-
|
|
10
|
-
type SubmenuItem = {
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type SideNavSubItem = {
|
|
11
3
|
label: string;
|
|
12
4
|
href?: string;
|
|
13
|
-
onclick?: (item:
|
|
5
|
+
onclick?: (item: SideNavSubItem) => void;
|
|
14
6
|
description?: string;
|
|
15
7
|
status?: string | Snippet;
|
|
16
8
|
icon?: IconData;
|
|
17
9
|
};
|
|
18
10
|
|
|
19
|
-
type
|
|
11
|
+
export type SideNavItem = {
|
|
20
12
|
type?: 'item' | 'divider' | 'header' | 'submenu';
|
|
21
13
|
label?: string;
|
|
22
14
|
description?: string;
|
|
23
15
|
href?: string;
|
|
24
|
-
onclick?: (item:
|
|
16
|
+
onclick?: (item: SideNavItem) => void;
|
|
25
17
|
status?: string | Snippet;
|
|
26
18
|
icon?: IconData;
|
|
27
|
-
subitems?:
|
|
19
|
+
subitems?: SideNavSubItem[];
|
|
28
20
|
open?: boolean;
|
|
29
21
|
};
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
import { page } from '$app/state';
|
|
26
|
+
import { ChevronRight24RegularIcon } from '../icons/index.js';
|
|
27
|
+
import { Icon, type IconData } from '../index.js';
|
|
28
|
+
import { cn } from '../utils/class-names.js';
|
|
29
|
+
import type { Snippet } from 'svelte';
|
|
30
|
+
import { slide } from 'svelte/transition';
|
|
30
31
|
|
|
31
32
|
type Props = {
|
|
32
|
-
items:
|
|
33
|
+
items: SideNavItem[];
|
|
33
34
|
variant?: 'primary' | 'secondary' | 'muted';
|
|
34
35
|
size?: 'sm' | 'md' | 'lg';
|
|
35
36
|
class?: string;
|
|
@@ -97,7 +98,7 @@
|
|
|
97
98
|
}
|
|
98
99
|
</script>
|
|
99
100
|
|
|
100
|
-
{#snippet navItemContent(item:
|
|
101
|
+
{#snippet navItemContent(item: SideNavItem | SideNavSubItem, isSubitem = false)}
|
|
101
102
|
<div class="sidenav-content">
|
|
102
103
|
<div class="sidenav-label">{item.label}</div>
|
|
103
104
|
{#if item.description && (isExpanded || !isCollapsible)}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type SideNavSubItem = {
|
|
2
|
+
label: string;
|
|
3
|
+
href?: string;
|
|
4
|
+
onclick?: (item: SideNavSubItem) => void;
|
|
5
|
+
description?: string;
|
|
6
|
+
status?: string | Snippet;
|
|
7
|
+
icon?: IconData;
|
|
8
|
+
};
|
|
9
|
+
export type SideNavItem = {
|
|
10
|
+
type?: 'item' | 'divider' | 'header' | 'submenu';
|
|
11
|
+
label?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
href?: string;
|
|
14
|
+
onclick?: (item: SideNavItem) => void;
|
|
15
|
+
status?: string | Snippet;
|
|
16
|
+
icon?: IconData;
|
|
17
|
+
subitems?: SideNavSubItem[];
|
|
18
|
+
open?: boolean;
|
|
19
|
+
};
|
|
20
|
+
import { type IconData } from '../index.js';
|
|
21
|
+
import type { Snippet } from 'svelte';
|
|
22
|
+
type Props = {
|
|
23
|
+
items: SideNavItem[];
|
|
24
|
+
variant?: 'primary' | 'secondary' | 'muted';
|
|
25
|
+
size?: 'sm' | 'md' | 'lg';
|
|
26
|
+
class?: string;
|
|
27
|
+
isWide?: boolean;
|
|
28
|
+
isCompact?: boolean;
|
|
29
|
+
isCollapsible?: boolean;
|
|
30
|
+
};
|
|
31
|
+
declare const SideNav: import("svelte").Component<Props, {}, "">;
|
|
32
|
+
type SideNav = ReturnType<typeof SideNav>;
|
|
33
|
+
export default SideNav;
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
position?: 'top' | 'bottom' | 'start' | 'end';
|
|
13
13
|
variant?: 'primary' | 'secondary' | 'muted' | 'outline' | 'line' | 'ghost';
|
|
14
14
|
pill?: boolean;
|
|
15
|
-
|
|
15
|
+
rootClass?: string;
|
|
16
16
|
tabListClass?: string;
|
|
17
17
|
tabClass?: string;
|
|
18
18
|
tabContentClass?: string;
|
|
19
19
|
};
|
|
20
20
|
const {
|
|
21
|
-
|
|
21
|
+
rootClass,
|
|
22
22
|
tabClass,
|
|
23
23
|
tabListClass,
|
|
24
24
|
tabContentClass,
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
</script>
|
|
53
53
|
|
|
54
|
-
<div class={cn('tabs', positionClasses[position],
|
|
54
|
+
<div class={cn('tabs', positionClasses[position], rootClass)}>
|
|
55
55
|
<div class={cn('tabs-list', variantClasses[variant], pill && 'is-pill', tabListClass)}>
|
|
56
56
|
{#each tabs as tab}
|
|
57
57
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
@@ -9,7 +9,7 @@ type Props = {
|
|
|
9
9
|
position?: 'top' | 'bottom' | 'start' | 'end';
|
|
10
10
|
variant?: 'primary' | 'secondary' | 'muted' | 'outline' | 'line' | 'ghost';
|
|
11
11
|
pill?: boolean;
|
|
12
|
-
|
|
12
|
+
rootClass?: string;
|
|
13
13
|
tabListClass?: string;
|
|
14
14
|
tabClass?: string;
|
|
15
15
|
tabContentClass?: string;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.bottomnav {
|
|
3
|
+
@apply fixed bottom-0 left-0 right-0 z-50;
|
|
4
|
+
@apply flex items-center justify-around;
|
|
5
|
+
@apply bg-background text-on-background;
|
|
6
|
+
@apply border-t border-muted;
|
|
7
|
+
@apply shadow-lg;
|
|
8
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
9
|
+
|
|
10
|
+
.bottomnav-item {
|
|
11
|
+
@apply flex flex-col items-center justify-center gap-1;
|
|
12
|
+
@apply flex-1 py-2 px-1;
|
|
13
|
+
@apply cursor-pointer select-none outline-none;
|
|
14
|
+
@apply transition-all duration-200;
|
|
15
|
+
@apply relative;
|
|
16
|
+
|
|
17
|
+
.bottomnav-icon {
|
|
18
|
+
@apply h-6 w-6 shrink-0;
|
|
19
|
+
@apply transition-all duration-200;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.bottomnav-label {
|
|
23
|
+
@apply text-xs font-medium whitespace-nowrap;
|
|
24
|
+
@apply transition-all duration-200;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
@apply bg-muted/50;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.is-active {
|
|
32
|
+
@apply text-primary;
|
|
33
|
+
|
|
34
|
+
.bottomnav-icon {
|
|
35
|
+
@apply text-primary;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.is-sm {
|
|
41
|
+
.bottomnav-item {
|
|
42
|
+
@apply gap-0.5 py-1.5;
|
|
43
|
+
|
|
44
|
+
.bottomnav-icon {
|
|
45
|
+
@apply h-5 w-5;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.bottomnav-label {
|
|
49
|
+
@apply text-[10px];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.is-md {
|
|
55
|
+
.bottomnav-item {
|
|
56
|
+
@apply gap-1 py-2;
|
|
57
|
+
|
|
58
|
+
.bottomnav-icon {
|
|
59
|
+
@apply h-6 w-6;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.bottomnav-label {
|
|
63
|
+
@apply text-xs;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.is-lg {
|
|
69
|
+
.bottomnav-item {
|
|
70
|
+
@apply gap-1.5 py-3;
|
|
71
|
+
|
|
72
|
+
.bottomnav-icon {
|
|
73
|
+
@apply h-7 w-7;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.bottomnav-label {
|
|
77
|
+
@apply text-sm;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.is-icon-only {
|
|
83
|
+
.bottomnav-item {
|
|
84
|
+
@apply gap-0;
|
|
85
|
+
|
|
86
|
+
.bottomnav-icon {
|
|
87
|
+
@apply h-7 w-7;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.bottomnav-primary {
|
|
93
|
+
.bottomnav-item.is-active {
|
|
94
|
+
@apply text-primary;
|
|
95
|
+
|
|
96
|
+
.bottomnav-icon {
|
|
97
|
+
@apply text-primary;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.bottomnav-label {
|
|
101
|
+
@apply text-primary;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.bottomnav-secondary {
|
|
107
|
+
.bottomnav-item.is-active {
|
|
108
|
+
@apply text-secondary;
|
|
109
|
+
|
|
110
|
+
.bottomnav-icon {
|
|
111
|
+
@apply text-secondary;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.bottomnav-label {
|
|
115
|
+
@apply text-secondary;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.bottomnav-muted {
|
|
121
|
+
.bottomnav-item.is-active {
|
|
122
|
+
@apply bg-muted text-on-muted;
|
|
123
|
+
|
|
124
|
+
.bottomnav-icon {
|
|
125
|
+
@apply text-on-muted;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.bottomnav-label {
|
|
129
|
+
@apply text-on-muted;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.footer-group {
|
|
3
|
+
@apply flex flex-col gap-4;
|
|
4
|
+
|
|
5
|
+
.footer-group-title {
|
|
6
|
+
@apply text-base font-semibold;
|
|
7
|
+
@apply mb-2;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.footer-group-links {
|
|
11
|
+
@apply flex flex-col gap-2;
|
|
12
|
+
@apply list-none p-0 m-0;
|
|
13
|
+
|
|
14
|
+
.footer-group-link {
|
|
15
|
+
@apply text-sm text-on-muted;
|
|
16
|
+
@apply transition-colors duration-200;
|
|
17
|
+
@apply hover:underline;
|
|
18
|
+
@apply focus:outline-none;
|
|
19
|
+
@apply inline-flex items-center gap-1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.footer-group-content {
|
|
24
|
+
@apply flex flex-col gap-3;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|