Skip to content

Export CSSPseudos, CSSProperties, StrictCSSProperties types for a strict XCSSProp implementation. #1600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gorgeous-melons-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@compiled/react': patch
---

Export `CSSPseudos, CSSProperties, StrictCSSProperties` types for a strict `XCSSProp` implementation.
17 changes: 11 additions & 6 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/xcss-prop/index.ts
Original file line number Diff line number Diff line change
@@ -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, K extends keyof T> = T & { [P in K]-?: T[P] };

Expand Down Expand Up @@ -64,7 +64,7 @@ export type CompiledStyles<TObject> = {
* 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
Expand Down