ywana-core8 0.2.20 → 0.2.21

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.
@@ -0,0 +1,504 @@
1
+ import React from 'react'
2
+ import { MenuIcon, MenuItem, MenuSeparator } from './menu'
3
+
4
+ export default {
5
+ title: 'HTML/Menu'
6
+ }
7
+
8
+ /**
9
+ * Basic Menu Example
10
+ */
11
+ export const BasicMenu = () => (
12
+ <div style={{ padding: '100px', display: 'flex', gap: '20px', flexWrap: 'wrap' }}>
13
+ <div>
14
+ <h3>Basic Menu</h3>
15
+ <MenuIcon icon="more_vert">
16
+ <MenuItem icon="edit" label="Edit" onSelect={() => alert('Edit clicked')} />
17
+ <MenuItem icon="copy" label="Copy" onSelect={() => alert('Copy clicked')} />
18
+ <MenuItem icon="delete" label="Delete" onSelect={() => alert('Delete clicked')} />
19
+ </MenuIcon>
20
+ </div>
21
+
22
+ <div>
23
+ <h3>With Separators</h3>
24
+ <MenuIcon icon="menu">
25
+ <MenuItem icon="home" label="Home" onSelect={() => alert('Home')} />
26
+ <MenuItem icon="dashboard" label="Dashboard" onSelect={() => alert('Dashboard')} />
27
+ <MenuSeparator />
28
+ <MenuItem icon="settings" label="Settings" onSelect={() => alert('Settings')} />
29
+ <MenuItem icon="help" label="Help" onSelect={() => alert('Help')} />
30
+ <MenuSeparator />
31
+ <MenuItem icon="logout" label="Logout" onSelect={() => alert('Logout')} />
32
+ </MenuIcon>
33
+ </div>
34
+
35
+ <div>
36
+ <h3>With Disabled Items</h3>
37
+ <MenuIcon icon="more_horiz">
38
+ <MenuItem icon="visibility" label="View" onSelect={() => alert('View')} />
39
+ <MenuItem icon="edit" label="Edit" disabled={true} />
40
+ <MenuItem icon="share" label="Share" onSelect={() => alert('Share')} />
41
+ <MenuItem icon="delete" label="Delete" disabled={true} />
42
+ </MenuIcon>
43
+ </div>
44
+
45
+ <div>
46
+ <h3>With Metadata</h3>
47
+ <MenuIcon icon="settings">
48
+ <MenuItem icon="save" label="Save" meta="Ctrl+S" onSelect={() => alert('Save')} />
49
+ <MenuItem icon="undo" label="Undo" meta="Ctrl+Z" onSelect={() => alert('Undo')} />
50
+ <MenuItem icon="redo" label="Redo" meta="Ctrl+Y" onSelect={() => alert('Redo')} />
51
+ <MenuSeparator />
52
+ <MenuItem icon="print" label="Print" meta="Ctrl+P" onSelect={() => alert('Print')} />
53
+ </MenuIcon>
54
+ </div>
55
+ </div>
56
+ )
57
+
58
+ /**
59
+ * All Positions Demo
60
+ */
61
+ export const AllPositions = () => (
62
+ <div style={{ padding: '20px' }}>
63
+ <h2>Menu Positions</h2>
64
+ <p>Click each icon to see the menu in different positions</p>
65
+
66
+ <div style={{
67
+ display: 'grid',
68
+ gridTemplateColumns: 'repeat(3, 1fr)',
69
+ gap: '100px',
70
+ padding: '100px',
71
+ background: '#f5f5f5',
72
+ borderRadius: '8px'
73
+ }}>
74
+ {/* Top Row */}
75
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
76
+ <p><strong>Top Left</strong></p>
77
+ <MenuIcon icon="arrow_drop_up" position="top-left">
78
+ <MenuItem icon="star" label="Top Left Item 1" />
79
+ <MenuItem icon="favorite" label="Top Left Item 2" />
80
+ <MenuItem icon="bookmark" label="Top Left Item 3" />
81
+ </MenuIcon>
82
+ </div>
83
+
84
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
85
+ <p><strong>Top (Centered)</strong></p>
86
+ <MenuIcon icon="arrow_drop_up" position="top">
87
+ <MenuItem icon="star" label="Top Center Item 1" />
88
+ <MenuItem icon="favorite" label="Top Center Item 2" />
89
+ <MenuItem icon="bookmark" label="Top Center Item 3" />
90
+ </MenuIcon>
91
+ </div>
92
+
93
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
94
+ <p><strong>Top Right</strong></p>
95
+ <MenuIcon icon="arrow_drop_up" position="top-right">
96
+ <MenuItem icon="star" label="Top Right Item 1" />
97
+ <MenuItem icon="favorite" label="Top Right Item 2" />
98
+ <MenuItem icon="bookmark" label="Top Right Item 3" />
99
+ </MenuIcon>
100
+ </div>
101
+
102
+ {/* Middle Row */}
103
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
104
+ <p><strong>Left</strong></p>
105
+ <MenuIcon icon="arrow_left" position="left">
106
+ <MenuItem icon="star" label="Left Item 1" />
107
+ <MenuItem icon="favorite" label="Left Item 2" />
108
+ <MenuItem icon="bookmark" label="Left Item 3" />
109
+ </MenuIcon>
110
+ </div>
111
+
112
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', background: '#e0e0e0', padding: '20px', borderRadius: '8px' }}>
113
+ <p><strong>Icon Here</strong></p>
114
+ <p style={{ fontSize: '12px', color: '#666' }}>Click surrounding icons</p>
115
+ </div>
116
+
117
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
118
+ <p><strong>Right</strong></p>
119
+ <MenuIcon icon="arrow_right" position="right">
120
+ <MenuItem icon="star" label="Right Item 1" />
121
+ <MenuItem icon="favorite" label="Right Item 2" />
122
+ <MenuItem icon="bookmark" label="Right Item 3" />
123
+ </MenuIcon>
124
+ </div>
125
+
126
+ {/* Bottom Row */}
127
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
128
+ <p><strong>Bottom Left</strong></p>
129
+ <MenuIcon icon="arrow_drop_down" position="bottom-left">
130
+ <MenuItem icon="star" label="Bottom Left Item 1" />
131
+ <MenuItem icon="favorite" label="Bottom Left Item 2" />
132
+ <MenuItem icon="bookmark" label="Bottom Left Item 3" />
133
+ </MenuIcon>
134
+ </div>
135
+
136
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
137
+ <p><strong>Bottom (Centered)</strong></p>
138
+ <MenuIcon icon="arrow_drop_down" position="bottom">
139
+ <MenuItem icon="star" label="Bottom Center Item 1" />
140
+ <MenuItem icon="favorite" label="Bottom Center Item 2" />
141
+ <MenuItem icon="bookmark" label="Bottom Center Item 3" />
142
+ </MenuIcon>
143
+ </div>
144
+
145
+ <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
146
+ <p><strong>Bottom Right</strong></p>
147
+ <MenuIcon icon="arrow_drop_down" position="bottom-right">
148
+ <MenuItem icon="star" label="Bottom Right Item 1" />
149
+ <MenuItem icon="favorite" label="Bottom Right Item 2" />
150
+ <MenuItem icon="bookmark" label="Bottom Right Item 3" />
151
+ </MenuIcon>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ )
156
+
157
+ /**
158
+ * Context Menu Simulation
159
+ */
160
+ export const ContextMenuExample = () => (
161
+ <div style={{ padding: '50px' }}>
162
+ <h2>Context Menu Example</h2>
163
+ <p>Common use case: Actions menu in a table or card</p>
164
+
165
+ <div style={{
166
+ display: 'grid',
167
+ gridTemplateColumns: 'repeat(auto-fill, minmax(250px, 1fr))',
168
+ gap: '20px',
169
+ marginTop: '20px'
170
+ }}>
171
+ {/* Card 1 */}
172
+ <div style={{
173
+ border: '1px solid #ddd',
174
+ borderRadius: '8px',
175
+ padding: '16px',
176
+ background: 'white',
177
+ boxShadow: '0 2px 4px rgba(0,0,0,0.1)'
178
+ }}>
179
+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
180
+ <h3 style={{ margin: 0 }}>Document 1</h3>
181
+ <MenuIcon icon="more_vert" position="bottom-right">
182
+ <MenuItem icon="visibility" label="View" onSelect={() => alert('View Document 1')} />
183
+ <MenuItem icon="edit" label="Edit" onSelect={() => alert('Edit Document 1')} />
184
+ <MenuItem icon="download" label="Download" onSelect={() => alert('Download Document 1')} />
185
+ <MenuSeparator />
186
+ <MenuItem icon="share" label="Share" onSelect={() => alert('Share Document 1')} />
187
+ <MenuSeparator />
188
+ <MenuItem icon="delete" label="Delete" onSelect={() => alert('Delete Document 1')} />
189
+ </MenuIcon>
190
+ </div>
191
+ <p style={{ color: '#666', fontSize: '14px' }}>Last modified: 2 hours ago</p>
192
+ </div>
193
+
194
+ {/* Card 2 */}
195
+ <div style={{
196
+ border: '1px solid #ddd',
197
+ borderRadius: '8px',
198
+ padding: '16px',
199
+ background: 'white',
200
+ boxShadow: '0 2px 4px rgba(0,0,0,0.1)'
201
+ }}>
202
+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
203
+ <h3 style={{ margin: 0 }}>Document 2</h3>
204
+ <MenuIcon icon="more_vert" position="bottom-right">
205
+ <MenuItem icon="visibility" label="View" onSelect={() => alert('View Document 2')} />
206
+ <MenuItem icon="edit" label="Edit" disabled={true} />
207
+ <MenuItem icon="download" label="Download" onSelect={() => alert('Download Document 2')} />
208
+ <MenuSeparator />
209
+ <MenuItem icon="share" label="Share" onSelect={() => alert('Share Document 2')} />
210
+ <MenuSeparator />
211
+ <MenuItem icon="delete" label="Delete" onSelect={() => alert('Delete Document 2')} />
212
+ </MenuIcon>
213
+ </div>
214
+ <p style={{ color: '#666', fontSize: '14px' }}>Last modified: Yesterday</p>
215
+ </div>
216
+
217
+ {/* Card 3 */}
218
+ <div style={{
219
+ border: '1px solid #ddd',
220
+ borderRadius: '8px',
221
+ padding: '16px',
222
+ background: 'white',
223
+ boxShadow: '0 2px 4px rgba(0,0,0,0.1)'
224
+ }}>
225
+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
226
+ <h3 style={{ margin: 0 }}>Document 3</h3>
227
+ <MenuIcon icon="more_vert" position="bottom-right">
228
+ <MenuItem icon="visibility" label="View" onSelect={() => alert('View Document 3')} />
229
+ <MenuItem icon="edit" label="Edit" onSelect={() => alert('Edit Document 3')} />
230
+ <MenuItem icon="download" label="Download" onSelect={() => alert('Download Document 3')} />
231
+ <MenuSeparator />
232
+ <MenuItem icon="share" label="Share" onSelect={() => alert('Share Document 3')} />
233
+ <MenuSeparator />
234
+ <MenuItem icon="delete" label="Delete" onSelect={() => alert('Delete Document 3')} />
235
+ </MenuIcon>
236
+ </div>
237
+ <p style={{ color: '#666', fontSize: '14px' }}>Last modified: Last week</p>
238
+ </div>
239
+ </div>
240
+ </div>
241
+ )
242
+
243
+ /**
244
+ * Icon Sizes
245
+ */
246
+ export const IconSizes = () => (
247
+ <div style={{ padding: '50px', display: 'flex', gap: '40px', alignItems: 'center' }}>
248
+ <div>
249
+ <p><strong>Small Icon</strong></p>
250
+ <MenuIcon icon="more_vert" size="small">
251
+ <MenuItem icon="edit" label="Edit" size="small" />
252
+ <MenuItem icon="delete" label="Delete" size="small" />
253
+ </MenuIcon>
254
+ </div>
255
+
256
+ <div>
257
+ <p><strong>Normal Icon (default)</strong></p>
258
+ <MenuIcon icon="more_vert" size="normal">
259
+ <MenuItem icon="edit" label="Edit" />
260
+ <MenuItem icon="delete" label="Delete" />
261
+ </MenuIcon>
262
+ </div>
263
+
264
+ <div>
265
+ <p><strong>Large Icon</strong></p>
266
+ <MenuIcon icon="more_vert" size="large">
267
+ <MenuItem icon="edit" label="Edit" size="large" />
268
+ <MenuItem icon="delete" label="Delete" size="large" />
269
+ </MenuIcon>
270
+ </div>
271
+ </div>
272
+ )
273
+
274
+ /**
275
+ * Different Icons
276
+ */
277
+ export const DifferentIcons = () => (
278
+ <div style={{ padding: '50px', display: 'flex', gap: '40px', flexWrap: 'wrap' }}>
279
+ <div>
280
+ <p><strong>more_vert</strong></p>
281
+ <MenuIcon icon="more_vert">
282
+ <MenuItem icon="edit" label="Edit" />
283
+ <MenuItem icon="delete" label="Delete" />
284
+ </MenuIcon>
285
+ </div>
286
+
287
+ <div>
288
+ <p><strong>more_horiz</strong></p>
289
+ <MenuIcon icon="more_horiz">
290
+ <MenuItem icon="edit" label="Edit" />
291
+ <MenuItem icon="delete" label="Delete" />
292
+ </MenuIcon>
293
+ </div>
294
+
295
+ <div>
296
+ <p><strong>menu</strong></p>
297
+ <MenuIcon icon="menu">
298
+ <MenuItem icon="home" label="Home" />
299
+ <MenuItem icon="dashboard" label="Dashboard" />
300
+ <MenuItem icon="settings" label="Settings" />
301
+ </MenuIcon>
302
+ </div>
303
+
304
+ <div>
305
+ <p><strong>settings</strong></p>
306
+ <MenuIcon icon="settings">
307
+ <MenuItem icon="account_circle" label="Profile" />
308
+ <MenuItem icon="notifications" label="Notifications" />
309
+ <MenuItem icon="security" label="Security" />
310
+ </MenuIcon>
311
+ </div>
312
+
313
+ <div>
314
+ <p><strong>apps</strong></p>
315
+ <MenuIcon icon="apps">
316
+ <MenuItem icon="mail" label="Mail" />
317
+ <MenuItem icon="calendar_today" label="Calendar" />
318
+ <MenuItem icon="contacts" label="Contacts" />
319
+ <MenuItem icon="drive_file" label="Drive" />
320
+ </MenuIcon>
321
+ </div>
322
+
323
+ <div>
324
+ <p><strong>account_circle</strong></p>
325
+ <MenuIcon icon="account_circle">
326
+ <MenuItem icon="person" label="My Profile" />
327
+ <MenuItem icon="settings" label="Settings" />
328
+ <MenuSeparator />
329
+ <MenuItem icon="logout" label="Logout" />
330
+ </MenuIcon>
331
+ </div>
332
+ </div>
333
+ )
334
+
335
+ /**
336
+ * Long Menu with Scroll
337
+ */
338
+ export const LongMenuWithScroll = () => (
339
+ <div style={{ padding: '50px' }}>
340
+ <h2>Long Menu (Scrollable)</h2>
341
+ <p>When menu has many items, it becomes scrollable (max-height: 50vh)</p>
342
+
343
+ <MenuIcon icon="list">
344
+ <MenuItem icon="filter_1" label="Item 1" onSelect={() => alert('Item 1')} />
345
+ <MenuItem icon="filter_2" label="Item 2" onSelect={() => alert('Item 2')} />
346
+ <MenuItem icon="filter_3" label="Item 3" onSelect={() => alert('Item 3')} />
347
+ <MenuItem icon="filter_4" label="Item 4" onSelect={() => alert('Item 4')} />
348
+ <MenuItem icon="filter_5" label="Item 5" onSelect={() => alert('Item 5')} />
349
+ <MenuItem icon="filter_6" label="Item 6" onSelect={() => alert('Item 6')} />
350
+ <MenuItem icon="filter_7" label="Item 7" onSelect={() => alert('Item 7')} />
351
+ <MenuItem icon="filter_8" label="Item 8" onSelect={() => alert('Item 8')} />
352
+ <MenuItem icon="filter_9" label="Item 9" onSelect={() => alert('Item 9')} />
353
+ <MenuSeparator />
354
+ <MenuItem icon="add" label="Add New Item" onSelect={() => alert('Add New')} />
355
+ <MenuItem icon="edit" label="Edit Items" onSelect={() => alert('Edit')} />
356
+ <MenuItem icon="delete" label="Delete All" onSelect={() => alert('Delete All')} />
357
+ <MenuSeparator />
358
+ <MenuItem icon="settings" label="Settings" onSelect={() => alert('Settings')} />
359
+ <MenuItem icon="help" label="Help" onSelect={() => alert('Help')} />
360
+ <MenuItem icon="info" label="About" onSelect={() => alert('About')} />
361
+ </MenuIcon>
362
+ </div>
363
+ )
364
+
365
+ /**
366
+ * Compact Menu Size
367
+ */
368
+ export const CompactMenuSize = () => (
369
+ <div style={{ padding: '50px', display: 'flex', gap: '60px', alignItems: 'flex-start' }}>
370
+ <div>
371
+ <h3>Normal Menu (default)</h3>
372
+ <MenuIcon icon="window" menuSize="normal">
373
+ <MenuItem icon="view_stream" label="Cascade" onSelect={() => alert('Cascade')} />
374
+ <MenuItem icon="view_module" label="Tile" onSelect={() => alert('Tile')} />
375
+ <MenuSeparator />
376
+ <MenuItem icon="view_week" label="Columns" onSelect={() => alert('Columns')} />
377
+ <MenuItem icon="view_agenda" label="Rows" onSelect={() => alert('Rows')} />
378
+ <MenuSeparator />
379
+ <MenuItem icon="center_focus_strong" label="Center All" onSelect={() => alert('Center All')} />
380
+ <MenuItem icon="clear_all" label="Clear All" onSelect={() => alert('Clear All')} />
381
+ </MenuIcon>
382
+ </div>
383
+
384
+ <div>
385
+ <h3>Compact Menu</h3>
386
+ <MenuIcon icon="window" menuSize="compact">
387
+ <MenuItem icon="view_stream" label="Cascade" onSelect={() => alert('Cascade')} />
388
+ <MenuItem icon="view_module" label="Tile" onSelect={() => alert('Tile')} />
389
+ <MenuSeparator />
390
+ <MenuItem icon="view_week" label="Columns" onSelect={() => alert('Columns')} />
391
+ <MenuItem icon="view_agenda" label="Rows" onSelect={() => alert('Rows')} />
392
+ <MenuSeparator />
393
+ <MenuItem icon="center_focus_strong" label="Center All" onSelect={() => alert('Center All')} />
394
+ <MenuItem icon="clear_all" label="Clear All" onSelect={() => alert('Clear All')} />
395
+ </MenuIcon>
396
+ </div>
397
+
398
+ <div>
399
+ <h3>Compact with Small Icon</h3>
400
+ <MenuIcon icon="window" size="small" menuSize="compact">
401
+ <MenuItem icon="view_stream" label="Cascade" onSelect={() => alert('Cascade')} />
402
+ <MenuItem icon="view_module" label="Tile" onSelect={() => alert('Tile')} />
403
+ <MenuSeparator />
404
+ <MenuItem icon="view_week" label="Columns" onSelect={() => alert('Columns')} />
405
+ <MenuItem icon="view_agenda" label="Rows" onSelect={() => alert('Rows')} />
406
+ <MenuSeparator />
407
+ <MenuItem icon="center_focus_strong" label="Center All" onSelect={() => alert('Center All')} />
408
+ <MenuItem icon="clear_all" label="Clear All" onSelect={() => alert('Clear All')} />
409
+ </MenuIcon>
410
+ </div>
411
+ </div>
412
+ )
413
+
414
+ /**
415
+ * Taskbar Simulation
416
+ */
417
+ export const TaskbarSimulation = () => (
418
+ <div style={{ padding: '50px' }}>
419
+ <h2>Taskbar Menu Example</h2>
420
+ <p>Compact menu as used in Desktop Taskbar</p>
421
+
422
+ <div style={{
423
+ background: 'linear-gradient(180deg, #2c3e50 0%, #34495e 100%)',
424
+ padding: '8px 16px',
425
+ display: 'flex',
426
+ alignItems: 'center',
427
+ gap: '12px',
428
+ borderRadius: '4px',
429
+ boxShadow: '0 2px 8px rgba(0,0,0,0.2)'
430
+ }}>
431
+ <button style={{
432
+ background: 'rgba(255,255,255,0.1)',
433
+ border: 'none',
434
+ color: 'white',
435
+ padding: '6px 12px',
436
+ borderRadius: '3px',
437
+ cursor: 'pointer'
438
+ }}>
439
+ Start
440
+ </button>
441
+
442
+ <div style={{ flex: 1 }}></div>
443
+
444
+ <MenuIcon
445
+ icon="window"
446
+ size="small"
447
+ position="top-right"
448
+ menuSize="compact"
449
+ >
450
+ <MenuItem icon="view_stream" label="Cascade" onSelect={() => alert('Cascade')} />
451
+ <MenuItem icon="view_module" label="Tile" onSelect={() => alert('Tile')} />
452
+ <MenuSeparator />
453
+ <MenuItem icon="view_week" label="Columns" onSelect={() => alert('Columns')} />
454
+ <MenuItem icon="view_agenda" label="Rows" onSelect={() => alert('Rows')} />
455
+ <MenuSeparator />
456
+ <MenuItem icon="center_focus_strong" label="Center All" onSelect={() => alert('Center All')} />
457
+ <MenuItem icon="clear_all" label="Clear All" onSelect={() => alert('Clear All')} />
458
+ </MenuIcon>
459
+
460
+ <span style={{ color: 'white', fontSize: '12px', marginLeft: '8px' }}>
461
+ 1200×600
462
+ </span>
463
+ </div>
464
+ </div>
465
+ )
466
+
467
+ /**
468
+ * Backwards Compatibility (align prop)
469
+ */
470
+ export const BackwardsCompatibility = () => (
471
+ <div style={{ padding: '50px', display: 'flex', gap: '40px' }}>
472
+ <div>
473
+ <p><strong>align="left" (deprecated)</strong></p>
474
+ <MenuIcon icon="more_vert" align="left">
475
+ <MenuItem icon="edit" label="Edit" />
476
+ <MenuItem icon="delete" label="Delete" />
477
+ </MenuIcon>
478
+ </div>
479
+
480
+ <div>
481
+ <p><strong>align="right" (deprecated)</strong></p>
482
+ <MenuIcon icon="more_vert" align="right">
483
+ <MenuItem icon="edit" label="Edit" />
484
+ <MenuItem icon="delete" label="Delete" />
485
+ </MenuIcon>
486
+ </div>
487
+
488
+ <div>
489
+ <p><strong>position="bottom-left" (new)</strong></p>
490
+ <MenuIcon icon="more_vert" position="bottom-left">
491
+ <MenuItem icon="edit" label="Edit" />
492
+ <MenuItem icon="delete" label="Delete" />
493
+ </MenuIcon>
494
+ </div>
495
+
496
+ <div>
497
+ <p><strong>position="bottom-right" (new)</strong></p>
498
+ <MenuIcon icon="more_vert" position="bottom-right">
499
+ <MenuItem icon="edit" label="Edit" />
500
+ <MenuItem icon="delete" label="Delete" />
501
+ </MenuIcon>
502
+ </div>
503
+ </div>
504
+ )
package/src/html/menu.css CHANGED
@@ -1,5 +1,6 @@
1
1
  .menu-icon {
2
2
  position: relative;
3
+ display: inline-block;
3
4
  }
4
5
 
5
6
  /* Solución simple: z-index muy alto para que aparezca por encima de todo */
@@ -17,8 +18,6 @@
17
18
  .menu-icon > menu {
18
19
  z-index: 9999;
19
20
  position: absolute;
20
- top: 3rem;
21
- left: 0px;
22
21
  margin: 0;
23
22
  border: solid 1px var(--divider-color);
24
23
  background-color: var(--paper-color);
@@ -28,16 +27,68 @@
28
27
  max-height: 50vh;
29
28
  overflow: auto;
30
29
  box-shadow: var(--shadow1);
30
+ border-radius: 4px;
31
+ }
32
+
33
+ /* Position: Bottom Left (default) */
34
+ .menu-icon > menu.position-bottom-left {
35
+ top: calc(100% + 0.25rem);
36
+ left: 0;
37
+ }
38
+
39
+ /* Position: Bottom Right */
40
+ .menu-icon > menu.position-bottom-right {
41
+ top: calc(100% + 0.25rem);
42
+ right: 0;
43
+ }
44
+
45
+ /* Position: Top Left */
46
+ .menu-icon > menu.position-top-left {
47
+ bottom: calc(100% + 0.25rem);
48
+ left: 0;
49
+ }
50
+
51
+ /* Position: Top Right */
52
+ .menu-icon > menu.position-top-right {
53
+ bottom: calc(100% + 0.25rem);
54
+ right: 0;
55
+ }
56
+
57
+ /* Position: Left */
58
+ .menu-icon > menu.position-left {
59
+ right: calc(100% + 0.25rem);
60
+ top: 0;
61
+ }
62
+
63
+ /* Position: Right */
64
+ .menu-icon > menu.position-right {
65
+ left: calc(100% + 0.25rem);
66
+ top: 0;
67
+ }
68
+
69
+ /* Position: Top (centered) */
70
+ .menu-icon > menu.position-top {
71
+ bottom: calc(100% + 0.25rem);
72
+ left: 50%;
73
+ transform: translateX(-50%);
31
74
  }
32
75
 
76
+ /* Position: Bottom (centered) */
77
+ .menu-icon > menu.position-bottom {
78
+ top: calc(100% + 0.25rem);
79
+ left: 50%;
80
+ transform: translateX(-50%);
81
+ }
82
+
83
+ /* Backwards compatibility */
33
84
  .menu-icon > menu.alignRight {
34
- left: unset;
35
- right: 0px;
85
+ top: calc(100% + 0.25rem);
86
+ right: 0;
36
87
  }
37
88
 
38
89
  .menu-icon > menu.alignLeft {
39
- left: 0px;
40
- right: unset;
90
+ top: calc(100% + 0.25rem);
91
+ left: 0;
41
92
  }
42
93
 
43
94
  .menu-icon > menu ul {
@@ -94,3 +145,31 @@
94
145
  height: 1px;
95
146
  border-top: solid 1px var(--divider-color);
96
147
  }
148
+
149
+ /* ============================================
150
+ COMPACT MENU VARIANT
151
+ ============================================ */
152
+
153
+ .menu-icon > menu.menu-compact {
154
+ min-width: 6rem;
155
+ max-width: 12rem;
156
+ font-size: 0.85rem;
157
+ }
158
+
159
+ .menu-icon > menu.menu-compact li {
160
+ min-height: 2rem;
161
+ padding: 0 0.4rem;
162
+ }
163
+
164
+ .menu-icon > menu.menu-compact .menu-item > label {
165
+ font-size: 0.75rem;
166
+ padding: 0 0.4rem 0 0;
167
+ }
168
+
169
+ .menu-icon > menu.menu-compact .menu-item > .meta {
170
+ font-size: 0.7rem;
171
+ }
172
+
173
+ .menu-icon > menu.menu-compact .menu-separator {
174
+ margin: 0.2rem 0;
175
+ }