@monster-orange/den-ui 0.5.1 → 0.7.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.
Files changed (45) hide show
  1. package/README.md +515 -1
  2. package/bin/den-ui-parity.mjs +440 -0
  3. package/inventory/fonts-dir.cjs +8 -0
  4. package/inventory/fonts-dir.mjs +10 -0
  5. package/inventory/nav-inventory.d.ts +133 -0
  6. package/inventory/nav-inventory.js +839 -0
  7. package/inventory/reference/den-chromium-1280.json +5388 -0
  8. package/inventory/reference/den-chromium-390.json +3834 -0
  9. package/inventory/reference/den-webkit-1280.json +5388 -0
  10. package/inventory/reference/den-webkit-390.json +3834 -0
  11. package/package.json +40 -3
  12. package/src/busy-words.d.ts +2 -0
  13. package/src/busy-words.js +6 -0
  14. package/src/busy.css +155 -0
  15. package/src/busy.d.ts +80 -0
  16. package/src/busy.js +105 -35
  17. package/src/dialog.css +103 -0
  18. package/src/dialog.d.ts +44 -0
  19. package/src/dialog.js +95 -30
  20. package/src/icons.d.ts +4 -0
  21. package/src/icons.js +43 -0
  22. package/src/kit.d.ts +217 -0
  23. package/src/kit.js +299 -0
  24. package/src/marks/den.svg +6 -0
  25. package/src/report-shot.d.ts +47 -0
  26. package/src/report-shot.js +437 -0
  27. package/src/report.css +387 -0
  28. package/src/report.d.ts +61 -0
  29. package/src/report.js +909 -0
  30. package/src/shell-client.d.ts +149 -0
  31. package/src/shell-client.js +820 -0
  32. package/src/shell-html.d.ts +305 -0
  33. package/src/shell-html.js +903 -0
  34. package/src/shell.css +1010 -0
  35. package/src/strings.d.ts +18 -0
  36. package/src/strings.js +565 -0
  37. package/src/time.d.ts +18 -0
  38. package/src/time.js +14 -2
  39. package/src/tokens.css +81 -67
  40. package/src/update-pill.d.ts +17 -0
  41. package/src/version.d.ts +7 -0
  42. package/src/version.js +31 -0
  43. package/src/whatsnew.css +235 -0
  44. package/src/whatsnew.d.ts +36 -0
  45. package/src/whatsnew.js +411 -0
@@ -0,0 +1,149 @@
1
+ import type {
2
+ AccountMenu,
3
+ AppearanceMenu,
4
+ BellItem,
5
+ BellPanelOptions,
6
+ WaitingOptions,
7
+ } from "./shell-html.js";
8
+
9
+ export interface HydrateOptions {
10
+ lang?: string | (() => string);
11
+ /** The toggle was pressed: store it, then call shell.setCollapsed(next). */
12
+ onCollapse?: (next: boolean) => void;
13
+ /** Delete on a pinned row. */
14
+ onUnpin?: (id: string) => void;
15
+ /** The elements made inert behind the open drawer. */
16
+ inert?: () => (Element | null)[];
17
+ /** True while a product menu is open (Escape is the menu's then). */
18
+ menuOpen?: () => boolean;
19
+ }
20
+ export interface Shell {
21
+ nav: HTMLElement | null;
22
+ rove(): void;
23
+ paint(html: string, force?: boolean): boolean;
24
+ setCollapsed(on: boolean): void;
25
+ unpin(id: string): void;
26
+ openDrawer(): void;
27
+ closeDrawer(refocus?: boolean): void;
28
+ drawerOpen(): boolean;
29
+ syncPinToggles(root: ParentNode, isPinned: (id: string) => boolean): void;
30
+ }
31
+ export declare function syncPinToggles(
32
+ root: ParentNode,
33
+ isPinned: (id: string) => boolean,
34
+ lang?: string,
35
+ ): void;
36
+ export declare function hydrateShell(
37
+ root: ParentNode,
38
+ opts?: HydrateOptions,
39
+ ): Shell;
40
+
41
+ /** 0.7.0: the scope crumbs' menus. */
42
+ export interface ScopeHydrateOptions {
43
+ /** A crumb whose menu is the host's (menu: true) was opened. */
44
+ onOpen?: (key: string, button: HTMLElement) => void;
45
+ }
46
+ export interface ScopeHandle {
47
+ close(): void;
48
+ isOpen(): boolean;
49
+ }
50
+ export declare function hydrateScope(
51
+ root: ParentNode & EventTarget,
52
+ opts?: ScopeHydrateOptions,
53
+ ): ScopeHandle;
54
+ export interface SearchHydrateOptions {
55
+ /** A click or Enter ("click"), ⌘K or Ctrl-K ("key"). */
56
+ onActivate?: (via: string, event?: Event) => void;
57
+ /** false: no ⌘K / Ctrl-K. */
58
+ keys?: boolean;
59
+ }
60
+ export interface SearchHandle {
61
+ activate(via?: string): void;
62
+ destroy(): void;
63
+ }
64
+ export declare function hydrateSearch(
65
+ button: HTMLElement | null,
66
+ opts?: SearchHydrateOptions,
67
+ ): SearchHandle;
68
+ export interface BellHydrateOptions {
69
+ lang?: string | (() => string);
70
+ title?: string;
71
+ titleId?: string;
72
+ items?: BellItem[] | (() => BellItem[]);
73
+ empty?: { text?: string; more?: string };
74
+ foot?: string | (() => string);
75
+ /** The whole content: HTML, or bellPanelHtml's options. */
76
+ panel?: () => string | BellPanelOptions;
77
+ onOpen?: () => void;
78
+ onClose?: () => void;
79
+ /** An Esc while open: true when the host took it (the panel stays). */
80
+ onEscape?: (e: KeyboardEvent) => boolean | void;
81
+ /** The panel's id (default "den-bell-pop"). */
82
+ id?: string;
83
+ }
84
+ export interface BellHandle {
85
+ el: HTMLElement;
86
+ open(): void;
87
+ close(focus?: boolean): void;
88
+ isOpen(): boolean;
89
+ paint(): void;
90
+ setCount(n: number): void;
91
+ }
92
+ export declare function hydrateBell(
93
+ button: HTMLElement,
94
+ opts?: BellHydrateOptions,
95
+ ): BellHandle;
96
+ export interface AccountHydrateOptions {
97
+ lang?: string | (() => string);
98
+ /** The entry as an action (no href, no menu): a click calls it. */
99
+ onAction?: (e: Event) => void;
100
+ /** The entry's menu (`menu: true` on the entry), each time it opens. */
101
+ menu?: () => Omit<AccountMenu, "lang">;
102
+ /** A button entry's pick: "item" and its id. */
103
+ onPick?: (kind: string, value: string | null, row: HTMLElement) => void;
104
+ /** A form entry's submit; preventDefault keeps it from posting. */
105
+ onSubmit?: (e: SubmitEvent, form: HTMLFormElement) => void;
106
+ }
107
+ /**
108
+ * A type-to-filter field for a host's own menu (.den-mi entries), when it
109
+ * has more entries than `filter` allows (past 6 by default): the field
110
+ * (focus it once the menu shows), else null. The menu's rows (and its
111
+ * role and name) move into a `.den-mlist` role="menu" list, id
112
+ * `<menu id>-list`; `menu` keeps its id and becomes the pop-up holding the
113
+ * field, the list and "No match" (a menu owns only its items).
114
+ */
115
+ export declare function attachMenuFilter(
116
+ menu: HTMLElement,
117
+ o?: {
118
+ label?: string;
119
+ lang?: string;
120
+ filter?: boolean | number;
121
+ onClose?: (refocus: boolean) => void;
122
+ },
123
+ ): HTMLInputElement | null;
124
+ /** The account entry: its menu's handle when it has one, else nothing. */
125
+ export declare function hydrateAccount(
126
+ root: ParentNode & EventTarget,
127
+ opts?: AccountHydrateOptions,
128
+ ): AppearanceHandle | void;
129
+ export interface AppearanceHydrateOptions {
130
+ lang?: string | (() => string);
131
+ /** The menu's content, each time it opens. */
132
+ menu?: () => Omit<AppearanceMenu, "lang">;
133
+ /** A pick: "mode", "theme", "language" or "item", and its value. */
134
+ onPick?: (kind: string, value: string | null, row: HTMLElement) => void;
135
+ }
136
+ export interface AppearanceHandle {
137
+ open(): void;
138
+ close(refocus?: boolean): void;
139
+ isOpen(): boolean;
140
+ }
141
+ export declare function hydrateAppearance(
142
+ button: HTMLElement,
143
+ opts?: AppearanceHydrateOptions,
144
+ ): AppearanceHandle;
145
+ /** The update-waiting pill after the version chip; null hides it. */
146
+ export declare function setWaiting(
147
+ o: (WaitingOptions & { onClick?: (e: Event) => void }) | null,
148
+ root?: Document | Element,
149
+ ): HTMLElement | null;