@umber-style/react 0.0.0-stage → 0.1.0-alpha.0
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/LICENSE +21 -0
- package/README.md +10 -2
- package/dist/ThemeProvider.cjs +37 -0
- package/dist/ThemeProvider.mjs +37 -0
- package/dist/ThemeProvider.server.cjs +35 -0
- package/dist/ThemeProvider.server.mjs +35 -0
- package/dist/ThemeValue.cjs +32 -0
- package/dist/ThemeValue.mjs +32 -0
- package/dist/createStyle.cjs +56 -0
- package/dist/createStyle.d.cts +7 -0
- package/dist/createStyle.d.mts +7 -0
- package/dist/createStyle.mjs +55 -0
- package/dist/createStyle.server.cjs +53 -0
- package/dist/createStyle.server.d.cts +8 -0
- package/dist/createStyle.server.d.mts +8 -0
- package/dist/createStyle.server.mjs +52 -0
- package/dist/defaultStyle.cjs +44 -0
- package/dist/defaultStyle.d.cts +22 -0
- package/dist/defaultStyle.d.mts +22 -0
- package/dist/defaultStyle.mjs +44 -0
- package/dist/defaultStyle.server.cjs +44 -0
- package/dist/defaultStyle.server.d.cts +22 -0
- package/dist/defaultStyle.server.d.mts +22 -0
- package/dist/defaultStyle.server.mjs +44 -0
- package/dist/index.cjs +61 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.mts +18 -0
- package/dist/index.mjs +5 -0
- package/dist/index.server.cjs +61 -0
- package/dist/index.server.d.cts +18 -0
- package/dist/index.server.d.mts +18 -0
- package/dist/index.server.mjs +5 -0
- package/dist/serverContext.cjs +32 -0
- package/dist/serverContext.d.cts +2 -0
- package/dist/serverContext.d.mts +3 -0
- package/dist/serverContext.mjs +31 -0
- package/dist/styleElements.cjs +33 -0
- package/dist/styleElements.mjs +32 -0
- package/dist/styled.cjs +30 -0
- package/dist/styled.mjs +30 -0
- package/dist/styled.server.cjs +22 -0
- package/dist/styled.server.mjs +22 -0
- package/dist/styledParts.cjs +37 -0
- package/dist/styledParts.mjs +37 -0
- package/dist/types.d.cts +101 -0
- package/dist/types.d.mts +101 -0
- package/package.json +90 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
let _umber_style_core = require("@umber-style/core");
|
|
2
|
+
// src/styledParts.ts
|
|
3
|
+
/** Whether `tag` is a component made by `styled`. */
|
|
4
|
+
function isStyledComponent(tag) {
|
|
5
|
+
return typeof tag === "function" && "_styles" in tag;
|
|
6
|
+
}
|
|
7
|
+
/** What both builds of `styled` share: the styler, and the element and props that a component renders. */
|
|
8
|
+
function prepareStyled(engine, tag, options, styles) {
|
|
9
|
+
const inner = isStyledComponent(tag) ? tag : void 0;
|
|
10
|
+
const baseTag = inner?._tag ?? tag;
|
|
11
|
+
const shouldForward = options.shouldForwardProp ?? inner?._shouldForwardProp;
|
|
12
|
+
const styler = engine.createStyler(options, styles, inner?._styles);
|
|
13
|
+
/** The element, its props and the engine class for `props`; `theme` is the view that function styles read. */
|
|
14
|
+
const resolve = (props, theme) => {
|
|
15
|
+
const className = styler.getClassName(props, [...(0, _umber_style_core.flattenStyle)(props.style), props.className], theme);
|
|
16
|
+
const element = props.as ?? baseTag;
|
|
17
|
+
const filter = typeof element === "string" ? shouldForward : void 0;
|
|
18
|
+
const forwarded = {};
|
|
19
|
+
for (const [key, value] of Object.entries(props)) if (!(key === "as" || key === "theme" || key === "className" || key === "style") && (!filter || filter(key))) forwarded[key] = value;
|
|
20
|
+
forwarded.className = className || void 0;
|
|
21
|
+
return {
|
|
22
|
+
element,
|
|
23
|
+
forwarded,
|
|
24
|
+
className
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
styler,
|
|
29
|
+
resolve,
|
|
30
|
+
statics: {
|
|
31
|
+
_styles: styler.styles,
|
|
32
|
+
_tag: baseTag,
|
|
33
|
+
_shouldForwardProp: shouldForward
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.prepareStyled = prepareStyled;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { flattenStyle } from "@umber-style/core";
|
|
2
|
+
// src/styledParts.ts
|
|
3
|
+
/** Whether `tag` is a component made by `styled`. */
|
|
4
|
+
function isStyledComponent(tag) {
|
|
5
|
+
return typeof tag === "function" && "_styles" in tag;
|
|
6
|
+
}
|
|
7
|
+
/** What both builds of `styled` share: the styler, and the element and props that a component renders. */
|
|
8
|
+
function prepareStyled(engine, tag, options, styles) {
|
|
9
|
+
const inner = isStyledComponent(tag) ? tag : void 0;
|
|
10
|
+
const baseTag = inner?._tag ?? tag;
|
|
11
|
+
const shouldForward = options.shouldForwardProp ?? inner?._shouldForwardProp;
|
|
12
|
+
const styler = engine.createStyler(options, styles, inner?._styles);
|
|
13
|
+
/** The element, its props and the engine class for `props`; `theme` is the view that function styles read. */
|
|
14
|
+
const resolve = (props, theme) => {
|
|
15
|
+
const className = styler.getClassName(props, [...flattenStyle(props.style), props.className], theme);
|
|
16
|
+
const element = props.as ?? baseTag;
|
|
17
|
+
const filter = typeof element === "string" ? shouldForward : void 0;
|
|
18
|
+
const forwarded = {};
|
|
19
|
+
for (const [key, value] of Object.entries(props)) if (!(key === "as" || key === "theme" || key === "className" || key === "style") && (!filter || filter(key))) forwarded[key] = value;
|
|
20
|
+
forwarded.className = className || void 0;
|
|
21
|
+
return {
|
|
22
|
+
element,
|
|
23
|
+
forwarded,
|
|
24
|
+
className
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
styler,
|
|
29
|
+
resolve,
|
|
30
|
+
statics: {
|
|
31
|
+
_styles: styler.styles,
|
|
32
|
+
_tag: baseTag,
|
|
33
|
+
_shouldForwardProp: shouldForward
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export { prepareStyled };
|
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ComponentProps, ElementType, FunctionComponent, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { AlphaColor, BindingOptions, Cache, ColorScheme, DeepPartial, Engine, NestedKey, ObjectSheet, SchemeKey, SchemeKey as SchemeKey$1, SchemeName, SchemeName as SchemeName$1, SheetEntry, SheetEntry as SheetEntry$1, SheetStyles, StyleInput, StyleObject, StylerOptions, Theme, ThemeKey, ThemeKey as ThemeKey$1, WebNested, WebProperties, WebStyleObject, WebStyleObject as WebStyleObject$1 } from "@umber-style/core";
|
|
3
|
+
/** What only the client build of the React binding takes: it can render the style of its classes on a server. */
|
|
4
|
+
export interface ServerStyleOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Whether, where there is no `document` (the server render of a client component), a styled element and a
|
|
7
|
+
* theme provider render the `<style href precedence>` elements of their classes, as the server components
|
|
8
|
+
* build does. React moves them to the head and renders each `href` once, so the first HTML of a page
|
|
9
|
+
* is styled whichever build rendered a component. In the browser the client build inserts into its sheet
|
|
10
|
+
* and renders none, whatever this is. Default true. Set it to false when a classic server render
|
|
11
|
+
* puts the CSS of the page into one style element of its own (`extractPageStyles`, `createStyleTag`).
|
|
12
|
+
*/
|
|
13
|
+
hasServerStyleElements?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface StyleOptions<T = never> extends BindingOptions<T>, ServerStyleOptions {}
|
|
16
|
+
export interface DefaultStyleOptions extends BindingOptions<Theme>, ServerStyleOptions {
|
|
17
|
+
/** The base theme, for an app that has no provider at all. */
|
|
18
|
+
theme?: Theme;
|
|
19
|
+
}
|
|
20
|
+
export interface StyledOptions extends StylerOptions {
|
|
21
|
+
/** Whether a prop is forwarded to a string tag. Default: every prop but `as`, `theme`, `className` and `style`, which the component handles itself. */
|
|
22
|
+
shouldForwardProp?: (prop: string) => boolean;
|
|
23
|
+
}
|
|
24
|
+
/** What a styled component keeps, so that styling it again flattens into one element. */
|
|
25
|
+
export interface StyledStatics {
|
|
26
|
+
/** Every style of the component, the styles of the components it wraps first. */
|
|
27
|
+
_styles: readonly StyleInput[];
|
|
28
|
+
/** The tag or component that is finally rendered. */
|
|
29
|
+
_tag: ElementType;
|
|
30
|
+
_shouldForwardProp?: (prop: string) => boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What the `style` prop of a styled component takes on the web: sheet entries and plain style
|
|
34
|
+
* objects, in arrays, with falsy values dropped. Nothing is rendered as a style attribute: all of it
|
|
35
|
+
* is merged, in order, into the one class of the element, after its own styles and before
|
|
36
|
+
* `className`. A value that changes often (an animated or measured number) makes a new class for
|
|
37
|
+
* each value, so give such a value to a class as a CSS custom property, or drive it another way. A
|
|
38
|
+
* string is an error.
|
|
39
|
+
*/
|
|
40
|
+
export type StyleProp = SheetEntry$1 | WebStyleObject$1 | false | null | undefined | readonly StyleProp[];
|
|
41
|
+
export type StyledComponent<C extends ElementType, P extends object> = FunctionComponent<Omit<ComponentProps<C>, keyof P | 'as' | 'style'> & P & {
|
|
42
|
+
as?: ElementType;
|
|
43
|
+
style?: StyleProp;
|
|
44
|
+
}> & StyledStatics;
|
|
45
|
+
export type Styled<T> = <C extends ElementType>(tag: C, options?: StyledOptions) => <P extends object = object>(...styles: StyleInput<T, P>[]) => StyledComponent<C, P>;
|
|
46
|
+
/** A set of named styles; `E` is what one of them becomes: a class name on the web, a style object on React Native. */
|
|
47
|
+
export interface SheetDefinition<S extends SheetStyles, E> {
|
|
48
|
+
/** Never set at run time: it only carries the types. */
|
|
49
|
+
readonly entries?: { [K in keyof S]: E; };
|
|
50
|
+
}
|
|
51
|
+
export interface ThemeProviderProps<T> {
|
|
52
|
+
/** The theme, or the part of it that this subtree changes. */
|
|
53
|
+
readonly theme: DeepPartial<T>;
|
|
54
|
+
/** Web only. */
|
|
55
|
+
readonly colorScheme?: ColorScheme;
|
|
56
|
+
/** Web only. */
|
|
57
|
+
readonly className?: string;
|
|
58
|
+
/** Web only. Renders no element and no class: the app puts `themeClass(theme)` on an ancestor, usually `<html>`. The theme still reaches the engine and the context. */
|
|
59
|
+
readonly isRoot?: boolean;
|
|
60
|
+
readonly children?: ReactNode;
|
|
61
|
+
}
|
|
62
|
+
export interface WebThemeProviderProps<T> extends ThemeProviderProps<T> {
|
|
63
|
+
/** The element that carries the theme class. Default 'div'. */
|
|
64
|
+
readonly as?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface Style<T, E> {
|
|
67
|
+
styled: Styled<T>;
|
|
68
|
+
StyleSheet: {
|
|
69
|
+
/** A sheet given as an object is its entries, usable at once, with no hook and no theme. */
|
|
70
|
+
create<K extends string>(styles: ObjectSheet<K>): { readonly [P in K]: E; };
|
|
71
|
+
/** A sheet given as a function of the theme is for `useStyle`, which resolves it against the theme. */
|
|
72
|
+
create<K extends string>(styles: (theme: T) => Record<K, WebStyleObject$1>): SheetDefinition<Record<K, WebStyleObject$1>, E>;
|
|
73
|
+
};
|
|
74
|
+
/** The entries of a sheet; an object sheet is its own entries and is returned as it is. */
|
|
75
|
+
useStyle<K extends string>(sheet: { readonly [P in K]: E; }): { readonly [P in K]: E; };
|
|
76
|
+
useStyle<S extends SheetStyles>(sheet: SheetDefinition<S, E>): { [K in keyof S]: E; };
|
|
77
|
+
ThemeProvider(props: ThemeProviderProps<T>): ReactElement;
|
|
78
|
+
/** The real theme values, for JavaScript that needs a number or a name. */
|
|
79
|
+
useTheme(): T;
|
|
80
|
+
/** The class that declares the variables of `theme`; '' on React Native. */
|
|
81
|
+
themeClass(theme: DeepPartial<T>, colorScheme?: ColorScheme): string;
|
|
82
|
+
/** A style key for "the nearest theme is this theme": `{ [when(dark)]: { border: ... } }`. On the web it needs `@scope`; on React Native it matches the theme object of the nearest provider. */
|
|
83
|
+
when(theme: DeepPartial<T>, colorScheme?: ColorScheme): ThemeKey$1;
|
|
84
|
+
/** A style key for "the nearest color scheme is this one": the nearest provider given that `colorScheme`, else the system preference. */
|
|
85
|
+
whenScheme(scheme: SchemeName$1): SchemeKey$1;
|
|
86
|
+
}
|
|
87
|
+
/** The styling for server components: the root theme of the request is read with readTheme, not with a hook. */
|
|
88
|
+
export interface ServerStyle<T> extends Omit<WebStyle<T>, 'useTheme'> {
|
|
89
|
+
/** The root theme of the request, or the base theme of the engine; throws when there is neither. */
|
|
90
|
+
readTheme(): T;
|
|
91
|
+
}
|
|
92
|
+
export interface WebStyle<T> extends Omit<Style<T, SheetEntry$1>, 'ThemeProvider' | 'apply'> {
|
|
93
|
+
/** The props that apply sheet entries (or class names) to a plain element: a class name. */
|
|
94
|
+
apply(...entries: (SheetEntry$1 | string | null | undefined | false)[]): {
|
|
95
|
+
className?: string;
|
|
96
|
+
};
|
|
97
|
+
ThemeProvider(props: WebThemeProviderProps<T>): ReactElement;
|
|
98
|
+
engine: Engine<T>;
|
|
99
|
+
cache: Cache;
|
|
100
|
+
}
|
|
101
|
+
export type { AlphaColor, NestedKey, SchemeKey, SchemeName, SheetEntry, StyleObject, ThemeKey, WebNested, WebProperties, WebStyleObject };
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ComponentProps, ElementType, FunctionComponent, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { AlphaColor, BindingOptions, Cache, ColorScheme, DeepPartial, Engine, NestedKey, ObjectSheet, SchemeKey, SchemeKey as SchemeKey$1, SchemeName, SchemeName as SchemeName$1, SheetEntry, SheetEntry as SheetEntry$1, SheetStyles, StyleInput, StyleObject, StylerOptions, Theme, ThemeKey, ThemeKey as ThemeKey$1, WebNested, WebProperties, WebStyleObject, WebStyleObject as WebStyleObject$1 } from "@umber-style/core";
|
|
3
|
+
/** What only the client build of the React binding takes: it can render the style of its classes on a server. */
|
|
4
|
+
export interface ServerStyleOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Whether, where there is no `document` (the server render of a client component), a styled element and a
|
|
7
|
+
* theme provider render the `<style href precedence>` elements of their classes, as the server components
|
|
8
|
+
* build does. React moves them to the head and renders each `href` once, so the first HTML of a page
|
|
9
|
+
* is styled whichever build rendered a component. In the browser the client build inserts into its sheet
|
|
10
|
+
* and renders none, whatever this is. Default true. Set it to false when a classic server render
|
|
11
|
+
* puts the CSS of the page into one style element of its own (`extractPageStyles`, `createStyleTag`).
|
|
12
|
+
*/
|
|
13
|
+
hasServerStyleElements?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface StyleOptions<T = never> extends BindingOptions<T>, ServerStyleOptions {}
|
|
16
|
+
export interface DefaultStyleOptions extends BindingOptions<Theme>, ServerStyleOptions {
|
|
17
|
+
/** The base theme, for an app that has no provider at all. */
|
|
18
|
+
theme?: Theme;
|
|
19
|
+
}
|
|
20
|
+
export interface StyledOptions extends StylerOptions {
|
|
21
|
+
/** Whether a prop is forwarded to a string tag. Default: every prop but `as`, `theme`, `className` and `style`, which the component handles itself. */
|
|
22
|
+
shouldForwardProp?: (prop: string) => boolean;
|
|
23
|
+
}
|
|
24
|
+
/** What a styled component keeps, so that styling it again flattens into one element. */
|
|
25
|
+
export interface StyledStatics {
|
|
26
|
+
/** Every style of the component, the styles of the components it wraps first. */
|
|
27
|
+
_styles: readonly StyleInput[];
|
|
28
|
+
/** The tag or component that is finally rendered. */
|
|
29
|
+
_tag: ElementType;
|
|
30
|
+
_shouldForwardProp?: (prop: string) => boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What the `style` prop of a styled component takes on the web: sheet entries and plain style
|
|
34
|
+
* objects, in arrays, with falsy values dropped. Nothing is rendered as a style attribute: all of it
|
|
35
|
+
* is merged, in order, into the one class of the element, after its own styles and before
|
|
36
|
+
* `className`. A value that changes often (an animated or measured number) makes a new class for
|
|
37
|
+
* each value, so give such a value to a class as a CSS custom property, or drive it another way. A
|
|
38
|
+
* string is an error.
|
|
39
|
+
*/
|
|
40
|
+
export type StyleProp = SheetEntry$1 | WebStyleObject$1 | false | null | undefined | readonly StyleProp[];
|
|
41
|
+
export type StyledComponent<C extends ElementType, P extends object> = FunctionComponent<Omit<ComponentProps<C>, keyof P | 'as' | 'style'> & P & {
|
|
42
|
+
as?: ElementType;
|
|
43
|
+
style?: StyleProp;
|
|
44
|
+
}> & StyledStatics;
|
|
45
|
+
export type Styled<T> = <C extends ElementType>(tag: C, options?: StyledOptions) => <P extends object = object>(...styles: StyleInput<T, P>[]) => StyledComponent<C, P>;
|
|
46
|
+
/** A set of named styles; `E` is what one of them becomes: a class name on the web, a style object on React Native. */
|
|
47
|
+
export interface SheetDefinition<S extends SheetStyles, E> {
|
|
48
|
+
/** Never set at run time: it only carries the types. */
|
|
49
|
+
readonly entries?: { [K in keyof S]: E; };
|
|
50
|
+
}
|
|
51
|
+
export interface ThemeProviderProps<T> {
|
|
52
|
+
/** The theme, or the part of it that this subtree changes. */
|
|
53
|
+
readonly theme: DeepPartial<T>;
|
|
54
|
+
/** Web only. */
|
|
55
|
+
readonly colorScheme?: ColorScheme;
|
|
56
|
+
/** Web only. */
|
|
57
|
+
readonly className?: string;
|
|
58
|
+
/** Web only. Renders no element and no class: the app puts `themeClass(theme)` on an ancestor, usually `<html>`. The theme still reaches the engine and the context. */
|
|
59
|
+
readonly isRoot?: boolean;
|
|
60
|
+
readonly children?: ReactNode;
|
|
61
|
+
}
|
|
62
|
+
export interface WebThemeProviderProps<T> extends ThemeProviderProps<T> {
|
|
63
|
+
/** The element that carries the theme class. Default 'div'. */
|
|
64
|
+
readonly as?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface Style<T, E> {
|
|
67
|
+
styled: Styled<T>;
|
|
68
|
+
StyleSheet: {
|
|
69
|
+
/** A sheet given as an object is its entries, usable at once, with no hook and no theme. */
|
|
70
|
+
create<K extends string>(styles: ObjectSheet<K>): { readonly [P in K]: E; };
|
|
71
|
+
/** A sheet given as a function of the theme is for `useStyle`, which resolves it against the theme. */
|
|
72
|
+
create<K extends string>(styles: (theme: T) => Record<K, WebStyleObject$1>): SheetDefinition<Record<K, WebStyleObject$1>, E>;
|
|
73
|
+
};
|
|
74
|
+
/** The entries of a sheet; an object sheet is its own entries and is returned as it is. */
|
|
75
|
+
useStyle<K extends string>(sheet: { readonly [P in K]: E; }): { readonly [P in K]: E; };
|
|
76
|
+
useStyle<S extends SheetStyles>(sheet: SheetDefinition<S, E>): { [K in keyof S]: E; };
|
|
77
|
+
ThemeProvider(props: ThemeProviderProps<T>): ReactElement;
|
|
78
|
+
/** The real theme values, for JavaScript that needs a number or a name. */
|
|
79
|
+
useTheme(): T;
|
|
80
|
+
/** The class that declares the variables of `theme`; '' on React Native. */
|
|
81
|
+
themeClass(theme: DeepPartial<T>, colorScheme?: ColorScheme): string;
|
|
82
|
+
/** A style key for "the nearest theme is this theme": `{ [when(dark)]: { border: ... } }`. On the web it needs `@scope`; on React Native it matches the theme object of the nearest provider. */
|
|
83
|
+
when(theme: DeepPartial<T>, colorScheme?: ColorScheme): ThemeKey$1;
|
|
84
|
+
/** A style key for "the nearest color scheme is this one": the nearest provider given that `colorScheme`, else the system preference. */
|
|
85
|
+
whenScheme(scheme: SchemeName$1): SchemeKey$1;
|
|
86
|
+
}
|
|
87
|
+
/** The styling for server components: the root theme of the request is read with readTheme, not with a hook. */
|
|
88
|
+
export interface ServerStyle<T> extends Omit<WebStyle<T>, 'useTheme'> {
|
|
89
|
+
/** The root theme of the request, or the base theme of the engine; throws when there is neither. */
|
|
90
|
+
readTheme(): T;
|
|
91
|
+
}
|
|
92
|
+
export interface WebStyle<T> extends Omit<Style<T, SheetEntry$1>, 'ThemeProvider' | 'apply'> {
|
|
93
|
+
/** The props that apply sheet entries (or class names) to a plain element: a class name. */
|
|
94
|
+
apply(...entries: (SheetEntry$1 | string | null | undefined | false)[]): {
|
|
95
|
+
className?: string;
|
|
96
|
+
};
|
|
97
|
+
ThemeProvider(props: WebThemeProviderProps<T>): ReactElement;
|
|
98
|
+
engine: Engine<T>;
|
|
99
|
+
cache: Cache;
|
|
100
|
+
}
|
|
101
|
+
export type { AlphaColor, NestedKey, SchemeKey, SchemeName, SheetEntry, StyleObject, ThemeKey, WebNested, WebProperties, WebStyleObject };
|
package/package.json
CHANGED
|
@@ -1,6 +1,93 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umber-style/react",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "UmberStyle for React: styled, ThemeProvider, useTheme, StyleSheet, useStyle and apply, with a server build for server components.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"styling",
|
|
7
|
+
"theme",
|
|
8
|
+
"design-tokens",
|
|
9
|
+
"css-variables",
|
|
10
|
+
"react",
|
|
11
|
+
"ssr",
|
|
12
|
+
"server-components",
|
|
13
|
+
"typescript"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Masoud Soroush <masoud@soroush.tech>",
|
|
17
|
+
"homepage": "https://umber-style.soroush.design",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/soroush-tech/umber-style.git",
|
|
21
|
+
"directory": "packages/react"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/soroush-tech/umber-style/issues"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"react-server": {
|
|
34
|
+
"import": {
|
|
35
|
+
"types": "./dist/index.server.d.mts",
|
|
36
|
+
"default": "./dist/index.server.mjs"
|
|
37
|
+
},
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./dist/index.server.d.cts",
|
|
40
|
+
"default": "./dist/index.server.cjs"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/index.d.mts",
|
|
45
|
+
"default": "./dist/index.mjs"
|
|
46
|
+
},
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./dist/index.d.cts",
|
|
49
|
+
"default": "./dist/index.cjs"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@umber-style/core": "0.1.0-alpha.0"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"react": "^19.2.8"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@emotion/is-prop-valid": "^1.4.0",
|
|
64
|
+
"@soroush.tech/styled-system": "^6.0.1",
|
|
65
|
+
"@testing-library/react": "^16.3.3",
|
|
66
|
+
"@types/node": "^26.6.6",
|
|
67
|
+
"@types/react": "^19.3.0",
|
|
68
|
+
"@types/react-dom": "^19.3.0",
|
|
69
|
+
"@vitest/browser-playwright": "^5.1.1",
|
|
70
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
71
|
+
"jsdom": "^31.0.0",
|
|
72
|
+
"oxlint": "^1.93.0",
|
|
73
|
+
"playwright": "1.65.0",
|
|
74
|
+
"react": "^19.3.1",
|
|
75
|
+
"react-dom": "^19.3.1",
|
|
76
|
+
"tsdown": "^0.23.7",
|
|
77
|
+
"typescript": "~7.0.2",
|
|
78
|
+
"vitest": "^5.1.0",
|
|
79
|
+
"@umber-bench/shared": "0.1.0",
|
|
80
|
+
"@umber-style/eslint-config": "0.0.0"
|
|
81
|
+
},
|
|
82
|
+
"scripts": {
|
|
83
|
+
"build": "tsdown",
|
|
84
|
+
"lint": "oxlint --deny-warnings",
|
|
85
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.augmentation.json && tsc --noEmit -p tsconfig.server.json",
|
|
86
|
+
"test": "vitest run",
|
|
87
|
+
"test:coverage": "vitest run --coverage",
|
|
88
|
+
"test:browser": "vitest run --config vitest.browser.config.ts"
|
|
89
|
+
},
|
|
90
|
+
"main": "./dist/index.cjs",
|
|
91
|
+
"module": "./dist/index.mjs",
|
|
92
|
+
"types": "./dist/index.d.mts"
|
|
6
93
|
}
|