Skip to content

Commit 41aa78b

Browse files
committed
Add id to special prop
1 parent e00354b commit 41aa78b

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.changeset/dirty-buttons-wink.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 id to special prop

libs/extractor/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ mod tests {
158158
reset_class_map();
159159
assert_debug_snapshot!(extract(
160160
"test.tsx",
161-
r"import {Box} from '@devup-ui/core'
162-
<Box padding={1} ref={ref} data-test={1} role={2} children={[]} onClick={()=>{}} aria-valuenow={24} key={2} tabIndex={1} />
163-
",
161+
r#"import {Box} from '@devup-ui/core'
162+
<Box padding={1} ref={ref} data-test={1} role={2} children={[]} onClick={()=>{}} aria-valuenow={24} key={2} tabIndex={1} id="id" />
163+
"#,
164164
ExtractOption {
165165
package: "@devup-ui/core".to_string(),
166166
css_file: None

libs/extractor/src/snapshots/extractor__tests__ignore_special_props.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
source: libs/extractor/src/lib.rs
3-
expression: "extract(\"test.tsx\",\nr\"import {Box} from '@devup-ui/core'\n <Box padding={1} ref={ref} data-test={1} role={2} children={[]} onClick={()=>{}} aria-valuenow={24} key={2} tabIndex={1} />\n \",\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap()"
3+
expression: "extract(\"test.tsx\",\nr#\"import {Box} from '@devup-ui/core'\n <Box padding={1} ref={ref} data-test={1} role={2} children={[]} onClick={()=>{}} aria-valuenow={24} key={2} tabIndex={1} id=\"id\" />\n \"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap()"
44
---
55
ExtractOutput {
66
styles: [
@@ -14,5 +14,5 @@ ExtractOutput {
1414
},
1515
),
1616
],
17-
code: "import \"@devup-ui/core/devup-ui.css\";\n<div ref={ref} data-test={1} role={2} children={[]} onClick={() => {}} aria-valuenow={24} key={2} tabIndex={1} className=\"d0\" />;\n",
17+
code: "import \"@devup-ui/core/devup-ui.css\";\n<div ref={ref} data-test={1} role={2} children={[]} onClick={() => {}} aria-valuenow={24} key={2} tabIndex={1} id=\"id\" className=\"d0\" />;\n",
1818
}

libs/extractor/src/utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ static SPECIAL_PROPERTIES: Lazy<HashSet<&str>> = Lazy::new(|| {
3535
"role",
3636
"ref",
3737
"key",
38+
"id",
3839
"alt",
3940
"type",
4041
"src",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
source: libs/sheet/src/lib.rs
3+
expression: sheet.create_css()
4+
---
5+
".test::placeholder{background:red}.test:hover{background:red}.test:active{background:blue}"

0 commit comments

Comments
 (0)