@axium/client 0.12.2 → 0.12.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.
@@ -0,0 +1,112 @@
1
+ <script lang="ts">
2
+ import Icon from './Icon.svelte';
3
+ import { capitalize } from 'utilium';
4
+
5
+ interface Tab {
6
+ href: string;
7
+ name: string;
8
+ icon: string;
9
+ active: boolean;
10
+ }
11
+
12
+ let { children, tabs, bottom }: { children(): any; tabs: Tab[]; bottom?(): any } = $props();
13
+ </script>
14
+
15
+ <div class="sidebar-container">
16
+ <div class="sidebar">
17
+ {#each tabs as { href, name, icon: i, active }}
18
+ <a {href} class={['item', 'icon-text', active && 'active']}><Icon {i} /> <span class="sidebar-text">{capitalize(name)}</span></a
19
+ >
20
+ {/each}
21
+
22
+ {#if bottom}
23
+ <div class="sidebar-bottom">
24
+ {@render bottom()}
25
+ </div>
26
+ {/if}
27
+ </div>
28
+
29
+ <div class="sidebar-content">
30
+ {@render children()}
31
+ </div>
32
+ </div>
33
+
34
+ <style>
35
+ .sidebar-container {
36
+ display: grid;
37
+ grid-template-columns: 15em 1fr;
38
+ height: 100%;
39
+ }
40
+
41
+ .sidebar {
42
+ grid-column: 1;
43
+ width: 100%;
44
+ display: inline-flex;
45
+ flex-direction: column;
46
+ gap: 0.5em;
47
+ background-color: var(--bg-alt);
48
+ padding: 1em;
49
+ padding-left: 0;
50
+ border-radius: 0 1em 1em 0;
51
+
52
+ .item {
53
+ padding: 0.3em 0.5em;
54
+ border-radius: 0.25em 1em 1em 0.25em;
55
+ }
56
+
57
+ .item:hover {
58
+ background-color: var(--bg-strong);
59
+ cursor: pointer;
60
+ }
61
+
62
+ .item.active {
63
+ background-color: var(--bg-strong);
64
+ }
65
+ }
66
+
67
+ .sidebar-content {
68
+ grid-column: 2;
69
+ padding: 1em;
70
+ overflow-x: hidden;
71
+ overflow-y: scroll;
72
+ }
73
+
74
+ .sidebar-bottom {
75
+ margin-top: auto;
76
+ }
77
+
78
+ @media (width < 700px) {
79
+ .sidebar-container {
80
+ grid-template-columns: 1fr;
81
+ }
82
+
83
+ .sidebar-content {
84
+ padding-bottom: 4em;
85
+ grid-column: 1;
86
+ }
87
+
88
+ .sidebar {
89
+ position: fixed;
90
+ grid-column: unset;
91
+ inset: auto 0 0;
92
+ border-radius: 1em;
93
+ display: flex;
94
+ flex-direction: row;
95
+ justify-content: space-around;
96
+ gap: 1em;
97
+ padding: 0.5em;
98
+ z-index: 6;
99
+
100
+ .item {
101
+ flex: 1 1 0;
102
+ border-radius: 1em;
103
+ padding: 1em;
104
+ justify-content: center;
105
+ }
106
+ }
107
+
108
+ .sidebar-text {
109
+ display: none;
110
+ }
111
+ }
112
+ </style>
package/lib/index.ts CHANGED
@@ -9,6 +9,7 @@ export { default as NumberBar } from './NumberBar.svelte';
9
9
  export { default as Popover } from './Popover.svelte';
10
10
  export { default as Register } from './Register.svelte';
11
11
  export { default as SessionList } from './SessionList.svelte';
12
+ export { default as SidebarLayout } from './SidebarLayout.svelte';
12
13
  export { default as Toast } from './Toast.svelte';
13
14
  export { default as Upload } from './Upload.svelte';
14
15
  export { default as URLText } from './URLText.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/client",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "author": "James Prevett <jp@jamespre.dev>",
5
5
  "funding": {
6
6
  "type": "individual",