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