- Components inside a shadow root get the kit's styles. Until now every stylesheet went to
document.head, where a shadow root cannot see it; now each component also adopts the kit's stylesheets into its root when it connects (constructed stylesheets, one per document; a<style>where the browser has none). Orbit's own stylesheet is still yours to put in that root.base.jsexportsadoptKitStyles(root).
Orbit Kit now runs on Orbit 2, with seven new components and four options that work the same in every component. Tag names and attributes from 0.x keep working; the few behavior changes are under Changed.
<o-range>: a circular range slider with a start and an end handle on one ring, for numbers (min,max,step,wrap) or times of day (mode="time",hours="12|24"), withmin-span/max-span, a span readout, keys per handle and the band, and form valuestart-end.<o-time-picker>: pick a time on a clock face, hours (12h with AM/PM, or 24h with an inner ring) then minutes, withminute-step,min/max, spinbutton fields for the keyboard and form valueHH:MM.<o-spinner>: a loading indicator (ring,dots,segments,orbit,progress) withrole="progressbar", determinate progress and a calm version for reduced motion.<o-radar-chart>: a radar chart with series, per-axis scales, tooltip, keyboard, legend, a table for screen readers and animated updates.<o-sunburst>: a hierarchical chart from a JSON tree. Labels where they fit, colors by branch, a readout with number format and share, click or Enter to zoom, keyboard navigation,selectandnavigateevents, and an accessible tree.<o-wheel>: a prize wheel with weighted or forced results (spin(index)),tickandresultevents andremove-winnerfor raffles.<o-color-wheel>: a color picker and form control that submits hex,rgb()orhsl(), with optional swatches.color.jsexports the color helpers.- Themes:
theme="dark","light"or"glass"on any component, or the classok-theme-dark,ok-theme-lightorok-theme-glasson a container. Themes are sets of--ok-*properties at zero specificity; your rules and the color attributes win. New shared tokens:--ok-hand,--ok-surface,--ok-backdrop. - Number format:
format(decimal,percent,currency,unit,compact),decimals,currencyandlocaleon the gauge, knob, meter, instrument, donut, rings, compass and radar, throughIntl.NumberFormat. They reach readouts, tick labels, titles andaria-valuetext. The locale falls back to the closestlang.unitstays text unlessformat="unit". formatter: a JS property on every component,(value, { kind, min, max, locale }) => string.min,maxandstepread the same everywhere:stepon the gauge, meter and instrument;minandmaxon the rings (defaults for each ring, which can also set its ownmin) and the radar (distis read between them).- Form controls:
<o-knob>and<o-menu>are form-associated custom elements withname,disabled(also from a<fieldset>), form reset and restore,validity,checkValidity()andlabels. The knob addsdefaultValue,min,max,step,stepUp()andstepDown(); the menu addsrequired, avalueattribute and avaluesetter. <o-menu>firesinputandchangewith every pick, besidesselect, and takesdisabled.<o-menu palette>:monoorcolor.theme="color"still works and can be combined, as intheme="color light".<o-rings spacing>: the new name ofstep, which still works.base.jsexports the helpers for new components:FormControl,formatNumber,normalizeRange,snapValue,rangeFraction,pointerAngle,valueAtAngle,THEMES,withSharedand the attribute groups.DESIGN-shared.mdexplains them.
- Setting
knob.valuefrom code no longer firesinput, like a native input. User changes still fireinputandchange. - Readouts show the clamped value: a gauge with
value="120" max="100"reads 100. Amaxbelowminbecomesminon the gauge, meter and instrument too (it used to reset the range), the same as the knob and<input type="range">. - A disabled knob loses focus, like a disabled input.
<o-instrument>withoutaccentor a preset uses--ok-accent(still red by default), and white preset needles follow--ok-hand, so themes reach them.<o-meter>draws its needle with--ok-meter-needle(set byneedle-color).
- Requires
@zumer/orbit^2.0.0(peer dependency). Orbit 1.x is no longer supported. - Components are sized by their universe: the
.bigbangis as wide assize,orbit-12touches its edge and the rest is laid out in lanes. The--o-forcescaling of 0.x is gone. Outer bands now reach the edge of the widget, so gauges, knobs, donuts and rings look a little bigger at the samesize. - Text scales with the widget (
--ok-font-size, readouts inem) instead of inheriting the page font size. gapis a share of the widget width, in percent, in<o-donut>,<o-menu>and<o-status>. Defaults changed to keep the same look (donut1.5, menu1.2).- Colors are custom properties that inherit:
--ok-fill,--ok-track,--ok-accent,--ok-text,--ok-face,--ok-bezel,--ok-tick,--ok-case,--ok-focus. The color attributes set them on the element. Component-specific properties (--ok-clock-*,--ok-inst-*,--ok-cmp-*,--ok-menu-*) still work and fall back to the shared ones. <o-menu>: the ring touches the edge, and in concentric mode open levels stack inward from it; icons are plain satellites centered in their sector;--o-menu-hubis now--ok-menu-hub(the old name still works).<o-radar>: range rings are drawn by one layer for any count; spokes are vectors from the center; blips use--o-alignment(the 1.x spelling--o-aligmentis gone).<o-clock>: sub-dials are satellites holding a universe of their own; hands and ticks scale with the dial.<o-instrument>: preset captions are written in normal case (Speed,Fuel); thevupreset uses a scale of whole numbers.<o-compass>,<o-instrument>,<o-clock>and<o-radar>no longer letter-space or uppercase their captions.
<o-timer>: a countdown ring with start, pause and reset buttons,warn,ticks, methods, properties and events.<o-status>: status segments in up to three layers, with labels along the arcs, keyboard navigation and aselectevent.thicknesson every band component, in lanes.orbitandstroke-widthfrom 0.x still work.<o-gauge min>.accenton<o-compass>(alias offill) and<o-radar>(alias ofcolor).<o-knob>follows the pointer around its band: the track is aninteractive<o-arc>with ahit-width. Dragging anywhere else still works vertically.<o-gauge>,<o-instrument>and<o-meter>haverole="meter"witharia-valuenow,aria-valuemin,aria-valuemaxandaria-valuetext.- Visible focus rings (
--ok-focus) on the knob, menu sectors, timer buttons and status segments. - The instrument needle eases to a new value, except with reduced motion.
- Tests for the new components, for meter semantics and for bands staying inside their box. The browser suite fails on console errors and on any
[orbit]warning, and checks that it runs on Orbit 2.
- Generated accessible names and roles never replace ones you set, including
aria-labelledby. <o-status>and<o-timer>import safely during server rendering.