hamzus-ui 0.0.236 → 0.0.238
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/package.json
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
|
-
|
|
3
|
+
import { open } from './SideBar';
|
|
4
4
|
import IconButton from '../../components/hamzus-ui/IconButton/IconButton.svelte';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
6
|
function toggleNav() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
open.update((acutalValue)=>!acutalValue)
|
|
7
|
+
const monEvenement = new CustomEvent('openNav', {});
|
|
8
|
+
document.dispatchEvent(monEvenement);
|
|
9
|
+
|
|
10
|
+
open.update((acutalValue) => !acutalValue);
|
|
16
11
|
}
|
|
17
12
|
|
|
18
13
|
function handleKeyDown(event) {
|
|
@@ -24,77 +19,79 @@
|
|
|
24
19
|
onMount(() => {
|
|
25
20
|
window.addEventListener('keydown', handleKeyDown);
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
return () => {
|
|
23
|
+
window.removeEventListener('keydown', handleKeyDown);
|
|
24
|
+
};
|
|
30
25
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
26
|
</script>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
27
|
+
|
|
28
|
+
<nav class="sidebar {$open ? 'open' : ''}">
|
|
29
|
+
<div class="sidebar-content">
|
|
30
|
+
<div class="top">
|
|
31
|
+
<slot name="logo" />
|
|
32
|
+
<div class="phone-btn">
|
|
33
|
+
<IconButton onClick={toggleNav} variant="ghost">
|
|
34
|
+
<svg
|
|
35
|
+
width="24"
|
|
36
|
+
height="24"
|
|
37
|
+
viewBox="0 0 24 24"
|
|
38
|
+
fill="none"
|
|
39
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
+
>
|
|
41
|
+
<path
|
|
42
|
+
d="M15 22.75H9C3.57 22.75 1.25 20.43 1.25 15V9C1.25 3.57 3.57 1.25 9 1.25H15C20.43 1.25 22.75 3.57 22.75 9V15C22.75 20.43 20.43 22.75 15 22.75ZM9 2.75C4.39 2.75 2.75 4.39 2.75 9V15C2.75 19.61 4.39 21.25 9 21.25H15C19.61 21.25 21.25 19.61 21.25 15V9C21.25 4.39 19.61 2.75 15 2.75H9Z"
|
|
43
|
+
fill="#292D32"
|
|
44
|
+
/>
|
|
45
|
+
<path
|
|
46
|
+
d="M6.14717 22C4.17762 22 2.54434 18.1322 2.54434 17.7222L2.84561 4.78206C2.84561 4.37206 4.17762 2.37205 6.14717 2.37205C8.11672 2.37205 9.75 1.58999 9.75 1.99999V22C9.75 22.41 8.11672 22 6.14717 22Z"
|
|
47
|
+
fill="#292D32"
|
|
48
|
+
/>
|
|
49
|
+
</svg>
|
|
50
|
+
</IconButton>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<slot />
|
|
54
|
+
</div>
|
|
59
55
|
</nav>
|
|
56
|
+
|
|
60
57
|
<style>
|
|
61
58
|
.sidebar {
|
|
62
59
|
width: 0;
|
|
63
60
|
height: 100%;
|
|
64
|
-
|
|
61
|
+
max-height: 100dvh;
|
|
65
62
|
display: flex;
|
|
66
63
|
flex-direction: column;
|
|
67
64
|
transition-property: width;
|
|
68
|
-
transition-duration: .2s;
|
|
65
|
+
transition-duration: 0.2s;
|
|
69
66
|
transition-timing-function: ease-in-out;
|
|
70
|
-
|
|
67
|
+
background-color: var(--bg-1);
|
|
71
68
|
overflow-x: clip;
|
|
72
|
-
|
|
69
|
+
overflow-y: auto;
|
|
73
70
|
}
|
|
74
71
|
.sidebar.open {
|
|
75
|
-
width:
|
|
76
|
-
|
|
72
|
+
width: 250px;
|
|
73
|
+
border-right: 1px solid var(--stroke);
|
|
77
74
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
75
|
+
:global(.phone-close-btn) {
|
|
76
|
+
display: none;
|
|
77
|
+
margin-bottom: 7px;
|
|
78
|
+
}
|
|
79
|
+
.sidebar-content {
|
|
80
|
+
width: 100%;
|
|
81
|
+
padding: 7px;
|
|
82
|
+
}
|
|
83
|
+
.top {
|
|
84
|
+
padding-bottom: 7px;
|
|
85
|
+
}
|
|
86
|
+
.top {
|
|
87
|
+
width: 100%;
|
|
88
|
+
display: flex;
|
|
89
|
+
justify-content: end;
|
|
90
|
+
}
|
|
91
|
+
.top:global(:has(> :nth-child(2))) {
|
|
92
|
+
justify-content: space-between;
|
|
93
|
+
}
|
|
94
|
+
/*
|
|
98
95
|
old width margin
|
|
99
96
|
.nav-content.focus {
|
|
100
97
|
width: calc(100% - (10px + 250px));
|
|
@@ -104,15 +101,21 @@
|
|
|
104
101
|
border-radius: 7px;
|
|
105
102
|
|
|
106
103
|
} */
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
position: fixed;
|
|
110
|
-
top: 0;
|
|
111
|
-
left: 0;
|
|
112
|
-
z-index: 1000;
|
|
104
|
+
.phone-btn {
|
|
105
|
+
display: none;
|
|
113
106
|
}
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
@media (max-width: 900px) {
|
|
108
|
+
.sidebar {
|
|
109
|
+
position: fixed;
|
|
110
|
+
top: 0;
|
|
111
|
+
left: 0;
|
|
112
|
+
z-index: 1000;
|
|
113
|
+
}
|
|
114
|
+
:global(.phone-close-btn) {
|
|
115
|
+
display: flex;
|
|
116
|
+
}
|
|
117
|
+
.phone-btn {
|
|
118
|
+
display: initial;
|
|
116
119
|
}
|
|
117
|
-
|
|
120
|
+
}
|
|
118
121
|
</style>
|