1mod accordion;
8pub mod actions;
9mod alert_dialog;
10pub mod animation;
11#[doc(hidden)]
12pub mod async_util;
13mod auto_scroll;
14mod avatar;
15mod button;
16mod calendar;
17mod checkbox;
18mod collapsible;
19mod color_picker;
20mod combobox;
21pub mod component_traits;
22mod date_picker;
23mod dialog;
24pub mod dock;
25mod element_ext;
26mod event;
27mod focus_trap;
28mod geometry;
29mod global_state;
30mod history;
31mod hover_card;
32mod index_path;
33pub mod input;
34mod link;
35mod list_settings;
36#[cfg(all(target_os = "macos", not(feature = "test-support")))]
37mod macos_accessibility;
38mod measure;
39pub mod motion;
40mod nav_stack;
41mod number_input;
42mod observe;
43mod otp_input;
44mod pagination;
45pub mod plot;
46mod popover;
47mod popup;
48mod positioner;
49mod progress;
50pub mod questionnaire;
51mod radio;
52mod radio_group;
53mod reduce_motion;
54mod resizable;
55mod root;
56mod scroll_bounce;
57mod scrollable_mask;
58mod scrollbar;
59mod select;
60mod selectable_text;
61mod sheet;
62pub mod slider;
63mod state_style;
64mod styled;
65mod switch;
66mod table;
67mod tabs;
68pub mod text;
69mod text_boundary;
70mod text_compat;
71mod text_selection;
72mod theme;
73pub mod theme_tokens;
74mod time_field;
75mod toast;
76mod toggle;
77mod toggle_group;
78mod toolbar;
79mod tooltip;
80mod touch_selection;
81mod tree;
82mod undo_history;
83mod virtual_list;
84
85pub use accordion::{Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger};
86pub use alert_dialog::{
87 AlertDialog, AlertDialogAction, AlertDialogBackdrop, AlertDialogCancel, AlertDialogClose,
88 AlertDialogDescription, AlertDialogPopup, AlertDialogTitle, AlertDialogTrigger,
89};
90pub use auto_scroll::AutoScroll;
91pub use avatar::{Avatar, AvatarFallback, AvatarImage};
92pub use button::{Button, ButtonStyles};
93pub use calendar::{
94 Calendar, CalendarEvent, CalendarItem, CalendarItemKind, CalendarItemState, CalendarState,
95 CalendarView, Date, IntervalMatcher, Matcher, RangeMatcher,
96};
97pub use checkbox::{
98 Checkbox, CheckboxIndicator, CheckboxIndicatorStyles, CheckboxState, CheckboxStyles,
99};
100pub use collapsible::Collapsible;
101pub use color_picker::{ColorPicker, ColorPickerEvent, ColorPickerState, ColorSwatch, HslaSliders};
102pub use combobox::Combobox;
103pub use component_traits::FocusableExt;
104pub use component_traits::{Disableable, Selectable};
105pub use date_picker::DatePicker;
106pub use dialog::{
107 Dialog, DialogBackdrop, DialogChangeReason, DialogClose, DialogDescription, DialogHandle,
108 DialogPopup, DialogTitle, DialogTrigger,
109};
110pub use element_ext::ElementExt;
111pub use event::{InteractiveElementExt, OngoingScrollExt};
112pub use focus_trap::FocusTrapElement;
113#[doc(hidden)]
114pub use focus_trap::active_focus_trap;
115pub use geometry::*;
116pub use global_state::{DeferredPopover, GlobalState};
117pub use history::History;
118pub use hover_card::{HoverCard, HoverCardState};
119pub use index_path::IndexPath;
120pub use input::{Editor, Input, InputBase, InputStyles, Textarea};
121pub use link::{Link, LinkStyles};
122pub use list_settings::ListSettings;
123#[cfg(all(target_os = "macos", not(feature = "test-support")))]
124#[doc(hidden)]
125pub use macos_accessibility::install_window_hit_test_forwarder;
126#[doc(hidden)]
127pub use measure::measurement_enabled;
128pub use measure::{Measure, measure, measure_if};
129pub use motion::{
130 Discrete, DiscreteError, Easing, EasingError, Interpolate, IterationCount, Keyframe,
131 KeyframeError, Keyframes, LinearStop, MotionPhase, MotionReveal, MotionStatus, MotionTransform,
132 MotionValue, PlaybackDirection, Presence, PresencePhase, PresenceSample, Sequence,
133 SequenceSample, SequenceStep, SignedDuration, Spring, SpringError, Stagger, StaggerOrigin,
134 StepPosition, Timing, TimingSample, Transition, TransitionId, animate_keyframes, spring,
135 transition, transition_with_status,
136};
137pub use nav_stack::{NavMotion, NavOperation, NavPage, NavStack, NavStackEvent, NavStackState};
138pub use number_input::{
139 Decrement, Increment, NumberInput, NumberInputEvent, NumberInputText, NumberStep, StepAction,
140 step_value,
141};
142pub use observe::{ObservedElement, TestSupportExt};
143pub use otp_input::{OtpEvent, OtpInput, OtpState};
144pub use pagination::{Pagination, PaginationItem, PaginationState};
145pub use plot::PlotMotion;
146pub use popover::{Popover, PopoverState};
147pub use popup::{POPUP_PRIORITY, Popup};
148pub use positioner::{Align, Positioner, ResolvedPosition};
149pub use progress::{Progress, ProgressIndicator, ProgressTrack};
150pub use radio::{Radio, RadioStyles};
151pub use radio_group::RadioGroup;
152pub use reduce_motion::apply_system_reduce_motion;
153pub use resizable::{
154 HandleEdge, ResizablePanel, ResizablePanelEvent, ResizablePanelGroup, ResizableState,
155 ResizeHandleContext, ResizeHandleRenderer, ResizeHandleState, h_resizable, resizable_panel,
156 v_resizable,
157};
158#[doc(hidden)]
159pub use resizable::{PANEL_MIN_SIZE, resize_handle};
160pub use root::{Root, RootPlugin};
161pub use scroll_bounce::{ScrollBounce, ScrollBounceMotion};
162pub use scrollable_mask::ScrollableMask;
163pub use scrollbar::{
164 Scrollbar, ScrollbarAxis, ScrollbarEntrance, ScrollbarHandle, ScrollbarMode, ScrollbarMotion,
165 ScrollbarStyles, ScrollbarThumbStyle, ScrollbarTrackStyle,
166};
167pub use select::Select;
168pub use selectable_text::SelectableText;
169pub use sheet::Sheet;
170pub use slider::{Slider, SliderIndicator, SliderThumb, SliderTrack};
171pub use state_style::StateStyle;
172#[cfg(any(feature = "inspector", debug_assertions))]
173pub use styled::styled_ext_reflection_methods;
174pub use styled::{RoleOverride, StyledExt, box_shadow, h_flex, v_flex};
175pub use switch::{
176 Switch, SwitchStyles, SwitchThumb, SwitchThumbStyles, SwitchTrack, SwitchTrackStyles,
177};
178pub use table::{Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow};
179pub use tabs::{Tab, TabStyles, Tabs};
180pub use text::{
181 InlineElement, InlineRenderContext, MarkdownExtensions, MarkdownNode, MarkdownParseContext,
182 MarkdownPlugin, RangeHighlight, RangeHighlightError, RenderedText, SelectionFormat, TableData,
183 Text, TextView, TextViewDefaults, TextViewMotion, TextViewPlugin, TextViewState, TextViewStyle,
184 html, markdown, markdown_ast,
185};
186pub use text_selection::{
187 TextSelection, TextSelectionContentKey, TextSelectionCoverage, TextSelectionEndpoint,
188 TextSelectionEvent, TextSelectionHandle, TextSelectionLayer, TextSelectionProjection,
189 TextSelectionRegistration, TextSelectionRun, TextSelectionScopeId, TextSelectionSnapshot,
190 TextSelectionWindowPoints, TouchHandleLayout,
191};
192pub use theme::{PlotTheme, ResizableTheme, ScrollbarTheme, Theme, ThemeAppearance};
193pub use theme_tokens::{
194 ColorTokens, RadiusTokens, SemanticThemeTokens, ShadowTokens, SpacingTokens, TextStyleToken,
195 TypographyTokens,
196};
197pub use time_field::{
198 HourCycle, TimeField, TimeFieldEvent, TimeFieldSegment, TimeFieldSegmentState, TimeFieldState,
199 TimePrecision, TimeSegment,
200};
201pub use toast::{
202 Toast, ToastAdvance, ToastManager, ToastMotion, ToastOptions, ToastStack, ToastStackState,
203 ToastTransitionStatus,
204};
205pub use toggle::{Toggle, ToggleStyles};
206pub use toggle_group::ToggleGroup;
207pub use toolbar::{Toolbar, ToolbarGroup};
208pub use tooltip::{Tooltip, TooltipOverlay, TooltipPositioner, TooltipRequest, TooltipTransition};
209pub use touch_selection::{SelectionEdge, TouchHandle, TouchSelectionSnapshot};
210pub use tree::{Tree, TreeEntry, TreeEntryState, TreeEvent, TreeItem, TreeState};
211#[doc(hidden)]
212pub use tree::{init as init_tree, key_context as tree_key_context};
213pub use undo_history::UndoHistory;
214#[doc(hidden)]
215pub use virtual_list::virtual_list;
216pub use virtual_list::{VirtualList, VirtualListScrollHandle, h_virtual_list, v_virtual_list};
217
218use gpui::App;
219
220#[inline]
224pub const fn is_mobile() -> bool {
225 cfg!(any(target_os = "ios", target_os = "android"))
226}
227
228pub fn init(cx: &mut App) {
230 let _ = Theme::global_mut(cx);
231 GlobalState::init(cx);
232 reduce_motion::init(cx);
233 dialog::init(cx);
234 focus_trap::init(cx);
235 popover::init(cx);
236 sheet::init(cx);
237 combobox::init(cx);
238 color_picker::init(cx);
239 select::init(cx);
240 number_input::init(cx);
241 time_field::init(cx);
242 input::init(cx);
243 tree::init(cx);
244 text::init(cx);
245 root::init(cx);
246}
247
248#[cfg(feature = "test-support")]
249pub mod test_support;
250
251#[cfg(test)]
252mod test_text_system;