Skip to content

Commit 6b7cdde

Browse files
chore(release): 1.0.0-alpha.3
# [1.0.0-alpha.3](v1.0.0-alpha.2...v1.0.0-alpha.3) (2021-10-30) ### Bug Fixes * make server types more generalized ([874b7f8](874b7f8))
1 parent 874b7f8 commit 6b7cdde

File tree

4 files changed

+36
-81
lines changed

4 files changed

+36
-81
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [1.0.0-alpha.3](https://github.com/dash-ui/react/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2021-10-30)
2+
3+
4+
### Bug Fixes
5+
6+
* make server types more generalized ([874b7f8](https://github.com/dash-ui/react/commit/874b7f8593f27f33ff6789ba5bdc1575d9207483))
7+
18
# [1.0.0-alpha.2](https://github.com/dash-ui/react/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2021-10-29)
29

310
### Bug Fixes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dash-ui/react",
3-
"version": "1.0.0-alpha.2",
3+
"version": "1.0.0-alpha.3",
44
"description": "React components and hooks for dash-ui",
55
"license": "MIT",
66
"author": "Jared Lunde <[email protected]> (https://jaredLunde.com)",

server/types/index.d.ts

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ import * as React from "react";
88
* @param styles - An instance of `styles()`. Defaults to the default styles instance
99
* in `@dash-ui/styles`.
1010
*/
11-
export declare function toComponent(
12-
html: string,
13-
styles?: Styles<any, any>
14-
): React.ReactElement;
11+
export declare function toComponent(html: string, styles?: Styles<any, any>): React.ReactElement;
1512
/**
1613
* A React component for injecting SSR CSS styles into Next.js documents
1714
*
@@ -39,22 +36,16 @@ export declare function toComponent(
3936
* }
4037
* }
4138
*/
42-
export declare function Style({
43-
html,
44-
styles,
45-
}: StyleProps): React.ReactElement<
46-
any,
47-
string | React.JSXElementConstructor<any>
48-
>;
39+
export declare function Style({ html, styles }: StyleProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
4940
export interface StyleProps {
50-
/**
51-
* The HTML generated by Next.js, `renderToStaticMarkup()` or `renderToString()`
52-
*/
53-
html: string;
54-
/**
55-
* An instance of `styles()`. Defaults to the default styles instance in `@dash-ui/styles`.
56-
*/
57-
styles?: Styles<any, any>;
41+
/**
42+
* The HTML generated by Next.js, `renderToStaticMarkup()` or `renderToString()`
43+
*/
44+
html: string;
45+
/**
46+
* An instance of `styles()`. Defaults to the default styles instance in `@dash-ui/styles`.
47+
*/
48+
styles?: Styles<any, any>;
5849
}
5950
/**
6051
* Creates a Gatsby replaceRenderer for injecting styles generated by Dash on
@@ -66,7 +57,5 @@ export interface StyleProps {
6657
* // gatsby-ssr.js
6758
* exports.replaceRenderer = require('@dash-ui/react/server').createGatsbyRenderer()
6859
*/
69-
export declare function createGatsbyRenderer(
70-
styles?: Styles<any, any>
71-
): <P = any>(props: P) => P;
60+
export declare function createGatsbyRenderer(styles?: Styles<any, any>): <P = any>(props: P) => P;
7261
export * from "@dash-ui/styles/server";

types/index.d.ts

Lines changed: 17 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import type {
2-
DashThemes,
3-
DashTokens,
4-
Falsy,
5-
StyleCallback,
6-
StyleObject,
7-
Styles,
8-
} from "@dash-ui/styles";
1+
import type { DashThemes, DashTokens, Falsy, StyleCallback, StyleObject, Styles } from "@dash-ui/styles";
92
import * as React from "react";
103
/**
114
* A component for creating an inline `<style>` tag that is unmounted when
@@ -15,25 +8,19 @@ import * as React from "react";
158
* @param root0.css
169
* @param root0.styles
1710
*/
18-
export declare function Inline<
19-
Tokens extends DashTokens,
20-
Themes extends DashThemes
21-
>({ styles, css: input }: InlineProps<Tokens, Themes>): JSX.Element | null;
22-
export interface InlineProps<
23-
Tokens extends DashTokens,
24-
Themes extends DashThemes
25-
> {
26-
/**
27-
* A Dash `styles` instance
28-
*/
29-
styles: Styles<Tokens, Themes>;
30-
/**
31-
* The CSS you want to inline in the DOM.
32-
*
33-
* @example
34-
* const Component => <Inline css={({color}) => `html { color: ${color.text}; }`}/>
35-
*/
36-
css: string | StyleCallback<Tokens, Themes> | StyleObject;
11+
export declare function Inline<Tokens extends DashTokens, Themes extends DashThemes>({ styles, css: input, }: InlineProps<Tokens, Themes>): JSX.Element | null;
12+
export interface InlineProps<Tokens extends DashTokens, Themes extends DashThemes> {
13+
/**
14+
* A Dash `styles` instance
15+
*/
16+
styles: Styles<Tokens, Themes>;
17+
/**
18+
* The CSS you want to inline in the DOM.
19+
*
20+
* @example
21+
* const Component => <Inline css={({color}) => `html { color: ${color.text}; }`}/>
22+
*/
23+
css: string | StyleCallback<Tokens, Themes> | StyleObject;
3724
}
3825
/**
3926
* A hook for inserting transient global styles into the DOM. These styles
@@ -56,21 +43,7 @@ export interface InlineProps<
5643
* )
5744
* }
5845
*/
59-
export declare function useGlobal<
60-
Tokens extends DashTokens,
61-
Themes extends DashThemes
62-
>(
63-
styles: Styles<Tokens, Themes>,
64-
value:
65-
| string
66-
| StyleCallback<Tokens, Themes>
67-
| StyleObject
68-
| null
69-
| 0
70-
| undefined
71-
| false,
72-
deps?: React.DependencyList
73-
): void;
46+
export declare function useGlobal<Tokens extends DashTokens, Themes extends DashThemes>(styles: Styles<Tokens, Themes>, value: string | StyleCallback<Tokens, Themes> | StyleObject | null | 0 | undefined | false, deps?: React.DependencyList): void;
7447
/**
7548
* A hook for inserting transient CSS tokens into the DOM. These tokens
7649
* will be injected when the hook mounts and flushed when the hook unmounts.
@@ -89,14 +62,7 @@ export declare function useGlobal<
8962
* )
9063
* }
9164
*/
92-
export declare function useTokens<
93-
Tokens extends DashTokens,
94-
Themes extends DashThemes
95-
>(
96-
styles: Styles<Tokens, Themes>,
97-
value: Parameters<Styles<Tokens, Themes>["insertTokens"]>[0] | Falsy,
98-
deps?: React.DependencyList
99-
): void;
65+
export declare function useTokens<Tokens extends DashTokens, Themes extends DashThemes>(styles: Styles<Tokens, Themes>, value: Parameters<Styles<Tokens, Themes>["insertTokens"]>[0] | Falsy, deps?: React.DependencyList): void;
10066
/**
10167
* A hook for inserting transient CSS theme tokens into the DOM. These tokens
10268
* will be injected when the hook mounts and flushed when the hook unmounts.
@@ -117,11 +83,4 @@ export declare function useTokens<
11783
* )
11884
* }
11985
*/
120-
export declare function useThemes<
121-
Tokens extends DashTokens,
122-
Themes extends DashThemes
123-
>(
124-
styles: Styles<Tokens, Themes>,
125-
value: Parameters<Styles<Tokens, Themes>["insertThemes"]>[0] | Falsy,
126-
deps?: React.DependencyList
127-
): void;
86+
export declare function useThemes<Tokens extends DashTokens, Themes extends DashThemes>(styles: Styles<Tokens, Themes>, value: Parameters<Styles<Tokens, Themes>["insertThemes"]>[0] | Falsy, deps?: React.DependencyList): void;

0 commit comments

Comments
 (0)