@voiceflow/style 1.18.1-d62a34e5bb.326 → 1.18.2-0cab83efde.52
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/build/main.d.mts +251 -0
- package/build/main.d.mts.map +1 -0
- package/build/main.mjs +74 -0
- package/build/main.mjs.map +1 -0
- package/package.json +6 -5
- package/build/ThemeContext.d.ts +0 -8
- package/build/ThemeContext.d.ts.map +0 -1
- package/build/ThemeContext.js +0 -7
- package/build/ThemeContext.js.map +0 -1
- package/build/__fixtures__/Button/Button.component.d.ts +0 -5
- package/build/__fixtures__/Button/Button.component.d.ts.map +0 -1
- package/build/__fixtures__/Button/Button.component.js +0 -4
- package/build/__fixtures__/Button/Button.component.js.map +0 -1
- package/build/__fixtures__/Button/Button.css.d.ts +0 -2
- package/build/__fixtures__/Button/Button.css.d.ts.map +0 -1
- package/build/__fixtures__/Button/Button.css.js +0 -7
- package/build/__fixtures__/Button/Button.css.js.map +0 -1
- package/build/__fixtures__/Button/Button.styled.d.ts +0 -2
- package/build/__fixtures__/Button/Button.styled.d.ts.map +0 -1
- package/build/__fixtures__/Button/Button.styled.js +0 -4
- package/build/__fixtures__/Button/Button.styled.js.map +0 -1
- package/build/__fixtures__/Button/index.d.ts +0 -7
- package/build/__fixtures__/Button/index.d.ts.map +0 -1
- package/build/__fixtures__/Button/index.js +0 -5
- package/build/__fixtures__/Button/index.js.map +0 -1
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.component.d.ts +0 -6
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.component.d.ts.map +0 -1
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.component.js +0 -5
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.component.js.map +0 -1
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.css.d.ts +0 -2
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.css.d.ts.map +0 -1
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.css.js +0 -7
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.css.js.map +0 -1
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.styled.d.ts +0 -11
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.styled.d.ts.map +0 -1
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.styled.js +0 -6
- package/build/__fixtures__/InlineThemedButton/InlineThemedButton.styled.js.map +0 -1
- package/build/__fixtures__/InlineThemedButton/index.d.ts +0 -5
- package/build/__fixtures__/InlineThemedButton/index.d.ts.map +0 -1
- package/build/__fixtures__/InlineThemedButton/index.js +0 -4
- package/build/__fixtures__/InlineThemedButton/index.js.map +0 -1
- package/build/__fixtures__/InlineVarButton/InlineVarButton.component.d.ts +0 -6
- package/build/__fixtures__/InlineVarButton/InlineVarButton.component.d.ts.map +0 -1
- package/build/__fixtures__/InlineVarButton/InlineVarButton.component.js +0 -4
- package/build/__fixtures__/InlineVarButton/InlineVarButton.component.js.map +0 -1
- package/build/__fixtures__/InlineVarButton/InlineVarButton.css.d.ts +0 -3
- package/build/__fixtures__/InlineVarButton/InlineVarButton.css.d.ts.map +0 -1
- package/build/__fixtures__/InlineVarButton/InlineVarButton.css.js +0 -10
- package/build/__fixtures__/InlineVarButton/InlineVarButton.css.js.map +0 -1
- package/build/__fixtures__/InlineVarButton/InlineVarButton.styled.d.ts +0 -4
- package/build/__fixtures__/InlineVarButton/InlineVarButton.styled.d.ts.map +0 -1
- package/build/__fixtures__/InlineVarButton/InlineVarButton.styled.js +0 -9
- package/build/__fixtures__/InlineVarButton/InlineVarButton.styled.js.map +0 -1
- package/build/__fixtures__/InlineVarButton/index.d.ts +0 -5
- package/build/__fixtures__/InlineVarButton/index.d.ts.map +0 -1
- package/build/__fixtures__/InlineVarButton/index.js +0 -4
- package/build/__fixtures__/InlineVarButton/index.js.map +0 -1
- package/build/__fixtures__/RecipeButton/RecipeButton.component.d.ts +0 -7
- package/build/__fixtures__/RecipeButton/RecipeButton.component.d.ts.map +0 -1
- package/build/__fixtures__/RecipeButton/RecipeButton.component.js +0 -4
- package/build/__fixtures__/RecipeButton/RecipeButton.component.js.map +0 -1
- package/build/__fixtures__/RecipeButton/RecipeButton.css.d.ts +0 -22
- package/build/__fixtures__/RecipeButton/RecipeButton.css.d.ts.map +0 -1
- package/build/__fixtures__/RecipeButton/RecipeButton.css.js +0 -21
- package/build/__fixtures__/RecipeButton/RecipeButton.css.js.map +0 -1
- package/build/__fixtures__/RecipeButton/RecipeButton.styled.d.ts +0 -7
- package/build/__fixtures__/RecipeButton/RecipeButton.styled.d.ts.map +0 -1
- package/build/__fixtures__/RecipeButton/RecipeButton.styled.js +0 -5
- package/build/__fixtures__/RecipeButton/RecipeButton.styled.js.map +0 -1
- package/build/__fixtures__/RecipeButton/index.d.ts +0 -5
- package/build/__fixtures__/RecipeButton/index.d.ts.map +0 -1
- package/build/__fixtures__/RecipeButton/index.js +0 -4
- package/build/__fixtures__/RecipeButton/index.js.map +0 -1
- package/build/__fixtures__/ReuseCSS/ReuseCSS.component.d.ts +0 -3
- package/build/__fixtures__/ReuseCSS/ReuseCSS.component.d.ts.map +0 -1
- package/build/__fixtures__/ReuseCSS/ReuseCSS.component.js +0 -4
- package/build/__fixtures__/ReuseCSS/ReuseCSS.component.js.map +0 -1
- package/build/__fixtures__/ReuseCSS/ReuseCSS.css.d.ts +0 -2
- package/build/__fixtures__/ReuseCSS/ReuseCSS.css.d.ts.map +0 -1
- package/build/__fixtures__/ReuseCSS/ReuseCSS.css.js +0 -10
- package/build/__fixtures__/ReuseCSS/ReuseCSS.css.js.map +0 -1
- package/build/__fixtures__/ReuseCSS/index.d.ts +0 -5
- package/build/__fixtures__/ReuseCSS/index.d.ts.map +0 -1
- package/build/__fixtures__/ReuseCSS/index.js +0 -4
- package/build/__fixtures__/ReuseCSS/index.js.map +0 -1
- package/build/__fixtures__/ReuseStyled/ReuseStyled.component.d.ts +0 -3
- package/build/__fixtures__/ReuseStyled/ReuseStyled.component.d.ts.map +0 -1
- package/build/__fixtures__/ReuseStyled/ReuseStyled.component.js +0 -4
- package/build/__fixtures__/ReuseStyled/ReuseStyled.component.js.map +0 -1
- package/build/__fixtures__/ReuseStyled/ReuseStyled.css.d.ts +0 -2
- package/build/__fixtures__/ReuseStyled/ReuseStyled.css.d.ts.map +0 -1
- package/build/__fixtures__/ReuseStyled/ReuseStyled.css.js +0 -6
- package/build/__fixtures__/ReuseStyled/ReuseStyled.css.js.map +0 -1
- package/build/__fixtures__/ReuseStyled/ReuseStyled.styled.d.ts +0 -2
- package/build/__fixtures__/ReuseStyled/ReuseStyled.styled.d.ts.map +0 -1
- package/build/__fixtures__/ReuseStyled/ReuseStyled.styled.js +0 -5
- package/build/__fixtures__/ReuseStyled/ReuseStyled.styled.js.map +0 -1
- package/build/__fixtures__/ReuseStyled/index.d.ts +0 -5
- package/build/__fixtures__/ReuseStyled/index.d.ts.map +0 -1
- package/build/__fixtures__/ReuseStyled/index.js +0 -4
- package/build/__fixtures__/ReuseStyled/index.js.map +0 -1
- package/build/__fixtures__/ThemedButton/ThemedButton.component.d.ts +0 -3
- package/build/__fixtures__/ThemedButton/ThemedButton.component.d.ts.map +0 -1
- package/build/__fixtures__/ThemedButton/ThemedButton.component.js +0 -4
- package/build/__fixtures__/ThemedButton/ThemedButton.component.js.map +0 -1
- package/build/__fixtures__/ThemedButton/ThemedButton.css.d.ts +0 -2
- package/build/__fixtures__/ThemedButton/ThemedButton.css.d.ts.map +0 -1
- package/build/__fixtures__/ThemedButton/ThemedButton.css.js +0 -7
- package/build/__fixtures__/ThemedButton/ThemedButton.css.js.map +0 -1
- package/build/__fixtures__/ThemedButton/ThemedButton.styled.d.ts +0 -2
- package/build/__fixtures__/ThemedButton/ThemedButton.styled.d.ts.map +0 -1
- package/build/__fixtures__/ThemedButton/ThemedButton.styled.js +0 -5
- package/build/__fixtures__/ThemedButton/ThemedButton.styled.js.map +0 -1
- package/build/__fixtures__/ThemedButton/index.d.ts +0 -5
- package/build/__fixtures__/ThemedButton/index.d.ts.map +0 -1
- package/build/__fixtures__/ThemedButton/index.js +0 -4
- package/build/__fixtures__/ThemedButton/index.js.map +0 -1
- package/build/__fixtures__/VariantButton/VariantButton.component.d.ts +0 -7
- package/build/__fixtures__/VariantButton/VariantButton.component.d.ts.map +0 -1
- package/build/__fixtures__/VariantButton/VariantButton.component.js +0 -4
- package/build/__fixtures__/VariantButton/VariantButton.component.js.map +0 -1
- package/build/__fixtures__/VariantButton/VariantButton.css.d.ts +0 -2
- package/build/__fixtures__/VariantButton/VariantButton.css.d.ts.map +0 -1
- package/build/__fixtures__/VariantButton/VariantButton.css.js +0 -6
- package/build/__fixtures__/VariantButton/VariantButton.css.js.map +0 -1
- package/build/__fixtures__/VariantButton/VariantButton.styled.d.ts +0 -4
- package/build/__fixtures__/VariantButton/VariantButton.styled.d.ts.map +0 -1
- package/build/__fixtures__/VariantButton/VariantButton.styled.js +0 -5
- package/build/__fixtures__/VariantButton/VariantButton.styled.js.map +0 -1
- package/build/__fixtures__/VariantButton/index.d.ts +0 -5
- package/build/__fixtures__/VariantButton/index.d.ts.map +0 -1
- package/build/__fixtures__/VariantButton/index.js +0 -4
- package/build/__fixtures__/VariantButton/index.js.map +0 -1
- package/build/__fixtures__/index.d.ts +0 -10
- package/build/__fixtures__/index.d.ts.map +0 -1
- package/build/__fixtures__/index.js +0 -10
- package/build/__fixtures__/index.js.map +0 -1
- package/build/__fixtures__/theme.css.d.ts +0 -17
- package/build/__fixtures__/theme.css.d.ts.map +0 -1
- package/build/__fixtures__/theme.css.js +0 -19
- package/build/__fixtures__/theme.css.js.map +0 -1
- package/build/main.d.ts +0 -10
- package/build/main.d.ts.map +0 -1
- package/build/main.js +0 -9
- package/build/main.js.map +0 -1
- package/build/styled/constants.d.ts +0 -2
- package/build/styled/constants.d.ts.map +0 -1
- package/build/styled/constants.js +0 -2
- package/build/styled/constants.js.map +0 -1
- package/build/styled/factory.d.ts +0 -182
- package/build/styled/factory.d.ts.map +0 -1
- package/build/styled/factory.js +0 -23
- package/build/styled/factory.js.map +0 -1
- package/build/styled/index.d.ts +0 -5
- package/build/styled/index.d.ts.map +0 -1
- package/build/styled/index.js +0 -5
- package/build/styled/index.js.map +0 -1
- package/build/styled/types.d.ts +0 -46
- package/build/styled/types.d.ts.map +0 -1
- package/build/styled/types.js +0 -2
- package/build/styled/types.js.map +0 -1
- package/build/styled/utils.d.ts +0 -9
- package/build/styled/utils.d.ts.map +0 -1
- package/build/styled/utils.js +0 -31
- package/build/styled/utils.js.map +0 -1
- package/build/testing.d.ts +0 -6
- package/build/testing.d.ts.map +0 -1
- package/build/testing.js +0 -14
- package/build/testing.js.map +0 -1
- package/build/types.d.ts +0 -6
- package/build/types.d.ts.map +0 -1
- package/build/types.js +0 -2
- package/build/types.js.map +0 -1
package/build/main.d.mts
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
3
|
+
import { ComplexStyleRule } from "@vanilla-extract/css";
|
|
4
|
+
import { RecipeVariants, RuntimeFn, RuntimeFn as RuntimeFn$1, recipe } from "@vanilla-extract/recipes";
|
|
5
|
+
import { Simplify } from "type-fest";
|
|
6
|
+
export * from "@vanilla-extract/dynamic";
|
|
7
|
+
export * from "@vanilla-extract/css";
|
|
8
|
+
export declare const STYLED_CLASS: unique symbol;
|
|
9
|
+
export type ThemeContract = Parameters<typeof assignInlineVars>[0];
|
|
10
|
+
export interface DynamicOptions<Theme extends ThemeContract | null = ThemeContract, Variables extends Record<string, string> | null = Record<string, string>> {
|
|
11
|
+
/**
|
|
12
|
+
* the contract for a theme that can be overridden via a `theme` prop
|
|
13
|
+
*/
|
|
14
|
+
theme?: Theme;
|
|
15
|
+
/**
|
|
16
|
+
* variables that can be overridden via a `vars` prop
|
|
17
|
+
*/
|
|
18
|
+
vars?: Variables;
|
|
19
|
+
}
|
|
20
|
+
export type DynamicThemeProps<Theme> = Theme extends ThemeContract ? {
|
|
21
|
+
/**
|
|
22
|
+
* inline override for the theme used to style this component
|
|
23
|
+
*/
|
|
24
|
+
theme?: Parameters<typeof assignInlineVars<Theme>>[1];
|
|
25
|
+
} : object;
|
|
26
|
+
export type DynamicVariablesProps<Variables> = Variables extends Record<string, string> ? {
|
|
27
|
+
/**
|
|
28
|
+
* inline override for variables used to styled this component
|
|
29
|
+
*/
|
|
30
|
+
vars?: Partial<{ [K in keyof Variables]: string; }>;
|
|
31
|
+
} : object;
|
|
32
|
+
export type StyledComponentProps<Tag extends keyof JSX.IntrinsicElements, Theme, Variables, Extras extends object = object> = React.ComponentPropsWithoutRef<Tag> & DynamicThemeProps<Theme> & DynamicVariablesProps<Variables> & Extras;
|
|
33
|
+
export interface StyledComponent<Props = object> extends React.FunctionComponent<Props> {
|
|
34
|
+
(props: Props, context?: any): React.ReactElement<any, any> | null;
|
|
35
|
+
[STYLED_CLASS]: string | null;
|
|
36
|
+
}
|
|
37
|
+
export type StyleSource = StyledComponent | string;
|
|
38
|
+
export interface StyledFactory<Tag extends keyof JSX.IntrinsicElements> {
|
|
39
|
+
<Recipe extends RuntimeFn$1<Record<string, any>>, Theme extends ThemeContract | null = null, Variables extends Record<string, string> | null = null>(recipe: Recipe, sources?: StyleSource[], dynamic?: DynamicOptions<Theme, Variables>): StyledComponent<StyledComponentProps<Tag, Theme, Variables, {
|
|
40
|
+
variants: RecipeVariants<Recipe>;
|
|
41
|
+
}>>;
|
|
42
|
+
<Variant extends string, Theme extends ThemeContract | null = null, Variables extends Record<string, string> | null = null>(variants: Record<Variant, string>, sources?: StyleSource[], dynamic?: DynamicOptions<Theme, Variables>): StyledComponent<StyledComponentProps<Tag, Theme, Variables, {
|
|
43
|
+
variant: Variant;
|
|
44
|
+
}>>;
|
|
45
|
+
<Theme extends ThemeContract | null = null, Variables extends Record<string, string> | null = null>(sources: StyleSource[], dynamic?: DynamicOptions<Theme, Variables>): StyledComponent<StyledComponentProps<Tag, Theme, Variables>>;
|
|
46
|
+
}
|
|
47
|
+
export type FirstStyledArgument<Variants extends Record<string, any> = any> = RuntimeFn$1<Variants> | Record<string, string> | StyleSource[];
|
|
48
|
+
export type SecondStyledArgument = StyleSource[] | DynamicOptions;
|
|
49
|
+
export declare const styled: {
|
|
50
|
+
a: StyledFactory<"a">;
|
|
51
|
+
abbr: StyledFactory<"abbr">;
|
|
52
|
+
address: StyledFactory<"address">;
|
|
53
|
+
area: StyledFactory<"area">;
|
|
54
|
+
article: StyledFactory<"article">;
|
|
55
|
+
aside: StyledFactory<"aside">;
|
|
56
|
+
audio: StyledFactory<"audio">;
|
|
57
|
+
b: StyledFactory<"b">;
|
|
58
|
+
base: StyledFactory<"base">;
|
|
59
|
+
bdi: StyledFactory<"bdi">;
|
|
60
|
+
bdo: StyledFactory<"bdo">;
|
|
61
|
+
big: StyledFactory<"big">;
|
|
62
|
+
blockquote: StyledFactory<"blockquote">;
|
|
63
|
+
body: StyledFactory<"body">;
|
|
64
|
+
br: StyledFactory<"br">;
|
|
65
|
+
button: StyledFactory<"button">;
|
|
66
|
+
canvas: StyledFactory<"canvas">;
|
|
67
|
+
caption: StyledFactory<"caption">;
|
|
68
|
+
center: StyledFactory<"center">;
|
|
69
|
+
cite: StyledFactory<"cite">;
|
|
70
|
+
code: StyledFactory<"code">;
|
|
71
|
+
col: StyledFactory<"col">;
|
|
72
|
+
colgroup: StyledFactory<"colgroup">;
|
|
73
|
+
data: StyledFactory<"data">;
|
|
74
|
+
datalist: StyledFactory<"datalist">;
|
|
75
|
+
dd: StyledFactory<"dd">;
|
|
76
|
+
del: StyledFactory<"del">;
|
|
77
|
+
details: StyledFactory<"details">;
|
|
78
|
+
dfn: StyledFactory<"dfn">;
|
|
79
|
+
dialog: StyledFactory<"dialog">;
|
|
80
|
+
div: StyledFactory<"div">;
|
|
81
|
+
dl: StyledFactory<"dl">;
|
|
82
|
+
dt: StyledFactory<"dt">;
|
|
83
|
+
em: StyledFactory<"em">;
|
|
84
|
+
embed: StyledFactory<"embed">;
|
|
85
|
+
fieldset: StyledFactory<"fieldset">;
|
|
86
|
+
figcaption: StyledFactory<"figcaption">;
|
|
87
|
+
figure: StyledFactory<"figure">;
|
|
88
|
+
footer: StyledFactory<"footer">;
|
|
89
|
+
form: StyledFactory<"form">;
|
|
90
|
+
h1: StyledFactory<"h1">;
|
|
91
|
+
h2: StyledFactory<"h2">;
|
|
92
|
+
h3: StyledFactory<"h3">;
|
|
93
|
+
h4: StyledFactory<"h4">;
|
|
94
|
+
h5: StyledFactory<"h5">;
|
|
95
|
+
h6: StyledFactory<"h6">;
|
|
96
|
+
head: StyledFactory<"head">;
|
|
97
|
+
header: StyledFactory<"header">;
|
|
98
|
+
hgroup: StyledFactory<"hgroup">;
|
|
99
|
+
hr: StyledFactory<"hr">;
|
|
100
|
+
html: StyledFactory<"html">;
|
|
101
|
+
i: StyledFactory<"i">;
|
|
102
|
+
iframe: StyledFactory<"iframe">;
|
|
103
|
+
img: StyledFactory<"img">;
|
|
104
|
+
input: StyledFactory<"input">;
|
|
105
|
+
ins: StyledFactory<"ins">;
|
|
106
|
+
kbd: StyledFactory<"kbd">;
|
|
107
|
+
keygen: StyledFactory<"keygen">;
|
|
108
|
+
label: StyledFactory<"label">;
|
|
109
|
+
legend: StyledFactory<"legend">;
|
|
110
|
+
li: StyledFactory<"li">;
|
|
111
|
+
link: StyledFactory<"link">;
|
|
112
|
+
main: StyledFactory<"main">;
|
|
113
|
+
map: StyledFactory<"map">;
|
|
114
|
+
mark: StyledFactory<"mark">;
|
|
115
|
+
menu: StyledFactory<"menu">;
|
|
116
|
+
menuitem: StyledFactory<"menuitem">;
|
|
117
|
+
meta: StyledFactory<"meta">;
|
|
118
|
+
meter: StyledFactory<"meter">;
|
|
119
|
+
nav: StyledFactory<"nav">;
|
|
120
|
+
noindex: StyledFactory<"noindex">;
|
|
121
|
+
noscript: StyledFactory<"noscript">;
|
|
122
|
+
object: StyledFactory<"object">;
|
|
123
|
+
ol: StyledFactory<"ol">;
|
|
124
|
+
optgroup: StyledFactory<"optgroup">;
|
|
125
|
+
option: StyledFactory<"option">;
|
|
126
|
+
output: StyledFactory<"output">;
|
|
127
|
+
p: StyledFactory<"p">;
|
|
128
|
+
param: StyledFactory<"param">;
|
|
129
|
+
picture: StyledFactory<"picture">;
|
|
130
|
+
pre: StyledFactory<"pre">;
|
|
131
|
+
progress: StyledFactory<"progress">;
|
|
132
|
+
q: StyledFactory<"q">;
|
|
133
|
+
rp: StyledFactory<"rp">;
|
|
134
|
+
rt: StyledFactory<"rt">;
|
|
135
|
+
ruby: StyledFactory<"ruby">;
|
|
136
|
+
s: StyledFactory<"s">;
|
|
137
|
+
samp: StyledFactory<"samp">;
|
|
138
|
+
search: StyledFactory<"search">;
|
|
139
|
+
slot: StyledFactory<"slot">;
|
|
140
|
+
script: StyledFactory<"script">;
|
|
141
|
+
section: StyledFactory<"section">;
|
|
142
|
+
select: StyledFactory<"select">;
|
|
143
|
+
small: StyledFactory<"small">;
|
|
144
|
+
source: StyledFactory<"source">;
|
|
145
|
+
span: StyledFactory<"span">;
|
|
146
|
+
strong: StyledFactory<"strong">;
|
|
147
|
+
style: StyledFactory<"style">;
|
|
148
|
+
sub: StyledFactory<"sub">;
|
|
149
|
+
summary: StyledFactory<"summary">;
|
|
150
|
+
sup: StyledFactory<"sup">;
|
|
151
|
+
table: StyledFactory<"table">;
|
|
152
|
+
template: StyledFactory<"template">;
|
|
153
|
+
tbody: StyledFactory<"tbody">;
|
|
154
|
+
td: StyledFactory<"td">;
|
|
155
|
+
textarea: StyledFactory<"textarea">;
|
|
156
|
+
tfoot: StyledFactory<"tfoot">;
|
|
157
|
+
th: StyledFactory<"th">;
|
|
158
|
+
thead: StyledFactory<"thead">;
|
|
159
|
+
time: StyledFactory<"time">;
|
|
160
|
+
title: StyledFactory<"title">;
|
|
161
|
+
tr: StyledFactory<"tr">;
|
|
162
|
+
track: StyledFactory<"track">;
|
|
163
|
+
u: StyledFactory<"u">;
|
|
164
|
+
ul: StyledFactory<"ul">;
|
|
165
|
+
var: StyledFactory<"var">;
|
|
166
|
+
video: StyledFactory<"video">;
|
|
167
|
+
wbr: StyledFactory<"wbr">;
|
|
168
|
+
webview: StyledFactory<"webview">;
|
|
169
|
+
svg: StyledFactory<"svg">;
|
|
170
|
+
animate: StyledFactory<"animate">;
|
|
171
|
+
animateMotion: StyledFactory<"animateMotion">;
|
|
172
|
+
animateTransform: StyledFactory<"animateTransform">;
|
|
173
|
+
circle: StyledFactory<"circle">;
|
|
174
|
+
clipPath: StyledFactory<"clipPath">;
|
|
175
|
+
defs: StyledFactory<"defs">;
|
|
176
|
+
desc: StyledFactory<"desc">;
|
|
177
|
+
ellipse: StyledFactory<"ellipse">;
|
|
178
|
+
feBlend: StyledFactory<"feBlend">;
|
|
179
|
+
feColorMatrix: StyledFactory<"feColorMatrix">;
|
|
180
|
+
feComponentTransfer: StyledFactory<"feComponentTransfer">;
|
|
181
|
+
feComposite: StyledFactory<"feComposite">;
|
|
182
|
+
feConvolveMatrix: StyledFactory<"feConvolveMatrix">;
|
|
183
|
+
feDiffuseLighting: StyledFactory<"feDiffuseLighting">;
|
|
184
|
+
feDisplacementMap: StyledFactory<"feDisplacementMap">;
|
|
185
|
+
feDistantLight: StyledFactory<"feDistantLight">;
|
|
186
|
+
feDropShadow: StyledFactory<"feDropShadow">;
|
|
187
|
+
feFlood: StyledFactory<"feFlood">;
|
|
188
|
+
feFuncA: StyledFactory<"feFuncA">;
|
|
189
|
+
feFuncB: StyledFactory<"feFuncB">;
|
|
190
|
+
feFuncG: StyledFactory<"feFuncG">;
|
|
191
|
+
feFuncR: StyledFactory<"feFuncR">;
|
|
192
|
+
feGaussianBlur: StyledFactory<"feGaussianBlur">;
|
|
193
|
+
feImage: StyledFactory<"feImage">;
|
|
194
|
+
feMerge: StyledFactory<"feMerge">;
|
|
195
|
+
feMergeNode: StyledFactory<"feMergeNode">;
|
|
196
|
+
feMorphology: StyledFactory<"feMorphology">;
|
|
197
|
+
feOffset: StyledFactory<"feOffset">;
|
|
198
|
+
fePointLight: StyledFactory<"fePointLight">;
|
|
199
|
+
feSpecularLighting: StyledFactory<"feSpecularLighting">;
|
|
200
|
+
feSpotLight: StyledFactory<"feSpotLight">;
|
|
201
|
+
feTile: StyledFactory<"feTile">;
|
|
202
|
+
feTurbulence: StyledFactory<"feTurbulence">;
|
|
203
|
+
filter: StyledFactory<"filter">;
|
|
204
|
+
foreignObject: StyledFactory<"foreignObject">;
|
|
205
|
+
g: StyledFactory<"g">;
|
|
206
|
+
image: StyledFactory<"image">;
|
|
207
|
+
line: StyledFactory<"line">;
|
|
208
|
+
linearGradient: StyledFactory<"linearGradient">;
|
|
209
|
+
marker: StyledFactory<"marker">;
|
|
210
|
+
mask: StyledFactory<"mask">;
|
|
211
|
+
metadata: StyledFactory<"metadata">;
|
|
212
|
+
mpath: StyledFactory<"mpath">;
|
|
213
|
+
path: StyledFactory<"path">;
|
|
214
|
+
pattern: StyledFactory<"pattern">;
|
|
215
|
+
polygon: StyledFactory<"polygon">;
|
|
216
|
+
polyline: StyledFactory<"polyline">;
|
|
217
|
+
radialGradient: StyledFactory<"radialGradient">;
|
|
218
|
+
rect: StyledFactory<"rect">;
|
|
219
|
+
set: StyledFactory<"set">;
|
|
220
|
+
stop: StyledFactory<"stop">;
|
|
221
|
+
switch: StyledFactory<"switch">;
|
|
222
|
+
symbol: StyledFactory<"symbol">;
|
|
223
|
+
text: StyledFactory<"text">;
|
|
224
|
+
textPath: StyledFactory<"textPath">;
|
|
225
|
+
tspan: StyledFactory<"tspan">;
|
|
226
|
+
use: StyledFactory<"use">;
|
|
227
|
+
view: StyledFactory<"view">;
|
|
228
|
+
};
|
|
229
|
+
export declare const getStaticClass: (firstArg: FirstStyledArgument, secondArg?: SecondStyledArgument) => string | null;
|
|
230
|
+
export declare const getDynamicOptions: (secondArg?: SecondStyledArgument, thirdArg?: DynamicOptions) => DynamicOptions | null;
|
|
231
|
+
export declare const useDynamicClass: (firstArg: FirstStyledArgument<any>, props: {
|
|
232
|
+
variant?: string;
|
|
233
|
+
variants?: Record<string, any>;
|
|
234
|
+
}) => string | null | undefined;
|
|
235
|
+
export declare const useInlineStyle: (props: StyledComponentProps<keyof JSX.IntrinsicElements, ThemeContract, Record<string, string>>, dynamicOptions: DynamicOptions | null) => {};
|
|
236
|
+
/**
|
|
237
|
+
* the pattern for data-testid attributes is based off of BEM naming
|
|
238
|
+
* https://getbem.com/naming/
|
|
239
|
+
*/
|
|
240
|
+
export declare const tid: (block: string | undefined, elements: string | [string, string, ...string[]], modifier?: string) => string | undefined;
|
|
241
|
+
export declare const ThemeContext: import("react").Context<string | null>;
|
|
242
|
+
export declare const ThemeConsumer: import("react").Consumer<string | null>;
|
|
243
|
+
export interface ThemeProviderProps extends React.PropsWithChildren {
|
|
244
|
+
theme: string;
|
|
245
|
+
}
|
|
246
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
247
|
+
export declare const useTheme: () => string | null;
|
|
248
|
+
export type VariantStyleRules = Record<string, Record<string, ComplexStyleRule | string>>;
|
|
249
|
+
export type VariantProps<RecipeFn extends RuntimeFn$1<VariantStyleRules>> = Exclude<Simplify<RecipeVariants<RecipeFn>>, undefined | null>;
|
|
250
|
+
export { type RuntimeFn, clsx, recipe };
|
|
251
|
+
//# sourceMappingURL=main.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.mts","names":["RuntimeFn","RuntimeFn"],"sources":["../src/styled/constants.ts","../src/styled/types.ts","../src/styled/factory.tsx","../src/styled/utils.ts","../src/testing.ts","../src/ThemeContext.tsx","../src/types.ts"],"mappings":";;;;;;;qBAAa;YCKD,gBAAgB,kBAAkB;iBAE7B,eACf,cAAc,uBAAuB,eACrC,kBAAkB,gCAAgC;;;;EAKlD,QAAQ;;;;EAIR,OAAO;;YAGG,kBAAkB,SAAS,cAAc;;;;EAK/C,QAAQ,kBAAkB,iBAAiB;;YAIrC,sBAAsB,aAChC,kBAAkB;;;;EAKZ,OAAO,WAAW,WAAW;;YAIzB,qBACV,kBAAkB,IAAI,mBACtB,OACA,WACA,kCACE,MAAM,yBAAyB,OAAO,kBAAkB,SAAS,sBAAsB,aAAa;iBAEvF,gBAAgB,wBAAwB,MAAM,kBAAkB;GAC9E,OAAO,OAAO,gBAAgB,MAAM;GACpC;;YAGS,cAAc;iBAET,cAAc,kBAAkB,IAAI;GAEjD,eAAeA,YAAU,sBACzB,cAAc,6BACd,kBAAkB,sCAElB,QAAQ,QACR,UAAU,eACV,UAAU,eAAe,OAAO,aAC/B,gBAAgB,qBAAqB,KAAK,OAAO;IAAa,UAAU,eAAe;;GAGxF,wBACA,cAAc,6BACd,kBAAkB,sCAElB,UAAU,OAAO,kBACjB,UAAU,eACV,UAAU,eAAe,OAAO,aAC/B,gBAAgB,qBAAqB,KAAK,OAAO;IAAa,SAAS;;GAEzE,cAAc,6BAA6B,kBAAkB,sCAC5D,SAAS,eACT,UAAU,eAAe,OAAO,aAC/B,gBAAgB,qBAAqB,KAAK,OAAO;;YAG1C,oBAAoB,iBAAiB,6BAC7CA,YAAU,YACV,yBACA;YAEQ,uBAAuB,gBAAgB;qBCvEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBCFA,iBAAkB,UAAU,qBAAqB,YAAY;qBAS7D,oBAAqB,YAAY,sBAAsB,WAAW,mBAAiB;qBAGnF,kBACX,UAAU,0BACV;EAAS;EAAkB,WAAW;;qBAS3B,iBACX,OAAO,2BAA2B,IAAI,mBAAmB,eAAe,yBACxE,gBAAgB;;;;;qBCjCL,MAAO,2BAA2B,kDAAkD;qBCHpF,8BAAY;qBACA,+BAAa;iBAErB,2BAA2B,MAAM;EAChD;;qBAGW,eAAe,MAAM,GAAG;qBAIxB;YCTD,oBAAoB,eAAe,eAAe;YAElD,aAAa,iBAAiBC,YAAU,sBAAsB,QACxE,SAAS,eAAe"}
|
package/build/main.mjs
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { clsx, clsx as clsx$1 } from "clsx";
|
|
2
|
+
import { createContext, createElement, useContext, useMemo } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
5
|
+
import { recipe } from "@vanilla-extract/recipes";
|
|
6
|
+
export * from "@vanilla-extract/dynamic";
|
|
7
|
+
export * from "@vanilla-extract/css";
|
|
8
|
+
// src/styled/constants.ts
|
|
9
|
+
const STYLED_CLASS = Symbol("styled_class");
|
|
10
|
+
// src/ThemeContext.tsx
|
|
11
|
+
const ThemeContext = createContext(null);
|
|
12
|
+
const { Consumer: ThemeConsumer } = ThemeContext;
|
|
13
|
+
const ThemeProvider = ({ theme, children }) => /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
14
|
+
value: theme,
|
|
15
|
+
children
|
|
16
|
+
});
|
|
17
|
+
const useTheme = () => useContext(ThemeContext);
|
|
18
|
+
// src/styled/utils.ts
|
|
19
|
+
const getStaticClass = (firstArg, secondArg) => {
|
|
20
|
+
const classNames = (Array.isArray(firstArg) ? firstArg : Array.isArray(secondArg) ? secondArg : []).map((source) => typeof source === "string" ? source : source[STYLED_CLASS]);
|
|
21
|
+
return classNames.length ? clsx$1(classNames) : null;
|
|
22
|
+
};
|
|
23
|
+
const getDynamicOptions = (secondArg, thirdArg) => (Array.isArray(secondArg) ? thirdArg : secondArg) ?? null;
|
|
24
|
+
const useDynamicClass = (firstArg, props) => useMemo(() => {
|
|
25
|
+
if (typeof firstArg === "function") return firstArg(props.variants);
|
|
26
|
+
if (Array.isArray(firstArg) || !props.variant) return null;
|
|
27
|
+
return firstArg[props.variant];
|
|
28
|
+
}, [
|
|
29
|
+
firstArg,
|
|
30
|
+
props.variants,
|
|
31
|
+
props.variant
|
|
32
|
+
]);
|
|
33
|
+
const useInlineStyle = (props, dynamicOptions) => {
|
|
34
|
+
const { theme, vars } = dynamicOptions ?? {};
|
|
35
|
+
return useMemo(() => {
|
|
36
|
+
const style = {};
|
|
37
|
+
if (theme && props.theme) Object.assign(style, assignInlineVars(theme, props.theme));
|
|
38
|
+
if (vars && props.vars) Object.assign(style, assignInlineVars(props.vars));
|
|
39
|
+
return style;
|
|
40
|
+
}, [props.theme, props.vars]);
|
|
41
|
+
};
|
|
42
|
+
// src/styled/factory.tsx
|
|
43
|
+
const styled = new Proxy({}, { get: (_target, tag) => (firstArg, secondArg, thirdArg) => {
|
|
44
|
+
const staticClass = getStaticClass(firstArg, secondArg);
|
|
45
|
+
const dynamicOptions = getDynamicOptions(secondArg, thirdArg);
|
|
46
|
+
const StyledComponent = (props) => {
|
|
47
|
+
const themeClass = useTheme();
|
|
48
|
+
const dynamicClass = useDynamicClass(firstArg, props);
|
|
49
|
+
const inlineStyle = useInlineStyle(props, dynamicOptions);
|
|
50
|
+
return createElement(tag, {
|
|
51
|
+
...props,
|
|
52
|
+
className: clsx$1(themeClass, staticClass, dynamicClass, props.className),
|
|
53
|
+
style: {
|
|
54
|
+
...inlineStyle,
|
|
55
|
+
...props.style
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
return Object.assign(StyledComponent, { [STYLED_CLASS]: staticClass });
|
|
60
|
+
} });
|
|
61
|
+
// src/testing.ts
|
|
62
|
+
/**
|
|
63
|
+
* the pattern for data-testid attributes is based off of BEM naming
|
|
64
|
+
* https://getbem.com/naming/
|
|
65
|
+
*/
|
|
66
|
+
const tid = (block, elements, modifier) => {
|
|
67
|
+
if (!block) return void 0;
|
|
68
|
+
const blockElement = [block, ...typeof elements === "string" ? [elements] : elements].join("__");
|
|
69
|
+
if (!modifier) return blockElement;
|
|
70
|
+
return `${blockElement}--${modifier}`;
|
|
71
|
+
};
|
|
72
|
+
export { STYLED_CLASS, ThemeConsumer, ThemeContext, ThemeProvider, clsx, getDynamicOptions, getStaticClass, recipe, styled, tid, useDynamicClass, useInlineStyle, useTheme };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=main.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.mjs","names":["clsx","clsx"],"sources":["../src/styled/constants.ts","../src/ThemeContext.tsx","../src/styled/utils.ts","../src/styled/factory.tsx","../src/testing.ts"],"sourcesContent":["export const STYLED_CLASS = Symbol('styled_class');\n","import { createContext, useContext } from 'react';\n\nexport const ThemeContext = createContext<string | null>(null);\nexport const { Consumer: ThemeConsumer } = ThemeContext;\n\nexport interface ThemeProviderProps extends React.PropsWithChildren {\n theme: string;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ theme, children }) => (\n <ThemeContext.Provider value={theme}>{children}</ThemeContext.Provider>\n);\n\nexport const useTheme = () => useContext(ThemeContext);\n","import { assignInlineVars } from '@vanilla-extract/dynamic';\nimport { clsx } from 'clsx';\nimport { useMemo } from 'react';\n\nimport { STYLED_CLASS } from './constants';\nimport type {\n DynamicOptions,\n FirstStyledArgument,\n SecondStyledArgument,\n StyledComponentProps,\n ThemeContract,\n} from './types';\n\nexport const getStaticClass = (firstArg: FirstStyledArgument, secondArg?: SecondStyledArgument): string | null => {\n // oxlint-disable-next-line no-nested-ternary\n const classNames = (Array.isArray(firstArg) ? firstArg : Array.isArray(secondArg) ? secondArg : []).map((source) =>\n typeof source === 'string' ? source : source[STYLED_CLASS]\n );\n\n return classNames.length ? clsx(classNames) : null;\n};\n\nexport const getDynamicOptions = (secondArg?: SecondStyledArgument, thirdArg?: DynamicOptions): DynamicOptions | null =>\n (Array.isArray(secondArg) ? thirdArg : secondArg) ?? null;\n\nexport const useDynamicClass = (\n firstArg: FirstStyledArgument<any>,\n props: { variant?: string; variants?: Record<string, any> }\n) =>\n useMemo(() => {\n if (typeof firstArg === 'function') return firstArg(props.variants);\n if (Array.isArray(firstArg) || !props.variant) return null;\n\n return firstArg[props.variant];\n }, [firstArg, props.variants, props.variant]);\n\nexport const useInlineStyle = (\n props: StyledComponentProps<keyof JSX.IntrinsicElements, ThemeContract, Record<string, string>>,\n dynamicOptions: DynamicOptions | null\n) => {\n const { theme, vars } = dynamicOptions ?? {};\n\n return useMemo(() => {\n const style = {};\n\n if (theme && props.theme) {\n Object.assign(style, assignInlineVars(theme, props.theme));\n }\n\n if (vars && props.vars) {\n Object.assign(style, assignInlineVars(props.vars as Record<string, string>));\n }\n\n return style;\n }, [props.theme, props.vars]);\n};\n","import { clsx } from 'clsx';\nimport { createElement } from 'react';\n\nimport { useTheme } from '../ThemeContext';\nimport { STYLED_CLASS } from './constants';\nimport type {\n DynamicOptions,\n FirstStyledArgument,\n SecondStyledArgument,\n StyledComponent,\n StyledComponentProps,\n StyledFactory,\n} from './types';\nimport { getDynamicOptions, getStaticClass, useDynamicClass, useInlineStyle } from './utils';\n\nexport const styled = new Proxy<{\n [Tag in keyof JSX.IntrinsicElements]: StyledFactory<Tag>;\n}>({} as any, {\n get:\n <Tag extends keyof JSX.IntrinsicElements>(_target: unknown, tag: Tag): StyledFactory<Tag> =>\n (firstArg: FirstStyledArgument, secondArg?: SecondStyledArgument, thirdArg?: DynamicOptions) => {\n const staticClass = getStaticClass(firstArg, secondArg);\n const dynamicOptions = getDynamicOptions(secondArg, thirdArg);\n\n const StyledComponent = (props: StyledComponentProps<Tag, any, any, { variant?: any; variants?: any }>) => {\n const themeClass = useTheme();\n const dynamicClass = useDynamicClass(firstArg, props);\n const inlineStyle = useInlineStyle(props, dynamicOptions);\n\n return createElement(tag, {\n ...(props as React.ComponentPropsWithoutRef<Tag>),\n className: clsx(themeClass, staticClass, dynamicClass, props.className),\n style: { ...inlineStyle, ...props.style },\n });\n };\n\n return Object.assign(StyledComponent, { [STYLED_CLASS]: staticClass }) as StyledComponent<any>;\n },\n});\n","/**\n * the pattern for data-testid attributes is based off of BEM naming\n * https://getbem.com/naming/\n */\n\nexport const tid = (block: string | undefined, elements: string | [string, string, ...string[]], modifier?: string) => {\n if (!block) return undefined;\n\n const elementList = typeof elements === 'string' ? [elements] : elements;\n const blockElement = [block, ...elementList].join('__');\n\n if (!modifier) return blockElement;\n\n return `${blockElement}--${modifier}`;\n};\n"],"mappings":";;;;;;;;AAAA,MAAa,eAAe,OAAO,cAAc;;ACEjD,MAAa,eAAe,cAA6B,IAAI;AAC7D,MAAa,EAAE,UAAU,kBAAkB;AAM3C,MAAa,iBAA+C,EAAE,OAAO,eACnE,oBAAC,aAAa,UAAd;CAAuB,OAAO;CAAQ;AAAgC,CAAA;AAGxE,MAAa,iBAAiB,WAAW,YAAY;;ACArD,MAAa,kBAAkB,UAA+B,cAAoD;CAEhH,MAAM,cAAc,MAAM,QAAQ,QAAQ,IAAI,WAAW,MAAM,QAAQ,SAAS,IAAI,YAAY,CAAC,EAAA,CAAG,KAAK,WACvG,OAAO,WAAW,WAAW,SAAS,OAAO,aAC/C;CAEA,OAAO,WAAW,SAASA,OAAK,UAAU,IAAI;AAChD;AAEA,MAAa,qBAAqB,WAAkC,cACjE,MAAM,QAAQ,SAAS,IAAI,WAAW,cAAc;AAEvD,MAAa,mBACX,UACA,UAEA,cAAc;CACZ,IAAI,OAAO,aAAa,YAAY,OAAO,SAAS,MAAM,QAAQ;CAClE,IAAI,MAAM,QAAQ,QAAQ,KAAK,CAAC,MAAM,SAAS,OAAO;CAEtD,OAAO,SAAS,MAAM;AACxB,GAAG;CAAC;CAAU,MAAM;CAAU,MAAM;AAAO,CAAC;AAE9C,MAAa,kBACX,OACA,mBACG;CACH,MAAM,EAAE,OAAO,SAAS,kBAAkB,CAAC;CAE3C,OAAO,cAAc;EACnB,MAAM,QAAQ,CAAC;EAEf,IAAI,SAAS,MAAM,OACjB,OAAO,OAAO,OAAO,iBAAiB,OAAO,MAAM,KAAK,CAAC;EAG3D,IAAI,QAAQ,MAAM,MAChB,OAAO,OAAO,OAAO,iBAAiB,MAAM,IAA8B,CAAC;EAG7E,OAAO;CACT,GAAG,CAAC,MAAM,OAAO,MAAM,IAAI,CAAC;AAC9B;;ACxCA,MAAa,SAAS,IAAI,MAEvB,CAAC,GAAU,EACZ,MAC4C,SAAkB,SAC3D,UAA+B,WAAkC,aAA8B;CAC9F,MAAM,cAAc,eAAe,UAAU,SAAS;CACtD,MAAM,iBAAiB,kBAAkB,WAAW,QAAQ;CAE5D,MAAM,mBAAmB,UAAkF;EACzG,MAAM,aAAa,SAAS;EAC5B,MAAM,eAAe,gBAAgB,UAAU,KAAK;EACpD,MAAM,cAAc,eAAe,OAAO,cAAc;EAExD,OAAO,cAAc,KAAK;GACxB,GAAI;GACJ,WAAWC,OAAK,YAAY,aAAa,cAAc,MAAM,SAAS;GACtE,OAAO;IAAE,GAAG;IAAa,GAAG,MAAM;GAAM;EAC1C,CAAC;CACH;CAEA,OAAO,OAAO,OAAO,iBAAiB,GAAG,eAAe,YAAY,CAAC;AACvE,EACJ,CAAC;;;;;;ACjCD,MAAa,OAAO,OAA2B,UAAkD,aAAsB;CACrH,IAAI,CAAC,OAAO,OAAO,KAAA;CAGnB,MAAM,eAAe,CAAC,OAAO,GADT,OAAO,aAAa,WAAW,CAAC,QAAQ,IAAI,QACrB,CAAC,CAAC,KAAK,IAAI;CAEtD,IAAI,CAAC,UAAU,OAAO;CAEtB,OAAO,GAAG,aAAa,IAAI;AAC7B"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voiceflow/style",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.2-0cab83efde.52+0cab83efde",
|
|
4
4
|
"files": [
|
|
5
5
|
"build"
|
|
6
6
|
],
|
|
7
7
|
"type": "module",
|
|
8
|
-
"
|
|
9
|
-
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./build/main.mjs"
|
|
10
|
+
},
|
|
10
11
|
"scripts": {
|
|
11
12
|
"build": "yarn g:turbo run build:cmd --filter=@voiceflow/style...",
|
|
12
|
-
"build:cmd": "yarn g:
|
|
13
|
+
"build:cmd": "yarn g:tsdown",
|
|
13
14
|
"clean": "yarn g:rimraf build",
|
|
14
15
|
"lint": "yarn g:run-p -c lint:oxlint lint:oxfmt",
|
|
15
16
|
"lint:oxlint": "yarn g:oxlint .",
|
|
@@ -45,5 +46,5 @@
|
|
|
45
46
|
"volta": {
|
|
46
47
|
"extends": "../../package.json"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "0cab83efdeac6207189632a19dc13e95af07fbce"
|
|
49
50
|
}
|
package/build/ThemeContext.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const ThemeContext: import("react").Context<string | null>;
|
|
2
|
-
export declare const ThemeConsumer: import("react").Consumer<string | null>;
|
|
3
|
-
export interface ThemeProviderProps extends React.PropsWithChildren {
|
|
4
|
-
theme: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
7
|
-
export declare const useTheme: () => string | null;
|
|
8
|
-
//# sourceMappingURL=ThemeContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../src/ThemeContext.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,wCAAqC,CAAC;AAC/D,eAAO,MAAkB,aAAa,yCAAiB,CAAC;AAExD,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,iBAAiB;IACjE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAEtD,CAAC;AAEF,eAAO,MAAM,QAAQ,qBAAiC,CAAC"}
|
package/build/ThemeContext.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext } from 'react';
|
|
3
|
-
export const ThemeContext = createContext(null);
|
|
4
|
-
export const { Consumer: ThemeConsumer } = ThemeContext;
|
|
5
|
-
export const ThemeProvider = ({ theme, children }) => (_jsx(ThemeContext.Provider, { value: theme, children: children }));
|
|
6
|
-
export const useTheme = () => useContext(ThemeContext);
|
|
7
|
-
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../src/ThemeContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAgB,IAAI,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,YAAY,CAAC;AAMxD,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAClF,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAyB,CACxE,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.component.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/Button/Button.component.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,iBAAiB;IAC1D,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAA4E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.component.js","sourceRoot":"","sources":["../../../src/__fixtures__/Button/Button.component.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,CAAC,MAAM,iBAAiB,CAAC;AAMrC,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,KAAC,CAAC,CAAC,IAAI,IAAC,OAAO,EAAE,OAAO,YAAG,QAAQ,GAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.css.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/Button/Button.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,QAIf,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.css.js","sourceRoot":"","sources":["../../../src/__fixtures__/Button/Button.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC;IACxB,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,EAAE;IAChB,MAAM,EAAE,EAAE;CACX,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styled.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/Button/Button.styled.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,uGAAwB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styled.js","sourceRoot":"","sources":["../../../src/__fixtures__/Button/Button.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as styled from './Button.styled.js';
|
|
2
|
-
import * as css from './Button.css.js';
|
|
3
|
-
export type { ButtonProps } from './Button.component.js';
|
|
4
|
-
export declare const Button: import("react").FC<import("./Button.component.js").ButtonProps> & typeof styled & {
|
|
5
|
-
css: typeof css;
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/Button/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,eAAO,MAAM,MAAM;;CAAkD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/__fixtures__/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAIpC,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ButtonProps } from '../Button/index.js';
|
|
2
|
-
export interface InlineThemedButtonProps extends ButtonProps {
|
|
3
|
-
brandColor: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const InlineThemedButton: React.FC<InlineThemedButtonProps>;
|
|
6
|
-
//# sourceMappingURL=InlineThemedButton.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineThemedButton.component.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/InlineThemedButton/InlineThemedButton.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAK7C,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAIhE,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as S from './InlineThemedButton.styled.js';
|
|
3
|
-
import * as Theme from '../theme.css.js';
|
|
4
|
-
export const InlineThemedButton = ({ brandColor, onClick, children }) => (_jsx(S.Base, { onClick: onClick, theme: { color: { brand: brandColor }, spacing: Theme.spacing }, children: children }));
|
|
5
|
-
//# sourceMappingURL=InlineThemedButton.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineThemedButton.component.js","sourceRoot":"","sources":["../../../src/__fixtures__/InlineThemedButton/InlineThemedButton.component.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,CAAC,MAAM,6BAA6B,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAMtC,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC1G,KAAC,CAAC,CAAC,IAAI,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,YACtF,QAAQ,GACF,CACV,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineThemedButton.css.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/InlineThemedButton/InlineThemedButton.css.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,QAGjB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineThemedButton.css.js","sourceRoot":"","sources":["../../../src/__fixtures__/InlineThemedButton/InlineThemedButton.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK;IAC7B,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const Base: import("../../main.js").StyledComponent<import("../../main.js").StyledComponentProps<"button", {
|
|
2
|
-
color: {
|
|
3
|
-
brand: `var(--${string})`;
|
|
4
|
-
};
|
|
5
|
-
spacing: {
|
|
6
|
-
sm: `var(--${string})`;
|
|
7
|
-
md: `var(--${string})`;
|
|
8
|
-
lg: `var(--${string})`;
|
|
9
|
-
};
|
|
10
|
-
}, null, object>>;
|
|
11
|
-
//# sourceMappingURL=InlineThemedButton.styled.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineThemedButton.styled.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/InlineThemedButton/InlineThemedButton.styled.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,IAAI;;;;;;;;;iBAA8D,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { styled } from '../../main.js';
|
|
2
|
-
import { Button } from '../Button/index.js';
|
|
3
|
-
import * as Theme from '../theme.css.js';
|
|
4
|
-
import { themed } from './InlineThemedButton.css.js';
|
|
5
|
-
export const Base = styled.button([Button.Base, themed], { theme: Theme.vars });
|
|
6
|
-
//# sourceMappingURL=InlineThemedButton.styled.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineThemedButton.styled.js","sourceRoot":"","sources":["../../../src/__fixtures__/InlineThemedButton/InlineThemedButton.styled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/InlineThemedButton/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAEhD,eAAO,MAAM,kBAAkB;;CAAsD,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { InlineThemedButton as InlineThemedButtonComponent } from './InlineThemedButton.component.js';
|
|
2
|
-
import * as css from './InlineThemedButton.css.js';
|
|
3
|
-
export const InlineThemedButton = Object.assign(InlineThemedButtonComponent, { css });
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/__fixtures__/InlineThemedButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAEnG,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAEhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,2BAA2B,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ButtonProps } from '../Button/index.js';
|
|
2
|
-
export interface InlineVarButtonProps extends ButtonProps {
|
|
3
|
-
brandColor: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const InlineVarButton: React.FC<InlineVarButtonProps>;
|
|
6
|
-
//# sourceMappingURL=InlineVarButton.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineVarButton.component.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/InlineVarButton/InlineVarButton.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAI1D,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as S from './InlineVarButton.styled.js';
|
|
3
|
-
export const InlineVarButton = ({ brandColor, onClick, children }) => (_jsx(S.Base, { onClick: onClick, vars: { brandColor }, children: children }));
|
|
4
|
-
//# sourceMappingURL=InlineVarButton.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineVarButton.component.js","sourceRoot":"","sources":["../../../src/__fixtures__/InlineVarButton/InlineVarButton.component.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,CAAC,MAAM,0BAA0B,CAAC;AAM9C,MAAM,CAAC,MAAM,eAAe,GAAmC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACpG,KAAC,CAAC,CAAC,IAAI,IAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,YAC3C,QAAQ,GACF,CACV,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InlineVarButton.css.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/InlineVarButton/InlineVarButton.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,oBAAc,CAAC;AAEpC,eAAO,MAAM,IAAI,QAOf,CAAC"}
|