micro-sidebar 1.1.0__py3-none-any.whl → 1.2.0__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: micro-sidebar
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: A Reusable RTL Django Sidebar App
5
5
  Home-page: https://github.com/debeski/micro-sidebar
6
6
  Author: DeBeski
@@ -112,3 +112,4 @@ While it may theoretically work in LTR environments if standard Bootstrap files
112
112
  | **v1.0.1** | Fixed titlebar positioning bug causing overlap/gaps. |
113
113
  | **v1.0.2** | Improved documentation clarity and added usage instructions. |
114
114
  | **v1.1.0** | Renamed `content.html` to `main.html` for clarity. Refactored to use `{% block items %}` for easier extension. |
115
+ | **v1.2.0** | **New Theme Implementation:** Redesigned UI with rounded pill-shaped items, tactile micro-animations, and a refined color palette. Improved responsiveness with dynamic top-offset calculations and inline FOUC fixes for small screens. Fixed tooltip stickiness bug. |
@@ -0,0 +1,13 @@
1
+ sidebar/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ sidebar/apps.py,sha256=4UjKXHoBGKRLxpC9AY6eaq8YZx8unirUz_8u-IrlfVQ,145
3
+ sidebar/urls.py,sha256=UL_9e1RLNMxZXkah65m7GRU1dbViZRGeNPBIiSZpOYg,142
4
+ sidebar/views.py,sha256=MebyJ1ZiylSOPESXFkkQ8QTg-ClrkJn-oYLN6KrcgiM,418
5
+ sidebar/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ sidebar/static/sidebar/sidebar.css,sha256=hE5O5CRKXSyvPhtFem0rTbcy5KWgPpcrEqs6i3xEgdU,5204
7
+ sidebar/static/sidebar/sidebar.js,sha256=bfNottViY6uZgPqBHbu97BA2eVIIx2coU-ksjjB_9n4,6646
8
+ sidebar/templates/sidebar/main.html,sha256=m2b34IO-kG7fn5d9vnx9Sjwls2l9uBn2gDL3E5_Gj70,1912
9
+ micro_sidebar-1.2.0.dist-info/LICENSE,sha256=Fco89ULLSSxKkC2KKnx57SaT0R7WOkZfuk8IYcGiN50,1063
10
+ micro_sidebar-1.2.0.dist-info/METADATA,sha256=QlFmiEttPfyZM-6Qf_cJL10Z5gMZiWcLVQfjxZhsqZA,3919
11
+ micro_sidebar-1.2.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
12
+ micro_sidebar-1.2.0.dist-info/top_level.txt,sha256=ih69sjMhU1wOB9HzUV90yEY98aiPuGhzPBBBE-YtJ3w,8
13
+ micro_sidebar-1.2.0.dist-info/RECORD,,
@@ -1,17 +1,20 @@
1
-
2
1
  .sidebar {
3
2
  z-index: 900;
4
- transition: width 0.15s ease-in-out;
5
- background-color: white;
6
- position: -webkit-sticky; /* For Safari */
3
+ transition: width 0.2s ease-in-out;
4
+ background: linear-gradient(180deg, #ffffff 10%, #f1f7fd 100%);
7
5
  position: sticky;
8
- top: 0; /* Sticks the sidebar at the top of the parent container */
6
+ /* Use the JS-provided offset, fallback to 0 if standalone */
7
+ top: var(--sidebar-top-offset, 0px);
9
8
  overflow-y: auto;
10
9
  overflow-x: hidden;
11
- height: calc(100vh - 45px); /* Fallback/Base height for sticky behavior */
12
- /* Custom Scrollbar for Webkit */
10
+ height: calc(100vh - var(--sidebar-top-offset, 0px));
11
+ border-left: 1px solid #f1f3f5;
13
12
  scrollbar-width: thin;
14
- scrollbar-color: rgba(0,0,0,0.2) transparent;
13
+ scrollbar-color: rgba(0,0,0,0.1) transparent;
14
+
15
+ /* Variables for stable positioning */
16
+ --sidebar-item-px: 12.5px;
17
+ --sidebar-icon-width: 40px;
15
18
  }
16
19
 
17
20
  .sidebar::-webkit-scrollbar {
@@ -26,18 +29,27 @@
26
29
  }
27
30
 
28
31
  .sidebar.collapsed {
29
- width: 52px !important;
30
- }
31
- .sidebar.collapsed .list-group-item span {
32
- display: none !important;
32
+ width: 65px !important;
33
33
  }
34
+
35
+ /* Stable layout for icons - NO OVERRIDES for padding/gap here! */
36
+ .sidebar.collapsed .list-group-item span,
34
37
  .sidebar.collapsed .accordion-button span {
35
- display: none !important;
38
+ opacity: 0;
39
+ visibility: hidden;
40
+ width: 0;
41
+ display: inline-block; /* Keep it in flow but hidden */
36
42
  }
37
- .sidebar.collapsed .accordion-button::after {
38
- background-image: none;
43
+
44
+ .sidebar .list-group-item span,
45
+ .sidebar .accordion-button span {
46
+ transition: opacity 0.2s ease, visibility 0.2s;
47
+ white-space: nowrap;
39
48
  }
40
49
 
50
+ .sidebar.collapsed .accordion-button::after {
51
+ display: none !important;
52
+ }
41
53
 
42
54
  .sidebar-ghost {
43
55
  display: none;
@@ -52,12 +64,14 @@
52
64
 
53
65
  .sidebar {
54
66
  position: fixed;
55
- top: 45px; /* Fallback, JS calculates exact height */
67
+ /* Use dynamic offset even in fixed mode for consistency */
68
+ top: var(--sidebar-top-offset, 0px);
56
69
  right: 0;
57
70
  width: 250px;
58
71
  transition: width 0.15s ease-in-out;
59
- height: calc(100vh - 45px); /* Fallback */
72
+ height: calc(100vh - var(--sidebar-top-offset, 0px));
60
73
  z-index: 1000;
74
+ --sidebar-item-px: 6px;
61
75
  }
62
76
 
63
77
  .sidebar.collapsed {
@@ -66,28 +80,121 @@
66
80
  position: fixed;
67
81
  }
68
82
  }
83
+ /* Sidebar Styling Redesign */
69
84
  .sidebar .list-group-item {
70
- border: none !important;
71
- font-size: 18px !important;
85
+ border: 1px solid transparent !important; /* Reserve space to prevent jumps */
86
+ font-size: 0.95rem !important;
72
87
  font-weight: 600 !important;
73
- height: 60px !important;
88
+ color: #5a6474; /* Softer text color */
89
+ margin: 4px 0;
90
+ border-radius: 12px !important; /* Rounded pill shape */
91
+ transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
92
+ display: flex;
93
+ align-items: center;
94
+ gap: 10px;
95
+ padding: 12px var(--sidebar-item-px);
74
96
  white-space: nowrap;
75
97
  overflow: hidden;
76
- padding: 12px;
77
- align-items: center;
98
+ }
99
+
100
+ .sidebar .list-group-item:hover {
101
+ background-color: transparent !important;
102
+ color: var(--primal) !important;
103
+ transform: translateX(-4px); /* Tactile slide for RTL */
104
+ }
105
+
106
+ .sidebar .list-group-item.active {
107
+ border: 1px solid transparent !important; /* Keep the 1px reserve */
108
+ background-color: rgba(35, 99, 195, 0.05) !important; /* Lighter soft blue */
109
+ color: var(--primal) !important;
110
+ font-weight: 700 !important;
111
+ box-shadow: 0 4px 12px rgba(35, 99, 195, 0.08) !important;
112
+ }
113
+
114
+ .sidebar .list-group-item i,
115
+ .sidebar .accordion-button i {
116
+ width: var(--sidebar-icon-width);
117
+ display: flex;
118
+ justify-content: center;
119
+ flex-shrink: 0;
120
+ font-size: 1.25rem;
121
+ transition: transform 0.2s ease, color 0.2s;
122
+ color: #8c98a4; /* Muted icon color by default */
123
+ }
124
+
125
+ .sidebar .list-group-item:hover i,
126
+ .sidebar .list-group-item.active i,
127
+ .sidebar .accordion-button:hover i,
128
+ .sidebar .accordion-button:not(.collapsed) i {
129
+ transform: scale(1.1);
130
+ color: var(--primal); /* Active/Hover icon color */
78
131
  }
79
132
 
80
133
  .sidebar .accordion-button {
81
- font-size: 18px !important;
134
+ font-size: 0.95rem !important;
82
135
  font-weight: 600 !important;
83
- border: none !important;
84
- height: 60px !important;
136
+ color: #5a6474;
137
+ background-color: transparent !important;
138
+ border: 1px solid transparent !important; /* Reserve space here too */
139
+ border-radius: 12px !important;
140
+ margin: 4px 0;
141
+ padding: 12px var(--sidebar-item-px);
142
+ display: flex;
143
+ align-items: center;
144
+ gap: 10px;
85
145
  white-space: nowrap;
86
146
  overflow: hidden;
87
- padding: 12px;
88
- align-items: center;
147
+ transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
89
148
  }
90
149
 
91
150
  .sidebar .accordion-button:not(.collapsed) {
92
- background-color: var(--body) !important;
151
+ background-color: rgba(35, 99, 195, 0.04) !important; /* Very subtle open state */
152
+ color: var(--primal) !important;
153
+ font-weight: 700 !important;
93
154
  }
155
+
156
+ .sidebar .accordion-button:hover {
157
+ color: var(--primal) !important;
158
+ background-color: transparent !important;
159
+ transform: translateX(-4px);
160
+ }
161
+
162
+ .sidebar .accordion-item {
163
+ background-color: transparent !important;
164
+ border: none !important;
165
+ }
166
+
167
+ .sidebar .accordion-body {
168
+ background-color: transparent !important;
169
+ border: none !important;
170
+ padding-top: 0;
171
+ padding-bottom: 0;
172
+ }
173
+
174
+
175
+ .sidebar-toggle {
176
+ background-color: transparent;
177
+ color: #2c3e50;
178
+ border: none;
179
+ transition: background-color 0.3s, transform 0.1s;
180
+ min-width: 5vh;
181
+ min-height: 5vh;
182
+ font-size: 1.5rem;
183
+ }
184
+
185
+ .sidebar-toggle:hover {
186
+ background-color: #f8f9fa;
187
+ color: #0d6efd;
188
+ }
189
+
190
+ .sidebar-toggle:active {
191
+ transform: scale(0.95);
192
+ }
193
+
194
+ .tooltip-custom .tooltip-inner {
195
+ font-size: 1.2rem;
196
+ background-color: var(--title);
197
+ color: white;
198
+ padding: 8px 12px;
199
+ border-radius: 5px;
200
+ }
@@ -22,23 +22,15 @@ document.addEventListener("DOMContentLoaded", function () {
22
22
  function adjustSidebarForWindowSize() {
23
23
  const screenWidth = window.innerWidth;
24
24
  const titlebar = document.querySelector('.titlebar');
25
- const titlebarHeight = titlebar ? titlebar.offsetHeight : 0;
25
+ const titlebarHeight = (titlebar && window.getComputedStyle(titlebar).display !== 'none') ? titlebar.offsetHeight : 0;
26
+
27
+ // Set dynamic CSS variable for the sidebar
28
+ sidebar.style.setProperty('--sidebar-top-offset', titlebarHeight + 'px');
26
29
 
27
30
  if (screenWidth < 1100) {
28
31
  // Always collapse sidebar on small screens
29
32
  sidebar.classList.add("collapsed");
30
33
  initializeTooltips();
31
-
32
- // Dynamic positioning to anchor to titlebar
33
- // Dynamic positioning to anchor to titlebar
34
- if (titlebarHeight > 0) {
35
- sidebar.style.top = titlebarHeight + 'px';
36
- sidebar.style.height = (window.innerHeight - titlebarHeight) + 'px';
37
- } else {
38
- // Failsafe: Stick to top if no titlebar
39
- sidebar.style.top = '0px';
40
- sidebar.style.height = '100vh';
41
- }
42
34
  } else {
43
35
  // Reset styles for large screens to let CSS take over (sticky)
44
36
  sidebar.style.top = '';
@@ -99,6 +91,20 @@ document.addEventListener("DOMContentLoaded", function () {
99
91
  setTimeout(triggerAutoscale, 250);
100
92
  });
101
93
  }
94
+
95
+ // Proactively hide tooltips when any sidebar click occurs
96
+ // This fixes the "sticking to top of screen" glitch during transitions
97
+ sidebar.addEventListener("click", function (event) {
98
+ // Find all tooltips in the sidebar and dispose them immediately
99
+ // This ensures they are completely removed from the DOM before any transition
100
+ const sidebarItems = sidebar.querySelectorAll(".list-group-item, .accordion-button");
101
+ sidebarItems.forEach(item => {
102
+ if (item._tooltip) {
103
+ item._tooltip.dispose();
104
+ delete item._tooltip;
105
+ }
106
+ });
107
+ });
102
108
  });
103
109
 
104
110
  // Close sidebar when clicking outside (only for small screens)
@@ -138,7 +144,8 @@ function initializeTooltips() {
138
144
  item._tooltip = new bootstrap.Tooltip(item, {
139
145
  title: item.querySelector("span").textContent,
140
146
  placement: "right",
141
- customClass: "tooltip-custom"
147
+ customClass: "tooltip-custom",
148
+ trigger: 'hover' // Explicitly disable click/focus triggers
142
149
  });
143
150
  });
144
151
  }
@@ -9,6 +9,19 @@
9
9
  id="sidebar"
10
10
  data-toggle-url="{% url 'toggle_sidebar' %}"
11
11
  data-session-collapsed="{{ request.session.sidebarCollapsed|yesno:'true,false' }}">
12
+ <script>
13
+ // Immediate FOUC fix for small screens
14
+ (function() {
15
+ var screenWidth = window.innerWidth;
16
+ var sidebar = document.currentScript.parentElement;
17
+ if (screenWidth < 1100) {
18
+ sidebar.classList.add('collapsed');
19
+ // Temporarily disable transition to avoid "sliding shut" flicker on load
20
+ sidebar.style.transition = 'none';
21
+ setTimeout(function() { sidebar.style.transition = ''; }, 100);
22
+ }
23
+ })();
24
+ </script>
12
25
  <div class="list-group flex-shrink-0">
13
26
  {% block items %}
14
27
 
@@ -1,13 +0,0 @@
1
- sidebar/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- sidebar/apps.py,sha256=4UjKXHoBGKRLxpC9AY6eaq8YZx8unirUz_8u-IrlfVQ,145
3
- sidebar/urls.py,sha256=UL_9e1RLNMxZXkah65m7GRU1dbViZRGeNPBIiSZpOYg,142
4
- sidebar/views.py,sha256=MebyJ1ZiylSOPESXFkkQ8QTg-ClrkJn-oYLN6KrcgiM,418
5
- sidebar/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- sidebar/static/sidebar/sidebar.css,sha256=aEbc4yPFaQBpMoYnJi575u077pHzej7FLFP8kgRnfBk,2105
7
- sidebar/static/sidebar/sidebar.js,sha256=jLspMcoRDpsw_KpIegGwSL-FRi_uz_8pQ95zDXMnTZ0,6221
8
- sidebar/templates/sidebar/main.html,sha256=8dhxllfL40advQ6z2UlqH_wf3Nnf7ilexukoG7VQoek,1363
9
- micro_sidebar-1.1.0.dist-info/LICENSE,sha256=Fco89ULLSSxKkC2KKnx57SaT0R7WOkZfuk8IYcGiN50,1063
10
- micro_sidebar-1.1.0.dist-info/METADATA,sha256=nlAXd6VHbs4FwddvAZmSxP_0SP6JgACUygmByl3J_mw,3639
11
- micro_sidebar-1.1.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
12
- micro_sidebar-1.1.0.dist-info/top_level.txt,sha256=ih69sjMhU1wOB9HzUV90yEY98aiPuGhzPBBBE-YtJ3w,8
13
- micro_sidebar-1.1.0.dist-info/RECORD,,