Skip to content

Commit b900094

Browse files
author
Brijesh Bittu
committed
Consolidate exports to single ts file
1 parent d839820 commit b900094

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

packages/pigment-css-react-new/src/styled.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/pigment-css-react-new/src/styled.d.ts renamed to packages/pigment-css-react-new/src/styled.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import type * as React from 'react';
2-
import { Variants, BaseInterface, CssArg, VariantNames, Primitive } from '@pigment-css/core';
2+
import {
3+
Variants,
4+
BaseInterface,
5+
CssArg,
6+
VariantNames,
7+
Primitive,
8+
generateErrorMessage,
9+
} from '@pigment-css/core';
310

411
export type NoInfer<T> = [T][T extends any ? 0 : never];
512
type FastOmit<T extends object, U extends string | number | symbol> = {
@@ -8,7 +15,7 @@ type FastOmit<T extends object, U extends string | number | symbol> = {
815

916
export type Substitute<A extends object, B extends object> = FastOmit<A, keyof B> & B;
1017

11-
interface RequiredProps {
18+
export interface RequiredProps {
1219
className?: string;
1320
style?: React.CSSProperties;
1421
}
@@ -72,4 +79,7 @@ export type CreateStyledIndex = {
7279
>;
7380
};
7481

75-
export declare const styled: CreateStyled & CreateStyledIndex;
82+
// @ts-expect-error The implementation is is different than the user API
83+
export const styled: CreateStyled & CreateStyledIndex = () => {
84+
throw new Error(generateErrorMessage('styled'));
85+
};

packages/pigment-css-react-new/tests/styled/fixtures/styled-no-layer.input.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function TestComponent() {
1414
}
1515

1616
const StyledTest = styled(TestComponent)({
17+
// gets converted to css variable -> ---id: 0px
1718
$$id: 0,
1819
display: 'block',
1920
position: 'absolute',

packages/pigment-css-react-new/tests/styled/fixtures/styled-no-layer.output.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)