@lilydesignsystem/angular-link-picker 0.1.1 → 0.2.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/{dist/fesm2022 → fesm2022}/lilydesignsystem-angular-link-picker.mjs +48 -5
- package/fesm2022/lilydesignsystem-angular-link-picker.mjs.map +1 -0
- package/package.json +20 -11
- package/{dist/types → types}/lilydesignsystem-angular-link-picker.d.ts +29 -13
- package/types/lilydesignsystem-angular-link-picker.d.ts.map +1 -0
- package/AGENTS.md +0 -29
- package/CHANGELOG.md +0 -8
- package/dist/fesm2022/lilydesignsystem-angular-link-picker.mjs.map +0 -1
- package/dist/package.json +0 -50
- package/dist/types/lilydesignsystem-angular-link-picker.d.ts.map +0 -1
- package/docs/accessibility.md +0 -29
- package/examples/README.md +0 -9
- package/examples/basic.component.ts +0 -18
- package/examples/custom-icon.component.ts +0 -22
- package/examples/router.component.ts +0 -22
- package/index.md +0 -86
- package/index.ts +0 -11
- package/link-picker.component.spec.ts +0 -287
- package/link-picker.component.ts +0 -398
- package/ng-package.json +0 -10
- package/spec/index.md +0 -102
- package/tsconfig.lib.json +0 -13
- /package/{dist/README.md → README.md} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from "@angular/common";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import { ChangeDetectionStrategy, Component, Directive, TemplateRef, computed, contentChild, effect, input, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, Directive, Injector, TemplateRef, afterNextRender, computed, contentChild, effect, inject, input, model, output, signal, viewChild } from "@angular/core";
|
|
4
4
|
import { IconButton } from "@lilydesignsystem/angular-headless";
|
|
5
5
|
function linkId(link) {
|
|
6
6
|
return link.id ?? link.href;
|
|
@@ -61,7 +61,12 @@ var LinkPicker = class LinkPicker {
|
|
|
61
61
|
this.listRef = viewChild.required("listEl", ...ngDevMode ? [{ debugName: "listRef" }] : /* istanbul ignore next */ []);
|
|
62
62
|
this.baseId = nextLinkPickerId();
|
|
63
63
|
this.listId = `${this.baseId}-list`;
|
|
64
|
-
this.open =
|
|
64
|
+
this.open = model(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
65
|
+
this.disabled = input(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
66
|
+
this.closeWhenDisabled = effect(() => {
|
|
67
|
+
if (this.disabled() && this.open()) this.open.set(false);
|
|
68
|
+
}, ...ngDevMode ? [{ debugName: "closeWhenDisabled" }] : /* istanbul ignore next */ []);
|
|
69
|
+
this.injector = inject(Injector);
|
|
65
70
|
this.tooltipId = `${this.baseId}-tooltip`;
|
|
66
71
|
this.hoverButton = signal(false, ...ngDevMode ? [{ debugName: "hoverButton" }] : /* istanbul ignore next */ []);
|
|
67
72
|
this.hoverTooltip = signal(false, ...ngDevMode ? [{ debugName: "hoverTooltip" }] : /* istanbul ignore next */ []);
|
|
@@ -110,10 +115,10 @@ var LinkPicker = class LinkPicker {
|
|
|
110
115
|
}
|
|
111
116
|
openList(focusLast = false) {
|
|
112
117
|
this.open.set(true);
|
|
113
|
-
|
|
118
|
+
afterNextRender(() => {
|
|
114
119
|
const all = this.items();
|
|
115
120
|
(focusLast ? all[all.length - 1] : all[0])?.focus({ preventScroll: true });
|
|
116
|
-
});
|
|
121
|
+
}, { injector: this.injector });
|
|
117
122
|
}
|
|
118
123
|
closeList(refocus = true) {
|
|
119
124
|
if (!this.open()) return;
|
|
@@ -241,9 +246,26 @@ var LinkPicker = class LinkPicker {
|
|
|
241
246
|
isSignal: true,
|
|
242
247
|
isRequired: false,
|
|
243
248
|
transformFunction: null
|
|
249
|
+
},
|
|
250
|
+
open: {
|
|
251
|
+
classPropertyName: "open",
|
|
252
|
+
publicName: "open",
|
|
253
|
+
isSignal: true,
|
|
254
|
+
isRequired: false,
|
|
255
|
+
transformFunction: null
|
|
256
|
+
},
|
|
257
|
+
disabled: {
|
|
258
|
+
classPropertyName: "disabled",
|
|
259
|
+
publicName: "disabled",
|
|
260
|
+
isSignal: true,
|
|
261
|
+
isRequired: false,
|
|
262
|
+
transformFunction: null
|
|
244
263
|
}
|
|
245
264
|
},
|
|
246
|
-
outputs: {
|
|
265
|
+
outputs: {
|
|
266
|
+
navigated: "navigated",
|
|
267
|
+
open: "openChange"
|
|
268
|
+
},
|
|
247
269
|
host: { listeners: { "document:click": "onDocumentClick($event)" } },
|
|
248
270
|
queries: [{
|
|
249
271
|
propertyName: "iconTemplate",
|
|
@@ -283,6 +305,7 @@ var LinkPicker = class LinkPicker {
|
|
|
283
305
|
(focusout)="onRootFocusOut($event)"
|
|
284
306
|
>
|
|
285
307
|
<lily-icon-button
|
|
308
|
+
[disabled]="disabled()"
|
|
286
309
|
#buttonEl
|
|
287
310
|
[label]="label()"
|
|
288
311
|
baseClass="link-picker-button"
|
|
@@ -408,6 +431,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
408
431
|
(focusout)="onRootFocusOut($event)"
|
|
409
432
|
>
|
|
410
433
|
<lily-icon-button
|
|
434
|
+
[disabled]="disabled()"
|
|
411
435
|
#buttonEl
|
|
412
436
|
[label]="label()"
|
|
413
437
|
baseClass="link-picker-button"
|
|
@@ -538,6 +562,25 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
538
562
|
listRef: [{
|
|
539
563
|
type: i0.ViewChild,
|
|
540
564
|
args: ["listEl", { isSignal: true }]
|
|
565
|
+
}],
|
|
566
|
+
open: [{
|
|
567
|
+
type: i0.Input,
|
|
568
|
+
args: [{
|
|
569
|
+
isSignal: true,
|
|
570
|
+
alias: "open",
|
|
571
|
+
required: false
|
|
572
|
+
}]
|
|
573
|
+
}, {
|
|
574
|
+
type: i0.Output,
|
|
575
|
+
args: ["openChange"]
|
|
576
|
+
}],
|
|
577
|
+
disabled: [{
|
|
578
|
+
type: i0.Input,
|
|
579
|
+
args: [{
|
|
580
|
+
isSignal: true,
|
|
581
|
+
alias: "disabled",
|
|
582
|
+
required: false
|
|
583
|
+
}]
|
|
541
584
|
}]
|
|
542
585
|
}
|
|
543
586
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lilydesignsystem-angular-link-picker.mjs","names":[],"sources":["../../link-picker.component.ts"],"sourcesContent":["import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from \"@angular/core\";\n// Only the trigger button composes a headless primitive. The list below is real `<a>` navigation\n// with a roving-focus pattern of its own — not an ARIA listbox or menu: role=\"menuitem\" would strip\n// middle-click, open-in-new-tab and copy-link-address from ordinary links. See spec/index.md §3.\nimport { IconButton } from \"@lilydesignsystem/angular-headless\";\n\n/**\n * One destination in the list. The app defines them all: this package ships no routes and no\n * English — `label` is the consumer's text.\n */\nexport type LinkItem = {\n /** Stable identifier, passed back on the `navigated` output. Defaults to `href`. */\n id?: string;\n /** Visible link text. Consumer-supplied, so it localises. */\n label: string;\n /** Where the link goes: a route (\"/about/\") or a full URL. */\n href: string;\n /** Marks this link as the current page (`aria-current=\"page\"`). */\n current?: boolean;\n /** Open in a new tab (`target=\"_blank\"` with `rel=\"noopener noreferrer\"`). */\n newTab?: boolean;\n};\n\n/** Context passed to a custom icon `<ng-template>` (the button icon). */\nexport type ChildArgs = {\n /** Is the list open? */\n open: boolean;\n};\n\n/** Payload of the `navigated` output. */\nexport type LinkNavigatedEvent = {\n /** The chosen link's `id` (its `href` when it has none). */\n id: string;\n /** The chosen link's `href`. */\n href: string;\n};\n\n/** The id a link reports: its explicit `id`, else its `href`. */\nexport function linkId(link: LinkItem): string {\n return link.id ?? link.href;\n}\n\nlet uid = 0;\n/** Stable per-instance id prefix; SSR-safe (no Math.random / Date.now). */\nexport function nextLinkPickerId(): string {\n uid += 1;\n return `link-picker-${uid}`;\n}\n\n/**\n * Optional marker for the projected icon template. Gives consumers typed `let-` variables:\n *\n * ```html\n * <lily-link-picker label=\"Pages\" [links]=\"links\">\n * <ng-template lilyLinkPickerIcon let-args>{{ args.open ? \"×\" : \"☰\" }}</ng-template>\n * </lily-link-picker>\n * ```\n */\n@Directive({\n selector: \"ng-template[lilyLinkPickerIcon]\",\n standalone: true,\n})\nexport class LinkPickerIcon {\n static ngTemplateContextGuard(\n _dir: LinkPickerIcon,\n _ctx: unknown,\n ): _ctx is ChildArgs & { $implicit: ChildArgs } {\n return true;\n }\n}\n\n/**\n * LinkPicker — a headless page-links control.\n *\n * A single-icon button (a bundled home SVG) that opens a disclosure list of page links the app\n * defines. It applies nothing to the document and persists nothing. See `spec/index.md`.\n */\n@Component({\n selector: \"lily-link-picker\",\n standalone: true,\n imports: [NgTemplateOutlet, IconButton],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n \"(document:click)\": \"onDocumentClick($event)\",\n },\n template: `\n <div\n #rootEl\n class=\"link-picker {{ className() }}\"\n (focusout)=\"onRootFocusOut($event)\"\n >\n <lily-icon-button\n [disabled]=\"disabled()\"\n #buttonEl\n [label]=\"label()\"\n baseClass=\"link-picker-button\"\n [ariaExpanded]=\"open()\"\n [ariaControls]=\"listId\"\n (click)=\"onButtonClick(); hoverButton.set(false)\"\n (mouseenter)=\"onTooltipButtonEnter()\"\n (mouseleave)=\"hoverButton.set(false)\"\n (focusin)=\"onTooltipButtonFocusIn()\"\n (focusout)=\"onTooltipButtonFocusOut()\"\n (keydown)=\"onButtonKeydown($event); onTooltipKeydown($event)\"\n >\n @if (iconTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"childContext()\"\n />\n } @else {\n <svg\n class=\"link-picker-icon\"\n viewBox=\"0 0 16 16\"\n width=\"1.05rem\"\n height=\"1.05rem\"\n aria-hidden=\"true\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.6\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M1 8 8 1.5l7 6.5\" />\n <path d=\"M2.5 7v7.5h11V7\" />\n <path d=\"M6.5 14.5v-4h3v4\" />\n </svg>\n }\n </lily-icon-button>\n\n <!-- Purely visual: the same text is already the button's aria-label, so it is not wired\n with aria-describedby (that would announce the name twice). -->\n <div\n class=\"link-picker-tooltip\"\n role=\"tooltip\"\n [id]=\"tooltipId\"\n [attr.hidden]=\"tooltipVisible() ? null : ''\"\n (mouseenter)=\"hoverTooltip.set(true)\"\n (mouseleave)=\"hoverTooltip.set(false)\"\n >{{ label() }}</div>\n\n <!-- Named like the sibling pickers' popups: a screen reader entering the list hears what\n it is for. -->\n <ul\n #listEl\n class=\"link-picker-list\"\n [id]=\"listId\"\n [attr.aria-label]=\"label() || null\"\n [attr.hidden]=\"open() ? null : ''\"\n (keydown)=\"onListKeydown($event)\"\n >\n @for (link of links(); track idOf(link)) {\n <li class=\"link-picker-list-item\">\n <!-- A real link, not role=\"menuitem\": these ARE navigation. -->\n <a\n class=\"link-picker-link\"\n [attr.data-link-id]=\"idOf(link)\"\n [attr.href]=\"link.href\"\n [attr.aria-current]=\"link.current ? 'page' : null\"\n [attr.target]=\"link.newTab ? '_blank' : null\"\n [attr.rel]=\"link.newTab ? 'noopener noreferrer' : null\"\n (click)=\"onLinkClick($event, link)\"\n >{{ link.label }}</a\n >\n </li>\n }\n </ul>\n </div>\n `,\n})\nexport class LinkPicker {\n /** Accessible name for the button and the list. */\n readonly label = input.required<string>();\n /** The page links to offer. Defined by the app. */\n readonly links = input.required<LinkItem[]>();\n /**\n * Client-side navigation hook, e.g. a router's `navigateByUrl`. When given, a plain left click\n * on a link calls `navigate(href)` instead of letting the browser load the page; modified\n * clicks (Ctrl/Cmd/Shift/Alt, middle button) and `newTab` links stay native.\n */\n readonly navigate = input<((href: string) => void) | undefined>(undefined);\n /** Extra CSS class on the root div. */\n readonly className = input<string>(\"\");\n\n /** Fires after a link is chosen. */\n readonly navigated = output<LinkNavigatedEvent>();\n\n /** Projected icon template; replaces the default icon when supplied. */\n protected readonly iconTemplate = contentChild(TemplateRef);\n\n private readonly rootRef =\n viewChild.required<ElementRef<HTMLDivElement>>(\"rootEl\");\n // A template-ref-variable on a component tag resolves to the component INSTANCE, which is what\n // is needed to call the headless component's own public `focus()` method.\n private readonly buttonRef = viewChild.required<IconButton>(\"buttonEl\");\n private readonly listRef =\n viewChild.required<ElementRef<HTMLUListElement>>(\"listEl\");\n\n private readonly baseId = nextLinkPickerId();\n protected readonly listId = `${this.baseId}-list`;\n\n /** Is the popup open? Two-way bindable: `[(open)]`; `openChange` fires for each change. */\n readonly open = model<boolean>(false);\n /** Disables the button; an open popup closes. */\n readonly disabled = input<boolean>(false);\n private readonly closeWhenDisabled = effect(() => {\n if (this.disabled() && this.open()) this.open.set(false);\n });\n private readonly injector = inject(Injector);\n\n // Tooltip: shown while the pointer is over the button or the tooltip itself (hoverable, WCAG\n // 1.4.13) or while the button has keyboard focus; Escape dismisses it without moving focus;\n // never shown while the popup is open, since the popup then explains the control.\n protected readonly tooltipId = `${this.baseId}-tooltip`;\n protected readonly hoverButton = signal(false);\n protected readonly hoverTooltip = signal(false);\n protected readonly focusButton = signal(false);\n protected readonly dismissed = signal(false);\n protected readonly tooltipVisible = computed(\n () =>\n !this.open() &&\n !this.dismissed() &&\n (this.hoverButton() || this.hoverTooltip() || this.focusButton()),\n );\n\n protected onTooltipButtonEnter(): void {\n this.hoverButton.set(true);\n this.dismissed.set(false);\n }\n\n protected onTooltipButtonFocusIn(): void {\n // Keyboard focus only: a mouse click also focuses the button in Chromium, and the tooltip\n // should not stick after a click.\n try {\n this.focusButton.set(\n this.buttonRef().element?.matches(\":focus-visible\") ?? false,\n );\n } catch {\n this.focusButton.set(true); // engine without :focus-visible — err towards showing\n }\n }\n\n protected onTooltipButtonFocusOut(): void {\n this.focusButton.set(false);\n this.dismissed.set(false);\n }\n\n protected onTooltipKeydown(event: KeyboardEvent): void {\n if (event.key === \"Escape\" && this.tooltipVisible()) this.dismissed.set(true);\n }\n\n // WCAG 1.4.13 \"dismissable\": while the tooltip is visible, Escape works wherever focus is. The\n // listener exists only while visible; the effect cleanup removes it on hide and on destroy.\n private readonly tooltipEscapeListener = effect((onCleanup) => {\n if (!this.tooltipVisible() || typeof document === \"undefined\") return;\n const onKey = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\") this.dismissed.set(true);\n };\n document.addEventListener(\"keydown\", onKey);\n onCleanup(() => document.removeEventListener(\"keydown\", onKey));\n });\n\n protected readonly childContext = computed(() => {\n const args: ChildArgs = { open: this.open() };\n return { $implicit: args, ...args };\n });\n\n protected idOf(link: LinkItem): string {\n return linkId(link);\n }\n\n /** Every focusable link in the list, in DOM order. */\n private items(): HTMLElement[] {\n return Array.from(\n this.listRef().nativeElement.querySelectorAll<HTMLElement>(\".link-picker-link\"),\n );\n }\n\n // ---------------------------------------------------------------\n // Open / close\n // ---------------------------------------------------------------\n\n /** Open the list, focusing the first link (or the last, if `focusLast`). */\n openList(focusLast = false): void {\n this.open.set(true);\n // After the next render, so the list's `hidden` attribute is gone: a hidden link cannot take\n // focus (a microtask ran before Angular rendered, and the focus silently went nowhere).\n afterNextRender(\n () => {\n const all = this.items();\n (focusLast ? all[all.length - 1] : all[0])?.focus({ preventScroll: true });\n },\n { injector: this.injector },\n );\n }\n\n /** Close the list; `refocus` returns focus to the trigger. */\n closeList(refocus = true): void {\n if (!this.open()) return;\n this.open.set(false);\n if (refocus) queueMicrotask(() => this.buttonRef().focus({ preventScroll: true }));\n }\n\n protected onButtonClick(): void {\n if (this.open()) this.closeList();\n else this.openList();\n }\n\n protected onLinkClick(event: MouseEvent, link: LinkItem): void {\n this.navigated.emit({ id: linkId(link), href: link.href });\n const go = this.navigate();\n const modified =\n event.ctrlKey || event.metaKey || event.shiftKey || event.altKey || event.button !== 0;\n if (go && !link.newTab && !modified && !event.defaultPrevented) {\n event.preventDefault();\n go(link.href);\n }\n this.closeList();\n }\n\n // ---------------------------------------------------------------\n // Keyboard\n // ---------------------------------------------------------------\n\n protected onButtonKeydown(event: KeyboardEvent): void {\n // Enter and Space already produce a click; only the arrows need handling here.\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (!this.open()) this.openList();\n else this.items()[0]?.focus({ preventScroll: true });\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!this.open()) this.openList(true);\n else {\n const all = this.items();\n all[all.length - 1]?.focus({ preventScroll: true });\n }\n }\n }\n\n private moveFocus(delta: number): void {\n const all = this.items();\n if (all.length === 0) return;\n const i = all.indexOf(document.activeElement as HTMLElement);\n // Clamp rather than wrap.\n const next = Math.min(Math.max((i < 0 ? 0 : i) + delta, 0), all.length - 1);\n all[next]?.focus({ preventScroll: true });\n }\n\n protected onListKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n this.moveFocus(1);\n break;\n case \"ArrowUp\":\n event.preventDefault();\n this.moveFocus(-1);\n break;\n case \"Home\":\n event.preventDefault();\n this.items()[0]?.focus({ preventScroll: true });\n break;\n case \"End\": {\n event.preventDefault();\n const all = this.items();\n all[all.length - 1]?.focus({ preventScroll: true });\n break;\n }\n case \"Escape\":\n event.preventDefault();\n this.closeList();\n break;\n case \"Tab\":\n // Focus goes to the button FIRST, without cancelling the key: hiding the list while a\n // link has focus drops focus to <body>, and the default Tab would restart from the top.\n this.buttonRef().focus?.({ preventScroll: true });\n this.closeList(false);\n break;\n default:\n break;\n }\n }\n\n protected onRootFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.rootRef().nativeElement.contains(next)) return;\n this.closeList(false);\n }\n\n protected onDocumentClick(event: Event): void {\n if (!this.open()) return;\n const t = event.target as Node | null;\n if (t && !this.rootRef().nativeElement.contains(t)) this.closeList(false);\n }\n}\n"],"mappings":";;;;AAwDA,SAAgB,OAAO,MAAc;CACnC,OAAO,KAAK,MAAM,KAAK;AACzB;AAE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KAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAGT,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAGG,YAAU,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAEnB,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lilydesignsystem/angular-link-picker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": "=26"
|
|
6
6
|
},
|
|
7
7
|
"description": "Lily Design System Angular link picker: an icon button (a home icon) opening a disclosure of app-defined page links. Headless, SSR-safe, no CSS.",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@lilydesignsystem/angular-headless": "^0.
|
|
9
|
+
"@lilydesignsystem/angular-headless": "^0.5.0",
|
|
10
|
+
"tslib": "^2.3.0"
|
|
10
11
|
},
|
|
11
12
|
"peerDependencies": {
|
|
12
|
-
"@angular/
|
|
13
|
-
"@angular/
|
|
13
|
+
"@angular/common": ">=20.0.0 <23.0.0",
|
|
14
|
+
"@angular/core": ">=20.0.0 <23.0.0"
|
|
14
15
|
},
|
|
15
16
|
"sideEffects": false,
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "cd .. && pnpm build",
|
|
18
|
-
"prepublishOnly": "cd .. && pnpm build"
|
|
19
|
-
},
|
|
20
17
|
"keywords": [
|
|
21
18
|
"lily",
|
|
22
19
|
"design",
|
|
@@ -31,11 +28,23 @@
|
|
|
31
28
|
"license": "MIT OR Apache-2.0 OR GPL-2.0-only OR GPL-3.0-only OR BSD-3-Clause",
|
|
32
29
|
"repository": {
|
|
33
30
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/LilyDesignSystem/lily-design-system
|
|
31
|
+
"url": "git+https://github.com/LilyDesignSystem/lily-design-system.git",
|
|
35
32
|
"directory": "lily-design-system-angular-link-picker"
|
|
36
33
|
},
|
|
37
34
|
"homepage": "https://lilydesignsystem.com/",
|
|
38
35
|
"bugs": {
|
|
39
36
|
"url": "https://github.com/LilyDesignSystem/lily-design-system/issues"
|
|
40
|
-
}
|
|
41
|
-
|
|
37
|
+
},
|
|
38
|
+
"module": "fesm2022/lilydesignsystem-angular-link-picker.mjs",
|
|
39
|
+
"typings": "types/lilydesignsystem-angular-link-picker.d.ts",
|
|
40
|
+
"exports": {
|
|
41
|
+
"./package.json": {
|
|
42
|
+
"default": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./types/lilydesignsystem-angular-link-picker.d.ts",
|
|
46
|
+
"default": "./fesm2022/lilydesignsystem-angular-link-picker.mjs"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"type": "module"
|
|
50
|
+
}
|
|
@@ -56,39 +56,44 @@ export declare class LinkPickerIcon {
|
|
|
56
56
|
*/
|
|
57
57
|
export declare class LinkPicker {
|
|
58
58
|
/** Accessible name for the button and the list. */
|
|
59
|
-
readonly label: import("@angular/core").InputSignal<string>;
|
|
59
|
+
readonly label: import("@angular/core/types/core").InputSignal<string>;
|
|
60
60
|
/** The page links to offer. Defined by the app. */
|
|
61
|
-
readonly links: import("@angular/core").InputSignal<LinkItem[]>;
|
|
61
|
+
readonly links: import("@angular/core/types/core").InputSignal<LinkItem[]>;
|
|
62
62
|
/**
|
|
63
63
|
* Client-side navigation hook, e.g. a router's `navigateByUrl`. When given, a plain left click
|
|
64
64
|
* on a link calls `navigate(href)` instead of letting the browser load the page; modified
|
|
65
65
|
* clicks (Ctrl/Cmd/Shift/Alt, middle button) and `newTab` links stay native.
|
|
66
66
|
*/
|
|
67
|
-
readonly navigate: import("@angular/core").InputSignal<((href: string) => void) | undefined>;
|
|
67
|
+
readonly navigate: import("@angular/core/types/core").InputSignal<((href: string) => void) | undefined>;
|
|
68
68
|
/** Extra CSS class on the root div. */
|
|
69
|
-
readonly className: import("@angular/core").InputSignal<string>;
|
|
69
|
+
readonly className: import("@angular/core/types/core").InputSignal<string>;
|
|
70
70
|
/** Fires after a link is chosen. */
|
|
71
|
-
readonly navigated: import("@angular/core").OutputEmitterRef<LinkNavigatedEvent>;
|
|
71
|
+
readonly navigated: import("@angular/core/types/_api-chunk").OutputEmitterRef<LinkNavigatedEvent>;
|
|
72
72
|
/** Projected icon template; replaces the default icon when supplied. */
|
|
73
|
-
protected readonly iconTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
73
|
+
protected readonly iconTemplate: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<TemplateRef<any> | undefined>;
|
|
74
74
|
private readonly rootRef;
|
|
75
75
|
private readonly buttonRef;
|
|
76
76
|
private readonly listRef;
|
|
77
77
|
private readonly baseId;
|
|
78
78
|
protected readonly listId: string;
|
|
79
|
-
|
|
79
|
+
/** Is the popup open? Two-way bindable: `[(open)]`; `openChange` fires for each change. */
|
|
80
|
+
readonly open: import("@angular/core/types/core").ModelSignal<boolean>;
|
|
81
|
+
/** Disables the button; an open popup closes. */
|
|
82
|
+
readonly disabled: import("@angular/core/types/core").InputSignal<boolean>;
|
|
83
|
+
private readonly closeWhenDisabled;
|
|
84
|
+
private readonly injector;
|
|
80
85
|
protected readonly tooltipId: string;
|
|
81
|
-
protected readonly hoverButton: import("@angular/core").WritableSignal<boolean>;
|
|
82
|
-
protected readonly hoverTooltip: import("@angular/core").WritableSignal<boolean>;
|
|
83
|
-
protected readonly focusButton: import("@angular/core").WritableSignal<boolean>;
|
|
84
|
-
protected readonly dismissed: import("@angular/core").WritableSignal<boolean>;
|
|
85
|
-
protected readonly tooltipVisible: import("@angular/core").Signal<boolean>;
|
|
86
|
+
protected readonly hoverButton: import("@angular/core/types/_chrome_dev_tools_performance-chunk").WritableSignal<boolean>;
|
|
87
|
+
protected readonly hoverTooltip: import("@angular/core/types/_chrome_dev_tools_performance-chunk").WritableSignal<boolean>;
|
|
88
|
+
protected readonly focusButton: import("@angular/core/types/_chrome_dev_tools_performance-chunk").WritableSignal<boolean>;
|
|
89
|
+
protected readonly dismissed: import("@angular/core/types/_chrome_dev_tools_performance-chunk").WritableSignal<boolean>;
|
|
90
|
+
protected readonly tooltipVisible: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<boolean>;
|
|
86
91
|
protected onTooltipButtonEnter(): void;
|
|
87
92
|
protected onTooltipButtonFocusIn(): void;
|
|
88
93
|
protected onTooltipButtonFocusOut(): void;
|
|
89
94
|
protected onTooltipKeydown(event: KeyboardEvent): void;
|
|
90
95
|
private readonly tooltipEscapeListener;
|
|
91
|
-
protected readonly childContext: import("@angular/core").Signal<{
|
|
96
|
+
protected readonly childContext: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<{
|
|
92
97
|
/** Is the list open? */
|
|
93
98
|
open: boolean;
|
|
94
99
|
$implicit: ChildArgs;
|
|
@@ -129,8 +134,19 @@ export declare class LinkPicker {
|
|
|
129
134
|
"required": false;
|
|
130
135
|
"isSignal": true;
|
|
131
136
|
};
|
|
137
|
+
"open": {
|
|
138
|
+
"alias": "open";
|
|
139
|
+
"required": false;
|
|
140
|
+
"isSignal": true;
|
|
141
|
+
};
|
|
142
|
+
"disabled": {
|
|
143
|
+
"alias": "disabled";
|
|
144
|
+
"required": false;
|
|
145
|
+
"isSignal": true;
|
|
146
|
+
};
|
|
132
147
|
}, {
|
|
133
148
|
"navigated": "navigated";
|
|
149
|
+
"open": "openChange";
|
|
134
150
|
}, ["iconTemplate"], never, true, never>;
|
|
135
151
|
}
|
|
136
152
|
export type { ChildArgs, LinkItem, LinkNavigatedEvent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lilydesignsystem-angular-link-picker.d.ts","names":[],"sources":["../../link-picker.component.ts"],"mappings":";;;;;;KA4BY;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;;KAIU;;EAEV;;;KAIU;;EAEV;;EAEA;;;wBAIc,OAAO,MAAM;;wBAMb;;;;;;;;;;qBAkBH;SACJ,uBACL,MAAM,gBACN,gBACC,QAAQ;IAAc,WAAW;;SAJzB,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;;;;;;;;qBA4GA;;WAEF,0CAAK;;WAEL,0CAAK,YAAA;;;;;;WAML,6CAAQ,cAAA;;WAER,8CAAS;;WAGT,oDAAS,iBAAA;;qBAGC,gFAAY,OAAA;mBAEd;mBAIA;mBACA;mBAGA;qBACE;;WAGV,yCAAI;;WAEJ,6CAAQ;mBACA;mBAGA;qBAKE;qBACA,+EAAW;qBACX,gFAAY;qBACZ,+EAAW;qBACX,6EAAS;qBACT,kFAAc;YAOvB;YAKA;YAYA;YAKA,iBAAiB,OAAO;mBAMjB;qBASE,gFAAY;;IA5OzB;;;YAiPI,KAAK,MAAM;;UAKb;;EAWR,SAAS;;EAcT,UAAU;YAMA;YAKA,YAAY,OAAO,YAAY,MAAM;YAgBrC,gBAAgB,OAAO;UAgBzB;YASE,cAAc,OAAO;YAmCrB,eAAe,OAAO;YAMtB,gBAAgB,OAAO;SA5NtB,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAU;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA;IAAA"}
|
package/AGENTS.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# AGENTS — LinkPicker (Angular)
|
|
2
|
-
|
|
3
|
-
Single source of truth: [spec/index.md](./spec/index.md); the contract is the Svelte package's, ported.
|
|
4
|
-
|
|
5
|
-
## What this package is
|
|
6
|
-
|
|
7
|
-
A headless Angular `>=20 <23` page-links control: a single-icon button (a bundled home SVG) opening a disclosure list of page links the
|
|
8
|
-
**app defines**. No CSS, no routes, no English.
|
|
9
|
-
|
|
10
|
-
## Files
|
|
11
|
-
|
|
12
|
-
| File | Purpose |
|
|
13
|
-
| ---- | ------- |
|
|
14
|
-
| `link-picker.component.ts` | Implementation. |
|
|
15
|
-
| `link-picker.component.spec.ts` | 24 tests mapped to the spec §7 clauses. |
|
|
16
|
-
| `spec/index.md` | Contract and this port's differences. |
|
|
17
|
-
| `index.md` | Guide. |
|
|
18
|
-
| `docs/accessibility.md` | Trade-offs, stated plainly. |
|
|
19
|
-
| `examples/` | Home / About Us / Contact Us / Privacy Policy, router integration, custom icon. |
|
|
20
|
-
|
|
21
|
-
## Surface
|
|
22
|
-
|
|
23
|
-
`LinkPicker`, `LinkPickerIcon`, `linkId`, `nextLinkPickerId`, types `ChildArgs`, `LinkItem`, `LinkNavigatedEvent`.
|
|
24
|
-
|
|
25
|
-
## HTML
|
|
26
|
-
|
|
27
|
-
`div.link-picker` → `button.link-picker-button` (aria-hidden SVG `link-picker-icon`) → `div.link-picker-tooltip[role=tooltip]` →
|
|
28
|
-
`ul.link-picker-list[hidden]` of `li.link-picker-list-item > a.link-picker-link`. Not a menu: real `<a href>`;
|
|
29
|
-
`aria-current="page"` where marked.
|
package/CHANGELOG.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Changelog — LinkPicker (Angular)
|
|
2
|
-
|
|
3
|
-
The format is loosely based on [Keep a Changelog](https://keepachangelog.com/); the project follows [Semantic Versioning](https://semver.org/).
|
|
4
|
-
|
|
5
|
-
## 0.1.0 — 2026-10-07
|
|
6
|
-
|
|
7
|
-
**First release.** A home-icon button opening a disclosure of app-defined page links. Real `<a>` links (not a menu), `aria-current="page"`,
|
|
8
|
-
hover/keyboard-focus tooltip, full keyboard support, no default links and no English. 24 tests, one per spec clause.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lilydesignsystem-angular-link-picker.mjs","names":[],"sources":["../../link-picker.component.ts"],"sourcesContent":["import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n Directive,\n ElementRef,\n TemplateRef,\n computed,\n contentChild,\n effect,\n input,\n output,\n signal,\n viewChild,\n} from \"@angular/core\";\n// Only the trigger button composes a headless primitive. The list below is real `<a>` navigation\n// with a roving-focus pattern of its own — not an ARIA listbox or menu: role=\"menuitem\" would strip\n// middle-click, open-in-new-tab and copy-link-address from ordinary links. See spec/index.md §3.\nimport { IconButton } from \"@lilydesignsystem/angular-headless\";\n\n/**\n * One destination in the list. The app defines them all: this package ships no routes and no\n * English — `label` is the consumer's text.\n */\nexport type LinkItem = {\n /** Stable identifier, passed back on the `navigated` output. Defaults to `href`. */\n id?: string;\n /** Visible link text. Consumer-supplied, so it localises. */\n label: string;\n /** Where the link goes: a route (\"/about/\") or a full URL. */\n href: string;\n /** Marks this link as the current page (`aria-current=\"page\"`). */\n current?: boolean;\n /** Open in a new tab (`target=\"_blank\"` with `rel=\"noopener noreferrer\"`). */\n newTab?: boolean;\n};\n\n/** Context passed to a custom icon `<ng-template>` (the button icon). */\nexport type ChildArgs = {\n /** Is the list open? */\n open: boolean;\n};\n\n/** Payload of the `navigated` output. */\nexport type LinkNavigatedEvent = {\n /** The chosen link's `id` (its `href` when it has none). */\n id: string;\n /** The chosen link's `href`. */\n href: string;\n};\n\n/** The id a link reports: its explicit `id`, else its `href`. */\nexport function linkId(link: LinkItem): string {\n return link.id ?? link.href;\n}\n\nlet uid = 0;\n/** Stable per-instance id prefix; SSR-safe (no Math.random / Date.now). */\nexport function nextLinkPickerId(): string {\n uid += 1;\n return `link-picker-${uid}`;\n}\n\n/**\n * Optional marker for the projected icon template. Gives consumers typed `let-` variables:\n *\n * ```html\n * <lily-link-picker label=\"Pages\" [links]=\"links\">\n * <ng-template lilyLinkPickerIcon let-args>{{ args.open ? \"×\" : \"☰\" }}</ng-template>\n * </lily-link-picker>\n * ```\n */\n@Directive({\n selector: \"ng-template[lilyLinkPickerIcon]\",\n standalone: true,\n})\nexport class LinkPickerIcon {\n static ngTemplateContextGuard(\n _dir: LinkPickerIcon,\n _ctx: unknown,\n ): _ctx is ChildArgs & { $implicit: ChildArgs } {\n return true;\n }\n}\n\n/**\n * LinkPicker — a headless page-links control.\n *\n * A single-icon button (a bundled home SVG) that opens a disclosure list of page links the app\n * defines. It applies nothing to the document and persists nothing. See `spec/index.md`.\n */\n@Component({\n selector: \"lily-link-picker\",\n standalone: true,\n imports: [NgTemplateOutlet, IconButton],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n \"(document:click)\": \"onDocumentClick($event)\",\n },\n template: `\n <div\n #rootEl\n class=\"link-picker {{ className() }}\"\n (focusout)=\"onRootFocusOut($event)\"\n >\n <lily-icon-button\n #buttonEl\n [label]=\"label()\"\n baseClass=\"link-picker-button\"\n [ariaExpanded]=\"open()\"\n [ariaControls]=\"listId\"\n (click)=\"onButtonClick(); hoverButton.set(false)\"\n (mouseenter)=\"onTooltipButtonEnter()\"\n (mouseleave)=\"hoverButton.set(false)\"\n (focusin)=\"onTooltipButtonFocusIn()\"\n (focusout)=\"onTooltipButtonFocusOut()\"\n (keydown)=\"onButtonKeydown($event); onTooltipKeydown($event)\"\n >\n @if (iconTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"childContext()\"\n />\n } @else {\n <svg\n class=\"link-picker-icon\"\n viewBox=\"0 0 16 16\"\n width=\"1.05rem\"\n height=\"1.05rem\"\n aria-hidden=\"true\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.6\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M1 8 8 1.5l7 6.5\" />\n <path d=\"M2.5 7v7.5h11V7\" />\n <path d=\"M6.5 14.5v-4h3v4\" />\n </svg>\n }\n </lily-icon-button>\n\n <!-- Purely visual: the same text is already the button's aria-label, so it is not wired\n with aria-describedby (that would announce the name twice). -->\n <div\n class=\"link-picker-tooltip\"\n role=\"tooltip\"\n [id]=\"tooltipId\"\n [attr.hidden]=\"tooltipVisible() ? null : ''\"\n (mouseenter)=\"hoverTooltip.set(true)\"\n (mouseleave)=\"hoverTooltip.set(false)\"\n >{{ label() }}</div>\n\n <!-- Named like the sibling pickers' popups: a screen reader entering the list hears what\n it is for. -->\n <ul\n #listEl\n class=\"link-picker-list\"\n [id]=\"listId\"\n [attr.aria-label]=\"label() || null\"\n [attr.hidden]=\"open() ? null : ''\"\n (keydown)=\"onListKeydown($event)\"\n >\n @for (link of links(); track idOf(link)) {\n <li class=\"link-picker-list-item\">\n <!-- A real link, not role=\"menuitem\": these ARE navigation. -->\n <a\n class=\"link-picker-link\"\n [attr.data-link-id]=\"idOf(link)\"\n [attr.href]=\"link.href\"\n [attr.aria-current]=\"link.current ? 'page' : null\"\n [attr.target]=\"link.newTab ? '_blank' : null\"\n [attr.rel]=\"link.newTab ? 'noopener noreferrer' : null\"\n (click)=\"onLinkClick($event, link)\"\n >{{ link.label }}</a\n >\n </li>\n }\n </ul>\n </div>\n `,\n})\nexport class LinkPicker {\n /** Accessible name for the button and the list. */\n readonly label = input.required<string>();\n /** The page links to offer. Defined by the app. */\n readonly links = input.required<LinkItem[]>();\n /**\n * Client-side navigation hook, e.g. a router's `navigateByUrl`. When given, a plain left click\n * on a link calls `navigate(href)` instead of letting the browser load the page; modified\n * clicks (Ctrl/Cmd/Shift/Alt, middle button) and `newTab` links stay native.\n */\n readonly navigate = input<((href: string) => void) | undefined>(undefined);\n /** Extra CSS class on the root div. */\n readonly className = input<string>(\"\");\n\n /** Fires after a link is chosen. */\n readonly navigated = output<LinkNavigatedEvent>();\n\n /** Projected icon template; replaces the default icon when supplied. */\n protected readonly iconTemplate = contentChild(TemplateRef);\n\n private readonly rootRef =\n viewChild.required<ElementRef<HTMLDivElement>>(\"rootEl\");\n // A template-ref-variable on a component tag resolves to the component INSTANCE, which is what\n // is needed to call the headless component's own public `focus()` method.\n private readonly buttonRef = viewChild.required<IconButton>(\"buttonEl\");\n private readonly listRef =\n viewChild.required<ElementRef<HTMLUListElement>>(\"listEl\");\n\n private readonly baseId = nextLinkPickerId();\n protected readonly listId = `${this.baseId}-list`;\n\n protected readonly open = signal(false);\n\n // Tooltip: shown while the pointer is over the button or the tooltip itself (hoverable, WCAG\n // 1.4.13) or while the button has keyboard focus; Escape dismisses it without moving focus;\n // never shown while the popup is open, since the popup then explains the control.\n protected readonly tooltipId = `${this.baseId}-tooltip`;\n protected readonly hoverButton = signal(false);\n protected readonly hoverTooltip = signal(false);\n protected readonly focusButton = signal(false);\n protected readonly dismissed = signal(false);\n protected readonly tooltipVisible = computed(\n () =>\n !this.open() &&\n !this.dismissed() &&\n (this.hoverButton() || this.hoverTooltip() || this.focusButton()),\n );\n\n protected onTooltipButtonEnter(): void {\n this.hoverButton.set(true);\n this.dismissed.set(false);\n }\n\n protected onTooltipButtonFocusIn(): void {\n // Keyboard focus only: a mouse click also focuses the button in Chromium, and the tooltip\n // should not stick after a click.\n try {\n this.focusButton.set(\n this.buttonRef().element?.matches(\":focus-visible\") ?? false,\n );\n } catch {\n this.focusButton.set(true); // engine without :focus-visible — err towards showing\n }\n }\n\n protected onTooltipButtonFocusOut(): void {\n this.focusButton.set(false);\n this.dismissed.set(false);\n }\n\n protected onTooltipKeydown(event: KeyboardEvent): void {\n if (event.key === \"Escape\" && this.tooltipVisible()) this.dismissed.set(true);\n }\n\n // WCAG 1.4.13 \"dismissable\": while the tooltip is visible, Escape works wherever focus is. The\n // listener exists only while visible; the effect cleanup removes it on hide and on destroy.\n private readonly tooltipEscapeListener = effect((onCleanup) => {\n if (!this.tooltipVisible() || typeof document === \"undefined\") return;\n const onKey = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\") this.dismissed.set(true);\n };\n document.addEventListener(\"keydown\", onKey);\n onCleanup(() => document.removeEventListener(\"keydown\", onKey));\n });\n\n protected readonly childContext = computed(() => {\n const args: ChildArgs = { open: this.open() };\n return { $implicit: args, ...args };\n });\n\n protected idOf(link: LinkItem): string {\n return linkId(link);\n }\n\n /** Every focusable link in the list, in DOM order. */\n private items(): HTMLElement[] {\n return Array.from(\n this.listRef().nativeElement.querySelectorAll<HTMLElement>(\".link-picker-link\"),\n );\n }\n\n // ---------------------------------------------------------------\n // Open / close\n // ---------------------------------------------------------------\n\n /** Open the list, focusing the first link (or the last, if `focusLast`). */\n openList(focusLast = false): void {\n this.open.set(true);\n // Deferred so the `hidden` attribute is gone before focus is moved.\n queueMicrotask(() => {\n const all = this.items();\n (focusLast ? all[all.length - 1] : all[0])?.focus({ preventScroll: true });\n });\n }\n\n /** Close the list; `refocus` returns focus to the trigger. */\n closeList(refocus = true): void {\n if (!this.open()) return;\n this.open.set(false);\n if (refocus) queueMicrotask(() => this.buttonRef().focus({ preventScroll: true }));\n }\n\n protected onButtonClick(): void {\n if (this.open()) this.closeList();\n else this.openList();\n }\n\n protected onLinkClick(event: MouseEvent, link: LinkItem): void {\n this.navigated.emit({ id: linkId(link), href: link.href });\n const go = this.navigate();\n const modified =\n event.ctrlKey || event.metaKey || event.shiftKey || event.altKey || event.button !== 0;\n if (go && !link.newTab && !modified && !event.defaultPrevented) {\n event.preventDefault();\n go(link.href);\n }\n this.closeList();\n }\n\n // ---------------------------------------------------------------\n // Keyboard\n // ---------------------------------------------------------------\n\n protected onButtonKeydown(event: KeyboardEvent): void {\n // Enter and Space already produce a click; only the arrows need handling here.\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (!this.open()) this.openList();\n else this.items()[0]?.focus({ preventScroll: true });\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!this.open()) this.openList(true);\n else {\n const all = this.items();\n all[all.length - 1]?.focus({ preventScroll: true });\n }\n }\n }\n\n private moveFocus(delta: number): void {\n const all = this.items();\n if (all.length === 0) return;\n const i = all.indexOf(document.activeElement as HTMLElement);\n // Clamp rather than wrap.\n const next = Math.min(Math.max((i < 0 ? 0 : i) + delta, 0), all.length - 1);\n all[next]?.focus({ preventScroll: true });\n }\n\n protected onListKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n this.moveFocus(1);\n break;\n case \"ArrowUp\":\n event.preventDefault();\n this.moveFocus(-1);\n break;\n case \"Home\":\n event.preventDefault();\n this.items()[0]?.focus({ preventScroll: true });\n break;\n case \"End\": {\n event.preventDefault();\n const all = this.items();\n all[all.length - 1]?.focus({ preventScroll: true });\n break;\n }\n case \"Escape\":\n event.preventDefault();\n this.closeList();\n break;\n case \"Tab\":\n // Focus goes to the button FIRST, without cancelling the key: hiding the list while a\n // link has focus drops focus to <body>, and the default Tab would restart from the top.\n this.buttonRef().focus?.({ preventScroll: true });\n this.closeList(false);\n break;\n default:\n break;\n }\n }\n\n protected onRootFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.rootRef().nativeElement.contains(next)) return;\n this.closeList(false);\n }\n\n protected onDocumentClick(event: Event): void {\n if (!this.open()) return;\n const t = event.target as Node | null;\n if (t && !this.rootRef().nativeElement.contains(t)) this.closeList(false);\n }\n}\n"],"mappings":";;;;AAoDA,SAAgB,OAAO,MAAc;CACnC,OAAO,KAAK,MAAM,KAAK;AACzB;AAEA,IAAI,MAAM;AAEV,SAAgB,mBAAgB;CAC9B,OAAO;CACP,OAAO,eAAe;AACxB;AAeA,IAAa,iBAAb,MAAa,eAAc;CACzB,OAAO,uBACL,MACA,MAAa;EAEb,OAAO;C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A,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,WAAW,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAGT,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAGG,YAAU,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAEnB,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
package/dist/package.json
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lilydesignsystem/angular-link-picker",
|
|
3
|
-
"version": "0.1.1",
|
|
4
|
-
"engines": {
|
|
5
|
-
"node": "=26"
|
|
6
|
-
},
|
|
7
|
-
"description": "Lily Design System Angular link picker: an icon button (a home icon) opening a disclosure of app-defined page links. Headless, SSR-safe, no CSS.",
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"@lilydesignsystem/angular-headless": "^0.2.0",
|
|
10
|
-
"tslib": "^2.3.0"
|
|
11
|
-
},
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
"@angular/core": ">=20.0.0 <23.0.0",
|
|
14
|
-
"@angular/common": ">=20.0.0 <23.0.0"
|
|
15
|
-
},
|
|
16
|
-
"sideEffects": false,
|
|
17
|
-
"keywords": [
|
|
18
|
-
"lily",
|
|
19
|
-
"design",
|
|
20
|
-
"system",
|
|
21
|
-
"angular",
|
|
22
|
-
"link",
|
|
23
|
-
"navigation",
|
|
24
|
-
"home",
|
|
25
|
-
"picker"
|
|
26
|
-
],
|
|
27
|
-
"author": "Joel Parker Henderson <joel@joelparkerhenderson.com>",
|
|
28
|
-
"license": "MIT OR Apache-2.0 OR GPL-2.0-only OR GPL-3.0-only OR BSD-3-Clause",
|
|
29
|
-
"repository": {
|
|
30
|
-
"type": "git",
|
|
31
|
-
"url": "git+https://github.com/LilyDesignSystem/lily-design-system-angular-helpers.git",
|
|
32
|
-
"directory": "lily-design-system-angular-link-picker"
|
|
33
|
-
},
|
|
34
|
-
"homepage": "https://lilydesignsystem.com/",
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/LilyDesignSystem/lily-design-system/issues"
|
|
37
|
-
},
|
|
38
|
-
"module": "fesm2022/lilydesignsystem-angular-link-picker.mjs",
|
|
39
|
-
"typings": "types/lilydesignsystem-angular-link-picker.d.ts",
|
|
40
|
-
"exports": {
|
|
41
|
-
"./package.json": {
|
|
42
|
-
"default": "./package.json"
|
|
43
|
-
},
|
|
44
|
-
".": {
|
|
45
|
-
"types": "./types/lilydesignsystem-angular-link-picker.d.ts",
|
|
46
|
-
"default": "./fesm2022/lilydesignsystem-angular-link-picker.mjs"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"type": "module"
|
|
50
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lilydesignsystem-angular-link-picker.d.ts","names":[],"sources":["../../link-picker.component.ts"],"mappings":";;;;;;KAwBY;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;;KAIU;;EAEV;;;KAIU;;EAEV;;EAEA;;;wBAIc,OAAO,MAAM;;wBAMb;;;;;;;;;;qBAkBH;SACJ,uBACL,MAAM,gBACN,gBACC,QAAQ;IAAc,WAAW;;SAJzB,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;;;;;;;;qBA2GA;;WAEF,+BAAK;;WAEL,+BAAK,YAAA;;;;;;WAML,kCAAQ,cAAA;;WAER,mCAAS;;WAGT,mCAAS,iBAAA;;qBAGC,sCAAY,OAAA;mBAEd;mBAIA;mBACA;mBAGA;qBACE;qBAEA,8BAAI;qBAKJ;qBACA,qCAAW;qBACX,sCAAY;qBACZ,qCAAW;qBACX,mCAAS;qBACT,wCAAc;YAOvB;YAKA;YAYA;YAKA,iBAAiB,OAAO;mBAMjB;qBASE,sCAAY;;IApOzB;;;YAyOI,KAAK,MAAM;;UAKb;;EAWR,SAAS;;EAUT,UAAU;YAMA;YAKA,YAAY,OAAO,YAAY,MAAM;YAgBrC,gBAAgB,OAAO;UAgBzB;YASE,cAAc,OAAO;YAmCrB,eAAe,OAAO;YAMtB,gBAAgB,OAAO;SAjNtB,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,uBAAA;IAAU;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;IAAA;MAAA;MAAA;MAAA;;;IAAA"}
|
package/docs/accessibility.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Accessibility
|
|
2
|
-
|
|
3
|
-
WCAG 2.2 AAA is the target. This document states what the control does well and what it costs.
|
|
4
|
-
|
|
5
|
-
## What it does
|
|
6
|
-
|
|
7
|
-
- The icon is `aria-hidden="true"`; the accessible name is the consumer-supplied `label`, so it localises with your copy.
|
|
8
|
-
- `aria-expanded` on the trigger reflects the list state, and `aria-controls` points at it. The list is named with the same
|
|
9
|
-
`label`.
|
|
10
|
-
- The links keep **native link semantics**: real `<a href>` elements with no `role` override, so middle-click,
|
|
11
|
-
open-in-new-tab and copy-link-address all work. A `role="menuitem"` implementation would take all three away.
|
|
12
|
-
- The current page's link carries `aria-current="page"` when you mark it `current`.
|
|
13
|
-
- Keyboard: `Enter`/`Space` toggle, `ArrowDown`/`ArrowUp` open and move between links (clamping, not wrapping), `Home`/`End`
|
|
14
|
-
jump, `Escape` closes and returns focus to the trigger, `Tab` closes — focus lands on the button first so the default Tab
|
|
15
|
-
proceeds from the picker's position instead of restarting from `<body>`.
|
|
16
|
-
- Opening focuses a link without scrolling the page.
|
|
17
|
-
- The tooltip is hoverable and dismissable (WCAG 1.4.13): visible on pointer hover or keyboard focus, `Escape` hides it
|
|
18
|
-
wherever focus is, and it is never shown while the list is open.
|
|
19
|
-
|
|
20
|
-
## What it costs
|
|
21
|
-
|
|
22
|
-
**The name rests entirely on `label`.** An icon-only control has no visible text fallback. A home icon is widely understood,
|
|
23
|
-
but if `label` is wrong, missing or untranslated there is nothing else to go on. Choose a label that says what the list is
|
|
24
|
-
("Pages", "Site"), not what the icon is.
|
|
25
|
-
|
|
26
|
-
**It hides navigation behind a click.** For a handful of links in a header that is the point; for primary site navigation,
|
|
27
|
-
use a visible `nav` instead (see `BreadcrumbNav`, `SectionNav`).
|
|
28
|
-
|
|
29
|
-
**Focus management is real focus**, not `aria-activedescendant`, so screen readers announce each link as it receives focus.
|
package/examples/README.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Examples — LinkPicker (Angular)
|
|
2
|
-
|
|
3
|
-
| File | Shows |
|
|
4
|
-
| ---- | ----- |
|
|
5
|
-
| [basic.component.ts](./basic.component.ts) | Basic usage |
|
|
6
|
-
| [router.component.ts](./router.component.ts) | Angular Router: client-side navigation and the current page |
|
|
7
|
-
| [custom-icon.component.ts](./custom-icon.component.ts) | Replacing the icon |
|
|
8
|
-
|
|
9
|
-
Every user-facing string and every route is a prop — the package ships no default list.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Component } from "@angular/core";
|
|
2
|
-
import { LinkPicker, type LinkItem } from "../link-picker.component";
|
|
3
|
-
|
|
4
|
-
// The app defines the links: the package ships no routes and no English.
|
|
5
|
-
@Component({
|
|
6
|
-
selector: "example-basic",
|
|
7
|
-
standalone: true,
|
|
8
|
-
imports: [LinkPicker],
|
|
9
|
-
template: `<lily-link-picker label="Pages" [links]="links" />`,
|
|
10
|
-
})
|
|
11
|
-
export class Basic {
|
|
12
|
-
links: LinkItem[] = [
|
|
13
|
-
{ label: "Home", href: "/" },
|
|
14
|
-
{ label: "About Us", href: "/about/" },
|
|
15
|
-
{ label: "Contact Us", href: "/contact/" },
|
|
16
|
-
{ label: "Privacy Policy", href: "/privacy/" },
|
|
17
|
-
];
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Component } from "@angular/core";
|
|
2
|
-
import { LinkPicker, LinkPickerIcon } from "../link-picker.component";
|
|
3
|
-
|
|
4
|
-
// A projected <ng-template lilyLinkPickerIcon> replaces the icon inside the button, never the links.
|
|
5
|
-
@Component({
|
|
6
|
-
selector: "example-custom-icon",
|
|
7
|
-
standalone: true,
|
|
8
|
-
imports: [LinkPicker, LinkPickerIcon],
|
|
9
|
-
template: `
|
|
10
|
-
<lily-link-picker label="Pages" [links]="links">
|
|
11
|
-
<ng-template lilyLinkPickerIcon let-args><span aria-hidden="true">{{ args.open ? "▾" : "☰" }}</span></ng-template>
|
|
12
|
-
</lily-link-picker>
|
|
13
|
-
`,
|
|
14
|
-
})
|
|
15
|
-
export class CustomIcon {
|
|
16
|
-
links = [
|
|
17
|
-
{ label: "Home", href: "/" },
|
|
18
|
-
{ label: "About Us", href: "/about/" },
|
|
19
|
-
{ label: "Contact Us", href: "/contact/" },
|
|
20
|
-
{ label: "Privacy Policy", href: "/privacy/" },
|
|
21
|
-
];
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Component, inject } from "@angular/core";
|
|
2
|
-
import { Router } from "@angular/router";
|
|
3
|
-
import { LinkPicker } from "../link-picker.component";
|
|
4
|
-
|
|
5
|
-
// `navigate` turns a plain left click into router navigation; Ctrl/Cmd-click, middle click and
|
|
6
|
-
// newTab links stay native. `current` marks the page you are on with aria-current="page".
|
|
7
|
-
@Component({
|
|
8
|
-
selector: "example-router",
|
|
9
|
-
standalone: true,
|
|
10
|
-
imports: [LinkPicker],
|
|
11
|
-
template: `<lily-link-picker label="Pages" [links]="links()" [navigate]="go" />`,
|
|
12
|
-
})
|
|
13
|
-
export class RouterExample {
|
|
14
|
-
private router = inject(Router);
|
|
15
|
-
go = (href: string) => void this.router.navigateByUrl(href);
|
|
16
|
-
links = () => [
|
|
17
|
-
{ label: "Home", href: "/" },
|
|
18
|
-
{ label: "About Us", href: "/about/" },
|
|
19
|
-
{ label: "Contact Us", href: "/contact/" },
|
|
20
|
-
{ label: "Privacy Policy", href: "/privacy/" },
|
|
21
|
-
].map((p) => ({ ...p, current: this.router.url === p.href }));
|
|
22
|
-
}
|