Figure
import { Figure, FigureState, FigureView, figureAccessibleName, figureBylineText, fit } from "@arcadia/ui";From Workspace telemetry
Figure
kindrequired- "chart" | "diagram" | "layout"
"chart","diagram"or"layout". A layout parts its child sections withSeparatorand has no larger view or image actions.titlerequired- string
- Required accessible title. Shown in the head unless
hideTitleis set. hideTitle- boolean
- Default:
false - When the drawing carries its own title, keeps
titlefor assistive technology and shows only the menu button at the card's top end on hover and focus. by- Actor
- Who posted it, rendered outside the drawing with
ActorName. Omit when no byline applies. date- ReactNode
- Optional date meta shown in the head for
kind="layout". state- FigureStateInput
- Replaces the well's drawing with
FigureStatewhile drawing, failed or removed. actions- readonly FigureAction[]
- Menu items in the order the product gives them. For
kind="layout","open"and"image"items are omitted. source- ReactNode
- Source line shown in the foot as
"From "followed bysource, at Caption in quiet ink. height- number
- Height in CSS pixels held by the well across swaps, capped at
--figure-max-height(600px). Taller drawings scroll inside. fit- boolean
- Default:
false - Fits the card to its drawing's own width, capped at 100% (for diagrams). Its width is then the drawing's, so it is no container.
onOpenLarge- () => void
- Opens the larger view on a double click of the well and adds
"Open larger"to the menu when no"open"action is passed. Ignored forkind="layout". menuLabel- string
- Accessible name for the card's menu button. Defaults to
"Chart actions","Diagram actions"or"Layout actions". menuRef- Ref<HTMLButtonElement>
- Ref to the card's menu button so
FigureViewcan restore focus to it on close (finalFocus). rootStyle- RootStyle
- Typed StyleX override: layout.
children- ReactNode
- The drawing (a frame, still image or layout sections). Unless the figure fits, it answers to the figure's own width through
@container figure.
Rest props go to HTMLAttributes<HTMLElement>.
kindrequired- "chart" | "diagram" | "layout"
- The kind named in the message:
"chart","diagram"or"layout". statusrequired- "drawing" | "failed" | "removed"
"drawing","failed"or"removed".reason- "unresponsive" | "timeout"
- Default:
"unresponsive" - Why it was closed when
status="removed". problems- readonly string[]
- Up to three problem lines shown at Caption when
status="failed". Extra entries are omitted. onShowSource- () => void
- Opens the drawing's source when
status="failed". onCopySource- () => void
- Copies the drawing's source when
status="failed". onRetry- () => void
- Retries drawing when
status="failed"orstatus="removed". height- number
- Height held in CSS pixels so content below does not shift while drawing or after removal.
rootStyle- RootStyle
- Typed StyleX override: layout.
Rest props go to HTMLAttributes<HTMLDivElement>.
kindrequired- Exclude<FigureKind, "layout">
"chart"or"diagram". Layouts do not open in a larger view.titlerequired- string
- The drawing's title shown in the dialog head and used as its accessible name.
by- Actor
- Who posted it, rendered in the head with
ActorName. source- ReactNode
- Optional source line shown in the foot as
"From "followed bysource. actions- readonly FigureAction[]
- Actions for the foot:
"image"and"data"items render as buttons, remaining non-"open"items sit in a menu. height- number
- Natural height of the drawing in CSS pixels when reported by a frame. Smaller drawings sit at their own height; taller ones scroll inside.
state- FigureStateInput
- Replaces the drawing with
FigureStateif it reloads, fails or is removed while open. onBodySizeChange- (size: FigureViewSize) => void
- Called with the body's inner width and height as the view opens and each time they change, for a renderer that must have the numbers. A frame that fills the body needs none.
closeLabel- string
- Default:
"Close" - Accessible name of the close button.
initialFocus- FocusTarget
- Where focus moves on open.
finalFocus- FocusTarget
- Where focus returns on close; pass the card's
menuRefso focus returns to its menu button. rootStyle- RootStyle
- Typed StyleX override for the dialog: layout.
children- ReactNode
- The drawing shown in the dialog body, a box it fills by layout alone: a frame at
height: 100%takes its whole height.
Rest props go to Pick<DialogProps, "open" | "defaultOpen" | "onOpenChange" | "onOpenChangeComplete">.
State machine
From Workspace telemetry