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,6 +1,6 @@
1
1
  {
2
2
  "name": "hamzus-ui",
3
- "version": "0.0.236",
3
+ "version": "0.0.238",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -1,18 +1,13 @@
1
1
  <script>
2
2
  import { onMount } from 'svelte';
3
- import { open } from './SideBar';
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
- const monEvenement = new CustomEvent("openNav",{});
13
- document.dispatchEvent(monEvenement);
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
- return ()=>{
28
- window.removeEventListener('keydown', handleKeyDown);
29
- }
22
+ return () => {
23
+ window.removeEventListener('keydown', handleKeyDown);
24
+ };
30
25
  });
31
-
32
-
33
26
  </script>
34
- <nav class="sidebar {$open ? "open" : ""}">
35
- <div class="sidebar-content">
36
- <div class="top">
37
- <slot name="logo"/>
38
- <IconButton onClick={toggleNav} variant="ghost">
39
- <svg
40
- width="24"
41
- height="24"
42
- viewBox="0 0 24 24"
43
- fill="none"
44
- xmlns="http://www.w3.org/2000/svg"
45
- >
46
- <path
47
- 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"
48
- fill="#292D32"
49
- />
50
- <path
51
- 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"
52
- fill="#292D32"
53
- />
54
- </svg>
55
- </IconButton>
56
- </div>
57
- <slot/>
58
- </div>
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
- max-height: 100dvh;
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
- background-color: var(--bg-1);
67
+ background-color: var(--bg-1);
71
68
  overflow-x: clip;
72
- overflow-y: auto;
69
+ overflow-y: auto;
73
70
  }
74
71
  .sidebar.open {
75
- width: 250px;
76
- border-right: 1px solid var(--stroke);
72
+ width: 250px;
73
+ border-right: 1px solid var(--stroke);
77
74
  }
78
- :global(.phone-close-btn) {
79
- display: none;
80
- margin-bottom: 7px;
81
- }
82
- .sidebar-content{
83
- width: 100%;
84
- padding: 7px;
85
- }
86
- .top{
87
- padding-bottom: 7px;
88
- }
89
- .top{
90
- width: 100%;
91
- display: flex;
92
- justify-content: end;
93
- }
94
- .top:global(:has( > :nth-child(2))) {
95
- justify-content: space-between;
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
- @media (max-width : 900px){
108
- .sidebar {
109
- position: fixed;
110
- top: 0;
111
- left: 0;
112
- z-index: 1000;
104
+ .phone-btn {
105
+ display: none;
113
106
  }
114
- :global(.phone-close-btn){
115
- display: flex;
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>
@@ -34,7 +34,7 @@
34
34
  text-wrap: nowrap;
35
35
  }
36
36
  .sidebar-btn:hover{
37
- background-color: var(--bg-1);
37
+ background-color: var(--bg-blur);
38
38
  }
39
39
  .icon-container{
40
40
  height: 16px;
@@ -48,7 +48,7 @@
48
48
  transition: background-color .2s ease-out;
49
49
  }
50
50
  .sidebar-btn:hover{
51
- background-color: var(--bg-1);
51
+ background-color: var(--bg-blur);
52
52
  }
53
53
  .icon-container{
54
54
  height: 16px;