seblify 0.1.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 +18 -0
- package/dist/components/AppShell.svelte +136 -0
- package/dist/components/AppShell.svelte.d.ts +13 -0
- package/dist/components/Banner.svelte +56 -0
- package/dist/components/Banner.svelte.d.ts +9 -0
- package/dist/components/Button.svelte +64 -0
- package/dist/components/Button.svelte.d.ts +13 -0
- package/dist/components/Icon.svelte +67 -0
- package/dist/components/Icon.svelte.d.ts +8 -0
- package/dist/components/Sidebar.svelte +106 -0
- package/dist/components/Sidebar.svelte.d.ts +14 -0
- package/dist/components/Snackbar.svelte +26 -0
- package/dist/components/Snackbar.svelte.d.ts +7 -0
- package/dist/components/Toast.svelte +27 -0
- package/dist/components/Toast.svelte.d.ts +7 -0
- package/dist/components/action/input/field/pin-input/PinInput.svelte +156 -0
- package/dist/components/action/input/field/pin-input/PinInput.svelte.d.ts +10 -0
- package/dist/components/action/input/select/checkbox/Checkbox.svelte +71 -0
- package/dist/components/action/input/select/checkbox/Checkbox.svelte.d.ts +10 -0
- package/dist/components/action/input/select/segment-control/SegmentControl.svelte +150 -0
- package/dist/components/action/input/select/segment-control/SegmentControl.svelte.d.ts +15 -0
- package/dist/components/action/input/select/slider/Slider.svelte +79 -0
- package/dist/components/action/input/select/slider/Slider.svelte.d.ts +11 -0
- package/dist/components/action/input/select/switch/Switch.svelte +122 -0
- package/dist/components/action/input/select/switch/Switch.svelte.d.ts +10 -0
- package/dist/components/action/input/select/theme-switch/ThemeSwitch.svelte +43 -0
- package/dist/components/action/input/select/theme-switch/ThemeSwitch.svelte.d.ts +10 -0
- package/dist/components/component-doc.d.ts +23 -0
- package/dist/components/component-doc.js +1 -0
- package/dist/components/display/annotation/badge/Badge.svelte +296 -0
- package/dist/components/display/annotation/badge/Badge.svelte.d.ts +16 -0
- package/dist/components/display/annotation/tag/Tag.svelte +227 -0
- package/dist/components/display/annotation/tag/Tag.svelte.d.ts +16 -0
- package/dist/components/display/annotation/tag-group/TagGroup.svelte +33 -0
- package/dist/components/display/annotation/tag-group/TagGroup.svelte.d.ts +12 -0
- package/dist/components/display/feedback/loading/loading-dots/LoadingDots.svelte +136 -0
- package/dist/components/display/feedback/loading/loading-dots/LoadingDots.svelte.d.ts +8 -0
- package/dist/components/display/feedback/loading/spinner/Spinner.svelte +110 -0
- package/dist/components/display/feedback/loading/spinner/Spinner.svelte.d.ts +8 -0
- package/dist/components/display/media/icon/Icon.svelte +41 -0
- package/dist/components/display/media/icon/Icon.svelte.d.ts +8 -0
- package/dist/components/display/media/icon/IconGlyph.svelte +56 -0
- package/dist/components/display/media/icon/IconGlyph.svelte.d.ts +8 -0
- package/dist/components/display/typography/eyebrow/Eyebrow.svelte +48 -0
- package/dist/components/display/typography/eyebrow/Eyebrow.svelte.d.ts +8 -0
- package/dist/components/display/typography/highlight/Highlight.svelte +160 -0
- package/dist/components/display/typography/highlight/Highlight.svelte.d.ts +10 -0
- package/dist/components/framework/layout/alignment/cluster/Cluster.svelte +142 -0
- package/dist/components/framework/layout/alignment/cluster/Cluster.svelte.d.ts +17 -0
- package/dist/components/framework/layout/alignment/grid/Grid.svelte +120 -0
- package/dist/components/framework/layout/alignment/grid/Grid.svelte.d.ts +18 -0
- package/dist/components/framework/layout/alignment/row/Row.svelte +142 -0
- package/dist/components/framework/layout/alignment/row/Row.svelte.d.ts +17 -0
- package/dist/components/framework/layout/alignment/stack/Stack.svelte +142 -0
- package/dist/components/framework/layout/alignment/stack/Stack.svelte.d.ts +17 -0
- package/dist/components/framework/layout/container/app-shell/AppShell.svelte +82 -0
- package/dist/components/framework/layout/container/app-shell/AppShell.svelte.d.ts +9 -0
- package/dist/components/framework/layout/container/page-header/PageHeader.svelte +114 -0
- package/dist/components/framework/layout/container/page-header/PageHeader.svelte.d.ts +11 -0
- package/dist/components/framework/layout/container/sidebar/Sidebar.svelte +134 -0
- package/dist/components/framework/layout/container/sidebar/Sidebar.svelte.d.ts +9 -0
- package/dist/components/framework/navigation/context/breadcrumb/Breadcrumb.svelte +72 -0
- package/dist/components/framework/navigation/context/breadcrumb/Breadcrumb.svelte.d.ts +10 -0
- package/dist/components/framework/navigation/sidenav/Sidenav.svelte +86 -0
- package/dist/components/framework/navigation/sidenav/Sidenav.svelte.d.ts +8 -0
- package/dist/components/framework/navigation/sidenav/SidenavTree.svelte +265 -0
- package/dist/components/framework/navigation/sidenav/SidenavTree.svelte.d.ts +14 -0
- package/dist/components/framework/navigation/sidenav/sidenav.d.ts +6 -0
- package/dist/components/framework/navigation/sidenav/sidenav.js +1 -0
- package/dist/components/framework/surface/paper/Paper.svelte +179 -0
- package/dist/components/framework/surface/paper/Paper.svelte.d.ts +18 -0
- package/dist/design-system/reserved-props/allowed-options.d.ts +46 -0
- package/dist/design-system/reserved-props/allowed-options.js +1 -0
- package/dist/design-system/reserved-props/blocked-props.d.ts +9 -0
- package/dist/design-system/reserved-props/blocked-props.js +1 -0
- package/dist/design-system/reserved-props/complex-types.d.ts +1 -0
- package/dist/design-system/reserved-props/complex-types.js +1 -0
- package/dist/design-system/reserved-props/type.d.ts +16 -0
- package/dist/design-system/reserved-props/type.js +1 -0
- package/dist/design-system/theme/tokens.d.ts +7 -0
- package/dist/design-system/theme/tokens.js +219 -0
- package/dist/icons/generated/chevron-double-down.svelte +16 -0
- package/dist/icons/generated/chevron-double-down.svelte.d.ts +7 -0
- package/dist/icons/generated/chevron-double-left.svelte +16 -0
- package/dist/icons/generated/chevron-double-left.svelte.d.ts +7 -0
- package/dist/icons/generated/chevron-double-right.svelte +16 -0
- package/dist/icons/generated/chevron-double-right.svelte.d.ts +7 -0
- package/dist/icons/generated/chevron-double-up.svelte +16 -0
- package/dist/icons/generated/chevron-double-up.svelte.d.ts +7 -0
- package/dist/icons/generated/chevron-down.svelte +16 -0
- package/dist/icons/generated/chevron-down.svelte.d.ts +7 -0
- package/dist/icons/generated/chevron-left.svelte +16 -0
- package/dist/icons/generated/chevron-left.svelte.d.ts +7 -0
- package/dist/icons/generated/chevron-right.svelte +16 -0
- package/dist/icons/generated/chevron-right.svelte.d.ts +7 -0
- package/dist/icons/generated/chevron-up.svelte +16 -0
- package/dist/icons/generated/chevron-up.svelte.d.ts +7 -0
- package/dist/icons/generated/fallback.svelte +17 -0
- package/dist/icons/generated/fallback.svelte.d.ts +7 -0
- package/dist/icons/generated/heart-circle-outline.svelte +16 -0
- package/dist/icons/generated/heart-circle-outline.svelte.d.ts +7 -0
- package/dist/icons/generated/heart-circle.svelte +16 -0
- package/dist/icons/generated/heart-circle.svelte.d.ts +7 -0
- package/dist/icons/generated/heart-half-full.svelte +16 -0
- package/dist/icons/generated/heart-half-full.svelte.d.ts +7 -0
- package/dist/icons/generated/heart-half-outline.svelte +16 -0
- package/dist/icons/generated/heart-half-outline.svelte.d.ts +7 -0
- package/dist/icons/generated/heart-half.svelte +16 -0
- package/dist/icons/generated/heart-half.svelte.d.ts +7 -0
- package/dist/icons/generated/heart-multiple-outline.svelte +23 -0
- package/dist/icons/generated/heart-multiple-outline.svelte.d.ts +7 -0
- package/dist/icons/generated/heart-multiple.svelte +23 -0
- package/dist/icons/generated/heart-multiple.svelte.d.ts +7 -0
- package/dist/icons/generated/heart-outline.svelte +16 -0
- package/dist/icons/generated/heart-outline.svelte.d.ts +7 -0
- package/dist/icons/generated/heart.svelte +16 -0
- package/dist/icons/generated/heart.svelte.d.ts +7 -0
- package/dist/icons/generated/home-edit-outline.svelte +16 -0
- package/dist/icons/generated/home-edit-outline.svelte.d.ts +7 -0
- package/dist/icons/generated/home-edit.svelte +16 -0
- package/dist/icons/generated/home-edit.svelte.d.ts +7 -0
- package/dist/icons/generated/home-outline.svelte +16 -0
- package/dist/icons/generated/home-outline.svelte.d.ts +7 -0
- package/dist/icons/generated/home.svelte +16 -0
- package/dist/icons/generated/home.svelte.d.ts +7 -0
- package/dist/icons/generated/index.d.ts +24 -0
- package/dist/icons/generated/index.js +24 -0
- package/dist/icons/generated/manifest.d.ts +7 -0
- package/dist/icons/generated/manifest.js +198 -0
- package/dist/icons/generated/tag-heart-outline.svelte +16 -0
- package/dist/icons/generated/tag-heart-outline.svelte.d.ts +7 -0
- package/dist/icons/generated/tag-heart.svelte +16 -0
- package/dist/icons/generated/tag-heart.svelte.d.ts +7 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +28 -0
- package/dist/svelte.d.ts +18 -0
- package/dist/theme.css +161 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Seblify
|
|
2
|
+
|
|
3
|
+
> First package publish test
|
|
4
|
+
|
|
5
|
+
Svelte component library for Seblify.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install seblify
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { Button, Badge } from 'seblify';
|
|
17
|
+
import 'seblify/theme.css';
|
|
18
|
+
```
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
banners?: Snippet;
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
drawer?: Snippet;
|
|
8
|
+
snackbars?: Snippet;
|
|
9
|
+
sidebar?: Snippet;
|
|
10
|
+
toasts?: Snippet;
|
|
11
|
+
sidebarWidth?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
banners,
|
|
16
|
+
children,
|
|
17
|
+
drawer,
|
|
18
|
+
snackbars,
|
|
19
|
+
sidebar,
|
|
20
|
+
toasts,
|
|
21
|
+
sidebarWidth = '280px',
|
|
22
|
+
}: Props = $props();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div class="app-shell" style:--sidebar-width={sidebarWidth}>
|
|
26
|
+
{#if banners}
|
|
27
|
+
<div class="banner-stack" aria-label="Page alerts">
|
|
28
|
+
{@render banners()}
|
|
29
|
+
</div>
|
|
30
|
+
{/if}
|
|
31
|
+
|
|
32
|
+
<div class="app-body">
|
|
33
|
+
{#if sidebar}
|
|
34
|
+
<aside class="sidebar">
|
|
35
|
+
{@render sidebar()}
|
|
36
|
+
</aside>
|
|
37
|
+
{/if}
|
|
38
|
+
|
|
39
|
+
<main class="main-content" tabindex="-1">
|
|
40
|
+
{@render children?.()}
|
|
41
|
+
</main>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
{#if toasts}
|
|
45
|
+
<div class="toast-region" aria-live="polite" aria-label="Confirmations">
|
|
46
|
+
{@render toasts()}
|
|
47
|
+
</div>
|
|
48
|
+
{/if}
|
|
49
|
+
|
|
50
|
+
{#if snackbars}
|
|
51
|
+
<div class="snackbar-region" aria-live="polite" aria-label="Notifications">
|
|
52
|
+
{@render snackbars()}
|
|
53
|
+
</div>
|
|
54
|
+
{/if}
|
|
55
|
+
|
|
56
|
+
{#if drawer}
|
|
57
|
+
<div class="drawer-layer">
|
|
58
|
+
{@render drawer()}
|
|
59
|
+
</div>
|
|
60
|
+
{/if}
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<style>
|
|
64
|
+
.app-shell {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
min-height: 100vh;
|
|
68
|
+
background: var(--app-shell-background, var(--seblify-color-page, #f4f6f8));
|
|
69
|
+
color: var(--app-shell-color, var(--seblify-color-text, #172033));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.banner-stack {
|
|
73
|
+
position: relative;
|
|
74
|
+
z-index: 100;
|
|
75
|
+
display: grid;
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.app-body {
|
|
80
|
+
flex: 1;
|
|
81
|
+
display: grid;
|
|
82
|
+
grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
|
|
83
|
+
min-height: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.sidebar {
|
|
87
|
+
min-width: 0;
|
|
88
|
+
background: transparent;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.main-content {
|
|
92
|
+
min-width: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.toast-region {
|
|
96
|
+
position: fixed;
|
|
97
|
+
top: 16px;
|
|
98
|
+
left: 50%;
|
|
99
|
+
z-index: 650;
|
|
100
|
+
display: grid;
|
|
101
|
+
gap: 8px;
|
|
102
|
+
width: min(420px, calc(100vw - 32px));
|
|
103
|
+
transform: translateX(-50%);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.snackbar-region {
|
|
107
|
+
position: fixed;
|
|
108
|
+
right: 16px;
|
|
109
|
+
bottom: 16px;
|
|
110
|
+
z-index: 700;
|
|
111
|
+
display: grid;
|
|
112
|
+
gap: 8px;
|
|
113
|
+
width: min(360px, calc(100vw - 32px));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.drawer-layer {
|
|
117
|
+
position: fixed;
|
|
118
|
+
inset: 0;
|
|
119
|
+
z-index: 1000;
|
|
120
|
+
pointer-events: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.drawer-layer :global(*) {
|
|
124
|
+
pointer-events: auto;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@media (max-width: 760px) {
|
|
128
|
+
.app-body {
|
|
129
|
+
grid-template-columns: 1fr;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.sidebar {
|
|
133
|
+
border-bottom: 0;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
banners?: Snippet;
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
drawer?: Snippet;
|
|
6
|
+
snackbars?: Snippet;
|
|
7
|
+
sidebar?: Snippet;
|
|
8
|
+
toasts?: Snippet;
|
|
9
|
+
sidebarWidth?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const AppShell: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type AppShell = ReturnType<typeof AppShell>;
|
|
13
|
+
export default AppShell;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
type BannerTone = 'info' | 'success' | 'warning' | 'error';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
tone?: BannerTone;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { children, tone = 'info' }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<section
|
|
15
|
+
class="banner"
|
|
16
|
+
class:success={tone === 'success'}
|
|
17
|
+
class:warning={tone === 'warning'}
|
|
18
|
+
class:error={tone === 'error'}
|
|
19
|
+
>
|
|
20
|
+
<div class="content">
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</div>
|
|
23
|
+
</section>
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
.banner {
|
|
27
|
+
width: 100%;
|
|
28
|
+
border-bottom: 1px solid var(--seblify-color-info-border, #bfd1ea);
|
|
29
|
+
background: var(--seblify-color-info-surface, #eaf3ff);
|
|
30
|
+
color: var(--seblify-color-info-text, #102f55);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.content {
|
|
34
|
+
padding: 10px 16px;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
line-height: 1.4;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.success {
|
|
40
|
+
border-bottom-color: var(--seblify-color-success-border, #b8ddc7);
|
|
41
|
+
background: var(--seblify-color-success-surface, #e8f8ee);
|
|
42
|
+
color: var(--seblify-color-success-text, #143d25);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.warning {
|
|
46
|
+
border-bottom-color: var(--seblify-color-warning-border, #e8d28f);
|
|
47
|
+
background: var(--seblify-color-warning-surface, #fff6d8);
|
|
48
|
+
color: var(--seblify-color-warning-text, #4d3900);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.error {
|
|
52
|
+
border-bottom-color: var(--seblify-color-error-border, #efb6b6);
|
|
53
|
+
background: var(--seblify-color-error-surface, #fff0f0);
|
|
54
|
+
color: var(--seblify-color-error-text, #5a1717);
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type BannerTone = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
interface Props {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
tone?: BannerTone;
|
|
6
|
+
}
|
|
7
|
+
declare const Banner: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type Banner = ReturnType<typeof Banner>;
|
|
9
|
+
export default Banner;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = 'primary' | 'secondary';
|
|
5
|
+
type ButtonType = 'button' | 'submit' | 'reset';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onclick?: (event: MouseEvent) => void;
|
|
11
|
+
type?: ButtonType;
|
|
12
|
+
variant?: ButtonVariant;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
disabled = false,
|
|
18
|
+
onclick,
|
|
19
|
+
type = 'button',
|
|
20
|
+
variant = 'primary',
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<button {disabled} {onclick} {type} class:secondary={variant === 'secondary'}>
|
|
25
|
+
{@render children?.()}
|
|
26
|
+
</button>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
button {
|
|
30
|
+
min-height: 36px;
|
|
31
|
+
border: 1px solid var(--seblify-color-fill-accent, #146a6f);
|
|
32
|
+
border-radius: 6px;
|
|
33
|
+
padding: 0 14px;
|
|
34
|
+
background: var(--seblify-color-fill-accent, #146a6f);
|
|
35
|
+
color: var(--seblify-color-fill-accent-text, #ffffff);
|
|
36
|
+
font: inherit;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
button:hover:not(:disabled) {
|
|
42
|
+
background: var(--seblify-color-fill-accent-hover, #0d4d52);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
button:focus-visible {
|
|
46
|
+
outline: 3px solid var(--seblify-color-focus-ring, #9bd4d8);
|
|
47
|
+
outline-offset: 2px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
button:disabled {
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
opacity: var(--seblify-opacity-disabled, 0.56);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.secondary {
|
|
56
|
+
border-color: var(--seblify-color-border, #c8d2df);
|
|
57
|
+
background: var(--seblify-color-surface, #ffffff);
|
|
58
|
+
color: var(--seblify-color-text, #172033);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.secondary:hover:not(:disabled) {
|
|
62
|
+
background: var(--seblify-color-surface-hover, #f1f4f9);
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type ButtonVariant = 'primary' | 'secondary';
|
|
3
|
+
type ButtonType = 'button' | 'submit' | 'reset';
|
|
4
|
+
interface Props {
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onclick?: (event: MouseEvent) => void;
|
|
8
|
+
type?: ButtonType;
|
|
9
|
+
variant?: ButtonVariant;
|
|
10
|
+
}
|
|
11
|
+
declare const Button: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type Button = ReturnType<typeof Button>;
|
|
13
|
+
export default Button;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const iconModules = import.meta.glob("../icons/**/*.svg", {
|
|
3
|
+
eager: true,
|
|
4
|
+
import: "default"
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
alt?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
size?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { alt = "", name = "", size = 24 }: Props = $props();
|
|
14
|
+
|
|
15
|
+
function normalizeNameToPath(value: unknown): string | null {
|
|
16
|
+
const safe = typeof value === "string" ? value.trim() : "";
|
|
17
|
+
|
|
18
|
+
if (safe.length === 0) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const parts = safe.split("-").filter((part) => part.length > 0);
|
|
23
|
+
|
|
24
|
+
if (parts.length < 2) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const folder = parts[0];
|
|
29
|
+
const file = parts.slice(1).join("-");
|
|
30
|
+
|
|
31
|
+
return `../icons/${folder}/${file}.svg`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let groupedPath = $derived(normalizeNameToPath(name));
|
|
35
|
+
let iconPath = $derived(
|
|
36
|
+
(groupedPath != null ? iconModules[groupedPath] : undefined) ??
|
|
37
|
+
iconModules[`../icons/${name}.svg`] ??
|
|
38
|
+
""
|
|
39
|
+
);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
{#if iconPath}
|
|
43
|
+
<span
|
|
44
|
+
role={alt ? "img" : undefined}
|
|
45
|
+
aria-label={alt || undefined}
|
|
46
|
+
aria-hidden={alt ? undefined : "true"}
|
|
47
|
+
style:--icon-url={`url('${iconPath}')`}
|
|
48
|
+
style:width={`${size / 16}rem`}
|
|
49
|
+
style:height={`${size / 16}rem`}
|
|
50
|
+
></span>
|
|
51
|
+
{/if}
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
span {
|
|
55
|
+
display: inline-block;
|
|
56
|
+
flex: 0 0 auto;
|
|
57
|
+
background-color: currentColor;
|
|
58
|
+
mask-image: var(--icon-url);
|
|
59
|
+
mask-position: center;
|
|
60
|
+
mask-repeat: no-repeat;
|
|
61
|
+
mask-size: contain;
|
|
62
|
+
-webkit-mask-image: var(--icon-url);
|
|
63
|
+
-webkit-mask-position: center;
|
|
64
|
+
-webkit-mask-repeat: no-repeat;
|
|
65
|
+
-webkit-mask-size: contain;
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface SidebarNavItem {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
href?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
bottomItems?: SidebarNavItem[];
|
|
12
|
+
logo?: Snippet;
|
|
13
|
+
topItems?: SidebarNavItem[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { bottomItems = [], logo, topItems = [] }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<aside class="sidebar">
|
|
20
|
+
{#if logo}
|
|
21
|
+
<div class="brand">
|
|
22
|
+
{@render logo()}
|
|
23
|
+
</div>
|
|
24
|
+
{/if}
|
|
25
|
+
|
|
26
|
+
<nav class="nav-section top" aria-label="Primary navigation">
|
|
27
|
+
{#each topItems as item}
|
|
28
|
+
<a
|
|
29
|
+
class="nav-item"
|
|
30
|
+
class:active={item.active}
|
|
31
|
+
href={item.href ?? '#'}
|
|
32
|
+
aria-current={item.active ? 'page' : undefined}
|
|
33
|
+
>
|
|
34
|
+
{item.label}
|
|
35
|
+
</a>
|
|
36
|
+
{/each}
|
|
37
|
+
</nav>
|
|
38
|
+
|
|
39
|
+
{#if bottomItems.length > 0}
|
|
40
|
+
<nav class="nav-section bottom" aria-label="Secondary navigation">
|
|
41
|
+
{#each bottomItems as item}
|
|
42
|
+
<a
|
|
43
|
+
class="nav-item"
|
|
44
|
+
class:active={item.active}
|
|
45
|
+
href={item.href ?? '#'}
|
|
46
|
+
aria-current={item.active ? 'page' : undefined}
|
|
47
|
+
>
|
|
48
|
+
{item.label}
|
|
49
|
+
</a>
|
|
50
|
+
{/each}
|
|
51
|
+
</nav>
|
|
52
|
+
{/if}
|
|
53
|
+
</aside>
|
|
54
|
+
|
|
55
|
+
<style>
|
|
56
|
+
.sidebar {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
width: 16.5rem;
|
|
60
|
+
max-width: 100%;
|
|
61
|
+
min-height: 100%;
|
|
62
|
+
background: var(--seblify-color-surface-inverse, #172033);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.brand {
|
|
66
|
+
padding: 1.5rem 1rem;
|
|
67
|
+
color: var(--seblify-color-text-inverse, #ffffff);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.nav-section {
|
|
71
|
+
display: grid;
|
|
72
|
+
gap: 0.25rem;
|
|
73
|
+
margin: 0 1rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.top {
|
|
77
|
+
align-content: start;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.bottom {
|
|
81
|
+
margin-top: auto;
|
|
82
|
+
padding-bottom: 1rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.nav-item {
|
|
86
|
+
display: block;
|
|
87
|
+
width: 100%;
|
|
88
|
+
border-radius: 0.375rem;
|
|
89
|
+
padding: 0.75rem 1rem;
|
|
90
|
+
color: var(--seblify-color-text-inverse, #ffffff);
|
|
91
|
+
font-size: 0.875rem;
|
|
92
|
+
line-height: 1.25rem;
|
|
93
|
+
text-decoration: none;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.nav-item:hover {
|
|
98
|
+
background: var(--seblify-color-surface-inverse-hover, #263043);
|
|
99
|
+
color: var(--seblify-color-text-inverse, #ffffff);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.active {
|
|
103
|
+
background: var(--seblify-color-surface-inverse-hover, #263043);
|
|
104
|
+
color: var(--seblify-color-text-inverse, #ffffff);
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface SidebarNavItem {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
href?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
bottomItems?: SidebarNavItem[];
|
|
9
|
+
logo?: Snippet;
|
|
10
|
+
topItems?: SidebarNavItem[];
|
|
11
|
+
}
|
|
12
|
+
declare const Sidebar: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type Sidebar = ReturnType<typeof Sidebar>;
|
|
14
|
+
export default Sidebar;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
let { children }: Props = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<section class="snackbar" role="status">
|
|
12
|
+
{@render children?.()}
|
|
13
|
+
</section>
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
.snackbar {
|
|
17
|
+
border: 1px solid var(--seblify-color-border-inverse, #263043);
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
padding: 12px 14px;
|
|
20
|
+
background: var(--seblify-color-surface-inverse, #172033);
|
|
21
|
+
color: var(--seblify-color-text-inverse, #ffffff);
|
|
22
|
+
box-shadow: var(--seblify-shadow-raised, 0 12px 28px rgb(23 32 51 / 22%));
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
line-height: 1.4;
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
let { children }: Props = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<section class="toast" role="status">
|
|
12
|
+
{@render children?.()}
|
|
13
|
+
</section>
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
.toast {
|
|
17
|
+
border: 1px solid var(--seblify-color-success-border, #b8ddc7);
|
|
18
|
+
border-radius: 999px;
|
|
19
|
+
padding: 8px 14px;
|
|
20
|
+
background: var(--seblify-color-success-surface, #e8f8ee);
|
|
21
|
+
color: var(--seblify-color-success-text, #143d25);
|
|
22
|
+
box-shadow: var(--seblify-shadow-status, 0 10px 24px rgb(20 61 37 / 14%));
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
line-height: 1.4;
|
|
25
|
+
text-align: center;
|
|
26
|
+
}
|
|
27
|
+
</style>
|