@ghub/identity-chrome 0.1.0 → 0.3.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.
@@ -0,0 +1,67 @@
1
+ /**
2
+ * `<gp-apps>`, the apps picker (GPlatform Identity, sheet 31, option B).
3
+ *
4
+ * A nine dot trigger and, under it, the products this person has and the ones
5
+ * open to join: flat marks with nothing behind them until a pointer or the
6
+ * focus arrives, the current product on a resting plate in the selected wash,
7
+ * an invitation carrying a small plus.
8
+ *
9
+ * **What it is to assistive technology, which is most of the work:**
10
+ *
11
+ * - The trigger is a `button` with `aria-haspopup="dialog"`, named "Products".
12
+ * - The popup is a `dialog`, not modal and never a `menu`: the tiles are links
13
+ * that navigate, and a menu would take the browser's link behaviour away
14
+ * (middle click, copy the address). Below 600 wide it is a bottom sheet, and
15
+ * there it is modal, with a scrim, a close button first and a contained
16
+ * focus loop, because a sheet covers the page.
17
+ * - Focus opens on the current product, else the first tile. Each group is one
18
+ * tab stop with a roving tabindex; the arrows move in two dimensions without
19
+ * wrapping a row, Down from the last row of one group lands in the same
20
+ * column of the next, Home and End go to the group's ends, and Tab from the
21
+ * last group returns to the trigger and closes.
22
+ * - Each tile is named with its state: "GAdvisory, you are here", "GOpenCDR,
23
+ * open to join", "DAnalytics, cannot be opened while offline". The current
24
+ * one carries `aria-current="page"`; an offline one is `aria-disabled` and
25
+ * stays focusable.
26
+ *
27
+ * **It draws the kept list at once.** The core holds the last answer in local
28
+ * storage; opening draws it with no network wait and asks again in the
29
+ * background, and a changed list swaps in without moving the focus. The
30
+ * skeleton is only for a first visit with nothing kept.
31
+ *
32
+ * The words are English by default and every one can be replaced (`labels`).
33
+ */
34
+ export interface AppsLabels {
35
+ /** The trigger's name and the popup's heading. */
36
+ trigger: string;
37
+ yours: string;
38
+ more: string;
39
+ /** Known only from a seeded list and never opened. */
40
+ empty: string;
41
+ /** The kept list is shown because Identity could not be reached. */
42
+ stale: (time: string) => string;
43
+ retry: string;
44
+ failed: string;
45
+ here: (name: string) => string;
46
+ join: (name: string) => string;
47
+ offline: (name: string) => string;
48
+ offlineShort: string;
49
+ moreBelow: (count: number) => string;
50
+ close: string;
51
+ }
52
+ export declare const APPS_LABELS: AppsLabels;
53
+ export declare const APPS_CSS: string;
54
+ /**
55
+ * Where an arrow key goes in a grid of `count` tiles, `columns` wide, without
56
+ * wrapping a row. Null where the key leaves the grid downwards or upwards, so
57
+ * the caller can carry the column into the next group.
58
+ */
59
+ export declare function moveInGrid(index: number, count: number, columns: number, key: string): number | "above" | "below" | null;
60
+ /**
61
+ * Defines `<gp-apps>` once, where custom elements exist. Safe to import on a
62
+ * server: nothing touches the DOM until this is called in a browser.
63
+ */
64
+ export declare function defineAppsElement(name?: string): void;
65
+ /** The class itself, for a caller that registers it under its own name or in a scoped registry. */
66
+ export declare function createAppsElementClass(): CustomElementConstructor;
67
+ //# sourceMappingURL=apps.d.ts.map