noph-ui 0.25.2 → 0.25.4
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.
|
@@ -38,6 +38,12 @@
|
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
40
|
<div {style} class={['np-container', attributes.class]} bind:this={element}>
|
|
41
|
+
<div class="np-outline"></div>
|
|
42
|
+
<div class="np-background"></div>
|
|
43
|
+
<svg class="np-icon" viewBox="0 0 18 18" aria-hidden="true">
|
|
44
|
+
<rect class="mark short" />
|
|
45
|
+
<rect class="mark long" />
|
|
46
|
+
</svg>
|
|
41
47
|
<div class="np-input-wrapper">
|
|
42
48
|
{#if !attributes.disabled}
|
|
43
49
|
<Ripple forElement={inputEl} />
|
|
@@ -53,12 +59,6 @@
|
|
|
53
59
|
aria-checked={indeterminate ? 'mixed' : undefined}
|
|
54
60
|
/>
|
|
55
61
|
</div>
|
|
56
|
-
<div class="np-outline"></div>
|
|
57
|
-
<div class="np-background"></div>
|
|
58
|
-
<svg class="np-icon" viewBox="0 0 18 18" aria-hidden="true">
|
|
59
|
-
<rect class="mark short" />
|
|
60
|
-
<rect class="mark long" />
|
|
61
|
-
</svg>
|
|
62
62
|
</div>
|
|
63
63
|
|
|
64
64
|
<style>
|
|
@@ -95,7 +95,6 @@
|
|
|
95
95
|
height: 40px;
|
|
96
96
|
position: absolute;
|
|
97
97
|
width: 40px;
|
|
98
|
-
z-index: 1;
|
|
99
98
|
border-radius: var(--np-shape-corner-full);
|
|
100
99
|
cursor: inherit;
|
|
101
100
|
}
|
package/dist/menu/Menu.svelte
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
style,
|
|
12
12
|
popover = 'auto',
|
|
13
13
|
anchor,
|
|
14
|
+
ontoggle,
|
|
14
15
|
...attributes
|
|
15
16
|
}: MenuProps = $props()
|
|
16
17
|
|
|
@@ -97,7 +98,7 @@
|
|
|
97
98
|
})
|
|
98
99
|
</script>
|
|
99
100
|
|
|
100
|
-
<svelte:window bind:innerHeight onresize={refreshValues} />
|
|
101
|
+
<!-- <svelte:window bind:innerHeight onresize={refreshValues} /> -->
|
|
101
102
|
<div
|
|
102
103
|
role="menu"
|
|
103
104
|
{...attributes}
|
|
@@ -108,7 +109,7 @@
|
|
|
108
109
|
ontoggle={(event) => {
|
|
109
110
|
let { newState } = event
|
|
110
111
|
open = newState === 'open'
|
|
111
|
-
|
|
112
|
+
ontoggle?.(event)
|
|
112
113
|
}}
|
|
113
114
|
{popover}
|
|
114
115
|
class={['np-menu-container', attributes.class]}
|
|
@@ -139,22 +140,21 @@
|
|
|
139
140
|
padding: 0;
|
|
140
141
|
box-shadow: var(--np-elevation-2);
|
|
141
142
|
margin: var(--np-menu-margin, 2px);
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.np-menu-container[popover]:popover-open {
|
|
146
|
+
opacity: 1;
|
|
147
|
+
animation: fadeIn 0.2s linear;
|
|
147
148
|
justify-self: var(--np-menu-justify-self, anchor-center);
|
|
148
149
|
position-area: var(--np-menu-position-area, bottom center);
|
|
149
150
|
position-try: normal flip-block;
|
|
150
|
-
z-index: 1000;
|
|
151
151
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
opacity: 1;
|
|
155
|
-
display: flex;
|
|
156
|
-
@starting-style {
|
|
152
|
+
@keyframes fadeIn {
|
|
153
|
+
0% {
|
|
157
154
|
opacity: 0;
|
|
158
155
|
}
|
|
156
|
+
100% {
|
|
157
|
+
opacity: 1;
|
|
158
|
+
}
|
|
159
159
|
}
|
|
160
160
|
</style>
|
|
@@ -48,9 +48,6 @@
|
|
|
48
48
|
padding: 0;
|
|
49
49
|
background-color: transparent;
|
|
50
50
|
}
|
|
51
|
-
.np-navigation-drawer-container-modal {
|
|
52
|
-
z-index: 1000;
|
|
53
|
-
}
|
|
54
51
|
.np-navigation-wrapper {
|
|
55
52
|
background-color: var(--np-navigation-drawer-background, var(--np-color-surface-container-low));
|
|
56
53
|
border-top-right-radius: var(--np-shape-corner-large);
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
anchor.style.setProperty('anchor-name', generatedId)
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
anchor.addEventListener('
|
|
53
|
-
anchor.addEventListener('
|
|
52
|
+
anchor.addEventListener('mouseenter', showPopover)
|
|
53
|
+
anchor.addEventListener('mouseleave', onLeave)
|
|
54
54
|
anchor.addEventListener('focus', onAnchorFocus)
|
|
55
55
|
anchor.addEventListener('blur', hidePopover)
|
|
56
56
|
}
|
|
@@ -70,11 +70,19 @@
|
|
|
70
70
|
element?.hidePopover()
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
const onLeave = () => {
|
|
74
|
+
hidePopover()
|
|
75
|
+
// TODO Use delay as soons as popover="hint" is supported in all browsers
|
|
76
|
+
// setTimeout(() => {
|
|
77
|
+
// hidePopover()
|
|
78
|
+
// }, 500)
|
|
79
|
+
}
|
|
80
|
+
|
|
73
81
|
onMount(() => {
|
|
74
82
|
return () => {
|
|
75
83
|
if (anchor) {
|
|
76
|
-
anchor.removeEventListener('
|
|
77
|
-
anchor.removeEventListener('
|
|
84
|
+
anchor.removeEventListener('mouseenter', showPopover)
|
|
85
|
+
anchor.removeEventListener('mouseleave', onLeave)
|
|
78
86
|
anchor.removeEventListener('focus', onAnchorFocus)
|
|
79
87
|
anchor.removeEventListener('blur', hidePopover)
|
|
80
88
|
}
|
|
@@ -91,7 +99,7 @@
|
|
|
91
99
|
{@attach attachAnchor}
|
|
92
100
|
class={['np-tooltip', attributes.class]}
|
|
93
101
|
role="tooltip"
|
|
94
|
-
popover="
|
|
102
|
+
popover="hint"
|
|
95
103
|
bind:this={element}
|
|
96
104
|
bind:clientWidth
|
|
97
105
|
bind:clientHeight
|
|
@@ -108,7 +116,6 @@
|
|
|
108
116
|
.np-tooltip[popover] {
|
|
109
117
|
width: max-content;
|
|
110
118
|
margin: 4px 0;
|
|
111
|
-
inset: auto;
|
|
112
119
|
background: var(--np-color-inverse-surface);
|
|
113
120
|
color: var(--np-color-inverse-on-surface);
|
|
114
121
|
padding: 0.25rem 0.5rem;
|
|
@@ -116,18 +123,13 @@
|
|
|
116
123
|
border-radius: 0.25rem;
|
|
117
124
|
line-height: 1rem;
|
|
118
125
|
font-size: 0.75rem;
|
|
119
|
-
opacity: 0;
|
|
120
|
-
z-index: 1000;
|
|
121
|
-
transition:
|
|
122
|
-
display 0.3s allow-discrete,
|
|
123
|
-
opacity 0.3s ease;
|
|
124
|
-
justify-self: var(--np-tooltip-justify-self, anchor-center);
|
|
125
|
-
position-area: var(--np-tooltip-position-area, top);
|
|
126
|
-
position-try: normal flip-block;
|
|
127
126
|
}
|
|
128
127
|
.np-tooltip:popover-open {
|
|
129
128
|
opacity: 1;
|
|
130
129
|
animation: scaleIn 0.3s ease;
|
|
130
|
+
justify-self: var(--np-tooltip-justify-self, anchor-center);
|
|
131
|
+
position-area: var(--np-tooltip-position-area, top);
|
|
132
|
+
position-try: normal flip-block;
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
@keyframes scaleIn {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "noph-ui",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://noph.dev",
|
|
6
6
|
"repository": {
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@material/material-color-utilities": "^0.3.0",
|
|
59
59
|
"@playwright/test": "^1.55.0",
|
|
60
60
|
"@sveltejs/adapter-vercel": "^5.10.2",
|
|
61
|
-
"@sveltejs/kit": "^2.39.
|
|
62
|
-
"@sveltejs/package": "^2.5.
|
|
61
|
+
"@sveltejs/kit": "^2.39.1",
|
|
62
|
+
"@sveltejs/package": "^2.5.1",
|
|
63
63
|
"@sveltejs/vite-plugin-svelte": "^6.2.0",
|
|
64
64
|
"@types/eslint": "^9.6.1",
|
|
65
65
|
"eslint": "^9.35.0",
|