Skip to content

Commit 580e888

Browse files
authored
Merge pull request #115 from dev-five-git/call-case
Add call case
2 parents 87f4f0c + e708e4c commit 580e888

File tree

8 files changed

+392
-286
lines changed

8 files changed

+392
-286
lines changed

.changeset/fluffy-cups-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@devup-ui/wasm": patch
3+
---
4+
5+
Add call case

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ tsconfig.tsbuildinfo
1212
codecov
1313
codecov.*
1414
codecov.*.*
15+
lcov.info
16+
tarpaulin-report.html

apps/landing/src/app/(detail)/team/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function TeamLayout({
77
}>) {
88
return (
99
<>
10-
<Box minH="calc(100vh - 500px)" mx="auto" p="40px 60px" w="1014px">
10+
<Box maxW="1014px" minH="calc(100vh - 500px)" mx="auto" p="40px 60px">
1111
{children}
1212
</Box>
1313
</>

libs/css/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,4 +731,13 @@ mod tests {
731731
":root[data-theme=dark] .cls:hover"
732732
);
733733
}
734+
735+
#[test]
736+
#[serial]
737+
fn test_set_class_map() {
738+
let mut map = HashMap::new();
739+
map.insert("background-0-rgba(255,0,0,0.5)-".to_string(), 1);
740+
set_class_map(map);
741+
assert_eq!(get_class_map().len(), 1);
742+
}
734743
}

libs/extractor/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,19 @@ mod tests {
492492
"test.tsx",
493493
r#"import { Box } from "@devup-ui/core";
494494
<Box padding={someStyleVar} margin={someStyleVar2} />;
495+
"#,
496+
ExtractOption {
497+
package: "@devup-ui/core".to_string(),
498+
css_file: None
499+
}
500+
)
501+
.unwrap());
502+
503+
reset_class_map();
504+
assert_debug_snapshot!(extract(
505+
"test.tsx",
506+
r#"import { Box } from "@devup-ui/core";
507+
<Box padding={Math.abs(5)} />;
495508
"#,
496509
ExtractOption {
497510
package: "@devup-ui/core".to_string(),
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
source: libs/extractor/src/lib.rs
3+
expression: "extract(\"test.tsx\",\nr#\"import { Box } from \"@devup-ui/core\";\n<Box padding={Math.abs(5)} />;\n\"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap()"
4+
---
5+
ExtractOutput {
6+
styles: [
7+
Dynamic(
8+
ExtractDynamicStyle {
9+
property: "padding",
10+
level: 0,
11+
identifier: "Math.abs(5)",
12+
selector: None,
13+
},
14+
),
15+
],
16+
code: "import \"@devup-ui/core/devup-ui.css\";\n<div className=\"d0\" style={{ \"--d1\": Math.abs(5) }} />;\n",
17+
}

0 commit comments

Comments
 (0)