Form widgets: - Checkbox and CheckboxGroup for boolean inputs - RadioGroup for single-selection options - Select dropdown with keyboard navigation - Slider and RangeSlider for numeric inputs - TextArea for multi-line text input UI utilities: - StatusBar for bottom-of-screen information - Toast and ToastManager for notifications Examples: - form_demo.zig: Interactive form widgets showcase - panel_demo.zig: Docking panel system demo Documentation: - Complete README.md with Quick Start, widget examples, and API reference 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
235 lines
8 KiB
Zig
235 lines
8 KiB
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
// Módulo de la librería
|
|
const zcatui_mod = b.createModule(.{
|
|
.root_source_file = b.path("src/root.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
// Tests
|
|
const unit_tests = b.addTest(.{
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("src/root.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
}),
|
|
});
|
|
|
|
const run_unit_tests = b.addRunArtifact(unit_tests);
|
|
const test_step = b.step("test", "Ejecutar tests");
|
|
test_step.dependOn(&run_unit_tests.step);
|
|
|
|
// Ejemplo: hello
|
|
const hello_exe = b.addExecutable(.{
|
|
.name = "hello",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/hello.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(hello_exe);
|
|
|
|
const run_hello = b.addRunArtifact(hello_exe);
|
|
run_hello.step.dependOn(b.getInstallStep());
|
|
const hello_step = b.step("hello", "Ejecutar ejemplo hello");
|
|
hello_step.dependOn(&run_hello.step);
|
|
|
|
// Ejemplo: events_demo
|
|
const events_demo_exe = b.addExecutable(.{
|
|
.name = "events-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/events_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(events_demo_exe);
|
|
|
|
const run_events_demo = b.addRunArtifact(events_demo_exe);
|
|
run_events_demo.step.dependOn(b.getInstallStep());
|
|
const events_demo_step = b.step("events-demo", "Run events demo");
|
|
events_demo_step.dependOn(&run_events_demo.step);
|
|
|
|
// Ejemplo: list_demo
|
|
const list_demo_exe = b.addExecutable(.{
|
|
.name = "list-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/list_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(list_demo_exe);
|
|
|
|
const run_list_demo = b.addRunArtifact(list_demo_exe);
|
|
run_list_demo.step.dependOn(b.getInstallStep());
|
|
const list_demo_step = b.step("list-demo", "Run list demo");
|
|
list_demo_step.dependOn(&run_list_demo.step);
|
|
|
|
// Ejemplo: table_demo
|
|
const table_demo_exe = b.addExecutable(.{
|
|
.name = "table-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/table_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(table_demo_exe);
|
|
|
|
const run_table_demo = b.addRunArtifact(table_demo_exe);
|
|
run_table_demo.step.dependOn(b.getInstallStep());
|
|
const table_demo_step = b.step("table-demo", "Run table demo");
|
|
table_demo_step.dependOn(&run_table_demo.step);
|
|
|
|
// Ejemplo: dashboard
|
|
const dashboard_exe = b.addExecutable(.{
|
|
.name = "dashboard",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/dashboard.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(dashboard_exe);
|
|
|
|
const run_dashboard = b.addRunArtifact(dashboard_exe);
|
|
run_dashboard.step.dependOn(b.getInstallStep());
|
|
const dashboard_step = b.step("dashboard", "Run dashboard demo");
|
|
dashboard_step.dependOn(&run_dashboard.step);
|
|
|
|
// Ejemplo: input_demo
|
|
const input_demo_exe = b.addExecutable(.{
|
|
.name = "input-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/input_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(input_demo_exe);
|
|
|
|
const run_input_demo = b.addRunArtifact(input_demo_exe);
|
|
run_input_demo.step.dependOn(b.getInstallStep());
|
|
const input_demo_step = b.step("input-demo", "Run input demo");
|
|
input_demo_step.dependOn(&run_input_demo.step);
|
|
|
|
// Ejemplo: animation_demo
|
|
const animation_demo_exe = b.addExecutable(.{
|
|
.name = "animation-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/animation_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(animation_demo_exe);
|
|
|
|
const run_animation_demo = b.addRunArtifact(animation_demo_exe);
|
|
run_animation_demo.step.dependOn(b.getInstallStep());
|
|
const animation_demo_step = b.step("animation-demo", "Run animation demo");
|
|
animation_demo_step.dependOn(&run_animation_demo.step);
|
|
|
|
// Ejemplo: clipboard_demo
|
|
const clipboard_demo_exe = b.addExecutable(.{
|
|
.name = "clipboard-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/clipboard_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(clipboard_demo_exe);
|
|
|
|
const run_clipboard_demo = b.addRunArtifact(clipboard_demo_exe);
|
|
run_clipboard_demo.step.dependOn(b.getInstallStep());
|
|
const clipboard_demo_step = b.step("clipboard-demo", "Run clipboard demo");
|
|
clipboard_demo_step.dependOn(&run_clipboard_demo.step);
|
|
|
|
// Ejemplo: menu_demo
|
|
const menu_demo_exe = b.addExecutable(.{
|
|
.name = "menu-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/menu_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(menu_demo_exe);
|
|
|
|
const run_menu_demo = b.addRunArtifact(menu_demo_exe);
|
|
run_menu_demo.step.dependOn(b.getInstallStep());
|
|
const menu_demo_step = b.step("menu-demo", "Run menu demo");
|
|
menu_demo_step.dependOn(&run_menu_demo.step);
|
|
|
|
// Ejemplo: form_demo
|
|
const form_demo_exe = b.addExecutable(.{
|
|
.name = "form-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/form_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(form_demo_exe);
|
|
|
|
const run_form_demo = b.addRunArtifact(form_demo_exe);
|
|
run_form_demo.step.dependOn(b.getInstallStep());
|
|
const form_demo_step = b.step("form-demo", "Run form demo");
|
|
form_demo_step.dependOn(&run_form_demo.step);
|
|
|
|
// Ejemplo: panel_demo
|
|
const panel_demo_exe = b.addExecutable(.{
|
|
.name = "panel-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/panel_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(panel_demo_exe);
|
|
|
|
const run_panel_demo = b.addRunArtifact(panel_demo_exe);
|
|
run_panel_demo.step.dependOn(b.getInstallStep());
|
|
const panel_demo_step = b.step("panel-demo", "Run panel demo");
|
|
panel_demo_step.dependOn(&run_panel_demo.step);
|
|
}
|