foldkit-mixins 0.4.0 → 0.6.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 +252 -13
- 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-izIY2GSX.mjs → core-Bxj0UQDF.mjs} +2 -2
- package/dist/{core-izIY2GSX.mjs.map → core-Bxj0UQDF.mjs.map} +1 -1
- package/dist/{core-B86QnDhB.d.mts → core-CUw_n1Nd.d.mts} +2 -2
- package/dist/{core-B86QnDhB.d.mts.map → core-CUw_n1Nd.d.mts.map} +1 -1
- package/dist/defaults.d.mts +6 -2
- package/dist/defaults.d.mts.map +1 -1
- package/dist/defaults.mjs +7 -3
- package/dist/defaults.mjs.map +1 -1
- 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 +11 -566
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +63 -1076
- package/dist/index.mjs.map +1 -1
- package/dist/{layers-CJS5d1i7.mjs → layers-B31M0tDi.mjs} +3 -7
- package/dist/layers-B31M0tDi.mjs.map +1 -0
- package/dist/layers.d.mts +1 -1
- package/dist/layers.d.mts.map +1 -1
- package/dist/layers.mjs +1 -1
- package/dist/layout.d.mts +1 -1
- package/dist/layout.mjs +1 -1
- package/dist/oklch-BxvCD0oi.d.mts +135 -0
- package/dist/oklch-BxvCD0oi.d.mts.map +1 -0
- package/dist/prose.d.mts +8 -2
- package/dist/prose.d.mts.map +1 -1
- package/dist/prose.mjs +11 -7
- package/dist/prose.mjs.map +1 -1
- 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-C9vAKt7A.d.mts → styleValue-BavTe9MZ.d.mts} +13 -18
- package/dist/styleValue-BavTe9MZ.d.mts.map +1 -0
- package/dist/{styleValue--iQMTcPn.mjs → styleValue-_G9jwb17.mjs} +84 -78
- 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 +21 -240
- package/dist/theme.d.mts.map +1 -1
- package/dist/theme.mjs +11 -143
- package/dist/theme.mjs.map +1 -1
- 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 +34 -7
- package/dist/diagnostics-YJ7991-A.mjs +0 -15
- package/dist/diagnostics-YJ7991-A.mjs.map +0 -1
- package/dist/layers-CJS5d1i7.mjs.map +0 -1
- package/dist/styleValue--iQMTcPn.mjs.map +0 -1
- package/dist/styleValue-C9vAKt7A.d.mts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
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";
|
|
2
3
|
import { Layers, Placement } from "./layers.mjs";
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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";
|
|
6
8
|
declare namespace diagnostics_d_exports {
|
|
7
9
|
export { Diagnostic, DiagnosticCode, DiagnosticError };
|
|
8
10
|
}
|
|
@@ -25,231 +27,8 @@ declare class DiagnosticError extends Error {
|
|
|
25
27
|
readonly diagnostic: Diagnostic;
|
|
26
28
|
constructor(diagnostic: Diagnostic);
|
|
27
29
|
}
|
|
28
|
-
declare namespace metadataToken_d_exports {
|
|
29
|
-
export { Any$2 as Any, KindOf, MetadataToken, MetadataTokenTypeId, NameOf$2 as NameOf, NamesOf$2 as NamesOf, is$6 as is, make$6 as make, nameOf };
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Ported from `effect-atom-jsx/src/MetadataToken.ts`. Kinded name tokens so
|
|
33
|
-
* Event, Attr, Requirement, and Capability share one witness instead of four
|
|
34
|
-
* ad-hoc brands.
|
|
35
|
-
*/
|
|
36
|
-
declare const MetadataTokenTypeId: unique symbol;
|
|
37
|
-
interface MetadataToken<Kind extends string, Name extends string> {
|
|
38
|
-
readonly [MetadataTokenTypeId]: {
|
|
39
|
-
readonly Kind: Kind;
|
|
40
|
-
readonly Name: Name;
|
|
41
|
-
};
|
|
42
|
-
readonly kind: Kind;
|
|
43
|
-
readonly name: Name;
|
|
44
|
-
}
|
|
45
|
-
type Any$2 = MetadataToken<string, string>;
|
|
46
|
-
type NameOf$2<T> = T extends MetadataToken<any, infer Name> ? Name : T extends string ? T : never;
|
|
47
|
-
type KindOf<T> = T extends MetadataToken<infer Kind, any> ? Kind : never;
|
|
48
|
-
type NamesOf$2<T extends readonly unknown[]> = NameOf$2<T[number]>;
|
|
49
|
-
declare const make$6: <const Kind extends string, const Name extends string>(kind: Kind, name: Name) => MetadataToken<Kind, Name>;
|
|
50
|
-
declare const is$6: (value: unknown) => value is Any$2;
|
|
51
|
-
declare const nameOf: (value: string | Any$2) => string;
|
|
52
|
-
declare namespace attr_d_exports {
|
|
53
|
-
export { AriaDescribedby, AriaDisabled, AriaExpanded, AriaInvalid, AriaLabel, AriaSelected, AttrToken, Disabled, Role, Value, describe$5 as describe, equals$1 as equals, is$5 as is, make$5 as make };
|
|
54
|
-
}
|
|
55
|
-
type AttrToken<Name extends string = string> = MetadataToken<'view.attribute', Name>;
|
|
56
|
-
declare const is$5: (value: unknown) => value is AttrToken;
|
|
57
|
-
declare const make$5: <const Name extends string>(name: Name) => AttrToken<Name>;
|
|
58
|
-
declare const equals$1: (left: AttrToken, right: AttrToken) => boolean;
|
|
59
|
-
declare const describe$5: (attr: AttrToken) => {
|
|
60
|
-
readonly name: string;
|
|
61
|
-
};
|
|
62
|
-
declare const Role: AttrToken<"role">;
|
|
63
|
-
declare const AriaLabel: AttrToken<"aria-label">;
|
|
64
|
-
declare const AriaDescribedby: AttrToken<"aria-describedby">;
|
|
65
|
-
declare const AriaExpanded: AttrToken<"aria-expanded">;
|
|
66
|
-
declare const AriaSelected: AttrToken<"aria-selected">;
|
|
67
|
-
declare const AriaInvalid: AttrToken<"aria-invalid">;
|
|
68
|
-
declare const AriaDisabled: AttrToken<"aria-disabled">;
|
|
69
|
-
declare const Disabled: AttrToken<"disabled">;
|
|
70
|
-
declare const Value: AttrToken<"value">;
|
|
71
|
-
declare namespace capability_d_exports {
|
|
72
|
-
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$4 as is, make$4 as make, names, satisfies };
|
|
73
|
-
}
|
|
74
|
-
type CapabilityParent = string | MetadataToken<'element.capability', string>;
|
|
75
|
-
interface Capability<Name extends string = string, Extends extends readonly CapabilityParent[] = readonly []> extends MetadataToken<'element.capability', Name> {
|
|
76
|
-
readonly extends: Extends;
|
|
77
|
-
}
|
|
78
|
-
type Any = Capability<string, readonly CapabilityParent[]>;
|
|
79
|
-
type NameOf$1<T> = NameOf$2<T>;
|
|
80
|
-
type NamesOf$1<T extends readonly unknown[]> = NamesOf$2<T>;
|
|
81
|
-
type ExtendsOf<T> = T extends Capability<any, infer Extends> ? NameOf$2<Extends[number]> : never;
|
|
82
|
-
type AssignableNamesOf<T> = T extends string ? T : T extends Capability<any, infer Extends> ? NameOf$2<T> | AssignableNamesOf<Extends[number]> : NameOf$2<T>;
|
|
83
|
-
type Satisfies<Actual, Required extends {
|
|
84
|
-
readonly name: string;
|
|
85
|
-
}> = Required['name'] extends AssignableNamesOf<Actual> ? true : false;
|
|
86
|
-
declare const is$4: (value: unknown) => value is Any;
|
|
87
|
-
declare const make$4: <const Name extends string, const Extends extends readonly CapabilityParent[] = readonly []>(name: Name, options?: {
|
|
88
|
-
readonly extends?: Extends;
|
|
89
|
-
}) => Capability<Name, Extends>;
|
|
90
|
-
/** True when `value` is `base` or inherits from it. Ported from AF-UI. */
|
|
91
|
-
declare const extendsCapability: (value: string | Any, base: string | Any) => boolean;
|
|
92
|
-
declare const satisfies: (actual: string | Any, required: string | Any) => boolean;
|
|
93
|
-
declare const names: (capability: Any) => ReadonlyArray<string>;
|
|
94
|
-
declare const describe$4: (capability: Any) => {
|
|
95
|
-
readonly name: string;
|
|
96
|
-
readonly extends: ReadonlyArray<string>;
|
|
97
|
-
};
|
|
98
|
-
declare const Base: Capability<"Base", readonly []>;
|
|
99
|
-
declare const Interactive: Capability<"Interactive", readonly [Capability<"Base", readonly []>]>;
|
|
100
|
-
declare const Container: Capability<"Container", readonly [Capability<"Interactive", readonly [Capability<"Base", readonly []>]>]>;
|
|
101
|
-
declare const Focusable: Capability<"Focusable", readonly [Capability<"Interactive", readonly [Capability<"Base", readonly []>]>]>;
|
|
102
|
-
declare const TextInput: Capability<"TextInput", readonly [Capability<"Focusable", readonly [Capability<"Interactive", readonly [Capability<"Base", readonly []>]>]>]>;
|
|
103
|
-
declare const Draggable: Capability<"Draggable", readonly [Capability<"Interactive", readonly [Capability<"Base", readonly []>]>]>;
|
|
104
|
-
declare const Collection: Capability<"Collection", readonly [Capability<"Base", readonly []>]>;
|
|
105
|
-
declare namespace event_d_exports {
|
|
106
|
-
export { Blur, Cancel, Change, Click, EventToken, Focus, Hover, Input, KeyDown, PointerDown, PointerUp, Press, Submit, describe$3 as describe, equals, is$3 as is, make$3 as make };
|
|
107
|
-
}
|
|
108
|
-
type EventToken<Name extends string = string> = MetadataToken<'view.event', Name>;
|
|
109
|
-
declare const is$3: (value: unknown) => value is EventToken;
|
|
110
|
-
declare const make$3: <const Name extends string>(name: Name) => EventToken<Name>;
|
|
111
|
-
declare const equals: (left: EventToken, right: EventToken) => boolean;
|
|
112
|
-
declare const describe$3: (event: EventToken) => {
|
|
113
|
-
readonly name: string;
|
|
114
|
-
};
|
|
115
|
-
declare const Press: EventToken<"press">;
|
|
116
|
-
declare const Click: EventToken<"click">;
|
|
117
|
-
declare const Cancel: EventToken<"cancel">;
|
|
118
|
-
declare const Input: EventToken<"input">;
|
|
119
|
-
declare const Change: EventToken<"change">;
|
|
120
|
-
declare const Focus: EventToken<"focus">;
|
|
121
|
-
declare const Blur: EventToken<"blur">;
|
|
122
|
-
declare const KeyDown: EventToken<"keydown">;
|
|
123
|
-
declare const PointerDown: EventToken<"pointerdown">;
|
|
124
|
-
declare const PointerUp: EventToken<"pointerup">;
|
|
125
|
-
declare const Hover: EventToken<"hover">;
|
|
126
|
-
declare const Submit: EventToken<"submit">;
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region src/pipe.d.ts
|
|
129
|
-
type Pipeable<Self> = {
|
|
130
|
-
pipe(): Self;
|
|
131
|
-
pipe(...fns: ReadonlyArray<(self: Self) => Self>): Self;
|
|
132
|
-
pipe<A>(ab: (self: Self) => A): A;
|
|
133
|
-
pipe<A, B>(ab: (self: Self) => A, bc: (a: A) => B): B;
|
|
134
|
-
pipe<A, B, C>(ab: (self: Self) => A, bc: (a: A) => B, cd: (b: B) => C): C;
|
|
135
|
-
};
|
|
136
|
-
declare namespace requirement_d_exports {
|
|
137
|
-
export { Clipboard, Keyboard, Pointer, RequirementToken, describe$2 as describe, is$2 as is, make$2 as make };
|
|
138
|
-
}
|
|
139
|
-
type RequirementToken<Name extends string = string> = MetadataToken<'view.requirement', Name>;
|
|
140
|
-
declare const is$2: (value: unknown) => value is RequirementToken;
|
|
141
|
-
declare const make$2: <const Name extends string>(name: Name) => RequirementToken<Name>;
|
|
142
|
-
declare const describe$2: (requirement: RequirementToken) => {
|
|
143
|
-
readonly name: string;
|
|
144
|
-
};
|
|
145
|
-
declare const Keyboard: RequirementToken<"keyboard">;
|
|
146
|
-
declare const Pointer: RequirementToken<"pointer">;
|
|
147
|
-
declare const Clipboard: RequirementToken<"clipboard">;
|
|
148
|
-
declare namespace slot_d_exports {
|
|
149
|
-
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$1 as is, make$1 as make, requires };
|
|
150
|
-
}
|
|
151
|
-
declare const SlotTypeId: unique symbol;
|
|
152
|
-
type SlotTypeId = typeof SlotTypeId;
|
|
153
|
-
type EventName = string | EventToken;
|
|
154
|
-
type AttributeName = string | AttrToken;
|
|
155
|
-
type RequirementName = string | RequirementToken;
|
|
156
|
-
type SlotCapability = string | Any;
|
|
157
|
-
interface SlotProtection {
|
|
158
|
-
readonly events: ReadonlyArray<EventName>;
|
|
159
|
-
readonly attributes: ReadonlyArray<AttributeName>;
|
|
160
|
-
readonly style: ReadonlyArray<string>;
|
|
161
|
-
}
|
|
162
|
-
interface SlotMetadata<Name extends string = string> {
|
|
163
|
-
readonly name: Name;
|
|
164
|
-
readonly capability: SlotCapability;
|
|
165
|
-
readonly allowedEvents: readonly EventName[];
|
|
166
|
-
readonly allowedAttributes: readonly AttributeName[];
|
|
167
|
-
readonly platformRequirements: readonly RequirementName[];
|
|
168
|
-
readonly hidden: boolean;
|
|
169
|
-
readonly protected: SlotProtection;
|
|
170
|
-
}
|
|
171
|
-
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>> {
|
|
172
|
-
readonly [SlotTypeId]: {
|
|
173
|
-
readonly Name: Name;
|
|
174
|
-
readonly Capability: C;
|
|
175
|
-
readonly Events: Events;
|
|
176
|
-
readonly Attributes: Attributes;
|
|
177
|
-
readonly Requirements: Requirements;
|
|
178
|
-
readonly Hidden: Hidden;
|
|
179
|
-
};
|
|
180
|
-
readonly name: Name;
|
|
181
|
-
readonly capability: C;
|
|
182
|
-
readonly events: Events;
|
|
183
|
-
readonly attributes: Attributes;
|
|
184
|
-
readonly requirements: Requirements;
|
|
185
|
-
readonly hidden: Hidden;
|
|
186
|
-
readonly protected: SlotProtection;
|
|
187
|
-
readonly metadata: SlotMetadata<Name> & {
|
|
188
|
-
readonly capability: C;
|
|
189
|
-
readonly allowedEvents: Events;
|
|
190
|
-
readonly allowedAttributes: Attributes;
|
|
191
|
-
readonly platformRequirements: Requirements;
|
|
192
|
-
readonly hidden: Hidden;
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
type Any$1 = Slot<string, SlotCapability, readonly EventName[], readonly AttributeName[], readonly RequirementName[], boolean>;
|
|
196
|
-
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'> & {
|
|
197
|
-
readonly name?: never;
|
|
198
|
-
};
|
|
199
|
-
type NameOf<T> = T extends Slot<infer Name, any, any, any, any, any> ? Name : never;
|
|
200
|
-
type CapabilityOf<T> = T extends Slot<any, infer C, any, any, any, any> ? NameOf$2<C> : never;
|
|
201
|
-
type CapabilityValueOf<T> = T extends Slot<any, infer C, any, any, any, any> ? C : never;
|
|
202
|
-
type EventsOf<T> = T extends Slot<any, any, infer Events, any, any, any> ? NamesOf$2<Events> : never;
|
|
203
|
-
type AttributesOf<T> = T extends Slot<any, any, any, infer Attributes, any, any> ? NamesOf$2<Attributes> : never;
|
|
204
|
-
type HiddenOf<T> = T extends Slot<any, any, any, any, any, infer Hidden> ? Hidden : never;
|
|
205
|
-
type AssignableCapabilityNamesOf<T> = AssignableNamesOf<CapabilityValueOf<T>>;
|
|
206
|
-
type Public<T> = HiddenOf<T> extends true ? never : T;
|
|
207
|
-
type Hidden$1<T> = HiddenOf<T> extends true ? T : never;
|
|
208
|
-
declare const is$1: (value: unknown) => value is Any$1 | UnnamedSlot;
|
|
209
|
-
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> {
|
|
210
|
-
readonly capability?: C;
|
|
211
|
-
readonly events?: Events;
|
|
212
|
-
readonly allowedEvents?: Events;
|
|
213
|
-
readonly attributes?: Attributes;
|
|
214
|
-
readonly allowedAttributes?: Attributes;
|
|
215
|
-
readonly requirements?: Requirements;
|
|
216
|
-
readonly platformRequirements?: Requirements;
|
|
217
|
-
readonly hidden?: Hidden;
|
|
218
|
-
readonly protected?: {
|
|
219
|
-
readonly events?: ReadonlyArray<EventName>;
|
|
220
|
-
readonly attributes?: ReadonlyArray<AttributeName>;
|
|
221
|
-
readonly style?: ReadonlyArray<string>;
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
/** AF-UI form: name is the first argument. */
|
|
225
|
-
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>;
|
|
226
|
-
/** Foldkit form: name comes from `Slots.define` keys. */
|
|
227
|
-
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>;
|
|
228
|
-
/** Pipeable transform replacing a named slot's capability. */
|
|
229
|
-
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>;
|
|
230
|
-
/** Pipeable transform replacing a named slot's allowed events. */
|
|
231
|
-
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>;
|
|
232
|
-
/** Pipeable transform replacing a named slot's allowed attributes. */
|
|
233
|
-
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>;
|
|
234
|
-
/** Pipeable transform replacing a named slot's platform requirements. */
|
|
235
|
-
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>;
|
|
236
|
-
/** Pipeable transform marking a named slot hidden from public attachment. */
|
|
237
|
-
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>;
|
|
238
|
-
declare const describe$1: (slot: Any$1 | UnnamedSlot) => {
|
|
239
|
-
readonly name?: string;
|
|
240
|
-
readonly capability: string;
|
|
241
|
-
readonly events: ReadonlyArray<string>;
|
|
242
|
-
readonly attributes: ReadonlyArray<string>;
|
|
243
|
-
readonly requirements: ReadonlyArray<string>;
|
|
244
|
-
readonly hidden: boolean;
|
|
245
|
-
readonly protected: {
|
|
246
|
-
readonly events: ReadonlyArray<string>;
|
|
247
|
-
readonly attributes: ReadonlyArray<string>;
|
|
248
|
-
readonly style: ReadonlyArray<string>;
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
30
|
declare namespace a11y_d_exports {
|
|
252
|
-
export { A11yDiagnostic, A11yDiagnosticCode, Pattern, PatternTypeId, Requirements
|
|
31
|
+
export { A11yDiagnostic, A11yDiagnosticCode, Pattern, PatternTypeId, Requirements, SlotRequirement, pattern, validate };
|
|
253
32
|
}
|
|
254
33
|
type A11yDiagnosticCode = 'a11y:missing-slot' | 'a11y:hidden-slot' | 'a11y:capability-mismatch' | 'a11y:missing-event' | 'a11y:missing-attribute';
|
|
255
34
|
interface A11yDiagnostic extends Diagnostic {
|
|
@@ -263,62 +42,18 @@ interface SlotRequirement {
|
|
|
263
42
|
/** An absent slot is expected, not a diagnostic. A present slot is still checked. */
|
|
264
43
|
readonly optional?: boolean;
|
|
265
44
|
}
|
|
266
|
-
type Requirements
|
|
45
|
+
type Requirements = Readonly<Record<string, SlotRequirement>>;
|
|
267
46
|
declare const PatternTypeId: unique symbol;
|
|
268
|
-
interface Pattern<Spec extends Requirements
|
|
47
|
+
interface Pattern<Spec extends Requirements = Requirements> {
|
|
269
48
|
readonly [PatternTypeId]: {
|
|
270
49
|
readonly Requirements: Spec;
|
|
271
50
|
};
|
|
272
51
|
readonly requirements: Spec;
|
|
273
52
|
}
|
|
274
|
-
declare const pattern: <const Spec extends Requirements
|
|
53
|
+
declare const pattern: <const Spec extends Requirements>(spec: Spec) => Pattern<Spec>;
|
|
275
54
|
declare const validate: (pattern: Pattern, slots: {
|
|
276
55
|
readonly [name: string]: Any$1;
|
|
277
56
|
}) => ReadonlyArray<A11yDiagnostic>;
|
|
278
|
-
//#endregion
|
|
279
|
-
//#region src/contribution.d.ts
|
|
280
|
-
interface StaticContribution<Message> {
|
|
281
|
-
readonly classes?: ReadonlyArray<string>;
|
|
282
|
-
readonly style?: Readonly<Record<string, string>>;
|
|
283
|
-
readonly attributes?: ReadonlyArray<Attribute<Message> | ChildAttribute>;
|
|
284
|
-
readonly mounts?: ReadonlyArray<MountAction<Message, any>>;
|
|
285
|
-
/** Compiled rule CSS for a class this contribution introduces. */
|
|
286
|
-
readonly css?: string;
|
|
287
|
-
/** Class-independent CSS this contribution introduces (keyframes, layers). */
|
|
288
|
-
readonly globalCss?: string;
|
|
289
|
-
}
|
|
290
|
-
interface ContributionContext<Message> {
|
|
291
|
-
readonly input: unknown;
|
|
292
|
-
readonly h: HtmlBuilder<Message>;
|
|
293
|
-
/** Present only when the view resolved the slot for one item. */
|
|
294
|
-
readonly item?: SlotItem;
|
|
295
|
-
}
|
|
296
|
-
type DynamicContribution<Message> = (context: ContributionContext<Message>) => StaticContribution<Message>;
|
|
297
|
-
/**
|
|
298
|
-
* A contribution that reads the view input but names no Message universe, so it
|
|
299
|
-
* stays assignable to any view. Input-driven Style (`Style.whenInput`) compiles
|
|
300
|
-
* to this. It never receives `h`, because a conditional style emits no handlers.
|
|
301
|
-
*/
|
|
302
|
-
type InputContribution<Message = never> = (context: {
|
|
303
|
-
readonly input: unknown;
|
|
304
|
-
readonly item?: SlotItem;
|
|
305
|
-
}) => StaticContribution<Message>;
|
|
306
|
-
type SlotContribution<Message> = StaticContribution<Message> | DynamicContribution<Message>;
|
|
307
|
-
type Contribution<Message> = {
|
|
308
|
-
readonly [slot: string]: SlotContribution<Message> | undefined;
|
|
309
|
-
};
|
|
310
|
-
type StaticContributionMap<Message> = {
|
|
311
|
-
readonly [slot: string]: StaticContribution<Message> | undefined;
|
|
312
|
-
};
|
|
313
|
-
declare namespace resolver_d_exports {
|
|
314
|
-
export { ResolveOptions, SlotAttributes, resolve };
|
|
315
|
-
}
|
|
316
|
-
type SlotAttributes<Message> = ReadonlyArray<Attribute<Message> | ChildAttribute>;
|
|
317
|
-
interface ResolveOptions {
|
|
318
|
-
readonly slot?: string;
|
|
319
|
-
readonly protected?: SlotProtection;
|
|
320
|
-
}
|
|
321
|
-
declare const resolve: <Message>(base: SlotAttributes<Message> | undefined, contributions: ReadonlyArray<StaticContribution<Message>>, options?: ResolveOptions) => SlotAttributes<Message>;
|
|
322
57
|
declare namespace attributes_d_exports {
|
|
323
58
|
export { Of, Tag, filter, find, tagOf };
|
|
324
59
|
}
|
|
@@ -334,152 +69,6 @@ declare const tagOf: <Message>(attribute: SlotAttributes<Message>[number]) => Ta
|
|
|
334
69
|
declare const find: <Message, T extends Tag>(attributes: SlotAttributes<Message>, tag: T) => Of<Message, T> | undefined;
|
|
335
70
|
/** Every attribute with `tag`, in bundle order. */
|
|
336
71
|
declare const filter: <Message, T extends Tag>(attributes: SlotAttributes<Message>, tag: T) => ReadonlyArray<Of<Message, T>>;
|
|
337
|
-
declare namespace mixin_d_exports {
|
|
338
|
-
export { AnyMixin, Mixin, MixinFor, StaticMixin, compose, contributionsFor, dynamic, empty, evaluate, isDynamic, make };
|
|
339
|
-
}
|
|
340
|
-
interface Mixin<Message = never> {
|
|
341
|
-
readonly name: string;
|
|
342
|
-
readonly contributions: Contribution<Message>;
|
|
343
|
-
}
|
|
344
|
-
interface StaticMixin<Message = never> {
|
|
345
|
-
readonly name: string;
|
|
346
|
-
readonly contributions: StaticContributionMap<Message>;
|
|
347
|
-
}
|
|
348
|
-
type AnyMixin = Mixin<any> | StaticMixin<any>;
|
|
349
|
-
/**
|
|
350
|
-
* A Mixin acceptable in any context of `Message`. `Mixin<never>` is included
|
|
351
|
-
* explicitly because a message-free dynamic Mixin (input-driven Style) does not
|
|
352
|
-
* widen to `Mixin<Message>` — `HtmlBuilder` is invariant in `Message`.
|
|
353
|
-
*/
|
|
354
|
-
type MixinFor<Message> = Mixin<Message> | StaticMixin<Message> | Mixin<never>;
|
|
355
|
-
declare const isDynamic: <Message>(contribution: SlotContribution<Message>) => contribution is DynamicContribution<Message>;
|
|
356
|
-
declare const evaluate: <Message>(contribution: SlotContribution<Message>, context: ContributionContext<Message>) => StaticContribution<Message>;
|
|
357
|
-
declare const make: <Message = never>(name: string, contributions: StaticContributionMap<Message>) => StaticMixin<Message>;
|
|
358
|
-
declare const dynamic: <Message = never>(name: string, contributions: Contribution<Message>) => Mixin<Message>;
|
|
359
|
-
declare const empty: <Message = never>() => StaticMixin<Message>;
|
|
360
|
-
declare const compose: <Message = never>(...mixins: ReadonlyArray<MixinFor<Message>>) => Mixin<Message>;
|
|
361
|
-
declare const contributionsFor: <Message>(mixin: Mixin<Message> | StaticMixin<Message>, slot: string) => SlotContribution<Message> | undefined;
|
|
362
|
-
declare namespace slotView_d_exports {
|
|
363
|
-
export { MessageSlotView, SlotBuilder, SlotBuilders, SlotView, SlotViewRender, SlotViewTransform, SlotViewTransformFor, attach$1 as attach, buildersFor, define$1 as define, forMessages, inertBuilder };
|
|
364
|
-
}
|
|
365
|
-
type SlotBuilder<Message> = {
|
|
366
|
-
/**
|
|
367
|
-
* The view's base attributes plus every resolved contribution. Pass `item`
|
|
368
|
-
* when the slot is rendered once per item, so a Behavior can decorate each
|
|
369
|
-
* repetition differently.
|
|
370
|
-
*/
|
|
371
|
-
readonly attrs: (base?: SlotAttributes<Message>, item?: SlotItem) => SlotAttributes<Message>;
|
|
372
|
-
};
|
|
373
|
-
type SlotBuilders<Slots, Message> = { readonly [K in keyof Slots]: SlotBuilder<Message>; };
|
|
374
|
-
type SlotViewRender<Slots, Input, Message> = (input: Input, slots: SlotBuilders<Slots, Message>, h: HtmlBuilder<Message>) => Html;
|
|
375
|
-
interface SlotView<Slots, Input, Message> extends Pipeable<SlotView<Slots, Input, Message>> {
|
|
376
|
-
(input: Input, h: HtmlBuilder<Message>): Html;
|
|
377
|
-
readonly name?: string;
|
|
378
|
-
readonly slots: Slots;
|
|
379
|
-
readonly mixins: ReadonlyArray<MixinFor<Message>>;
|
|
380
|
-
readonly render: SlotViewRender<Slots, Input, Message>;
|
|
381
|
-
}
|
|
382
|
-
/** Build one `attrs` resolver per published slot, evaluating Mixins lazily. */
|
|
383
|
-
declare const buildersFor: <Slots, Message, Input>(slots: Slots, mixins: ReadonlyArray<MixinFor<Message>>, context: {
|
|
384
|
-
readonly input: Input;
|
|
385
|
-
readonly h: HtmlBuilder<Message>;
|
|
386
|
-
}) => SlotBuilders<Slots, Message>;
|
|
387
|
-
/**
|
|
388
|
-
* Defines a view over published Slots.
|
|
389
|
-
*
|
|
390
|
-
* `Message` has no anchor but the render callback's builder, so it is inferred
|
|
391
|
-
* from an explicit `h: HtmlBuilder<Message>` annotation on that parameter.
|
|
392
|
-
* Without one it resolves to `unknown`, and the first error appears later and
|
|
393
|
-
* elsewhere — an invariance mismatch at `Style.attach`/`Behavior.attach` that
|
|
394
|
-
* does not name the missing annotation. `forMessages<Message>()` fixes the
|
|
395
|
-
* Message universe up front instead, and leaves `h` contextually typed.
|
|
396
|
-
*/
|
|
397
|
-
declare const define$1: <Slots, Input, Message>(slots: Slots, render: SlotViewRender<Slots, Input, Message>, options?: {
|
|
398
|
-
readonly name?: string;
|
|
399
|
-
}) => SlotView<Slots, Input, Message>;
|
|
400
|
-
/**
|
|
401
|
-
* Foldkit's `inertHtml` typed for a Message universe, for rendering a view
|
|
402
|
-
* outside a runtime (tests, demos, static description). `inertHtml` is
|
|
403
|
-
* `HtmlBuilder<never>`, and the builder is invariant in `Message`, so this is
|
|
404
|
-
* the one cast: sound because inert handlers are never dispatched.
|
|
405
|
-
*/
|
|
406
|
-
declare const inertBuilder: <Message>() => HtmlBuilder<Message>;
|
|
407
|
-
/** The `SlotView` constructors with `Message` already fixed. */
|
|
408
|
-
interface MessageSlotView<Message> {
|
|
409
|
-
readonly define: <Slots, Input>(slots: Slots, render: SlotViewRender<Slots, Input, Message>, options?: {
|
|
410
|
-
readonly name?: string;
|
|
411
|
-
}) => SlotView<Slots, Input, Message>;
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Binds the view constructors to one Message universe, so the render callback
|
|
415
|
-
* no longer has to annotate `h` to pin it. `Input` is still inferred from the
|
|
416
|
-
* callback's own `input` annotation.
|
|
417
|
-
*
|
|
418
|
-
* @example
|
|
419
|
-
* ```ts
|
|
420
|
-
* const Field = SlotView.forMessages<Message>().define(
|
|
421
|
-
* FieldSlots,
|
|
422
|
-
* (input: FieldInput, slots, h) =>
|
|
423
|
-
* h.input(slots.input.attrs([h.OnInput(value => Message.ChangedValue({ value }))])),
|
|
424
|
-
* )
|
|
425
|
-
* ```
|
|
426
|
-
*/
|
|
427
|
-
declare const forMessages: <Message>() => MessageSlotView<Message>;
|
|
428
|
-
/** A transform on any view, used by Message-free static mixins such as Style. */
|
|
429
|
-
type SlotViewTransform = <Slots, Input, Message>(view: SlotView<Slots, Input, Message>) => SlotView<Slots, Input, Message>;
|
|
430
|
-
/** A transform restricted to one Message universe, for Behavior mixins. */
|
|
431
|
-
type SlotViewTransformFor<Message> = <Slots, Input>(view: SlotView<Slots, Input, Message>) => SlotView<Slots, Input, Message>;
|
|
432
|
-
/** Attach one Mixin. Returns a new view; the original is unchanged. */
|
|
433
|
-
declare function attach$1(mixin: StaticMixin<never> | Mixin<never>): SlotViewTransform;
|
|
434
|
-
declare function attach$1<MixinMessage>(mixin: Mixin<MixinMessage>): SlotViewTransformFor<MixinMessage>;
|
|
435
|
-
declare namespace behavior_d_exports {
|
|
436
|
-
export { Behavior, BehaviorSlotOptions, BehaviorSpec, NamedBehavior, SlotRequirements, attach, forSlots, slot };
|
|
437
|
-
}
|
|
438
|
-
interface SlotRequirements {
|
|
439
|
-
readonly capability?: SlotCapability;
|
|
440
|
-
readonly events?: ReadonlyArray<EventName>;
|
|
441
|
-
readonly attributes?: ReadonlyArray<AttributeName>;
|
|
442
|
-
}
|
|
443
|
-
interface BehaviorSlotOptions<Input, Message> {
|
|
444
|
-
readonly requires?: SlotRequirements;
|
|
445
|
-
/**
|
|
446
|
-
* Attributes for one resolution of the slot. `item` is present when the view
|
|
447
|
-
* passed one to `slots.x.attrs(base, item)`, that is, when the slot is
|
|
448
|
-
* rendered once per item.
|
|
449
|
-
*/
|
|
450
|
-
readonly attributes?: (context: {
|
|
451
|
-
readonly input: Input;
|
|
452
|
-
readonly h: HtmlBuilder<Message>;
|
|
453
|
-
readonly item?: SlotItem;
|
|
454
|
-
}) => ReadonlyArray<Attribute<Message> | ChildAttribute>;
|
|
455
|
-
readonly mount?: (input: Input, item?: SlotItem) => MountAction<Message, any>;
|
|
456
|
-
}
|
|
457
|
-
type BehaviorSpec<Slots, Input, Message> = { readonly [K in keyof Slots as HiddenOf<Slots[K]> extends true ? never : K]?: BehaviorSlotOptions<Input, Message>; };
|
|
458
|
-
interface NamedBehavior<Slots, Input, Message> {
|
|
459
|
-
readonly name?: string;
|
|
460
|
-
readonly spec: BehaviorSpec<Slots, Input, Message>;
|
|
461
|
-
readonly mixin: Mixin<Message>;
|
|
462
|
-
}
|
|
463
|
-
/** Identity helper; `forSlots` supplies the contextual `Input`/`Message`. */
|
|
464
|
-
declare const slot: <Options extends BehaviorSlotOptions<any, any>>(options: Options) => Options;
|
|
465
|
-
declare const forSlots: <Slots>(slots: Slots) => <Input, Message>(spec: BehaviorSpec<Slots, Input, Message>, options?: {
|
|
466
|
-
readonly name?: string;
|
|
467
|
-
}) => NamedBehavior<Slots, Input, Message>;
|
|
468
|
-
/**
|
|
469
|
-
* Attaches a Behavior to a view. The behavior's `Input` becomes the attached
|
|
470
|
-
* view's `Input`: a behavior declared over only the fields it reads is rejected
|
|
471
|
-
* even though those fields are a subset, and one declared over extra fields
|
|
472
|
-
* widens what the view must be called with. Declare `Input` as the view's own
|
|
473
|
-
* input type.
|
|
474
|
-
*/
|
|
475
|
-
declare const attach: <BehaviorSlots, Message, Input>(behavior: NamedBehavior<BehaviorSlots, Input, Message>) => <ViewSlots>(view: SlotView<ViewSlots, Input, Message>) => SlotView<ViewSlots, Input, Message>;
|
|
476
|
-
declare const Behavior: {
|
|
477
|
-
readonly slot: <Options extends BehaviorSlotOptions<any, any>>(options: Options) => Options;
|
|
478
|
-
readonly forSlots: <Slots>(slots: Slots) => <Input, Message>(spec: BehaviorSpec<Slots, Input, Message>, options?: {
|
|
479
|
-
readonly name?: string;
|
|
480
|
-
}) => NamedBehavior<Slots, Input, Message>;
|
|
481
|
-
readonly attach: <BehaviorSlots, Message, Input>(behavior: NamedBehavior<BehaviorSlots, Input, Message>) => <ViewSlots>(view: SlotView<ViewSlots, Input, Message>) => SlotView<ViewSlots, Input, Message>;
|
|
482
|
-
};
|
|
483
72
|
declare namespace collection_d_exports {
|
|
484
73
|
export { BehaviorOptions, Describe, Items, behavior$4 as behavior, of };
|
|
485
74
|
}
|
|
@@ -610,150 +199,6 @@ declare const descendant: (selector: string) => string;
|
|
|
610
199
|
declare const sibling: (selector: string) => string;
|
|
611
200
|
/** Any later sibling, for `Style.nest`. */
|
|
612
201
|
declare const siblings: (selector: string) => string;
|
|
613
|
-
declare namespace slots_d_exports {
|
|
614
|
-
export { Contract, HiddenNamesOf, NamesOf, PublicNamesOf, SlotsTypeId, WithCapability, define, describe, withCapability };
|
|
615
|
-
}
|
|
616
|
-
declare const SlotsTypeId: unique symbol;
|
|
617
|
-
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; };
|
|
618
|
-
type NamesOf<T> = keyof T & string;
|
|
619
|
-
type PublicNamesOf<T> = { readonly [K in keyof T & string]: HiddenOf<T[K]> extends true ? never : K; }[keyof T & string];
|
|
620
|
-
type HiddenNamesOf<T> = { readonly [K in keyof T & string]: HiddenOf<T[K]> extends true ? K : never; }[keyof T & string];
|
|
621
|
-
type WithCapability<T, C extends SlotCapability> = { readonly [K in keyof T & string as NameOf$1<C> extends AssignableCapabilityNamesOf<T[K]> ? K : never]: T[K]; };
|
|
622
|
-
declare const define: <const S extends { readonly [K in keyof S]: UnnamedSlot | MakeOptions; }>(spec: S) => Contract<S>;
|
|
623
|
-
declare const describe: (contract: {
|
|
624
|
-
readonly [key: string]: Any$1 | UnnamedSlot;
|
|
625
|
-
}) => {
|
|
626
|
-
readonly slots: Readonly<Record<string, {
|
|
627
|
-
readonly name: string;
|
|
628
|
-
readonly capability: string;
|
|
629
|
-
readonly events: ReadonlyArray<string>;
|
|
630
|
-
readonly attributes: ReadonlyArray<string>;
|
|
631
|
-
readonly requirements: ReadonlyArray<string>;
|
|
632
|
-
readonly hidden: boolean;
|
|
633
|
-
readonly protected: {
|
|
634
|
-
readonly events: ReadonlyArray<string>;
|
|
635
|
-
readonly attributes: ReadonlyArray<string>;
|
|
636
|
-
readonly style: ReadonlyArray<string>;
|
|
637
|
-
};
|
|
638
|
-
}>>;
|
|
639
|
-
};
|
|
640
|
-
declare const withCapability: <T extends {
|
|
641
|
-
readonly [key: string]: Any$1;
|
|
642
|
-
}, C extends SlotCapability>(contract: T, capability: C) => WithCapability<T, C>;
|
|
643
|
-
//#endregion
|
|
644
|
-
//#region src/style.d.ts
|
|
645
|
-
/** A hidden slot is internal: it is neither styleable nor behavior-targetable. */
|
|
646
|
-
type StylePieces<Slots> = { readonly [K in keyof Slots as HiddenOf<Slots[K]> extends true ? never : K]?: StyleValue; };
|
|
647
|
-
interface NamedStyle<Slots> {
|
|
648
|
-
readonly name?: string;
|
|
649
|
-
readonly pieces: StylePieces<Slots>;
|
|
650
|
-
readonly mixin: Mixin<never>;
|
|
651
|
-
/** Concatenated rule CSS for every static piece. */
|
|
652
|
-
readonly css: string;
|
|
653
|
-
/** Concatenated class-independent CSS (keyframes, layers, global rules). */
|
|
654
|
-
readonly globalCss: string;
|
|
655
|
-
/** One entry per generated class, for a deduplicating stylesheet. */
|
|
656
|
-
readonly rules: ReadonlyArray<{
|
|
657
|
-
readonly className: string;
|
|
658
|
-
readonly css: string;
|
|
659
|
-
}>;
|
|
660
|
-
/** Class-independent rule chunks, for a deduplicating stylesheet. */
|
|
661
|
-
readonly globalRules: ReadonlyArray<string>;
|
|
662
|
-
}
|
|
663
|
-
interface StyleOptions {
|
|
664
|
-
readonly name?: string;
|
|
665
|
-
/**
|
|
666
|
-
* The layer every piece is placed in before compiling, e.g.
|
|
667
|
-
* `Layers.standard.layer('app')`. A rule already in a layer keeps it.
|
|
668
|
-
*/
|
|
669
|
-
readonly layer?: Placement;
|
|
670
|
-
}
|
|
671
|
-
interface StylesheetSource {
|
|
672
|
-
readonly rules: ReadonlyArray<{
|
|
673
|
-
readonly className: string;
|
|
674
|
-
readonly css: string;
|
|
675
|
-
}>;
|
|
676
|
-
readonly globalRules: ReadonlyArray<string>;
|
|
677
|
-
}
|
|
678
|
-
type RecipeVariantDef = Readonly<Record<string, StyleValue>>;
|
|
679
|
-
/** A combination style applied when every `when` entry matches the selection. */
|
|
680
|
-
interface RecipeCompound<Variants extends Readonly<Record<string, RecipeVariantDef>>> {
|
|
681
|
-
readonly when: Partial<{ readonly [K in keyof Variants]: keyof Variants[K] & string; }>;
|
|
682
|
-
readonly style: StyleValue;
|
|
683
|
-
}
|
|
684
|
-
interface RecipeDef<Variants extends Readonly<Record<string, RecipeVariantDef>>> {
|
|
685
|
-
readonly base?: StyleValue;
|
|
686
|
-
readonly variants: Variants;
|
|
687
|
-
readonly defaults?: { readonly [K in keyof Variants]?: keyof Variants[K] & string; };
|
|
688
|
-
readonly compound?: ReadonlyArray<RecipeCompound<Variants>>;
|
|
689
|
-
}
|
|
690
|
-
type AnyRecipeDef = RecipeDef<Record<string, RecipeVariantDef>>;
|
|
691
|
-
type RecipeSelection<D extends AnyRecipeDef> = { readonly [K in keyof D['variants']]?: keyof D['variants'][K] & string; };
|
|
692
|
-
type SlotRecipeVariants<Slots> = Readonly<Record<string, Readonly<Record<string, StylePieces<Slots>>>>>;
|
|
693
|
-
interface SlotRecipeDef<Slots, Variants extends SlotRecipeVariants<Slots>> {
|
|
694
|
-
readonly base?: StylePieces<Slots>;
|
|
695
|
-
readonly variants: Variants;
|
|
696
|
-
readonly defaults?: { readonly [K in keyof Variants]?: keyof Variants[K] & string; };
|
|
697
|
-
readonly compound?: ReadonlyArray<{
|
|
698
|
-
readonly when: Partial<{ readonly [K in keyof Variants]: keyof Variants[K] & string; }>;
|
|
699
|
-
readonly style: StylePieces<Slots>;
|
|
700
|
-
}>;
|
|
701
|
-
}
|
|
702
|
-
/** A selection; `null` unsets an axis that has a default. */
|
|
703
|
-
type SlotRecipeSelection<Variants> = { readonly [K in keyof Variants]?: (keyof Variants[K] & string) | null; };
|
|
704
|
-
interface SlotRecipePatch<Slots, Variants extends SlotRecipeVariants<Slots>> {
|
|
705
|
-
readonly base?: StylePieces<Slots>;
|
|
706
|
-
readonly variants?: { readonly [K in keyof Variants]?: { readonly [V in keyof Variants[K]]?: StylePieces<Slots>; }; };
|
|
707
|
-
readonly defaults?: SlotRecipeDef<Slots, Variants>['defaults'];
|
|
708
|
-
readonly compound?: SlotRecipeDef<Slots, Variants>['compound'];
|
|
709
|
-
}
|
|
710
|
-
interface SlotRecipe<Slots, Variants extends SlotRecipeVariants<Slots>> {
|
|
711
|
-
(selection?: SlotRecipeSelection<Variants>): StylePieces<Slots>;
|
|
712
|
-
readonly def: SlotRecipeDef<Slots, Variants>;
|
|
713
|
-
/**
|
|
714
|
-
* The same recipe with `patch` merged in: base pieces compose per slot, a
|
|
715
|
-
* variant's pieces compose over the base recipe's, compounds append,
|
|
716
|
-
* defaults override. A slot the contract lacks is refused at once.
|
|
717
|
-
*/
|
|
718
|
-
readonly extend: (patch: SlotRecipePatch<Slots, Variants>) => SlotRecipe<Slots, Variants>;
|
|
719
|
-
}
|
|
720
|
-
export declare const Style: {
|
|
721
|
-
readonly class: (value: string) => StyleValue;
|
|
722
|
-
readonly inline: (value: Declarations) => StyleValue;
|
|
723
|
-
readonly compose: (...pieces: ReadonlyArray<StyleValue>) => StyleValue;
|
|
724
|
-
readonly when: (condition: boolean, piece: StyleValue) => StyleValue;
|
|
725
|
-
readonly whenInput: <Input>(predicate: (input: Input) => boolean, piece: StyleValue) => StyleValue;
|
|
726
|
-
readonly pseudo: (suffix: string, declarations: Declarations) => StyleValue;
|
|
727
|
-
readonly self: (declarations: Declarations) => StyleValue;
|
|
728
|
-
readonly media: (query: string, declarations: Declarations) => StyleValue;
|
|
729
|
-
readonly supports: (condition: string, declarations: Declarations) => StyleValue;
|
|
730
|
-
readonly container: (condition: string, declarations: Declarations) => StyleValue;
|
|
731
|
-
readonly nest: (selector: string, declarations: Declarations) => StyleValue;
|
|
732
|
-
readonly states: (map: Readonly<Record<string, Declarations>>, attribute?: string) => StyleValue;
|
|
733
|
-
readonly responsive: <Breakpoints extends Readonly<Record<string, string>>>(breakpoints: Breakpoints, map: Partial<Readonly<Record<keyof Breakpoints & string, Declarations>>>) => StyleValue;
|
|
734
|
-
readonly vars: (values: Readonly<Record<`--${string}`, string>>) => StyleValue;
|
|
735
|
-
readonly enter: (declarations: Declarations) => StyleValue;
|
|
736
|
-
readonly allowDiscrete: StyleValue;
|
|
737
|
-
readonly viewTransitionName: (name: string) => StyleValue;
|
|
738
|
-
readonly grid: <const Area extends string>(config: GridConfig<Area>) => Grid<Exclude<Area, ".">>;
|
|
739
|
-
readonly keyframes: (frames: Readonly<Record<string, Declarations>>) => {
|
|
740
|
-
readonly name: string;
|
|
741
|
-
readonly style: StyleValue;
|
|
742
|
-
};
|
|
743
|
-
readonly global: (css: string) => StyleValue;
|
|
744
|
-
readonly empty: StyleValue;
|
|
745
|
-
readonly perItem: (piece: (item: SlotItem) => StyleValue) => StyleValue;
|
|
746
|
-
readonly stagger: (options: {
|
|
747
|
-
readonly stepMs: number;
|
|
748
|
-
readonly property?: "transitionDelay" | "animationDelay";
|
|
749
|
-
}) => StyleValue;
|
|
750
|
-
readonly forSlots: <Slots>(slots: Slots) => (pieces: StylePieces<Slots>, options?: StyleOptions) => NamedStyle<Slots>;
|
|
751
|
-
readonly forCapability: <Slots>(slots: Slots) => (capability: string | Any, piece: StyleValue, options?: StyleOptions) => NamedStyle<Slots>;
|
|
752
|
-
readonly attach: <Slots>(style: NamedStyle<Slots>) => <ViewSlots, Input, Message>(view: SlotView<ViewSlots, Input, Message>) => SlotView<ViewSlots, Input, Message>;
|
|
753
|
-
readonly recipe: <Variants extends Readonly<Record<string, RecipeVariantDef>>>(def: RecipeDef<Variants>) => (selection: RecipeSelection<RecipeDef<Variants>>) => StyleValue;
|
|
754
|
-
readonly recipeFor: <Slots>(slots: Slots) => <Variants extends SlotRecipeVariants<Slots>>(def: SlotRecipeDef<Slots, Variants>) => SlotRecipe<Slots, Variants>;
|
|
755
|
-
readonly stylesheet: (...styles: ReadonlyArray<StyleValue | StylesheetSource>) => string;
|
|
756
|
-
};
|
|
757
202
|
//#endregion
|
|
758
|
-
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 Contribution, type ContributionContext, type Declarations, 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 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 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 StyleOptions, type StylePieces, type StyleRule, type StyleValue, type StylesheetSource, Theme, 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 };
|
|
759
204
|
//# sourceMappingURL=index.d.mts.map
|