@onetype/framework 2.0.32 → 2.0.34

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,7 @@
1
1
  .e-64d8716d
2
2
  {
3
3
  display: flex;
4
+ flex-direction: column;
4
5
  }
5
6
 
6
7
  .e-64d8716d > .holder
@@ -84,4 +85,81 @@
84
85
  margin-left: auto;
85
86
  border-left: 1px solid var(--ot-bg-2-border);
86
87
  height: 100%;
87
- }
88
+ }
89
+
90
+ /* Burger */
91
+
92
+ .e-64d8716d > .holder > .burger
93
+ {
94
+ display: none;
95
+ align-items: center;
96
+ justify-content: center;
97
+ width: 34px;
98
+ height: 34px;
99
+ margin-left: auto;
100
+ background: none;
101
+ border: none;
102
+ color: var(--ot-text-2);
103
+ cursor: pointer;
104
+ }
105
+
106
+ .e-64d8716d > .holder > .burger > i
107
+ {
108
+ font-size: 20px;
109
+ }
110
+
111
+ /* Menu */
112
+
113
+ .e-64d8716d > .menu
114
+ {
115
+ display: none;
116
+ flex-direction: column;
117
+ background: var(--ot-bg-1);
118
+ border-bottom: 1px solid var(--ot-bg-2-border);
119
+ }
120
+
121
+ .e-64d8716d > .menu > .link
122
+ {
123
+ display: flex;
124
+ align-items: center;
125
+ gap: 8px;
126
+ padding: 10px var(--ot-spacing-m);
127
+ font-size: var(--ot-size-m);
128
+ font-weight: 500;
129
+ color: var(--ot-text-2);
130
+ text-decoration: none;
131
+ border-bottom: 1px solid var(--ot-bg-2-border);
132
+ }
133
+
134
+ .e-64d8716d > .menu > .link > i
135
+ {
136
+ font-size: 16px;
137
+ }
138
+
139
+ .e-64d8716d > .menu > .link:hover,
140
+ .e-64d8716d > .menu > .link.active
141
+ {
142
+ color: var(--ot-text-1);
143
+ background: var(--ot-bg-2);
144
+ }
145
+
146
+ /* Mobile */
147
+
148
+ @media screen and (max-width: 900px)
149
+ {
150
+ .e-64d8716d > .holder > .tabs,
151
+ .e-64d8716d > .holder > .right
152
+ {
153
+ display: none;
154
+ }
155
+
156
+ .e-64d8716d > .holder > .burger
157
+ {
158
+ display: flex;
159
+ }
160
+
161
+ .e-64d8716d > .menu
162
+ {
163
+ display: flex;
164
+ }
165
+ }
@@ -44,6 +44,14 @@ onetype.AddonReady('elements', (elements) =>
44
44
  active: isActive(item)
45
45
  }));
46
46
 
47
+ this.all = [...this.left, ...this.right];
48
+ this.open = false;
49
+
50
+ this.toggle = () =>
51
+ {
52
+ this.open = !this.open;
53
+ };
54
+
47
55
  return `
48
56
  <nav class="holder">
49
57
  <a class="logo" href="/">
@@ -56,7 +64,11 @@ onetype.AddonReady('elements', (elements) =>
56
64
  <div class="right">
57
65
  <a ot-for="item in right" :class="'tab' + (item.active ? ' active' : '')" :href="item.href" :target="item.target || null"><i>{{ item.icon }}</i> {{ item.label }}</a>
58
66
  </div>
67
+ <button class="burger" ot-click="toggle"><i ot-if="!open">menu</i><i ot-if="open">close</i></button>
59
68
  </nav>
69
+ <div ot-if="open" class="menu">
70
+ <a ot-for="item in all" :class="'link' + (item.active ? ' active' : '')" :href="item.href" :target="item.target || null"><i>{{ item.icon }}</i> {{ item.label }}</a>
71
+ </div>
60
72
  `;
61
73
  }
62
74
  });
@@ -19,7 +19,8 @@
19
19
  /* Group */
20
20
 
21
21
  .e-210c16c7 > .holder > .group,
22
- .e-210c16c7 > .holder > .bottom > .group
22
+ .e-210c16c7 > .holder > .bottom > .group,
23
+ .e-210c16c7 > .drawer > .group
23
24
  {
24
25
  display: flex;
25
26
  flex-direction: column;
@@ -29,7 +30,8 @@
29
30
  }
30
31
 
31
32
  .e-210c16c7 > .holder > .group:first-child,
32
- .e-210c16c7 > .holder > .bottom > .group:first-child
33
+ .e-210c16c7 > .holder > .bottom > .group:first-child,
34
+ .e-210c16c7 > .drawer > .group:first-child
33
35
  {
34
36
  padding-top: 0;
35
37
  border-top: none;
@@ -38,7 +40,8 @@
38
40
  /* Title */
39
41
 
40
42
  .e-210c16c7 > .holder > .group > .title,
41
- .e-210c16c7 > .holder > .bottom > .group > .title
43
+ .e-210c16c7 > .holder > .bottom > .group > .title,
44
+ .e-210c16c7 > .drawer > .group > .title
42
45
  {
43
46
  font-size: 10px;
44
47
  font-weight: 600;
@@ -52,7 +55,8 @@
52
55
  /* Item */
53
56
 
54
57
  .e-210c16c7 > .holder > .group > .item,
55
- .e-210c16c7 > .holder > .bottom > .group > .item
58
+ .e-210c16c7 > .holder > .bottom > .group > .item,
59
+ .e-210c16c7 > .drawer > .group > .item
56
60
  {
57
61
  display: flex;
58
62
  align-items: center;
@@ -70,7 +74,8 @@
70
74
  }
71
75
 
72
76
  .e-210c16c7 > .holder > .group > .item > i,
73
- .e-210c16c7 > .holder > .bottom > .group > .item > i
77
+ .e-210c16c7 > .holder > .bottom > .group > .item > i,
78
+ .e-210c16c7 > .drawer > .group > .item > i
74
79
  {
75
80
  font-size: 20px;
76
81
  opacity: 0.4;
@@ -78,7 +83,8 @@
78
83
  }
79
84
 
80
85
  .e-210c16c7 > .holder > .group > .item > span,
81
- .e-210c16c7 > .holder > .bottom > .group > .item > span
86
+ .e-210c16c7 > .holder > .bottom > .group > .item > span,
87
+ .e-210c16c7 > .drawer > .group > .item > span
82
88
  {
83
89
  white-space: nowrap;
84
90
  overflow: hidden;
@@ -86,7 +92,8 @@
86
92
  }
87
93
 
88
94
  .e-210c16c7 > .holder > .group > .item > .count,
89
- .e-210c16c7 > .holder > .bottom > .group > .item > .count
95
+ .e-210c16c7 > .holder > .bottom > .group > .item > .count,
96
+ .e-210c16c7 > .drawer > .group > .item > .count
90
97
  {
91
98
  margin-left: auto;
92
99
  font-size: var(--ot-size-s);
@@ -104,14 +111,16 @@
104
111
  /* Hover */
105
112
 
106
113
  .e-210c16c7 > .holder > .group > .item:hover,
107
- .e-210c16c7 > .holder > .bottom > .group > .item:hover
114
+ .e-210c16c7 > .holder > .bottom > .group > .item:hover,
115
+ .e-210c16c7 > .drawer > .group > .item:hover
108
116
  {
109
117
  color: var(--ot-text-1);
110
118
  background: var(--ot-bg-3);
111
119
  }
112
120
 
113
121
  .e-210c16c7 > .holder > .group > .item:hover > i,
114
- .e-210c16c7 > .holder > .bottom > .group > .item:hover > i
122
+ .e-210c16c7 > .holder > .bottom > .group > .item:hover > i,
123
+ .e-210c16c7 > .drawer > .group > .item:hover > i
115
124
  {
116
125
  opacity: 0.6;
117
126
  }
@@ -119,7 +128,8 @@
119
128
  /* Active */
120
129
 
121
130
  .e-210c16c7 > .holder > .group > .item.active,
122
- .e-210c16c7 > .holder > .bottom > .group > .item.active
131
+ .e-210c16c7 > .holder > .bottom > .group > .item.active,
132
+ .e-210c16c7 > .drawer > .group > .item.active
123
133
  {
124
134
  color: var(--ot-text-1);
125
135
  background: var(--ot-bg-3);
@@ -128,7 +138,8 @@
128
138
  }
129
139
 
130
140
  .e-210c16c7 > .holder > .group > .item.active > i,
131
- .e-210c16c7 > .holder > .bottom > .group > .item.active > i
141
+ .e-210c16c7 > .holder > .bottom > .group > .item.active > i,
142
+ .e-210c16c7 > .drawer > .group > .item.active > i
132
143
  {
133
144
  opacity: 0.9;
134
145
  }
@@ -153,3 +164,125 @@
153
164
  {
154
165
  border-right: 1px solid var(--ot-bg-2-border);
155
166
  }
167
+
168
+ /* Bar, Overlay, Drawer — hidden on desktop */
169
+
170
+ .e-210c16c7 > .bar,
171
+ .e-210c16c7 > .overlay,
172
+ .e-210c16c7 > .drawer
173
+ {
174
+ display: none;
175
+ }
176
+
177
+ /* Mobile */
178
+
179
+ @media screen and (max-width: 900px)
180
+ {
181
+ .e-210c16c7
182
+ {
183
+ width: 100%;
184
+ height: auto;
185
+ }
186
+
187
+ .e-210c16c7 > .holder
188
+ {
189
+ display: none;
190
+ }
191
+
192
+ .e-210c16c7 > .bar
193
+ {
194
+ display: flex;
195
+ align-items: center;
196
+ justify-content: center;
197
+ position: fixed;
198
+ bottom: 0;
199
+ left: 0;
200
+ width: 100vw;
201
+ height: 40px;
202
+ background: var(--ot-bg-1);
203
+ border-top: 1px solid var(--ot-bg-2-border);
204
+ border-bottom: 1px solid var(--ot-bg-2-border);
205
+ z-index: 999;
206
+ cursor: pointer;
207
+ }
208
+
209
+ .e-210c16c7 > .bar > .toggle
210
+ {
211
+ font-size: 20px;
212
+ color: var(--ot-brand);
213
+ }
214
+
215
+ .e-210c16c7 > .drawer > .toggle
216
+ {
217
+ display: flex;
218
+ align-items: center;
219
+ justify-content: center;
220
+ width: 34px;
221
+ height: 34px;
222
+ background: none;
223
+ border: none;
224
+ color: var(--ot-text-2);
225
+ cursor: pointer;
226
+ }
227
+
228
+ .e-210c16c7 > .drawer > .toggle > i
229
+ {
230
+ font-size: 20px;
231
+ }
232
+
233
+ .e-210c16c7 > .overlay
234
+ {
235
+ display: block;
236
+ position: fixed;
237
+ inset: 0;
238
+ background: rgba(0, 0, 0, 0.5);
239
+ z-index: 1000;
240
+ }
241
+
242
+ .e-210c16c7 > .drawer
243
+ {
244
+ display: flex;
245
+ flex-direction: column;
246
+ position: fixed;
247
+ bottom: 0;
248
+ left: 0;
249
+ width: 100vw;
250
+ max-height: 80vh;
251
+ background: var(--ot-bg-1);
252
+ border-top: 1px solid var(--ot-bg-2-border);
253
+ padding: 0 var(--ot-spacing-s) var(--ot-spacing-s);
254
+ overflow-y: auto;
255
+ z-index: 1001;
256
+ }
257
+
258
+ .e-210c16c7 > .drawer > .toggle
259
+ {
260
+ display: flex;
261
+ align-items: center;
262
+ justify-content: center;
263
+ width: 100%;
264
+ height: 40px;
265
+ background: none;
266
+ border: none;
267
+ border-bottom: 1px solid var(--ot-bg-2-border);
268
+ color: var(--ot-text-2);
269
+ cursor: pointer;
270
+ margin-bottom: var(--ot-spacing-s);
271
+ }
272
+
273
+ .e-210c16c7 > .drawer > .toggle > i
274
+ {
275
+ font-size: 20px;
276
+ }
277
+
278
+ .e-210c16c7 > .drawer > .group
279
+ {
280
+ border-top: none;
281
+ border-bottom: 1px solid var(--ot-bg-2-border);
282
+ }
283
+
284
+ .e-210c16c7 > .drawer > .group:last-of-type
285
+ {
286
+ border-bottom: none;
287
+ }
288
+ }
@@ -31,6 +31,7 @@ onetype.AddonReady('elements', (elements) =>
31
31
 
32
32
  this.top = this.groups.filter(g => !g.placement || g.placement === 'top');
33
33
  this.bottom = this.groups.filter(g => g.placement === 'bottom');
34
+ this.open = false;
34
35
 
35
36
  this.isActive = (item) =>
36
37
  {
@@ -46,6 +47,7 @@ onetype.AddonReady('elements', (elements) =>
46
47
  this.handleClick = (item) =>
47
48
  {
48
49
  this.active = item.value;
50
+ this.open = false;
49
51
 
50
52
  if(this._click)
51
53
  {
@@ -53,6 +55,11 @@ onetype.AddonReady('elements', (elements) =>
53
55
  }
54
56
  };
55
57
 
58
+ this.toggle = () =>
59
+ {
60
+ this.open = !this.open;
61
+ };
62
+
56
63
  return `
57
64
  <nav :class="'holder ' + variant.join(' ')">
58
65
  <slot name="top"></slot>
@@ -76,6 +83,31 @@ onetype.AddonReady('elements', (elements) =>
76
83
  </div>
77
84
  <slot name="bottom"></slot>
78
85
  </nav>
86
+ <div :class="'bar ' + variant.join(' ')" ot-click="toggle">
87
+ <i class="toggle">filter_list</i>
88
+ </div>
89
+ <div ot-if="open" class="overlay" ot-click="toggle"></div>
90
+ <nav ot-if="open" :class="'drawer ' + variant.join(' ')">
91
+ <button class="toggle" ot-click="toggle"><i>close</i></button>
92
+ <div ot-for="group in top" class="group">
93
+ <p ot-if="group.title" class="title">{{ group.title }}</p>
94
+ <a ot-for="item in group.items" :class="'item' + (isActive(item) ? ' active' : '')" :href="item.href || 'javascript:void(0)'" ot-click="handleClick(item)">
95
+ <i ot-if="item.icon">{{ item.icon }}</i>
96
+ <span>{{ item.label }}</span>
97
+ <span ot-if="item.count !== undefined" class="count">{{ item.count }}</span>
98
+ </a>
99
+ </div>
100
+ <div ot-if="bottom.length" class="group">
101
+ <div ot-for="group in bottom" class="group">
102
+ <p ot-if="group.title" class="title">{{ group.title }}</p>
103
+ <a ot-for="item in group.items" :class="'item' + (isActive(item) ? ' active' : '')" :href="item.href || 'javascript:void(0)'" ot-click="handleClick(item)">
104
+ <i ot-if="item.icon">{{ item.icon }}</i>
105
+ <span>{{ item.label }}</span>
106
+ <span ot-if="item.count !== undefined" class="count">{{ item.count }}</span>
107
+ </a>
108
+ </div>
109
+ </div>
110
+ </nav>
79
111
  `;
80
112
  }
81
113
  });
@@ -28,6 +28,18 @@
28
28
  .ot-container-l { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 calc(var(--ot-spacing-m) * 2); }
29
29
  .ot-container-full { width: 100%; padding: 0 calc(var(--ot-spacing-m) * 2); }
30
30
 
31
+ @media screen and (max-width: 900px)
32
+ {
33
+ .ot-container,
34
+ .ot-container-s,
35
+ .ot-container-m,
36
+ .ot-container-l,
37
+ .ot-container-full
38
+ {
39
+ padding: 0 var(--ot-spacing-m);
40
+ }
41
+ }
42
+
31
43
  /* Scrollbar */
32
44
  .ot-scrollbar { overflow: auto; }
33
45
  .ot-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
@@ -69,3 +69,11 @@
69
69
  --ot-green-opacity: rgba(52, 211, 153, 0.12);
70
70
  --ot-green-hover: rgba(16, 185, 129, 1);
71
71
  }
72
+
73
+ @media screen and (max-width: 900px)
74
+ {
75
+ :root
76
+ {
77
+ --ot-spacing-l: 16px;
78
+ }
79
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onetype/framework",
3
- "version": "2.0.32",
3
+ "version": "2.0.34",
4
4
  "description": "OneType Framework — Full-stack isomorphic JavaScript framework built from scratch. One addon abstraction powers databases, servers, commands, pages, directives, queues, and more.",
5
5
  "type": "module",
6
6
  "main": "lib/load.js",