Skip to content

Commit a7913d8

Browse files
authored
Merge pull request #505 from dev-five-git/styled
Styled
2 parents 265c083 + 060ceb3 commit a7913d8

File tree

57 files changed

+2859
-140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2859
-140
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"changes": {
3+
"bindings/devup-ui-wasm/package.json": "Patch",
4+
"packages/react/package.json": "Patch"
5+
},
6+
"note": "Implement styled",
7+
"date": "2025-12-02T15:06:28.741744300Z"
8+
}

Cargo.lock

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

apps/next/src/app/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
'use client'
22

3-
import { Box, css, Text } from '@devup-ui/react'
3+
import { Box, css, styled, Text } from '@devup-ui/react'
44
import { useState } from 'react'
5+
const color = 'yellow'
6+
7+
const StyledFooter = styled.footer<{ type: '1' | '2' }>`
8+
background-color: ${color};
9+
color: ${(props) => (props.type === '1' ? 'red' : 'white')};
10+
`
511

612
export default function HomePage() {
713
const [color, setColor] = useState('yellow')
814
const [enabled, setEnabled] = useState(false)
915

1016
return (
1117
<div>
18+
<StyledFooter type="2">IMPLEMENTATION~</StyledFooter>
1219
<p
1320
style={{
1421
backgroundColor: 'blue',

libs/extractor/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ version = "0.1.0"
44
edition = "2024"
55

66
[dependencies]
7-
oxc_parser = "0.99.0"
8-
oxc_syntax = "0.99.0"
9-
oxc_span = "0.99.0"
10-
oxc_allocator = "0.99.0"
11-
oxc_ast = "0.99.0"
12-
oxc_ast_visit = "0.99.0"
13-
oxc_codegen = "0.99.0"
7+
oxc_parser = "0.101.0"
8+
oxc_syntax = "0.101.0"
9+
oxc_span = "0.101.0"
10+
oxc_allocator = "0.101.0"
11+
oxc_ast = "0.101.0"
12+
oxc_ast_visit = "0.101.0"
13+
oxc_codegen = "0.101.0"
1414
css = { path = "../css" }
1515
phf = "0.13"
1616
strum = "0.27.2"

libs/extractor/src/component.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ pub enum ExportVariableKind {
2121

2222
impl ExportVariableKind {
2323
/// Convert the kind to a tag
24-
pub fn to_tag(&self) -> Result<&str, &str> {
24+
pub fn to_tag(&self) -> &str {
2525
match self {
2626
ExportVariableKind::Center
2727
| ExportVariableKind::VStack
2828
| ExportVariableKind::Grid
2929
| ExportVariableKind::Flex
30-
| ExportVariableKind::Box => Ok("div"),
31-
ExportVariableKind::Text => Ok("span"),
32-
ExportVariableKind::Image => Ok("img"),
33-
ExportVariableKind::Button => Ok("button"),
34-
ExportVariableKind::Input => Ok("input"),
30+
| ExportVariableKind::Box => "div",
31+
ExportVariableKind::Text => "span",
32+
ExportVariableKind::Image => "img",
33+
ExportVariableKind::Button => "button",
34+
ExportVariableKind::Input => "input",
3535
}
3636
}
3737
}
@@ -151,15 +151,15 @@ mod tests {
151151

152152
#[test]
153153
fn test_to_tag() {
154-
assert_eq!(ExportVariableKind::Box.to_tag(), Ok("div"));
155-
assert_eq!(ExportVariableKind::Text.to_tag(), Ok("span"));
156-
assert_eq!(ExportVariableKind::Image.to_tag(), Ok("img"));
157-
assert_eq!(ExportVariableKind::Button.to_tag(), Ok("button"));
158-
assert_eq!(ExportVariableKind::Input.to_tag(), Ok("input"));
159-
assert_eq!(ExportVariableKind::Flex.to_tag(), Ok("div"));
160-
assert_eq!(ExportVariableKind::VStack.to_tag(), Ok("div"));
161-
assert_eq!(ExportVariableKind::Center.to_tag(), Ok("div"));
162-
assert_eq!(ExportVariableKind::Grid.to_tag(), Ok("div"));
154+
assert_eq!(ExportVariableKind::Box.to_tag(), "div");
155+
assert_eq!(ExportVariableKind::Text.to_tag(), "span");
156+
assert_eq!(ExportVariableKind::Image.to_tag(), "img");
157+
assert_eq!(ExportVariableKind::Button.to_tag(), "button");
158+
assert_eq!(ExportVariableKind::Input.to_tag(), "input");
159+
assert_eq!(ExportVariableKind::Flex.to_tag(), "div");
160+
assert_eq!(ExportVariableKind::VStack.to_tag(), "div");
161+
assert_eq!(ExportVariableKind::Center.to_tag(), "div");
162+
assert_eq!(ExportVariableKind::Grid.to_tag(), "div");
163163
}
164164

165165
#[test]

0 commit comments

Comments
 (0)