react-native-css 3.0.0 → 3.0.1
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/dist/commonjs/compiler/declarations.js +51 -0
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/lightningcss-loader.js +12 -2
- package/dist/commonjs/compiler/lightningcss-loader.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +3 -1
- package/dist/commonjs/compiler/supports.js.map +1 -1
- package/dist/commonjs/components/ActivityIndicator.js +4 -4
- package/dist/commonjs/components/ActivityIndicator.js.map +1 -1
- package/dist/commonjs/components/Button.js +4 -4
- package/dist/commonjs/components/Button.js.map +1 -1
- package/dist/commonjs/components/FlatList.js +4 -4
- package/dist/commonjs/components/FlatList.js.map +1 -1
- package/dist/commonjs/components/Image.js +4 -4
- package/dist/commonjs/components/Image.js.map +1 -1
- package/dist/commonjs/components/ImageBackground.js +4 -4
- package/dist/commonjs/components/ImageBackground.js.map +1 -1
- package/dist/commonjs/components/KeyboardAvoidingView.js +4 -4
- package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/commonjs/components/Pressable.js +4 -4
- package/dist/commonjs/components/Pressable.js.map +1 -1
- package/dist/commonjs/components/ScrollView.js +4 -4
- package/dist/commonjs/components/ScrollView.js.map +1 -1
- package/dist/commonjs/components/Switch.js +4 -4
- package/dist/commonjs/components/Switch.js.map +1 -1
- package/dist/commonjs/components/Text.js +4 -4
- package/dist/commonjs/components/Text.js.map +1 -1
- package/dist/commonjs/components/TextInput.js +4 -4
- package/dist/commonjs/components/TextInput.js.map +1 -1
- package/dist/commonjs/components/TouchableHighlight.js +4 -4
- package/dist/commonjs/components/TouchableHighlight.js.map +1 -1
- package/dist/commonjs/components/TouchableOpacity.js +4 -4
- package/dist/commonjs/components/TouchableOpacity.js.map +1 -1
- package/dist/commonjs/components/TouchableWithoutFeedback.js +4 -4
- package/dist/commonjs/components/TouchableWithoutFeedback.js.map +1 -1
- package/dist/commonjs/components/View.js +4 -4
- package/dist/commonjs/components/View.js.map +1 -1
- package/dist/commonjs/components/VirtualizedList.js +4 -4
- package/dist/commonjs/components/VirtualizedList.js.map +1 -1
- package/dist/commonjs/components/copyComponentProperties.js +19 -0
- package/dist/commonjs/components/copyComponentProperties.js.map +1 -0
- package/dist/commonjs/components/index.cjs +3 -3
- package/dist/commonjs/components/index.cjs.map +1 -1
- package/dist/commonjs/metro/resolver.js +5 -3
- package/dist/commonjs/metro/resolver.js.map +1 -1
- package/dist/commonjs/native/api.js +5 -1
- package/dist/commonjs/native/api.js.map +1 -1
- package/dist/commonjs/native/react/useNativeCss.js +11 -5
- package/dist/commonjs/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/native/styles/functions/color-mix.js +50 -0
- package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -0
- package/dist/commonjs/native/styles/functions/index.js +11 -0
- package/dist/commonjs/native/styles/functions/index.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +50 -7
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/web/api.js +5 -2
- package/dist/commonjs/web/api.js.map +1 -1
- package/dist/module/compiler/declarations.js +50 -0
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/lightningcss-loader.js +12 -2
- package/dist/module/compiler/lightningcss-loader.js.map +1 -1
- package/dist/module/compiler/supports.js +3 -1
- package/dist/module/compiler/supports.js.map +1 -1
- package/dist/module/components/ActivityIndicator.js +3 -2
- package/dist/module/components/ActivityIndicator.js.map +1 -1
- package/dist/module/components/Button.js +3 -2
- package/dist/module/components/Button.js.map +1 -1
- package/dist/module/components/FlatList.js +3 -2
- package/dist/module/components/FlatList.js.map +1 -1
- package/dist/module/components/Image.js +3 -2
- package/dist/module/components/Image.js.map +1 -1
- package/dist/module/components/ImageBackground.js +3 -2
- package/dist/module/components/ImageBackground.js.map +1 -1
- package/dist/module/components/KeyboardAvoidingView.js +3 -2
- package/dist/module/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/module/components/Pressable.js +3 -2
- package/dist/module/components/Pressable.js.map +1 -1
- package/dist/module/components/ScrollView.js +3 -2
- package/dist/module/components/ScrollView.js.map +1 -1
- package/dist/module/components/Switch.js +3 -2
- package/dist/module/components/Switch.js.map +1 -1
- package/dist/module/components/Text.js +3 -2
- package/dist/module/components/Text.js.map +1 -1
- package/dist/module/components/TextInput.js +3 -2
- package/dist/module/components/TextInput.js.map +1 -1
- package/dist/module/components/TouchableHighlight.js +3 -2
- package/dist/module/components/TouchableHighlight.js.map +1 -1
- package/dist/module/components/TouchableOpacity.js +3 -2
- package/dist/module/components/TouchableOpacity.js.map +1 -1
- package/dist/module/components/TouchableWithoutFeedback.js +3 -2
- package/dist/module/components/TouchableWithoutFeedback.js.map +1 -1
- package/dist/module/components/View.js +3 -2
- package/dist/module/components/View.js.map +1 -1
- package/dist/module/components/VirtualizedList.js +3 -2
- package/dist/module/components/VirtualizedList.js.map +1 -1
- package/dist/module/components/copyComponentProperties.js +15 -0
- package/dist/module/components/copyComponentProperties.js.map +1 -0
- package/dist/module/components/index.cjs +3 -3
- package/dist/module/components/index.cjs.map +1 -1
- package/dist/module/metro/resolver.js +5 -3
- package/dist/module/metro/resolver.js.map +1 -1
- package/dist/module/native/api.js +4 -1
- package/dist/module/native/api.js.map +1 -1
- package/dist/module/native/react/useNativeCss.js +11 -5
- package/dist/module/native/react/useNativeCss.js.map +1 -1
- package/dist/module/native/styles/functions/color-mix.js +45 -0
- package/dist/module/native/styles/functions/color-mix.js.map +1 -0
- package/dist/module/native/styles/functions/index.js +1 -0
- package/dist/module/native/styles/functions/index.js.map +1 -1
- package/dist/module/native/styles/index.js +50 -7
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/web/api.js +5 -2
- package/dist/module/web/api.js.map +1 -1
- package/dist/typescript/commonjs/.config/eslint.config.d.mts +1 -1
- package/dist/typescript/commonjs/example/src/App.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +1 -0
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Button.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/FlatList.d.ts +2 -2
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Image.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Pressable.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/Pressable.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ScrollView.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/ScrollView.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Switch.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Text.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TextInput.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/View.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/View.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts +2 -2
- package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts +5 -0
- package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/api.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts +3 -0
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts +1 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/api.d.ts +2 -2
- package/dist/typescript/commonjs/src/web/api.d.ts.map +1 -1
- package/dist/typescript/module/.config/eslint.config.d.mts +1 -1
- package/dist/typescript/module/example/src/App.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +1 -0
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts +2 -4
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Button.d.ts +2 -4
- package/dist/typescript/module/src/components/Button.d.ts.map +1 -1
- package/dist/typescript/module/src/components/FlatList.d.ts +2 -2
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Image.d.ts +2 -4
- package/dist/typescript/module/src/components/Image.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ImageBackground.d.ts +2 -4
- package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts +2 -4
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Pressable.d.ts +2 -4
- package/dist/typescript/module/src/components/Pressable.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ScrollView.d.ts +2 -4
- package/dist/typescript/module/src/components/ScrollView.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Switch.d.ts +2 -6
- package/dist/typescript/module/src/components/Switch.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Text.d.ts +2 -6
- package/dist/typescript/module/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TextInput.d.ts +2 -4
- package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableHighlight.d.ts +2 -4
- package/dist/typescript/module/src/components/TouchableHighlight.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableOpacity.d.ts +2 -4
- package/dist/typescript/module/src/components/TouchableOpacity.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts +2 -4
- package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts.map +1 -1
- package/dist/typescript/module/src/components/View.d.ts +2 -6
- package/dist/typescript/module/src/components/View.d.ts.map +1 -1
- package/dist/typescript/module/src/components/VirtualizedList.d.ts +2 -2
- package/dist/typescript/module/src/components/VirtualizedList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/copyComponentProperties.d.ts +5 -0
- package/dist/typescript/module/src/components/copyComponentProperties.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/module/src/native/api.d.ts +1 -1
- package/dist/typescript/module/src/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts +3 -0
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/functions/index.d.ts +1 -0
- package/dist/typescript/module/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts +1 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/module/src/web/api.d.ts +2 -2
- package/dist/typescript/module/src/web/api.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/compiler/declarations.ts +96 -0
- package/src/compiler/lightningcss-loader.ts +20 -1
- package/src/compiler/supports.ts +2 -0
- package/src/components/ActivityIndicator.tsx +8 -5
- package/src/components/Button.tsx +8 -3
- package/src/components/FlatList.tsx +13 -4
- package/src/components/Image.tsx +8 -3
- package/src/components/ImageBackground.tsx +8 -5
- package/src/components/KeyboardAvoidingView.tsx +8 -5
- package/src/components/Pressable.tsx +8 -3
- package/src/components/ScrollView.tsx +8 -5
- package/src/components/Switch.tsx +8 -3
- package/src/components/Text.tsx +8 -3
- package/src/components/TextInput.tsx +8 -3
- package/src/components/TouchableHighlight.tsx +8 -5
- package/src/components/TouchableOpacity.tsx +8 -5
- package/src/components/TouchableWithoutFeedback.tsx +8 -5
- package/src/components/View.tsx +8 -3
- package/src/components/VirtualizedList.tsx +17 -5
- package/src/components/copyComponentProperties.ts +21 -0
- package/src/components/index.cts +3 -3
- package/src/metro/resolver.ts +10 -3
- package/src/native/api.tsx +6 -2
- package/src/native/react/useNativeCss.ts +13 -6
- package/src/native/styles/functions/color-mix.ts +68 -0
- package/src/native/styles/functions/index.ts +1 -0
- package/src/native/styles/index.ts +72 -9
- package/src/utilities/dot-notation.types.ts +10 -3
- package/src/web/api.tsx +9 -4
- package/types.d.ts +3 -0
|
@@ -1228,6 +1228,8 @@ export function parseUnparsed(
|
|
|
1228
1228
|
builder,
|
|
1229
1229
|
property,
|
|
1230
1230
|
);
|
|
1231
|
+
case "color-mix":
|
|
1232
|
+
return parseColorMix(tokenOrValue.value.arguments, builder, property);
|
|
1231
1233
|
default: {
|
|
1232
1234
|
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
1233
1235
|
return;
|
|
@@ -2633,6 +2635,100 @@ export function parseCalcFn(
|
|
|
2633
2635
|
return;
|
|
2634
2636
|
}
|
|
2635
2637
|
|
|
2638
|
+
export function parseColorMix(
|
|
2639
|
+
tokens: TokenOrValue[],
|
|
2640
|
+
builder: StylesheetBuilder,
|
|
2641
|
+
property: string,
|
|
2642
|
+
): StyleDescriptor {
|
|
2643
|
+
const [inToken, whitespace, colorSpace, comma, ...rest] = tokens;
|
|
2644
|
+
if (
|
|
2645
|
+
typeof inToken !== "object" ||
|
|
2646
|
+
inToken.type !== "token" ||
|
|
2647
|
+
inToken.value.type !== "ident" ||
|
|
2648
|
+
inToken.value.value !== "in"
|
|
2649
|
+
) {
|
|
2650
|
+
return;
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
if (
|
|
2654
|
+
typeof whitespace !== "object" ||
|
|
2655
|
+
whitespace.type !== "token" ||
|
|
2656
|
+
whitespace.value.type !== "white-space"
|
|
2657
|
+
) {
|
|
2658
|
+
return;
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
if (
|
|
2662
|
+
typeof comma !== "object" ||
|
|
2663
|
+
comma.type !== "token" ||
|
|
2664
|
+
comma.value.type !== "comma"
|
|
2665
|
+
) {
|
|
2666
|
+
return;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
const colorSpaceArg = parseUnparsed(colorSpace, builder, property);
|
|
2670
|
+
if (typeof colorSpaceArg !== "string") {
|
|
2671
|
+
return;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
let nextToken = rest.shift();
|
|
2675
|
+
|
|
2676
|
+
const leftColorArg = parseUnparsed(nextToken, builder, property);
|
|
2677
|
+
|
|
2678
|
+
if (!leftColorArg) {
|
|
2679
|
+
return;
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
nextToken = rest.shift();
|
|
2683
|
+
|
|
2684
|
+
let leftColorPercentage: StyleDescriptor | undefined;
|
|
2685
|
+
if (nextToken?.type !== "token" || nextToken.value.type !== "comma") {
|
|
2686
|
+
leftColorPercentage = parseUnparsed(nextToken, builder, property);
|
|
2687
|
+
nextToken = rest.shift();
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
if (
|
|
2691
|
+
typeof nextToken !== "object" ||
|
|
2692
|
+
nextToken.type !== "token" ||
|
|
2693
|
+
nextToken.value.type !== "comma"
|
|
2694
|
+
) {
|
|
2695
|
+
return;
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
nextToken = rest.shift();
|
|
2699
|
+
|
|
2700
|
+
const rightColorArg = parseUnparsed(nextToken, builder, property);
|
|
2701
|
+
|
|
2702
|
+
if (rightColorArg === "transparent") {
|
|
2703
|
+
// Ignore the rest, treat as single color with alpha
|
|
2704
|
+
return [{}, "colorMix", [colorSpaceArg, leftColorArg, leftColorPercentage]];
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
nextToken = rest.shift();
|
|
2708
|
+
let rightColorPercentage: StyleDescriptor | undefined;
|
|
2709
|
+
if (nextToken?.type !== "token" || nextToken.value.type !== "comma") {
|
|
2710
|
+
rightColorPercentage = parseUnparsed(nextToken, builder, property);
|
|
2711
|
+
nextToken = rest.shift();
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
// We should have expired all tokens now
|
|
2715
|
+
if (nextToken) {
|
|
2716
|
+
return;
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
return [
|
|
2720
|
+
{},
|
|
2721
|
+
"colorMix",
|
|
2722
|
+
[
|
|
2723
|
+
colorSpaceArg,
|
|
2724
|
+
leftColorArg,
|
|
2725
|
+
leftColorPercentage,
|
|
2726
|
+
rightColorArg,
|
|
2727
|
+
rightColorPercentage,
|
|
2728
|
+
],
|
|
2729
|
+
];
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2636
2732
|
export function parseCalcArguments(
|
|
2637
2733
|
[...args]: TokenOrValue[],
|
|
2638
2734
|
builder: StylesheetBuilder,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
1
2
|
export function lightningcssLoader() {
|
|
2
3
|
let lightningcssPath: string | undefined;
|
|
3
4
|
|
|
@@ -28,11 +29,29 @@ export function lightningcssLoader() {
|
|
|
28
29
|
);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
32
32
|
const { transform: lightningcss, Features } = require(
|
|
33
33
|
lightningcssPath,
|
|
34
34
|
) as typeof import("lightningcss");
|
|
35
35
|
|
|
36
|
+
try {
|
|
37
|
+
const lightningcssPackageJSONPath = require.resolve("../../package.json", {
|
|
38
|
+
paths: [lightningcssPath],
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const packageJSON = require(lightningcssPackageJSONPath) as Record<
|
|
42
|
+
string,
|
|
43
|
+
unknown
|
|
44
|
+
>;
|
|
45
|
+
|
|
46
|
+
if (packageJSON.version === "1.30.2") {
|
|
47
|
+
throw new Error(
|
|
48
|
+
"[react-native-css] lightningcss version 1.30.2 has a critical bug that breaks compilation. Please pin the version of lightningcss to 1.30.1; or try upgrading.",
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
} catch {
|
|
52
|
+
// Intentionally left empty
|
|
53
|
+
}
|
|
54
|
+
|
|
36
55
|
return {
|
|
37
56
|
lightningcss,
|
|
38
57
|
Features,
|
package/src/compiler/supports.ts
CHANGED
|
@@ -23,4 +23,6 @@ export function supportsConditionValid(condition: SupportsCondition): boolean {
|
|
|
23
23
|
const declarations: Record<string, string[]> = {
|
|
24
24
|
// We don't actually support this, but its needed for Tailwind CSS
|
|
25
25
|
"-moz-orient": ["inline"],
|
|
26
|
+
// Special text used by TailwindCSS. We should probably change this to all color-mix
|
|
27
|
+
"color": ["color-mix(in lab, red, red)"],
|
|
26
28
|
};
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
type StyledProps,
|
|
10
10
|
} from "react-native-css";
|
|
11
11
|
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
12
14
|
const mapping: StyledConfiguration<typeof RNActivityIndicator> = {
|
|
13
15
|
className: {
|
|
14
16
|
target: "style",
|
|
@@ -18,10 +20,11 @@ const mapping: StyledConfiguration<typeof RNActivityIndicator> = {
|
|
|
18
20
|
},
|
|
19
21
|
};
|
|
20
22
|
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
) {
|
|
24
|
-
|
|
25
|
-
}
|
|
23
|
+
export const ActivityIndicator = copyComponentProperties(
|
|
24
|
+
RNActivityIndicator,
|
|
25
|
+
(props: StyledProps<ActivityIndicatorProps, typeof mapping>) => {
|
|
26
|
+
return useCssElement(RNActivityIndicator, props, mapping);
|
|
27
|
+
},
|
|
28
|
+
);
|
|
26
29
|
|
|
27
30
|
export default ActivityIndicator;
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
type StyledProps,
|
|
7
7
|
} from "react-native-css";
|
|
8
8
|
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
9
11
|
const mapping: StyledConfiguration<typeof RNButton> = {
|
|
10
12
|
className: {
|
|
11
13
|
target: false,
|
|
@@ -15,8 +17,11 @@ const mapping: StyledConfiguration<typeof RNButton> = {
|
|
|
15
17
|
},
|
|
16
18
|
};
|
|
17
19
|
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
export const Button = copyComponentProperties(
|
|
21
|
+
RNButton,
|
|
22
|
+
(props: StyledProps<ButtonProps, typeof mapping>) => {
|
|
23
|
+
return useCssElement(RNButton, props, mapping);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
21
26
|
|
|
22
27
|
export default Button;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import { FlatList as RNFlatList, type FlatListProps } from "react-native";
|
|
2
3
|
|
|
3
4
|
import {
|
|
@@ -6,6 +7,8 @@ import {
|
|
|
6
7
|
type StyledProps,
|
|
7
8
|
} from "react-native-css";
|
|
8
9
|
|
|
10
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
11
|
+
|
|
9
12
|
const mapping: StyledConfiguration<typeof RNFlatList> = {
|
|
10
13
|
ListFooterComponentClassName: "ListFooterComponentStyle",
|
|
11
14
|
ListHeaderComponentClassName: "ListHeaderComponentStyle",
|
|
@@ -13,10 +16,16 @@ const mapping: StyledConfiguration<typeof RNFlatList> = {
|
|
|
13
16
|
contentContainerClassName: "contentContainerStyle",
|
|
14
17
|
};
|
|
15
18
|
|
|
16
|
-
export function
|
|
17
|
-
|
|
18
|
-
) {
|
|
19
|
+
export const FlatList = copyComponentProperties(RNFlatList, function <
|
|
20
|
+
ItemT,
|
|
21
|
+
>(props: StyledProps<FlatListProps<ItemT>, typeof mapping>) {
|
|
19
22
|
return useCssElement(RNFlatList, props, mapping);
|
|
20
|
-
}
|
|
23
|
+
}) as unknown as typeof RNFlatList &
|
|
24
|
+
(<ItemT>(
|
|
25
|
+
props: StyledProps<
|
|
26
|
+
FlatListProps<ItemT>,
|
|
27
|
+
StyledConfiguration<typeof RNFlatList>
|
|
28
|
+
>,
|
|
29
|
+
) => ReactNode);
|
|
21
30
|
|
|
22
31
|
export default FlatList;
|
package/src/components/Image.tsx
CHANGED
|
@@ -6,12 +6,17 @@ import {
|
|
|
6
6
|
type StyledProps,
|
|
7
7
|
} from "react-native-css";
|
|
8
8
|
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
9
11
|
const mapping: StyledConfiguration<typeof RNImage> = {
|
|
10
12
|
className: "style",
|
|
11
13
|
};
|
|
12
14
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const Image = copyComponentProperties(
|
|
16
|
+
RNImage,
|
|
17
|
+
(props: StyledProps<ImageProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNImage, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
16
21
|
|
|
17
22
|
export default Image;
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
type StyledProps,
|
|
10
10
|
} from "react-native-css";
|
|
11
11
|
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
12
14
|
const mapping: StyledConfiguration<typeof RNImageBackground> = {
|
|
13
15
|
className: {
|
|
14
16
|
target: "style",
|
|
@@ -18,10 +20,11 @@ const mapping: StyledConfiguration<typeof RNImageBackground> = {
|
|
|
18
20
|
},
|
|
19
21
|
};
|
|
20
22
|
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
) {
|
|
24
|
-
|
|
25
|
-
}
|
|
23
|
+
export const ImageBackground = copyComponentProperties(
|
|
24
|
+
RNImageBackground,
|
|
25
|
+
(props: StyledProps<ImageBackgroundProps, typeof mapping>) => {
|
|
26
|
+
return useCssElement(RNImageBackground, props, mapping);
|
|
27
|
+
},
|
|
28
|
+
);
|
|
26
29
|
|
|
27
30
|
export default ImageBackground;
|
|
@@ -9,16 +9,19 @@ import {
|
|
|
9
9
|
type StyledProps,
|
|
10
10
|
} from "react-native-css";
|
|
11
11
|
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
12
14
|
const mapping: StyledConfiguration<typeof RNKeyboardAvoidingView> = {
|
|
13
15
|
className: {
|
|
14
16
|
target: "style",
|
|
15
17
|
},
|
|
16
18
|
};
|
|
17
19
|
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
) {
|
|
21
|
-
|
|
22
|
-
}
|
|
20
|
+
export const KeyboardAvoidingView = copyComponentProperties(
|
|
21
|
+
RNKeyboardAvoidingView,
|
|
22
|
+
(props: StyledProps<KeyboardAvoidingViewProps, typeof mapping>) => {
|
|
23
|
+
return useCssElement(RNKeyboardAvoidingView, props, mapping);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
23
26
|
|
|
24
27
|
export default KeyboardAvoidingView;
|
|
@@ -6,12 +6,17 @@ import {
|
|
|
6
6
|
type StyledProps,
|
|
7
7
|
} from "react-native-css";
|
|
8
8
|
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
9
11
|
const mapping: StyledConfiguration<typeof RNPressable> = {
|
|
10
12
|
className: "style",
|
|
11
13
|
};
|
|
12
14
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const Pressable = copyComponentProperties(
|
|
16
|
+
RNPressable,
|
|
17
|
+
(props: StyledProps<PressableProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNPressable, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
16
21
|
|
|
17
22
|
export default Pressable;
|
|
@@ -6,15 +6,18 @@ import {
|
|
|
6
6
|
type StyledProps,
|
|
7
7
|
} from "react-native-css";
|
|
8
8
|
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
9
11
|
const mapping: StyledConfiguration<typeof RNScrollView> = {
|
|
10
12
|
className: "style",
|
|
11
13
|
contentContainerClassName: "contentContainerStyle",
|
|
12
14
|
};
|
|
13
15
|
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
) {
|
|
17
|
-
|
|
18
|
-
}
|
|
16
|
+
export const ScrollView = copyComponentProperties(
|
|
17
|
+
RNScrollView,
|
|
18
|
+
(props: StyledProps<ScrollViewProps, typeof mapping>) => {
|
|
19
|
+
return useCssElement(RNScrollView, props, mapping);
|
|
20
|
+
},
|
|
21
|
+
);
|
|
19
22
|
|
|
20
23
|
export default ScrollView;
|
|
@@ -6,12 +6,17 @@ import {
|
|
|
6
6
|
type StyledProps,
|
|
7
7
|
} from "react-native-css";
|
|
8
8
|
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
9
11
|
const mapping = {
|
|
10
12
|
className: "style",
|
|
11
13
|
} satisfies StyledConfiguration<typeof RNSwitch>;
|
|
12
14
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const Switch = copyComponentProperties(
|
|
16
|
+
RNSwitch,
|
|
17
|
+
(props: StyledProps<SwitchProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNSwitch, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
16
21
|
|
|
17
22
|
export default Switch;
|
package/src/components/Text.tsx
CHANGED
|
@@ -6,12 +6,17 @@ import {
|
|
|
6
6
|
type StyledProps,
|
|
7
7
|
} from "react-native-css";
|
|
8
8
|
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
9
11
|
const mapping = {
|
|
10
12
|
className: "style",
|
|
11
13
|
} satisfies StyledConfiguration<typeof RNText>;
|
|
12
14
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const Text = copyComponentProperties(
|
|
16
|
+
RNText,
|
|
17
|
+
(props: StyledProps<TextProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNText, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
16
21
|
|
|
17
22
|
export default Text;
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
type StyledProps,
|
|
7
7
|
} from "react-native-css";
|
|
8
8
|
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
9
11
|
const mapping: StyledConfiguration<typeof RNTextInput> = {
|
|
10
12
|
className: {
|
|
11
13
|
target: "style",
|
|
@@ -15,8 +17,11 @@ const mapping: StyledConfiguration<typeof RNTextInput> = {
|
|
|
15
17
|
},
|
|
16
18
|
};
|
|
17
19
|
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
export const TextInput = copyComponentProperties(
|
|
21
|
+
RNTextInput,
|
|
22
|
+
(props: StyledProps<TextInputProps, typeof mapping>) => {
|
|
23
|
+
return useCssElement(RNTextInput, props, mapping);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
21
26
|
|
|
22
27
|
export default TextInput;
|
|
@@ -9,14 +9,17 @@ import {
|
|
|
9
9
|
type StyledProps,
|
|
10
10
|
} from "react-native-css";
|
|
11
11
|
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
12
14
|
const mapping: StyledConfiguration<typeof RNTouchableHighlight> = {
|
|
13
15
|
className: "style",
|
|
14
16
|
};
|
|
15
17
|
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
) {
|
|
19
|
-
|
|
20
|
-
}
|
|
18
|
+
export const TouchableHighlight = copyComponentProperties(
|
|
19
|
+
RNTouchableHighlight,
|
|
20
|
+
(props: StyledProps<TouchableHighlightProps, typeof mapping>) => {
|
|
21
|
+
return useCssElement(RNTouchableHighlight, props, mapping);
|
|
22
|
+
},
|
|
23
|
+
);
|
|
21
24
|
|
|
22
25
|
export default TouchableHighlight;
|
|
@@ -9,14 +9,17 @@ import {
|
|
|
9
9
|
type StyledProps,
|
|
10
10
|
} from "react-native-css";
|
|
11
11
|
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
12
14
|
const mapping: StyledConfiguration<typeof RNTouchableOpacity> = {
|
|
13
15
|
className: "style",
|
|
14
16
|
};
|
|
15
17
|
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
) {
|
|
19
|
-
|
|
20
|
-
}
|
|
18
|
+
export const TouchableOpacity = copyComponentProperties(
|
|
19
|
+
RNTouchableOpacity,
|
|
20
|
+
(props: StyledProps<TouchableOpacityProps, typeof mapping>) => {
|
|
21
|
+
return useCssElement(RNTouchableOpacity, props, mapping);
|
|
22
|
+
},
|
|
23
|
+
);
|
|
21
24
|
|
|
22
25
|
export default TouchableOpacity;
|
|
@@ -9,14 +9,17 @@ import {
|
|
|
9
9
|
type StyledProps,
|
|
10
10
|
} from "react-native-css";
|
|
11
11
|
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
12
14
|
const mapping: StyledConfiguration<typeof RNTouchableWithoutFeedback> = {
|
|
13
15
|
className: "style",
|
|
14
16
|
};
|
|
15
17
|
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
) {
|
|
19
|
-
|
|
20
|
-
}
|
|
18
|
+
export const TouchableWithoutFeedback = copyComponentProperties(
|
|
19
|
+
RNTouchableWithoutFeedback,
|
|
20
|
+
(props: StyledProps<TouchableWithoutFeedbackProps, typeof mapping>) => {
|
|
21
|
+
return useCssElement(RNTouchableWithoutFeedback, props, mapping);
|
|
22
|
+
},
|
|
23
|
+
);
|
|
21
24
|
|
|
22
25
|
export default TouchableWithoutFeedback;
|
package/src/components/View.tsx
CHANGED
|
@@ -6,12 +6,17 @@ import {
|
|
|
6
6
|
type StyledProps,
|
|
7
7
|
} from "react-native-css";
|
|
8
8
|
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
9
11
|
const mapping = {
|
|
10
12
|
className: "style",
|
|
11
13
|
} satisfies StyledConfiguration<typeof RNView>;
|
|
12
14
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const View = copyComponentProperties(
|
|
16
|
+
RNView,
|
|
17
|
+
(props: StyledProps<ViewProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNView, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
16
21
|
|
|
17
22
|
export default View;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import {
|
|
2
3
|
VirtualizedList as RNVirtualizedList,
|
|
3
4
|
type VirtualizedListProps,
|
|
@@ -9,6 +10,8 @@ import {
|
|
|
9
10
|
type StyledProps,
|
|
10
11
|
} from "react-native-css";
|
|
11
12
|
|
|
13
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
14
|
+
|
|
12
15
|
const mapping: StyledConfiguration<typeof RNVirtualizedList> = {
|
|
13
16
|
className: "style",
|
|
14
17
|
ListFooterComponentClassName: "ListFooterComponentStyle",
|
|
@@ -16,10 +19,19 @@ const mapping: StyledConfiguration<typeof RNVirtualizedList> = {
|
|
|
16
19
|
contentContainerClassName: "contentContainerStyle",
|
|
17
20
|
};
|
|
18
21
|
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
export const VirtualizedList = copyComponentProperties(
|
|
23
|
+
RNVirtualizedList,
|
|
24
|
+
function <ItemT>(
|
|
25
|
+
props: StyledProps<VirtualizedListProps<ItemT>, typeof mapping>,
|
|
26
|
+
) {
|
|
27
|
+
return useCssElement(RNVirtualizedList, props, mapping);
|
|
28
|
+
},
|
|
29
|
+
) as unknown as typeof RNVirtualizedList &
|
|
30
|
+
(<ItemT>(
|
|
31
|
+
props: StyledProps<
|
|
32
|
+
VirtualizedListProps<ItemT>,
|
|
33
|
+
StyledConfiguration<typeof RNVirtualizedList>
|
|
34
|
+
>,
|
|
35
|
+
) => ReactNode);
|
|
24
36
|
|
|
25
37
|
export default VirtualizedList;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
type AnyComponent = ComponentType<any>;
|
|
5
|
+
|
|
6
|
+
export function copyComponentProperties<T extends AnyComponent>(
|
|
7
|
+
BaseComponent: T,
|
|
8
|
+
Component: AnyComponent,
|
|
9
|
+
) {
|
|
10
|
+
for (const [key, value] of Object.entries(BaseComponent)) {
|
|
11
|
+
if (key === "$$typeof" || key === "render" || key === "contextType") {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
(Component as unknown as Record<string, unknown>)[key] = value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Component.displayName = BaseComponent.displayName;
|
|
19
|
+
|
|
20
|
+
return Component as unknown as T;
|
|
21
|
+
}
|
package/src/components/index.cts
CHANGED
|
@@ -25,6 +25,9 @@ module.exports = {
|
|
|
25
25
|
get Pressable() {
|
|
26
26
|
return require("./Pressable").Pressable;
|
|
27
27
|
},
|
|
28
|
+
get ScrollView() {
|
|
29
|
+
return require("./ScrollView").ScrollView;
|
|
30
|
+
},
|
|
28
31
|
get Switch() {
|
|
29
32
|
return require("./Switch").Switch;
|
|
30
33
|
},
|
|
@@ -71,9 +74,6 @@ module.exports = {
|
|
|
71
74
|
get SafeAreaView() {
|
|
72
75
|
return require("react-native").SafeAreaView;
|
|
73
76
|
},
|
|
74
|
-
get ScrollView() {
|
|
75
|
-
return require("react-native").ScrollView;
|
|
76
|
-
},
|
|
77
77
|
get SectionList() {
|
|
78
78
|
return require("react-native").SectionList;
|
|
79
79
|
},
|
package/src/metro/resolver.ts
CHANGED
|
@@ -26,7 +26,7 @@ export function nativeResolver(
|
|
|
26
26
|
const resolution = resolver(context, moduleName, platform);
|
|
27
27
|
const isInternal = isFromThisModule(context.originModulePath);
|
|
28
28
|
const isReactNativeIndex = context.originModulePath.endsWith(
|
|
29
|
-
|
|
29
|
+
`${sep}react-native${sep}index.js`,
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
if (isInternal || resolution.type !== "sourceFile" || isReactNativeIndex) {
|
|
@@ -73,7 +73,9 @@ export function webResolver(
|
|
|
73
73
|
// Only operate on source files
|
|
74
74
|
resolution.type !== "sourceFile" ||
|
|
75
75
|
// Skip anything that isn't importing from `react-native-web`
|
|
76
|
-
!resolution.filePath.includes(`${sep}react-native-web${sep}`)
|
|
76
|
+
!resolution.filePath.includes(`${sep}react-native-web${sep}`) ||
|
|
77
|
+
// Skip internal react-native-web files
|
|
78
|
+
resolution.filePath.includes(`${sep}react-native-web${sep}dist${sep}vendor`)
|
|
77
79
|
) {
|
|
78
80
|
return resolution;
|
|
79
81
|
}
|
|
@@ -83,7 +85,12 @@ export function webResolver(
|
|
|
83
85
|
const isIndex = segments.at(-1)?.startsWith("index.");
|
|
84
86
|
const module = segments.at(-2);
|
|
85
87
|
|
|
86
|
-
if (
|
|
88
|
+
if (
|
|
89
|
+
!isIndex ||
|
|
90
|
+
!module ||
|
|
91
|
+
!allowedModules.has(module) ||
|
|
92
|
+
module === "VirtualizedList"
|
|
93
|
+
) {
|
|
87
94
|
return resolution;
|
|
88
95
|
}
|
|
89
96
|
|
package/src/native/api.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import { useContext, useState } from "react";
|
|
2
|
+
import { useContext, useState, type ComponentType } from "react";
|
|
3
3
|
import { Appearance } from "react-native";
|
|
4
4
|
|
|
5
5
|
import type { StyleDescriptor } from "react-native-css/compiler";
|
|
@@ -30,6 +30,10 @@ export {
|
|
|
30
30
|
|
|
31
31
|
export { useNativeCss };
|
|
32
32
|
|
|
33
|
+
const defaultMapping: StyledConfiguration<ComponentType<{ style: unknown }>> = {
|
|
34
|
+
className: "style",
|
|
35
|
+
};
|
|
36
|
+
|
|
33
37
|
/**
|
|
34
38
|
* Generates a new Higher-Order component the wraps the base component and applies the styles.
|
|
35
39
|
* This is added to the `interopComponents` map so that it can be used in the `wrapJSX` function
|
|
@@ -41,7 +45,7 @@ export const styled = <
|
|
|
41
45
|
const M extends StyledConfiguration<C>,
|
|
42
46
|
>(
|
|
43
47
|
baseComponent: C,
|
|
44
|
-
mapping: M,
|
|
48
|
+
mapping: M = defaultMapping as M,
|
|
45
49
|
options?: StyledOptions,
|
|
46
50
|
) => {
|
|
47
51
|
let component: any;
|