BoscaBML Reference

Migrating Git UI components

The Design Library contains the 41 presentation components extracted from Git UI. Declare the dependency and one unaliased root import as described in the library README. Keep the application's document, state, forms, actions, destinations, permissions and transport there. Nested pages and components use the same short tags.

Replace component calls and remove their old local definitions together. Local definitions take precedence over imported exports, so a successful build with a remaining copy does not establish that the library is being used. The extraction does not require forwarding components or an alias.

Tag mapping

Props and projected children retain their roles, with the caller adjustments below. The component reference lists the current props, defaults and attribute targets.

Git UI tagLibrary tagCaller adjustment
ui-alertalertKeep tone, hidden and compact state.
ui-app-headerapp-headerSupply the brand, product, destination and projected navigation.
ui-badgebadgeSet --purple in consumer CSS to customize the purple tone.
ui-bosca-markbosca-markThe SVG paths are preserved; colors use the --mark-* variables.
ui-buttonbuttonKeep native type, disabled/loading state, classes and declarative events.
ui-cardcardKeep title, padding and projected content.
ui-checkboxcheckboxKeep native form attributes and change events.
ui-comment-editorcomment-editorNative attributes target the textarea. name defaults to body; describedBy adds external descriptions.
ui-confirm-dialogconfirm-dialogKeep application-owned confirmation actions in projected content.
ui-copycopyKeep the exact value and label; copyresult reports clipboard success or failure.
ui-copy-fieldcopy-fieldKeep the value, field label and copy label.
ui-dialogdialogKeep request/completion state and projected forms. Use native escapes for native dialog elements.
ui-disclosure-headingdisclosure-headingKeep it inside the caller's native details element.
ui-empty-stateempty-stateKeep title, message, icon and projected actions.
ui-fieldfieldKeep the label, hint and projected native control.
ui-iconiconGlyphs, size and stroke-width props are preserved.
ui-icon-buttonicon-buttonKeep the accessible label, native button attributes and click action.
ui-icon-linkicon-linkKeep the accessible label, destination and native link attributes.
ui-inputinputKeep native form attributes, controlled value and declarative events.
ui-json-editorjson-editorKeep the field name/value; optionally supply label, mode, readonly/disabled state, error and preservation key.
ui-loading-stateloading-stateKeep label, compact state and additional native attributes.
ui-page-headingpage-headingUse the library NavigationItem and explicitly supply any product breadcrumb.
ui-pagepage-shellUse page-shell for the visual main container; page remains BML's route declaration.
ui-panelpanelKeep projected content; native attributes target its section.
ui-popoverpopoverKeep label, icon, width and projected content; the library owns disclosure positioning and dismissal.
ui-search-inputsearch-inputKeep value, name and input events. Autofocus remains enabled by default; pass :autofocus="false" when needed.
ui-selectselectKeep native options and change events. Mark persistent async choices explicitly and use the public search types.
ui-sectionsectionKeep projected content; use html:section for an unstyled native section.
ui-section-headingsection-headingKeep title, subtitle and projected actions.
ui-segmented-controlsegmented-controlKeep labels/values, native hidden form value and bubbling segmentchange event.
ui-source-viewsource-viewPass requested lines explicitly; Git's editable and preview workflows remain in Git.
ui-spinnerspinnerKeep size; the spinner remains decorative.
ui-switchswitchKeep label, checked/disabled state and native form/change behavior.
ui-table-scrolltable-scrollKeep the projected native table; optionally provide a contextual scroll-region label.
ui-tabstabsUse the library NavigationItem; destinations remain native links.
ui-timetimeFormatting props and server formatting are preserved; use html:time for native markup.
ui-toasttoastKeep a stable key and increment the notice sequence for each new message.
ui-treetreeKeep local/server expansion ownership; optionally provide a preservation key.
ui-tree-itemtree-itemKeep paths, labels, depth and native destinations/actions.
ui-tooltiptooltipKeep content, placement, delay and the projected trigger.
ui-view-tabsview-tabsKeep caller-owned selected state and handle the bubbling viewchange event.

Audit intentional native elements when enabling the import. button, input, select, section, time and dialog also name library components. Use html: for their native forms, including matching closing tags. Props, merged classes and additional attributes use BML's attrs support; components no longer need server scripts that filter named props out of an attribute map.

Replace imports of Git's former navigation model with bosca.design.model.NavigationItem. It still carries label, href and selected. page-heading renders the supplied trail and current crumb; Git explicitly adds its own product entry. Other products supply their own entries.

Async select transport stays in the application. Import the linked declarations with:

import type { SelectOption, SelectPage, SelectSearch } from "@bosca/bml-design/select";

A bubbling selectsearch event supplies query, offset, resolve and reject. Resolve an option array or a SelectPage with explicit previous/next offsets, and report failed requests through reject. Keep server contracts, authentication and response mapping in the application adapter. Choices that must remain available across result pages use data-persistent on their native option:

<select name="owner" label="Owner" searchable async>
  <option value="any" data-persistent>Any owner</option>
</select>

Styles, spacing and assets

Move reusable presentation with its component. The library includes component styles, native control sizing, pending button presentation, tooltip surfaces, projected table rules, modal form classes, dynamic select choices and editor styles. The shared rules for projected table/modal/select content stay under the owning library marker. Application document layout, auth screens, grids, diff/log presentation and route composition remain application CSS.

Use the public CSS variables on the document or a themed container. Surface/text colors, accents, feedback colors, fonts and radii inherit through the components. --control-border can give neutral controls a stronger boundary while --line and --line-2 retain subtle surface dividers. Control background/radius overrides are optional and otherwise follow the local surface and radius variables. Shared --control-height-md, --control-height-sm, --control-height-xs and --control-gap defaults preserve 32/30/24px controls and 6px content spacing. Application layout gaps and margins remain explicit application CSS.

The library declares the original Geist and Geist Mono faces, packages their WOFF2 subsets and retains the font and dependency notices. Select the document font in application CSS. Remove copied fonts, old private font routes and extracted global rules once their callers use the library. Do not target generated scope IDs to restyle a component.

Browser behavior and application adapters

The compiled dependency brings its reachable client helpers. Remove the old extracted helpers after migrating their callers; do not import private paths from the library source checkout. Keep domain adapters such as Git reference search, search URL state, discussion actions, editable CodeMirror state, previews and diff workspace behavior in Git.

source-view owns the read-only CodeMirror viewer. It infers language from path, accepts an explicit language, and takes a positive requested line from its caller. It does not inspect Git URL parameters. json-editor owns the structured engine and native form value; applications retain validation and save actions. Basic pages do not reach either editor's implementation assets through the module-wide import alone.

Give preserved controls distinct keys for independent instances, and change the key when the application intends to replace local editor state. A toast's initial sequence is a baseline; retained server text does not announce again after navigation or remount. Increase its sequence for every new notice, including repeated text. Copy controls retain native labels and manual-copy recovery when clipboard access fails. Forms, links, native select values and escaped editor content provide their documented script-disabled behavior.

The isolated consumer exercises these contracts in production and development, including two consumer themes, native fallback, declarative actions, retained state and component disposal. Git's route and browser checks cover its application adapters and the 1920/1440/1024/390px layout matrix.