micro-sidebar 1.1.0__py3-none-any.whl → 1.2.1__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.1
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,5 @@ 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. |
116
+ | **v1.2.1** | **Positioning Fix:** Added `align-self: flex-start` to resolve 60px vertical offset in flex containers. Removed legacy `sidebar-top-offset` CSS variable and JS calculations. Added `box-shadow: none` and `outline: none` to accordion buttons to remove focus ring. Fixed page flickering on wider screens by constraining sidebar height with `calc(100vh - header-height)`. |
@@ -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=f6xLSC3JiZFABkxWlFesuzAZZtAT3WW1nZBFMDQNS6Y,5283
7
+ sidebar/static/sidebar/sidebar.js,sha256=xDp038tlscz5KeTjBiEQTzZ2T7a8k4NY3rC6e9NvMsM,6314
8
+ sidebar/templates/sidebar/main.html,sha256=m2b34IO-kG7fn5d9vnx9Sjwls2l9uBn2gDL3E5_Gj70,1912
9
+ micro_sidebar-1.2.1.dist-info/LICENSE,sha256=Fco89ULLSSxKkC2KKnx57SaT0R7WOkZfuk8IYcGiN50,1063
10
+ micro_sidebar-1.2.1.dist-info/METADATA,sha256=msQeEumoDwSbOS8n9pqkE36b9DnaD8IOzAiyBbQOZXw,4304
11
+ micro_sidebar-1.2.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
12
+ micro_sidebar-1.2.1.dist-info/top_level.txt,sha256=ih69sjMhU1wOB9HzUV90yEY98aiPuGhzPBBBE-YtJ3w,8
13
+ micro_sidebar-1.2.1.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
+ top: var(--header-height, 60px);
7
+ align-self: flex-start; /* Force to top of flex container */
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(--header-height, 60px));
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,13 @@
52
64
 
53
65
  .sidebar {
54
66
  position: fixed;
55
- top: 45px; /* Fallback, JS calculates exact height */
67
+ top: var(--header-height, 60px);
56
68
  right: 0;
57
69
  width: 250px;
58
70
  transition: width 0.15s ease-in-out;
59
- height: calc(100vh - 45px); /* Fallback */
71
+ height: calc(100vh - var(--header-height, 60px));
60
72
  z-index: 1000;
73
+ --sidebar-item-px: 6px;
61
74
  }
62
75
 
63
76
  .sidebar.collapsed {
@@ -66,28 +79,128 @@
66
79
  position: fixed;
67
80
  }
68
81
  }
82
+ /* Sidebar Styling Redesign */
69
83
  .sidebar .list-group-item {
70
- border: none !important;
71
- font-size: 18px !important;
84
+ border: 1px solid transparent !important; /* Reserve space to prevent jumps */
85
+ font-size: 0.95rem !important;
72
86
  font-weight: 600 !important;
73
- height: 60px !important;
87
+ color: #5a6474; /* Softer text color */
88
+ margin: 4px 0;
89
+ border-radius: 12px !important; /* Rounded pill shape */
90
+ transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
91
+ display: flex;
92
+ align-items: center;
93
+ gap: 10px;
94
+ padding: 12px var(--sidebar-item-px);
74
95
  white-space: nowrap;
75
96
  overflow: hidden;
76
- padding: 12px;
77
- align-items: center;
97
+ }
98
+
99
+ .sidebar .list-group-item:hover {
100
+ background-color: transparent !important;
101
+ color: var(--primal) !important;
102
+ transform: translateX(-4px); /* Tactile slide for RTL */
103
+ }
104
+
105
+ .sidebar .list-group-item.active {
106
+ border: 1px solid transparent !important; /* Keep the 1px reserve */
107
+ background-color: rgba(35, 99, 195, 0.05) !important; /* Lighter soft blue */
108
+ color: var(--primal) !important;
109
+ font-weight: 700 !important;
110
+ box-shadow: 0 4px 12px rgba(35, 99, 195, 0.08) !important;
111
+ }
112
+
113
+ .sidebar .list-group-item i,
114
+ .sidebar .accordion-button i {
115
+ width: var(--sidebar-icon-width);
116
+ display: flex;
117
+ justify-content: center;
118
+ flex-shrink: 0;
119
+ font-size: 1.25rem;
120
+ transition: transform 0.2s ease, color 0.2s;
121
+ color: #8c98a4; /* Muted icon color by default */
122
+ }
123
+
124
+ .sidebar .list-group-item:hover i,
125
+ .sidebar .list-group-item.active i,
126
+ .sidebar .accordion-button:hover i,
127
+ .sidebar .accordion-button:not(.collapsed) i {
128
+ transform: scale(1.1);
129
+ color: var(--primal); /* Active/Hover icon color */
78
130
  }
79
131
 
80
132
  .sidebar .accordion-button {
81
- font-size: 18px !important;
133
+ font-size: 0.95rem !important;
82
134
  font-weight: 600 !important;
83
- border: none !important;
84
- height: 60px !important;
135
+ color: #5a6474;
136
+ background-color: transparent !important;
137
+ border: 1px solid transparent !important; /* Reserve space here too */
138
+ border-radius: 12px !important;
139
+ margin: 4px 0;
140
+ padding: 12px var(--sidebar-item-px);
141
+ display: flex;
142
+ align-items: center;
143
+ gap: 10px;
85
144
  white-space: nowrap;
86
145
  overflow: hidden;
87
- padding: 12px;
88
- align-items: center;
146
+ transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
147
+ box-shadow: none !important;
148
+ outline: none !important;
149
+ }
150
+
151
+ .sidebar .accordion-button:focus {
152
+ box-shadow: none !important;
153
+ outline: none !important;
89
154
  }
90
155
 
91
156
  .sidebar .accordion-button:not(.collapsed) {
92
- background-color: var(--body) !important;
157
+ background-color: rgba(35, 99, 195, 0.04) !important; /* Very subtle open state */
158
+ color: var(--primal) !important;
159
+ font-weight: 700 !important;
160
+ }
161
+
162
+ .sidebar .accordion-button:hover {
163
+ color: var(--primal) !important;
164
+ background-color: transparent !important;
165
+ transform: translateX(-4px);
166
+ }
167
+
168
+ .sidebar .accordion-item {
169
+ background-color: transparent !important;
170
+ border: none !important;
93
171
  }
172
+
173
+ .sidebar .accordion-body {
174
+ background-color: transparent !important;
175
+ border: none !important;
176
+ padding-top: 0;
177
+ padding-bottom: 0;
178
+ }
179
+
180
+
181
+ .sidebar-toggle {
182
+ background-color: transparent;
183
+ color: #2c3e50;
184
+ border: none;
185
+ transition: background-color 0.3s, transform 0.1s;
186
+ min-width: 5vh;
187
+ min-height: 5vh;
188
+ font-size: 1.5rem;
189
+ }
190
+
191
+ .sidebar-toggle:hover {
192
+ background-color: #f8f9fa;
193
+ color: #0d6efd;
194
+ }
195
+
196
+ .sidebar-toggle:active {
197
+ transform: scale(0.95);
198
+ }
199
+
200
+ .tooltip-custom .tooltip-inner {
201
+ font-size: 1.2rem;
202
+ background-color: var(--title);
203
+ color: white;
204
+ padding: 8px 12px;
205
+ border-radius: 5px;
206
+ }
@@ -21,24 +21,11 @@ document.addEventListener("DOMContentLoaded", function () {
21
21
  // Function to handle sidebar collapsing based on window size
22
22
  function adjustSidebarForWindowSize() {
23
23
  const screenWidth = window.innerWidth;
24
- const titlebar = document.querySelector('.titlebar');
25
- const titlebarHeight = titlebar ? titlebar.offsetHeight : 0;
26
24
 
27
25
  if (screenWidth < 1100) {
28
26
  // Always collapse sidebar on small screens
29
27
  sidebar.classList.add("collapsed");
30
28
  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
29
  } else {
43
30
  // Reset styles for large screens to let CSS take over (sticky)
44
31
  sidebar.style.top = '';
@@ -99,6 +86,20 @@ document.addEventListener("DOMContentLoaded", function () {
99
86
  setTimeout(triggerAutoscale, 250);
100
87
  });
101
88
  }
89
+
90
+ // Proactively hide tooltips when any sidebar click occurs
91
+ // This fixes the "sticking to top of screen" glitch during transitions
92
+ sidebar.addEventListener("click", function (event) {
93
+ // Find all tooltips in the sidebar and dispose them immediately
94
+ // This ensures they are completely removed from the DOM before any transition
95
+ const sidebarItems = sidebar.querySelectorAll(".list-group-item, .accordion-button");
96
+ sidebarItems.forEach(item => {
97
+ if (item._tooltip) {
98
+ item._tooltip.dispose();
99
+ delete item._tooltip;
100
+ }
101
+ });
102
+ });
102
103
  });
103
104
 
104
105
  // Close sidebar when clicking outside (only for small screens)
@@ -138,7 +139,8 @@ function initializeTooltips() {
138
139
  item._tooltip = new bootstrap.Tooltip(item, {
139
140
  title: item.querySelector("span").textContent,
140
141
  placement: "right",
141
- customClass: "tooltip-custom"
142
+ customClass: "tooltip-custom",
143
+ trigger: 'hover' // Explicitly disable click/focus triggers
142
144
  });
143
145
  });
144
146
  }
@@ -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,,