next-yak 9.4.0 → 9.4.2
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/README.md +57 -288
- package/dist/context/baseContext.cjs +6 -29
- package/dist/context/baseContext.cjs.map +1 -1
- package/dist/context/baseContext.d.cts +4 -2
- package/dist/context/baseContext.d.ts +4 -2
- package/dist/context/baseContext.js +5 -5
- package/dist/context/baseContext.js.map +1 -1
- package/dist/context/index.cjs +33 -41
- package/dist/context/index.cjs.map +1 -1
- package/dist/context/index.d.cts +12 -8
- package/dist/context/index.d.ts +12 -8
- package/dist/context/index.js +10 -13
- package/dist/context/index.js.map +1 -1
- package/dist/context/index.server.cjs +35 -41
- package/dist/context/index.server.cjs.map +1 -1
- package/dist/context/index.server.d.cts +13 -0
- package/dist/context/index.server.d.ts +13 -0
- package/dist/context/index.server.js +12 -14
- package/dist/context/index.server.js.map +1 -1
- package/dist/index.cjs +1 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -46
- package/dist/index.d.ts +52 -46
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +464 -697
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +368 -0
- package/dist/internal.d.ts +368 -0
- package/dist/internal.js +297 -532
- package/dist/internal.js.map +1 -1
- package/dist/isolated-source-eval/index.d.ts +22 -20
- package/dist/isolated-source-eval/index.js +284 -298
- package/dist/isolated-source-eval/index.js.map +1 -1
- package/dist/isolated-source-eval/worker.js +53 -57
- package/dist/isolated-source-eval/worker.js.map +1 -1
- package/dist/jsx-dev-runtime.cjs +1 -1
- package/dist/jsx-dev-runtime.cjs.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +9 -0
- package/dist/jsx-dev-runtime.d.ts +9 -0
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.cjs +1 -1
- package/dist/jsx-runtime.cjs.map +1 -1
- package/dist/jsx-runtime.d.cts +25 -24
- package/dist/jsx-runtime.d.ts +25 -24
- package/dist/jsx-runtime.js +1 -1
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/loaders/turbo-loader.cjs +695 -983
- package/dist/loaders/turbo-loader.cjs.map +1 -1
- package/dist/loaders/turbo-loader.d.cts +7 -6
- package/dist/loaders/vite-plugin.d.ts +15 -13
- package/dist/loaders/vite-plugin.js +736 -1060
- package/dist/loaders/vite-plugin.js.map +1 -1
- package/dist/loaders/webpack-loader.cjs +629 -916
- package/dist/loaders/webpack-loader.cjs.map +1 -1
- package/dist/loaders/webpack-loader.d.cts +5 -4
- package/dist/static/chunk-WfQuXRBF.js +1 -0
- package/dist/static/index.cjs +1 -1
- package/dist/static/index.cjs.map +1 -1
- package/dist/static/index.d.cts +6 -7
- package/dist/static/index.d.ts +6 -7
- package/dist/static/index.js +1 -1
- package/dist/static/index.js.map +1 -1
- package/dist/withYak/index.cjs +135 -161
- package/dist/withYak/index.cjs.map +1 -1
- package/dist/withYak/index.d.cts +42 -40
- package/dist/withYak/index.d.ts +42 -40
- package/dist/withYak/index.js +114 -133
- package/dist/withYak/index.js.map +1 -1
- package/loaders/lib/__tests__/debugLogger.test.ts +11 -43
- package/loaders/lib/debugLogger.ts +6 -12
- package/loaders/lib/extractCss.ts +2 -6
- package/loaders/lib/resolveCrossFileSelectors.ts +105 -89
- package/loaders/turbo-evaluator.ts +7 -14
- package/loaders/turbo-loader.ts +5 -22
- package/loaders/vite-plugin.ts +19 -55
- package/loaders/webpack-loader.ts +1 -3
- package/package.json +131 -71
- package/runtime/__tests__/attrs.test.tsx +9 -16
- package/runtime/__tests__/cssLiteral.test.tsx +21 -45
- package/runtime/__tests__/cssProp.test.tsx +8 -17
- package/runtime/__tests__/cssPropTest.tsx +10 -13
- package/runtime/__tests__/styled.test.tsx +4 -13
- package/runtime/__tests__/tsconfig.json +1 -0
- package/runtime/__tests__/typeTest.tsx +7 -15
- package/runtime/atoms.tsx +1 -1
- package/runtime/context/README.md +11 -16
- package/runtime/context/index.server.tsx +2 -9
- package/runtime/cssLiteral.tsx +4 -13
- package/runtime/index.ts +1 -1
- package/runtime/internals/mergeCssProp.ts +1 -3
- package/runtime/jsx-runtime.ts +1 -2
- package/runtime/keyframes.tsx +1 -1
- package/runtime/mocks/cssLiteral.ts +3 -11
- package/runtime/mocks/keyframes.ts +1 -1
- package/runtime/publicStyledApi.ts +3 -13
- package/runtime/styled.tsx +19 -31
- package/withYak/index.ts +11 -19
package/dist/internal.js
CHANGED
|
@@ -1,552 +1,317 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { YakThemeProvider, useTheme, useTheme as useTheme$1 } from "next-yak/context";
|
|
3
|
+
|
|
4
|
+
//#region runtime/cssLiteral.tsx
|
|
5
|
+
const yakComponentSymbol = Symbol("yak");
|
|
3
6
|
function css(...args) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} else {
|
|
24
|
-
style[key] = String(value);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (dynamicCssFunctions.length === 0) {
|
|
31
|
-
return (_, classNames) => {
|
|
32
|
-
if (className) {
|
|
33
|
-
classNames.add(className);
|
|
34
|
-
}
|
|
35
|
-
return () => {
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
return (props, classNames, allStyles) => {
|
|
40
|
-
if (className) {
|
|
41
|
-
classNames.add(className);
|
|
42
|
-
}
|
|
43
|
-
for (let i = 0; i < dynamicCssFunctions.length; i++) {
|
|
44
|
-
unwrapProps(props, dynamicCssFunctions[i], classNames, allStyles);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
7
|
+
let className;
|
|
8
|
+
const dynamicCssFunctions = [];
|
|
9
|
+
for (const arg of args) if (typeof arg === "string") className = arg;
|
|
10
|
+
else if (typeof arg === "function") dynamicCssFunctions.push(arg);
|
|
11
|
+
else if (typeof arg === "object" && "style" in arg) dynamicCssFunctions.push((props, _, style) => {
|
|
12
|
+
for (const key in arg.style) {
|
|
13
|
+
const value = arg.style[key];
|
|
14
|
+
if (typeof value === "function") style[key] = String(recursivePropExecution(props, value));
|
|
15
|
+
else style[key] = String(value);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
if (dynamicCssFunctions.length === 0) return (_, classNames) => {
|
|
19
|
+
if (className) classNames.add(className);
|
|
20
|
+
return () => {};
|
|
21
|
+
};
|
|
22
|
+
return (props, classNames, allStyles) => {
|
|
23
|
+
if (className) classNames.add(className);
|
|
24
|
+
for (let i = 0; i < dynamicCssFunctions.length; i++) unwrapProps(props, dynamicCssFunctions[i], classNames, allStyles);
|
|
25
|
+
};
|
|
47
26
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
style[key] = result.style[key];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
27
|
+
const unwrapProps = (props, fn, classNames, style) => {
|
|
28
|
+
let result = fn(props, classNames, style);
|
|
29
|
+
while (result) {
|
|
30
|
+
if (typeof result === "function") {
|
|
31
|
+
result = result(props, classNames, style);
|
|
32
|
+
continue;
|
|
33
|
+
} else if (typeof result === "object") {
|
|
34
|
+
if ("className" in result && result.className) classNames.add(result.className);
|
|
35
|
+
if ("style" in result && result.style) for (const key in result.style) style[key] = result.style[key];
|
|
36
|
+
}
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
66
39
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
throw new Error(
|
|
75
|
-
`Dynamic CSS functions must return a string or number but returned ${JSON.stringify(
|
|
76
|
-
result
|
|
77
|
-
)}
|
|
78
|
-
|
|
79
|
-
Dynamic CSS function: ${fn.toString()}
|
|
80
|
-
`
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return result;
|
|
40
|
+
const recursivePropExecution = (props, fn) => {
|
|
41
|
+
const result = fn(props);
|
|
42
|
+
if (typeof result === "function") return recursivePropExecution(props, result);
|
|
43
|
+
if (process.env.NODE_ENV === "development") {
|
|
44
|
+
if (typeof result !== "string" && typeof result !== "number" && !(result instanceof String)) throw new Error(`Dynamic CSS functions must return a string or number but returned ${JSON.stringify(result)}\n\nDynamic CSS function: ${fn.toString()}\n`);
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
85
47
|
};
|
|
86
48
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (!("$__runtimeStylesProcessed" in combinedProps)) {
|
|
132
|
-
runtimeStyleProcessor(combinedProps, classNames, styles2);
|
|
133
|
-
combinedProps.$__runtimeStylesProcessed = true;
|
|
134
|
-
}
|
|
135
|
-
combinedProps.className = Array.from(classNames).join(" ") || void 0;
|
|
136
|
-
combinedProps.style = styles2;
|
|
137
|
-
const { theme: themeAfterAttr, ...combinedPropsWithoutTheme } = combinedProps;
|
|
138
|
-
const propsBeforeFiltering = themeAfterAttr === theme ? combinedPropsWithoutTheme : combinedProps;
|
|
139
|
-
const filteredProps = !isYakComponent ? removeNonDomProperties(propsBeforeFiltering) : propsBeforeFiltering;
|
|
140
|
-
return parentYakComponent ? (
|
|
141
|
-
// if the styled(Component) syntax is used and the component is a yak component
|
|
142
|
-
// we can call the yak function directly without running through react createElement
|
|
143
|
-
parentYakComponent(filteredProps)
|
|
144
|
-
) : (
|
|
145
|
-
// if the final component is a string component e.g. styled("div") or a custom non yak fn e.g. styled(MyComponent)
|
|
146
|
-
/* @__PURE__ */ React.createElement(
|
|
147
|
-
Component,
|
|
148
|
-
{
|
|
149
|
-
...filteredProps
|
|
150
|
-
}
|
|
151
|
-
)
|
|
152
|
-
);
|
|
153
|
-
};
|
|
154
|
-
return Object.assign(yak, {
|
|
155
|
-
[yakComponentSymbol]: [yak, mergedAttrsFn, runtimeStyleProcessor]
|
|
156
|
-
});
|
|
157
|
-
};
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region runtime/styled.tsx
|
|
51
|
+
const noTheme = {};
|
|
52
|
+
const styledFactory = (Component) => Object.assign(yakStyled(Component), { attrs: (attrs) => yakStyled(Component, attrs) });
|
|
53
|
+
const styled = styledFactory;
|
|
54
|
+
const yakStyled = (Component, attrs) => {
|
|
55
|
+
const isYakComponent = typeof Component !== "string" && yakComponentSymbol in Component;
|
|
56
|
+
const [parentYakComponent, parentAttrsFn, parentRuntimeStylesFn] = isYakComponent ? Component[yakComponentSymbol] : [];
|
|
57
|
+
const mergedAttrsFn = buildRuntimeAttrsProcessor(attrs, parentAttrsFn);
|
|
58
|
+
return (styles, ...values) => {
|
|
59
|
+
const runtimeStylesFn = css(styles, ...values);
|
|
60
|
+
const runtimeStyleProcessor = buildRuntimeStylesProcessor(runtimeStylesFn, parentRuntimeStylesFn);
|
|
61
|
+
const Yak = (props) => {
|
|
62
|
+
const theme = mergedAttrsFn || runtimeStylesFn.length ? useTheme$1() : noTheme;
|
|
63
|
+
const combinedProps = "$__attrs" in props ? {
|
|
64
|
+
theme,
|
|
65
|
+
...props
|
|
66
|
+
} : combineProps({
|
|
67
|
+
theme,
|
|
68
|
+
...props,
|
|
69
|
+
$__attrs: true
|
|
70
|
+
}, mergedAttrsFn?.({
|
|
71
|
+
theme,
|
|
72
|
+
...props
|
|
73
|
+
}));
|
|
74
|
+
const classNames = new Set("className" in combinedProps ? combinedProps.className?.split(" ") : []);
|
|
75
|
+
const styles = { ..."style" in combinedProps ? combinedProps.style : {} };
|
|
76
|
+
if (!("$__runtimeStylesProcessed" in combinedProps)) {
|
|
77
|
+
runtimeStyleProcessor(combinedProps, classNames, styles);
|
|
78
|
+
combinedProps.$__runtimeStylesProcessed = true;
|
|
79
|
+
}
|
|
80
|
+
combinedProps.className = Array.from(classNames).join(" ") || void 0;
|
|
81
|
+
combinedProps.style = styles;
|
|
82
|
+
const { theme: themeAfterAttr, ...combinedPropsWithoutTheme } = combinedProps;
|
|
83
|
+
const propsBeforeFiltering = themeAfterAttr === theme ? combinedPropsWithoutTheme : combinedProps;
|
|
84
|
+
const filteredProps = !isYakComponent ? removeNonDomProperties(propsBeforeFiltering) : propsBeforeFiltering;
|
|
85
|
+
return parentYakComponent ? parentYakComponent(filteredProps) : /* @__PURE__ */ React.createElement(Component, filteredProps);
|
|
86
|
+
};
|
|
87
|
+
return Object.assign(Yak, { [yakComponentSymbol]: [
|
|
88
|
+
Yak,
|
|
89
|
+
mergedAttrsFn,
|
|
90
|
+
runtimeStyleProcessor
|
|
91
|
+
] });
|
|
92
|
+
};
|
|
158
93
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
result[key] = obj[key];
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return result;
|
|
94
|
+
const removeNonDomProperties = (obj) => {
|
|
95
|
+
const result = {};
|
|
96
|
+
for (const key in obj) if (!key.startsWith("$") && obj[key] !== void 0) result[key] = obj[key];
|
|
97
|
+
return result;
|
|
167
98
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
99
|
+
const mergeClassNames = (a, b) => {
|
|
100
|
+
if (!a && !b) return void 0;
|
|
101
|
+
if (!a) return b;
|
|
102
|
+
if (!b) return a;
|
|
103
|
+
return a + " " + b;
|
|
173
104
|
};
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const ownAttrsFn = attrs && (typeof attrs === "function" ? attrs : () => attrs);
|
|
194
|
-
if (ownAttrsFn && parentAttrsFn) {
|
|
195
|
-
return (props) => {
|
|
196
|
-
const parentProps = parentAttrsFn(props);
|
|
197
|
-
return combineProps(
|
|
198
|
-
parentProps,
|
|
199
|
-
ownAttrsFn(combineProps(props, parentProps))
|
|
200
|
-
);
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
return ownAttrsFn || parentAttrsFn;
|
|
105
|
+
const combineProps = (props, newProps) => newProps ? (props.className === newProps.className || !newProps.className) && (props.style === newProps.style || !newProps.style) ? {
|
|
106
|
+
...props,
|
|
107
|
+
...newProps
|
|
108
|
+
} : {
|
|
109
|
+
...props,
|
|
110
|
+
...newProps,
|
|
111
|
+
className: mergeClassNames(props.className, newProps.className),
|
|
112
|
+
style: {
|
|
113
|
+
...props.style,
|
|
114
|
+
...newProps.style
|
|
115
|
+
}
|
|
116
|
+
} : props;
|
|
117
|
+
const buildRuntimeAttrsProcessor = (attrs, parentAttrsFn) => {
|
|
118
|
+
const ownAttrsFn = attrs && (typeof attrs === "function" ? attrs : () => attrs);
|
|
119
|
+
if (ownAttrsFn && parentAttrsFn) return (props) => {
|
|
120
|
+
const parentProps = parentAttrsFn(props);
|
|
121
|
+
return combineProps(parentProps, ownAttrsFn(combineProps(props, parentProps)));
|
|
122
|
+
};
|
|
123
|
+
return ownAttrsFn || parentAttrsFn;
|
|
204
124
|
};
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
125
|
+
const buildRuntimeStylesProcessor = (runtimeStylesFn, parentRuntimeStylesFn) => {
|
|
126
|
+
if (runtimeStylesFn && parentRuntimeStylesFn) {
|
|
127
|
+
const combined = (props, classNames, style) => {
|
|
128
|
+
parentRuntimeStylesFn(props, classNames, style);
|
|
129
|
+
runtimeStylesFn(props, classNames, style);
|
|
130
|
+
};
|
|
131
|
+
return combined;
|
|
132
|
+
}
|
|
133
|
+
return runtimeStylesFn || parentRuntimeStylesFn;
|
|
214
134
|
};
|
|
215
135
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
const runtimeFunctions = staticClasses.length > 0 ? [
|
|
228
|
-
(_, classNames) => {
|
|
229
|
-
staticClasses.forEach((cls) => classNames.add(cls));
|
|
230
|
-
},
|
|
231
|
-
...dynamicFunctions
|
|
232
|
-
] : dynamicFunctions;
|
|
233
|
-
return css(...runtimeFunctions);
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region runtime/atoms.tsx
|
|
138
|
+
const atoms = (...atoms) => {
|
|
139
|
+
const staticClasses = [];
|
|
140
|
+
const dynamicFunctions = [];
|
|
141
|
+
for (const atom of atoms) if (typeof atom === "string") staticClasses.push(...atom.split(" "));
|
|
142
|
+
else if (typeof atom === "function") dynamicFunctions.push(atom);
|
|
143
|
+
return css(...staticClasses.length > 0 ? [(_, classNames) => {
|
|
144
|
+
staticClasses.forEach((cls) => classNames.add(cls));
|
|
145
|
+
}, ...dynamicFunctions] : dynamicFunctions);
|
|
234
146
|
};
|
|
235
147
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region runtime/keyframes.tsx
|
|
150
|
+
const keyframes = (styles, ..._dynamic) => {
|
|
151
|
+
return styles;
|
|
239
152
|
};
|
|
240
153
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
case "string":
|
|
251
|
-
return `${arg}${unit}`;
|
|
252
|
-
// Ignore falsy values
|
|
253
|
-
default:
|
|
254
|
-
return void 0;
|
|
255
|
-
}
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region runtime/internals/unitPostFix.ts
|
|
156
|
+
const unitPostFix = (arg, unit) => {
|
|
157
|
+
switch (typeof arg) {
|
|
158
|
+
case "function": return (props) => unitPostFix(arg(props), unit);
|
|
159
|
+
case "number":
|
|
160
|
+
case "string": return `${arg}${unit}`;
|
|
161
|
+
default: return;
|
|
162
|
+
}
|
|
256
163
|
};
|
|
257
164
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
result.className = Array.from(classNames).join(" ");
|
|
271
|
-
}
|
|
272
|
-
return result;
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region runtime/internals/mergeCssProp.ts
|
|
167
|
+
const mergeCssProp = (relevantProps, cssProp) => {
|
|
168
|
+
const existingClassName = relevantProps.className;
|
|
169
|
+
const classNames = existingClassName ? new Set(existingClassName.split(" ")) : /* @__PURE__ */ new Set();
|
|
170
|
+
const existingStyle = relevantProps.style;
|
|
171
|
+
const style = existingStyle ? { ...existingStyle } : {};
|
|
172
|
+
cssProp({}, classNames, style);
|
|
173
|
+
const result = {};
|
|
174
|
+
if (Object.keys(style).length > 0) result.style = style;
|
|
175
|
+
if (classNames.size > 0) result.className = Array.from(classNames).join(" ");
|
|
176
|
+
return result;
|
|
273
177
|
};
|
|
274
178
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
__yak_address,
|
|
414
|
-
__yak_area,
|
|
415
|
-
__yak_article,
|
|
416
|
-
__yak_aside,
|
|
417
|
-
__yak_audio,
|
|
418
|
-
__yak_b,
|
|
419
|
-
__yak_base,
|
|
420
|
-
__yak_bdi,
|
|
421
|
-
__yak_bdo,
|
|
422
|
-
__yak_big,
|
|
423
|
-
__yak_blockquote,
|
|
424
|
-
__yak_body,
|
|
425
|
-
__yak_br,
|
|
426
|
-
__yak_button,
|
|
427
|
-
__yak_canvas,
|
|
428
|
-
__yak_caption,
|
|
429
|
-
__yak_circle,
|
|
430
|
-
__yak_cite,
|
|
431
|
-
__yak_clipPath,
|
|
432
|
-
__yak_code,
|
|
433
|
-
__yak_col,
|
|
434
|
-
__yak_colgroup,
|
|
435
|
-
__yak_data,
|
|
436
|
-
__yak_datalist,
|
|
437
|
-
__yak_dd,
|
|
438
|
-
__yak_defs,
|
|
439
|
-
__yak_del,
|
|
440
|
-
__yak_details,
|
|
441
|
-
__yak_dfn,
|
|
442
|
-
__yak_dialog,
|
|
443
|
-
__yak_div,
|
|
444
|
-
__yak_dl,
|
|
445
|
-
__yak_dt,
|
|
446
|
-
__yak_ellipse,
|
|
447
|
-
__yak_em,
|
|
448
|
-
__yak_embed,
|
|
449
|
-
__yak_fieldset,
|
|
450
|
-
__yak_figcaption,
|
|
451
|
-
__yak_figure,
|
|
452
|
-
__yak_footer,
|
|
453
|
-
__yak_foreignObject,
|
|
454
|
-
__yak_form,
|
|
455
|
-
__yak_g,
|
|
456
|
-
__yak_h1,
|
|
457
|
-
__yak_h2,
|
|
458
|
-
__yak_h3,
|
|
459
|
-
__yak_h4,
|
|
460
|
-
__yak_h5,
|
|
461
|
-
__yak_h6,
|
|
462
|
-
__yak_header,
|
|
463
|
-
__yak_hgroup,
|
|
464
|
-
__yak_hr,
|
|
465
|
-
__yak_html,
|
|
466
|
-
__yak_i,
|
|
467
|
-
__yak_iframe,
|
|
468
|
-
__yak_image,
|
|
469
|
-
__yak_img,
|
|
470
|
-
__yak_input,
|
|
471
|
-
__yak_ins,
|
|
472
|
-
__yak_kbd,
|
|
473
|
-
__yak_keygen,
|
|
474
|
-
__yak_label,
|
|
475
|
-
__yak_legend,
|
|
476
|
-
__yak_li,
|
|
477
|
-
__yak_line,
|
|
478
|
-
__yak_linearGradient,
|
|
479
|
-
__yak_link,
|
|
480
|
-
__yak_main,
|
|
481
|
-
__yak_map,
|
|
482
|
-
__yak_mark,
|
|
483
|
-
__yak_marker,
|
|
484
|
-
__yak_mask,
|
|
485
|
-
__yak_menu,
|
|
486
|
-
__yak_menuitem,
|
|
487
|
-
mergeCssProp as __yak_mergeCssProp,
|
|
488
|
-
__yak_meta,
|
|
489
|
-
__yak_meter,
|
|
490
|
-
__yak_nav,
|
|
491
|
-
__yak_noscript,
|
|
492
|
-
__yak_object,
|
|
493
|
-
__yak_ol,
|
|
494
|
-
__yak_optgroup,
|
|
495
|
-
__yak_option,
|
|
496
|
-
__yak_output,
|
|
497
|
-
__yak_p,
|
|
498
|
-
__yak_param,
|
|
499
|
-
__yak_path,
|
|
500
|
-
__yak_pattern,
|
|
501
|
-
__yak_picture,
|
|
502
|
-
__yak_polygon,
|
|
503
|
-
__yak_polyline,
|
|
504
|
-
__yak_pre,
|
|
505
|
-
__yak_progress,
|
|
506
|
-
__yak_q,
|
|
507
|
-
__yak_radialGradient,
|
|
508
|
-
__yak_rect,
|
|
509
|
-
__yak_rp,
|
|
510
|
-
__yak_rt,
|
|
511
|
-
__yak_ruby,
|
|
512
|
-
__yak_s,
|
|
513
|
-
__yak_samp,
|
|
514
|
-
__yak_script,
|
|
515
|
-
__yak_section,
|
|
516
|
-
__yak_select,
|
|
517
|
-
__yak_small,
|
|
518
|
-
__yak_source,
|
|
519
|
-
__yak_span,
|
|
520
|
-
__yak_stop,
|
|
521
|
-
__yak_strong,
|
|
522
|
-
__yak_style,
|
|
523
|
-
__yak_sub,
|
|
524
|
-
__yak_summary,
|
|
525
|
-
__yak_sup,
|
|
526
|
-
__yak_svg,
|
|
527
|
-
__yak_table,
|
|
528
|
-
__yak_tbody,
|
|
529
|
-
__yak_td,
|
|
530
|
-
__yak_text,
|
|
531
|
-
__yak_textarea,
|
|
532
|
-
__yak_tfoot,
|
|
533
|
-
__yak_th,
|
|
534
|
-
__yak_thead,
|
|
535
|
-
__yak_time,
|
|
536
|
-
__yak_tr,
|
|
537
|
-
__yak_track,
|
|
538
|
-
__yak_tspan,
|
|
539
|
-
__yak_u,
|
|
540
|
-
__yak_ul,
|
|
541
|
-
unitPostFix as __yak_unitPostFix,
|
|
542
|
-
__yak_use,
|
|
543
|
-
__yak_var,
|
|
544
|
-
__yak_video,
|
|
545
|
-
__yak_wbr,
|
|
546
|
-
atoms,
|
|
547
|
-
css,
|
|
548
|
-
keyframes,
|
|
549
|
-
styled,
|
|
550
|
-
useTheme2 as useTheme
|
|
551
|
-
};
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region runtime/styledDom.tsx
|
|
181
|
+
const __yak_a = /* @__PURE__ */ styled("a");
|
|
182
|
+
const __yak_abbr = /* @__PURE__ */ styled("abbr");
|
|
183
|
+
const __yak_address = /* @__PURE__ */ styled("address");
|
|
184
|
+
const __yak_area = /* @__PURE__ */ styled("area");
|
|
185
|
+
const __yak_article = /* @__PURE__ */ styled("article");
|
|
186
|
+
const __yak_aside = /* @__PURE__ */ styled("aside");
|
|
187
|
+
const __yak_audio = /* @__PURE__ */ styled("audio");
|
|
188
|
+
const __yak_b = /* @__PURE__ */ styled("b");
|
|
189
|
+
const __yak_base = /* @__PURE__ */ styled("base");
|
|
190
|
+
const __yak_bdi = /* @__PURE__ */ styled("bdi");
|
|
191
|
+
const __yak_bdo = /* @__PURE__ */ styled("bdo");
|
|
192
|
+
const __yak_big = /* @__PURE__ */ styled("big");
|
|
193
|
+
const __yak_blockquote = /* @__PURE__ */ styled("blockquote");
|
|
194
|
+
const __yak_body = /* @__PURE__ */ styled("body");
|
|
195
|
+
const __yak_br = /* @__PURE__ */ styled("br");
|
|
196
|
+
const __yak_button = /* @__PURE__ */ styled("button");
|
|
197
|
+
const __yak_canvas = /* @__PURE__ */ styled("canvas");
|
|
198
|
+
const __yak_caption = /* @__PURE__ */ styled("caption");
|
|
199
|
+
const __yak_cite = /* @__PURE__ */ styled("cite");
|
|
200
|
+
const __yak_code = /* @__PURE__ */ styled("code");
|
|
201
|
+
const __yak_col = /* @__PURE__ */ styled("col");
|
|
202
|
+
const __yak_colgroup = /* @__PURE__ */ styled("colgroup");
|
|
203
|
+
const __yak_data = /* @__PURE__ */ styled("data");
|
|
204
|
+
const __yak_datalist = /* @__PURE__ */ styled("datalist");
|
|
205
|
+
const __yak_dd = /* @__PURE__ */ styled("dd");
|
|
206
|
+
const __yak_del = /* @__PURE__ */ styled("del");
|
|
207
|
+
const __yak_details = /* @__PURE__ */ styled("details");
|
|
208
|
+
const __yak_dfn = /* @__PURE__ */ styled("dfn");
|
|
209
|
+
const __yak_dialog = /* @__PURE__ */ styled("dialog");
|
|
210
|
+
const __yak_div = /* @__PURE__ */ styled("div");
|
|
211
|
+
const __yak_dl = /* @__PURE__ */ styled("dl");
|
|
212
|
+
const __yak_dt = /* @__PURE__ */ styled("dt");
|
|
213
|
+
const __yak_em = /* @__PURE__ */ styled("em");
|
|
214
|
+
const __yak_embed = /* @__PURE__ */ styled("embed");
|
|
215
|
+
const __yak_fieldset = /* @__PURE__ */ styled("fieldset");
|
|
216
|
+
const __yak_figcaption = /* @__PURE__ */ styled("figcaption");
|
|
217
|
+
const __yak_figure = /* @__PURE__ */ styled("figure");
|
|
218
|
+
const __yak_footer = /* @__PURE__ */ styled("footer");
|
|
219
|
+
const __yak_form = /* @__PURE__ */ styled("form");
|
|
220
|
+
const __yak_h1 = /* @__PURE__ */ styled("h1");
|
|
221
|
+
const __yak_h2 = /* @__PURE__ */ styled("h2");
|
|
222
|
+
const __yak_h3 = /* @__PURE__ */ styled("h3");
|
|
223
|
+
const __yak_h4 = /* @__PURE__ */ styled("h4");
|
|
224
|
+
const __yak_h5 = /* @__PURE__ */ styled("h5");
|
|
225
|
+
const __yak_h6 = /* @__PURE__ */ styled("h6");
|
|
226
|
+
const __yak_header = /* @__PURE__ */ styled("header");
|
|
227
|
+
const __yak_hgroup = /* @__PURE__ */ styled("hgroup");
|
|
228
|
+
const __yak_hr = /* @__PURE__ */ styled("hr");
|
|
229
|
+
const __yak_html = /* @__PURE__ */ styled("html");
|
|
230
|
+
const __yak_i = /* @__PURE__ */ styled("i");
|
|
231
|
+
const __yak_iframe = /* @__PURE__ */ styled("iframe");
|
|
232
|
+
const __yak_img = /* @__PURE__ */ styled("img");
|
|
233
|
+
const __yak_input = /* @__PURE__ */ styled("input");
|
|
234
|
+
const __yak_ins = /* @__PURE__ */ styled("ins");
|
|
235
|
+
const __yak_kbd = /* @__PURE__ */ styled("kbd");
|
|
236
|
+
const __yak_keygen = /* @__PURE__ */ styled("keygen");
|
|
237
|
+
const __yak_label = /* @__PURE__ */ styled("label");
|
|
238
|
+
const __yak_legend = /* @__PURE__ */ styled("legend");
|
|
239
|
+
const __yak_li = /* @__PURE__ */ styled("li");
|
|
240
|
+
const __yak_link = /* @__PURE__ */ styled("link");
|
|
241
|
+
const __yak_main = /* @__PURE__ */ styled("main");
|
|
242
|
+
const __yak_map = /* @__PURE__ */ styled("map");
|
|
243
|
+
const __yak_mark = /* @__PURE__ */ styled("mark");
|
|
244
|
+
const __yak_menu = /* @__PURE__ */ styled("menu");
|
|
245
|
+
const __yak_menuitem = /* @__PURE__ */ styled("menuitem");
|
|
246
|
+
const __yak_meta = /* @__PURE__ */ styled("meta");
|
|
247
|
+
const __yak_meter = /* @__PURE__ */ styled("meter");
|
|
248
|
+
const __yak_nav = /* @__PURE__ */ styled("nav");
|
|
249
|
+
const __yak_noscript = /* @__PURE__ */ styled("noscript");
|
|
250
|
+
const __yak_object = /* @__PURE__ */ styled("object");
|
|
251
|
+
const __yak_ol = /* @__PURE__ */ styled("ol");
|
|
252
|
+
const __yak_optgroup = /* @__PURE__ */ styled("optgroup");
|
|
253
|
+
const __yak_option = /* @__PURE__ */ styled("option");
|
|
254
|
+
const __yak_output = /* @__PURE__ */ styled("output");
|
|
255
|
+
const __yak_p = /* @__PURE__ */ styled("p");
|
|
256
|
+
const __yak_param = /* @__PURE__ */ styled("param");
|
|
257
|
+
const __yak_picture = /* @__PURE__ */ styled("picture");
|
|
258
|
+
const __yak_pre = /* @__PURE__ */ styled("pre");
|
|
259
|
+
const __yak_progress = /* @__PURE__ */ styled("progress");
|
|
260
|
+
const __yak_q = /* @__PURE__ */ styled("q");
|
|
261
|
+
const __yak_rp = /* @__PURE__ */ styled("rp");
|
|
262
|
+
const __yak_rt = /* @__PURE__ */ styled("rt");
|
|
263
|
+
const __yak_ruby = /* @__PURE__ */ styled("ruby");
|
|
264
|
+
const __yak_s = /* @__PURE__ */ styled("s");
|
|
265
|
+
const __yak_samp = /* @__PURE__ */ styled("samp");
|
|
266
|
+
const __yak_script = /* @__PURE__ */ styled("script");
|
|
267
|
+
const __yak_section = /* @__PURE__ */ styled("section");
|
|
268
|
+
const __yak_select = /* @__PURE__ */ styled("select");
|
|
269
|
+
const __yak_small = /* @__PURE__ */ styled("small");
|
|
270
|
+
const __yak_source = /* @__PURE__ */ styled("source");
|
|
271
|
+
const __yak_span = /* @__PURE__ */ styled("span");
|
|
272
|
+
const __yak_strong = /* @__PURE__ */ styled("strong");
|
|
273
|
+
const __yak_style = /* @__PURE__ */ styled("style");
|
|
274
|
+
const __yak_sub = /* @__PURE__ */ styled("sub");
|
|
275
|
+
const __yak_summary = /* @__PURE__ */ styled("summary");
|
|
276
|
+
const __yak_sup = /* @__PURE__ */ styled("sup");
|
|
277
|
+
const __yak_table = /* @__PURE__ */ styled("table");
|
|
278
|
+
const __yak_tbody = /* @__PURE__ */ styled("tbody");
|
|
279
|
+
const __yak_td = /* @__PURE__ */ styled("td");
|
|
280
|
+
const __yak_textarea = /* @__PURE__ */ styled("textarea");
|
|
281
|
+
const __yak_tfoot = /* @__PURE__ */ styled("tfoot");
|
|
282
|
+
const __yak_th = /* @__PURE__ */ styled("th");
|
|
283
|
+
const __yak_thead = /* @__PURE__ */ styled("thead");
|
|
284
|
+
const __yak_time = /* @__PURE__ */ styled("time");
|
|
285
|
+
const __yak_tr = /* @__PURE__ */ styled("tr");
|
|
286
|
+
const __yak_track = /* @__PURE__ */ styled("track");
|
|
287
|
+
const __yak_u = /* @__PURE__ */ styled("u");
|
|
288
|
+
const __yak_ul = /* @__PURE__ */ styled("ul");
|
|
289
|
+
const __yak_use = /* @__PURE__ */ styled("use");
|
|
290
|
+
const __yak_var = /* @__PURE__ */ styled("var");
|
|
291
|
+
const __yak_video = /* @__PURE__ */ styled("video");
|
|
292
|
+
const __yak_wbr = /* @__PURE__ */ styled("wbr");
|
|
293
|
+
const __yak_circle = /* @__PURE__ */ styled("circle");
|
|
294
|
+
const __yak_clipPath = /* @__PURE__ */ styled("clipPath");
|
|
295
|
+
const __yak_defs = /* @__PURE__ */ styled("defs");
|
|
296
|
+
const __yak_ellipse = /* @__PURE__ */ styled("ellipse");
|
|
297
|
+
const __yak_foreignObject = /* @__PURE__ */ styled("foreignObject");
|
|
298
|
+
const __yak_g = /* @__PURE__ */ styled("g");
|
|
299
|
+
const __yak_image = /* @__PURE__ */ styled("image");
|
|
300
|
+
const __yak_line = /* @__PURE__ */ styled("line");
|
|
301
|
+
const __yak_linearGradient = /* @__PURE__ */ styled("linearGradient");
|
|
302
|
+
const __yak_marker = /* @__PURE__ */ styled("marker");
|
|
303
|
+
const __yak_mask = /* @__PURE__ */ styled("mask");
|
|
304
|
+
const __yak_path = /* @__PURE__ */ styled("path");
|
|
305
|
+
const __yak_pattern = /* @__PURE__ */ styled("pattern");
|
|
306
|
+
const __yak_polygon = /* @__PURE__ */ styled("polygon");
|
|
307
|
+
const __yak_polyline = /* @__PURE__ */ styled("polyline");
|
|
308
|
+
const __yak_radialGradient = /* @__PURE__ */ styled("radialGradient");
|
|
309
|
+
const __yak_rect = /* @__PURE__ */ styled("rect");
|
|
310
|
+
const __yak_stop = /* @__PURE__ */ styled("stop");
|
|
311
|
+
const __yak_svg = /* @__PURE__ */ styled("svg");
|
|
312
|
+
const __yak_text = /* @__PURE__ */ styled("text");
|
|
313
|
+
const __yak_tspan = /* @__PURE__ */ styled("tspan");
|
|
314
|
+
|
|
315
|
+
//#endregion
|
|
316
|
+
export { YakThemeProvider, __yak_a, __yak_abbr, __yak_address, __yak_area, __yak_article, __yak_aside, __yak_audio, __yak_b, __yak_base, __yak_bdi, __yak_bdo, __yak_big, __yak_blockquote, __yak_body, __yak_br, __yak_button, __yak_canvas, __yak_caption, __yak_circle, __yak_cite, __yak_clipPath, __yak_code, __yak_col, __yak_colgroup, __yak_data, __yak_datalist, __yak_dd, __yak_defs, __yak_del, __yak_details, __yak_dfn, __yak_dialog, __yak_div, __yak_dl, __yak_dt, __yak_ellipse, __yak_em, __yak_embed, __yak_fieldset, __yak_figcaption, __yak_figure, __yak_footer, __yak_foreignObject, __yak_form, __yak_g, __yak_h1, __yak_h2, __yak_h3, __yak_h4, __yak_h5, __yak_h6, __yak_header, __yak_hgroup, __yak_hr, __yak_html, __yak_i, __yak_iframe, __yak_image, __yak_img, __yak_input, __yak_ins, __yak_kbd, __yak_keygen, __yak_label, __yak_legend, __yak_li, __yak_line, __yak_linearGradient, __yak_link, __yak_main, __yak_map, __yak_mark, __yak_marker, __yak_mask, __yak_menu, __yak_menuitem, mergeCssProp as __yak_mergeCssProp, __yak_meta, __yak_meter, __yak_nav, __yak_noscript, __yak_object, __yak_ol, __yak_optgroup, __yak_option, __yak_output, __yak_p, __yak_param, __yak_path, __yak_pattern, __yak_picture, __yak_polygon, __yak_polyline, __yak_pre, __yak_progress, __yak_q, __yak_radialGradient, __yak_rect, __yak_rp, __yak_rt, __yak_ruby, __yak_s, __yak_samp, __yak_script, __yak_section, __yak_select, __yak_small, __yak_source, __yak_span, __yak_stop, __yak_strong, __yak_style, __yak_sub, __yak_summary, __yak_sup, __yak_svg, __yak_table, __yak_tbody, __yak_td, __yak_text, __yak_textarea, __yak_tfoot, __yak_th, __yak_thead, __yak_time, __yak_tr, __yak_track, __yak_tspan, __yak_u, __yak_ul, unitPostFix as __yak_unitPostFix, __yak_use, __yak_var, __yak_video, __yak_wbr, atoms, css, keyframes, styled, useTheme };
|
|
552
317
|
//# sourceMappingURL=internal.js.map
|