Skip to content

Commit 78fd38d

Browse files
authored
Merge pull request #93 from dev-five-git/fix-theme-typing
Fix theme typing issue and update dependencies to version 0.48.2
2 parents c002b73 + 96cd069 commit 78fd38d

File tree

6 files changed

+62
-56
lines changed

6 files changed

+62
-56
lines changed

.changeset/long-laws-shout.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 flexGrow to Maintain prop

.changeset/polite-humans-wash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@devup-ui/react": patch
3+
---
4+
5+
Fix theme typing issue

Cargo.lock

Lines changed: 31 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/extractor/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
oxc_parser = "0.48.1"
8-
oxc_syntax = "0.48.1"
9-
oxc_span = "0.48.1"
10-
oxc_allocator = "0.48.1"
11-
oxc_ast = "0.48.1"
12-
oxc_codegen = "0.48.1"
7+
oxc_parser = "0.48.2"
8+
oxc_syntax = "0.48.2"
9+
oxc_span = "0.48.2"
10+
oxc_allocator = "0.48.2"
11+
oxc_ast = "0.48.2"
12+
oxc_codegen = "0.48.2"
1313
css = { path = "../css" }
1414
once_cell = "1.20.2"
1515

libs/extractor/src/extract_style/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static MAINTAIN_VALUE_PROPERTIES: Lazy<HashSet<String>> = Lazy::new(|| {
2828
set.insert("fontWeight".to_string());
2929
set.insert("scale".to_string());
3030
set.insert("aspectRatio".to_string());
31+
set.insert("flexGrow".to_string());
3132
set
3233
});
3334

@@ -98,7 +99,14 @@ impl ExtractStyleProperty for ExtractStaticStyle {
9899
StyleProperty::ClassName(sheet_to_classname(
99100
self.property.as_str(),
100101
self.level,
101-
Some(convert_value(self.value.as_str()).as_str()),
102+
Some(
103+
if MAINTAIN_VALUE_PROPERTIES.contains(self.property.as_str()) {
104+
self.value.to_string()
105+
} else {
106+
convert_value(self.value.as_str())
107+
}
108+
.as_str(),
109+
),
102110
s.as_deref(),
103111
))
104112
}

packages/react/src/types/props/selector/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ type toPascalCase<S extends string> = S extends `${infer T}${infer U}`
55
? `${Uppercase<T>}${U}`
66
: S
77

8-
export type DevupThemeSelectorProps = {
9-
[K in keyof DevupTheme as `_theme${toPascalCase<K>}`]?: DevupCommonProps &
10-
DevupSelectorProps
11-
}
8+
export type DevupThemeSelectorProps = keyof DevupTheme extends undefined
9+
? Record<`_theme${string}`, DevupCommonProps & DevupSelectorProps>
10+
: {
11+
[K in keyof DevupTheme as `_theme${toPascalCase<K>}`]?: DevupCommonProps &
12+
DevupSelectorProps
13+
}
1214

1315
export interface DevupSelectorProps {
1416
_active?: DevupCommonProps

0 commit comments

Comments
 (0)