noph-ui 0.8.8 → 0.8.10
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/dist/dialogs/Dialog.svelte +2 -0
- package/dist/menu/Menu.svelte +18 -1
- package/package.json +1 -1
|
@@ -67,6 +67,8 @@
|
|
|
67
67
|
border-radius: var(--np-shape-corner-extra-large);
|
|
68
68
|
box-shadow: var(--np-elevation-3);
|
|
69
69
|
max-height: 100dvh;
|
|
70
|
+
scrollbar-color: var(--np-color-on-surface-variant) transparent;
|
|
71
|
+
scrollbar-width: thin;
|
|
70
72
|
transition:
|
|
71
73
|
display 0.2s allow-discrete,
|
|
72
74
|
overlay 0.2s allow-discrete,
|
package/dist/menu/Menu.svelte
CHANGED
|
@@ -86,6 +86,20 @@
|
|
|
86
86
|
popover="auto"
|
|
87
87
|
class={[position, 'np-menu', attributes.class]}
|
|
88
88
|
role="menu"
|
|
89
|
+
ontoggle={(event) => {
|
|
90
|
+
if (event.newState === 'open') {
|
|
91
|
+
const rect = event.currentTarget.getBoundingClientRect()
|
|
92
|
+
const viewportHeight = window.innerHeight
|
|
93
|
+
|
|
94
|
+
if (rect.bottom > viewportHeight) {
|
|
95
|
+
const maxHeight = viewportHeight - rect.top - 18
|
|
96
|
+
event.currentTarget.style.maxHeight = `${maxHeight}px`
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (event.newState === 'closed') {
|
|
100
|
+
event.currentTarget.style.maxHeight = '80dvh'
|
|
101
|
+
}
|
|
102
|
+
}}
|
|
89
103
|
>
|
|
90
104
|
{@render children()}
|
|
91
105
|
</div>
|
|
@@ -94,7 +108,7 @@
|
|
|
94
108
|
.np-menu[popover] {
|
|
95
109
|
color: var(--np-menu-text-color, var(--np-color-on-surface));
|
|
96
110
|
background-color: var(--np-menu-container-color, var(--np-color-surface-container));
|
|
97
|
-
overflow: auto;
|
|
111
|
+
overflow-y: auto;
|
|
98
112
|
border: none;
|
|
99
113
|
border-radius: var(--np-menu-container-shape, var(--np-shape-corner-extra-small));
|
|
100
114
|
padding: 0.5rem 0;
|
|
@@ -102,6 +116,9 @@
|
|
|
102
116
|
margin: 0;
|
|
103
117
|
margin-bottom: 2px;
|
|
104
118
|
margin-top: 2px;
|
|
119
|
+
max-height: 80dvh;
|
|
120
|
+
scrollbar-color: var(--np-color-on-surface-variant) transparent;
|
|
121
|
+
scrollbar-width: thin;
|
|
105
122
|
transition:
|
|
106
123
|
display 0.2s allow-discrete,
|
|
107
124
|
opacity 0.2s linear;
|