Nutrient Toolbar Item Button
The render leaf for a single ToolbarItem — the smallest visual toolbar primitive.
Reuses the rest of the Phase 0 spine: colors from UiTheme / MainToolbarColors (#10), the accessibility contract from toolbarItemSemantics (#3), and the ToolbarIcon sealed type for rendering. A tap emits a ToolbarAction via onAction; the leaf holds no business logic.
A long press names the item with the Material 3 tooltip from ToolbarTooltipBox — the View bars' TooltipCompat affordance. toolbarPosition is the dock the button is rendered in; the tooltip opens on that bar's document side. Buttons that already use their long press for something else (a submenu group opening its sheet, i.e. a non-null onLongClick) get no tooltip, and neither do the ToolbarItem.OverflowBehavior.AlwaysAsText items, which already spell their label out next to the glyph. A disabled item still gets one, unlike TooltipCompat: a greyed-out glyph is precisely the one a user cannot identify by tapping it, so naming it is worth the divergence from the View bars.
Parameters
the toolbar item to render.
called with the ToolbarAction a tap produces.
applied to the tooltip wrapper, which is the outermost layout this composable emits, so layout modifiers (weight, align, layoutId) reach the node the caller's own parent measures. That wrapper passes loose constraints down, so a size modifier sizes the space the button is centered in rather than the button itself: Modifier.width(120.dp) gives a 120dp slot holding the standard 48dp touch target, not a 120dp-wide one. The touch target and the invertedSelection background follow the button, not the slot.
a long-press handler that takes the place of the tooltip, for buttons that spend their long press on something else.
true to mark the selected state the View way — the activated color filling a rounded rect behind a knocked-out glyph — instead of tinting the glyph alone.
the dock this button is rendered in; the tooltip opens on that bar's document side.