diff --git a/.changeset/gorgeous-melons-sniff.md b/.changeset/gorgeous-melons-sniff.md new file mode 100644 index 000000000..e409aa3fe --- /dev/null +++ b/.changeset/gorgeous-melons-sniff.md @@ -0,0 +1,5 @@ +--- +'@compiled/react': patch +--- + +Export `CSSPseudos, CSSProperties, StrictCSSProperties` types for a strict `XCSSProp` implementation. diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 320bc2e7e..1c21a9c27 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,16 +1,21 @@ import { createElement } from 'react'; import type { CompiledJSX } from './jsx/jsx-local-namespace'; -import type { CssFunction, CSSProps, CssType } from './types'; -export type { CSSProps, CssFunction, CssType }; - -export { keyframes } from './keyframes'; -export { styled } from './styled'; export { ClassNames } from './class-names'; +export { createStrictAPI } from './create-strict-api'; export { default as css } from './css'; export { default as cssMap } from './css-map'; -export { createStrictAPI } from './create-strict-api'; +export { keyframes } from './keyframes'; +export { styled } from './styled'; +export type { + CSSProperties, + CSSProps, + CSSPseudos, + CssFunction, + CssType, + StrictCSSProperties, +} from './types'; export { type XCSSAllProperties, type XCSSAllPseudos, type XCSSProp, cx } from './xcss-prop'; // Pass through the (classic) jsx runtime. diff --git a/packages/react/src/xcss-prop/index.ts b/packages/react/src/xcss-prop/index.ts index 6fa3d4b93..ddab6ebce 100644 --- a/packages/react/src/xcss-prop/index.ts +++ b/packages/react/src/xcss-prop/index.ts @@ -1,7 +1,7 @@ import type * as CSS from 'csstype'; import { ac } from '../runtime'; -import type { CSSPseudos, CSSProperties } from '../types'; +import type { CSSPseudos, CSSProperties, StrictCSSProperties } from '../types'; type MarkAsRequired = T & { [P in K]-?: T[P] }; @@ -64,7 +64,7 @@ export type CompiledStyles = { * Use in conjunction with {@link XCSSProp} to allow all properties to be given to * your component. */ -export type XCSSAllProperties = keyof CSSProperties; +export type XCSSAllProperties = keyof StrictCSSProperties; /** * Please think twice before using this type, you're better off declaring explicitly