1use std::{collections::HashMap, path::PathBuf};
7
8pub use atlas_ui_components as components;
9pub use atlas_ui_core as core;
10#[cfg(feature = "documents")]
11pub use atlas_ui_documents as documents;
12pub use atlas_ui_icons as icons;
13pub use atlas_ui_tokens as tokens;
14
15pub const COMPONENT_LIBRARY: &str = "atlas-ui";
18
19#[must_use]
27pub fn slint_library_paths() -> HashMap<String, PathBuf> {
28 HashMap::from([
29 (COMPONENT_LIBRARY.to_owned(), components::ui_path()),
30 ("atlas-ui-core".to_owned(), core::ui_path()),
31 ("atlas-ui-icons".to_owned(), icons::ui_path()),
32 ("atlas-ui-tokens".to_owned(), tokens::ui_path()),
33 ])
34}
35
36#[must_use]
38pub fn stable_slint_path() -> PathBuf {
39 components::ui_path().join("stable.slint")
40}
41
42#[must_use]
44pub fn preview_slint_path() -> PathBuf {
45 components::ui_path().join("preview.slint")
46}
47
48#[must_use]
51pub fn preview_nonresponsive_slint_path() -> PathBuf {
52 components::ui_path().join("preview-nonresponsive.slint")
53}
54
55#[cfg(test)]
56mod tests {
57 use super::{
58 preview_nonresponsive_slint_path, preview_slint_path, slint_library_paths,
59 stable_slint_path,
60 };
61
62 #[test]
63 fn exported_slint_paths_exist() {
64 assert!(stable_slint_path().is_file());
65 assert!(preview_slint_path().is_file());
66 assert!(preview_nonresponsive_slint_path().is_file());
67 assert!(slint_library_paths().values().all(|path| path.is_dir()));
68 }
69}