@bedrock-layout/solid 1.1.10 → 1.1.11
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/lib/typeUtils.d.ts +7 -7
- package/package.json +3 -3
package/lib/typeUtils.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* attribute where its appropriate.
|
|
7
7
|
*/
|
|
8
8
|
import { JSX } from "solid-js";
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type OmitAndMerge<A, B> = A & Omit<B, keyof A>;
|
|
10
|
+
type Accessor<T = unknown> = () => T;
|
|
11
11
|
export type Maybe<T> = NonNullable<T> | undefined;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type ValidElements = keyof JSX.IntrinsicElements;
|
|
13
|
+
type ValidComponent<P> = (props: P) => JSX.Element;
|
|
14
14
|
export type ValidConstructor = ValidElements | ValidComponent<any> | (string & {});
|
|
15
15
|
export type DynamicProps<T extends ValidConstructor> = T extends ValidElements ? JSX.IntrinsicElements[T] : T extends ValidComponent<infer U> ? U : Record<string, unknown>;
|
|
16
16
|
type UnboxIntrinsicElements<T> = T extends JSX.HTMLAttributes<infer U> ? U : never;
|
|
@@ -19,11 +19,11 @@ type RefField<T> = T | RefCallback<T>;
|
|
|
19
19
|
type UnboxComponentProp<U> = U extends {
|
|
20
20
|
ref: infer X;
|
|
21
21
|
} ? X : never;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
type DynamicNode<T extends ValidConstructor> = T extends ValidElements ? UnboxIntrinsicElements<JSX.IntrinsicElements[T]> : T extends ValidComponent<infer U> ? UnboxComponentProp<U> : never;
|
|
23
|
+
interface WithRef<T extends ValidConstructor> {
|
|
24
24
|
ref?: RefField<DynamicNode<T>>;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
interface DynamicComponentWithRef<T extends ValidConstructor> extends WithRef<T> {
|
|
27
27
|
as?: T;
|
|
28
28
|
}
|
|
29
29
|
export type HeadlessPropsWithRef<T extends ValidConstructor, V = {}> = OmitAndMerge<V & DynamicComponentWithRef<T>, DynamicProps<T>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrock-layout/solid",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "Solid Foundational Layout Primitives for your Solid-js App",
|
|
5
5
|
"info": "Solid Bedrock Layout is a Solid.js port of the Bedrock Layout primitives written for react. Bedrock primitives are built to allow you to compose them together to create your own custom layouts. Many 'complex' layouts can be created by composing Bedrock Layout Primitives",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"solid-js": "^1.3.7"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@bedrock-layout/register-resize-callback": "^2.0.
|
|
59
|
+
"@bedrock-layout/register-resize-callback": "^2.0.9"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"bugs": {
|
|
72
72
|
"url": "https://github.com/Bedrock-Layouts/Solid-Bedrock/issues"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "a3f85a5aebbd9681317b1c00c88765b2537f9b10"
|
|
75
75
|
}
|