snapshots_test__kitchen_sink_ir.snap raw
---
source: crates/guiduck-component-core/tests/snapshots_test.rs
assertion_line: 47
expression: "compile_or_render_errors(source, \"kitchen-sink.gdc\")"
---
Ir {
name: "KitchenSink",
records: [],
props: [
IrProp {
name: "title",
ty: ValueTy {
kind: Scalar(
String,
),
list: false,
},
default: None,
},
IrProp {
name: "step",
ty: ValueTy {
kind: Scalar(
I32,
),
list: false,
},
default: Some(
Int(
2,
),
),
},
IrProp {
name: "scale",
ty: ValueTy {
kind: Scalar(
F64,
),
list: false,
},
default: Some(
Float(
1.5,
),
),
},
],
outputs: [
IrOutput {
name: "changed",
ty: I32,
},
],
states: [
IrState {
name: "count",
ty: ValueTy {
kind: Scalar(
I32,
),
list: false,
},
init: Int(
0,
),
},
IrState {
name: "active",
ty: ValueTy {
kind: Scalar(
Bool,
),
list: false,
},
init: Bool(
false,
),
},
],
handlers: [
IrHandler {
name: "bump",
payloads: [],
returns: None,
},
IrHandler {
name: "toggle",
payloads: [],
returns: None,
},
],
nodes: [
IrNode {
widget: Widget(
IrWidgetNode {
name: "container",
type_path: "::guiduck::core::Container",
props: [
IrWidgetProp {
name: "background",
setter: "set_background",
ty: Brush,
value: Binding(
If(
Path(
[
"active",
],
Span {
start: 506,
end: 512,
},
),
Str(
Template {
segments: [
Literal(
"#ff0000aa",
),
],
},
Span {
start: 513,
end: 524,
},
),
Str(
Template {
segments: [
Literal(
"#0f0",
),
],
},
Span {
start: 525,
end: 531,
},
),
Span {
start: 502,
end: 532,
},
),
),
},
],
events: [],
queries: [],
},
),
classes: [],
style: StyleIr {
width: Some(
Percent(
0.5,
),
),
height: Some(
Auto,
),
padding: Some(
4.0,
),
gap: Some(
8.0,
),
direction: Some(
Row,
),
align_items: Some(
Center,
),
justify_content: Some(
End,
),
align_self: None,
grow: Some(
1.0,
),
shrink: Some(
0.0,
),
basis: Some(
Px(
100.0,
),
),
},
events: [
IrEvent {
event: Click,
handler: "bump",
args: [],
},
],
autofocus: false,
enabled: None,
focused: None,
tooltip: None,
accel: None,
component_props: [],
component_outputs: [],
component_key: None,
control: None,
children: [
1,
2,
4,
6,
],
},
IrNode {
widget: Widget(
IrWidgetNode {
name: "text",
type_path: "::guiduck::core::Text",
props: [
IrWidgetProp {
name: "text",
setter: "set_text",
ty: RichText,
value: Binding(
Str(
Template {
segments: [
Ref(
"title",
Span {
start: 579,
end: 584,
},
),
Literal(
": ",
),
Ref(
"count",
Span {
start: 588,
end: 593,
},
),
Literal(
" of ",
),
Ref(
"step",
Span {
start: 599,
end: 603,
},
),
],
},
Span {
start: 577,
end: 605,
},
),
),
},
IrWidgetProp {
name: "font-size",
setter: "set_font_size",
ty: Scalar(
F32,
),
value: Static(
Float(
12.5,
),
),
},
IrWidgetProp {
name: "color",
setter: "set_brush",
ty: Brush,
value: Static(
Color(
51,
51,
51,
255,
),
),
},
],
events: [],
queries: [],
},
),
classes: [],
style: StyleIr {
width: None,
height: None,
padding: None,
gap: None,
direction: None,
align_items: None,
justify_content: None,
align_self: None,
grow: None,
shrink: None,
basis: None,
},
events: [
IrEvent {
event: PointerEnter,
handler: "toggle",
args: [],
},
],
autofocus: false,
enabled: None,
focused: None,
tooltip: None,
accel: None,
component_props: [],
component_outputs: [],
component_key: None,
control: None,
children: [],
},
IrNode {
widget: Widget(
IrWidgetNode {
name: "container",
type_path: "::guiduck::core::Container",
props: [
IrWidgetProp {
name: "corner-radius",
setter: "set_corner_radius",
ty: Scalar(
F64,
),
value: Static(
Float(
4.0,
),
),
},
IrWidgetProp {
name: "background",
setter: "set_background",
ty: Brush,
value: Static(
Color(
171,
205,
239,
255,
),
),
},
],
events: [],
queries: [],
},
),
classes: [
"card",
"padded",
],
style: StyleIr {
width: None,
height: None,
padding: None,
gap: None,
direction: None,
align_items: None,
justify_content: None,
align_self: None,
grow: None,
shrink: None,
basis: None,
},
events: [],
autofocus: false,
enabled: Some(
Unary(
Not,
Path(
[
"active",
],
Span {
start: 799,
end: 805,
},
),
Span {
start: 794,
end: 806,
},
),
),
focused: None,
tooltip: None,
accel: None,
component_props: [],
component_outputs: [],
component_key: None,
control: None,
children: [
3,
],
},
IrNode {
widget: Widget(
IrWidgetNode {
name: "text",
type_path: "::guiduck::core::Text",
props: [
IrWidgetProp {
name: "text",
setter: "set_text",
ty: RichText,
value: Static(
Str(
"static label",
),
),
},
],
events: [],
queries: [],
},
),
classes: [],
style: StyleIr {
width: None,
height: None,
padding: None,
gap: None,
direction: None,
align_items: None,
justify_content: None,
align_self: None,
grow: None,
shrink: None,
basis: None,
},
events: [],
autofocus: false,
enabled: None,
focused: None,
tooltip: None,
accel: None,
component_props: [],
component_outputs: [],
component_key: None,
control: None,
children: [],
},
IrNode {
widget: Widget(
IrWidgetNode {
name: "container",
type_path: "::guiduck::core::Container",
props: [],
events: [],
queries: [],
},
),
classes: [],
style: StyleIr {
width: None,
height: None,
padding: None,
gap: None,
direction: None,
align_items: None,
justify_content: None,
align_self: None,
grow: None,
shrink: None,
basis: None,
},
events: [],
autofocus: false,
enabled: Some(
Bool(
false,
Span {
start: 866,
end: 871,
},
),
),
focused: None,
tooltip: None,
accel: None,
component_props: [],
component_outputs: [],
component_key: None,
control: None,
children: [
5,
],
},
IrNode {
widget: Widget(
IrWidgetNode {
name: "text",
type_path: "::guiduck::core::Text",
props: [
IrWidgetProp {
name: "text",
setter: "set_text",
ty: RichText,
value: Static(
Str(
"always off",
),
),
},
],
events: [],
queries: [],
},
),
classes: [],
style: StyleIr {
width: None,
height: None,
padding: None,
gap: None,
direction: None,
align_items: None,
justify_content: None,
align_self: None,
grow: None,
shrink: None,
basis: None,
},
events: [],
autofocus: false,
enabled: None,
focused: None,
tooltip: None,
accel: None,
component_props: [],
component_outputs: [],
component_key: None,
control: None,
children: [],
},
IrNode {
widget: Widget(
IrWidgetNode {
name: "scroll-area",
type_path: "::guiduck::core::ScrollArea",
props: [
IrWidgetProp {
name: "axis",
setter: "set_axis",
ty: ScrollAxes,
value: Static(
ScrollAxes(
Both,
),
),
},
],
events: [],
queries: [],
},
),
classes: [],
style: StyleIr {
width: Some(
Px(
80.0,
),
),
height: Some(
Px(
40.0,
),
),
padding: None,
gap: None,
direction: Some(
Column,
),
align_items: None,
justify_content: None,
align_self: None,
grow: None,
shrink: None,
basis: None,
},
events: [],
autofocus: false,
enabled: None,
focused: None,
tooltip: None,
accel: None,
component_props: [],
component_outputs: [],
component_key: None,
control: None,
children: [
7,
8,
],
},
IrNode {
widget: Widget(
IrWidgetNode {
name: "text",
type_path: "::guiduck::core::Text",
props: [
IrWidgetProp {
name: "text",
setter: "set_text",
ty: RichText,
value: Static(
Str(
"overflowing",
),
),
},
],
events: [],
queries: [],
},
),
classes: [],
style: StyleIr {
width: None,
height: None,
padding: None,
gap: None,
direction: None,
align_items: None,
justify_content: None,
align_self: None,
grow: None,
shrink: None,
basis: None,
},
events: [],
autofocus: false,
enabled: None,
focused: None,
tooltip: None,
accel: None,
component_props: [],
component_outputs: [],
component_key: None,
control: None,
children: [],
},
IrNode {
widget: Widget(
IrWidgetNode {
name: "text",
type_path: "::guiduck::core::Text",
props: [
IrWidgetProp {
name: "text",
setter: "set_text",
ty: RichText,
value: Static(
Str(
"content",
),
),
},
],
events: [],
queries: [],
},
),
classes: [],
style: StyleIr {
width: None,
height: None,
padding: None,
gap: None,
direction: None,
align_items: None,
justify_content: None,
align_self: None,
grow: None,
shrink: None,
basis: None,
},
events: [],
autofocus: false,
enabled: None,
focused: None,
tooltip: None,
accel: None,
component_props: [],
component_outputs: [],
component_key: None,
control: None,
children: [],
},
],
}