@nldd/design-system 0.8.99 → 0.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/custom-elements.json +484 -40
- package/dist/components/actions/button/button.d.ts +7 -5
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.i18n.d.ts +3 -1
- package/dist/components/actions/button/button.i18n.d.ts.map +1 -1
- package/dist/components/actions/button/button.i18n.js +3 -1
- package/dist/components/actions/button/button.i18n.js.map +1 -1
- package/dist/components/actions/button/button.js +3 -3
- package/dist/components/actions/button/button.styles.js +2 -2
- package/dist/components/actions/button/button.template.d.ts.map +1 -1
- package/dist/components/actions/button/button.template.js +9 -10
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +7 -5
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.i18n.d.ts +3 -1
- package/dist/components/actions/icon-button/icon-button.i18n.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.i18n.js +3 -1
- package/dist/components/actions/icon-button/icon-button.i18n.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +3 -3
- package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +7 -7
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +9 -0
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +18 -1
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/split-button/split-button.d.ts +1 -1
- package/dist/components/actions/split-button/split-button.js +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +1 -1
- package/dist/components/actions/toolbar/toolbar.i18n.d.ts +3 -1
- package/dist/components/actions/toolbar/toolbar.i18n.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.i18n.js +3 -1
- package/dist/components/actions/toolbar/toolbar.i18n.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +1 -1
- package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.js +4 -2
- package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
- package/dist/components/components.js +1014 -296
- package/dist/components/content/avatar/avatar.d.ts +5 -3
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.i18n.d.ts +3 -1
- package/dist/components/content/avatar/avatar.i18n.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.i18n.js +3 -1
- package/dist/components/content/avatar/avatar.i18n.js.map +1 -1
- package/dist/components/content/avatar/avatar.js +1 -1
- package/dist/components/content/avatar/avatar.template.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.template.js +6 -6
- package/dist/components/content/avatar/avatar.template.js.map +1 -1
- package/dist/components/content/text/text.d.ts +1 -1
- package/dist/components/content/text/text.js +1 -1
- package/dist/components/content/text/text.styles.d.ts.map +1 -1
- package/dist/components/content/text/text.styles.js +55 -0
- package/dist/components/content/text/text.styles.js.map +1 -1
- package/dist/components/content/title/title.d.ts +16 -1
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +109 -0
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/content/title/title.styles.d.ts.map +1 -1
- package/dist/components/content/title/title.styles.js +39 -0
- package/dist/components/content/title/title.styles.js.map +1 -1
- package/dist/components/content/token/token.d.ts +1 -1
- package/dist/components/content/token/token.js +1 -1
- package/dist/components/{icon-button-CJIikwyu.js → icon-button-BVhiOwX9.js} +12 -7
- package/dist/components/inputs/dropdown/dropdown.d.ts +6 -0
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +6 -0
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/layout/card/card.d.ts +6 -4
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.i18n.d.ts +3 -1
- package/dist/components/layout/card/card.i18n.d.ts.map +1 -1
- package/dist/components/layout/card/card.i18n.js +3 -1
- package/dist/components/layout/card/card.i18n.js.map +1 -1
- package/dist/components/layout/card/card.js +2 -2
- package/dist/components/layout/card/card.template.d.ts.map +1 -1
- package/dist/components/layout/card/card.template.js +6 -6
- package/dist/components/layout/card/card.template.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +16 -5
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +44 -10
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/collection/collection.styles.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.styles.js +7 -6
- package/dist/components/layout/collection/collection.styles.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +1 -1
- package/dist/components/layout/container/container.js +1 -1
- package/dist/components/layout/container/container.styles.d.ts.map +1 -1
- package/dist/components/layout/container/container.styles.js +4 -0
- package/dist/components/layout/container/container.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts +29 -0
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts.map +1 -0
- package/dist/components/layout/page-sections/hero/hero-corner.js +131 -0
- package/dist/components/layout/page-sections/hero/hero-corner.js.map +1 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.d.ts +2 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.d.ts.map +1 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js +139 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js.map +1 -0
- package/dist/components/layout/page-sections/hero/hero.d.ts +13 -5
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +42 -6
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +16 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +61 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +1 -1
- package/dist/components/layout/window/window.js +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts +5 -0
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js +25 -0
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.js +28 -7
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.template.js +8 -4
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.template.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +5 -2
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +9 -4
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +12 -5
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.d.ts +3 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.js +3 -1
- package/dist/components/lists-and-tables/list-item/list-item.i18n.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +15 -7
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.js +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.template.js +9 -2
- package/dist/components/lists-and-tables/list-item/list-item.template.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +11 -2
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.i18n.d.ts +7 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.i18n.d.ts.map +1 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.i18n.js +6 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.i18n.js.map +1 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +7 -3
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js +12 -0
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +6 -3
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +8 -5
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +19 -10
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.js +4 -0
- package/dist/components/lists-and-tables/table/table.styles.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.template.js +5 -1
- package/dist/components/lists-and-tables/table/table.template.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +7 -5
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.i18n.d.ts +3 -1
- package/dist/components/navigation/link/link.i18n.d.ts.map +1 -1
- package/dist/components/navigation/link/link.i18n.js +3 -1
- package/dist/components/navigation/link/link.i18n.js.map +1 -1
- package/dist/components/navigation/link/link.js +3 -3
- package/dist/components/navigation/link/link.styles.js +2 -2
- package/dist/components/navigation/link/link.template.d.ts.map +1 -1
- package/dist/components/navigation/link/link.template.js +7 -8
- package/dist/components/navigation/link/link.template.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +4 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +11 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.d.ts +1 -1
- package/dist/components/navigation/pagination/pagination.js +1 -1
- package/dist/components/navigation/skip-link/skip-link.d.ts +1 -14
- package/dist/components/navigation/skip-link/skip-link.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.js +7 -55
- package/dist/components/navigation/skip-link/skip-link.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +6 -3
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +11 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +21 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.js +1 -1
- package/dist/components/{with-translations-C8_0-9y8.js → with-translations-C6QfP6_S.js} +24 -1
- package/dist/css/rich-text.css +1 -1
- package/dist/css/variables.css +1 -0
- package/dist/nldd.min.js +962 -683
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +24 -7
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.d.ts.map +1 -1
- package/dist/translations/fy.js +24 -7
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +24 -7
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/nl.generated.js +2 -0
- package/dist/translations/nl.generated.js.map +1 -1
- package/dist/translations/pap-AW.d.ts.map +1 -1
- package/dist/translations/pap-AW.js +24 -7
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.d.ts.map +1 -1
- package/dist/translations/pap-CW.js +24 -7
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/vue.d.ts +71 -38
- package/dist/utilities/focus-target.d.ts +23 -0
- package/dist/utilities/focus-target.d.ts.map +1 -0
- package/dist/utilities/focus-target.js +70 -0
- package/dist/utilities/focus-target.js.map +1 -0
- package/dist/utilities/link-hint.d.ts +18 -0
- package/dist/utilities/link-hint.d.ts.map +1 -0
- package/dist/utilities/link-hint.js +29 -0
- package/dist/utilities/link-hint.js.map +1 -0
- package/package.json +3 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { html, nothing } from 'lit';
|
|
2
2
|
import { linkRel } from '../../../utilities/link-rel.js';
|
|
3
|
+
import { linkHintKey } from '../../../utilities/link-hint.js';
|
|
3
4
|
export function template(helpers) {
|
|
4
5
|
const resolvedRel = linkRel(this.rel, this.target);
|
|
5
|
-
// A
|
|
6
|
+
// A link to another website or a new tab says so (WCAG 2.1 SC 3.2.2).
|
|
6
7
|
// Suppressed when disabled (the <a> carries no href, so it doesn't navigate).
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
: '';
|
|
8
|
+
const hintKey = this.disabled ? null : linkHintKey(this.href, this.target);
|
|
9
|
+
const linkHint = hintKey ? this._t(`components.link.${hintKey}`) : '';
|
|
10
10
|
// aria-label wins the accessible-name cascade, so when one is set the hint
|
|
11
11
|
// must live inside it; otherwise the name is content-derived (text or slot)
|
|
12
12
|
// and the visually-hidden span below appends the hint to it.
|
|
13
13
|
const ariaLabel = this.accessibleLabel
|
|
14
|
-
? [this.accessibleLabel,
|
|
14
|
+
? [this.accessibleLabel, linkHint].filter(Boolean).join(', ')
|
|
15
15
|
: nothing;
|
|
16
|
-
const
|
|
16
|
+
const renderLinkHint = !!linkHint && !this.accessibleLabel;
|
|
17
17
|
// Icons render in both modes:
|
|
18
18
|
// - sized mode: inline-flex container + gap controls spacing
|
|
19
19
|
// - inherit mode: inline container, the whitespace text node between
|
|
@@ -35,8 +35,7 @@ export function template(helpers) {
|
|
|
35
35
|
<span class="link__label">${this.text ? this.text : html `<slot></slot>`}</span>
|
|
36
36
|
${this.endIcon ? html `
|
|
37
37
|
<span class="link__end-icon"><nldd-icon icon=${this.endIcon}></nldd-icon></span>
|
|
38
|
-
` : html `<slot name="end-icon"></slot>`}
|
|
39
|
-
${renderOpensInNewTabHint ? html `<span class="link__opens-in-new-tab-hint">${opensInNewTabHint}</span>` : nothing}
|
|
38
|
+
` : html `<slot name="end-icon"></slot>`}${renderLinkHint ? html `<span class="link__link-hint">, ${linkHint}</span>` : nothing}
|
|
40
39
|
</a>
|
|
41
40
|
`;
|
|
42
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.template.js","sourceRoot":"","sources":["../../../../src/components/navigation/link/link.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;
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,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;cAC5B,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;YACrD,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC;SACrD,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,OAAO,CAAC;mBACxC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;gBACnC,SAAS;YACb,OAAO,CAAC,WAAW;;KAE1B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;qDAC2B,IAAI,CAAC,SAAS;IAC/D,CAAC,CAAC,CAAC,IAAI,CAAA,iCAAiC;+BACb,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,eAAe;KACrE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;mDAC2B,IAAI,CAAC,OAAO;IAC3D,CAAC,CAAC,CAAC,IAAI,CAAA,+BAA+B,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,CAAA,mCAAmC,QAAQ,SAAS,CAAC,CAAC,CAAC,OAAO;;EAE9H,CAAC;AACH,CAAC"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @attr {boolean} icon-only - Hide the text visually (always). The text then shows as a tooltip on hover and focus.
|
|
17
17
|
* @attr {'icon'|'text'} content-priority - Decides what stays visible in compact mode: 'icon' hides the text, 'text' hides the icon. A bar is compact on a narrow screen and also at 200% zoom on a desktop, so with 'icon' the text is gone there too and shows as a tooltip instead.
|
|
18
18
|
* @attr {boolean} compact - Activates content-priority behavior (set by the parent nldd-menu-bar)
|
|
19
|
-
* @attr {boolean} disabled - Turn interaction off
|
|
19
|
+
* @attr {boolean} disabled - Turn interaction off. Avoid it where you can; the design guidelines say why.
|
|
20
20
|
* @attr {string} accessible-label - Override aria-label
|
|
21
21
|
* @attr {string} haspopup - aria-haspopup value (e.g. "menu", "dialog")
|
|
22
22
|
* @attr {boolean} open - Whether the linked popover or menu is open
|
|
@@ -85,6 +85,9 @@ export declare class NLDDMenuBarItem extends LitElement {
|
|
|
85
85
|
private _unwireMenu;
|
|
86
86
|
private _handlePointerdown;
|
|
87
87
|
private _handleClick;
|
|
88
|
+
/** How far the indicator stops short of the item's top and bottom, so the
|
|
89
|
+
* menu can open against the indicator instead of against the item. */
|
|
90
|
+
private _indicatorInset;
|
|
88
91
|
private _toggleMenu;
|
|
89
92
|
render(): import("lit-html").TemplateResult<1>;
|
|
90
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-bar-item.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/menu-bar-item/menu-bar-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAKjC,OAAO,4BAA4B,CAAC;AACpC,OAAO,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"menu-bar-item.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/menu-bar-item/menu-bar-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAKjC,OAAO,4BAA4B,CAAC;AACpC,OAAO,4BAA4B,CAAC;AAepC,qBACa,eAAgB,SAAQ,UAAU;IAC9C,OAAgB,MAAM,0BAAqB;IAG3C,IAAI,SAAM;IAGV,OAAO,UAAS;IAGhB,WAAW,EAAE,MA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ually (always). The text then shows as a tooltip on hover and focus.
|
|
17
17
|
* @attr {'icon'|'text'} content-priority - Decides what stays visible in compact mode: 'icon' hides the text, 'text' hides the icon. A bar is compact on a narrow screen and also at 200% zoom on a desktop, so with 'icon' the text is gone there too and shows as a tooltip instead.
|
|
18
18
|
* @attr {boolean} compact - Activates content-priority behavior (set by the parent nldd-menu-bar)
|
|
19
|
-
* @attr {boolean} disabled - Turn interaction off
|
|
19
|
+
* @attr {boolean} disabled - Turn interaction off. Avoid it where you can; the design guidelines say why.
|
|
20
20
|
* @attr {string} accessible-label - Override aria-label
|
|
21
21
|
* @attr {string} haspopup - aria-haspopup value (e.g. "menu", "dialog")
|
|
22
22
|
* @attr {boolean} open - Whether the linked popover or menu is open
|
|
@@ -183,6 +183,15 @@ let NLDDMenuBarItem = class NLDDMenuBarItem extends LitElement {
|
|
|
183
183
|
this._menuOpen = false;
|
|
184
184
|
}
|
|
185
185
|
// ## Menu popover
|
|
186
|
+
/** How far the indicator stops short of the item's top and bottom, so the
|
|
187
|
+
* menu can open against the indicator instead of against the item. */
|
|
188
|
+
_indicatorInset() {
|
|
189
|
+
const item = this.shadowRoot?.querySelector('.menu-bar-item');
|
|
190
|
+
if (!item)
|
|
191
|
+
return 0;
|
|
192
|
+
const inset = parseFloat(getComputedStyle(item, '::before').top);
|
|
193
|
+
return Number.isNaN(inset) ? 0 : inset;
|
|
194
|
+
}
|
|
186
195
|
_toggleMenu() {
|
|
187
196
|
if (this._pointerdownWhileMenuOpen) {
|
|
188
197
|
this._pointerdownWhileMenuOpen = false;
|
|
@@ -193,6 +202,7 @@ let NLDDMenuBarItem = class NLDDMenuBarItem extends LitElement {
|
|
|
193
202
|
if (!this._menu)
|
|
194
203
|
return;
|
|
195
204
|
this._menu.anchorElement = this;
|
|
205
|
+
this._menu.anchorOffset = -this._indicatorInset();
|
|
196
206
|
if (this._menuOpen) {
|
|
197
207
|
this._menu.hidePopover();
|
|
198
208
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-bar-item.js","sourceRoot":"","sources":["../../../../src/components/navigation/menu-bar-item/menu-bar-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,4BAA4B,CAAC;AACpC,OAAO,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"menu-bar-item.js","sourceRoot":"","sources":["../../../../src/components/navigation/menu-bar-item/menu-bar-item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,4BAA4B,CAAC;AACpC,OAAO,4BAA4B,CAAC;AAgB7B,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAIN,SAAI,GAAG,EAAE,CAAC;QAGV,YAAO,GAAG,KAAK,CAAC;QAGhB,gBAAW,GAA4D,MAAM,CAAC;QAG9E,SAAI,GAAG,EAAE,CAAC;QAGV,SAAI,GAAG,EAAE,CAAC;QAGV,eAAU,GAAG,KAAK,C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Q,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAC1B;AAUjB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6DACa;AAU5C;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;4DAC4B;AA0C3D;IADC,KAAK,EAAE;wDACgB;AAtGZ,eAAe;IAD3B,aAAa,CAAC,oBAAoB,CAAC;GACvB,eAAe,CAyN3B"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @element nldd-pagination
|
|
7
7
|
* @attr {number} current - Currently active page (1-based)
|
|
8
8
|
* @attr {number} total - Total number of pages (recommended max: 200 for compact select performance)
|
|
9
|
-
* @attr {boolean} disabled - Disabled state
|
|
9
|
+
* @attr {boolean} disabled - Disabled state. Avoid it where you can; the design guidelines say why.
|
|
10
10
|
* @attr {boolean} centered - Centers the pagination in the container (host fills row, items grouped in the middle)
|
|
11
11
|
* @attr {string} href-pattern - URL pattern with a {page} placeholder, renders links instead of buttons
|
|
12
12
|
* @attr {object} translations - Translations; unspecified keys fall back to Dutch
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @element nldd-pagination
|
|
7
7
|
* @attr {number} current - Currently active page (1-based)
|
|
8
8
|
* @attr {number} total - Total number of pages (recommended max: 200 for compact select performance)
|
|
9
|
-
* @attr {boolean} disabled - Disabled state
|
|
9
|
+
* @attr {boolean} disabled - Disabled state. Avoid it where you can; the design guidelines say why.
|
|
10
10
|
* @attr {boolean} centered - Centers the pagination in the container (host fills row, items grouped in the middle)
|
|
11
11
|
* @attr {string} href-pattern - URL pattern with a {page} placeholder, renders links instead of buttons
|
|
12
12
|
* @attr {object} translations - Translations; unspecified keys fall back to Dutch
|
|
@@ -47,23 +47,10 @@ export declare class NLDDSkipLink extends NLDDSkipLink_base {
|
|
|
47
47
|
* on the link, so the next Tab starts from the top again.
|
|
48
48
|
*/
|
|
49
49
|
_handleLinkClick: (event?: MouseEvent) => void;
|
|
50
|
-
/**
|
|
51
|
-
* The fragment of an href that stays on this page, or an empty string. An
|
|
52
|
-
* absolute URL to the page you are on counts too: a router or a CMS writes
|
|
53
|
-
* `/pagina#inhoud` as readily as `#inhoud`.
|
|
54
|
-
*/
|
|
55
|
-
private _samePageHash;
|
|
56
50
|
private _focusTimer?;
|
|
57
51
|
private _restoreTarget?;
|
|
58
52
|
disconnectedCallback(): void;
|
|
59
|
-
/**
|
|
60
|
-
* Focuses the target and leaves it as it was once focus moves on.
|
|
61
|
-
*
|
|
62
|
-
* The tabindex is 0 and not -1, also when the target came with a -1 of its
|
|
63
|
-
* own. WebKit skips everything inside a shadow host that has a negative
|
|
64
|
-
* tabindex, slotted content included, so with -1 on an nldd-* section the
|
|
65
|
-
* next Tab left the page instead of reaching the first link in it.
|
|
66
|
-
*/
|
|
53
|
+
/** Focuses the target with a temporary tab stop; see focusTemporarily. */
|
|
67
54
|
private _focus;
|
|
68
55
|
/**
|
|
69
56
|
* The first following sibling that is rendered. `focus()` does nothing on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;;;;;;;
|
|
1
|
+
{"version":3,"file":"skip-link.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;;;;;;;AASjC,qBACa,YAAa,SAAQ,iBAAsD;IACvF,OAAgB,MAAM,0BAAkB;IAGxC,IAAI,SAAM;IAGV,IAAI,SAAM;IAEV,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,QAAO,IAAI,CAYrB;IAEF;;;;OAIG;IACH,gBAAgB,GAAI,QAAQ,UAAU,KAAG,IAAI,CAW3C;IAEF,OAAO,CAAC,WAAW,CAAC,CAAgC;IACpD,OAAO,CAAC,cAAc,CAAC,CAAa;IAE3B,oBAAoB,IAAI,IAAI;IAKrC,0EAA0E;IAC1E,OAAO,CAAC,MAAM;IAUd;;;;OAIG;IACH,OAAO,CAAC,OAAO;IAUf;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAcR,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,gBAAgB,EAAE,YAAY,CAAC;KAC/B;CACD"}
|
|
@@ -41,6 +41,7 @@ import { skipLinkStyles } from './skip-link.styles.js';
|
|
|
41
41
|
import { template } from './skip-link.template.js';
|
|
42
42
|
import { withTranslations } from '../../../utilities/with-translations.js';
|
|
43
43
|
import { nlddSkipLinkTranslations } from './skip-link.i18n.js';
|
|
44
|
+
import { focusTemporarily, hashTarget, samePageHash } from '../../../utilities/focus-target.js';
|
|
44
45
|
let NLDDSkipLink = class NLDDSkipLink extends withTranslations(LitElement, nlddSkipLinkTranslations) {
|
|
45
46
|
constructor() {
|
|
46
47
|
super(...arguments);
|
|
@@ -63,21 +64,14 @@ let NLDDSkipLink = class NLDDSkipLink extends withTranslations(LitElement, nlddS
|
|
|
63
64
|
* on the link, so the next Tab starts from the top again.
|
|
64
65
|
*/
|
|
65
66
|
this._handleLinkClick = (event) => {
|
|
66
|
-
const hash = this.
|
|
67
|
+
const hash = samePageHash(this.href);
|
|
67
68
|
if (!hash)
|
|
68
69
|
return;
|
|
69
70
|
// A click that opens the link elsewhere (middle button, or with a
|
|
70
71
|
// modifier held) leaves this page where it is, focus included.
|
|
71
72
|
if (event && (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey))
|
|
72
73
|
return;
|
|
73
|
-
|
|
74
|
-
// A malformed escape throws; the raw id is then the best guess left.
|
|
75
|
-
try {
|
|
76
|
-
id = decodeURIComponent(id);
|
|
77
|
-
}
|
|
78
|
-
catch { /* keep the raw id */ }
|
|
79
|
-
const root = this.getRootNode();
|
|
80
|
-
const target = root.getElementById?.(id) ?? document.getElementById(id);
|
|
74
|
+
const target = hashTarget(hash, this);
|
|
81
75
|
if (!target)
|
|
82
76
|
return;
|
|
83
77
|
// After the navigation the click is about to cause, not before it.
|
|
@@ -88,60 +82,18 @@ let NLDDSkipLink = class NLDDSkipLink extends withTranslations(LitElement, nlddS
|
|
|
88
82
|
get _text() {
|
|
89
83
|
return this.text || this._t('components.skip-link.action');
|
|
90
84
|
}
|
|
91
|
-
/**
|
|
92
|
-
* The fragment of an href that stays on this page, or an empty string. An
|
|
93
|
-
* absolute URL to the page you are on counts too: a router or a CMS writes
|
|
94
|
-
* `/pagina#inhoud` as readily as `#inhoud`.
|
|
95
|
-
*/
|
|
96
|
-
_samePageHash() {
|
|
97
|
-
try {
|
|
98
|
-
const url = new URL(this.href, location.href);
|
|
99
|
-
const samePage = url.origin === location.origin
|
|
100
|
-
&& url.pathname === location.pathname
|
|
101
|
-
&& url.search === location.search;
|
|
102
|
-
return samePage ? url.hash : '';
|
|
103
|
-
}
|
|
104
|
-
catch {
|
|
105
|
-
return '';
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
85
|
disconnectedCallback() {
|
|
109
86
|
super.disconnectedCallback();
|
|
110
87
|
clearTimeout(this._focusTimer);
|
|
111
88
|
}
|
|
112
|
-
/**
|
|
113
|
-
* Focuses the target and leaves it as it was once focus moves on.
|
|
114
|
-
*
|
|
115
|
-
* The tabindex is 0 and not -1, also when the target came with a -1 of its
|
|
116
|
-
* own. WebKit skips everything inside a shadow host that has a negative
|
|
117
|
-
* tabindex, slotted content included, so with -1 on an nldd-* section the
|
|
118
|
-
* next Tab left the page instead of reaching the first link in it.
|
|
119
|
-
*/
|
|
89
|
+
/** Focuses the target with a temporary tab stop; see focusTemporarily. */
|
|
120
90
|
_focus(target) {
|
|
121
91
|
// A second run before the target has blurred would read the temporary 0
|
|
122
92
|
// as the original and put that back for good. Settle the first one first.
|
|
123
93
|
this._restoreTarget?.();
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (this._restoreTarget === restore)
|
|
128
|
-
this._restoreTarget = undefined;
|
|
129
|
-
if (previous === null)
|
|
130
|
-
target.removeAttribute('tabindex');
|
|
131
|
-
else
|
|
132
|
-
target.setAttribute('tabindex', previous);
|
|
133
|
-
};
|
|
134
|
-
this._restoreTarget = restore;
|
|
135
|
-
target.setAttribute('tabindex', '0');
|
|
136
|
-
target.addEventListener('blur', restore);
|
|
137
|
-
target.focus();
|
|
138
|
-
// Focus did not take (the target got hidden or went inert in between):
|
|
139
|
-
// no blur will follow, so the tab stop would stay behind for good.
|
|
140
|
-
if (target.getRootNode().activeElement !== target) {
|
|
141
|
-
restore();
|
|
142
|
-
if (import.meta.env?.DEV) {
|
|
143
|
-
console.warn('<nldd-skip-link>: the target did not take focus, so the skip link did nothing. It is probably hidden or inert.', target);
|
|
144
|
-
}
|
|
94
|
+
this._restoreTarget = focusTemporarily(target) ?? undefined;
|
|
95
|
+
if (!this._restoreTarget && import.meta.env?.DEV) {
|
|
96
|
+
console.warn('<nldd-skip-link>: the target did not take focus, so the skip link did nothing. It is probably hidden or inert.', target);
|
|
145
97
|
}
|
|
146
98
|
}
|
|
147
99
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skip-link.js","sourceRoot":"","sources":["../../../../src/components/navigation/skip-link/skip-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE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C;IACvB,CAAC;;AApGe,mBAAM,GAAG,cAAc,AAAjB,CAAkB;AAGxC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;0CAC5D;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACjB;AAPE,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAsGxB"}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* @attr {string} variant - Visual mode: 'icon-and-text' | 'text' | 'icon'. When unset, the variant is inferred from each item's content. Drives the layout at every size.
|
|
22
22
|
* @attr {string} size - Size: 'md' | 'lg' (default: 'md'). 'lg' enlarges the touch target; the per-variant layout is preserved (icon-and-text stacks the icon over the text, text renders large text, icon renders a larger icon-only control).
|
|
23
23
|
* @attr {boolean} navigation - Renders a nav landmark instead of tablist; use for href-based items that navigate between routes
|
|
24
|
-
* @attr {boolean} disabled - Disables the whole bar: dims it, blocks pointer interaction, and takes the tabs out of the tab order
|
|
24
|
+
* @attr {boolean} disabled - Disables the whole bar: dims it, blocks pointer interaction, and takes the tabs out of the tab order. Avoid it where you can; the design guidelines say why.
|
|
25
25
|
* @attr {boolean} centered - Centers the tabs in the container (host fills the row, tabs group in the middle)
|
|
26
26
|
* @attr {string} accessible-label - Accessible name for the navigation region; defaults to 'Tabs'
|
|
27
27
|
* @attr {object} translations - Override translation keys (e.g. the overflow button label); unset keys fall back to Dutch.
|
|
@@ -27,7 +27,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
27
27
|
* @attr {string} variant - Visual mode: 'icon-and-text' | 'text' | 'icon'. When unset, the variant is inferred from each item's content. Drives the layout at every size.
|
|
28
28
|
* @attr {string} size - Size: 'md' | 'lg' (default: 'md'). 'lg' enlarges the touch target; the per-variant layout is preserved (icon-and-text stacks the icon over the text, text renders large text, icon renders a larger icon-only control).
|
|
29
29
|
* @attr {boolean} navigation - Renders a nav landmark instead of tablist; use for href-based items that navigate between routes
|
|
30
|
-
* @attr {boolean} disabled - Disables the whole bar: dims it, blocks pointer interaction, and takes the tabs out of the tab order
|
|
30
|
+
* @attr {boolean} disabled - Disables the whole bar: dims it, blocks pointer interaction, and takes the tabs out of the tab order. Avoid it where you can; the design guidelines say why.
|
|
31
31
|
* @attr {boolean} centered - Centers the tabs in the container (host fills the row, tabs group in the middle)
|
|
32
32
|
* @attr {string} accessible-label - Accessible name for the navigation region; defaults to 'Tabs'
|
|
33
33
|
* @attr {object} translations - Override translation keys (e.g. the overflow button label); unset keys fall back to Dutch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-navigation-bar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/top-navigation-bar/top-navigation-bar.styles.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"top-navigation-bar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/top-navigation-bar/top-navigation-bar.styles.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,sBAAsB,yBAidlC,CAAC"}
|
|
@@ -19,6 +19,9 @@ export const topNavigationBarStyles = css `
|
|
|
19
19
|
--_top-navigation-bar-logo-background-color: var(--semantics-brand-ribbon-color);
|
|
20
20
|
--_top-navigation-bar-wordmark-content-color: light-dark(var(--primitives-color-reference-lintblauw), var(--primitives-color-neutral-1000));
|
|
21
21
|
--_top-navigation-bar-wordmark-max-width: 280px;
|
|
22
|
+
--_top-navigation-bar-wordmark-title-font: var(--primitives-font-body-sm-semi-bold-flat);
|
|
23
|
+
--_top-navigation-bar-wordmark-subtitle-font: var(--primitives-font-body-xs-regular-flat);
|
|
24
|
+
--_top-navigation-bar-wordmark-supporting-text-font: var(--primitives-font-body-xxs-regular-flat);
|
|
22
25
|
--_top-navigation-bar-max-width: var(--semantics-page-sections-body-max-width);
|
|
23
26
|
--_top-navigation-bar-title-sm-font: var(--primitives-font-display-6-sm);
|
|
24
27
|
--_top-navigation-bar-title-md-font: var(--primitives-font-display-5-sm);
|
|
@@ -276,19 +279,19 @@ export const topNavigationBarStyles = css `
|
|
|
276
279
|
|
|
277
280
|
.top-navigation-bar__wordmark-title {
|
|
278
281
|
margin: 0;
|
|
279
|
-
font: var(--
|
|
282
|
+
font: var(--_top-navigation-bar-wordmark-title-font);
|
|
280
283
|
text-wrap: balance;
|
|
281
284
|
}
|
|
282
285
|
|
|
283
286
|
.top-navigation-bar__wordmark-subtitle {
|
|
284
287
|
margin: 0;
|
|
285
|
-
font: var(--
|
|
288
|
+
font: var(--_top-navigation-bar-wordmark-subtitle-font);
|
|
286
289
|
text-wrap: balance;
|
|
287
290
|
}
|
|
288
291
|
|
|
289
292
|
.top-navigation-bar__wordmark-supporting-text {
|
|
290
293
|
margin: 0;
|
|
291
|
-
font: var(--
|
|
294
|
+
font: var(--_top-navigation-bar-wordmark-supporting-text-font);
|
|
292
295
|
text-wrap: balance;
|
|
293
296
|
}
|
|
294
297
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-navigation-bar.styles.js","sourceRoot":"","sources":["../../../../src/components/navigation/top-navigation-bar/top-navigation-bar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"top-navigation-bar.styles.js","sourceRoot":"","sources":["../../../../src/components/navigation/top-navigation-bar/top-navigation-bar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;IAsBrC,kBAAkB;;;;;;;;;;;;;;;;;;;2BAmBK,KAAK;;;;2BAIL,KAAK,qBAAqB,KAAK;;;;2BAI/B,KAAK;;;;;;;;;;;;;2BAaL,KAAK;;;;2BAIL,KAAK,qBAAqB,KAAK;;;;2BAI/B,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAiKL,KAAK;;;;;;;;;;;;2BAYL,KAAK;;;;;;;;;;;;;;;;;;;;;;2BAsBL,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAiCL,KAAK;;;;2BAIL,KAAK,qBAAqB,KAAK;;;;;;2BAM/B,KAAK;;;;;;;;;;;;;2BAaL,KAAK;;;;2BAIL,KAAK;;;;;;;;;;;2BAWL,KAAK;;;;;;;;;;;;;;;;;2BAiBL,KAAK;;;;2BAIL,KAAK;;;;2BAIL,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAoCL,KAAK;;;;;2BAKL,KAAK;;;;;;;;;;;;;2BAaL,KAAK;;;;;2BAKL,KAAK;;;;;;;;;;;;;2BAaL,KAAK;;;;;;;;;;;;2BAYL,KAAK;;;;;;;;;;;;;;;;;;;;CAoB/B,CAAC"}
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* A modal window with overlay backdrop, based on the native <dialog> element.
|
|
5
5
|
* Internally renders an <nldd-inline-dialog> for the visual structure.
|
|
6
6
|
*
|
|
7
|
+
* Use it only when there is no way back, and give it a real choice: a dialog
|
|
8
|
+
* with one button offers nothing to decide, so tell the user with an
|
|
9
|
+
* nldd-notification or an inline message instead. In a destructive dialog the
|
|
10
|
+
* safe way out comes first, as the primary button. Work that needs the page
|
|
11
|
+
* as context, such as editing, belongs in an nldd-sheet. The design guidelines
|
|
12
|
+
* say why. A dialog that opens with one action says so in development.
|
|
13
|
+
*
|
|
7
14
|
* Open and close it with `open`, bound to your state together with the close
|
|
8
15
|
* event: the dialog clears `open` itself when the user closes it. show() and
|
|
9
16
|
* hide() do the same for code without a binding. Keep the dialog in the DOM
|
|
@@ -24,7 +31,7 @@
|
|
|
24
31
|
* @slot notifications - Where the notifications area lands while this overlay is open, so a notification is not left inert behind it. Filled by the package; leave it alone.
|
|
25
32
|
*
|
|
26
33
|
* @fires open - When the dialog is opened
|
|
27
|
-
* @fires close - When the dialog is fully closed. Does not bubble: overlays nest, and a listener on one dialog asking about that dialog should not also hear the form it opened.
|
|
34
|
+
* @fires close - When the dialog is fully closed. Does not bubble: overlays nest, and a listener on one dialog asking about that dialog should not also hear the form it opened.
|
|
28
35
|
*
|
|
29
36
|
* @method show() - Opens the modal dialog
|
|
30
37
|
* @method hide() - Closes the modal dialog with a closing animation
|
|
@@ -48,6 +55,9 @@ export declare class NLDDModalDialog extends LitElement {
|
|
|
48
55
|
/** Cancels a `show()` that is waiting for the first render; null when none is. */
|
|
49
56
|
private _cancelPendingOpen;
|
|
50
57
|
show(): void;
|
|
58
|
+
private _warnedSingleAction;
|
|
59
|
+
/** DEV-only: warns once when the dialog opens with a single action. */
|
|
60
|
+
private _checkActions;
|
|
51
61
|
private _manageFocus;
|
|
52
62
|
hide(): void;
|
|
53
63
|
/** Timer id for the close fallback above. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/status-and-feedback/modal-dialog/modal-dialog.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"modal-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/status-and-feedback/modal-dialog/modal-dialog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAajC,OAAO,KAAK,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAC9G,OAAO,mCAAmC,CAAC;AAE3C,qBACa,eAAgB,SAAQ,UAAU;IAC9C,OAAgB,MAAM,0BAAqB;IAG3C,OAAO,EAAE,mBAAmB,GAAG,EAAE,CAAM;IAGvC,mBAAmB,EAAE,+BAA+B,GAAG,EAAE,CAAM;IAG/D,IAAI,SAAM;IAGV,cAAc,SAAM;IAGpB,IAAI,SAAM;IAEV,oFAAoF;IAEpF,eAAe,SAAM;IAGrB,IAAI,UAAS;IAEJ,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAQrD,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,KAAK,OAAO,GAElB;IAED,kFAAkF;IAClF,OAAO,CAAC,kBAAkB,CAA6B;IAEvD,IAAI,IAAI,IAAI;IA8BZ,OAAO,CAAC,mBAAmB,CAAS;IAEpC,uEAAuE;IACvE,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,YAAY;IAapB,IAAI,IAAI,IAAI;IAoCZ,6CAA6C;IAC7C,OAAO,CAAC,cAAc,CAAK;IAE3B;;;mEAG+D;IAC/D,OAAO,CAAC,sBAAsB,CAAS;IAEvC,wBAAwB,GAAI,GAAG,YAAY,KAAG,IAAI,CAEhD;IAEF;;;;2EAIuE;IACvE,OAAO,CAAC,aAAa;IASrB,oBAAoB,GAAI,GAAG,UAAU,KAAG,IAAI,CAO3C;IAED,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAKpB,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD"}
|
|
@@ -10,6 +10,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
10
10
|
* A modal window with overlay backdrop, based on the native <dialog> element.
|
|
11
11
|
* Internally renders an <nldd-inline-dialog> for the visual structure.
|
|
12
12
|
*
|
|
13
|
+
* Use it only when there is no way back, and give it a real choice: a dialog
|
|
14
|
+
* with one button offers nothing to decide, so tell the user with an
|
|
15
|
+
* nldd-notification or an inline message instead. In a destructive dialog the
|
|
16
|
+
* safe way out comes first, as the primary button. Work that needs the page
|
|
17
|
+
* as context, such as editing, belongs in an nldd-sheet. The design guidelines
|
|
18
|
+
* say why. A dialog that opens with one action says so in development.
|
|
19
|
+
*
|
|
13
20
|
* Open and close it with `open`, bound to your state together with the close
|
|
14
21
|
* event: the dialog clears `open` itself when the user closes it. show() and
|
|
15
22
|
* hide() do the same for code without a binding. Keep the dialog in the DOM
|
|
@@ -30,7 +37,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
30
37
|
* @slot notifications - Where the notifications area lands while this overlay is open, so a notification is not left inert behind it. Filled by the package; leave it alone.
|
|
31
38
|
*
|
|
32
39
|
* @fires open - When the dialog is opened
|
|
33
|
-
* @fires close - When the dialog is fully closed. Does not bubble: overlays nest, and a listener on one dialog asking about that dialog should not also hear the form it opened.
|
|
40
|
+
* @fires close - When the dialog is fully closed. Does not bubble: overlays nest, and a listener on one dialog asking about that dialog should not also hear the form it opened.
|
|
34
41
|
*
|
|
35
42
|
* @method show() - Opens the modal dialog
|
|
36
43
|
* @method hide() - Closes the modal dialog with a closing animation
|
|
@@ -62,6 +69,7 @@ let NLDDModalDialog = class NLDDModalDialog extends LitElement {
|
|
|
62
69
|
this._closing = false;
|
|
63
70
|
/** Cancels a `show()` that is waiting for the first render; null when none is. */
|
|
64
71
|
this._cancelPendingOpen = null;
|
|
72
|
+
this._warnedSingleAction = false;
|
|
65
73
|
/** Timer id for the close fallback above. */
|
|
66
74
|
this._closeFallback = 0;
|
|
67
75
|
/** Whether the press preceding a click started on the backdrop rather than
|
|
@@ -113,10 +121,22 @@ let NLDDModalDialog = class NLDDModalDialog extends LitElement {
|
|
|
113
121
|
return;
|
|
114
122
|
dialog.showModal();
|
|
115
123
|
this._manageFocus();
|
|
124
|
+
if (import.meta.env?.DEV)
|
|
125
|
+
this._checkActions();
|
|
116
126
|
}
|
|
117
127
|
this.open = true;
|
|
118
128
|
this.dispatchEvent(new CustomEvent('open', { bubbles: true, composed: true }));
|
|
119
129
|
}
|
|
130
|
+
/** DEV-only: warns once when the dialog opens with a single action. */
|
|
131
|
+
_checkActions() {
|
|
132
|
+
if (this._warnedSingleAction)
|
|
133
|
+
return;
|
|
134
|
+
const actions = [...this.children].filter((child) => child.getAttribute('slot') === 'actions');
|
|
135
|
+
if (actions.length !== 1)
|
|
136
|
+
return;
|
|
137
|
+
this._warnedSingleAction = true;
|
|
138
|
+
console.warn('<nldd-modal-dialog>: The dialog has one action, so there is nothing to choose. Tell the user with an nldd-notification or an inline message instead, or give the dialog a real choice.', this);
|
|
139
|
+
}
|
|
120
140
|
_manageFocus() {
|
|
121
141
|
// 1. autofocus element present — focus it ourselves: a design-system
|
|
122
142
|
// field keeps its input in shadow DOM, which the browser's own autofocus
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-dialog.js","sourceRoot":"","sources":["../../../../src/components/status-and-feedback/modal-dialog/modal-dialog.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"modal-dialog.js","sourceRoot":"","sources":["../../../../src/components/status-and-feedback/modal-dialog/modal-dialog.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC;;iDAEiD;AACjD,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,OAAO,mCAAmC,CAAC;AAGpC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAIN,YAAO,GAA6B,EAAE,CAAC;QAGvC,wBAAmB,GAAyC,EAAE,CAAC;QAG/D,SAAI,GAAG,EAAE,CAAC;QAGV,mBAAc,GAAG,EAAE,CAAC;QAGpB,SAAI,GAAG,EAAE,CAAC;QAEV,oFAAoF;QAEpF,oBAAe,GAAG,EAAE,CAAC;QAGrB,SAAI,GAAG,KAAK,CAAC;QAUL,aAAQ,GAAG,KAAK,CAAC;Q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GAAG,iBAAiB,AAApB,CAAqB;AAG3C;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAA2B,EAAE,CAAC,EAAE,CAAC;gDACjD;AAGvC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,sBAAsB,EAAE,SAAS,EAAE,iBAAiB,CAAuC,EAAE,CAAC,EAAE,CAAC;4DACxE;AAG/D;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;6CAC5D;AAGV;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;uDAChF;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAChC;AAIV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;wDACrC;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAC9B;AAvBD,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAgL3B"}
|
|
@@ -72,7 +72,7 @@ export declare class NLDDStepBarItem extends LitElement {
|
|
|
72
72
|
text: string;
|
|
73
73
|
icon: string;
|
|
74
74
|
href: string;
|
|
75
|
-
/** For flows without a URL per step (a
|
|
75
|
+
/** For flows without a URL per step (a process that runs inside one window). Ignored
|
|
76
76
|
* once `href` is set: one step is one action, and a link outranks a button
|
|
77
77
|
* -- the same rule as nldd-card and nldd-avatar. */
|
|
78
78
|
button: boolean;
|
|
@@ -82,7 +82,7 @@ export class NLDDStepBarItem extends LitElement {
|
|
|
82
82
|
this.text = '';
|
|
83
83
|
this.icon = '';
|
|
84
84
|
this.href = '';
|
|
85
|
-
/** For flows without a URL per step (a
|
|
85
|
+
/** For flows without a URL per step (a process that runs inside one window). Ignored
|
|
86
86
|
* once `href` is set: one step is one action, and a link outranks a button
|
|
87
87
|
* -- the same rule as nldd-card and nldd-avatar. */
|
|
88
88
|
this.button = false;
|
|
@@ -21,6 +21,29 @@ function linkRel(rel, target) {
|
|
|
21
21
|
return [...parts].join(" ");
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
|
+
//#region src/utilities/link-hint.ts
|
|
25
|
+
function linkHintKey(href, target) {
|
|
26
|
+
if (!href) return null;
|
|
27
|
+
const external = isExternalHref(href);
|
|
28
|
+
const newTab = target === "_blank";
|
|
29
|
+
if (external && newTab) return "link-hint-external-new-tab-lowercase-label";
|
|
30
|
+
if (external) return "link-hint-external-lowercase-label";
|
|
31
|
+
if (newTab) return "link-hint-new-tab-lowercase-label";
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
/** Whether `href` points at another origin than the page it is on. */
|
|
35
|
+
function isExternalHref(href) {
|
|
36
|
+
if (typeof document === "undefined" || typeof location === "undefined") return false;
|
|
37
|
+
let url;
|
|
38
|
+
try {
|
|
39
|
+
url = new URL(href, document.baseURI);
|
|
40
|
+
} catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") return false;
|
|
44
|
+
return url.origin !== location.origin;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
24
47
|
//#region src/utilities/translations.ts
|
|
25
48
|
var _globalThis;
|
|
26
49
|
var STORE_KEY = Symbol.for("nldd.translations");
|
|
@@ -94,4 +117,4 @@ function withTranslations(Base, defaults) {
|
|
|
94
117
|
return TranslationsMixin;
|
|
95
118
|
}
|
|
96
119
|
//#endregion
|
|
97
|
-
export { linkRel as i, setTranslations as n, translate as r, withTranslations as t };
|
|
120
|
+
export { linkRel as a, linkHintKey as i, setTranslations as n, translate as r, withTranslations as t };
|
package/dist/css/rich-text.css
CHANGED
|
@@ -386,7 +386,7 @@ nldd-rich-text code {
|
|
|
386
386
|
border-radius: var(--semantics-controls-xs-corner-radius);
|
|
387
387
|
background-color: var(--semantics-surfaces-tinted-background-color);
|
|
388
388
|
font-family: var(--primitives-font-family-monospace);
|
|
389
|
-
font-size:
|
|
389
|
+
font-size: var(--semantics-code-inline-font-size);
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
/* Inside table cells, let long code tokens (e.g. type_spec.precision) break so
|
package/dist/css/variables.css
CHANGED
|
@@ -1708,6 +1708,7 @@
|
|
|
1708
1708
|
|
|
1709
1709
|
/* ## Code syntax */
|
|
1710
1710
|
|
|
1711
|
+
--semantics-code-inline-font-size: 0.85em;
|
|
1711
1712
|
--semantics-code-syntax-comment-color: var(--semantics-content-secondary-color);
|
|
1712
1713
|
--semantics-code-syntax-punctuation-color: var(--semantics-content-color);
|
|
1713
1714
|
--semantics-code-syntax-keyword-color: var(--primitives-color-donkergeel-650);
|