@dile/ui 3.0.2 → 3.0.3
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.
|
@@ -48,6 +48,15 @@ export class DileSlideMenu extends DileSlideDown(LitElement) {
|
|
|
48
48
|
text-decoration: var(--dile-slide-menu-text-decoration, none);
|
|
49
49
|
--dile-icon-color: var(--dile-primary-color, #303030);
|
|
50
50
|
margin: var(--dile-slide-menu-control-margin, 0 0 0.25rem 0);
|
|
51
|
+
border-radius: 4px;
|
|
52
|
+
padding: 4px;
|
|
53
|
+
outline: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
nav:focus-visible {
|
|
57
|
+
outline: 2px solid var(--dile-primary-color, #303030);
|
|
58
|
+
outline-offset: 2px;
|
|
59
|
+
background-color: rgba(var(--dile-primary-color, 48, 48, 48), 0.05);
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
nav dile-icon {
|
|
@@ -63,6 +72,16 @@ export class DileSlideMenu extends DileSlideDown(LitElement) {
|
|
|
63
72
|
nav.opened dile-icon {
|
|
64
73
|
transform: var(--dile-slide-menu-opened-transform, rotate(0deg));
|
|
65
74
|
}
|
|
75
|
+
|
|
76
|
+
@media (prefers-reduced-motion: reduce) {
|
|
77
|
+
#content {
|
|
78
|
+
transition: none;
|
|
79
|
+
-webkit-transition: none;
|
|
80
|
+
}
|
|
81
|
+
dile-icon {
|
|
82
|
+
transition: none;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
66
85
|
`;
|
|
67
86
|
}
|
|
68
87
|
|
|
@@ -82,19 +101,35 @@ export class DileSlideMenu extends DileSlideDown(LitElement) {
|
|
|
82
101
|
|
|
83
102
|
render() {
|
|
84
103
|
return html`
|
|
85
|
-
<nav
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
<nav
|
|
105
|
+
@click="${this.toggle}"
|
|
106
|
+
@keydown="${this.handleKeydown}"
|
|
107
|
+
tabindex="0"
|
|
108
|
+
role="button"
|
|
109
|
+
aria-expanded="${this.opened}"
|
|
110
|
+
aria-controls="slide-menu-content"
|
|
111
|
+
aria-label="${this.label}"
|
|
112
|
+
class="${this.opened ? 'opened' : ''}"
|
|
113
|
+
>
|
|
114
|
+
<dile-icon .icon=${this.icon} aria-hidden="true"></dile-icon>
|
|
115
|
+
<span aria-hidden="true">
|
|
88
116
|
${this.label}
|
|
89
117
|
</span>
|
|
90
118
|
</nav>
|
|
91
|
-
<div id="content">
|
|
119
|
+
<div id="content" id="slide-menu-content" aria-hidden="${!this.opened}" ?inert="${!this.opened}">
|
|
92
120
|
<div class="container">
|
|
93
121
|
<slot></slot>
|
|
94
122
|
</div>
|
|
95
123
|
</div>
|
|
96
124
|
`;
|
|
97
125
|
}
|
|
126
|
+
|
|
127
|
+
handleKeydown(event) {
|
|
128
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
this.toggle();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
98
133
|
|
|
99
134
|
toggle() {
|
|
100
135
|
if (this.opened) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dile/ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "UI Core components from dile-components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "51f6ecc43a2b1db5e2b40cffe48e625e18516e38"
|
|
31
31
|
}
|