foldkit-mixins 0.3.0 → 0.5.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/README.md +459 -10
- package/dist/app.d.mts +46 -0
- package/dist/app.d.mts.map +1 -0
- package/dist/app.mjs +45 -0
- package/dist/app.mjs.map +1 -0
- package/dist/core-Bxj0UQDF.mjs +53 -0
- package/dist/core-Bxj0UQDF.mjs.map +1 -0
- package/dist/core-CUw_n1Nd.d.mts +40 -0
- package/dist/core-CUw_n1Nd.d.mts.map +1 -0
- package/dist/defaults.d.mts +31 -0
- package/dist/defaults.d.mts.map +1 -0
- package/dist/defaults.mjs +75 -0
- package/dist/defaults.mjs.map +1 -0
- package/dist/foundations.d.mts +30 -0
- package/dist/foundations.d.mts.map +1 -0
- package/dist/foundations.mjs +71 -0
- package/dist/foundations.mjs.map +1 -0
- package/dist/index.d.mts +137 -536
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +261 -1017
- package/dist/index.mjs.map +1 -1
- package/dist/layers-B31M0tDi.mjs +193 -0
- package/dist/layers-B31M0tDi.mjs.map +1 -0
- package/dist/layers.d.mts +47 -0
- package/dist/layers.d.mts.map +1 -0
- package/dist/layers.mjs +2 -0
- package/dist/layout.d.mts +114 -0
- package/dist/layout.d.mts.map +1 -0
- package/dist/layout.mjs +154 -0
- package/dist/layout.mjs.map +1 -0
- package/dist/oklch-BxvCD0oi.d.mts +135 -0
- package/dist/oklch-BxvCD0oi.d.mts.map +1 -0
- package/dist/prose.d.mts +30 -0
- package/dist/prose.d.mts.map +1 -0
- package/dist/prose.mjs +61 -0
- package/dist/prose.mjs.map +1 -0
- package/dist/root-C1u12YMD.mjs +37 -0
- package/dist/root-C1u12YMD.mjs.map +1 -0
- package/dist/root-xyWS6geK.d.mts +25 -0
- package/dist/root-xyWS6geK.d.mts.map +1 -0
- package/dist/slotItem-D6_m6IqP.d.mts +18 -0
- package/dist/slotItem-D6_m6IqP.d.mts.map +1 -0
- package/dist/slotMark-Rdsjb7XI.mjs +135 -0
- package/dist/slotMark-Rdsjb7XI.mjs.map +1 -0
- package/dist/slotView-BtIF2pHo.d.mts +476 -0
- package/dist/slotView-BtIF2pHo.d.mts.map +1 -0
- package/dist/style-CKjLee4e.mjs +1266 -0
- package/dist/style-CKjLee4e.mjs.map +1 -0
- package/dist/style-CtCqaL0l.d.mts +182 -0
- package/dist/style-CtCqaL0l.d.mts.map +1 -0
- package/dist/styleValue-BavTe9MZ.d.mts +72 -0
- package/dist/styleValue-BavTe9MZ.d.mts.map +1 -0
- package/dist/styleValue-_G9jwb17.mjs +248 -0
- package/dist/styleValue-_G9jwb17.mjs.map +1 -0
- package/dist/testing.d.mts +30 -0
- package/dist/testing.d.mts.map +1 -0
- package/dist/testing.mjs +167 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/theme.d.mts +193 -0
- package/dist/theme.d.mts.map +1 -0
- package/dist/theme.mjs +146 -0
- package/dist/theme.mjs.map +1 -0
- package/dist/tokens-BR_qxDR7.d.mts +91 -0
- package/dist/tokens-BR_qxDR7.d.mts.map +1 -0
- package/dist/tokens-DteBJVN-.mjs +117 -0
- package/dist/tokens-DteBJVN-.mjs.map +1 -0
- package/dist/utilities.d.mts +73 -0
- package/dist/utilities.d.mts.map +1 -0
- package/dist/utilities.mjs +90 -0
- package/dist/utilities.mjs.map +1 -0
- package/package.json +59 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as SlotItem } from "./slotItem-D6_m6IqP.mjs";
|
|
2
|
+
import { a as StyleCondition, i as Piece, o as StyleValue, s as StyleRule, t as Declarations } from "./styleValue-BavTe9MZ.mjs";
|
|
3
|
+
import { Layers, Placement } from "./layers.mjs";
|
|
4
|
+
import { $ as metadataToken_d_exports, A as requirement_d_exports, B as Contribution, D as UnnamedSlot, E as SlotProtection, F as AnyMixin, G as StaticContribution, H as DynamicContribution, I as Mixin, K as StaticContributionMap, L as MixinFor, M as event_d_exports, N as AttrToken, O as slot_d_exports, P as attr_d_exports, Q as capability_d_exports, R as StaticMixin, T as SlotCapability, U as InputContribution, V as ContributionContext, W as SlotContribution, Z as Satisfies, _ as Any$1, a as SlotViewRender, b as EventName, c as slotView_d_exports, d as resolver_d_exports, f as BehaviorSlotOptions, g as behavior_d_exports, h as SlotRequirements, j as EventToken, k as RequirementToken, l as ResolveOptions, m as NamedBehavior, n as SlotBuilder, o as SlotViewTransform, p as BehaviorSpec, q as Any, r as SlotBuilders, s as SlotViewTransformFor, t as MessageSlotView, u as SlotAttributes, y as AttributeName, z as mixin_d_exports } from "./slotView-BtIF2pHo.mjs";
|
|
5
|
+
import { a as NamedStyle, c as StyleOptions, d as StylesheetSource, f as Contract, i as DeclaredSlots, l as StylePieces, n as Declared, o as SlotPiece, p as slots_d_exports, r as DeclaredPieces, s as Style, t as ContainerSlot, u as StyleValues } from "./style-CtCqaL0l.mjs";
|
|
6
|
+
import { n as Theme, r as ThemeTokens, t as Refs } from "./core-CUw_n1Nd.mjs";
|
|
7
|
+
import { Attribute, KeyboardModifiers } from "foldkit/html";
|
|
3
8
|
declare namespace diagnostics_d_exports {
|
|
4
9
|
export { Diagnostic, DiagnosticCode, DiagnosticError };
|
|
5
10
|
}
|
|
@@ -9,9 +14,9 @@ declare namespace diagnostics_d_exports {
|
|
|
9
14
|
* programming errors (a definition attaches something a slot does not allow),
|
|
10
15
|
* so `resolve` throws a `DiagnosticError` carrying one.
|
|
11
16
|
*/
|
|
12
|
-
type DiagnosticCode = 'mixins:unknown-slot' | 'mixins:hidden-slot' | 'mixins:capability-mismatch' | 'mixins:unsupported-event' | 'mixins:unsupported-attribute' | 'mixins:protected-event' | 'mixins:protected-attribute' | 'mixins:protected-style-property' | 'mixins:event-conflict' | 'mixins:attribute-conflict' | 'mixins:structural-override' | 'mixins:duplicate-mount-name' | 'style:
|
|
17
|
+
type DiagnosticCode = 'mixins:unknown-slot' | 'mixins:hidden-slot' | 'mixins:capability-mismatch' | 'mixins:unsupported-event' | 'mixins:unsupported-attribute' | 'mixins:protected-event' | 'mixins:protected-attribute' | 'mixins:protected-style-property' | 'mixins:style-property-conflict' | 'mixins:event-conflict' | 'mixins:attribute-conflict' | 'mixins:structural-override' | 'mixins:duplicate-mount-name' | 'mixins:duplicate-item-id' | 'mixins:ragged-grid-areas' | 'style:duplicate-layer' | 'style:conflicting-layer-order' | 'style:unlayered-rule' | 'style:relayered' | 'theme:unparseable-breakpoint' | 'a11y:missing-slot' | 'a11y:hidden-slot' | 'a11y:capability-mismatch' | 'a11y:missing-event' | 'a11y:missing-attribute';
|
|
13
18
|
interface Diagnostic {
|
|
14
|
-
readonly source: 'mixins' | 'a11y';
|
|
19
|
+
readonly source: 'mixins' | 'a11y' | 'style' | 'theme';
|
|
15
20
|
readonly code: DiagnosticCode;
|
|
16
21
|
readonly severity: 'error';
|
|
17
22
|
readonly message: string;
|
|
@@ -22,231 +27,8 @@ declare class DiagnosticError extends Error {
|
|
|
22
27
|
readonly diagnostic: Diagnostic;
|
|
23
28
|
constructor(diagnostic: Diagnostic);
|
|
24
29
|
}
|
|
25
|
-
declare namespace metadataToken_d_exports {
|
|
26
|
-
export { Any$2 as Any, KindOf, MetadataToken, MetadataTokenTypeId, NameOf$2 as NameOf, NamesOf$2 as NamesOf, is$5 as is, make$6 as make, nameOf };
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Ported from `effect-atom-jsx/src/MetadataToken.ts`. Kinded name tokens so
|
|
30
|
-
* Event, Attr, Requirement, and Capability share one witness instead of four
|
|
31
|
-
* ad-hoc brands.
|
|
32
|
-
*/
|
|
33
|
-
declare const MetadataTokenTypeId: unique symbol;
|
|
34
|
-
interface MetadataToken<Kind extends string, Name extends string> {
|
|
35
|
-
readonly [MetadataTokenTypeId]: {
|
|
36
|
-
readonly Kind: Kind;
|
|
37
|
-
readonly Name: Name;
|
|
38
|
-
};
|
|
39
|
-
readonly kind: Kind;
|
|
40
|
-
readonly name: Name;
|
|
41
|
-
}
|
|
42
|
-
type Any$2 = MetadataToken<string, string>;
|
|
43
|
-
type NameOf$2<T> = T extends MetadataToken<any, infer Name> ? Name : T extends string ? T : never;
|
|
44
|
-
type KindOf<T> = T extends MetadataToken<infer Kind, any> ? Kind : never;
|
|
45
|
-
type NamesOf$2<T extends readonly unknown[]> = NameOf$2<T[number]>;
|
|
46
|
-
declare const make$6: <const Kind extends string, const Name extends string>(kind: Kind, name: Name) => MetadataToken<Kind, Name>;
|
|
47
|
-
declare const is$5: (value: unknown) => value is Any$2;
|
|
48
|
-
declare const nameOf: (value: string | Any$2) => string;
|
|
49
|
-
declare namespace attr_d_exports {
|
|
50
|
-
export { AriaDescribedby, AriaDisabled, AriaExpanded, AriaInvalid, AriaLabel, AriaSelected, AttrToken, Disabled, Role, Value, describe$5 as describe, equals$1 as equals, is$4 as is, make$5 as make };
|
|
51
|
-
}
|
|
52
|
-
type AttrToken<Name extends string = string> = MetadataToken<'view.attribute', Name>;
|
|
53
|
-
declare const is$4: (value: unknown) => value is AttrToken;
|
|
54
|
-
declare const make$5: <const Name extends string>(name: Name) => AttrToken<Name>;
|
|
55
|
-
declare const equals$1: (left: AttrToken, right: AttrToken) => boolean;
|
|
56
|
-
declare const describe$5: (attr: AttrToken) => {
|
|
57
|
-
readonly name: string;
|
|
58
|
-
};
|
|
59
|
-
declare const Role: AttrToken<"role">;
|
|
60
|
-
declare const AriaLabel: AttrToken<"aria-label">;
|
|
61
|
-
declare const AriaDescribedby: AttrToken<"aria-describedby">;
|
|
62
|
-
declare const AriaExpanded: AttrToken<"aria-expanded">;
|
|
63
|
-
declare const AriaSelected: AttrToken<"aria-selected">;
|
|
64
|
-
declare const AriaInvalid: AttrToken<"aria-invalid">;
|
|
65
|
-
declare const AriaDisabled: AttrToken<"aria-disabled">;
|
|
66
|
-
declare const Disabled: AttrToken<"disabled">;
|
|
67
|
-
declare const Value: AttrToken<"value">;
|
|
68
|
-
declare namespace capability_d_exports {
|
|
69
|
-
export { Any, AssignableNamesOf, Base, Capability, CapabilityParent, Collection, Container, Draggable, ExtendsOf, Focusable, Interactive, NameOf$1 as NameOf, NamesOf$1 as NamesOf, Satisfies, TextInput, describe$4 as describe, extendsCapability, is$3 as is, make$4 as make, names, satisfies };
|
|
70
|
-
}
|
|
71
|
-
type CapabilityParent = string | MetadataToken<'element.capability', string>;
|
|
72
|
-
interface Capability<Name extends string = string, Extends extends readonly CapabilityParent[] = readonly []> extends MetadataToken<'element.capability', Name> {
|
|
73
|
-
readonly extends: Extends;
|
|
74
|
-
}
|
|
75
|
-
type Any = Capability<string, readonly CapabilityParent[]>;
|
|
76
|
-
type NameOf$1<T> = NameOf$2<T>;
|
|
77
|
-
type NamesOf$1<T extends readonly unknown[]> = NamesOf$2<T>;
|
|
78
|
-
type ExtendsOf<T> = T extends Capability<any, infer Extends> ? NameOf$2<Extends[number]> : never;
|
|
79
|
-
type AssignableNamesOf<T> = T extends string ? T : T extends Capability<any, infer Extends> ? NameOf$2<T> | AssignableNamesOf<Extends[number]> : NameOf$2<T>;
|
|
80
|
-
type Satisfies<Actual, Required extends {
|
|
81
|
-
readonly name: string;
|
|
82
|
-
}> = Required['name'] extends AssignableNamesOf<Actual> ? true : false;
|
|
83
|
-
declare const is$3: (value: unknown) => value is Any;
|
|
84
|
-
declare const make$4: <const Name extends string, const Extends extends readonly CapabilityParent[] = readonly []>(name: Name, options?: {
|
|
85
|
-
readonly extends?: Extends;
|
|
86
|
-
}) => Capability<Name, Extends>;
|
|
87
|
-
/** True when `value` is `base` or inherits from it. Ported from AF-UI. */
|
|
88
|
-
declare const extendsCapability: (value: string | Any, base: string | Any) => boolean;
|
|
89
|
-
declare const satisfies: (actual: string | Any, required: string | Any) => boolean;
|
|
90
|
-
declare const names: (capability: Any) => ReadonlyArray<string>;
|
|
91
|
-
declare const describe$4: (capability: Any) => {
|
|
92
|
-
readonly name: string;
|
|
93
|
-
readonly extends: ReadonlyArray<string>;
|
|
94
|
-
};
|
|
95
|
-
declare const Base: Capability<"Base", readonly []>;
|
|
96
|
-
declare const Interactive: Capability<"Interactive", readonly [Capability<"Base", readonly []>]>;
|
|
97
|
-
declare const Container: Capability<"Container", readonly [Capability<"Interactive", readonly [Capability<"Base", readonly []>]>]>;
|
|
98
|
-
declare const Focusable: Capability<"Focusable", readonly [Capability<"Interactive", readonly [Capability<"Base", readonly []>]>]>;
|
|
99
|
-
declare const TextInput: Capability<"TextInput", readonly [Capability<"Focusable", readonly [Capability<"Interactive", readonly [Capability<"Base", readonly []>]>]>]>;
|
|
100
|
-
declare const Draggable: Capability<"Draggable", readonly [Capability<"Interactive", readonly [Capability<"Base", readonly []>]>]>;
|
|
101
|
-
declare const Collection: Capability<"Collection", readonly [Capability<"Base", readonly []>]>;
|
|
102
|
-
declare namespace event_d_exports {
|
|
103
|
-
export { Blur, Cancel, Change, Click, EventToken, Focus, Hover, Input, KeyDown, PointerDown, PointerUp, Press, Submit, describe$3 as describe, equals, is$2 as is, make$3 as make };
|
|
104
|
-
}
|
|
105
|
-
type EventToken<Name extends string = string> = MetadataToken<'view.event', Name>;
|
|
106
|
-
declare const is$2: (value: unknown) => value is EventToken;
|
|
107
|
-
declare const make$3: <const Name extends string>(name: Name) => EventToken<Name>;
|
|
108
|
-
declare const equals: (left: EventToken, right: EventToken) => boolean;
|
|
109
|
-
declare const describe$3: (event: EventToken) => {
|
|
110
|
-
readonly name: string;
|
|
111
|
-
};
|
|
112
|
-
declare const Press: EventToken<"press">;
|
|
113
|
-
declare const Click: EventToken<"click">;
|
|
114
|
-
declare const Cancel: EventToken<"cancel">;
|
|
115
|
-
declare const Input: EventToken<"input">;
|
|
116
|
-
declare const Change: EventToken<"change">;
|
|
117
|
-
declare const Focus: EventToken<"focus">;
|
|
118
|
-
declare const Blur: EventToken<"blur">;
|
|
119
|
-
declare const KeyDown: EventToken<"keydown">;
|
|
120
|
-
declare const PointerDown: EventToken<"pointerdown">;
|
|
121
|
-
declare const PointerUp: EventToken<"pointerup">;
|
|
122
|
-
declare const Hover: EventToken<"hover">;
|
|
123
|
-
declare const Submit: EventToken<"submit">;
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/pipe.d.ts
|
|
126
|
-
type Pipeable<Self> = {
|
|
127
|
-
pipe(): Self;
|
|
128
|
-
pipe(...fns: ReadonlyArray<(self: Self) => Self>): Self;
|
|
129
|
-
pipe<A>(ab: (self: Self) => A): A;
|
|
130
|
-
pipe<A, B>(ab: (self: Self) => A, bc: (a: A) => B): B;
|
|
131
|
-
pipe<A, B, C>(ab: (self: Self) => A, bc: (a: A) => B, cd: (b: B) => C): C;
|
|
132
|
-
};
|
|
133
|
-
declare namespace requirement_d_exports {
|
|
134
|
-
export { Clipboard, Keyboard, Pointer, RequirementToken, describe$2 as describe, is$1 as is, make$2 as make };
|
|
135
|
-
}
|
|
136
|
-
type RequirementToken<Name extends string = string> = MetadataToken<'view.requirement', Name>;
|
|
137
|
-
declare const is$1: (value: unknown) => value is RequirementToken;
|
|
138
|
-
declare const make$2: <const Name extends string>(name: Name) => RequirementToken<Name>;
|
|
139
|
-
declare const describe$2: (requirement: RequirementToken) => {
|
|
140
|
-
readonly name: string;
|
|
141
|
-
};
|
|
142
|
-
declare const Keyboard: RequirementToken<"keyboard">;
|
|
143
|
-
declare const Pointer: RequirementToken<"pointer">;
|
|
144
|
-
declare const Clipboard: RequirementToken<"clipboard">;
|
|
145
|
-
declare namespace slot_d_exports {
|
|
146
|
-
export { Any$1 as Any, AssignableCapabilityNamesOf, AttributeName, AttributesOf, CapabilityOf, CapabilityValueOf, EventName, EventsOf, Hidden$1 as Hidden, HiddenOf, MakeOptions, NameOf, Public, RequirementName, Slot, SlotCapability, SlotMetadata, SlotProtection, SlotTypeId, UnnamedSlot, attributes, capability, describe$1 as describe, events, hide, is, make$1 as make, requires };
|
|
147
|
-
}
|
|
148
|
-
declare const SlotTypeId: unique symbol;
|
|
149
|
-
type SlotTypeId = typeof SlotTypeId;
|
|
150
|
-
type EventName = string | EventToken;
|
|
151
|
-
type AttributeName = string | AttrToken;
|
|
152
|
-
type RequirementName = string | RequirementToken;
|
|
153
|
-
type SlotCapability = string | Any;
|
|
154
|
-
interface SlotProtection {
|
|
155
|
-
readonly events: ReadonlyArray<EventName>;
|
|
156
|
-
readonly attributes: ReadonlyArray<AttributeName>;
|
|
157
|
-
readonly style: ReadonlyArray<string>;
|
|
158
|
-
}
|
|
159
|
-
interface SlotMetadata<Name extends string = string> {
|
|
160
|
-
readonly name: Name;
|
|
161
|
-
readonly capability: SlotCapability;
|
|
162
|
-
readonly allowedEvents: readonly EventName[];
|
|
163
|
-
readonly allowedAttributes: readonly AttributeName[];
|
|
164
|
-
readonly platformRequirements: readonly RequirementName[];
|
|
165
|
-
readonly hidden: boolean;
|
|
166
|
-
readonly protected: SlotProtection;
|
|
167
|
-
}
|
|
168
|
-
interface Slot<Name extends string = string, C extends SlotCapability = typeof Base, Events extends readonly EventName[] = readonly [], Attributes extends readonly AttributeName[] = readonly [], Requirements extends readonly RequirementName[] = readonly [], Hidden extends boolean = false> extends Pipeable<Slot<Name, C, Events, Attributes, Requirements, Hidden>> {
|
|
169
|
-
readonly [SlotTypeId]: {
|
|
170
|
-
readonly Name: Name;
|
|
171
|
-
readonly Capability: C;
|
|
172
|
-
readonly Events: Events;
|
|
173
|
-
readonly Attributes: Attributes;
|
|
174
|
-
readonly Requirements: Requirements;
|
|
175
|
-
readonly Hidden: Hidden;
|
|
176
|
-
};
|
|
177
|
-
readonly name: Name;
|
|
178
|
-
readonly capability: C;
|
|
179
|
-
readonly events: Events;
|
|
180
|
-
readonly attributes: Attributes;
|
|
181
|
-
readonly requirements: Requirements;
|
|
182
|
-
readonly hidden: Hidden;
|
|
183
|
-
readonly protected: SlotProtection;
|
|
184
|
-
readonly metadata: SlotMetadata<Name> & {
|
|
185
|
-
readonly capability: C;
|
|
186
|
-
readonly allowedEvents: Events;
|
|
187
|
-
readonly allowedAttributes: Attributes;
|
|
188
|
-
readonly platformRequirements: Requirements;
|
|
189
|
-
readonly hidden: Hidden;
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
type Any$1 = Slot<string, SlotCapability, readonly EventName[], readonly AttributeName[], readonly RequirementName[], boolean>;
|
|
193
|
-
type UnnamedSlot<C extends SlotCapability = SlotCapability, Events extends readonly EventName[] = readonly EventName[], Attributes extends readonly AttributeName[] = readonly AttributeName[], Requirements extends readonly RequirementName[] = readonly RequirementName[], Hidden extends boolean = boolean> = Omit<Slot<'', C, Events, Attributes, Requirements, Hidden>, 'name'> & {
|
|
194
|
-
readonly name?: never;
|
|
195
|
-
};
|
|
196
|
-
type NameOf<T> = T extends Slot<infer Name, any, any, any, any, any> ? Name : never;
|
|
197
|
-
type CapabilityOf<T> = T extends Slot<any, infer C, any, any, any, any> ? NameOf$2<C> : never;
|
|
198
|
-
type CapabilityValueOf<T> = T extends Slot<any, infer C, any, any, any, any> ? C : never;
|
|
199
|
-
type EventsOf<T> = T extends Slot<any, any, infer Events, any, any, any> ? NamesOf$2<Events> : never;
|
|
200
|
-
type AttributesOf<T> = T extends Slot<any, any, any, infer Attributes, any, any> ? NamesOf$2<Attributes> : never;
|
|
201
|
-
type HiddenOf<T> = T extends Slot<any, any, any, any, any, infer Hidden> ? Hidden : never;
|
|
202
|
-
type AssignableCapabilityNamesOf<T> = AssignableNamesOf<CapabilityValueOf<T>>;
|
|
203
|
-
type Public<T> = HiddenOf<T> extends true ? never : T;
|
|
204
|
-
type Hidden$1<T> = HiddenOf<T> extends true ? T : never;
|
|
205
|
-
declare const is: (value: unknown) => value is Any$1 | UnnamedSlot;
|
|
206
|
-
interface MakeOptions<C extends SlotCapability = SlotCapability, Events extends readonly EventName[] = readonly EventName[], Attributes extends readonly AttributeName[] = readonly AttributeName[], Requirements extends readonly RequirementName[] = readonly RequirementName[], Hidden extends boolean = boolean> {
|
|
207
|
-
readonly capability?: C;
|
|
208
|
-
readonly events?: Events;
|
|
209
|
-
readonly allowedEvents?: Events;
|
|
210
|
-
readonly attributes?: Attributes;
|
|
211
|
-
readonly allowedAttributes?: Attributes;
|
|
212
|
-
readonly requirements?: Requirements;
|
|
213
|
-
readonly platformRequirements?: Requirements;
|
|
214
|
-
readonly hidden?: Hidden;
|
|
215
|
-
readonly protected?: {
|
|
216
|
-
readonly events?: ReadonlyArray<EventName>;
|
|
217
|
-
readonly attributes?: ReadonlyArray<AttributeName>;
|
|
218
|
-
readonly style?: ReadonlyArray<string>;
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
/** AF-UI form: name is the first argument. */
|
|
222
|
-
declare function make$1<const Name extends string, const C extends SlotCapability = typeof Base, const Events extends readonly EventName[] = readonly [], const Attributes extends readonly AttributeName[] = readonly [], const Requirements extends readonly RequirementName[] = readonly [], const Hidden extends boolean = false>(name: Name, options?: MakeOptions<C, Events, Attributes, Requirements, Hidden>): Slot<Name, C, Events, Attributes, Requirements, Hidden>;
|
|
223
|
-
/** Foldkit form: name comes from `Slots.define` keys. */
|
|
224
|
-
declare function make$1<const C extends SlotCapability = typeof Base, const Events extends readonly EventName[] = readonly [], const Attributes extends readonly AttributeName[] = readonly [], const Requirements extends readonly RequirementName[] = readonly [], const Hidden extends boolean = false>(options: MakeOptions<C, Events, Attributes, Requirements, Hidden>): UnnamedSlot<C, Events, Attributes, Requirements, Hidden>;
|
|
225
|
-
/** Pipeable transform replacing a named slot's capability. */
|
|
226
|
-
declare const capability: <const C extends SlotCapability>(capability: C) => <Name extends string, OldC extends SlotCapability, Events extends readonly EventName[], Attributes extends readonly AttributeName[], Requirements extends readonly RequirementName[], Hidden extends boolean>(slot: Slot<Name, OldC, Events, Attributes, Requirements, Hidden>) => Slot<Name, C, Events, Attributes, Requirements, Hidden>;
|
|
227
|
-
/** Pipeable transform replacing a named slot's allowed events. */
|
|
228
|
-
declare const events: <const Next extends readonly EventName[]>(...next: Next) => <Name extends string, C extends SlotCapability, Events extends readonly EventName[], Attributes extends readonly AttributeName[], Requirements extends readonly RequirementName[], Hidden extends boolean>(slot: Slot<Name, C, Events, Attributes, Requirements, Hidden>) => Slot<Name, C, Next, Attributes, Requirements, Hidden>;
|
|
229
|
-
/** Pipeable transform replacing a named slot's allowed attributes. */
|
|
230
|
-
declare const attributes: <const Next extends readonly AttributeName[]>(...next: Next) => <Name extends string, C extends SlotCapability, Events extends readonly EventName[], Attributes extends readonly AttributeName[], Requirements extends readonly RequirementName[], Hidden extends boolean>(slot: Slot<Name, C, Events, Attributes, Requirements, Hidden>) => Slot<Name, C, Events, Next, Requirements, Hidden>;
|
|
231
|
-
/** Pipeable transform replacing a named slot's platform requirements. */
|
|
232
|
-
declare const requires: <const Next extends readonly RequirementName[]>(...next: Next) => <Name extends string, C extends SlotCapability, Events extends readonly EventName[], Attributes extends readonly AttributeName[], Requirements extends readonly RequirementName[], Hidden extends boolean>(slot: Slot<Name, C, Events, Attributes, Requirements, Hidden>) => Slot<Name, C, Events, Attributes, Next, Hidden>;
|
|
233
|
-
/** Pipeable transform marking a named slot hidden from public attachment. */
|
|
234
|
-
declare const hide: <Name extends string, C extends SlotCapability, Events extends readonly EventName[], Attributes extends readonly AttributeName[], Requirements extends readonly RequirementName[], Hidden extends boolean>(slot: Slot<Name, C, Events, Attributes, Requirements, Hidden>) => Slot<Name, C, Events, Attributes, Requirements, true>;
|
|
235
|
-
declare const describe$1: (slot: Any$1 | UnnamedSlot) => {
|
|
236
|
-
readonly name?: string;
|
|
237
|
-
readonly capability: string;
|
|
238
|
-
readonly events: ReadonlyArray<string>;
|
|
239
|
-
readonly attributes: ReadonlyArray<string>;
|
|
240
|
-
readonly requirements: ReadonlyArray<string>;
|
|
241
|
-
readonly hidden: boolean;
|
|
242
|
-
readonly protected: {
|
|
243
|
-
readonly events: ReadonlyArray<string>;
|
|
244
|
-
readonly attributes: ReadonlyArray<string>;
|
|
245
|
-
readonly style: ReadonlyArray<string>;
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
30
|
declare namespace a11y_d_exports {
|
|
249
|
-
export { A11yDiagnostic, A11yDiagnosticCode, Pattern, PatternTypeId, Requirements
|
|
31
|
+
export { A11yDiagnostic, A11yDiagnosticCode, Pattern, PatternTypeId, Requirements, SlotRequirement, pattern, validate };
|
|
250
32
|
}
|
|
251
33
|
type A11yDiagnosticCode = 'a11y:missing-slot' | 'a11y:hidden-slot' | 'a11y:capability-mismatch' | 'a11y:missing-event' | 'a11y:missing-attribute';
|
|
252
34
|
interface A11yDiagnostic extends Diagnostic {
|
|
@@ -260,59 +42,18 @@ interface SlotRequirement {
|
|
|
260
42
|
/** An absent slot is expected, not a diagnostic. A present slot is still checked. */
|
|
261
43
|
readonly optional?: boolean;
|
|
262
44
|
}
|
|
263
|
-
type Requirements
|
|
45
|
+
type Requirements = Readonly<Record<string, SlotRequirement>>;
|
|
264
46
|
declare const PatternTypeId: unique symbol;
|
|
265
|
-
interface Pattern<Spec extends Requirements
|
|
47
|
+
interface Pattern<Spec extends Requirements = Requirements> {
|
|
266
48
|
readonly [PatternTypeId]: {
|
|
267
49
|
readonly Requirements: Spec;
|
|
268
50
|
};
|
|
269
51
|
readonly requirements: Spec;
|
|
270
52
|
}
|
|
271
|
-
declare const pattern: <const Spec extends Requirements
|
|
53
|
+
declare const pattern: <const Spec extends Requirements>(spec: Spec) => Pattern<Spec>;
|
|
272
54
|
declare const validate: (pattern: Pattern, slots: {
|
|
273
55
|
readonly [name: string]: Any$1;
|
|
274
56
|
}) => ReadonlyArray<A11yDiagnostic>;
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region src/contribution.d.ts
|
|
277
|
-
interface StaticContribution<Message> {
|
|
278
|
-
readonly classes?: ReadonlyArray<string>;
|
|
279
|
-
readonly style?: Readonly<Record<string, string>>;
|
|
280
|
-
readonly attributes?: ReadonlyArray<Attribute<Message> | ChildAttribute>;
|
|
281
|
-
readonly mounts?: ReadonlyArray<MountAction<Message, any>>;
|
|
282
|
-
/** Compiled rule CSS for a class this contribution introduces. */
|
|
283
|
-
readonly css?: string;
|
|
284
|
-
/** Class-independent CSS this contribution introduces (keyframes, layers). */
|
|
285
|
-
readonly globalCss?: string;
|
|
286
|
-
}
|
|
287
|
-
interface ContributionContext<Message> {
|
|
288
|
-
readonly input: unknown;
|
|
289
|
-
readonly h: HtmlBuilder<Message>;
|
|
290
|
-
}
|
|
291
|
-
type DynamicContribution<Message> = (context: ContributionContext<Message>) => StaticContribution<Message>;
|
|
292
|
-
/**
|
|
293
|
-
* A contribution that reads the view input but names no Message universe, so it
|
|
294
|
-
* stays assignable to any view. Input-driven Style (`Style.whenInput`) compiles
|
|
295
|
-
* to this. It never receives `h`, because a conditional style emits no handlers.
|
|
296
|
-
*/
|
|
297
|
-
type InputContribution<Message = never> = (context: {
|
|
298
|
-
readonly input: unknown;
|
|
299
|
-
}) => StaticContribution<Message>;
|
|
300
|
-
type SlotContribution<Message> = StaticContribution<Message> | DynamicContribution<Message>;
|
|
301
|
-
type Contribution<Message> = {
|
|
302
|
-
readonly [slot: string]: SlotContribution<Message> | undefined;
|
|
303
|
-
};
|
|
304
|
-
type StaticContributionMap<Message> = {
|
|
305
|
-
readonly [slot: string]: StaticContribution<Message> | undefined;
|
|
306
|
-
};
|
|
307
|
-
declare namespace resolver_d_exports {
|
|
308
|
-
export { ResolveOptions, SlotAttributes, resolve };
|
|
309
|
-
}
|
|
310
|
-
type SlotAttributes<Message> = ReadonlyArray<Attribute<Message> | ChildAttribute>;
|
|
311
|
-
interface ResolveOptions {
|
|
312
|
-
readonly slot?: string;
|
|
313
|
-
readonly protected?: SlotProtection;
|
|
314
|
-
}
|
|
315
|
-
declare const resolve: <Message>(base: SlotAttributes<Message> | undefined, contributions: ReadonlyArray<StaticContribution<Message>>, options?: ResolveOptions) => SlotAttributes<Message>;
|
|
316
57
|
declare namespace attributes_d_exports {
|
|
317
58
|
export { Of, Tag, filter, find, tagOf };
|
|
318
59
|
}
|
|
@@ -328,276 +69,136 @@ declare const tagOf: <Message>(attribute: SlotAttributes<Message>[number]) => Ta
|
|
|
328
69
|
declare const find: <Message, T extends Tag>(attributes: SlotAttributes<Message>, tag: T) => Of<Message, T> | undefined;
|
|
329
70
|
/** Every attribute with `tag`, in bundle order. */
|
|
330
71
|
declare const filter: <Message, T extends Tag>(attributes: SlotAttributes<Message>, tag: T) => ReadonlyArray<Of<Message, T>>;
|
|
331
|
-
declare namespace
|
|
332
|
-
export {
|
|
72
|
+
declare namespace collection_d_exports {
|
|
73
|
+
export { BehaviorOptions, Describe, Items, behavior$4 as behavior, of };
|
|
74
|
+
}
|
|
75
|
+
interface Items<T> {
|
|
76
|
+
readonly size: number;
|
|
77
|
+
/** In render order; unique. */
|
|
78
|
+
readonly ids: ReadonlyArray<string>;
|
|
79
|
+
readonly at: (index: number) => T | undefined;
|
|
80
|
+
/** `-1` when no item has the id. */
|
|
81
|
+
readonly indexOf: (id: string) => number;
|
|
82
|
+
readonly isDisabled: (index: number) => boolean;
|
|
83
|
+
/** Indices of the enabled items, in order. */
|
|
84
|
+
readonly enabled: ReadonlyArray<number>;
|
|
85
|
+
/** The item context for `slots.x.attrs(base, item)`. */
|
|
86
|
+
readonly slotItem: (index: number) => SlotItem;
|
|
87
|
+
}
|
|
88
|
+
interface Describe<T> {
|
|
89
|
+
readonly id: (item: T, index: number) => string;
|
|
90
|
+
readonly disabled?: (item: T, index: number) => boolean;
|
|
91
|
+
}
|
|
92
|
+
/** Describes `items` once. Two items with one id are refused, since an id is what
|
|
93
|
+
* `aria-activedescendant`, `aria-controls`, and a keyed row rely on. */
|
|
94
|
+
declare const of: <T>(items: ReadonlyArray<T>, describe: Describe<T>) => Items<T>;
|
|
95
|
+
interface BehaviorOptions<Input, Slots> {
|
|
96
|
+
/** The slot rendered once per item. */
|
|
97
|
+
readonly item: keyof Slots & string;
|
|
98
|
+
/** Reads the described items from the view's input. */
|
|
99
|
+
readonly items: (input: Input) => Items<unknown>;
|
|
100
|
+
/** Write `aria-posinset` and `aria-setsize` on each item. Default `false`. */
|
|
101
|
+
readonly posInSet?: boolean;
|
|
102
|
+
/** Write `id` on each item, from its described id. Default `true`. */
|
|
103
|
+
readonly ids?: boolean;
|
|
333
104
|
}
|
|
334
|
-
interface Mixin<Message = never> {
|
|
335
|
-
readonly name: string;
|
|
336
|
-
readonly contributions: Contribution<Message>;
|
|
337
|
-
}
|
|
338
|
-
interface StaticMixin<Message = never> {
|
|
339
|
-
readonly name: string;
|
|
340
|
-
readonly contributions: StaticContributionMap<Message>;
|
|
341
|
-
}
|
|
342
|
-
type AnyMixin = Mixin<any> | StaticMixin<any>;
|
|
343
|
-
/**
|
|
344
|
-
* A Mixin acceptable in any context of `Message`. `Mixin<never>` is included
|
|
345
|
-
* explicitly because a message-free dynamic Mixin (input-driven Style) does not
|
|
346
|
-
* widen to `Mixin<Message>` — `HtmlBuilder` is invariant in `Message`.
|
|
347
|
-
*/
|
|
348
|
-
type MixinFor<Message> = Mixin<Message> | StaticMixin<Message> | Mixin<never>;
|
|
349
|
-
declare const isDynamic: <Message>(contribution: SlotContribution<Message>) => contribution is DynamicContribution<Message>;
|
|
350
|
-
declare const evaluate: <Message>(contribution: SlotContribution<Message>, context: ContributionContext<Message>) => StaticContribution<Message>;
|
|
351
|
-
declare const make: <Message = never>(name: string, contributions: StaticContributionMap<Message>) => StaticMixin<Message>;
|
|
352
|
-
declare const dynamic: <Message = never>(name: string, contributions: Contribution<Message>) => Mixin<Message>;
|
|
353
|
-
declare const empty: <Message = never>() => StaticMixin<Message>;
|
|
354
|
-
declare const compose: <Message = never>(...mixins: ReadonlyArray<MixinFor<Message>>) => Mixin<Message>;
|
|
355
|
-
declare const contributionsFor: <Message>(mixin: Mixin<Message> | StaticMixin<Message>, slot: string) => SlotContribution<Message> | undefined;
|
|
356
|
-
declare namespace slotView_d_exports {
|
|
357
|
-
export { MessageSlotView, SlotBuilder, SlotBuilders, SlotView, SlotViewRender, SlotViewTransform, SlotViewTransformFor, attach$1 as attach, buildersFor, define$1 as define, forMessages, inertBuilder };
|
|
358
|
-
}
|
|
359
|
-
type SlotBuilder<Message> = {
|
|
360
|
-
readonly attrs: (base?: SlotAttributes<Message>) => SlotAttributes<Message>;
|
|
361
|
-
};
|
|
362
|
-
type SlotBuilders<Slots, Message> = { readonly [K in keyof Slots]: SlotBuilder<Message>; };
|
|
363
|
-
type SlotViewRender<Slots, Input, Message> = (input: Input, slots: SlotBuilders<Slots, Message>, h: HtmlBuilder<Message>) => Html;
|
|
364
|
-
interface SlotView<Slots, Input, Message> extends Pipeable<SlotView<Slots, Input, Message>> {
|
|
365
|
-
(input: Input, h: HtmlBuilder<Message>): Html;
|
|
366
|
-
readonly name?: string;
|
|
367
|
-
readonly slots: Slots;
|
|
368
|
-
readonly mixins: ReadonlyArray<MixinFor<Message>>;
|
|
369
|
-
readonly render: SlotViewRender<Slots, Input, Message>;
|
|
370
|
-
}
|
|
371
|
-
/** Build one `attrs` resolver per published slot, evaluating Mixins lazily. */
|
|
372
|
-
declare const buildersFor: <Slots, Message, Input>(slots: Slots, mixins: ReadonlyArray<MixinFor<Message>>, context: {
|
|
373
|
-
readonly input: Input;
|
|
374
|
-
readonly h: HtmlBuilder<Message>;
|
|
375
|
-
}) => SlotBuilders<Slots, Message>;
|
|
376
|
-
/**
|
|
377
|
-
* Defines a view over published Slots.
|
|
378
|
-
*
|
|
379
|
-
* `Message` has no anchor but the render callback's builder, so it is inferred
|
|
380
|
-
* from an explicit `h: HtmlBuilder<Message>` annotation on that parameter.
|
|
381
|
-
* Without one it resolves to `unknown`, and the first error appears later and
|
|
382
|
-
* elsewhere — an invariance mismatch at `Style.attach`/`Behavior.attach` that
|
|
383
|
-
* does not name the missing annotation. `forMessages<Message>()` fixes the
|
|
384
|
-
* Message universe up front instead, and leaves `h` contextually typed.
|
|
385
|
-
*/
|
|
386
|
-
declare const define$1: <Slots, Input, Message>(slots: Slots, render: SlotViewRender<Slots, Input, Message>, options?: {
|
|
387
|
-
readonly name?: string;
|
|
388
|
-
}) => SlotView<Slots, Input, Message>;
|
|
389
|
-
/**
|
|
390
|
-
* Foldkit's `inertHtml` typed for a Message universe, for rendering a view
|
|
391
|
-
* outside a runtime (tests, demos, static description). `inertHtml` is
|
|
392
|
-
* `HtmlBuilder<never>`, and the builder is invariant in `Message`, so this is
|
|
393
|
-
* the one cast: sound because inert handlers are never dispatched.
|
|
394
|
-
*/
|
|
395
|
-
declare const inertBuilder: <Message>() => HtmlBuilder<Message>;
|
|
396
|
-
/** The `SlotView` constructors with `Message` already fixed. */
|
|
397
|
-
interface MessageSlotView<Message> {
|
|
398
|
-
readonly define: <Slots, Input>(slots: Slots, render: SlotViewRender<Slots, Input, Message>, options?: {
|
|
399
|
-
readonly name?: string;
|
|
400
|
-
}) => SlotView<Slots, Input, Message>;
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Binds the view constructors to one Message universe, so the render callback
|
|
404
|
-
* no longer has to annotate `h` to pin it. `Input` is still inferred from the
|
|
405
|
-
* callback's own `input` annotation.
|
|
406
|
-
*
|
|
407
|
-
* @example
|
|
408
|
-
* ```ts
|
|
409
|
-
* const Field = SlotView.forMessages<Message>().define(
|
|
410
|
-
* FieldSlots,
|
|
411
|
-
* (input: FieldInput, slots, h) =>
|
|
412
|
-
* h.input(slots.input.attrs([h.OnInput(value => Message.ChangedValue({ value }))])),
|
|
413
|
-
* )
|
|
414
|
-
* ```
|
|
415
|
-
*/
|
|
416
|
-
declare const forMessages: <Message>() => MessageSlotView<Message>;
|
|
417
|
-
/** A transform on any view, used by Message-free static mixins such as Style. */
|
|
418
|
-
type SlotViewTransform = <Slots, Input, Message>(view: SlotView<Slots, Input, Message>) => SlotView<Slots, Input, Message>;
|
|
419
|
-
/** A transform restricted to one Message universe, for Behavior mixins. */
|
|
420
|
-
type SlotViewTransformFor<Message> = <Slots, Input>(view: SlotView<Slots, Input, Message>) => SlotView<Slots, Input, Message>;
|
|
421
|
-
/** Attach one Mixin. Returns a new view; the original is unchanged. */
|
|
422
|
-
declare function attach$1(mixin: StaticMixin<never> | Mixin<never>): SlotViewTransform;
|
|
423
|
-
declare function attach$1<MixinMessage>(mixin: Mixin<MixinMessage>): SlotViewTransformFor<MixinMessage>;
|
|
424
|
-
declare namespace behavior_d_exports {
|
|
425
|
-
export { Behavior, BehaviorSlotOptions, BehaviorSpec, NamedBehavior, SlotRequirements, attach, forSlots, slot };
|
|
426
|
-
}
|
|
427
|
-
interface SlotRequirements {
|
|
428
|
-
readonly capability?: SlotCapability;
|
|
429
|
-
readonly events?: ReadonlyArray<EventName>;
|
|
430
|
-
readonly attributes?: ReadonlyArray<AttributeName>;
|
|
431
|
-
}
|
|
432
|
-
interface BehaviorSlotOptions<Input, Message> {
|
|
433
|
-
readonly requires?: SlotRequirements;
|
|
434
|
-
readonly attributes?: (context: {
|
|
435
|
-
readonly input: Input;
|
|
436
|
-
readonly h: HtmlBuilder<Message>;
|
|
437
|
-
}) => ReadonlyArray<Attribute<Message> | ChildAttribute>;
|
|
438
|
-
readonly mount?: (input: Input) => MountAction<Message, any>;
|
|
439
|
-
}
|
|
440
|
-
type BehaviorSpec<Slots, Input, Message> = { readonly [K in keyof Slots as HiddenOf<Slots[K]> extends true ? never : K]?: BehaviorSlotOptions<Input, Message>; };
|
|
441
|
-
interface NamedBehavior<Slots, Input, Message> {
|
|
442
|
-
readonly name?: string;
|
|
443
|
-
readonly spec: BehaviorSpec<Slots, Input, Message>;
|
|
444
|
-
readonly mixin: Mixin<Message>;
|
|
445
|
-
}
|
|
446
|
-
/** Identity helper; `forSlots` supplies the contextual `Input`/`Message`. */
|
|
447
|
-
declare const slot: <Options extends BehaviorSlotOptions<any, any>>(options: Options) => Options;
|
|
448
|
-
declare const forSlots: <Slots>(slots: Slots) => <Input, Message>(spec: BehaviorSpec<Slots, Input, Message>, options?: {
|
|
449
|
-
readonly name?: string;
|
|
450
|
-
}) => NamedBehavior<Slots, Input, Message>;
|
|
451
105
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
* input type.
|
|
106
|
+
* Writes each item's identity and position: `id` from the described id,
|
|
107
|
+
* `aria-disabled` for a disabled item, and `aria-posinset` and `aria-setsize`
|
|
108
|
+
* on request. Reads the item context the view passes to `attrs`; with none it
|
|
109
|
+
* contributes nothing, so a slot rendered once is left alone.
|
|
457
110
|
*/
|
|
458
|
-
declare const
|
|
459
|
-
declare
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
readonly
|
|
111
|
+
declare const behavior$4: <Slots>(slots: Slots) => <Input, Message>(options: BehaviorOptions<Input, Slots>) => NamedBehavior<Slots, Input, Message>;
|
|
112
|
+
declare namespace disclosure_d_exports {
|
|
113
|
+
export { Options$3 as Options, behavior$3 as behavior };
|
|
114
|
+
}
|
|
115
|
+
interface Options$3<Input, Slots> {
|
|
116
|
+
readonly trigger: keyof Slots & string;
|
|
117
|
+
readonly content: keyof Slots & string;
|
|
118
|
+
readonly open: (input: Input) => boolean;
|
|
119
|
+
/** The content's id, which `aria-controls` names. */
|
|
120
|
+
readonly id: (input: Input) => string;
|
|
121
|
+
}
|
|
122
|
+
declare const behavior$3: <Slots>(slots: Slots) => <Input, Message>(options: Options$3<Input, Slots>) => NamedBehavior<Slots, Input, Message>;
|
|
123
|
+
declare namespace field_association_d_exports {
|
|
124
|
+
export { Options$2 as Options, behavior$2 as behavior, ids };
|
|
125
|
+
}
|
|
126
|
+
interface Options$2<Input, Slots> {
|
|
127
|
+
readonly control: keyof Slots & string;
|
|
128
|
+
readonly label: keyof Slots & string;
|
|
129
|
+
readonly description?: keyof Slots & string;
|
|
130
|
+
readonly error?: keyof Slots & string;
|
|
131
|
+
readonly id: (input: Input) => string;
|
|
132
|
+
/** The error slot is rendered and describes the control. */
|
|
133
|
+
readonly invalid?: (input: Input) => boolean;
|
|
134
|
+
readonly required?: (input: Input) => boolean;
|
|
135
|
+
}
|
|
136
|
+
/** The ids one base id yields, for a view that renders these elements itself. */
|
|
137
|
+
declare const ids: (id: string) => {
|
|
138
|
+
control: string;
|
|
139
|
+
label: string;
|
|
140
|
+
description: string;
|
|
141
|
+
error: string;
|
|
465
142
|
};
|
|
466
|
-
declare
|
|
467
|
-
|
|
143
|
+
declare const behavior$2: <Slots>(slots: Slots) => <Input, Message>(options: Options$2<Input, Slots>) => NamedBehavior<Slots, Input, Message>;
|
|
144
|
+
declare namespace spin_value_d_exports {
|
|
145
|
+
export { Bounds, Options$1 as Options, behavior$1 as behavior, spin };
|
|
146
|
+
}
|
|
147
|
+
interface Bounds {
|
|
148
|
+
readonly min?: number;
|
|
149
|
+
readonly max?: number;
|
|
150
|
+
/** Default `1`. */
|
|
151
|
+
readonly step?: number;
|
|
152
|
+
/** PageUp and PageDown move by this; default ten steps. */
|
|
153
|
+
readonly page?: number;
|
|
154
|
+
}
|
|
155
|
+
/** The value the key moves to, or `undefined` when the key is not a spin key or a chord. */
|
|
156
|
+
declare const spin: (value: number, key: string, modifiers: KeyboardModifiers, bounds: Bounds) => number | undefined;
|
|
157
|
+
interface Options$1<Input, Message, Slots> extends Bounds {
|
|
158
|
+
readonly control: keyof Slots & string;
|
|
159
|
+
readonly value: (input: Input) => number;
|
|
160
|
+
readonly onChange: (next: number) => Message;
|
|
161
|
+
/** For `aria-valuetext`, when the number alone would not read well. */
|
|
162
|
+
readonly text?: (input: Input) => string;
|
|
163
|
+
}
|
|
164
|
+
declare const behavior$1: <Slots>(slots: Slots) => <Input, Message>(options: Options$1<Input, Message, Slots>) => NamedBehavior<Slots, Input, Message>;
|
|
165
|
+
declare namespace toggle_state_d_exports {
|
|
166
|
+
export { Options, State, behavior };
|
|
167
|
+
}
|
|
168
|
+
type State = boolean | 'mixed';
|
|
169
|
+
interface Options<Input, Slots> {
|
|
170
|
+
readonly control: keyof Slots & string;
|
|
171
|
+
readonly state: (input: Input) => State;
|
|
172
|
+
/** `'checked'` writes `aria-checked` (checkbox, switch, radio, option);
|
|
173
|
+
* `'pressed'` writes `aria-pressed` (a toggle button). */
|
|
174
|
+
readonly as: 'checked' | 'pressed';
|
|
175
|
+
}
|
|
176
|
+
declare const behavior: <Slots>(slots: Slots) => <Input, Message>(options: Options<Input, Slots>) => NamedBehavior<Slots, Input, Message>;
|
|
177
|
+
declare namespace index_d_exports {
|
|
178
|
+
export { collection_d_exports as Collection, disclosure_d_exports as Disclosure, field_association_d_exports as FieldAssociation, spin_value_d_exports as SpinValue, toggle_state_d_exports as ToggleState };
|
|
179
|
+
}
|
|
180
|
+
declare namespace selector_d_exports {
|
|
181
|
+
export { attr, child, descendant, is, not, sibling, siblings };
|
|
468
182
|
}
|
|
469
|
-
declare const SlotsTypeId: unique symbol;
|
|
470
|
-
type Contract<S extends { readonly [K in keyof S]: UnnamedSlot | MakeOptions; }> = { readonly [K in keyof S]: S[K] extends UnnamedSlot<infer C, infer Events, infer Attributes, infer Requirements, infer Hidden> ? Slot<K & string, C, Events, Attributes, Requirements, Hidden> : S[K] extends MakeOptions<infer C, infer Events, infer Attributes, infer Requirements, infer Hidden> ? Slot<K & string, C, Events, Attributes, Requirements, Hidden> : never; };
|
|
471
|
-
type NamesOf<T> = keyof T & string;
|
|
472
|
-
type PublicNamesOf<T> = { readonly [K in keyof T & string]: HiddenOf<T[K]> extends true ? never : K; }[keyof T & string];
|
|
473
|
-
type HiddenNamesOf<T> = { readonly [K in keyof T & string]: HiddenOf<T[K]> extends true ? K : never; }[keyof T & string];
|
|
474
|
-
type WithCapability<T, C extends SlotCapability> = { readonly [K in keyof T & string as NameOf$1<C> extends AssignableCapabilityNamesOf<T[K]> ? K : never]: T[K]; };
|
|
475
|
-
declare const define: <const S extends { readonly [K in keyof S]: UnnamedSlot | MakeOptions; }>(spec: S) => Contract<S>;
|
|
476
|
-
declare const describe: (contract: {
|
|
477
|
-
readonly [key: string]: Any$1 | UnnamedSlot;
|
|
478
|
-
}) => {
|
|
479
|
-
readonly slots: Readonly<Record<string, {
|
|
480
|
-
readonly name: string;
|
|
481
|
-
readonly capability: string;
|
|
482
|
-
readonly events: ReadonlyArray<string>;
|
|
483
|
-
readonly attributes: ReadonlyArray<string>;
|
|
484
|
-
readonly requirements: ReadonlyArray<string>;
|
|
485
|
-
readonly hidden: boolean;
|
|
486
|
-
readonly protected: {
|
|
487
|
-
readonly events: ReadonlyArray<string>;
|
|
488
|
-
readonly attributes: ReadonlyArray<string>;
|
|
489
|
-
readonly style: ReadonlyArray<string>;
|
|
490
|
-
};
|
|
491
|
-
}>>;
|
|
492
|
-
};
|
|
493
|
-
declare const withCapability: <T extends {
|
|
494
|
-
readonly [key: string]: Any$1;
|
|
495
|
-
}, C extends SlotCapability>(contract: T, capability: C) => WithCapability<T, C>;
|
|
496
|
-
//#endregion
|
|
497
|
-
//#region src/styleRules.d.ts
|
|
498
183
|
/**
|
|
499
|
-
*
|
|
500
|
-
* relative to the generated class
|
|
501
|
-
*
|
|
502
|
-
* server and the browser derive the same name. Pure data in, CSS text out: no
|
|
503
|
-
* registry, no DOM, no `Date.now`.
|
|
184
|
+
* Typed builders for the selector strings `Style.pseudo` and `Style.nest`
|
|
185
|
+
* take, relative to the generated class (`&`). They exist so a recipe does
|
|
186
|
+
* not hand-type `&:not([aria-disabled="true"])` in every entry.
|
|
504
187
|
*/
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
/** Class-independent CSS (keyframes, layers, global rules). */
|
|
520
|
-
readonly globalCss?: ReadonlyArray<string>;
|
|
521
|
-
}
|
|
522
|
-
interface StyleCondition {
|
|
523
|
-
readonly predicate: (input: unknown) => boolean;
|
|
524
|
-
readonly piece: StyleValue;
|
|
525
|
-
}
|
|
526
|
-
/** A hidden slot is internal: it is neither styleable nor behavior-targetable. */
|
|
527
|
-
type StylePieces<Slots> = { readonly [K in keyof Slots as HiddenOf<Slots[K]> extends true ? never : K]?: StyleValue; };
|
|
528
|
-
interface NamedStyle<Slots> {
|
|
529
|
-
readonly name?: string;
|
|
530
|
-
readonly pieces: StylePieces<Slots>;
|
|
531
|
-
readonly mixin: Mixin<never>;
|
|
532
|
-
/** Concatenated rule CSS for every static piece. */
|
|
533
|
-
readonly css: string;
|
|
534
|
-
/** Concatenated class-independent CSS (keyframes, layers, global rules). */
|
|
535
|
-
readonly globalCss: string;
|
|
536
|
-
/** One entry per generated class, for a deduplicating stylesheet. */
|
|
537
|
-
readonly rules: ReadonlyArray<{
|
|
538
|
-
readonly className: string;
|
|
539
|
-
readonly css: string;
|
|
540
|
-
}>;
|
|
541
|
-
/** Class-independent rule chunks, for a deduplicating stylesheet. */
|
|
542
|
-
readonly globalRules: ReadonlyArray<string>;
|
|
543
|
-
}
|
|
544
|
-
type RecipeVariantDef = Readonly<Record<string, StyleValue>>;
|
|
545
|
-
/** A combination style applied when every `when` entry matches the selection. */
|
|
546
|
-
interface RecipeCompound<Variants extends Readonly<Record<string, RecipeVariantDef>>> {
|
|
547
|
-
readonly when: Partial<{ readonly [K in keyof Variants]: keyof Variants[K] & string; }>;
|
|
548
|
-
readonly style: StyleValue;
|
|
549
|
-
}
|
|
550
|
-
interface RecipeDef<Variants extends Readonly<Record<string, RecipeVariantDef>>> {
|
|
551
|
-
readonly base?: StyleValue;
|
|
552
|
-
readonly variants: Variants;
|
|
553
|
-
readonly defaults?: { readonly [K in keyof Variants]?: keyof Variants[K] & string; };
|
|
554
|
-
readonly compound?: ReadonlyArray<RecipeCompound<Variants>>;
|
|
555
|
-
}
|
|
556
|
-
type AnyRecipeDef = RecipeDef<Record<string, RecipeVariantDef>>;
|
|
557
|
-
type RecipeSelection<D extends AnyRecipeDef> = { readonly [K in keyof D['variants']]?: keyof D['variants'][K] & string; };
|
|
558
|
-
export declare const Style: {
|
|
559
|
-
readonly class: (value: string) => StyleValue;
|
|
560
|
-
readonly inline: (value: Readonly<Record<string, string>>) => StyleValue;
|
|
561
|
-
readonly compose: (...pieces: ReadonlyArray<StyleValue>) => StyleValue;
|
|
562
|
-
readonly when: (condition: boolean, piece: StyleValue) => StyleValue;
|
|
563
|
-
readonly whenInput: <Input>(predicate: (input: Input) => boolean, piece: StyleValue) => StyleValue;
|
|
564
|
-
readonly pseudo: (suffix: string, declarations: Readonly<Record<string, string>>) => StyleValue;
|
|
565
|
-
readonly media: (query: string, declarations: Readonly<Record<string, string>>) => StyleValue;
|
|
566
|
-
readonly supports: (condition: string, declarations: Readonly<Record<string, string>>) => StyleValue;
|
|
567
|
-
readonly container: (condition: string, declarations: Readonly<Record<string, string>>) => StyleValue;
|
|
568
|
-
readonly nest: (selector: string, declarations: Readonly<Record<string, string>>) => StyleValue;
|
|
569
|
-
readonly keyframes: (frames: Readonly<Record<string, Readonly<Record<string, string>>>>) => {
|
|
570
|
-
readonly name: string;
|
|
571
|
-
readonly style: StyleValue;
|
|
572
|
-
};
|
|
573
|
-
readonly global: (css: string) => StyleValue;
|
|
574
|
-
readonly empty: StyleValue;
|
|
575
|
-
readonly forSlots: <Slots>(slots: Slots) => (pieces: StylePieces<Slots>, options?: {
|
|
576
|
-
readonly name?: string;
|
|
577
|
-
}) => NamedStyle<Slots>;
|
|
578
|
-
readonly attach: <Slots>(style: NamedStyle<Slots>) => <ViewSlots, Input, Message>(view: SlotView<ViewSlots, Input, Message>) => SlotView<ViewSlots, Input, Message>;
|
|
579
|
-
readonly recipe: <Variants extends Readonly<Record<string, RecipeVariantDef>>>(def: RecipeDef<Variants>) => (selection: RecipeSelection<RecipeDef<Variants>>) => StyleValue;
|
|
580
|
-
readonly stylesheet: (...styles: ReadonlyArray<{
|
|
581
|
-
readonly rules: ReadonlyArray<{
|
|
582
|
-
readonly className: string;
|
|
583
|
-
readonly css: string;
|
|
584
|
-
}>;
|
|
585
|
-
readonly globalRules: ReadonlyArray<string>;
|
|
586
|
-
}>) => string;
|
|
587
|
-
};
|
|
588
|
-
//#endregion
|
|
589
|
-
//#region src/theme.d.ts
|
|
590
|
-
type ThemeTokens = {
|
|
591
|
-
readonly [group: string]: {
|
|
592
|
-
readonly [name: string]: string;
|
|
593
|
-
};
|
|
594
|
-
};
|
|
595
|
-
export type Theme<T extends ThemeTokens = ThemeTokens> = T;
|
|
596
|
-
export declare const Theme: {
|
|
597
|
-
readonly define: <T extends ThemeTokens>(tokens: T) => Readonly<T>;
|
|
598
|
-
readonly variable: <T extends ThemeTokens, G extends keyof T & string>(_theme: T, group: G, name: keyof T[G] & string) => string;
|
|
599
|
-
readonly variables: <T extends ThemeTokens>(theme: T) => StyleValue;
|
|
600
|
-
};
|
|
188
|
+
/** `&[name]` or `&[name="value"]`. */
|
|
189
|
+
declare const attr: (name: string, value?: string) => string;
|
|
190
|
+
/** `&:not(selector)`, for `Style.pseudo`. */
|
|
191
|
+
declare const not: (selector: string) => string;
|
|
192
|
+
/** `&:is(a, b)`, for `Style.pseudo`. */
|
|
193
|
+
declare const is: (...selectors: ReadonlyArray<string>) => string;
|
|
194
|
+
/** A direct child, for `Style.nest`. */
|
|
195
|
+
declare const child: (selector: string) => string;
|
|
196
|
+
/** Any descendant, for `Style.nest`. */
|
|
197
|
+
declare const descendant: (selector: string) => string;
|
|
198
|
+
/** The next sibling, for `Style.nest`. */
|
|
199
|
+
declare const sibling: (selector: string) => string;
|
|
200
|
+
/** Any later sibling, for `Style.nest`. */
|
|
201
|
+
declare const siblings: (selector: string) => string;
|
|
601
202
|
//#endregion
|
|
602
|
-
export { a11y_d_exports as A11y, type A11yDiagnostic, type A11yDiagnosticCode, type Pattern as A11yPattern, type SlotRequirement as A11yRequirement, type Any as AnyCapability, type AnyMixin, attr_d_exports as Attr, type AttrToken, attributes_d_exports as Attributes, behavior_d_exports as Behavior, type BehaviorSlotOptions, type BehaviorSpec, capability_d_exports as Capability, type Contribution, type ContributionContext, type Diagnostic, type DiagnosticCode, diagnostics_d_exports as Diagnostics, type DynamicContribution, event_d_exports as Event, type EventToken, type InputContribution, type MessageSlotView, metadataToken_d_exports as MetadataToken, mixin_d_exports as Mixin, type MixinFor, type Mixin as MixinValue, type NamedBehavior, type NamedStyle, requirement_d_exports as Requirement, type RequirementToken, type ResolveOptions, resolver_d_exports as Resolver, type Satisfies, slot_d_exports as Slot, type SlotAttributes, type SlotBuilder, type SlotBuilders, type SlotContribution, type SlotProtection, type SlotRequirements, slotView_d_exports as SlotView, type SlotViewRender, type SlotViewTransform, type SlotViewTransformFor, slots_d_exports as Slots, type Contract as SlotsContract, type StaticContribution, type StaticContributionMap, type StaticMixin, type StyleCondition, type StylePieces, type StyleRule, type StyleValue, type Theme as ThemeValue, type ThemeTokens, type UnnamedSlot };
|
|
203
|
+
export { a11y_d_exports as A11y, type A11yDiagnostic, type A11yDiagnosticCode, type Pattern as A11yPattern, type SlotRequirement as A11yRequirement, type Any as AnyCapability, type AnyMixin, attr_d_exports as Attr, type AttrToken, attributes_d_exports as Attributes, behavior_d_exports as Behavior, type BehaviorSlotOptions, type BehaviorSpec, index_d_exports as Behaviors, capability_d_exports as Capability, type ContainerSlot, type Contribution, type ContributionContext, type Declarations, type Declared, type DeclaredPieces, type DeclaredSlots, type Diagnostic, type DiagnosticCode, diagnostics_d_exports as Diagnostics, type DynamicContribution, event_d_exports as Event, type EventToken, type InputContribution, Layers, type Layers as LayersValue, type MessageSlotView, metadataToken_d_exports as MetadataToken, mixin_d_exports as Mixin, type MixinFor, type Mixin as MixinValue, type NamedBehavior, type NamedStyle, type Piece, type Placement, type Refs, requirement_d_exports as Requirement, type RequirementToken, type ResolveOptions, resolver_d_exports as Resolver, type Satisfies, selector_d_exports as Selector, slot_d_exports as Slot, type SlotAttributes, type SlotBuilder, type SlotBuilders, type SlotContribution, type SlotItem, type SlotPiece, type SlotProtection, type SlotRequirements, slotView_d_exports as SlotView, type SlotViewRender, type SlotViewTransform, type SlotViewTransformFor, slots_d_exports as Slots, type Contract as SlotsContract, type StaticContribution, type StaticContributionMap, type StaticMixin, Style, type StyleCondition, type StyleOptions, type StylePieces, type StyleRule, type StyleValue, type StyleValues, type StylesheetSource, Theme, type Theme as ThemeValue, type ThemeTokens, type UnnamedSlot };
|
|
603
204
|
//# sourceMappingURL=index.d.mts.map
|