praxis-kit 6.5.0 → 6.6.1
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/{chunk-AM5J6PY3.js → chunk-6JILZ6GQ.js} +254 -154
- package/dist/contract/index.d.ts +11 -1
- package/dist/contract/index.js +2 -0
- package/dist/guards/index.d.ts +11 -2
- package/dist/html/index.d.ts +98 -0
- package/dist/html/index.js +878 -0
- package/dist/lit/index.d.ts +10 -0
- package/dist/lit/index.js +254 -154
- package/dist/preact/index.d.ts +19 -0
- package/dist/preact/index.js +254 -154
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +1 -1
- package/dist/react/legacy.d.ts +2 -2
- package/dist/react/legacy.js +1 -1
- package/dist/{react-options-DoFNqNdY.d.ts → react-options-BUBVohU6.d.ts} +49 -33
- package/dist/solid/index.d.ts +19 -0
- package/dist/solid/index.js +254 -154
- package/dist/svelte/index.d.ts +10 -0
- package/dist/svelte/index.js +254 -154
- package/dist/vue/index.d.ts +10 -0
- package/dist/vue/index.js +254 -154
- package/dist/web/index.d.ts +10 -0
- package/dist/web/index.js +254 -154
- package/package.json +10 -3
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ReadonlyDeep } from 'type-fest';
|
|
2
|
+
import { DiagnosticInput } from '../_shared/diagnostics.js';
|
|
3
|
+
|
|
4
|
+
type StringMap<T = unknown> = Record<string, T>;
|
|
5
|
+
type AnyRecord = StringMap<unknown>;
|
|
6
|
+
|
|
7
|
+
type IntrinsicTag = keyof HTMLElementTagNameMap;
|
|
8
|
+
|
|
9
|
+
declare const KNOWN_ARIA_ROLES: readonly ["alert", "alertdialog", "application", "article", "banner", "blockquote", "button", "caption", "cell", "checkbox", "code", "columnheader", "combobox", "complementary", "contentinfo", "definition", "deletion", "dialog", "document", "emphasis", "feed", "figure", "form", "generic", "grid", "gridcell", "group", "heading", "img", "insertion", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "meter", "navigation", "none", "note", "option", "paragraph", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "strong", "subscript", "superscript", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "time", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem"];
|
|
10
|
+
type KnownAriaRole = (typeof KNOWN_ARIA_ROLES)[number];
|
|
11
|
+
|
|
12
|
+
type AriaRole = KnownAriaRole | (string & {});
|
|
13
|
+
type IntrinsicProps = AnyRecord & {
|
|
14
|
+
role?: AriaRole;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type ValidResult = {
|
|
18
|
+
valid: true;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type AriaContext = {
|
|
22
|
+
readonly tag: IntrinsicTag;
|
|
23
|
+
readonly implicitRole: AriaRole | undefined;
|
|
24
|
+
readonly effectiveRole: string | undefined;
|
|
25
|
+
readonly props: ReadonlyDeep<IntrinsicProps>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type RemoveAttributeFixKind = `removeAttribute:${string}`;
|
|
29
|
+
type InjectLiveFixKind = `injectLive:${string}`;
|
|
30
|
+
type FixKind = 'removeRole' | 'setRole' | 'normalizeRelevantAll' | RemoveAttributeFixKind | InjectLiveFixKind;
|
|
31
|
+
|
|
32
|
+
type AriaFixResult = {
|
|
33
|
+
applied: false;
|
|
34
|
+
next: ReadonlyDeep<IntrinsicProps>;
|
|
35
|
+
} | {
|
|
36
|
+
applied: true;
|
|
37
|
+
next: ReadonlyDeep<IntrinsicProps>;
|
|
38
|
+
previous: ReadonlyDeep<IntrinsicProps>;
|
|
39
|
+
};
|
|
40
|
+
type AriaFix = {
|
|
41
|
+
readonly kind: FixKind;
|
|
42
|
+
readonly priority?: number;
|
|
43
|
+
readonly source?: string;
|
|
44
|
+
readonly apply: (context: AriaContext) => AriaFixResult;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
type Severity = 'error' | 'warning' | (string & {});
|
|
48
|
+
|
|
49
|
+
type AriaInvalidBase<M extends string = string> = {
|
|
50
|
+
valid: false;
|
|
51
|
+
severity: Severity;
|
|
52
|
+
message?: M;
|
|
53
|
+
attribute?: string;
|
|
54
|
+
diagnostic?: DiagnosticInput;
|
|
55
|
+
};
|
|
56
|
+
type AriaInvalidWithFix<M extends string = string> = AriaInvalidBase<M> & {
|
|
57
|
+
fixable: true;
|
|
58
|
+
fix: AriaFix;
|
|
59
|
+
};
|
|
60
|
+
type AriaInvalidWithoutFix<M extends string = string> = AriaInvalidBase<M> & {
|
|
61
|
+
fixable: false;
|
|
62
|
+
};
|
|
63
|
+
type AriaInvalidResult<M extends string = string> = AriaInvalidWithFix<M> | AriaInvalidWithoutFix<M>;
|
|
64
|
+
type AriaResult = ValidResult | AriaInvalidResult;
|
|
65
|
+
|
|
66
|
+
type AriaRule<C extends AriaContext = AriaContext> = ((context: C) => readonly AriaResult[]) & {
|
|
67
|
+
readonly readsProps?: readonly string[];
|
|
68
|
+
readonly tags?: readonly string[];
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
declare const landmarkRoleRule: AriaRule;
|
|
72
|
+
declare function requireAccessibleName({ tag, props }: AriaContext): readonly AriaResult[];
|
|
73
|
+
declare const landmarkAccessibleNameRule: AriaRule;
|
|
74
|
+
declare const HTML_ARIA_RULES: readonly AriaRule[];
|
|
75
|
+
|
|
76
|
+
declare const roleNotPermittedRule: AriaRule;
|
|
77
|
+
|
|
78
|
+
declare const supportedInputTypeRule: AriaRule;
|
|
79
|
+
declare const checkedRequiresCheckableTypeRule: AriaRule;
|
|
80
|
+
declare const multipleRequiresSupportedTypeRule: AriaRule;
|
|
81
|
+
declare const maxLengthRequiresTextTypeRule: AriaRule;
|
|
82
|
+
declare const minLengthRequiresTextTypeRule: AriaRule;
|
|
83
|
+
declare const patternRequiresTextTypeRule: AriaRule;
|
|
84
|
+
declare const minRequiresNumericTypeRule: AriaRule;
|
|
85
|
+
declare const maxRequiresNumericTypeRule: AriaRule;
|
|
86
|
+
declare const stepRequiresNumericTypeRule: AriaRule;
|
|
87
|
+
declare const acceptRequiresFileTypeRule: AriaRule;
|
|
88
|
+
declare const captureRequiresFileTypeRule: AriaRule;
|
|
89
|
+
declare const sizeRequiresTextTypeRule: AriaRule;
|
|
90
|
+
declare const altRequiresImageTypeRule: AriaRule;
|
|
91
|
+
declare const heightRequiresImageTypeRule: AriaRule;
|
|
92
|
+
declare const widthRequiresImageTypeRule: AriaRule;
|
|
93
|
+
declare const inputAccessibleNameRule: AriaRule;
|
|
94
|
+
declare const passwordAutocompleteRule: AriaRule;
|
|
95
|
+
declare const requiredReadOnlyConflictRule: AriaRule;
|
|
96
|
+
declare const INPUT_RULES: readonly AriaRule[];
|
|
97
|
+
|
|
98
|
+
export { HTML_ARIA_RULES, INPUT_RULES, acceptRequiresFileTypeRule, altRequiresImageTypeRule, captureRequiresFileTypeRule, checkedRequiresCheckableTypeRule, heightRequiresImageTypeRule, inputAccessibleNameRule, landmarkAccessibleNameRule, landmarkRoleRule, maxLengthRequiresTextTypeRule, maxRequiresNumericTypeRule, minLengthRequiresTextTypeRule, minRequiresNumericTypeRule, multipleRequiresSupportedTypeRule, passwordAutocompleteRule, patternRequiresTextTypeRule, requireAccessibleName, requiredReadOnlyConflictRule, roleNotPermittedRule, sizeRequiresTextTypeRule, stepRequiresNumericTypeRule, supportedInputTypeRule, widthRequiresImageTypeRule };
|