actual-css 0.19.1 → 0.19.3
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/CHANGELOG.md +15 -0
- package/dist/actual.full.css +20 -0
- package/dist/actual.full.js +2 -2
- package/dist/actual.full.min.css +1 -1
- package/dist/types/ajax.d.ts +1 -0
- package/dist/types/command.d.ts +41 -0
- package/dist/types/context-menu.d.ts +1 -0
- package/dist/types/dialog.d.ts +3 -0
- package/dist/types/dirty.d.ts +15 -0
- package/dist/types/dismiss.d.ts +1 -0
- package/dist/types/enhance.d.ts +36 -0
- package/dist/types/enhancement-loader.d.ts +27 -0
- package/dist/types/escape.d.ts +1 -0
- package/dist/types/events.d.ts +14 -0
- package/dist/types/filter.d.ts +1 -0
- package/dist/types/floating-space.d.ts +16 -0
- package/dist/types/flyout.d.ts +1 -0
- package/dist/types/focus-group.d.ts +4 -0
- package/dist/types/focus.d.ts +4 -0
- package/dist/types/form-submission.d.ts +12 -0
- package/dist/types/full.d.ts +22 -0
- package/dist/types/in-view.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/inline-visible.d.ts +1 -0
- package/dist/types/input.d.ts +4 -0
- package/dist/types/keys.d.ts +5 -0
- package/dist/types/mask.d.ts +1 -0
- package/dist/types/menu.d.ts +12 -0
- package/dist/types/parse-config.d.ts +2 -0
- package/dist/types/parsed.d.ts +1 -0
- package/dist/types/password.d.ts +1 -0
- package/dist/types/range.d.ts +1 -0
- package/dist/types/scrollspy.d.ts +1 -0
- package/dist/types/selectors.d.ts +14 -0
- package/dist/types/status.d.ts +5 -0
- package/dist/types/surface.d.ts +6 -0
- package/dist/types/tab.d.ts +1 -0
- package/dist/types/tooltip.d.ts +68 -0
- package/dist/types/transition.d.ts +1 -0
- package/dist/types/validation.d.ts +17 -0
- package/docs/design-notes/tooltip-coordinate-space.md +3 -5
- package/docs/pages/enhancements/flyout.md +3 -1
- package/docs/pages/enhancements/tooltip.md +3 -2
- package/docs/pages/guides/progressive-enhancement.md +5 -1
- package/package.json +36 -34
- package/src/css/components/flyout.css +20 -0
- package/src/js/context-menu.js +10 -2
- package/src/js/enhance.js +18 -4
- package/src/js/full.js +3 -0
- package/src/js/tooltip.js +44 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a trigger's current `commandfor` target in the same document or
|
|
3
|
+
* shadow root.
|
|
4
|
+
*
|
|
5
|
+
* @param {Element} trigger Element carrying the `commandfor` attribute.
|
|
6
|
+
* @returns {Element | null} The current target, or `null` when it cannot be resolved.
|
|
7
|
+
*/
|
|
8
|
+
export declare function targetFor(trigger: Element): Element | null;
|
|
9
|
+
/**
|
|
10
|
+
* Build the button selector corresponding to one or more command names.
|
|
11
|
+
*
|
|
12
|
+
* Native keywords match case-insensitively, custom commands exactly — the
|
|
13
|
+
* same rule the router applies.
|
|
14
|
+
*
|
|
15
|
+
* @param {string | string[]} commands Command name or names to include.
|
|
16
|
+
* @returns {string} A selector matching command buttons with `commandfor`.
|
|
17
|
+
* @throws {TypeError} When a name is neither native nor a custom `--` command.
|
|
18
|
+
*/
|
|
19
|
+
export declare function commandSelector(commands: string | string[]): string;
|
|
20
|
+
/**
|
|
21
|
+
* Register one behavior for one or more command names.
|
|
22
|
+
*
|
|
23
|
+
* The router cancels the click once `resolve` returns a target, so `handle`
|
|
24
|
+
* runs with `event.defaultPrevented` already true.
|
|
25
|
+
*
|
|
26
|
+
* @param {string | string[]} commands Command name or names owned by this behavior.
|
|
27
|
+
* @param {object} options Behavior callbacks.
|
|
28
|
+
* @param {(trigger: HTMLButtonElement) => Element | null} [options.resolve=targetFor]
|
|
29
|
+
* Resolver evaluated for every action.
|
|
30
|
+
* @param {(event: MouseEvent, trigger: HTMLButtonElement, target: Element, command: string) => void} options.handle
|
|
31
|
+
* Command handler.
|
|
32
|
+
* @returns {{ disconnect: () => void }} An idempotent registration teardown handle.
|
|
33
|
+
* @throws {TypeError} When command names or callbacks are invalid.
|
|
34
|
+
* @throws {Error} When a command already has an owner in the current document.
|
|
35
|
+
*/
|
|
36
|
+
export declare function registerCommands(commands: string | string[], { resolve, handle }?: {
|
|
37
|
+
resolve?: (trigger: HTMLButtonElement) => Element | null;
|
|
38
|
+
handle: (event: MouseEvent, trigger: HTMLButtonElement, target: Element, command: string) => void;
|
|
39
|
+
}): {
|
|
40
|
+
disconnect: () => void;
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function contextFor(menu: any): any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class FormDirty {
|
|
2
|
+
/**
|
|
3
|
+
* Opaque snapshot of what the form would submit. Take it at submit time
|
|
4
|
+
* and pass it to markClean() once that submission is saved, so edits
|
|
5
|
+
* made during the request stay dirty.
|
|
6
|
+
*/
|
|
7
|
+
static capture(form: any): string;
|
|
8
|
+
/**
|
|
9
|
+
* Makes `snapshot` (default: current data) the new baseline. Also valid
|
|
10
|
+
* before the form is enhanced: connection keeps an existing baseline.
|
|
11
|
+
*/
|
|
12
|
+
static markClean(form: any, snapshot: any): void;
|
|
13
|
+
/** Re-evaluates an enhanced form after programmatic edits or added controls. */
|
|
14
|
+
static refresh(form: any): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type Enhancer = (el: Element) => (() => void) | void;
|
|
2
|
+
export type EnhancementHandle = {
|
|
3
|
+
/**
|
|
4
|
+
* Scan a node and its descendants.
|
|
5
|
+
*/
|
|
6
|
+
refresh: (node: Node) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Stop observing and run active cleanups.
|
|
9
|
+
*/
|
|
10
|
+
disconnect: () => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Apply a named opt-in once; presentation selectors remain application-owned.
|
|
14
|
+
* @param {string} name
|
|
15
|
+
* @param {string} selector
|
|
16
|
+
* @param {Document | Element | DocumentFragment | null} [root] Query scope, excluding itself.
|
|
17
|
+
* @returns {Element[]} Matched descendants.
|
|
18
|
+
*/
|
|
19
|
+
export declare function applyEnhancement(name: string, selector: string, root?: Document | Element | DocumentFragment | null): Element[];
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} name
|
|
22
|
+
* @param {Enhancer} init
|
|
23
|
+
* @param {Document | Element | DocumentFragment | null} [root]
|
|
24
|
+
* @returns {EnhancementHandle}
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerEnhancement(name: string, init: Enhancer, root?: Document | Element | DocumentFragment | null): EnhancementHandle;
|
|
27
|
+
/**
|
|
28
|
+
* @param {Record<string, Enhancer>} enhancers
|
|
29
|
+
* @param {Document | Element | DocumentFragment | null} [root]
|
|
30
|
+
* @param {object} [options]
|
|
31
|
+
* @param {(el: Element) => boolean} [options.accept] Lifecycle eligibility, rechecked on moves.
|
|
32
|
+
* @returns {EnhancementHandle}
|
|
33
|
+
*/
|
|
34
|
+
export default function enhance(enhancers: Record<string, Enhancer>, root?: Document | Element | DocumentFragment | null, { accept }?: {
|
|
35
|
+
accept?: (el: Element) => boolean;
|
|
36
|
+
}): EnhancementHandle;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare function loadScript(url: any): any;
|
|
2
|
+
export declare function loadStyle(url: any): any;
|
|
3
|
+
export declare function loadEnhancement(name: any, url: any): any;
|
|
4
|
+
/**
|
|
5
|
+
* Load every enhancement declared in the manifest blocks under `scope`.
|
|
6
|
+
*
|
|
7
|
+
* @param {Document | Element | DocumentFragment} [scope] Where to look for
|
|
8
|
+
* manifest blocks. It only limits discovery; loaded enhancements register on
|
|
9
|
+
* the default document root.
|
|
10
|
+
* @returns {Promise<{ names: string[], failed: { name: string, error: Error }[], skipped: string[] }>}
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadEnhancements(scope?: Document | Element | DocumentFragment): Promise<{
|
|
13
|
+
names: string[];
|
|
14
|
+
failed: {
|
|
15
|
+
name: string;
|
|
16
|
+
error: Error;
|
|
17
|
+
}[];
|
|
18
|
+
skipped: string[];
|
|
19
|
+
}>;
|
|
20
|
+
export declare function watchEnhancementManifests(): import("./enhance.js").EnhancementHandle;
|
|
21
|
+
export declare function loadResponse(response: any): Promise<{
|
|
22
|
+
names: never[];
|
|
23
|
+
failed: never[];
|
|
24
|
+
skipped: never[];
|
|
25
|
+
}>;
|
|
26
|
+
export declare function __setModuleImporter(fn: any): void;
|
|
27
|
+
export declare function __reset(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerEscapeDismissal(element: any, dismiss: any): () => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const ACTUAL_EVENT_PREFIX = "actual";
|
|
2
|
+
export declare const EVENTS: {
|
|
3
|
+
surfaceOpen: string;
|
|
4
|
+
contextMenu: string;
|
|
5
|
+
status: string;
|
|
6
|
+
invalid: string;
|
|
7
|
+
dirtyChange: string;
|
|
8
|
+
ajaxStart: string;
|
|
9
|
+
ajaxResponse: string;
|
|
10
|
+
ajaxError: string;
|
|
11
|
+
tabChange: string;
|
|
12
|
+
dialogCancel: string;
|
|
13
|
+
dismiss: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The author's placement attribute, or null when absent or unknown.
|
|
3
|
+
*
|
|
4
|
+
* @param {Element | null | undefined} el
|
|
5
|
+
* @param {string} attribute
|
|
6
|
+
* @returns {string | null}
|
|
7
|
+
*/
|
|
8
|
+
export declare function readPlacement(el: Element | null | undefined, attribute: string): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* @param {Element | null | undefined} anchor
|
|
11
|
+
* @returns {{ space: "viewport" | "document", position: "fixed" | "absolute" }}
|
|
12
|
+
*/
|
|
13
|
+
export declare function positionModeFor(anchor: Element | null | undefined): {
|
|
14
|
+
space: "viewport" | "document";
|
|
15
|
+
position: "fixed" | "absolute";
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads action, method, enctype or target: a submitter's form* attribute
|
|
3
|
+
* overrides the form's own, as natively. Reflected values, so method and
|
|
4
|
+
* enctype come back lowercase and action as an absolute URL.
|
|
5
|
+
*/
|
|
6
|
+
export declare function submissionSetting(form: any, submitter: any, name: any): any;
|
|
7
|
+
/**
|
|
8
|
+
* The browsing context name the submission goes to, "" for the page itself.
|
|
9
|
+
* Without a target attribute the form falls back to <base target>; an empty
|
|
10
|
+
* formtarget="" is still an attribute and means the page itself.
|
|
11
|
+
*/
|
|
12
|
+
export declare function submissionTarget(form: any, submitter: any): any;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./flyout.js";
|
|
2
|
+
import "./context-menu.js";
|
|
3
|
+
import "./dialog.js";
|
|
4
|
+
import "./dismiss.js";
|
|
5
|
+
import "./tab.js";
|
|
6
|
+
import "./tooltip.js";
|
|
7
|
+
import "./scrollspy.js";
|
|
8
|
+
import "./in-view.js";
|
|
9
|
+
import "./filter.js";
|
|
10
|
+
import "./mask.js";
|
|
11
|
+
import "./password.js";
|
|
12
|
+
import "./range.js";
|
|
13
|
+
import "./validation.js";
|
|
14
|
+
import "./dirty.js";
|
|
15
|
+
import "./ajax.js";
|
|
16
|
+
import "./status.js";
|
|
17
|
+
import "./index.js";
|
|
18
|
+
export { applyEnhancement, default as enhance, registerEnhancement } from "./enhance.js";
|
|
19
|
+
export type Enhancer = import("./enhance.js").Enhancer;
|
|
20
|
+
export type EnhancementHandle = import("./enhance.js").EnhancementHandle;
|
|
21
|
+
/** @typedef {import("./enhance.js").Enhancer} Enhancer */
|
|
22
|
+
/** @typedef {import("./enhance.js").EnhancementHandle} EnhancementHandle */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ensureInlineVisible(container: any, target: any): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function shouldIgnoreKey(event: any): boolean;
|
|
2
|
+
export declare function firstItem(items: any): any;
|
|
3
|
+
export declare function lastItem(items: any): any;
|
|
4
|
+
export declare function nextItem(items: any, current: any, delta: any, opts?: {}): any;
|
|
5
|
+
export declare function itemForKey(items: any, current: any, key: any, opts?: {}): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function getMenuItems(menu: any): any[];
|
|
2
|
+
export declare function hasMenuItems(menu: any): boolean;
|
|
3
|
+
export declare function hasMenuItem(menu: any, target: any): boolean;
|
|
4
|
+
export declare function focusFirstMenuItem(menu: any): void;
|
|
5
|
+
export declare function focusLastMenuItem(menu: any): void;
|
|
6
|
+
export declare function onMenuKeydown(e: any, { close, navigate }: {
|
|
7
|
+
close: any;
|
|
8
|
+
navigate?: boolean | undefined;
|
|
9
|
+
}): void;
|
|
10
|
+
export declare function connectMenu(menu: any, { close }: {
|
|
11
|
+
close: any;
|
|
12
|
+
}): () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function afterParse(node: any, callback: any): () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function refreshScrollspy(nav: any): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const CLASSES: {
|
|
2
|
+
wasValidated: string;
|
|
3
|
+
danger: string;
|
|
4
|
+
fieldError: string;
|
|
5
|
+
field: string;
|
|
6
|
+
formActions: string;
|
|
7
|
+
sticky: string;
|
|
8
|
+
open: string;
|
|
9
|
+
pending: string;
|
|
10
|
+
static: string;
|
|
11
|
+
modalOpen: string;
|
|
12
|
+
hadScrollbar: string;
|
|
13
|
+
tooltip: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isSurfaceOpen(menu: any): boolean;
|
|
2
|
+
export declare function prepareSurface(menu: any): void;
|
|
3
|
+
export declare function retainSurface(panel: any): () => void;
|
|
4
|
+
export declare function openSurface(menu: any, opts?: {}): boolean;
|
|
5
|
+
export declare function closeSurface(menu: any, opts?: {}): void;
|
|
6
|
+
export declare function disconnectSurface(menu: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type TooltipState = {
|
|
2
|
+
/**
|
|
3
|
+
* Triggers that currently reference this tip.
|
|
4
|
+
*/
|
|
5
|
+
refs: Set<Element>;
|
|
6
|
+
/**
|
|
7
|
+
* Trigger that last showed this tip.
|
|
8
|
+
*/
|
|
9
|
+
activeRef: Element | null;
|
|
10
|
+
/**
|
|
11
|
+
* Tip-level event listener cleanup.
|
|
12
|
+
*/
|
|
13
|
+
controller: AbortController;
|
|
14
|
+
/**
|
|
15
|
+
* Floating-position cleanup while wanted.
|
|
16
|
+
*/
|
|
17
|
+
stopTracking: (() => void) | null;
|
|
18
|
+
/**
|
|
19
|
+
* Reference the current subscription observes.
|
|
20
|
+
*/
|
|
21
|
+
trackedRef: Element | null;
|
|
22
|
+
/**
|
|
23
|
+
* Escape-stack cleanup while visible and dismissable.
|
|
24
|
+
*/
|
|
25
|
+
unregisterEscape: (() => void) | null;
|
|
26
|
+
/**
|
|
27
|
+
* Trigger represented by the current Escape-stack entry.
|
|
28
|
+
*/
|
|
29
|
+
escapeRef: Element | null;
|
|
30
|
+
/**
|
|
31
|
+
* True when the tip was created from data-tooltip text.
|
|
32
|
+
*/
|
|
33
|
+
generated: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* True while the interaction asks for this tip, positionable or not.
|
|
36
|
+
*/
|
|
37
|
+
wanted: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* True while the tip is promoted to the top layer.
|
|
40
|
+
*/
|
|
41
|
+
visible: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Coordinate space the tip is written in.
|
|
44
|
+
*/
|
|
45
|
+
space: "viewport" | "document";
|
|
46
|
+
/**
|
|
47
|
+
* Pending delayed show.
|
|
48
|
+
*/
|
|
49
|
+
timer: ReturnType<typeof setTimeout> | null;
|
|
50
|
+
/**
|
|
51
|
+
* Pending delayed hide.
|
|
52
|
+
*/
|
|
53
|
+
hideTimer: ReturnType<typeof setTimeout> | null;
|
|
54
|
+
/**
|
|
55
|
+
* Pointer is over the active trigger.
|
|
56
|
+
*/
|
|
57
|
+
hovered: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The active trigger has keyboard focus.
|
|
60
|
+
*/
|
|
61
|
+
focused: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Pointer is over the tooltip.
|
|
64
|
+
*/
|
|
65
|
+
overTip: boolean;
|
|
66
|
+
};
|
|
67
|
+
/** True while the tip is promoted. The runtime's state, not :popover-open. */
|
|
68
|
+
export declare function isTooltipVisible(tip: any): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function waitForTransitions(...elements: any[]): Promise<PromiseSettledResult<any>[]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class FormValidator {
|
|
2
|
+
static get rules(): {
|
|
3
|
+
same(v: any, el: any, selector: any): boolean;
|
|
4
|
+
number(v: any): boolean;
|
|
5
|
+
digits(v: any): boolean;
|
|
6
|
+
alnum(v: any): boolean;
|
|
7
|
+
"starts-with"(v: any, _el: any, ...prefixes: any[]): boolean;
|
|
8
|
+
"ends-with"(v: any, _el: any, ...suffixes: any[]): boolean;
|
|
9
|
+
date(v: any): boolean;
|
|
10
|
+
"tel-prefix"(value: any, _el: any, ...prefixes: any[]): boolean;
|
|
11
|
+
};
|
|
12
|
+
static registerRule(name: any, callback: any): void;
|
|
13
|
+
static setFieldError(el: any, message: any): void;
|
|
14
|
+
static clearFieldError(el: any): void;
|
|
15
|
+
static setErrors(form: any, errors: any): void;
|
|
16
|
+
}
|
|
17
|
+
export default FormValidator;
|
|
@@ -96,11 +96,9 @@ moves with the tip here, and holds steady for anything else.
|
|
|
96
96
|
outside the boundary included. `tooltip.js` used to read that as the end of the
|
|
97
97
|
interaction and call `hideTip()`, which stopped position tracking.
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
help either — the trigger is already focused, so no `focusin` fires, and a
|
|
103
|
-
repeat tap on the same element fires no `mouseover`.
|
|
99
|
+
A keyboard-focused trigger keeps its focus when scrolled past the boundary.
|
|
100
|
+
Scrolling back produces no new `focusin`, so the existing tracker must bring
|
|
101
|
+
the tooltip back.
|
|
104
102
|
|
|
105
103
|
So the runtime now keeps two states. `wanted` is what the interaction asks for
|
|
106
104
|
and only `hideTip()` clears it; `visible` is what is promoted. An
|
|
@@ -530,7 +530,9 @@ matching element. The scope also constrains the available height, so omit it
|
|
|
530
530
|
when the menu is allowed to escape the card or list item.
|
|
531
531
|
|
|
532
532
|
Long press is opt-in with `data-context-menu-long-press`. Empty uses the default
|
|
533
|
-
delay; a number sets the delay in milliseconds.
|
|
533
|
+
delay; a number sets the delay in milliseconds. On touch-primary devices the
|
|
534
|
+
target loses text selection and the iOS callout, so the native gesture does not
|
|
535
|
+
compete with the menu; keep the trigger button as the discoverable path.
|
|
534
536
|
|
|
535
537
|
```html demo
|
|
536
538
|
<div class="card stack"
|
|
@@ -11,9 +11,10 @@ by promoting it to the top layer with `popover="manual"`.
|
|
|
11
11
|
- Generated text is a snapshot at show time: changing `data-tooltip` never rewrites a tooltip that is already shown, and an always-visible generated tooltip keeps its initial text. For content that must update dynamically, use an explicit tooltip. See the [tooltips bench](../examples/overview.md) (`demo/templates/tooltips.html`) for all six cases side by side.
|
|
12
12
|
- Generated text is always plain text (`textContent` only), so a shorthand value is safe for untrusted strings once they are in the DOM. An explicit tooltip is author-owned DOM: its sanitization belongs to whoever produces it. Escape the attribute server-side — a DOM already compromised at render cannot be repaired at read time. There is no `data-tooltip-html`, by design.
|
|
13
13
|
- Tooltips are supplemental. Do not put required information or interactive controls inside them.
|
|
14
|
-
- Show on hover and focus. Hide on Escape, blur, or pointer
|
|
14
|
+
- Show on hover and keyboard focus. Hide on Escape, blur, pointer leave, or a pointer press on the trigger.
|
|
15
15
|
- A trigger scrolled out of view takes its tooltip down and brings it back when it returns; only a dismissal ends the tooltip.
|
|
16
|
-
- Escape
|
|
16
|
+
- Escape dismisses the tooltip without moving the pointer or focus (WCAG 2.1 SC 1.4.13).
|
|
17
|
+
- After Escape or a pointer press dismisses a hover or focus tooltip, move the pointer away and back or return with keyboard focus to show it again.
|
|
17
18
|
- Author an explicit tooltip with `hidden`. The runtime removes it when it takes the lifecycle over; until then it is what keeps the tooltip off screen.
|
|
18
19
|
- JavaScript can generate tooltip elements from `data-tooltip`.
|
|
19
20
|
- Add `data-tooltip-click` to toggle it on click instead of hover/focus.
|
|
@@ -93,7 +93,11 @@ registerEnhancement("autosubmit", (form) => {
|
|
|
93
93
|
});
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
For
|
|
96
|
+
For additional helpers, import the relevant `actual-css/js/*` module. Source
|
|
97
|
+
imports from the same package installation share the runtime instance.
|
|
98
|
+
The npm package includes TypeScript declarations for these imports. Import
|
|
99
|
+
`Enhancer` and `EnhancementHandle` as types from `actual-css/js/full` or
|
|
100
|
+
`actual-css/js/enhance`.
|
|
97
101
|
|
|
98
102
|
The same entrypoint produces the `dist/actual.full.js` standalone for a
|
|
99
103
|
classic `<script>`, where no global API is exposed. Static HTML that needs to
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "actual-css",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.3",
|
|
4
4
|
"description": "Plain CSS component framework with semantic classes, universal variants, small tokens, theme hooks, and progressive enhancements.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "bun@1.4.4",
|
|
@@ -46,37 +46,37 @@
|
|
|
46
46
|
"./css/typography/*": "./src/css/typography/*.css",
|
|
47
47
|
"./css/utilities": "./src/css/utilities/index.css",
|
|
48
48
|
"./css/utilities/*": "./src/css/utilities/*.css",
|
|
49
|
-
"./js": "./src/js/index.js",
|
|
50
|
-
"./js/full": "./src/js/full.js",
|
|
51
|
-
"./js/command": "./src/js/command.js",
|
|
52
|
-
"./js/context-menu": "./src/js/context-menu.js",
|
|
53
|
-
"./js/dialog": "./src/js/dialog.js",
|
|
54
|
-
"./js/dismiss": "./src/js/dismiss.js",
|
|
55
|
-
"./js/escape": "./src/js/escape.js",
|
|
56
|
-
"./js/enhance": "./src/js/enhance.js",
|
|
57
|
-
"./js/enhancement-loader": "./src/js/enhancement-loader.js",
|
|
58
|
-
"./js/parse-config": "./src/js/parse-config.js",
|
|
59
|
-
"./js/events": "./src/js/events.js",
|
|
60
|
-
"./js/filter": "./src/js/filter.js",
|
|
61
|
-
"./js/flyout": "./src/js/flyout.js",
|
|
62
|
-
"./js/focus": "./src/js/focus.js",
|
|
63
|
-
"./js/focus-group": "./src/js/focus-group.js",
|
|
64
|
-
"./js/input": "./src/js/input.js",
|
|
65
|
-
"./js/in-view": "./src/js/in-view.js",
|
|
66
|
-
"./js/keys": "./src/js/keys.js",
|
|
67
|
-
"./js/mask": "./src/js/mask.js",
|
|
68
|
-
"./js/menu": "./src/js/menu.js",
|
|
69
|
-
"./js/password": "./src/js/password.js",
|
|
70
|
-
"./js/range": "./src/js/range.js",
|
|
71
|
-
"./js/scrollspy": "./src/js/scrollspy.js",
|
|
72
|
-
"./js/selectors": "./src/js/selectors.js",
|
|
73
|
-
"./js/tab": "./src/js/tab.js",
|
|
74
|
-
"./js/tooltip": "./src/js/tooltip.js",
|
|
75
|
-
"./js/validation": "./src/js/validation.js",
|
|
76
|
-
"./js/dirty": "./src/js/dirty.js",
|
|
77
|
-
"./js/ajax": "./src/js/ajax.js",
|
|
78
|
-
"./js/status": "./src/js/status.js",
|
|
79
|
-
"./js/surface": "./src/js/surface.js",
|
|
49
|
+
"./js": { "types": "./dist/types/index.d.ts", "default": "./src/js/index.js" },
|
|
50
|
+
"./js/full": { "types": "./dist/types/full.d.ts", "default": "./src/js/full.js" },
|
|
51
|
+
"./js/command": { "types": "./dist/types/command.d.ts", "default": "./src/js/command.js" },
|
|
52
|
+
"./js/context-menu": { "types": "./dist/types/context-menu.d.ts", "default": "./src/js/context-menu.js" },
|
|
53
|
+
"./js/dialog": { "types": "./dist/types/dialog.d.ts", "default": "./src/js/dialog.js" },
|
|
54
|
+
"./js/dismiss": { "types": "./dist/types/dismiss.d.ts", "default": "./src/js/dismiss.js" },
|
|
55
|
+
"./js/escape": { "types": "./dist/types/escape.d.ts", "default": "./src/js/escape.js" },
|
|
56
|
+
"./js/enhance": { "types": "./dist/types/enhance.d.ts", "default": "./src/js/enhance.js" },
|
|
57
|
+
"./js/enhancement-loader": { "types": "./dist/types/enhancement-loader.d.ts", "default": "./src/js/enhancement-loader.js" },
|
|
58
|
+
"./js/parse-config": { "types": "./dist/types/parse-config.d.ts", "default": "./src/js/parse-config.js" },
|
|
59
|
+
"./js/events": { "types": "./dist/types/events.d.ts", "default": "./src/js/events.js" },
|
|
60
|
+
"./js/filter": { "types": "./dist/types/filter.d.ts", "default": "./src/js/filter.js" },
|
|
61
|
+
"./js/flyout": { "types": "./dist/types/flyout.d.ts", "default": "./src/js/flyout.js" },
|
|
62
|
+
"./js/focus": { "types": "./dist/types/focus.d.ts", "default": "./src/js/focus.js" },
|
|
63
|
+
"./js/focus-group": { "types": "./dist/types/focus-group.d.ts", "default": "./src/js/focus-group.js" },
|
|
64
|
+
"./js/input": { "types": "./dist/types/input.d.ts", "default": "./src/js/input.js" },
|
|
65
|
+
"./js/in-view": { "types": "./dist/types/in-view.d.ts", "default": "./src/js/in-view.js" },
|
|
66
|
+
"./js/keys": { "types": "./dist/types/keys.d.ts", "default": "./src/js/keys.js" },
|
|
67
|
+
"./js/mask": { "types": "./dist/types/mask.d.ts", "default": "./src/js/mask.js" },
|
|
68
|
+
"./js/menu": { "types": "./dist/types/menu.d.ts", "default": "./src/js/menu.js" },
|
|
69
|
+
"./js/password": { "types": "./dist/types/password.d.ts", "default": "./src/js/password.js" },
|
|
70
|
+
"./js/range": { "types": "./dist/types/range.d.ts", "default": "./src/js/range.js" },
|
|
71
|
+
"./js/scrollspy": { "types": "./dist/types/scrollspy.d.ts", "default": "./src/js/scrollspy.js" },
|
|
72
|
+
"./js/selectors": { "types": "./dist/types/selectors.d.ts", "default": "./src/js/selectors.js" },
|
|
73
|
+
"./js/tab": { "types": "./dist/types/tab.d.ts", "default": "./src/js/tab.js" },
|
|
74
|
+
"./js/tooltip": { "types": "./dist/types/tooltip.d.ts", "default": "./src/js/tooltip.js" },
|
|
75
|
+
"./js/validation": { "types": "./dist/types/validation.d.ts", "default": "./src/js/validation.js" },
|
|
76
|
+
"./js/dirty": { "types": "./dist/types/dirty.d.ts", "default": "./src/js/dirty.js" },
|
|
77
|
+
"./js/ajax": { "types": "./dist/types/ajax.d.ts", "default": "./src/js/ajax.js" },
|
|
78
|
+
"./js/status": { "types": "./dist/types/status.d.ts", "default": "./src/js/status.js" },
|
|
79
|
+
"./js/surface": { "types": "./dist/types/surface.d.ts", "default": "./src/js/surface.js" },
|
|
80
80
|
"./reserved-classes.json": "./reserved-classes.json",
|
|
81
81
|
"./components.json": "./components.json",
|
|
82
82
|
"./tokens.json": "./tokens.json",
|
|
@@ -136,6 +136,7 @@
|
|
|
136
136
|
"check:architecture": "bun scripts/check-css-architecture.js",
|
|
137
137
|
"build:dist": "bun scripts/build-dist.js",
|
|
138
138
|
"build:js": "bun scripts/build-js.js",
|
|
139
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
139
140
|
"build:themes": "bun scripts/build-themes.js",
|
|
140
141
|
"build:size": "bun scripts/build-size.js",
|
|
141
142
|
"build:pages": "bun scripts/pages.js",
|
|
@@ -160,12 +161,13 @@
|
|
|
160
161
|
"release:notes": "bun scripts/release-notes.js",
|
|
161
162
|
"test": "bun test",
|
|
162
163
|
"test:changed": "bun test --changed=master",
|
|
163
|
-
"build:all": "bun run lint && bun run build:dist && bun run build:js && bun run build:size && bun run format:docs && bun run build:docs && bun run check:docs && bun run check:doc-classes && bun run check:compat && bun run check:css-api && bun run check:color-space && bun run check:architecture && bun run check:enhance && bun run generate:reserved && bun run check:reserved && bun run generate:catalog && bun run check:catalog && bun run check:sync && bun run check:links && bun run check:templates && bun run test",
|
|
164
|
+
"build:all": "bun run lint && bun run build:dist && bun run build:js && bun run build:types && bun run build:size && bun run format:docs && bun run build:docs && bun run check:docs && bun run check:doc-classes && bun run check:compat && bun run check:css-api && bun run check:color-space && bun run check:architecture && bun run check:enhance && bun run generate:reserved && bun run check:reserved && bun run generate:catalog && bun run check:catalog && bun run check:sync && bun run check:links && bun run check:templates && bun run test",
|
|
164
165
|
"prepublishOnly": "bun run build:all"
|
|
165
166
|
},
|
|
166
167
|
"devDependencies": {
|
|
167
168
|
"@biomejs/biome": "^2.5.15",
|
|
168
|
-
"happy-dom": "^21.0.1"
|
|
169
|
+
"happy-dom": "^21.0.1",
|
|
170
|
+
"typescript": "^7.0.0"
|
|
169
171
|
},
|
|
170
172
|
"dependencies": {
|
|
171
173
|
"@lekoala/floating": "^0.3.1"
|
|
@@ -208,3 +208,23 @@
|
|
|
208
208
|
/* Vertical dividers — .menu-separator (menu.css) is the canonical way to
|
|
209
209
|
separate menu items. Flyout panels that are not menus use auto grid gap
|
|
210
210
|
declared on .flyout itself. */
|
|
211
|
+
|
|
212
|
+
/* Context-menu long press competes with the native touch gestures: Android
|
|
213
|
+
starts a text selection and iOS shows its callout under the opening menu.
|
|
214
|
+
Touch-primary devices only, so mouse users keep selecting card text. */
|
|
215
|
+
@media (pointer: coarse) {
|
|
216
|
+
[data-context-menu-long-press]:not(
|
|
217
|
+
[data-context-menu-long-press="false"],
|
|
218
|
+
[data-context-menu-long-press="none"]
|
|
219
|
+
) {
|
|
220
|
+
-webkit-touch-callout: none;
|
|
221
|
+
-webkit-user-select: none;
|
|
222
|
+
user-select: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* why: an inherited user-select: none blocks typing in fields on iOS. */
|
|
226
|
+
[data-context-menu-long-press] :is(input, textarea, [contenteditable]) {
|
|
227
|
+
-webkit-user-select: text;
|
|
228
|
+
user-select: text;
|
|
229
|
+
}
|
|
230
|
+
}
|