arc-gpui 0.2.0

All-in-one facade crate for Arc-rs: physics-first native Rust desktop UI components, OKLCH design tokens, ODE spring motion engine, and node workflow canvas for GPUI.
Documentation
//! # `arc-gpui` — Unified Facade Crate for Arc-rs
//!
//! Install a single dependency in `Cargo.toml` to access the entire Arc-rs ecosystem on GPUI:
//!
//! ```toml
//! [dependencies]
//! arc-gpui = "0.2.0"
//! ```
//!
//! Disable the node-graph canvas if you only need UI components, tokens, and motion:
//!
//! ```toml
//! [dependencies]
//! arc-gpui = { version = "0.2.0", default-features = false }
//! ```
//!
//! ## Included Modules
//! - [`tokens`] (`arc-tokens`): OKLCH/OKLab palettes, 8 semantic accents, radii, shadows, typography, i18n, spring specs.
//! - [`motion`] (`arc-motion`): analytical ODE spring solver, cubic bezier, FLIP shared layout, presence, drag/inertia.
//! - [`ui`] (`arc-ui`): 120+ interactive desktop components and charts, also re-exported at the crate root.
//! - [`flow`] (`arc-flow`, enabled by default via feature `flow`): GPU-accelerated node & workflow canvas.
//! - [`flow_core`] (`arc-flow-core`, enabled by default via feature `flow`): UI-agnostic graph kernel.
//! - [`gpui_kit`]: Underlying GPUI Kit runtime re-export.
//! - [`prelude`]: Common setup helpers, theme/locale traits, and core components.

pub use arc_motion as motion;
pub use arc_tokens as tokens;
pub use arc_ui as ui;
pub use gpui_kit;

#[cfg(feature = "flow")]
pub use arc_flow as flow;
#[cfg(feature = "flow")]
pub use arc_flow_core as flow_core;
#[cfg(feature = "graph")]
pub use arc_graph as graph;
#[cfg(feature = "graph")]
pub use arc_graph_core as graph_core;

pub use arc_ui::{
    ActionButton, ActionSwap, ActivityHeatmap, Alert, AnimatedCounter, AnnouncementBar, ArcDialog,
    ArcHoverCard, ArcOverlay, ArcPopover, ArcTooltip, Avatar, AvatarGroup, Badge, BarChart,
    BillingToggle, BottomSheet, Breadcrumb, BrushChart, Button, ButtonGroup, Calendar, Card,
    CardStack, Carousel, ChatThread, Checkbox, ChipGroup, CodeBlock, ColorPicker, Combobox,
    CommentThread, ConfirmMorph, ContextMenu, CookieConsent, CopyButton, Countdown, DatePicker,
    DateRangePicker, DonutChart, Drawer, DropdownMenu, ElasticSlider, EmptyState, ExpandableCard,
    ExpandableText, ExpandingButtonGroup, ExpandingSearch, FileDropzone, FilterToolbar,
    FloatingButtonGroup, Gauge, HoldToConfirm, IconMorph, ImageCompare, InViewTitle, InlineEdit,
    Input, JsonViewer, LineChart, MentionInput, MetricCard, MoneyInput, MorphSelect, MultiSelect,
    NumberField, OnboardingChecklist, Pagination, PasswordField, PasswordStrength, PhoneInput,
    Progress, RadioCards, RadioGroup, RangeHistogramSlider, Rating, Reactions, ReorderableList,
    ResizablePanels, RichTextEditor, Ridgeline, RulerSlider, ScrollArea, ScrubInput, SearchField,
    SegmentedControl, Select, ShortcutRecorder, SignaturePad, Skeleton, Slider, SlopeChart,
    SlotText, SortableDataTable, Sparkline, SplitButton, Stepper, Streamgraph, SwipeActions,
    Switch, Tabs, TagInput, TextMorph, TextReveal, TextShimmer, Textarea, ThemeSwitch, TimePicker,
    Timeline, Toast, ToastStack, ToggleGroup, TreeTable, TreeView, Treemap, UsageMeter, UserMenu,
    WaffleChart,
};
pub use arc_ui::{
    ChangelogEntry, ChangelogFeed, ChangelogKind, ChangelogMedia, CommandItem, CommandPalette,
    ComparisonColumn, ComparisonRow, ComparisonSection, ComparisonTable, ComparisonValue,
    EmptyScene, EmptyStates, FileUpload, FileUploadItem, NotificationActor, NotificationCenter,
    NotificationItem, NotificationTone, OtpInput, OtpInputMode, PageActivity, PageFile, PageHeader,
    PageIssue, PageMilestone, PagePerson, PageSection, PageUpdate, UploadRequest,
};
/// Re-export all UI components & charts at the crate root for ergonomic imports
/// (`use arc_gpui::{Button, Toast, LineChart, ...};`).
pub use arc_ui::{
    actions, blocks, chart, data, disclosure, feedback, inputs, install_overlay_layer, overlay,
    text,
};

#[cfg(feature = "flow")]
pub use arc_flow::{DefaultNodeRenderer, FlowCanvas, NodeRenderCtx, NodeRenderer};
#[cfg(feature = "graph")]
pub use arc_graph::{Graph2D, Lod, RenderCounts};

/// Convenient prelude for bootstrapping an Arc-rs GPUI application.
pub mod prelude {
    #[cfg(feature = "flow")]
    pub use crate::flow::{DefaultNodeRenderer, FlowCanvas, NodeRenderCtx, NodeRenderer};
    #[cfg(feature = "graph")]
    pub use crate::graph::{Graph2D, Lod, RenderCounts};
    pub use crate::motion::{
        ArcPresence, CubicBezier, ReducedMotionChoice, SpringSolver, arc_spring, arc_transition,
        is_reduced_motion, set_reduced_motion, set_time_scale,
    };
    pub use crate::tokens::{
        Accent, ActiveArcLocale as _, ActiveArcTheme as _, ArcColors, ControlHeights, Locale,
        Radii, Shadows, Spacing, ThemeMode, Typography, install_arc_theme, set_locale,
    };
    pub use crate::ui::install_overlay_layer;
}

/// One-shot Arc-rs initialization helper to run inside `gpui_kit::application().run(|cx| ...)`.
///
/// Installs `gpui_kit`, the window-level `ArcOverlay` portal layer, locale, and Arc theme.
pub fn init_arc(
    mode: tokens::ThemeMode,
    accent: tokens::Accent,
    locale: tokens::Locale,
    cx: &mut gpui_kit::App,
) {
    gpui_kit::init(cx);
    ui::install_overlay_layer(cx);
    tokens::set_locale(locale, cx);
    tokens::install_arc_theme(mode, accent, cx);
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn facade_reexports_all_layers() {
        // Tokens + Motion
        let _ = tokens::ControlHeights::MD;
        let _ = motion::CubicBezier::new(0.2, 0.0, 0.0, 1.0);
        // UI
        let _ = std::any::type_name::<Button>();
        // Flow (default feature)
        #[cfg(feature = "flow")]
        {
            let _ = flow_core::FORMAT_VERSION;
            let _ = std::any::type_name::<FlowCanvas>();
        }
    }
}