Skip to main content

Crate ev_lib_classes

Crate ev_lib_classes 

Source
Expand description

Pure styling data for the uikit: Tailwind class tables, variant/size enums and the cn! fuse macro. Carries no Dioxus — it’s the single source of truth that both the Rust components (ev_lib) and the TS codegen (ev_lib_gen) read from.

Macros§

cn
Fuses any number of class fragments into a single String with real Tailwind conflict resolution (like clsx + tailwind-merge): empty fragments drop, the rightmost conflicting utility wins. The TS mirror is cn in @evinvest/uikit.

Enums§

AlertVariant
BadgeVariant
Canonical superset of the cabinet (Success) and landing variants.
BookSide
Which side of the book a level or a print belongs to. Bids read positive, asks read loud — the row’s text colour; the depth bar takes its tint from book_depth_class.
ButtonGroupOrientation
ButtonVariant
Per-variant classes only; the base rides on BUTTON_BASE. as_class() yields the variant string, the codegen key is as_ref() (kebab).
DrawerDirection
Edge the drawer slides in from. The shared content base rides on DRAWER_CONTENT_BASE.
EmptyMediaVariant
FieldOrientation
InputGroupAddonAlign
InputGroupButtonSize
ItemMediaVariant
ItemSize
ItemVariant
OrderSide
The intent behind the submit: filled positive for a buy, filled loud for a sell, each with the ink that reads on that fill.
Orientation
Polarity
Which token scope a band sets on itself. Custom properties inherit, so the class re-themes the whole subtree: bg-card text-ink is then correct on both sides with no prop threading. A consumer that defines only :root gets a no-op either way.
ScrollBarOrientation
Size
The kit’s one control scale. Every sized component reads it, so a component that needs a step nobody else has adds it here rather than growing an enum of its own.
Surface
Which plane a band sits on, within its polarity.
TerminalArea
Where a pane sits in the TERMINAL_ROOT grid. Explicit placement, so the desktop layout does not depend on the order a consumer emits the panes in.
ToastPosition
ToastVariant
ToggleVariant

Constants§

ACCORDION_CONTENT
ACCORDION_CONTENT_INNER
ACCORDION_HEADER
ACCORDION_ITEM
ACCORDION_TRIGGER
ALERT_BASE
ALERT_DESCRIPTION
ALERT_DIALOG_CONTENT
ALERT_DIALOG_DESCRIPTION
ALERT_DIALOG_FOOTER
ALERT_DIALOG_HEADER
ALERT_DIALOG_OVERLAY
ALERT_DIALOG_TITLE
ALERT_TITLE
AVATAR
AVATAR_FALLBACK
AVATAR_IMAGE
BADGE_BASE
BREADCRUMB_ELLIPSIS
BREADCRUMB_ITEM
BREADCRUMB_LINK
BREADCRUMB_LIST
BREADCRUMB_PAGE
BREADCRUMB_SEPARATOR
BUTTON_BASE
Base classes shared by every button variant. Split out from the variant enum so the TS codegen can emit it verbatim and button_classes fuses it last-wins.
BUTTON_GROUP_BASE
BUTTON_GROUP_SEPARATOR_BASE
BUTTON_GROUP_TEXT_BASE
CALENDAR_CAPTION
CALENDAR_DAY
CALENDAR_DAY_CELL
CALENDAR_DAY_EMPTY
CALENDAR_DAY_SELECTED
CALENDAR_DAY_TODAY
CALENDAR_GRID
CALENDAR_NAV
CALENDAR_NAV_BUTTON
CALENDAR_ROOT
CALENDAR_WEEK
CALENDAR_WEEKDAY
CALENDAR_WEEKDAY_ROW
CARD
CARD_ACTION
CARD_CONTENT
CARD_DESCRIPTION
CARD_FOOTER
CARD_HEADER
CARD_TITLE
CAROUSEL_CONTENT_TRACK
CAROUSEL_CONTENT_TRACK_HORIZONTAL
CAROUSEL_CONTENT_TRACK_VERTICAL
CAROUSEL_CONTENT_VIEWPORT
CAROUSEL_EDGE_FADE_NEXT
CAROUSEL_EDGE_FADE_PREV
CAROUSEL_ITEM
CAROUSEL_ITEM_HORIZONTAL
CAROUSEL_ITEM_VERTICAL
CAROUSEL_NAV
CAROUSEL_NEXT_HORIZONTAL
CAROUSEL_NEXT_VERTICAL
CAROUSEL_PREVIOUS_HORIZONTAL
CAROUSEL_PREVIOUS_VERTICAL
CHART_CONTAINER
CHART_LEGEND
CHART_TOOLTIP
CHECK
CLASS_INVENTORY
Every Tailwind class literal the kit can emit, one per line.
COMMAND_DIALOG_COMMAND
COMMAND_DIALOG_CONTENT
COMMAND_DIALOG_OVERLAY
COMMAND_EMPTY
COMMAND_GROUP
COMMAND_INPUT
COMMAND_INPUT_WRAPPER
COMMAND_ITEM
COMMAND_LIST
COMMAND_ROOT
COMMAND_SEPARATOR
COMMAND_SHORTCUT
CONTAINER_BASE
CONTEXT_MENU_CHECK_ITEM
CONTEXT_MENU_CONTENT
CONTEXT_MENU_ITEM
CONTEXT_MENU_LABEL
CONTEXT_MENU_SEPARATOR
CONTEXT_MENU_SHORTCUT
CONTEXT_MENU_SUB_CONTENT
CONTEXT_MENU_SUB_TRIGGER
DIALOG_CLOSE
DIALOG_CONTENT
DIALOG_DESCRIPTION
DIALOG_FOOTER
DIALOG_HEADER
DIALOG_OVERLAY
DIALOG_TITLE
DISPLAY_BASE
cn! merges every font-* utility as one group, so a font-bold here would take the family down with it the moment a caller overrides anything — hence the weight as a property.
DRAWER_CONTENT_BASE
DRAWER_DESCRIPTION
DRAWER_FOOTER
DRAWER_HANDLE
DRAWER_HEADER
DRAWER_OVERLAY
DRAWER_TITLE
DROPDOWN_MENU_CHECK_ITEM
DROPDOWN_MENU_CONTENT
DROPDOWN_MENU_ITEM
DROPDOWN_MENU_ITEM_INDICATOR
DROPDOWN_MENU_LABEL
DROPDOWN_MENU_SEPARATOR
DROPDOWN_MENU_SHORTCUT
DROPDOWN_MENU_SUB_CONTENT
DROPDOWN_MENU_SUB_TRIGGER
EMPTY
EMPTY_CONTENT
EMPTY_DESCRIPTION
EMPTY_HEADER
EMPTY_MEDIA_BASE
EMPTY_TITLE
EYEBROW
FIELD_BASE
FIELD_CONTENT
FIELD_DESCRIPTION
FIELD_ERROR
FIELD_GROUP
FIELD_LABEL
FIELD_LEGEND
FIELD_SEPARATOR
FIELD_SEPARATOR_CONTENT
FIELD_SEPARATOR_LINE
FIELD_SET
FIELD_TITLE
FORM_DESCRIPTION
FORM_ITEM
FORM_LABEL
FORM_MESSAGE
HOVER_CARD_CONTENT
INPUT_BASE
INPUT_GROUP_ADDON_BASE
INPUT_GROUP_BASE
INPUT_GROUP_BUTTON_BASE
INPUT_GROUP_INPUT_CONTROL
Appended to the shared INPUT_BASE for a group-embedded input.
INPUT_GROUP_TEXT
INPUT_GROUP_TEXTAREA_CONTROL
Appended to the shared TEXTAREA_BASE for a group-embedded textarea.
INPUT_OTP_CONTAINER
INPUT_OTP_GROUP
INPUT_OTP_INPUT
INPUT_OTP_SLOT
INPUT_OTP_SLOT_CARET
INPUT_OTP_SLOT_CARET_WRAPPER
ITEM_ACTIONS
ITEM_BASE
Shared base for the two-axis (variant × size) item. Fused with the variant and size class last-wins, mirroring the TS cn(ITEM_BASE, itemVariants[v], itemSizes[s]).
ITEM_CONTENT
ITEM_DESCRIPTION
ITEM_FOOTER
ITEM_GROUP
ITEM_HEADER
ITEM_MEDIA_BASE
ITEM_SEPARATOR
ITEM_TITLE
KBD_BASE
KBD_GROUP_BASE
LABEL_BASE
LEDE
The paragraph directly under a DISPLAY_BASE headline — one step up from PROSE, which is body copy.
MENUBAR_CHECKBOX_ITEM
MENUBAR_CONTENT
MENUBAR_ITEM
MENUBAR_ITEM_INDICATOR
MENUBAR_LABEL
MENUBAR_RADIO_ITEM
MENUBAR_ROOT
MENUBAR_SEPARATOR
MENUBAR_SHORTCUT
MENUBAR_SUB_CONTENT
MENUBAR_SUB_TRIGGER
MENUBAR_TRIGGER
NAVIGATION_MENU
NAVIGATION_MENU_CONTENT
NAVIGATION_MENU_INDICATOR
NAVIGATION_MENU_ITEM
NAVIGATION_MENU_LINK
NAVIGATION_MENU_LIST
NAVIGATION_MENU_TRIGGER_STYLE
NAVIGATION_MENU_VIEWPORT
OPEN_ORDERS_EMPTY
The open-orders pane when there is nothing in it. A trader with no orders is the common case, so this reads as calm, not as an error.
ORDER_BOOK
ORDER_BOOK_DEPTH
The bar behind a level, anchored right and sized by the consumer (style="width: 42%"), tinted by book_depth_class.
ORDER_BOOK_HEAD
Column captions: price / size / total, right-aligned like the figures under them, except the price column.
ORDER_BOOK_PRICE
The price cell of a level or a print; takes its colour from BookSide.
ORDER_BOOK_ROW
One price level. isolate starts a stacking context so the depth bar’s negative z-index sits between this row’s own background (and its hover wash) and the figures, instead of vanishing behind the pane.
ORDER_BOOK_SPREAD
The mid / spread line between asks and bids.
ORDER_FORM
ORDER_FORM_LABEL
ORDER_FORM_ROW
A label / figure line in the order summary (cost, fee, available balance).
ORDER_FORM_SUBMIT_BASE
The submit button’s geometry; colour is OrderSide. Not a Button variant because the kit’s Destructive names a consequence, and selling is not one — it is the other half of the same intent.
ORDER_FORM_VALUE
POPOVER_CONTENT
PROGRESS_INDICATOR
PROGRESS_TRACK
PROSE
RADIO_GROUP_ITEM
RADIO_GROUP_ROOT
RESIZABLE_GROUP
RESIZABLE_HANDLE
RESIZABLE_HANDLE_GRIP
RESIZABLE_PANEL
SCROLLBAR_BASE
SCROLL_AREA_THUMB
SCROLL_AREA_VIEWPORT
SECTION_BASE
SECTION_HEAD
SECTION_PY
SECTION_PY_TIGHT
SEPARATOR_BASE
SHEET_CLOSE
SHEET_CONTENT
SHEET_DESCRIPTION
SHEET_FOOTER
SHEET_HEADER
SHEET_OVERLAY
SHEET_SIDE_BOTTOM
SHEET_SIDE_LEFT
SHEET_SIDE_RIGHT
SHEET_SIDE_TOP
SHEET_TITLE
SIDEBAR_CONTENT
SIDEBAR_FLAT
SIDEBAR_FOOTER
SIDEBAR_GROUP
SIDEBAR_GROUP_CONTENT
SIDEBAR_GROUP_LABEL
SIDEBAR_HEADER
SIDEBAR_INNER
SIDEBAR_INSET
SIDEBAR_MENU
SIDEBAR_MENU_BUTTON_BASE
SIDEBAR_MENU_ITEM
SIDEBAR_RAIL
SIDEBAR_SEPARATOR
SIDEBAR_TRIGGER
SIDEBAR_WRAPPER
SKELETON_BASE
SLIDER_RANGE
SLIDER_ROOT
SLIDER_THUMB
SLIDER_TRACK
STAT
STAT_FIGURE
STAT_LABEL
TABLE
TABLE_BODY
TABLE_CAPTION
TABLE_CELL
TABLE_CONTAINER
TABLE_FOOTER
TABLE_HEAD
TABLE_HEADER
TABLE_ROW
TABS_CONTENT
TABS_LIST
TABS_ROOT
TABS_TRIGGER
TERMINAL_CHART
The slot a plotting engine mounts into: sized, relative, nothing drawn. A chart library measures its host, so the host must have a height before the library runs — hence the floor.
TERMINAL_PANE
TERMINAL_PANE_BODY
TERMINAL_PANE_HEADER
TERMINAL_ROOT
The frame. Stacked on a phone in DOM order; from lg a three-column grid bound to the viewport, so every pane scrolls inside itself rather than the page. The height subtracts --ev-shell-offset so a hosting shell’s chrome is not double-counted. gap-px over a bg-border ground draws the hairlines between panes without a border on each.
TERMINAL_TICKER
The strip across the top. Scrolls sideways rather than wrapping: a stat that wraps under another is misread as its label.
TERMINAL_TICKER_LABEL
TERMINAL_TICKER_STAT
TERMINAL_TICKER_VALUE
TEXTAREA_BASE
TOASTER_BASE
Pinned stack container base; the per-position offsets ride on ToastPosition.
TOAST_BASE
Base shared by every toast. The TS mirror appends its swipe-only utilities (touch-pan-y select-none) on top — that styling is behaviour-specific and stays in the React component (the Rust kit has no swipe-to-dismiss).
TOAST_CLOSE
TOAST_CONTENT
TOAST_TITLE
TOGGLE_BASE
TOKENS_CSS
The token stylesheet the class tables above are written against, flattened.
TOKENS_LEGACY_CSS
TOKENS_CSS with the pre-0.10 utility names layered back on top — import this one while a consumer still writes text-main-mist, bg-sidebar or text-muted-foreground in its own markup. Pairs with the legacy feature of ev_lib; both go away together.
TOOLTIP_CONTENT
TRADES_TAPE_ROW
One print in the trades tape: price / size / time, the price coloured by the aggressor’s BookSide.

Functions§

book_depth_class
The depth bar’s fill for a side — the side colour at low alpha, so the figures over it stay legible.
button_size_class
Size + shape dimensions. An icon button is a square (h-N aspect-square px-0); otherwise per-size height + text padding. Mirrors the TS buttonSizeClasses table.
input_group_button_size_class
Size × icon → shadcn’s flat xs/sm/icon-xs/icon-sm keys. Mirrors the TS inputGroupButtonSizes table; an icon button is a square (size-N p-0).
sidebar_menu_button_size_class
The rail’s rows are full-width and left-aligned, so they take their height from the shared Size scale and nothing else — colour comes from ButtonVariant, like every other button in the kit.
toggle_size_class
Per-size height + min-width + horizontal padding. Mirrors the TS toggleSizeClasses table.