@brightspace-ui/labs 2.7.0 → 2.9.0
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/package.json +21 -1
- package/src/components/card-overlay/README.md +12 -0
- package/src/components/card-overlay/card-overlay.js +79 -0
- package/src/components/navigation/README.md +192 -0
- package/src/components/navigation/navigation-band.js +134 -0
- package/src/components/navigation/navigation-button-icon.js +120 -0
- package/src/components/navigation/navigation-dropdown-button-custom.js +35 -0
- package/src/components/navigation/navigation-dropdown-button-icon.js +86 -0
- package/src/components/navigation/navigation-immersive.js +265 -0
- package/src/components/navigation/navigation-iterator.js +97 -0
- package/src/components/navigation/navigation-link-back.js +39 -0
- package/src/components/navigation/navigation-link-icon.js +127 -0
- package/src/components/navigation/navigation-link-image.js +73 -0
- package/src/components/navigation/navigation-link.js +62 -0
- package/src/components/navigation/navigation-main-footer.js +27 -0
- package/src/components/navigation/navigation-main-header.js +67 -0
- package/src/components/navigation/navigation-notification-icon.js +54 -0
- package/src/components/navigation/navigation-separator.js +30 -0
- package/src/components/navigation/navigation-shared-styles.js +32 -0
- package/src/components/navigation/navigation-skip-main.js +31 -0
- package/src/components/navigation/navigation-skip.js +59 -0
- package/src/components/navigation/navigation-styles.js +107 -0
- package/src/components/navigation/navigation.js +60 -0
- package/src/lang/ar.js +4 -0
- package/src/lang/cy.js +4 -0
- package/src/lang/da.js +4 -0
- package/src/lang/de.js +4 -0
- package/src/lang/en-gb.js +4 -0
- package/src/lang/en.js +4 -0
- package/src/lang/es-es.js +4 -0
- package/src/lang/es.js +4 -0
- package/src/lang/fr-fr.js +4 -0
- package/src/lang/fr-on.js +4 -0
- package/src/lang/fr.js +4 -0
- package/src/lang/haw.js +4 -0
- package/src/lang/hi.js +4 -0
- package/src/lang/ja.js +4 -0
- package/src/lang/ko.js +4 -0
- package/src/lang/nl.js +4 -0
- package/src/lang/pt.js +4 -0
- package/src/lang/sv.js +4 -0
- package/src/lang/tr.js +4 -0
- package/src/lang/zh-cn.js +4 -0
- package/src/lang/zh-tw.js +4 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import '@brightspace-ui/core/components/colors/colors.js';
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { FocusMixin } from '@brightspace-ui/core/mixins/focus-mixin.js';
|
|
4
|
+
import { highlightBorderStyles } from './navigation-styles.js';
|
|
5
|
+
|
|
6
|
+
class D2LNavigationLink extends FocusMixin(LitElement) {
|
|
7
|
+
|
|
8
|
+
static get properties() {
|
|
9
|
+
return {
|
|
10
|
+
href: {
|
|
11
|
+
reflect: true,
|
|
12
|
+
type: String
|
|
13
|
+
},
|
|
14
|
+
text: {
|
|
15
|
+
type: String
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static get styles() {
|
|
21
|
+
return [highlightBorderStyles, css`
|
|
22
|
+
:host {
|
|
23
|
+
display: inline-block;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
a {
|
|
27
|
+
align-items: center;
|
|
28
|
+
color: var(--d2l-color-ferrite);
|
|
29
|
+
display: inline-flex;
|
|
30
|
+
height: 100%;
|
|
31
|
+
min-height: 40px;
|
|
32
|
+
position: relative;
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
vertical-align: middle;
|
|
35
|
+
}
|
|
36
|
+
a:hover,
|
|
37
|
+
a:focus {
|
|
38
|
+
--d2l-icon-fill-color: var(--d2l-color-celestine);
|
|
39
|
+
color: var(--d2l-color-celestine);
|
|
40
|
+
outline: none;
|
|
41
|
+
}
|
|
42
|
+
:host(:not([href])) .d2l-labs-navigation-highlight-border {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
`];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static get focusElementSelector() {
|
|
49
|
+
return 'a';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
render() {
|
|
53
|
+
return html`
|
|
54
|
+
<a href="${this.href}" title="${this.text}">
|
|
55
|
+
<span class="d2l-labs-navigation-highlight-border"></span>
|
|
56
|
+
<slot></slot>
|
|
57
|
+
</a>
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
customElements.define('d2l-labs-navigation-link', D2LNavigationLink);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit';
|
|
2
|
+
import { navigationSharedStyle } from './navigation-shared-styles.js';
|
|
3
|
+
|
|
4
|
+
class NavigationMainFooter extends LitElement {
|
|
5
|
+
|
|
6
|
+
static get styles() {
|
|
7
|
+
return [navigationSharedStyle, css`
|
|
8
|
+
:host {
|
|
9
|
+
border-bottom: 1px solid rgba(124, 134, 149, 0.18);
|
|
10
|
+
border-top: 1px solid rgba(124, 134, 149, 0.18);
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
`];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
render() {
|
|
17
|
+
return html`
|
|
18
|
+
<div class="d2l-labs-navigation-centerer">
|
|
19
|
+
<div class="d2l-labs-navigation-gutters">
|
|
20
|
+
<slot name="main"></slot>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
customElements.define('d2l-labs-navigation-main-footer', NavigationMainFooter);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit';
|
|
2
|
+
import { navigationSharedStyle } from './navigation-shared-styles.js';
|
|
3
|
+
|
|
4
|
+
class NavigationMainHeader extends LitElement {
|
|
5
|
+
|
|
6
|
+
static get styles() {
|
|
7
|
+
return [navigationSharedStyle, css`
|
|
8
|
+
:host {
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.d2l-labs-navigation-header-container {
|
|
13
|
+
align-items: center;
|
|
14
|
+
display: flex;
|
|
15
|
+
height: 90px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@media (max-width: 767px) {
|
|
19
|
+
.d2l-labs-navigation-header-container {
|
|
20
|
+
height: 72px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
div ::slotted(.d2l-labs-navigation-header-left),
|
|
25
|
+
div ::slotted(.d2l-labs-navigation-header-right) {
|
|
26
|
+
align-items: center;
|
|
27
|
+
display: flex;
|
|
28
|
+
height: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
div ::slotted(.d2l-labs-navigation-header-left) {
|
|
32
|
+
flex: 0 1 auto;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
div ::slotted(.d2l-labs-navigation-header-right) {
|
|
36
|
+
flex: 0 0 auto;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.d2l-labs-navigation-gutter {
|
|
40
|
+
display: inline-block;
|
|
41
|
+
flex: 1 1 auto;
|
|
42
|
+
min-width: var(--d2l-labs-navigation-margin-regular);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (max-width: 615px) {
|
|
46
|
+
.d2l-labs-navigation-gutter {
|
|
47
|
+
min-width: var(--d2l-labs-navigation-margin-regular) / 2;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
render() {
|
|
54
|
+
return html`
|
|
55
|
+
<div class="d2l-labs-navigation-centerer">
|
|
56
|
+
<div class="d2l-labs-navigation-gutters">
|
|
57
|
+
<div class="d2l-labs-navigation-header-container">
|
|
58
|
+
<slot name="left"></slot>
|
|
59
|
+
<div class="d2l-labs-navigation-gutter"></div>
|
|
60
|
+
<slot name="right"></slot>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
customElements.define('d2l-labs-navigation-main-header', NavigationMainHeader);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import '@brightspace-ui/core/components/colors/colors.js';
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { RtlMixin } from '@brightspace-ui/core/mixins/rtl-mixin.js';
|
|
4
|
+
|
|
5
|
+
class NavigationNotificationIcon extends RtlMixin(LitElement) {
|
|
6
|
+
|
|
7
|
+
static get properties() {
|
|
8
|
+
return {
|
|
9
|
+
thinBorder: { attribute: 'thin-border', reflect: true, type: Boolean }
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
static get styles() {
|
|
14
|
+
return css`
|
|
15
|
+
:host {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
height: 100%;
|
|
18
|
+
position: absolute;
|
|
19
|
+
right: calc(-100% + 11px);
|
|
20
|
+
top: calc(-50% + 11px);
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
:host([hidden]) {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
:host([dir="rtl"]) {
|
|
27
|
+
left: calc(-50% - 4px);
|
|
28
|
+
right: auto;
|
|
29
|
+
}
|
|
30
|
+
.d2l-labs-navigation-notification-icon-indicator {
|
|
31
|
+
background: var(--d2l-color-primary-accent-indicator);
|
|
32
|
+
border: 2px solid white;
|
|
33
|
+
border-radius: 50%;
|
|
34
|
+
height: 10px;
|
|
35
|
+
width: 10px;
|
|
36
|
+
}
|
|
37
|
+
:host([thin-border]) .d2l-labs-navigation-notification-icon-indicator {
|
|
38
|
+
border-width: 1px;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
constructor() {
|
|
44
|
+
super();
|
|
45
|
+
this.thinBorder = false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
render() {
|
|
49
|
+
return html`<div class="d2l-labs-navigation-notification-icon-indicator"></div>`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
window.customElements.define('d2l-labs-navigation-notification-icon', NavigationNotificationIcon);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import '@brightspace-ui/core/components/colors/colors.js';
|
|
2
|
+
import '@brightspace-ui/core/components/icons/icon.js';
|
|
3
|
+
import { css, html, LitElement } from 'lit';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Separator component to be used between buttons in a navigational element.
|
|
7
|
+
*/
|
|
8
|
+
class NavigationSeparator extends LitElement {
|
|
9
|
+
|
|
10
|
+
static get styles() {
|
|
11
|
+
return css`
|
|
12
|
+
:host {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
margin: 0 9px;
|
|
15
|
+
}
|
|
16
|
+
d2l-icon {
|
|
17
|
+
color: var(--d2l-color-mica);
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
render() {
|
|
23
|
+
return html`
|
|
24
|
+
<d2l-icon icon="tier2:divider-big"></d2l-icon>
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
customElements.define('d2l-labs-navigation-separator', NavigationSeparator);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
export const navigationSharedStyle = css`
|
|
4
|
+
:host {
|
|
5
|
+
--d2l-labs-navigation-margin-regular: 30px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.d2l-labs-navigation-centerer {
|
|
9
|
+
margin: 0 auto;
|
|
10
|
+
max-width: 1230px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.d2l-labs-navigation-gutters {
|
|
14
|
+
padding-left: 2.439%;
|
|
15
|
+
padding-right: 2.439%;
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (max-width: 615px) {
|
|
20
|
+
.d2l-labs-navigation-gutters {
|
|
21
|
+
padding-left: 15px;
|
|
22
|
+
padding-right: 15px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (min-width: 1230px) {
|
|
27
|
+
.d2l-labs-navigation-gutters {
|
|
28
|
+
padding-left: 30px;
|
|
29
|
+
padding-right: 30px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import './navigation-skip.js';
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { FocusMixin } from '@brightspace-ui/core/mixins/focus/focus-mixin.js';
|
|
4
|
+
import { LocalizeLabsElement } from '../localize-labs-element.js';
|
|
5
|
+
import { querySelectorComposed } from '@brightspace-ui/core/helpers/dom.js';
|
|
6
|
+
|
|
7
|
+
class NavigationSkipMain extends FocusMixin(LocalizeLabsElement(LitElement)) {
|
|
8
|
+
|
|
9
|
+
static get focusElementSelector() {
|
|
10
|
+
return 'd2l-labs-navigation-skip';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
render() {
|
|
14
|
+
return html`<d2l-labs-navigation-skip text="${this.localize('components:navigation:skipNav')}" @click="${this._handleSkipNav}" class="vdiff-target"></d2l-labs-navigation-skip>`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
_handleSkipNav() {
|
|
18
|
+
const elem = querySelectorComposed(document, 'main') ||
|
|
19
|
+
querySelectorComposed(document, '[role="main"]') ||
|
|
20
|
+
querySelectorComposed(document, 'h1');
|
|
21
|
+
if (elem) {
|
|
22
|
+
elem.tabIndex = -1;
|
|
23
|
+
elem.focus();
|
|
24
|
+
} else {
|
|
25
|
+
this.dispatchEvent(new CustomEvent('d2l-labs-navigation-skip-fail', { bubbles: false, composed: false }));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
customElements.define('d2l-labs-navigation-skip-main', NavigationSkipMain);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit';
|
|
2
|
+
import { FocusMixin } from '@brightspace-ui/core/mixins/focus/focus-mixin.js';
|
|
3
|
+
import { PropertyRequiredMixin } from '@brightspace-ui/core/mixins/property-required/property-required-mixin.js';
|
|
4
|
+
|
|
5
|
+
class NavigationSkip extends FocusMixin(PropertyRequiredMixin(LitElement)) {
|
|
6
|
+
|
|
7
|
+
static get properties() {
|
|
8
|
+
return {
|
|
9
|
+
text: { required: true, type: String }
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
static get styles() {
|
|
14
|
+
return css`
|
|
15
|
+
a {
|
|
16
|
+
inset-inline-start: -10000px;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
position: absolute;
|
|
19
|
+
width: 1px;
|
|
20
|
+
}
|
|
21
|
+
a:active,
|
|
22
|
+
a:focus {
|
|
23
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
24
|
+
border: 1px solid rgba(0, 0, 0, 0.8);
|
|
25
|
+
color: #ffffff;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
display: block;
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
inset-block-start: 0;
|
|
30
|
+
inset-inline-start: 25%;
|
|
31
|
+
margin: 0 auto;
|
|
32
|
+
outline: none;
|
|
33
|
+
padding: 0.3em;
|
|
34
|
+
text-align: center;
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
width: 50%;
|
|
37
|
+
z-index: 10000;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static get focusElementSelector() {
|
|
43
|
+
return 'a';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
render() {
|
|
47
|
+
return html`<a tabindex="0" @keydown="${this._handleKeyDown}" class="vdiff-target">${this.text}</a>`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_handleKeyDown(e) {
|
|
51
|
+
if (e.keyCode === 13) {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
this.dispatchEvent(new CustomEvent('click', { bubbles: true, composed: true }));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
customElements.define('d2l-labs-navigation-skip', NavigationSkip);
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import '@brightspace-ui/core/components/colors/colors.js';
|
|
2
|
+
import { css } from 'lit';
|
|
3
|
+
|
|
4
|
+
export const centererStyles = css`
|
|
5
|
+
.d2l-labs-navigation-centerer {
|
|
6
|
+
margin: 0 auto;
|
|
7
|
+
max-width: 1230px;
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const guttersStyles = css`
|
|
12
|
+
.d2l-labs-navigation-gutters {
|
|
13
|
+
padding-left: 2.439%;
|
|
14
|
+
padding-right: 2.439%;
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
@media (max-width: 615px) {
|
|
18
|
+
.d2l-labs-navigation-gutters {
|
|
19
|
+
padding-left: 15px;
|
|
20
|
+
padding-right: 15px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
@media (min-width: 1230px) {
|
|
24
|
+
.d2l-labs-navigation-gutters {
|
|
25
|
+
padding-left: 30px;
|
|
26
|
+
padding-right: 30px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
export const highlightBorderStyles = css`
|
|
32
|
+
.d2l-labs-navigation-highlight-border {
|
|
33
|
+
background: transparent;
|
|
34
|
+
border-bottom-left-radius: 4px;
|
|
35
|
+
border-bottom-right-radius: 4px;
|
|
36
|
+
display: block;
|
|
37
|
+
height: 4px;
|
|
38
|
+
left: -7px;
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 0;
|
|
41
|
+
width: calc(100% + 14px);
|
|
42
|
+
}
|
|
43
|
+
*:focus > .d2l-labs-navigation-highlight-border,
|
|
44
|
+
*:hover > .d2l-labs-navigation-highlight-border,
|
|
45
|
+
*[active] > .d2l-labs-navigation-highlight-border {
|
|
46
|
+
background: var(--d2l-color-celestine);
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
export const highlightButtonStyles = css`
|
|
51
|
+
button {
|
|
52
|
+
align-items: center;
|
|
53
|
+
background: transparent;
|
|
54
|
+
border: none;
|
|
55
|
+
color: var(--d2l-color-ferrite);
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
font-family: inherit;
|
|
59
|
+
font-size: inherit;
|
|
60
|
+
gap: 6px;
|
|
61
|
+
height: 100%;
|
|
62
|
+
margin: 0;
|
|
63
|
+
min-height: 40px;
|
|
64
|
+
outline: none;
|
|
65
|
+
overflow: visible;
|
|
66
|
+
padding: 0;
|
|
67
|
+
position: relative;
|
|
68
|
+
vertical-align: middle;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
}
|
|
71
|
+
/* Firefox includes a hidden border which messes up button dimensions */
|
|
72
|
+
button::-moz-focus-inner {
|
|
73
|
+
border: 0;
|
|
74
|
+
}
|
|
75
|
+
button:not([disabled]):hover,
|
|
76
|
+
button:not([disabled]):focus,
|
|
77
|
+
button[active] {
|
|
78
|
+
--d2l-icon-fill-color: var(--d2l-color-celestine);
|
|
79
|
+
color: var(--d2l-color-celestine);
|
|
80
|
+
outline: none;
|
|
81
|
+
}
|
|
82
|
+
button[disabled] {
|
|
83
|
+
cursor: default;
|
|
84
|
+
opacity: 0.5;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
export const highlightLinkStyles = css`
|
|
89
|
+
a {
|
|
90
|
+
align-items: center;
|
|
91
|
+
color: var(--d2l-color-ferrite);
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
gap: 6px;
|
|
94
|
+
height: 100%;
|
|
95
|
+
min-height: 40px;
|
|
96
|
+
position: relative;
|
|
97
|
+
text-decoration: none;
|
|
98
|
+
vertical-align: middle;
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
}
|
|
101
|
+
a:hover,
|
|
102
|
+
a:focus {
|
|
103
|
+
--d2l-icon-fill-color: var(--d2l-color-celestine);
|
|
104
|
+
color: var(--d2l-color-celestine);
|
|
105
|
+
outline: none;
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import './navigation-band.js';
|
|
2
|
+
import './navigation-skip-main.js';
|
|
3
|
+
import { css, html, LitElement, nothing } from 'lit';
|
|
4
|
+
import { getNextFocusable } from '@brightspace-ui/core/helpers/focus.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Primary navigation wrapper component.
|
|
8
|
+
* @slot - Default content placed inside of the component
|
|
9
|
+
* @slot navigation-band - Content placed inside band
|
|
10
|
+
*/
|
|
11
|
+
class Navigation extends LitElement {
|
|
12
|
+
|
|
13
|
+
static get properties() {
|
|
14
|
+
return {
|
|
15
|
+
hasSkipNav: { attribute: 'has-skip-nav', type: Boolean }
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static get styles() {
|
|
20
|
+
return css`
|
|
21
|
+
:host {
|
|
22
|
+
display: block;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
.d2l-labs-navigation-shadow-drop-border {
|
|
26
|
+
background-color: rgba(0, 0, 0, 0.02);
|
|
27
|
+
bottom: -4px;
|
|
28
|
+
display: var(--d2l-labs-navigation-shadow-drop-border-display, block);
|
|
29
|
+
height: 4px;
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
position: absolute;
|
|
32
|
+
width: 100%;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
constructor() {
|
|
38
|
+
super();
|
|
39
|
+
this.hasSkipNav = false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
render() {
|
|
43
|
+
const skipNav = this.hasSkipNav ? html`<d2l-labs-navigation-skip-main @d2l-labs-navigation-skip-fail="${this._handleSkipNavFail}"></d2l-labs-navigation-skip-main>` : nothing;
|
|
44
|
+
return html`
|
|
45
|
+
${skipNav}<d2l-labs-navigation-band><slot name="navigation-band"></slot></d2l-labs-navigation-band>
|
|
46
|
+
<slot></slot>
|
|
47
|
+
<div class="d2l-labs-navigation-shadow-drop-border"></div>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_handleSkipNavFail() {
|
|
52
|
+
const nextFocusable = getNextFocusable(this.shadowRoot.querySelector('.d2l-labs-navigation-shadow-drop-border'));
|
|
53
|
+
if (nextFocusable) {
|
|
54
|
+
nextFocusable.focus();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
customElements.define('d2l-labs-navigation', Navigation);
|
package/src/lang/ar.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "انقر، أو اضغط على مسافة للخلف، أو اضغط على مفتاح الحذف لإزالة العنصر {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "تم طي خانة الاختيار", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "تم توسيع خانة الاختيار", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "العودة",
|
|
21
|
+
"components:navigation:next": "التالي",
|
|
22
|
+
"components:navigation:previous": "السابق",
|
|
23
|
+
"components:navigation:skipNav": "تجاوز إلى المحتوى الرئيسي",
|
|
20
24
|
"components:optInFlyout:cancel": "إلغاء",
|
|
21
25
|
"components:optInFlyout:close": "إغلاق مربع الحوار هذا",
|
|
22
26
|
"components:optInFlyout:done": "تم",
|
package/src/lang/cy.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Cliciwch, pwyswch yn ôl, neu pwyswch y fysell dileu i dynnu’r eitem {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Wedi crebachu blwch ticio", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Wedi ehangu blwch ticio", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Yn ôl",
|
|
21
|
+
"components:navigation:next": "Nesaf",
|
|
22
|
+
"components:navigation:previous": "Blaenorol",
|
|
23
|
+
"components:navigation:skipNav": "neidio i’r prif gynnwys",
|
|
20
24
|
"components:optInFlyout:cancel": "Canslo",
|
|
21
25
|
"components:optInFlyout:close": "Cau’r dialog hwn",
|
|
22
26
|
"components:optInFlyout:done": "Wedi Gorffen",
|
package/src/lang/da.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Klik, tryk på tilbagetasten, eller tryk på slettasten for at fjerne element {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Afkrydsningsfelt skjult", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Afkrydsningsfelt udvidet", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Tilbage",
|
|
21
|
+
"components:navigation:next": "Næste",
|
|
22
|
+
"components:navigation:previous": "Forrige",
|
|
23
|
+
"components:navigation:skipNav": "spring videre til hovedindhold",
|
|
20
24
|
"components:optInFlyout:cancel": "Annuller",
|
|
21
25
|
"components:optInFlyout:close": "Luk denne dialogboks",
|
|
22
26
|
"components:optInFlyout:done": "Udført",
|
package/src/lang/de.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Klicken Sie, drücken Sie die Rücktaste, oder drücken Sie die Entfernen-Taste, um das Element {value} zu entfernen", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Kontrollkästchen ausgeblendet", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Kontrollkästchen eingeblendet", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Zurück",
|
|
21
|
+
"components:navigation:next": "Weiter",
|
|
22
|
+
"components:navigation:previous": "Zurück",
|
|
23
|
+
"components:navigation:skipNav": "zum Hauptinhalt springen",
|
|
20
24
|
"components:optInFlyout:cancel": "Abbrechen",
|
|
21
25
|
"components:optInFlyout:close": "Dieses Dialogfeld schließen",
|
|
22
26
|
"components:optInFlyout:done": "Fertig",
|
package/src/lang/en-gb.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Click, press backspace or press delete key to remove item {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Tick box collapsed", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Tick box expanded", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Back",
|
|
21
|
+
"components:navigation:next": "Next",
|
|
22
|
+
"components:navigation:previous": "Previous",
|
|
23
|
+
"components:navigation:skipNav": "skip to main content",
|
|
20
24
|
"components:optInFlyout:cancel": "Cancel",
|
|
21
25
|
"components:optInFlyout:close": "Close this dialogue",
|
|
22
26
|
"components:optInFlyout:done": "Done",
|
package/src/lang/en.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Click, press backspace, or press delete key to remove item {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Checkbox collapsed", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Checkbox expanded", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Back",
|
|
21
|
+
"components:navigation:next": "Next",
|
|
22
|
+
"components:navigation:previous": "Previous",
|
|
23
|
+
"components:navigation:skipNav": "skip to main content",
|
|
20
24
|
"components:optInFlyout:cancel": "Cancel",
|
|
21
25
|
"components:optInFlyout:close": "Close this dialog",
|
|
22
26
|
"components:optInFlyout:done": "Done",
|
package/src/lang/es-es.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Haga clic, pulse Retroceso o pulse la tecla Supr para eliminar el elemento {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Casilla de verificación contraída", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Casilla de verificación expandida", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Volver",
|
|
21
|
+
"components:navigation:next": "Siguiente",
|
|
22
|
+
"components:navigation:previous": "Anterior",
|
|
23
|
+
"components:navigation:skipNav": "pasar al contenido principal",
|
|
20
24
|
"components:optInFlyout:cancel": "Cancelar",
|
|
21
25
|
"components:optInFlyout:close": "Cerrar este cuadro de diálogo",
|
|
22
26
|
"components:optInFlyout:done": "Hecho",
|
package/src/lang/es.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Haga clic, presione Retroceso o presione la tecla Suprimir para eliminar el elemento {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Casilla de selección contraída", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Casilla de selección expandida", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Volver",
|
|
21
|
+
"components:navigation:next": "Siguiente",
|
|
22
|
+
"components:navigation:previous": "Anterior",
|
|
23
|
+
"components:navigation:skipNav": "pasar al contenido principal",
|
|
20
24
|
"components:optInFlyout:cancel": "Cancelar",
|
|
21
25
|
"components:optInFlyout:close": "Cerrar este cuadro de diálogo",
|
|
22
26
|
"components:optInFlyout:done": "Listo",
|
package/src/lang/fr-fr.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Cliquez sur l’élément, appuyez sur la touche Retour arrière ou sur la touche Suppr pour supprimer l’élément {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Case à cocher réduite", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Case à cocher développée", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Retour",
|
|
21
|
+
"components:navigation:next": "Suivant",
|
|
22
|
+
"components:navigation:previous": "Précédent",
|
|
23
|
+
"components:navigation:skipNav": "passer au contenu principal",
|
|
20
24
|
"components:optInFlyout:cancel": "Annuler",
|
|
21
25
|
"components:optInFlyout:close": "Fermer cette boîte de dialogue",
|
|
22
26
|
"components:optInFlyout:done": "Terminé",
|
package/src/lang/fr-on.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Cliquez, appuyez sur la touche d'effacement arrière ou appuyez sur la touche de suppression pour supprimer l'élément {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Case à cocher réduite", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Case à cocher agrandie", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Retour",
|
|
21
|
+
"components:navigation:next": "Page suivante",
|
|
22
|
+
"components:navigation:previous": "Précédent",
|
|
23
|
+
"components:navigation:skipNav": "passer au contenu principal",
|
|
20
24
|
"components:optInFlyout:cancel": "Annuler",
|
|
21
25
|
"components:optInFlyout:close": "Fermer cette boîte de dialogue",
|
|
22
26
|
"components:optInFlyout:done": "Terminé",
|
package/src/lang/fr.js
CHANGED
|
@@ -17,6 +17,10 @@ export default {
|
|
|
17
17
|
"components:attributePicker:removeValue": "Cliquez, appuyez sur la touche d'effacement arrière ou appuyez sur la touche de suppression pour supprimer l'élément {value}", // Label to inform user how they can remove the given value
|
|
18
18
|
"components:checkboxDrawer:checkboxCollapsed": "Case à cocher réduite", // Read by screen readers when focusing the collapsed (unchecked) checkbox, with the inner content hidden
|
|
19
19
|
"components:checkboxDrawer:checkboxExpanded": "Case à cocher agrandie", // Read by screen readers when focusing the expanded (checked) checkbox, with the inner content shown
|
|
20
|
+
"components:navigation:back": "Retour",
|
|
21
|
+
"components:navigation:next": "Page suivante",
|
|
22
|
+
"components:navigation:previous": "Précédent",
|
|
23
|
+
"components:navigation:skipNav": "passer au contenu principal",
|
|
20
24
|
"components:optInFlyout:cancel": "Annuler",
|
|
21
25
|
"components:optInFlyout:close": "Fermer cette boîte de dialogue",
|
|
22
26
|
"components:optInFlyout:done": "Terminé",
|