Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fluffy-cups-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@devup-ui/wasm": patch
---

Add call case
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ tsconfig.tsbuildinfo
codecov
codecov.*
codecov.*.*
lcov.info
tarpaulin-report.html
2 changes: 1 addition & 1 deletion apps/landing/src/app/(detail)/team/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function TeamLayout({
}>) {
return (
<>
<Box minH="calc(100vh - 500px)" mx="auto" p="40px 60px" w="1014px">
<Box maxW="1014px" minH="calc(100vh - 500px)" mx="auto" p="40px 60px">
{children}
</Box>
</>
Expand Down
9 changes: 9 additions & 0 deletions libs/css/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,4 +731,13 @@ mod tests {
":root[data-theme=dark] .cls:hover"
);
}

#[test]
#[serial]
fn test_set_class_map() {
let mut map = HashMap::new();
map.insert("background-0-rgba(255,0,0,0.5)-".to_string(), 1);
set_class_map(map);
assert_eq!(get_class_map().len(), 1);
}
}
13 changes: 13 additions & 0 deletions libs/extractor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,19 @@ mod tests {
"test.tsx",
r#"import { Box } from "@devup-ui/core";
<Box padding={someStyleVar} margin={someStyleVar2} />;
"#,
ExtractOption {
package: "@devup-ui/core".to_string(),
css_file: None
}
)
.unwrap());

reset_class_map();
assert_debug_snapshot!(extract(
"test.tsx",
r#"import { Box } from "@devup-ui/core";
<Box padding={Math.abs(5)} />;
"#,
ExtractOption {
package: "@devup-ui/core".to_string(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
source: libs/extractor/src/lib.rs
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()"
---
ExtractOutput {
styles: [
Dynamic(
ExtractDynamicStyle {
property: "padding",
level: 0,
identifier: "Math.abs(5)",
selector: None,
},
),
],
code: "import \"@devup-ui/core/devup-ui.css\";\n<div className=\"d0\" style={{ \"--d1\": Math.abs(5) }} />;\n",
}
Loading