praxis-kit 7.4.0 → 7.8.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/dist/_shared/diagnostics.d.ts +3 -0
- package/dist/_shared/diagnostics.js +3 -0
- package/dist/{chunk-EIKPSL26.js → chunk-QYP7KLRE.js} +316 -154
- package/dist/contract/index.d.ts +27 -4
- package/dist/eslint/index.js +227 -187
- package/dist/html/index.d.ts +6 -1
- package/dist/html/index.js +234 -68
- package/dist/lit/index.d.ts +27 -4
- package/dist/lit/index.js +305 -141
- package/dist/preact/index.d.ts +114 -6
- package/dist/preact/index.js +321 -153
- package/dist/react/index.d.ts +3 -2
- package/dist/react/index.js +7 -2
- package/dist/react/legacy.d.ts +8 -5
- package/dist/react/legacy.js +13 -9
- package/dist/{react-options-BnjZpdVh.d.ts → react-options-DU3EdFOv.d.ts} +126 -7
- package/dist/solid/index.d.ts +127 -8
- package/dist/solid/index.js +320 -153
- package/dist/svelte/Polymorphic.svelte +8 -0
- package/dist/svelte/index.d.ts +224 -13
- package/dist/svelte/index.js +319 -152
- package/dist/tailwind/index.d.ts +1 -1
- package/dist/vite-plugin/index.d.ts +6 -3
- package/dist/vue/index.d.ts +94 -6
- package/dist/vue/index.js +320 -153
- package/dist/web/index.d.ts +27 -4
- package/dist/web/index.js +305 -141
- package/package.json +9 -9
package/dist/web/index.d.ts
CHANGED
|
@@ -47,6 +47,19 @@ type NoPluginProps = EmptyRecord;
|
|
|
47
47
|
type IntrinsicTag = keyof HTMLElementTagNameMap;
|
|
48
48
|
|
|
49
49
|
type ElementType = IntrinsicTag | (string & {});
|
|
50
|
+
/**
|
|
51
|
+
* Resolves a component's default tag to its real DOM interface — `HTMLDialogElement` for
|
|
52
|
+
* `'dialog'`, `HTMLDetailsElement` for `'details'`, and so on — falling back to `HTMLElement`
|
|
53
|
+
* for custom-element tags or anything not in `HTMLElementTagNameMap`. Used to type
|
|
54
|
+
* `FactoryOptions.onElement`'s `element` param so component authors get direct, correctly-typed
|
|
55
|
+
* access to tag-specific native members (`dialogEl.showModal()`) without an unsafe cast.
|
|
56
|
+
*
|
|
57
|
+
* The fallback is `HTMLElement`, not the more generic `Element` — every tag reachable through
|
|
58
|
+
* `IntrinsicTag` extends it, and so does every custom element per spec, so members `HTMLElement`
|
|
59
|
+
* itself declares (`showPopover()`/`hidePopover()`/`togglePopover()`, the `popover` attribute)
|
|
60
|
+
* stay directly accessible even for tags with no dedicated entry in `HTMLElementTagNameMap`.
|
|
61
|
+
*/
|
|
62
|
+
type ElementForTag<TDefault extends ElementType> = TDefault extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[TDefault] : HTMLElement;
|
|
50
63
|
|
|
51
64
|
declare const KNOWN_ARIA_ROLES: readonly ["alert", "alertdialog", "application", "article", "banner", "blockquote", "button", "caption", "cell", "checkbox", "code", "columnheader", "combobox", "complementary", "contentinfo", "definition", "deletion", "dialog", "document", "emphasis", "feed", "figure", "form", "generic", "grid", "gridcell", "group", "heading", "img", "insertion", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "meter", "navigation", "none", "note", "option", "paragraph", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "strong", "subscript", "superscript", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "time", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem"];
|
|
52
65
|
type KnownAriaRole = (typeof KNOWN_ARIA_ROLES)[number];
|
|
@@ -146,7 +159,7 @@ type DefaultVariants<V extends VariantMap> = {
|
|
|
146
159
|
* Presets are named bundles of variant props that callers activate by key,
|
|
147
160
|
* avoiding the need to repeat variant combinations at each call site.
|
|
148
161
|
*/
|
|
149
|
-
type RecipeMap<V extends VariantMap = VariantMap> = Readonly<
|
|
162
|
+
type RecipeMap<V extends VariantMap = VariantMap> = Readonly<StringMap<VariantSelection<V>>>;
|
|
150
163
|
|
|
151
164
|
type RecipeTarget<TVariants extends VariantMap = VariantMap> = VariantSelection<TVariants>;
|
|
152
165
|
|
|
@@ -180,7 +193,7 @@ interface BaseClassOptions {
|
|
|
180
193
|
type ClassPipelineFn = (tag: unknown, props: AnyRecord, className?: ClassName, recipe?: string) => string | undefined;
|
|
181
194
|
|
|
182
195
|
interface RecipeOptions<TVariants extends VariantMap = VariantMap> {
|
|
183
|
-
recipeMap?:
|
|
196
|
+
recipeMap?: StringMap<RecipeTarget<TVariants>>;
|
|
184
197
|
}
|
|
185
198
|
|
|
186
199
|
interface TagMapOptions {
|
|
@@ -349,7 +362,7 @@ type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPre
|
|
|
349
362
|
* combination, skipping runtime class computation entirely when a match is found. Normally
|
|
350
363
|
* generated by a build-time class-extraction plugin rather than hand-authored.
|
|
351
364
|
*/
|
|
352
|
-
readonly precomputedClasses?: Readonly<
|
|
365
|
+
readonly precomputedClasses?: Readonly<StringMap<string>>;
|
|
353
366
|
};
|
|
354
367
|
|
|
355
368
|
type NormalizeFn<Props extends AnyRecord = AnyRecord> = {
|
|
@@ -395,13 +408,23 @@ type FactoryOptions<TDefault extends ElementType = ElementType, Props extends An
|
|
|
395
408
|
* no prop-based equivalent), not for anything expressible as a plain
|
|
396
409
|
* prop.
|
|
397
410
|
*
|
|
411
|
+
* `element` is typed to the real DOM interface of every tag the rendered
|
|
412
|
+
* element could actually be — `TDefault` plus whatever `enforcement.allowed`
|
|
413
|
+
* permits via `as` (`HTMLDialogElement` for `tag: 'dialog'`,
|
|
414
|
+
* `HTMLDetailsElement` for `tag: 'details'`, and so on) — no cast needed to
|
|
415
|
+
* reach tag-specific members. A component that leaves `allowed`
|
|
416
|
+
* unconstrained (any tag reachable via `as`) falls back to `HTMLElement`,
|
|
417
|
+
* which still covers members every element shares (`showPopover()` and
|
|
418
|
+
* friends); restrict `enforcement.allowed` to the tags `onElement`
|
|
419
|
+
* actually knows how to handle to get real narrowing.
|
|
420
|
+
*
|
|
398
421
|
* `getProps` returns the instance's *current* resolved props at call
|
|
399
422
|
* time — read it from inside a listener registered once at mount, rather
|
|
400
423
|
* than re-subscribing on every prop change.
|
|
401
424
|
*
|
|
402
425
|
* Return a cleanup function to run when the instance unmounts.
|
|
403
426
|
*/
|
|
404
|
-
readonly onElement?: (element:
|
|
427
|
+
readonly onElement?: (element: ElementForTag<TDefault | TAllowed>, getProps: () => Readonly<Props>) => void | (() => void);
|
|
405
428
|
};
|
|
406
429
|
|
|
407
430
|
/**
|