@cloudflare/style-container 8.0.6 → 8.0.7
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/CHANGELOG.md +6 -0
- package/dist/isValidElementProp.d.ts +3 -3
- package/dist/types.d.ts +7 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 8.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 92aa24bd89: Accept React 18 and 19 in the peer ranges of smoke-tested components and styling packages. Keep React keys out of Grid and FormGrid styling props, and emit declarations compatible with React 19 types.
|
|
8
|
+
|
|
3
9
|
## 8.0.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/// <reference types="lodash" />
|
|
2
|
+
import type { ElementTag } from './types';
|
|
3
3
|
export declare const ariaAttributes: string[];
|
|
4
|
-
export declare const isValidElementProp: ((tag:
|
|
5
|
-
export declare const filterValidElementProps: <T extends object>(tag:
|
|
4
|
+
export declare const isValidElementProp: ((tag: ElementTag, attr: string) => boolean) & import("lodash").MemoizedFunction;
|
|
5
|
+
export declare const filterValidElementProps: <T extends object>(tag: ElementTag, props: T) => Partial<T>;
|
|
6
6
|
export default isValidElementProp;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ComponentType, CSSProperties, DetailedHTMLProps, Ref, HTMLAttributes, ComponentClass, ForwardRefExoticComponent, PropsWithoutRef } from 'react';
|
|
1
|
+
import { ComponentType, ElementType as ReactElementType, ComponentProps, CSSProperties, DetailedHTMLProps, Ref, HTMLAttributes, ComponentClass, ForwardRefExoticComponent, PropsWithoutRef } from 'react';
|
|
2
2
|
import { TMultiRuleObject, TMultiRule } from 'fela-tools';
|
|
3
3
|
import { variables } from '@cloudflare/style-const';
|
|
4
4
|
import type { IRenderer, IStyle } from 'fela';
|
|
5
5
|
import { FelaWithThemeProps } from 'react-fela';
|
|
6
6
|
export { ThemeProvider } from 'react-fela';
|
|
7
|
-
export declare type ElementTag =
|
|
7
|
+
export declare type ElementTag = Extract<ReactElementType, string>;
|
|
8
8
|
export declare type BaseType = ElementTag | ComponentType<any>;
|
|
9
9
|
export declare type KeyList<T> = Extract<keyof T, string>[];
|
|
10
10
|
export declare type PassthroughProps<P> = KeyList<P> | ((props: P) => KeyList<P>);
|
|
@@ -69,20 +69,17 @@ export declare type RefType<Base extends BaseType> = Base extends ElementTag ? E
|
|
|
69
69
|
ref?: Ref<infer ForwardedRef>;
|
|
70
70
|
}> ? ForwardedRef : never;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* sure we don't include 'ref' as a prop which can be found on
|
|
76
|
-
* components created with forwardRef and props for elements on
|
|
77
|
-
* JSX.IntrinsicElements
|
|
72
|
+
* Infer custom component props directly because ComponentProps can lose
|
|
73
|
+
* {children?: ReactNode} via JSXElementConstructor. Intrinsic tags use
|
|
74
|
+
* React's own ComponentProps mapping. Omit 'ref' from either case.
|
|
78
75
|
*/
|
|
79
|
-
export declare type InferProps<Base extends BaseType> = PropsWithoutRef<Base extends ElementTag ?
|
|
76
|
+
export declare type InferProps<Base extends BaseType> = PropsWithoutRef<Base extends ElementTag ? ComponentProps<Base> : Base extends ComponentType<infer Props> ? Props : never>;
|
|
80
77
|
export declare type TStandardTheme = typeof variables;
|
|
81
78
|
/**
|
|
82
79
|
* Type helper for inferring an HTMLElement type based on the element
|
|
83
80
|
* tag type passed in.
|
|
84
81
|
*/
|
|
85
|
-
export declare type ElementType<Element extends ElementTag> =
|
|
82
|
+
export declare type ElementType<Element extends ElementTag> = ComponentProps<Element> extends DetailedHTMLProps<HTMLAttributes<infer E>, any> ? E : never;
|
|
86
83
|
export declare type TStaticRule = (attr: {
|
|
87
84
|
theme: TStandardTheme;
|
|
88
85
|
}) => string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/style-container",
|
|
3
3
|
"description": "Cloudflare Style Container",
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.7",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"author": "Vojtech Miksu <vojtech@cloudflare.com>",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@cloudflare/style-const": "^6.0.0",
|
|
26
|
-
"react": "^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"
|
|
26
|
+
"react": "^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0"
|
|
27
27
|
},
|
|
28
28
|
"stratus": {
|
|
29
29
|
"srcDirectory": "./src",
|