#[cfg(feature = "derive")]
pub use gpui_form_component_derive::InfiniteSelect;
mod calendar;
mod calendar_navigation;
pub mod date_picker;
pub mod file_picker;
pub mod i18n;
pub mod infinite_select;
#[doc(hidden)]
pub mod __macro_support {
pub use gpui_es_fluent::{localize_label, localize_message};
}
#[cfg(all(test, feature = "component-shape"))]
mod tests {
use std::path::PathBuf;
use component_shape::DeclaredComponentShape;
use gpui_form_runtime::shape::{
GpuiComponentEventOf, GpuiComponentShape, GpuiComponentShapeFor, GpuiComponentStateOf,
GpuiComponentValueBinding, GpuiFormComponentShapePolicy,
};
use gpui_kit::EventEmitter;
use crate::{
date_picker::{DatePicker, DateRangePicker},
file_picker::FilePicker,
};
fn assert_declared_shape<Shape>()
where
Shape: DeclaredComponentShape + GpuiComponentShape + GpuiFormComponentShapePolicy,
{
}
fn assert_shape_for<Shape, Value>()
where
Shape: GpuiComponentShapeFor<Value>,
{
}
fn assert_value_binding<Shape, Value>()
where
Shape: GpuiComponentValueBinding<Value>,
GpuiComponentStateOf<Shape>: EventEmitter<GpuiComponentEventOf<Shape, Value>>,
{
}
#[test]
fn component_shape_feature_publishes_runtime_component_contracts() {
assert_declared_shape::<DatePicker>();
assert_shape_for::<DatePicker, chrono::NaiveDate>();
assert_value_binding::<DatePicker, chrono::NaiveDate>();
assert_declared_shape::<DateRangePicker>();
assert_shape_for::<DateRangePicker, (chrono::NaiveDate, chrono::NaiveDate)>();
assert_value_binding::<DateRangePicker, (chrono::NaiveDate, chrono::NaiveDate)>();
assert_declared_shape::<FilePicker>();
assert_shape_for::<FilePicker, Vec<PathBuf>>();
assert_value_binding::<FilePicker, Vec<PathBuf>>();
}
}