@tanrei/mcp 0.1.0-next.0 → 0.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +4 -5
- package/README.md +21 -6
- package/bin/tanrei-mcp.js +3 -3
- package/dist/server.js +2218 -711
- package/dist/vocabulary/docs/governance/mimicry-gaps.json +95 -21
- package/dist/vocabulary/packages/tokens-build/generated/component-catalog.json +1825 -0
- package/dist/vocabulary/specs/accordion.spec.json +1 -0
- package/dist/vocabulary/specs/app-bar.spec.json +1 -0
- package/dist/vocabulary/specs/app-shell.spec.json +1 -0
- package/dist/vocabulary/specs/avatar.spec.json +1 -0
- package/dist/vocabulary/specs/badge.spec.json +1 -0
- package/dist/vocabulary/specs/bottom-sheet.spec.json +1 -0
- package/dist/vocabulary/specs/breadcrumbs.spec.json +1 -0
- package/dist/vocabulary/specs/button-group.spec.json +1 -0
- package/dist/vocabulary/specs/button-with-menu.spec.json +1 -0
- package/dist/vocabulary/specs/button.spec.json +1 -0
- package/dist/vocabulary/specs/calendar.spec.json +1 -0
- package/dist/vocabulary/specs/callout.spec.json +1 -0
- package/dist/vocabulary/specs/card.spec.json +1 -0
- package/dist/vocabulary/specs/carousel.spec.json +1 -0
- package/dist/vocabulary/specs/chat-composer.spec.json +1 -0
- package/dist/vocabulary/specs/checkbox-group.spec.json +1 -0
- package/dist/vocabulary/specs/checkbox.spec.json +1 -0
- package/dist/vocabulary/specs/chip-field.spec.json +1 -0
- package/dist/vocabulary/specs/chip.spec.json +1 -0
- package/dist/vocabulary/specs/code-block.spec.json +1 -0
- package/dist/vocabulary/specs/color-field.spec.json +1 -0
- package/dist/vocabulary/specs/color-input.spec.json +1 -0
- package/dist/vocabulary/specs/combobox-field.spec.json +1 -0
- package/dist/vocabulary/specs/combobox.spec.json +1 -0
- package/dist/vocabulary/specs/component.schema.json +1 -0
- package/dist/vocabulary/specs/copy-button.spec.json +1 -0
- package/dist/vocabulary/specs/date-time-picker.spec.json +1 -0
- package/dist/vocabulary/specs/description-list.spec.json +1 -0
- package/dist/vocabulary/specs/dialog.spec.json +1 -0
- package/dist/vocabulary/specs/divider.spec.json +1 -0
- package/dist/vocabulary/specs/drop-zone.spec.json +1 -0
- package/dist/vocabulary/specs/embedded-text-input.spec.json +1 -0
- package/dist/vocabulary/specs/empty-state.spec.json +1 -0
- package/dist/vocabulary/specs/fab-menu.spec.json +1 -0
- package/dist/vocabulary/specs/field-group.spec.json +1 -0
- package/dist/vocabulary/specs/field.spec.json +1 -0
- package/dist/vocabulary/specs/figure.spec.json +1 -0
- package/dist/vocabulary/specs/file-item.spec.json +1 -0
- package/dist/vocabulary/specs/file-picker.spec.json +1 -0
- package/dist/vocabulary/specs/file-upload.spec.json +1 -0
- package/dist/vocabulary/specs/handle.spec.json +1 -0
- package/dist/vocabulary/specs/image-preview.spec.json +1 -0
- package/dist/vocabulary/specs/inline-code.spec.json +1 -0
- package/dist/vocabulary/specs/inventory.json +1 -0
- package/dist/vocabulary/specs/keyboard-shortcut.spec.json +1 -0
- package/dist/vocabulary/specs/link-card.spec.json +1 -0
- package/dist/vocabulary/specs/link.spec.json +1 -0
- package/dist/vocabulary/specs/list-row.spec.json +1 -0
- package/dist/vocabulary/specs/list.spec.json +1 -0
- package/dist/vocabulary/specs/loading-indicator.spec.json +1 -0
- package/dist/vocabulary/specs/main-action-button.spec.json +1 -0
- package/dist/vocabulary/specs/marquee-text.spec.json +1 -0
- package/dist/vocabulary/specs/menu.spec.json +1 -0
- package/dist/vocabulary/specs/menubar.spec.json +1 -0
- package/dist/vocabulary/specs/meter.spec.json +1 -0
- package/dist/vocabulary/specs/modal-layer.spec.json +1 -0
- package/dist/vocabulary/specs/navigation-bar.spec.json +1 -0
- package/dist/vocabulary/specs/navigation-drawer.spec.json +1 -0
- package/dist/vocabulary/specs/number-field.spec.json +1 -0
- package/dist/vocabulary/specs/number-input.spec.json +1 -0
- package/dist/vocabulary/specs/number-ticker.spec.json +1 -0
- package/dist/vocabulary/specs/one-time-code-field.spec.json +1 -0
- package/dist/vocabulary/specs/one-time-code-input.spec.json +1 -0
- package/dist/vocabulary/specs/page-header.spec.json +1 -0
- package/dist/vocabulary/specs/pagination.spec.json +1 -0
- package/dist/vocabulary/specs/popover.spec.json +1 -0
- package/dist/vocabulary/specs/previous-next-links.spec.json +1 -0
- package/dist/vocabulary/specs/progress-indicator.spec.json +1 -0
- package/dist/vocabulary/specs/prose.spec.json +1 -0
- package/dist/vocabulary/specs/radio-button.spec.json +1 -0
- package/dist/vocabulary/specs/radio-group.spec.json +1 -0
- package/dist/vocabulary/specs/rating.spec.json +1 -0
- package/dist/vocabulary/specs/resizable-frame.spec.json +1 -0
- package/dist/vocabulary/specs/scroll-area.spec.json +1 -0
- package/dist/vocabulary/specs/search.spec.json +1 -0
- package/dist/vocabulary/specs/segmented-button.spec.json +1 -0
- package/dist/vocabulary/specs/select-field.spec.json +1 -0
- package/dist/vocabulary/specs/select.spec.json +1 -0
- package/dist/vocabulary/specs/side-sheet.spec.json +1 -0
- package/dist/vocabulary/specs/size-transition.spec.json +1 -0
- package/dist/vocabulary/specs/skeleton.spec.json +1 -0
- package/dist/vocabulary/specs/slider-field.spec.json +1 -0
- package/dist/vocabulary/specs/slider.spec.json +1 -0
- package/dist/vocabulary/specs/snackbar.spec.json +1 -0
- package/dist/vocabulary/specs/split-view.spec.json +1 -0
- package/dist/vocabulary/specs/stepper.spec.json +1 -0
- package/dist/vocabulary/specs/steps.spec.json +1 -0
- package/dist/vocabulary/specs/swatch.spec.json +1 -0
- package/dist/vocabulary/specs/switch.spec.json +1 -0
- package/dist/vocabulary/specs/tab-view.spec.json +1 -0
- package/dist/vocabulary/specs/table-of-contents.spec.json +1 -0
- package/dist/vocabulary/specs/table.spec.json +1 -0
- package/dist/vocabulary/specs/tabs.spec.json +1 -0
- package/dist/vocabulary/specs/tag-group.spec.json +1 -0
- package/dist/vocabulary/specs/tag.spec.json +1 -0
- package/dist/vocabulary/specs/text-field.spec.json +1 -0
- package/dist/vocabulary/specs/text-input.spec.json +1 -0
- package/dist/vocabulary/specs/timeline.spec.json +1 -0
- package/dist/vocabulary/specs/toolbar.spec.json +1 -0
- package/dist/vocabulary/specs/tooltip.spec.json +1 -0
- package/dist/vocabulary/specs/tree-view.spec.json +1 -0
- package/dist/vocabulary/tanrei.config.json +2 -1
- package/dist/vocabulary/tokens/comp/accordion.tokens.json +70 -47
- package/dist/vocabulary/tokens/comp/app-bar.tokens.json +99 -2
- package/dist/vocabulary/tokens/comp/app-shell.tokens.json +1 -1
- package/dist/vocabulary/tokens/comp/avatar.tokens.json +17 -5
- package/dist/vocabulary/tokens/comp/badge.tokens.json +2 -1
- package/dist/vocabulary/tokens/comp/bottom-sheet.tokens.json +143 -73
- package/dist/vocabulary/tokens/comp/breadcrumbs.tokens.json +3 -3
- package/dist/vocabulary/tokens/comp/button-group.tokens.json +26 -4
- package/dist/vocabulary/tokens/comp/button-with-menu.tokens.json +256 -28
- package/dist/vocabulary/tokens/comp/button.tokens.json +275 -22
- package/dist/vocabulary/tokens/comp/calendar.tokens.json +28 -18
- package/dist/vocabulary/tokens/comp/callout.tokens.json +55 -299
- package/dist/vocabulary/tokens/comp/card.tokens.json +3 -3
- package/dist/vocabulary/tokens/comp/carousel.tokens.json +70 -10
- package/dist/vocabulary/tokens/comp/chat-composer.tokens.json +37 -3
- package/dist/vocabulary/tokens/comp/checkbox.tokens.json +18 -22
- package/dist/vocabulary/tokens/comp/chip.tokens.json +67 -16
- package/dist/vocabulary/tokens/comp/code-block.tokens.json +15 -1
- package/dist/vocabulary/tokens/comp/combobox.tokens.json +202 -33
- package/dist/vocabulary/tokens/comp/copy-button.tokens.json +19 -2
- package/dist/vocabulary/tokens/comp/date-time-picker.tokens.json +66 -35
- package/dist/vocabulary/tokens/comp/description-list.tokens.json +45 -23
- package/dist/vocabulary/tokens/comp/dialog.tokens.json +95 -35
- package/dist/vocabulary/tokens/comp/drop-zone.tokens.json +151 -0
- package/dist/vocabulary/tokens/comp/embedded-text-input.tokens.json +2 -2
- package/dist/vocabulary/tokens/comp/field-group.tokens.json +21 -1
- package/dist/vocabulary/tokens/comp/field.tokens.json +33 -4
- package/dist/vocabulary/tokens/comp/figure.tokens.json +56 -2
- package/dist/vocabulary/tokens/comp/file-item.tokens.json +4 -4
- package/dist/vocabulary/tokens/comp/file-picker.tokens.json +3 -3
- package/dist/vocabulary/tokens/comp/file-upload.tokens.json +2 -7
- package/dist/vocabulary/tokens/comp/handle.tokens.json +343 -0
- package/dist/vocabulary/tokens/comp/image-preview.tokens.json +53 -23
- package/dist/vocabulary/tokens/comp/input-box.tokens.json +161 -26
- package/dist/vocabulary/tokens/comp/keyboard-shortcut.tokens.json +5 -3
- package/dist/vocabulary/tokens/comp/link-card.tokens.json +24 -4
- package/dist/vocabulary/tokens/comp/link.tokens.json +3 -3
- package/dist/vocabulary/tokens/comp/list-row.tokens.json +249 -0
- package/dist/vocabulary/tokens/comp/list.tokens.json +106 -225
- package/dist/vocabulary/tokens/comp/loading-indicator.tokens.json +13 -3
- package/dist/vocabulary/tokens/comp/main-action-button.tokens.json +96 -23
- package/dist/vocabulary/tokens/comp/marquee-text.tokens.json +110 -0
- package/dist/vocabulary/tokens/comp/menu.tokens.json +248 -43
- package/dist/vocabulary/tokens/comp/menubar.tokens.json +63 -12
- package/dist/vocabulary/tokens/comp/meter.tokens.json +173 -0
- package/dist/vocabulary/tokens/comp/modal-layer.tokens.json +69 -0
- package/dist/vocabulary/tokens/comp/navigation-bar.tokens.json +5 -36
- package/dist/vocabulary/tokens/comp/navigation-drawer.tokens.json +478 -122
- package/dist/vocabulary/tokens/comp/number-input.tokens.json +2 -2
- package/dist/vocabulary/tokens/comp/number-ticker.tokens.json +77 -0
- package/dist/vocabulary/tokens/comp/one-time-code-input.tokens.json +22 -7
- package/dist/vocabulary/tokens/comp/pagination.tokens.json +118 -79
- package/dist/vocabulary/tokens/comp/popover.tokens.json +84 -13
- package/dist/vocabulary/tokens/comp/previous-next-links.tokens.json +194 -0
- package/dist/vocabulary/tokens/comp/progress-indicator.tokens.json +14 -4
- package/dist/vocabulary/tokens/comp/prose.tokens.json +16 -0
- package/dist/vocabulary/tokens/comp/radio-button.tokens.json +16 -20
- package/dist/vocabulary/tokens/comp/rating.tokens.json +230 -0
- package/dist/vocabulary/tokens/comp/resizable-frame.tokens.json +166 -0
- package/dist/vocabulary/tokens/comp/scroll-area.tokens.json +99 -0
- package/dist/vocabulary/tokens/comp/search.tokens.json +144 -58
- package/dist/vocabulary/tokens/comp/segmented-button.tokens.json +75 -21
- package/dist/vocabulary/tokens/comp/select.tokens.json +168 -34
- package/dist/vocabulary/tokens/comp/side-sheet.tokens.json +60 -13
- package/dist/vocabulary/tokens/comp/size-transition.tokens.json +49 -0
- package/dist/vocabulary/tokens/comp/skeleton.tokens.json +5 -2
- package/dist/vocabulary/tokens/comp/slider.tokens.json +11 -10
- package/dist/vocabulary/tokens/comp/snackbar.tokens.json +81 -255
- package/dist/vocabulary/tokens/comp/split-view.tokens.json +52 -0
- package/dist/vocabulary/tokens/comp/stepper.tokens.json +538 -0
- package/dist/vocabulary/tokens/comp/swatch.tokens.json +208 -0
- package/dist/vocabulary/tokens/comp/switch.tokens.json +19 -18
- package/dist/vocabulary/tokens/comp/tab-view.tokens.json +5 -5
- package/dist/vocabulary/tokens/comp/table-of-contents.tokens.json +58 -33
- package/dist/vocabulary/tokens/comp/table.tokens.json +141 -30
- package/dist/vocabulary/tokens/comp/tabs.tokens.json +132 -44
- package/dist/vocabulary/tokens/comp/tag-group.tokens.json +15 -4
- package/dist/vocabulary/tokens/comp/tag.tokens.json +32 -8
- package/dist/vocabulary/tokens/comp/text-input.tokens.json +18 -88
- package/dist/vocabulary/tokens/comp/timeline.tokens.json +15 -19
- package/dist/vocabulary/tokens/comp/toolbar.tokens.json +121 -6
- package/dist/vocabulary/tokens/comp/tooltip.tokens.json +8 -32
- package/dist/vocabulary/tokens/comp/tree-view.tokens.json +136 -51
- package/dist/vocabulary/tokens/dial/dial.tokens.json +23 -3
- package/dist/vocabulary/tokens/fidelity/cupertino.fidelity.json +165 -0
- package/dist/vocabulary/tokens/fidelity/m3-like.fidelity.json +215 -5
- package/dist/vocabulary/tokens/fidelity/reference/androidx-material3.json +144 -0
- package/dist/vocabulary/tokens/fidelity/reference/apple-hig.json +196 -0
- package/dist/vocabulary/tokens/generated/cupertino/components.json +1749 -0
- package/dist/vocabulary/tokens/generated/cupertino/fidelity.json +162 -0
- package/dist/vocabulary/tokens/generated/m3-like/components.json +1761 -0
- package/dist/vocabulary/tokens/generated/m3-like/fidelity.json +182 -12
- package/dist/vocabulary/tokens/generated/tanrei/components.json +1764 -0
- package/dist/vocabulary/tokens/icon-sets/material-symbols.icon-set.json +2 -1
- package/dist/vocabulary/tokens/schema/system.schema.json +324 -35
- package/dist/vocabulary/tokens/sys/behavior.tokens.json +66 -1
- package/dist/vocabulary/tokens/sys/measure.tokens.json +105 -21
- package/dist/vocabulary/tokens/sys/motion.tokens.json +474 -2
- package/dist/vocabulary/tokens/sys/scroll-edge.tokens.json +50 -0
- package/dist/vocabulary/tokens/sys/shape.tokens.json +1 -1
- package/dist/vocabulary/tokens/sys/state.tokens.json +16 -3
- package/dist/vocabulary/tokens/sys/typescale.tokens.json +5 -5
- package/dist/vocabulary/tokens/systems/core.system.json +1889 -0
- package/dist/vocabulary/tokens/systems/cupertino.system.json +298 -79
- package/dist/vocabulary/tokens/{comp → systems/m3-like/comp}/fab-menu.tokens.json +5 -15
- package/dist/vocabulary/tokens/systems/m3-like.system.json +451 -125
- package/dist/vocabulary/tokens/systems/tanrei.system.json +619 -321
- package/dist/vocabulary/tokens/tanrei.resolver.json +48 -6
- package/package.json +22 -6
- package/dist/vocabulary/tokens/AGENTS.md +0 -15
- package/dist/vocabulary/tokens/comp/navigation-rail.tokens.json +0 -254
- package/dist/vocabulary/tokens/fidelity/m3-expressive-like.fidelity.json +0 -68
- package/dist/vocabulary/tokens/fidelity/reference/androidx-material3-buttons.json +0 -67
- package/dist/vocabulary/tokens/generated/m3-expressive-like/fidelity.json +0 -99
- package/dist/vocabulary/tokens/systems/m3-expressive-like.system.json +0 -83
- package/dist/vocabulary/tokens/vocabulary.lock.json +0 -7052
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"snackbar","title":"Snackbar","summary":"Tells a person briefly, at the bottom edge of the screen or at its top end, what the app just did or what happened (neutrally, or as information, a warning, an error or a success), on a raised surface of the scheme or as a bar of the opposite scheme, with at most one action, without taking focus or interrupting their work.","level":"base","listing":"default","anatomy":[{"id":"container","description":"The bar that holds the text and the controls, raised above the content of its host. Its color is its form's: a surface of the scheme (the default form, or a faint tint of a status) or, drawn inverse, the opposite scheme's surface or, in a status form, the bar the other theme draws for that status: deep in a light scheme, pale in a dark one."},{"id":"outline","description":"The edge of a status form: a hairline in the status's color, at the edge's opacity, around the bar where the ring of its elevation is. The default form and the inverse form draw none and keep that ring alone.","optional":true},{"id":"icon","description":"The status glyph from the system's icon set, before the text: info, warning, error or check_circle. Drawn only in a status form, a little softer than the text (in the status's own color on a surface and, on an inverse bar, in the status color of the other theme, at the glyph's opacity), and hidden from assistive technology, which hears statusLabel instead.","optional":true},{"id":"title","description":"A few words that name what happened, above the message. Up to three lines while collapsed.","optional":true},{"id":"supporting-text","description":"The message: what happened, or with a title the description, which is then drawn a little quieter than the title. Up to three lines while collapsed."},{"id":"action","description":"One control that undoes or follows up on what happened, drawn as a tonal button with the snackbar's own tokens, as tall as the expand and close buttons beside it: the color of its own bar with a tonal layer of its label's color over it, so that it stands one quiet step off the bar, the same step in every form.","optional":true},{"id":"expand","description":"An icon-only Button of the size comp.snackbar.close-button.size names (small in the default system) that shows the whole title and message, and hides them again: the glyph expand_more while collapsed and expand_less while expanded. Drawn only while the text is longer than its collapsed limit, and drawn as the close button is (SNK-34).","optional":true},{"id":"close","description":"An icon-only Button of the size comp.snackbar.close-button.size names (small in the default system) showing the icon set's close glyph, which closes the snackbar. The snackbar places it, chooses its size and its variant (comp.snackbar.close-button.variant: tonal in the default system) and gives it its form's tone (BTN-45): the glyph in the bar's message color and, where the variant draws a container, a circle of that color made translucent. Everything else it reads from Button's own tokens.","optional":true},{"id":"focus-ring","description":"Gap-then-ring indicator shown for keyboard focus of the action, or of the text while it scrolls, in the color its form gives it so that it shows on that form's bar. The expand and close buttons draw their own, in the same color (SNK-34).","optional":true}],"props":[{"name":"message","type":"string","default":"","description":"What happened; with a title, the description. Required. Plain text: the whole message is announced, even when a collapsed snackbar cuts it."},{"name":"title","type":"string","default":"","description":"A few words above the message that name what happened (\"Message not sent\"). Empty draws the message alone."},{"name":"action","type":"string","default":"","description":"The label of the one action (\"Undo\", \"View\"), drawn as a tonal button that sits one quiet step off the bar, the same step in every form. Empty draws no action."},{"name":"status","type":"enum","values":["default","info","warning","error","success"],"default":"default","description":"The form of the snackbar. Default is the neutral bar with no glyph; info, warning, error and success draw the bar as a quiet tint of that status (pale on the scheme's surface or, drawn inverse, the bar the other theme draws for that status, with that theme's text, glyph and edge colors), with an edge in the status's color and the status's glyph before the text, and warning and error are announced assertively."},{"name":"statusLabel","type":"string","default":"","description":"The status in words, in the product's language (\"Error\"), announced before the title and the message so that the status never rests on color and glyph alone. Required while status is not default."},{"name":"inverse","type":"boolean","default":null,"description":"Whether this snackbar is drawn inverse: in the opposite scheme's colors (a dark bar in a light scheme), so that it stands apart from whatever it lands on. False draws it on a surface of the scheme. Null, the default, takes comp.snackbar.container.inverse, the system's choice, which is off in the default system. It changes colors only (SNK-30)."},{"name":"closable","type":"boolean","default":false,"description":"Draws a close button, for a message that stays until the person closes it or for one they may want gone sooner."},{"name":"closeLabel","type":"string","default":"","description":"The close button's accessible name, in the product's language (\"Close\"). Required while closable is true.","words":"closeLabel"},{"name":"expanded","type":"boolean","default":false,"description":"Whether the whole title and message show. The person toggles it with the expand button (SNK-24); it has no effect while the text fits within its collapsed limits."},{"name":"expandLabel","type":"string","default":"","description":"The expand button's accessible name, in the product's language (\"Show full message\"). It stays the same while expanded; the button's expanded state says which way it acts. Required whenever the text can be longer than its collapsed limit.","words":"expandLabel"},{"name":"duration","type":"enum","values":["auto","short","long","indefinite"],"default":"auto","description":"How long the snackbar stays by itself. Auto is short without an action and indefinite with one (WCAG 2.2.1: a person must not be timed out of an action). Short and long close after the snackbar's timeout tokens; indefinite stays until it is closed."},{"name":"placement","type":"enum","values":["bottom","top-end"],"default":"bottom","description":"Where the host places the snackbar in its area. Bottom, the default, is the bottom edge, centred (SNK-13). Top-end is the top edge at the end side: the top right in a left-to-right layout and the top left in a right-to-left one, and across the top of a compact window (SNK-35). A host may be given one placement for all the snackbars it shows; a snackbar that names its own keeps it. It changes where the snackbar stands and the side it enters from (SNK-36, SNK-37), and nothing else: not its size, its form, its order in the queue, its place in the focus order or its announcement."}],"events":[{"name":"action","description":"The action was activated. The snackbar closes."},{"name":"dismiss","description":"The snackbar closed without its action; carries the reason: close (the close button), escape, timeout, or host (the product closed it or cleared the queue)."},{"name":"toggle","description":"The person expanded or collapsed the text with the expand button; carries the new expanded value. Not emitted when the product sets expanded."}],"states":["enabled","hovered","focused","pressed"],"behavior":[{"id":"SNK-1","text":"WHEN the user activates the action by pointer, touch, Enter or Space THE snackbar SHALL emit action exactly once and close; WHEN the user activates the close button the same way THE snackbar SHALL emit dismiss with the reason close exactly once and close."},{"id":"SNK-2","text":"WHILE the action is hovered, keyboard-focused or pressed THE snackbar SHALL render the action's container, content color and opacity from the component tokens of the highest-precedence active state of the action, in the snackbar's form (SNK-21, SNK-30), with precedence pressed over focused over hovered; focus gained by pointer or touch SHALL NOT select the focused state. The expand and close buttons answer their states as any Button does (SNK-34)."},{"id":"SNK-3","text":"WHEN the action receives keyboard focus THE snackbar SHALL show the focus ring around it without animation; focus gained by pointer or touch SHALL NOT show it. THE snackbar SHALL draw the outer stroke of that indicator, of the indicator inside the text while it scrolls and has keyboard focus (SNK-25) and, through the tone it gives them (SNK-34), of the indicators of the expand and close buttons, in its form's focus-ring color: comp.snackbar.focus-ring.color in the default form, and the token of that name under the form's prefix in every other (comp.snackbar.info.focus-ring.color, comp.snackbar.inverse.focus-ring.color, comp.snackbar.inverse-info.focus-ring.color, and warning's, error's and success's of the same names), never the system's focus-ring color role read directly. The widths and the offset SHALL stay the system's (sys.focus.outer-width, sys.focus.inner-width, sys.focus.offset), as SHALL the color of an inner stroke where the system draws one; under the glow focus style (SNK-7) the form's color SHALL be the halo's outer color."},{"id":"SNK-4","text":"WHERE the visual size of the action is below the minimum target THE snackbar SHALL extend the action's hit area on both axes to sys.target.touch for touch input and sys.target.pointer for fine pointers, without changing its visual size; a platform that cannot tell the input type SHALL use sys.target.touch. THE snackbar SHALL extend the hit areas of its controls — the action, the expand button and the close button — toward each other no further than the middle of comp.snackbar.controls.gap, so that a press on one control's visible bounds is never another's (BTN-5)."},{"id":"SNK-5","text":"WHEN the action is pressed by pointer, touch, Enter or Space THE snackbar SHALL show the pressed state without delay and SHALL keep it visible for at least sys.motion.duration.press-hold, even when the press ends sooner."},{"id":"SNK-6","text":"WHILE the action is pressed THE snackbar SHALL answer as sys.behavior.pressed-feedback names: overlay applies the pressed tokens to the whole container of the action at once; ripple grows the pressed state layer from the point of contact (from the center for keyboard activation); dim applies the pressed opacity to the whole action and draws no state layer; none draws no answer to the press. Under ripple and dim only the container color stays with the state under the press; content color, opacity and shape still come from the pressed tokens. Under none every part stays with the state under the press. The ripple grows over comp.snackbar.motion.feedback-duration with comp.snackbar.motion.state-easing, fades over comp.snackbar.motion.state-duration with comp.snackbar.motion.state-easing once the press has ended and press-hold has passed, and appears whole where motion is reduced."},{"id":"SNK-7","text":"THE snackbar SHALL ease its container corners and the action's corners by sys.shape.corner-smoothing (0 is a quarter circle, 0.6 the iOS continuous corner; a platform with only the OS curve draws it for any amount above 0) and show its keyboard focus as sys.behavior.focus-style names (ring or glow); a platform that cannot draw a choice SHALL fall back to the first value and state that in its README."},{"id":"SNK-8","text":"WHILE duration is auto THE snackbar SHALL behave as short when action is empty and as indefinite when action is set. WHILE duration is short or long THE snackbar SHALL close by itself once it has been shown for comp.snackbar.timeout.short or comp.snackbar.timeout.long, and emit dismiss with the reason timeout; WHERE the platform recommends a longer time for the person's accessibility settings (Android's accessibility timeout) it SHALL use that time, and WHERE the platform reports that a screen reader is running a snackbar with an action SHALL NOT close by itself. WHILE duration is indefinite THE snackbar SHALL NOT close by itself."},{"id":"SNK-9","text":"WHILE the pointer is over the snackbar, focus is inside it, it is expanded, or the app's window is hidden or in the background THE snackbar SHALL pause its timeout, and WHEN none of these holds any longer SHALL start the timeout again from its whole length; WHEN the host moves the showing snackbar into or out of a modal surface (SNK-38) it SHALL also start the timeout again from its whole length."},{"id":"SNK-10","text":"WHEN a snackbar is shown THE snackbar SHALL have assistive technology announce it once: statusLabel first when status is not default, then the title when it has one, then the whole message (never only the part a collapsed snackbar shows), then the action's label when it has one. It SHALL announce politely (after what is being read) when status is default, info or success, and assertively (interrupting what is being read) when status is warning or error, and SHALL NOT move keyboard or screen-reader focus."},{"id":"SNK-11","text":"THE snackbar's controls SHALL be reachable in the focus order at the place its host has in that order, in this order whatever row each is drawn on: the text while it scrolls (SNK-25), the action, the expand button, the close button; WHEN the user presses Escape while focus is inside the snackbar THE snackbar SHALL emit dismiss with the reason escape and close; WHEN a snackbar closes while focus is inside it, focus SHALL return to the element that had it before focus entered the snackbar or, where that element no longer exists, to the platform's default."},{"id":"SNK-12","text":"THE host SHALL show one snackbar at a time, in the order they were requested: WHEN a snackbar is requested while another is showing or closing it SHALL wait until the other has closed, and only for that: a modal surface that is open SHALL NOT hold it back (SNK-38). Each request SHALL resolve once its snackbar has closed, with action or with dismiss and its reason. WHEN the product closes the showing snackbar THE host SHALL close it and resolve it with dismiss and the reason host, and the next waiting one SHALL then show; WHEN the product clears the queue THE host SHALL also drop every waiting one and resolve each with dismiss and the reason host."},{"id":"SNK-13","text":"WHILE placement is bottom THE host SHALL place the snackbar at the bottom of its area, centred between the safe area's side edges and at least comp.snackbar.container.margin inside them, its bottom edge comp.snackbar.container.margin above the higher of the safe area's bottom edge and the top of what the frame keeps over the bottom of the area (a navigation bar's present height, APS-17), raised by the on-screen keyboard's height WHILE the keyboard is shown, so that it never covers a bottom navigation bar or the keyboard; at either placement it SHALL draw the snackbar above its area's content and, WHILE a Tanrei modal surface is open, above the topmost one and its scrim (SNK-38)."},{"id":"SNK-14","text":"THE snackbar SHALL be at least comp.snackbar.container.min-height tall and as wide as its content between comp.snackbar.container.min-width and comp.snackbar.container.max-width, but never wider than its host less comp.snackbar.container.margin on each side. It SHALL draw comp.snackbar.container.color, or its form's container color (SNK-21, SNK-30), with comp.snackbar.container.elevation and comp.snackbar.container.shape corners, and pad its content by comp.snackbar.container.padding-inline-start before the status glyph or, without one, before the text, by comp.snackbar.container.padding-block below the text and by at least as much above it, where SNK-29 places the first line, and after the text by comp.snackbar.container.padding-inline-end when there is no control or by comp.snackbar.container.padding-inline-end-with-controls after the last control. WHILE the action stands on its own row (SNK-16) and no control follows the text on its row, the text SHALL end comp.snackbar.container.padding-inline-end from the end edge, as in a snackbar without controls, and padding-inline-end-with-controls SHALL be the action row's alone."},{"id":"SNK-15","text":"THE snackbar SHALL draw the message in comp.snackbar.supporting-text.typescale and comp.snackbar.supporting-text.color, or its form's message color (SNK-21, SNK-30), at the opacity SNK-32 gives a message under a title, followed comp.snackbar.container.gap after the text (the title and the message) by the action, the expand button and the close button, in that order, comp.snackbar.controls.gap apart and centred on the text's first line (SNK-29). The action SHALL be drawn as a tonal button, in its form's action colors: a container of comp.snackbar.action.container.color at least comp.snackbar.controls.height tall (the height of the Button size comp.snackbar.close-button.size names, so that the action stands as tall as the expand and close buttons in its row), the tonal layer over it (SNK-33), and comp.snackbar.controls.padding-inline around its label in comp.snackbar.controls.label.typescale and comp.snackbar.action.content.color, on comp.snackbar.controls.shape corners. The expand and close buttons SHALL be drawn as SNK-34 says."},{"id":"SNK-16","text":"WHEN the text (the title and the message) would need more than two lines beside the controls, or the action's label would itself wrap, THE snackbar SHALL move the action onto its own row below the text, comp.snackbar.container.gap below it and aligned to the end, with comp.snackbar.container.padding-inline-end-with-controls between that row and the bar's bottom edge, while the expand and close buttons stay at the end of the first row; the text SHALL wrap, and is cut only as SNK-23 says, and the action's label SHALL never wrap or be truncated."},{"id":"SNK-17","text":"WHEN a snackbar is shown THE snackbar SHALL make its bar appear as every surface appears: from sys.motion.appear.opacity, sys.motion.appear.scale, sys.motion.appear.distance toward the edge of its host it stands at and sys.motion.appear.blur to whole, grown from the middle of that edge — the bottom edge WHILE placement is bottom, so that it rises into place, and the top edge at top-end, SNK-36 — over comp.snackbar.motion.enter-duration with comp.snackbar.motion.enter-easing; WHEN it closes THE snackbar SHALL take the bar back the same way to where it started, over comp.snackbar.motion.exit-duration with comp.snackbar.motion.exit-easing, and the host SHALL show the next one only after that; WHILE the bar leaves THE snackbar SHALL take no pointer input, so that a press there reaches what lies under it and the pointer on it is not hover (MOT-7). WHEN it closes while still appearing it SHALL turn round from the opacity and the size it has reached. WHERE sys.behavior.appearance is unfold the scale SHALL apply along the axis that leaves that edge only, so that the bar unfolds from it at its full width. WHERE motion is reduced it SHALL only fade in and out, over sys.motion.role.reduced, with no scale, distance or blur, or appear and disappear at once on a platform whose reduced-motion setting removes every animation (Android's). WHEN it is shown before the document has first been painted it SHALL appear without its motion. The motion SHALL be drawn only: the place SNK-13 and SNK-35 give, the layout SNK-16, SNK-23 and SNK-25 measure, and the announcement (SNK-10), which does not wait for it, are those of the snackbar at rest."},{"id":"SNK-18","text":"WHEN the layout direction is right-to-left THE snackbar SHALL mirror its layout (the status glyph and the text at the right, the controls at the left) without mirroring any glyph, and SHALL grow a ripple from the point of contact as in left-to-right."},{"id":"SNK-19","text":"WHILE a snackbar is drawn outside a host (a snapshot harness, a documentation page) THE snackbar SHALL draw in place at its resting position, centred across the width it is given as SNK-13 centres it in a host (or, WHILE placement is top-end, at the end of that width as SNK-35 places it, and across the whole of it where that width is narrower than comp.snackbar.breakpoint.medium) and at most as tall as the height it is given, the width and the height it is given standing for the host's area in SNK-25 and SNK-35; it SHALL NOT time out, queue, animate its entrance or announce itself, and SHALL still emit action, dismiss and toggle."},{"id":"SNK-20","text":"WHILE message is empty THE snackbar SHALL still render and in debug builds report the empty message; WHILE closable is true and closeLabel is empty it SHALL still render the close button and in debug builds report that the button has no accessible name; WHILE status is not default and statusLabel is empty it SHALL still render the status form and in debug builds report that the status is not given in words; WHILE the expand button is drawn and expandLabel is empty it SHALL still render it and in debug builds report that it has no accessible name; WHEN duration is short or long and action is set it SHALL, in debug builds, remind the product that a timed action must also be offered elsewhere."},{"id":"SNK-21","text":"WHILE status is info, warning, error or success THE snackbar SHALL draw that status form: the bar, the title, the message and the status glyph in the status's container, title, supporting-text and icon colors, and every state of the action from the parts prefixed with the status, and give the expand and close buttons the status's tone (SNK-34). For info, while the snackbar is not drawn inverse (SNK-30), these are comp.snackbar.info.container.color, comp.snackbar.info.title.color, comp.snackbar.info.supporting-text.color, comp.snackbar.info.icon.color, comp.snackbar.info.outline.color for its edge (SNK-31), comp.snackbar.action.info.container.color and comp.snackbar.action.info.content.color; warning, error and success read their own tokens of the same names, and a status form drawn inverse reads the tokens SNK-30 names. Before the text it SHALL draw the status's glyph from the system's icon set (info for info, warning for warning, error for error, check_circle for success) at comp.snackbar.icon.size, in its form's icon color drawn at comp.snackbar.icon.opacity (an opacity of the glyph alone, which fades nothing else), comp.snackbar.icon.gap before the text and centred on the text's first line (SNK-29), with the family and fill of an unselected icon, sys.icon.weight and an optical size clamped between sys.icon.optical-size.min and sys.icon.optical-size.max, never mirrored. The glyph so drawn SHALL keep 3:1 against its bar in every scheme of the default system. The glyph SHALL be hidden from assistive technology, and statusLabel SHALL be exposed as text before the title and the message. WHILE status is default THE snackbar SHALL draw no glyph and read the unprefixed tokens, or drawn inverse the tokens prefixed with inverse (SNK-30)."},{"id":"SNK-22","text":"WHILE title is not empty THE snackbar SHALL draw it above the message in comp.snackbar.title.typescale and comp.snackbar.title.color, or its form's title color (SNK-21, SNK-30), with comp.snackbar.title.gap between the title and the message; WHILE title is empty it SHALL draw the message alone. THE snackbar SHALL set the title's letter-spacing by the script of its text, as every title is set (PRS-20): no negative letter-spacing WHERE its language is Chinese, Japanese or Korean, and none WHERE its script joins its letters or stacks marks on them."},{"id":"SNK-23","text":"WHILE expanded is false THE snackbar SHALL show at most comp.snackbar.title.max-lines lines of the title and at most comp.snackbar.supporting-text.max-lines lines of the message, each ending with an ellipsis where it is cut, at every text size, and the whole of both SHALL still reach assistive technology. WHILE the title or the message is longer than its collapsed limit THE snackbar SHALL draw the expand button, holding expand_more while collapsed and expand_less while expanded; WHILE both fit within their limits it SHALL NOT draw the expand button, and expanded SHALL have no effect. WHILE expanded is true THE snackbar SHALL show the whole title and message."},{"id":"SNK-24","text":"WHEN the user activates the expand button by pointer, touch, Enter or Space THE snackbar SHALL toggle expanded, emit toggle with the new value exactly once, keep focus on the expand button and stay open; the bar SHALL grow to its expanded height or shrink back over comp.snackbar.motion.expand-duration with comp.snackbar.motion.expand-easing, keeping its bottom edge in place WHILE placement is bottom and its top edge at top-end (SNK-37), and change at once where motion is reduced. The expand button SHALL expose to assistive technology whether the text is expanded and which text it shows and hides, and SHALL keep expandLabel as its name in both states. WHEN the product sets expanded THE snackbar SHALL change the same way without emitting toggle."},{"id":"SNK-25","text":"WHILE the snackbar is expanded and its whole content would make it taller than its host's area allows (the area's height less comp.snackbar.container.margin above and below, inside the safe area, clear of what the frame keeps over the top and the bottom of the area (APS-17), and above the on-screen keyboard) THE snackbar SHALL take that height and scroll its text inside the bar, keeping the status glyph, the controls and an action on its own row in place; WHILE the text scrolls it SHALL be reachable by keyboard (a focus stop, scrolled by the arrow keys, Page Up and Page Down), named by the title when there is one, and scrolled by wheel, trackpad and touch."},{"id":"SNK-26","text":"WHILE the system's icon set cannot yet draw a glyph of the snackbar (its font is still loading) — the status glyph, or the glyph it gives the expand or the close button — THE snackbar SHALL draw nothing in that glyph's place, never the glyph's name as text, SHALL keep the glyph's box, and SHALL draw the glyph once the set can; statusLabel, expandLabel and closeLabel SHALL still reach assistive technology."},{"id":"SNK-27","text":"THE snackbar SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the snackbar is shown THE snackbar SHALL draw itself for the new direction at once, without a motion of its own, keeping its open state, the time left before it closes and its focus."},{"id":"SNK-28","text":"THE snackbar SHALL lay out its title, its message and its action's label as text of its own direction, isolated from the text around it: each takes the base direction of its first strong character, or the layout direction where it has none, so that a left-to-right word, a number with its sign or unit, a telephone number and an address keep their own order in a right-to-left layout and reorder nothing beside them; THE snackbar SHALL still place each and align its lines by the layout direction, not by the text's own, and SHALL cut a title or a message cut by a line limit that does not fit (SNK-23) at the end of its own direction, so that a left-to-right label in a right-to-left layout loses its right end and never its beginning."},{"id":"SNK-29","text":"THE snackbar SHALL align its content to the top of the bar. It SHALL centre the first line of the text (the title's, or the message's without a title) half of comp.snackbar.container.min-height below the bar's top edge, or lower where comp.snackbar.container.padding-block plus half that line's height is more (enlarged text), and SHALL centre the status glyph and every control of the first row (the action while it is beside the text, the expand button and the close button) on that line; every further line of the text follows below it, an action on its own row (SNK-16) follows the text, and any height the bar has beyond its content SHALL lie below the content, never above it. WHEN the bar expands or collapses (SNK-24), and WHEN its text is cut or shown whole (SNK-23), the status glyph, the first line of the title and of the message, and every control of the first row SHALL keep their distance from the bar's top edge, during the motion and after it; an action on its own row SHALL keep its distance from the bar's bottom edge."},{"id":"SNK-30","text":"THE snackbar SHALL be drawn inverse WHILE inverse is true, or WHILE inverse is null and comp.snackbar.container.inverse is on; otherwise (inverse false, or null where that choice is off) it SHALL be drawn on a surface of the scheme, from the unprefixed tokens or its status form's (SNK-21). WHILE it is drawn inverse and status is default THE snackbar SHALL draw the bar, the title and the message in comp.snackbar.inverse.container.color, comp.snackbar.inverse.title.color and comp.snackbar.inverse.supporting-text.color, and every state of the action from the parts prefixed with inverse (comp.snackbar.action.inverse.container.color and comp.snackbar.action.inverse.content.color), and give the expand and close buttons that form's tone (SNK-34). WHILE it is drawn inverse and status is info, warning, error or success it SHALL draw that status's inverse form the same way, from the parts prefixed with inverse- and the status: for info comp.snackbar.inverse-info.container.color, comp.snackbar.inverse-info.title.color, comp.snackbar.inverse-info.supporting-text.color, comp.snackbar.inverse-info.icon.color, comp.snackbar.inverse-info.outline.color for its edge (SNK-31), comp.snackbar.action.inverse-info.container.color and comp.snackbar.action.inverse-info.content.color, and for warning, error and success their own tokens of the same names. Under the default system each color of a status's inverse form SHALL be the color the same part of that status's form not drawn inverse has in the scheme of the other theme at the same contrast level (light for dark, light-medium for dark-medium, light-high for dark-high, and each the other way): the bar, the title, the message, the glyph, the edge, the focus indicator, every state of the action and the tone of the expand and close buttons, so that the inverse form of a status in one theme and its form on a surface in the other differ only in what lies around the bar. Being drawn inverse SHALL change colors only: the bar's elevation, corners, sizes and layout, the glyphs, the width and the opacity of a status form's edge, the opacities of the glyph, of a message under a title and of the action's tonal layer, the motion, the timing, the announcement and the keyboard behaviour SHALL be those of the same snackbar not drawn inverse. WHEN inverse or the system's choice changes while the snackbar is shown THE snackbar SHALL draw the other form at once, keeping its open state, the time left before it closes and its focus."},{"id":"SNK-31","text":"WHILE status is info, warning, error or success THE snackbar SHALL draw its form's edge: a line comp.snackbar.outline.width wide around the bar, outside the bar's bounds and following its corners, where the ring of comp.snackbar.container.elevation lies (the layer of that elevation with no offset, no blur and a positive spread), over that ring and above the elevation's shadows, in the form's outline color drawn at comp.snackbar.outline.opacity: comp.snackbar.info.outline.color for info, comp.snackbar.inverse-info.outline.color for info drawn inverse (SNK-30), and warning's, error's and success's tokens of the same names. The edge SHALL NOT change the bar's size or the place of anything inside or around it, and the focus indicator of a control SHALL be drawn above it. WHILE status is default THE snackbar SHALL draw no edge of its own, drawn inverse or not: the ring of its elevation shows alone, as on every raised surface. WHERE comp.snackbar.outline.opacity is 0 a status form SHALL draw no edge either."},{"id":"SNK-32","text":"WHILE title is not empty THE snackbar SHALL draw the message at comp.snackbar.supporting-text.under-title.opacity: an opacity of the message's text alone, applied to its form's message color (SNK-15), in every form, collapsed and expanded. WHILE title is empty it SHALL draw the message whole, and it SHALL draw the title whole in every form. The message so drawn SHALL keep 4.5:1 against its bar in every scheme of the default system, and 7:1 in its high-contrast schemes; what assistive technology reads SHALL NOT change with it."},{"id":"SNK-33","text":"THE snackbar SHALL draw the action's tonal layer in every form and in every state of the action: the action's content color of that form and state, at comp.snackbar.action.tonal-layer.opacity, filling the action's container to its corners, above the container color of that state (SNK-2) and above a ripple that grows on it (SNK-6), and under the label. The layer is the action's alone, SHALL NOT take a press or change the action's size, and SHALL NOT be drawn WHERE comp.snackbar.action.tonal-layer.opacity is 0, where the action is its container alone. The label SHALL keep 4.5:1 against the action as drawn (the container color of the state with the layer over it) in every form, state and scheme of the default system, and 7:1 in its high-contrast schemes."},{"id":"SNK-34","text":"WHILE closable is true, and WHILE the expand button is drawn (SNK-23), THE snackbar SHALL draw that button, in the place SNK-15, SNK-16 and SNK-29 give it, as an icon-only Button of the size comp.snackbar.close-button.size names showing a glyph of the system's icon set (close; expand_more or expand_less, SNK-23) and named by closeLabel or expandLabel, in the variant comp.snackbar.close-button.variant names and in the tone of the snackbar's form (BTN-45): the form's message color — comp.snackbar.supporting-text.color in the default form, and the token of that name under the form's prefix in every other (SNK-21, SNK-30) — with the form's focus-ring color (SNK-3) for its focus indicator, both given through the channel a Button reads from the component that places it, and otherwise unrestyled: it reads Button's own tokens for its size, glyph size, corners and state opacities, answers hover, focus and press as any Button does, and keeps its own minimum target (BTN-5). WHEN the snackbar's form changes while it is shown THE snackbar SHALL give the buttons the new form's tone with the new form's colors (SNK-30). THE snackbar SHALL draw no close or expand mark of its own (no path, shape or character of its own), and the expand button SHALL expose to assistive technology whether the text is expanded and which text it shows and hides (SNK-24)."},{"id":"SNK-35","text":"WHILE placement is top-end THE host SHALL place the snackbar at the top of its area, at its end side (the right in a left-to-right layout and the left in a right-to-left one, taken from where the host is used as SNK-27 says), comp.snackbar.container.margin below the top edge and comp.snackbar.container.margin from the end edge, inside the safe area and below what the frame keeps over the top of the area (how far its header reaches over it, whatever scrolls, APS-17), so that it never covers a top app bar; WHILE the area is narrower than comp.snackbar.breakpoint.medium (a compact window) it SHALL draw the snackbar across the top of the area instead, as wide as the area less comp.snackbar.container.margin on each side, within comp.snackbar.container.max-width. WHEN the product asks for a snackbar without a placement THE host SHALL give it the placement the host itself is given, and bottom where it is given none. The placement SHALL NOT change the snackbar's layer (SNK-13), its other size bounds (SNK-14), its place in the focus order (SNK-11) or its announcement (SNK-10), and the host SHALL still show one snackbar at a time, in order (SNK-12): at the top as at the bottom, a snackbar asked for while another shows waits for it to close, and no two are stacked."},{"id":"SNK-36","text":"WHILE placement is top-end, WHEN a snackbar is shown THE snackbar SHALL make its bar appear as SNK-17 says, grown from the middle of its top edge and travelling sys.motion.appear.distance down into place, the mirror of the bottom; WHEN it closes it SHALL take the bar back up the same way, as SNK-17 says, and WHERE motion is reduced it SHALL only fade in and out, over sys.motion.role.reduced, or appear and disappear at once where the platform removes every animation."},{"id":"SNK-37","text":"WHILE placement is top-end, WHEN the bar expands or collapses (SNK-24) THE snackbar SHALL grow downward and shrink back with its top edge in place, so that, its content being aligned to the top (SNK-29), nothing of its first row moves on the screen during the motion or after it; WHILE it is expanded it SHALL be at most as tall as SNK-25 allows, the area's height being measured from below what the frame keeps over its top (SNK-35)."},{"id":"SNK-38","text":"WHILE a Tanrei modal surface is open — a dialog, a modal layer, a modal side sheet or bottom sheet, a modal navigation drawer, an image preview, a popover shown as a sheet, a search's dialog or full-screen view, a modal date-time picker — THE host SHALL show its snackbar inside the topmost one, so that while everything outside that surface is inert the snackbar is drawn above the surface and its scrim, at the place SNK-13 and SNK-35 give it, can be pressed, is reached by keyboard and is announced (SNK-10). WHEN a snackbar is requested while a modal surface is open it SHALL show in its turn (SNK-12) without waiting for the surface to close. WHEN a modal surface opens while a snackbar shows, and WHEN the surface a snackbar shows in closes or is taken away, THE host SHALL move the snackbar into the surface that is then the topmost, or back to the host where none is open, at once and without its entrance motion (SNK-17), keeping it open, its expanded state and its place in the queue, and SHALL NOT announce it again. Inside a modal surface the snackbar's controls SHALL come after the surface's own in its focus order, within the surface's focus containment, and THE snackbar SHALL take its layout direction from that surface (SNK-27). A press, a key or a wheel inside the snackbar SHALL act on the snackbar alone and never on the surface — a press there is not a press on the surface's scrim, an arrow key does not move the surface's content, Escape closes the snackbar and leaves the surface open (SNK-11) — except Tab, which moves through the surface's focus order."},{"id":"SNK-39","text":"WHERE a keyboard is attached, WHEN the user presses F6 or Shift+F6 while the host shows a snackbar that has a focus stop (SNK-11) and focus is not inside it THE host SHALL move keyboard focus to the snackbar's first focus stop in the order SNK-11 gives, showing its focus indicator (SNK-3), from wherever focus is — in the page, or in the modal surface the snackbar shows in (SNK-38); WHEN the user presses F6 or Shift+F6 while focus is inside the snackbar THE host SHALL move focus back to the element that had it before focus entered the snackbar or, where that element no longer exists or cannot take focus, to the platform's default. THE host SHALL offer the product a call that moves focus to the snackbar in the same way, for a shortcut of its own, and that tells whether focus moved. WHILE no snackbar is shown, or the one shown has no focus stop, and WHERE the product has already handled the key, THE host SHALL leave F6 to the meaning the platform or the product gives it. Moving focus to or from the snackbar SHALL NOT close it or announce it again; while focus is inside it its timeout pauses (SNK-9), and closing it returns focus as SNK-11 says."}],"accessibility":{"role":"status","keyboard":[{"keys":"Tab","action":"Reaches, at the host's place in the focus order, the text while it scrolls, then the action, the expand button and the close button. Showing a snackbar never moves focus."},{"keys":"Enter or Space","action":"Activates the focused action, expand button or close button."},{"keys":"Arrow keys, Page Up, Page Down","action":"While the expanded text scrolls and has focus, scroll it."},{"keys":"Escape","action":"While focus is inside the snackbar, closes it (dismiss, reason escape)."},{"keys":"F6 or Shift+F6","action":"While a snackbar with a control is shown and focus is elsewhere, moves focus to its first control (the text while it scrolls, else the action, the expand button or the close button); from inside the snackbar, moves focus back to where it was. Without such a snackbar, or once the product has handled the key, the key keeps its own meaning."}],"labeling":"The snackbar is a live region: polite in the default, info and success forms (the status role on the web) and assertive in the warning and error forms (the alert role on the web). When it appears it announces, once, statusLabel, the title, the whole message and the action's label. The status glyph is hidden from assistive technology; statusLabel gives the status in words. The action's name is its label; the close button's name is closeLabel; the expand button's name is expandLabel, and it exposes whether the text is expanded. The bar itself is not a tab stop; its text is one only while it scrolls.","minimumTarget":true,"notes":["WCAG 2.2.1 (timing adjustable): by default (auto) a snackbar with an action never times out. A product may time one out (short or long), but then the action must also be available elsewhere (Undo in a menu or a history), because a person who is slow, zoomed-in or using a screen reader may not reach it in time. The timeout pauses while the snackbar is hovered, focused or expanded, and Android's accessibility timeout lengthens it.","A snackbar reports; it does not ask. A choice between two actions, an error that blocks the person's work, or anything they must acknowledge belongs in a dialog or next to what it is about. The error form is for a failure the person can come back to (a message not sent, with Retry).","The action is a tonal button so that an undo is seen at once: its label is the strongest thing in it (at least 9.1:1 on the action at rest and 6.9:1 in its weakest state, in every form and scheme of the default system), and the action is one quiet step off its bar, the same step in every form (1.25–1.45:1 against the bar in all ten forms and six schemes), so it never outweighs the message and never weighs more on one status than on another. A button with a visible label needs no boundary contrast (WCAG 1.4.11). An action important enough to seem to want a filled button does not belong in a snackbar: put a Main Action Button in a bottom sheet instead.","WCAG 2.4.13 and 1.4.11 (focus appearance, non-text contrast): the focus indicator is drawn on the bar, so its color is the form's (SNK-3). On the default form's surface it is the system's focus color, which the build holds against every surface role; on a status bar and on an inverse bar it is that bar's content color, which the build holds against the bar at 4.5:1 or more. The system's focus color alone is held against no status bar and falls under 3:1 on the inverse surface in five of the six schemes.","Drawn inverse or not, a snackbar is the same message: the role, the announcement, the focus order and the timing do not change with its colors (SNK-30). A product should not use inverse to mean something (an inverse bar for important messages): that is what the status forms and statusLabel are for.","WCAG 1.4.1 (use of color): a status form is never told by color alone. It draws the status's glyph, a shape of the icon set, and gives statusLabel, the status in words, to assistive technology (SNK-21).","WCAG 1.4.3 and 1.4.11 (contrast): three parts are drawn at an opacity of their own color, so their contrast is that of the color as drawn, not of the role. In the default system the message under a title keeps at least 7.1:1 on its bar (7.6:1 in the high-contrast schemes) and the status glyph at least 3.6:1, in every form and scheme (SNK-32, SNK-21); a status form's edge is decoration beside the glyph and statusLabel and is held to nothing (SNK-31). A system that changes one of these opacities, or the colors under them, must keep 4.5:1 for the message and 3:1 for the glyph.","WCAG 1.4.11 (non-text contrast): the expand and close buttons are Buttons in the form's tone (SNK-34): the glyph is the bar's message color, and the circle under it is that color at comp.button.tone.container.opacity over the bar. In the default system the glyph keeps at least 8.0:1 against its circle at rest and 6.2:1 in its weakest states (focused and pressed), in all ten forms and six schemes — well above the 3:1 a glyph without a label needs. A system that changes the tone's opacity, the state-layer opacities or a form's colors must keep 3:1 for the glyph against the circle in every state.","Text size never hides text for good: a collapsed title or message ends with an ellipsis at its line limit and the expand button shows the rest (SNK-23); the action moves to its own row (SNK-16); an expanded bar taller than the window scrolls inside it (SNK-25).","WCAG 4.1.3 and 2.1.1 (status messages, keyboard): a modal surface makes everything outside it inert — out of reach of the pointer, the keyboard and assistive technology. A notice raised behind it would be neither heard nor operable until the surface closed, an Undo then unreachable when it matters; so the host shows the snackbar inside the topmost modal surface (SNK-38), as the major design systems do (a toaster placed inside the dialog, or a toast layer the modal leaves operable). It stays a status message: it takes no focus and never closes the surface.","WCAG 2.1.1 and 2.4.3 (keyboard, focus order): a snackbar's controls are at the end of the focus order (SNK-11), a long walk from where the person works. F6, the key with which browsers and desktop apps move between a window's regions (and the one a toast region answers in the major design systems), takes focus to the snackbar in one key and back again (SNK-39), and still means what it meant while no snackbar with a control is shown. A product that wants a shortcut of its own (an Undo on Command+Option+Z) calls the host's focus call from it; one that gives F6 another meaning handles it first, and the host leaves it alone.","Web: `<tanrei-snackbar-host>` is placed by the product, normally as the last element of the page (its place in the focus order). It shows `<tanrei-snackbar>` elements as `popover=\"manual\"`, so they are in the top layer, and exposes `show(options): Promise<{ result: 'action' | 'dismiss', reason? }>` (whose options include `inverse`), `dismissCurrent()`, `clear()` and `focusCurrent(): boolean` (SNK-39: focus to the showing snackbar's first control, as F6 does; whether it moved). It hears F6 on the window as the key bubbles out of the page and leaves one that is `defaultPrevented`. The live regions are the host's two, which are always in the document, so screen readers register them before the first message is inserted: one with the status role (polite) for the default, info and success forms, one with the alert role (assertive) for warning and error. While a Tanrei modal surface is open the host shows the snackbar, and announces it, in a box it puts inside the topmost surface's `<dialog>`, with two live regions of its own made as that surface opens (SNK-38). The expand button carries `aria-expanded` and `aria-controls` naming the text.","SwiftUI, Compose, Flutter and React Native announce with the platform's own call, at default priority for the polite forms and at high priority for warning and error: AccessibilityNotification.Announcement with the speech announcement priority, a polite or assertive liveRegion, SemanticsService.announce with its assertiveness, and AccessibilityInfo.announceForAccessibility (announceForAccessibilityWithOptions with queue off for assertive on iOS). None of them takes focus. The expand button's state is the platform's expanded/collapsed semantics (Compose's expand and collapse actions, Flutter's expanded flag, React Native's accessibilityState.expanded, and on Apple platforms the expanded and collapsed value VoiceOver reads for a disclosure).","How a state looks is a value decision of the active design system; components read the state's tokens and never compute the effect themselves."]},"tokens":"comp.snackbar","fixtures":[{"id":"message","props":{"message":"Photo saved"}},{"id":"action","props":{"message":"Conversation archived","action":"Undo"}},{"id":"closable","props":{"message":"Connected to the office printer","closable":true,"closeLabel":"Close"}},{"id":"action-closable","props":{"message":"Conversation archived","action":"Undo","closable":true,"closeLabel":"Close"}},{"id":"two-lines","props":{"message":"Your changes were saved, but the shared copy is out of date.","action":"Retry"}},{"id":"action-own-row","props":{"message":"Three files could not be uploaded because they are larger than the limit for this folder.","action":"Review files that failed"}},{"id":"title","props":{"title":"Draft deleted","message":"The draft was moved to the bin.","action":"Undo"}},{"id":"info","props":{"status":"info","statusLabel":"Information","title":"Update ready","message":"Restart the app to finish installing it.","closable":true,"closeLabel":"Close"}},{"id":"warning","props":{"status":"warning","statusLabel":"Warning","title":"Storage almost full","message":"Only 200 MB is left on this device.","action":"Manage"}},{"id":"error","props":{"status":"error","statusLabel":"Error","title":"Message not sent","message":"Check your connection and try again.","action":"Retry","closable":true,"closeLabel":"Close"}},{"id":"success","props":{"status":"success","statusLabel":"Success","message":"Backup finished"}},{"id":"collapsed","props":{"title":"Some photos were not uploaded","message":"Twelve photos from the trip to Kyoto could not be uploaded because the shared album is full. Free some space in the album or choose another one, then try again from the Uploads page. The photos stay on this device until they are uploaded.","closable":true,"closeLabel":"Close","expandLabel":"Show full message"}},{"id":"expanded","props":{"title":"Some photos were not uploaded","message":"Twelve photos from the trip to Kyoto could not be uploaded because the shared album is full. Free some space in the album or choose another one, then try again from the Uploads page. The photos stay on this device until they are uploaded.","closable":true,"closeLabel":"Close","expandLabel":"Show full message","expanded":true}},{"id":"expanded-scrolls","props":{"status":"warning","statusLabel":"Warning","title":"Some photos were not uploaded","message":"Twelve photos from the trip to Kyoto could not be uploaded because the shared album is full. Free some space in the album or choose another one, then try again from the Uploads page. The photos stay on this device until they are uploaded. Photos that are uploaded later keep the date and place they were taken, and they are added to the album in the order they were taken, not the order they were uploaded. If you leave the album, the photos you added stay in it; ask the album's owner to remove them. Uploads pause while the device is on a metered connection or its battery is low, and they continue by themselves when that changes.","action":"Review","closable":true,"closeLabel":"Close","expandLabel":"Show full message","expanded":true}},{"id":"inverse","props":{"message":"Conversation archived","action":"Undo","inverse":true,"closable":true,"closeLabel":"Close"}},{"id":"inverse-info","props":{"status":"info","statusLabel":"Information","inverse":true,"title":"Update ready","message":"Restart the app to finish installing it.","action":"Restart","closable":true,"closeLabel":"Close"}},{"id":"inverse-warning","props":{"status":"warning","statusLabel":"Warning","inverse":true,"title":"Storage almost full","message":"Only 200 MB is left on this device.","action":"Manage","closable":true,"closeLabel":"Close"}},{"id":"inverse-error","props":{"status":"error","statusLabel":"Error","inverse":true,"title":"Message not sent","message":"Check your connection and try again.","action":"Retry","closable":true,"closeLabel":"Close"}},{"id":"inverse-success","props":{"status":"success","statusLabel":"Success","inverse":true,"title":"Backup finished","message":"Everything on this device is saved.","action":"View","closable":true,"closeLabel":"Close"}},{"id":"inverse-expanded","props":{"inverse":true,"title":"Some photos were not uploaded","message":"Twelve photos from the trip to Kyoto could not be uploaded because the shared album is full. Free some space in the album or choose another one, then try again from the Uploads page. The photos stay on this device until they are uploaded.","closable":true,"closeLabel":"Close","expandLabel":"Show full message","expanded":true}},{"id":"top-end","props":{"message":"Report exported to Downloads","action":"Open","closable":true,"closeLabel":"Close","placement":"top-end"}},{"id":"top-end-rtl","direction":"rtl","props":{"message":"Report exported to Downloads","action":"Open","closable":true,"closeLabel":"Close","placement":"top-end"}},{"id":"top-end-compact","props":{"message":"Report exported to Downloads","action":"Open","closable":true,"closeLabel":"Close","placement":"top-end"}}],"platforms":{"web":{"status":"lagging","name":"tanrei-snackbar","props":{"message":"message","title":"headline","action":"action","status":"status","statusLabel":"statusLabel","inverse":"inverse","closable":"closable","closeLabel":"closeLabel","expanded":"expanded","expandLabel":"expandLabel","duration":"duration","placement":"placement"},"events":{"action":"action","dismiss":"dismiss","toggle":"expandedchange"},"parts":{"container":"container","outline":"container@outline","icon":"icon","title":"title","supporting-text":"supporting-text","action":"action","expand":"expand","close":"close","focus-ring":"action@focus-ring"},"notes":"`title` is the `headline` property and attribute, because HTML's global `title` attribute would show a tooltip over the whole bar (as the app bar's). `closeLabel`, `statusLabel` and `expandLabel` are the `close-label`, `status-label` and `expand-label` attributes. `inverse` is a property that is `true`, `false` or `null` (the default); the `inverse` attribute sets it: absent is null, present (empty or `true`) is true, and `inverse=\"false\"` is false, the one way to refuse a system whose choice is on. While it is null the snackbar reads `--tanrei-comp-snackbar-container-inverse` from the cascade, which carries the choice's name (SNK-30). The opacities of SNK-21, SNK-31, SNK-32 and SNK-33 are applied to the color of the part they name (a mix of that color with transparent), never as an element's `opacity`, so nothing else fades with it; a status form's edge is a shadow layer of its own before the elevation's, and the tonal layer lies inside the action, under its label. The focus indicator's color is the form's `focus-ring-color` custom property, handed to the shared focus primitive (SNK-3). The expand and close buttons are `<tanrei-button size=\"small\">` elements in the snackbar's shadow root, given the variant `--tanrei-comp-snackbar-close-button-variant` names and the form's tone through the Button's internal channel (SNK-34); the expand button's expanded state and the text it controls are written on the Button's own native button (`aria-expanded`, and `ariaControlsElements`, since an id cannot be named across the Button's shadow root). `dismiss` is a CustomEvent whose `detail.reason` is the reason. `toggle` is the `expandedchange` CustomEvent, whose `detail.expanded` is the new value, because a popover element already fires a native `toggle` when it is shown and hidden. The host (`<tanrei-snackbar-host>`) queues and places snackbars; `show(options)` takes `title`, `status`, `statusLabel`, `inverse` and `expandLabel` as well; see the accessibility notes. A Tanrei modal surface is one opened modally with `showModal()` on a native `<dialog>` in its shadow root; while one is open the host moves the snackbar into a box it appends to the topmost one's `<dialog>` (out of its flow, with two live regions of its own) and back when it closes (SNK-38). There the snackbar is in that surface's shadow tree: a page's own rules that select `tanrei-snackbar` or its parts do not reach it, so style it through its tokens, and its `action`, `dismiss` and `expandedchange` events bubble no further than that tree, so listen on the snackbar or use what `show()` resolves with. The box stops what the person does in the snackbar — a key other than Tab, a press, a wheel — from reaching the surface. `placement` is the `placement` attribute of `<tanrei-snackbar>` and of `<tanrei-snackbar-host>`: the host's is the placement of each snackbar whose `show()` options name none (SNK-35). What the frame keeps over the top and the bottom of the area is `--tanrei-app-shell-window-inset-top` and `--tanrei-app-shell-window-inset-bottom` on the document's root, which `<tanrei-app-shell>` sets, whatever scrolls, to how far its header and its navigation bar reach over the window (APS-17) and a product's own frame may set; the safe area is `env(safe-area-inset-*)`. A compact window is one narrower than `--tanrei-comp-snackbar-breakpoint-medium`, read by the stylesheet itself, with no listener. Snapshot harness: each fixture is a `<tanrei-snackbar>` rendered outside a host (SNK-19), on a 400 px wide stage; `expanded-scrolls` on a stage 400 × 240, and `top-end` and `top-end-rtl` on a stage 720 wide, wider than a compact window."},"swiftui":{"status":"lagging","name":"TanreiSnackbar","props":{"message":"message","title":"title","action":"actionLabel","status":"status","statusLabel":"statusLabel","inverse":"inverse","closable":"withCloseButton","closeLabel":"closeLabel","expanded":"isExpanded","expandLabel":"expandLabel","duration":"duration","placement":"placement"},"events":{"action":"TanreiSnackbarResult.action","dismiss":"TanreiSnackbarResult.dismissed","toggle":"onExpandedChange"},"notes":"Lagging: ships an earlier form of the snackbar: always an inverse bar, with a text action, no status forms, no title, no expansion and no `inverse`. A host is a `@Observable` `TanreiSnackbarHost` attached with `.tanreiSnackbarHost(_:)` on the view whose bottom edge it uses; `await host.show(message:actionLabel:withCloseButton:closeLabel:duration:)` returns a `TanreiSnackbarResult` (`.action`, or `.dismissed(reason)`) once the snackbar has closed. It is drawn in an overlay of that view, not in a sheet, which would be modal. Snapshot harness: `TanreiSnackbar` rendered in place (SNK-19) in a 400-point frame. `inverse` is a `Bool?`, nil by default. Not yet: the top-end placement (SNK-35, SNK-36, SNK-37); the expand and close buttons as small Buttons in the form's tone (SNK-34); the title's letter-spacing by the script of its text (SNK-22, PRS-20); the snackbar shown inside the topmost modal surface (SNK-38); focus moved to the snackbar and back with F6 (SNK-39)."},"compose":{"status":"lagging","name":"TanreiSnackbar","props":{"message":"message","title":"title","action":"actionLabel","status":"status","statusLabel":"statusLabel","inverse":"inverse","closable":"withDismissAction","closeLabel":"closeLabel","expanded":"expanded","expandLabel":"expandLabel","duration":"duration","placement":"placement"},"events":{"action":"TanreiSnackbarResult.ActionPerformed","dismiss":"TanreiSnackbarResult.Dismissed","toggle":"onExpandedChange"},"notes":"Lagging: ships an earlier form of the snackbar: always an inverse bar, with a text action, no status forms, no title, no expansion and no `inverse`. Shaped like Material's snackbar API: `TanreiSnackbarHost(hostState)` is placed in the layout (for example a scaffold's snackbar slot), and `hostState.showSnackbar(message, actionLabel, withDismissAction, closeLabel, duration)` suspends until the snackbar has closed and returns the result; cancelling the coroutine closes it with the reason host. The recommended timeout is `AccessibilityManager.calculateRecommendedTimeoutMillis`. Snapshot harness: `TanreiSnackbar(message = …)` rendered in place (SNK-19) in a 400 dp wide box. `inverse` is a `Boolean?`, null by default. Not yet: the top-end placement (SNK-35, SNK-36, SNK-37); the expand and close buttons as small Buttons in the form's tone (SNK-34); the title's letter-spacing by the script of its text (SNK-22, PRS-20); the snackbar shown inside the topmost modal surface (SNK-38); focus moved to the snackbar and back with F6 (SNK-39)."},"flutter":{"status":"lagging","name":"TanreiSnackbar","props":{"message":"message","title":"title","action":"actionLabel","status":"status","statusLabel":"statusLabel","inverse":"inverse","closable":"showCloseIcon","closeLabel":"closeIconLabel","expanded":"expanded","expandLabel":"expandLabel","duration":"duration","placement":"placement"},"events":{"action":"TanreiSnackbarClosedReason.action","dismiss":"TanreiSnackbarClosedReason","toggle":"onExpandedChanged"},"notes":"Lagging: ships an earlier form of the snackbar: always an inverse bar, with a text action, no status forms, no title, no expansion and no `inverse`. Shaped like Flutter's `ScaffoldMessenger`: a `TanreiSnackbarMessenger` placed around the page, inside its route, hosts the queue (so a Tanrei dialog's route covers it), and `TanreiSnackbarMessenger.of(context).show(TanreiSnackbar(...))` returns a controller whose `closed` future completes with a `TanreiSnackbarClosedReason` (`action`, `close`, `escape`, `timeout`, `host`). `showCloseIcon` is Flutter's own name for the close button. A running screen reader is `MediaQuery.accessibleNavigation` (as Flutter's own SnackBar reads it); Android's recommended timeout needs a platform channel, since Flutter does not expose it. Snapshot harness: a golden of `TanreiSnackbar` rendered in place (SNK-19) in a 400-wide surface. `inverse` is a `bool?`, null by default. Not yet: the top-end placement (SNK-35, SNK-36, SNK-37); the expand and close buttons as small Buttons in the form's tone (SNK-34); the title's letter-spacing by the script of its text (SNK-22, PRS-20); the snackbar shown inside the topmost modal surface (SNK-38); focus moved to the snackbar and back with F6 (SNK-39)."},"react-native":{"status":"lagging","name":"Snackbar","props":{"message":"message","title":"title","action":"actionLabel","status":"status","statusLabel":"statusLabel","inverse":"inverse","closable":"closable","closeLabel":"closeLabel","expanded":"expanded","expandLabel":"expandLabel","duration":"duration","placement":"placement"},"events":{"action":"onAction","dismiss":"onDismiss","toggle":"onExpandedChange"},"notes":"Lagging: ships an earlier form of the snackbar: always an inverse bar, with a text action, no status forms, no title, no expansion and no `inverse`. `TanreiProvider` renders the host in its root overlay layer, not in a `Modal` (a `Modal` is modal and takes focus); `useSnackbar().show({ message, actionLabel, closable, closeLabel, duration })` returns a promise of the result. A `Snackbar` element rendered directly is drawn in place (SNK-19). Snapshot harness: `Snackbar` rendered in place in a 400-wide view. `inverse` is `boolean | null | undefined`; both null and undefined take the system's choice. Not yet: the top-end placement (SNK-35, SNK-36, SNK-37); the expand and close buttons as small Buttons in the form's tone (SNK-34); the title's letter-spacing by the script of its text (SNK-22, PRS-20); the snackbar shown inside the topmost modal surface (SNK-38); focus moved to the snackbar and back with F6 (SNK-39)."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"split-view","title":"Split view","summary":"Divides a region into two panes side by side or one above the other, with a Handle on the line between them that a person drags, steps from the keyboard or presses to give one pane more room, and, where the product allows it, to fold one pane away and bring it back.","level":"composed","listing":"default","builtFrom":["handle"],"anatomy":[{"id":"start-pane","description":"The pane at the start: the inline-start side while the panes stand side by side, the top while one stands above the other. It takes its size from the split and holds the product's content, clipped to it."},{"id":"end-pane","description":"The pane at the end, which takes the room the start pane and the divider leave, or the other way round when it is the primary pane."},{"id":"divider","description":"The hairline between the two panes, across the whole region."},{"id":"handle","description":"The Handle, centred on the divider: medium, with the axis of the split, its value the primary pane's share. Its target reaches over both panes; its drawing, states, cursor and keys are the Handle's own."}],"props":[{"name":"axis","type":"enum","values":["horizontal","vertical"],"default":"horizontal","description":"Which size the split divides, as the Handle names it. horizontal: the width — the panes stand side by side and the divider is upright. vertical: the height — one pane stands above the other and the divider lies across."},{"name":"primary","type":"enum","values":["start","end"],"default":"start","description":"Which pane the value measures and which one folds away: the start pane (a list beside its detail, a navigation beside a page) or the end pane (an inspector after a canvas). The other pane takes the rest."},{"name":"value","type":"number","default":50,"description":"The primary pane's share of the region's size along the axis, less the divider, in percent. It is drawn held between the least and the greatest share (SPV-16) and kept as given while the region's size changes. While the pane is folded away it is the share the pane comes back at. The split view writes it as the person moves the divider; the product may set it."},{"name":"min","type":"number","default":10,"description":"The least share of the primary pane, in percent, while it is not folded away. minSize may hold it larger (SPV-16)."},{"name":"max","type":"number","default":90,"description":"The greatest share of the primary pane, in percent: 100 less the least share the other pane keeps. maxSize may hold it smaller (SPV-16)."},{"name":"minSize","type":"number","default":null,"description":"The least size of the primary pane in pixels along the axis, while it is not folded away, on top of min (\"the list is never narrower than 240\"). Null sets none. Where the region is too small for both minSize and maxSize, minSize wins (SPV-16)."},{"name":"maxSize","type":"number","default":null,"description":"The greatest size of the primary pane in pixels along the axis, on top of max. Null sets none (SPV-16)."},{"name":"step","type":"number","default":5,"description":"How far one arrow key moves the divider, in percent of the region."},{"name":"largeStep","type":"number","default":20,"description":"How far Shift with an arrow key, Page Up or Page Down moves the divider, in percent of the region."},{"name":"resetValue","type":"number","default":50,"description":"The share a press on the Handle without a drag, Enter or Space moves the primary pane to while it cannot be folded away; the next press moves it back to where it was (SPV-7)."},{"name":"collapsible","type":"boolean","default":false,"description":"Lets the primary pane be folded away: by Enter or a press on the Handle, and by a drag past half its least share. Its content is then not drawn, not reachable and not read, and the divider stands at the region's edge to bring it back."},{"name":"collapsed","type":"boolean","default":false,"description":"Whether the primary pane is folded away. The split view writes it as the person folds and restores the pane; the product may set it. Ignored while collapsible is false."},{"name":"label","type":"string","default":"","description":"The Handle's accessible name, saying what the divider resizes in the product's words (\"Resize the message list\"); the primary pane's own heading, where it has one, is a good name. Never drawn. Required: a split view without one still works, and its Handle reports the missing name in debug builds (HDL-8)."},{"name":"valueText","type":"string","default":"","description":"Read in place of the percentage where another reading is natural (\"List 320 pixels wide\"), as the Handle's value text; the split view does not write it. Empty reads the percentage."},{"name":"disabled","type":"boolean","default":false,"description":"Keeps both panes at their sizes: the Handle is drawn as unavailable and cannot be moved, folded or reached by Tab (HDL-15). The panes' content stays as operable as it is."}],"slots":[{"name":"start","description":"The content of the start pane.","fixture":"text"},{"name":"end","description":"The content of the end pane.","fixture":"text"}],"events":[{"name":"resize","description":"The divider moved during a drag: emitted in every frame it moves, with the primary pane's share in percent and whether the pane is folded away."},{"name":"change","description":"The person changed the primary pane's share: once when a drag ends, and once for each key or press that moved it. Carries the new value. Not emitted when the product sets value."},{"name":"toggle","description":"The person folded the primary pane away or brought it back: by Enter, a press on the Handle or a drag. Carries the new collapsed value. Not emitted when the product sets collapsed."}],"states":["enabled","disabled","hovered","focused","pressed","dragged"],"behavior":[{"id":"SPV-1","text":"THE split view SHALL lay out its two panes along its axis — side by side WHILE axis is horizontal, the start pane at the inline-start; one above the other WHILE axis is vertical, the start pane on top — with a divider comp.split-view.divider.width thick in comp.split-view.divider.color between them across the whole region, the primary pane its share (value, held as SPV-16 says) of the region's size along the axis less the divider and the other pane the rest; each pane SHALL clip its content to its own box and SHALL draw nothing else of its own. THE split view SHALL take the size the layout gives it; WHILE axis is vertical it divides the height the layout gives it."},{"id":"SPV-2","text":"THE split view SHALL place one Handle centred on its divider, at size medium and with the axis of the split, its value the primary pane's share as drawn in whole percent, its min 0 WHILE collapsible is true and the least share (SPV-16) otherwise, and its max the greatest share, as the Handle draws and exposes them (HDL-1, HDL-5, HDL-8); its target SHALL reach over both panes without moving their content, and it SHALL be in the focus order after the start pane's content and before the end pane's. THE split view SHALL relate the Handle to the primary pane as the element it controls (the window splitter pattern's controls relation), where the platform has that relation, by the means the Handle gives whoever places it to relate it to another element (HDL-26 on the web)."},{"id":"SPV-3","text":"WHILE a drag holds the Handle (HDL-6) THE split view SHALL move the divider with the press, at every frame and without a motion of its own: the primary pane's share SHALL be the share it had when the drag began (0 WHILE it was folded away) plus the distance the Handle reports along the axis, as a share of the region less the divider, signed so that the divider moves the way the press moves, held between the least and the greatest share (SPV-16); THE split view SHALL emit resize at every frame the share drawn changes and, WHEN the drag ends and the share differs from the one the drag began with, change once with the new value. WHILE a drag lasts every embedded document in either pane SHALL take no pointer, so that the drag is not lost over it (HDL-6)."},{"id":"SPV-4","text":"WHILE collapsible is true and a drag holds the Handle THE split view SHALL fold the primary pane away WHEN the press moves the divider past half of the least share toward the pane, and bring it back at the least share WHEN the press moves it back past that point, at every frame and without a motion of its own; a pane a drag folds away SHALL keep the share it had when the drag began as its value, to come back at; WHEN the drag ends with the pane folded away or brought back THE split view SHALL emit toggle once with the new collapsed value."},{"id":"SPV-5","text":"WHEN the Handle emits step (HDL-9, HDL-10) THE split view SHALL move the divider at once, without a motion: the way the key points by step percent of the region for amount one and by largeStep for amount large, held between the least and the greatest share (SPV-16); to the least share for amount limit with direction −1 (Home) and to the greatest for amount limit with direction 1 (End) whichever pane is primary, as the window splitter pattern gives Home the primary pane's smallest size and End its largest; and SHALL emit change once WHEN the share changed. A step SHALL NOT fold the pane away. WHILE the pane is folded away, a step that would give it room and Home SHALL bring it back at the least share, and End at the greatest, emitting toggle and change; a step that would take room from it SHALL change nothing."},{"id":"SPV-6","text":"WHILE collapsible is true, WHEN the Handle emits activate (HDL-7: a press without a drag, Enter or Space) THE split view SHALL fold the primary pane away WHILE it is shown and bring it back at the share it had before WHILE it is folded away, over comp.split-view.motion.collapse-duration with comp.split-view.motion.collapse-easing, and emit toggle once with the new collapsed value; focus SHALL stay on the Handle."},{"id":"SPV-7","text":"WHILE collapsible is false, WHEN the Handle emits activate THE split view SHALL move the divider to the share resetValue gives the primary pane, held between the least and the greatest share, over comp.split-view.motion.collapse-duration with comp.split-view.motion.collapse-easing, and WHEN it emits activate again before the share was changed in another way SHALL move it back to the share it had before, emitting change once each time, so that two sizes are reached without a drag (WCAG 2.5.7); WHILE the share is resetValue already and there is no share before to go back to, activate SHALL change nothing."},{"id":"SPV-8","text":"WHILE the primary pane is folded away THE split view SHALL give it no size and draw nothing of it, SHALL make its content unreachable by focus and hidden from assistive technology, SHALL give the other pane the whole region less the divider, and SHALL keep the divider and the Handle at the region's edge on the folded pane's side, with the Handle's value 0, so that the pane can be brought back by every input that folded it."},{"id":"SPV-9","text":"WHEN the product sets value or collapsed after the first frame THE split view SHALL move the divider to the new place over comp.split-view.motion.resize-duration — over comp.split-view.motion.collapse-duration WHEN collapsed changes — with comp.split-view.motion.collapse-easing, going on from the place then shown WHEN it changes again during the motion (MOT-2), and SHALL emit neither change nor toggle; THE split view SHALL draw its first frame at its value without a motion (MOT-3), and WHERE motion is reduced SHALL move the divider at once (MOT-6)."},{"id":"SPV-10","text":"WHILE the divider moves by a motion (SPV-6, SPV-7, SPV-9) THE split view SHALL change the panes' sizes in the layout at every frame, their content laid out to the size then shown and fixed to each pane's start edge, and SHALL scroll nothing to bring a part of either into view (MOT-5)."},{"id":"SPV-11","text":"WHEN the region's own size changes — the window or an enclosing pane is resized or turned — THE split view SHALL keep the primary pane's share and lay both panes out again at once, without a motion, and emit nothing."},{"id":"SPV-12","text":"WHERE the layout direction is right-to-left and axis is horizontal THE split view SHALL place the start pane at the right and the end pane at the left, and the divider SHALL still move the way a press or an arrow key points (HDL-17), so that the Right Arrow moves it to the right whichever pane is primary; it SHALL take its layout direction from where it is used, SHALL have no direction setting of its own, and SHALL NOT mirror its panes' content."},{"id":"SPV-13","text":"WHILE disabled is true THE split view SHALL keep both panes at their sizes and the primary pane folded or shown as it is, and its Handle SHALL take no input and no focus (HDL-15); the panes' content SHALL stay as operable as it is."},{"id":"SPV-14","text":"WHERE the platform draws with a person's own forced colors THE split view SHALL draw its divider in the platform's text color; the Handle draws itself as HDL-16 says."},{"id":"SPV-15","text":"IF min is below 0, max above 100, min above max, or value, resetValue, step or largeStep is not a finite number, or step or largeStep is not above 0, THE split view SHALL use the default of each value it cannot use, hold value between the least and the greatest share, and in debug builds report the values; IF minSize or maxSize is neither null nor a finite number of 0 or more THE split view SHALL ignore it and in debug builds report it; WHEN axis or primary names a value the split view does not define it SHALL use the default and in debug builds report it; WHILE label is empty the Handle reports its missing name (HDL-8)."},{"id":"SPV-16","text":"THE split view SHALL hold the primary pane, while it is shown, between a least and a greatest share: the least the greater of min and minSize pixels as a share of the region's size along the axis less the divider, the greatest the lesser of max and maxSize pixels as such a share, each within 0 and 100; WHERE the region is too small for the least to stay at or below the greatest, the least SHALL win, as a least size wins over a greatest one in CSS. WHEN the region's size changes THE split view SHALL count both again and draw value held between them, keeping value as it was given (SPV-11)."}],"accessibility":{"role":"separator (the Handle: focusable, with a value) between two panes that have no role of their own","keyboard":[{"keys":"Tab","action":"Reaches the Handle between the start pane's content and the end pane's."},{"keys":"Arrow keys of the axis","action":"Move the divider by step percent the way the key points; with Shift by largeStep."},{"keys":"Page Up / Page Down","action":"Move the divider by largeStep."},{"keys":"Home / End","action":"Give the primary pane its least share (min, or minSize) or its greatest (max, or maxSize), whichever pane is primary."},{"keys":"Enter or Space","action":"While collapsible: fold the primary pane away, or bring it back where it was. Otherwise: move the divider to resetValue, and back."}],"labeling":"The Handle is named by label and exposes the primary pane's share in whole percent as its value (0 while the pane is folded away), with min (0 while collapsible, the least share otherwise) and the greatest share as max, valueText where given, and the primary pane as the element it controls. The panes are not landmarks of their own: a product that needs them as regions names a landmark inside each.","minimumTarget":true,"notes":["WAI-ARIA APG, Window Splitter: a focusable separator whose value is the primary pane's position, valuemin where the primary pane is smallest (typically 0), valuemax where it is largest, aria-controls naming the primary pane; arrow keys move it the way they point, Enter collapses and restores, Home gives the primary pane its smallest size and End its largest. Here Home and End stop at the least and the greatest share, and folding away is Enter's alone among the keys, so that a key held down never folds a pane by accident.","F6 to move between panes, which the pattern lists as optional, is not taken: web browsers give F6 to their own toolbar and address bar.","Dragging movements (WCAG 2.5.7): a press on the Handle without a drag folds and restores the pane, or moves the divider between resetValue and the share before (SPV-6, SPV-7), and the keys reach every share.","A drag over an embedded document keeps going (HDL-6): a pane that holds an iframe does not swallow the press.","The steps are percentages of the region, as react-resizable-panels counts them (5 for an arrow key); minSize and maxSize hold a pane to pixels on top of them, for a list that must stay readable in a wide window and a narrow one alike."]},"tokens":"comp.split-view","fixtures":[{"id":"horizontal","props":{"label":"Resize the message list"},"slots":{"start":"Inbox — 24 messages","end":"Select a message to read it."}},{"id":"vertical","props":{"axis":"vertical","value":60,"label":"Resize the editor"},"slots":{"start":"SELECT * FROM orders","end":"1,204 rows"}},{"id":"primary-end","props":{"primary":"end","value":30,"label":"Resize the inspector"},"slots":{"start":"Canvas","end":"Inspector"}},{"id":"collapsed","props":{"collapsible":true,"collapsed":true,"value":30,"label":"Resize the navigation"},"slots":{"start":"Navigation","end":"Page"}},{"id":"disabled","props":{"disabled":true,"value":35,"label":"Resize the message list"},"slots":{"start":"Inbox — 24 messages","end":"Select a message to read it."}},{"id":"rtl","props":{"value":35,"label":"تغيير حجم قائمة الرسائل"},"slots":{"start":"البريد الوارد","end":"اختر رسالة لقراءتها."},"direction":"rtl"}],"platforms":{"web":{"status":"alpha","name":"tanrei-split-view","props":{"axis":"axis","primary":"primary","value":"value","min":"min","max":"max","minSize":"minSize","maxSize":"maxSize","step":"step","largeStep":"largeStep","resetValue":"resetValue","collapsible":"collapsible","collapsed":"collapsed","label":"label","valueText":"valueText","disabled":"disabled"},"events":{"resize":"resize","change":"change","toggle":"toggle"},"parts":{"start-pane":"start-pane","end-pane":"end-pane","divider":"divider","handle":"handle"},"notes":"`<tanrei-split-view label=\"Resize the message list\"><div slot=\"start\">…</div><div slot=\"end\">…</div></tanrei-split-view>`. A flex row (a column while axis is vertical) in the shadow root: the start pane, the divider with the `<tanrei-handle>` centred on it, and the end pane; the primary pane's box is its share of the region less the divider, and the other takes the rest. The split view sets `aria-controls` on its Handle to the id of the primary pane's box, which the Handle moves to its separator (HDL-26). A folded pane's box is `inert`, and its content `visibility: hidden` once the fold's motion has ended. A motion is `AnimatedSize` on the primary pane's box. Attributes are kebab-case (`min-size`, `max-size`, `large-step`, `reset-value`, `value-text`). `resize`, `change` and `toggle` are CustomEvents that bubble and are composed, whose `detail` carries `value` and `collapsed`."},"swiftui":{"status":"planned","name":"TanreiSplitView","props":{"axis":"axis","primary":"primary","value":"value","min":"range.lowerBound","max":"range.upperBound","minSize":"minSize","maxSize":"maxSize","step":"step","largeStep":"largeStep","resetValue":"resetValue","collapsible":"isCollapsible","collapsed":"isCollapsed","label":"label","valueText":"valueText","disabled":".disabled(_:)"},"events":{"resize":"onResize","change":"value (Binding)","toggle":"isCollapsed (Binding)"},"notes":"Drawn by Tanrei with a layout that splits a geometry reader's size, not `HSplitView` (macOS only, with its own divider) or `NavigationSplitView` (a navigation structure)."},"compose":{"status":"planned","name":"TanreiSplitView","props":{"axis":"axis","primary":"primary","value":"value","min":"valueRange.start","max":"valueRange.endInclusive","minSize":"minSize","maxSize":"maxSize","step":"step","largeStep":"largeStep","resetValue":"resetValue","collapsible":"collapsible","collapsed":"collapsed","label":"label","valueText":"valueText","disabled":"enabled"},"events":{"resize":"onResize","change":"onValueChange","toggle":"onCollapsedChange"},"notes":"A `Layout` that measures the region and places the two panes and the `TanreiHandle`; `enabled` is the inverse of disabled."},"flutter":{"status":"planned","name":"TanreiSplitView","props":{"axis":"axis","primary":"primary","value":"value","min":"min","max":"max","minSize":"minSize","maxSize":"maxSize","step":"step","largeStep":"largeStep","resetValue":"resetValue","collapsible":"collapsible","collapsed":"collapsed","label":"label","valueText":"valueText","disabled":"enabled"},"events":{"resize":"onResize","change":"onChanged","toggle":"onCollapsedChanged"},"notes":"A `CustomMultiChildLayout` of the two panes and the `TanreiHandle`; a folded pane is wrapped in `Offstage` and `ExcludeSemantics`."},"react-native":{"status":"planned","name":"SplitView","props":{"axis":"axis","primary":"primary","value":"value","min":"min","max":"max","minSize":"minSize","maxSize":"maxSize","step":"step","largeStep":"largeStep","resetValue":"resetValue","collapsible":"collapsible","collapsed":"collapsed","label":"label","valueText":"valueText","disabled":"disabled"},"events":{"resize":"onResize","change":"onValueChange","toggle":"onCollapsedChange"},"notes":"Two Views sized by flex basis from the measured region, and the `Handle` between them; a folded pane is `display: 'none'`."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"stepper","title":"Stepper","summary":"Shows where a person is in a flow the product runs in a fixed order of steps — which step is current, which are complete, which has an error and which are still to come — and, where the product allows it, lets the person press a step to go back to it.","level":"base","listing":"default","anatomy":[{"id":"root","description":"The ordered list of the flow's steps, named by label: one row of equal columns (horizontal), one column (vertical), or, in the compact form, a bar and two lines of text. It has no fill, no edge and no padding of its own."},{"id":"step","description":"One item of the list: its marker, its label and, where it has one, its description. A step is in exactly one condition — incomplete, current, complete or error — and, while it can be pressed, in the interaction states."},{"id":"container","description":"The area of a step that carries hover, focus and press while the step can be pressed: its marker and its text, with the container's padding around them. It has no fill at rest. A step that cannot be pressed draws its container but answers nothing."},{"id":"marker","description":"What begins a step: a filled or ringed circle holding the step's number, the glyph check (complete) or the glyph priority_high (error). Its fill, ring and content say the step's condition; it is decorative, because the step's condition is also said in words."},{"id":"label","description":"The step's name, in a few words (\"Shipping\"). It wraps and is never cut."},{"id":"description","description":"A short second line under the label (\"Optional\", \"2 items\"), in a smaller and quieter style. It wraps and is never cut.","optional":true},{"id":"connector","description":"The line from a step's marker to the next step's marker: across the column in the horizontal form, down beside the text in the vertical form. Drawn in the complete color after a complete step, so that the way already gone is one line. Decorative. The last step has none."},{"id":"bar","description":"The compact form's row of segments, one per step, filled up to and including the current step. Decorative: the position text says the same in words.","optional":true},{"id":"position","description":"The compact form's position in the product's words (\"Step 2 of 5\"), above the current step's label.","optional":true},{"id":"focus-ring","description":"The indicator shown for keyboard focus, around a pressable step's container."}],"props":[{"name":"label","type":"string","default":"","description":"The accessible name of the stepper (\"Checkout progress\"), in the product's language. Not drawn. It tells the list of steps from the content it tracks, so it is required."},{"name":"value","type":"string","default":"","description":"The value of the current step: where the person is. Empty, or a value no step has, makes no step current — before the flow begins, or once it is finished. The stepper never changes it itself: the product moves its flow and sets value."},{"name":"layout","type":"enum","values":["horizontal","vertical","compact"],"default":"horizontal","description":"horizontal: the steps side by side in equal columns, above the content they track; where the width it is given cannot hold every step at its least width, the stepper draws the compact form instead (SPR-6). vertical: the steps one under another, beside the content or in a narrow column. compact: the bar and the position in words (\"Step 2 of 5\") with the current step's label, at any width."},{"name":"pressable","type":"enum","values":["none","visited","all"],"default":"none","description":"Which steps the person can press to go to them. none: no step; the stepper only shows where the person is. visited: each step that is complete or has an error and is not current — the steps the person has been to, so that they can go back. all: every step that is not current, for a flow whose steps can be done in any order. A disabled step is never pressable, and the current step never is. The compact form presses nothing."},{"name":"completedText","type":"string","default":"","description":"The word assistive technology hears after the label of a complete step (\"Completed\"), in the product's language. Not drawn: the check says it to the eye. The product's: Tanrei has no word for it. Empty reads the product's words. Required while a step is complete.","words":"stepCompletedText"},{"name":"errorText","type":"string","default":"","description":"The word assistive technology hears after the label of a step with an error (\"Has an error\"), in the product's language. Not drawn: the glyph says it to the eye. The product's: Tanrei has no word for it. Empty reads the product's words. Required while a step has an error.","words":"stepErrorText"},{"name":"positionText","type":"string","default":"","description":"The compact form's position: the whole sentence in the product's language with two places the stepper fills, {position} with the current step's place counted from 1 and {count} with the number of steps (\"Step {position} of {count}\", \"ステップ {position}/{count}\"). The product's: Tanrei has no sentence for it. Empty reads the product's words. Required while the compact form is drawn.","words":"stepPositionText","places":[{"name":"position","kind":"number","description":"The current step's place in the flow, counted from 1.","required":true},{"name":"count","kind":"number","description":"The number of steps."}]}],"items":[{"name":"step","summary":"One step of the flow: its value, its label, an optional description, its status and whether it can be visited.","props":[{"name":"value","type":"string","default":"","description":"Identifies the step: the stepper's value names the current step by it, and select carries it. Unique within the stepper; required."},{"name":"label","type":"string","default":"","description":"The step's name, in a few words (\"Shipping\"). Drawn, and the start of what assistive technology hears for the step. Required."},{"name":"description","type":"string","default":"","description":"A short second line under the label (\"Optional\", \"2 items\"). Empty draws none."},{"name":"status","type":"enum","values":["auto","incomplete","complete","error"],"default":"auto","description":"What the product knows of the step. auto: complete when it comes before the current step and incomplete when it comes after it (or when no step is current) — a flow done in order. incomplete and complete: so, wherever the step stands (a step skipped and left for later; a step done ahead in a flow of any order). error: the step needs the person's attention. The current step is drawn current whatever its status, except error, which it keeps."},{"name":"disabled","type":"boolean","default":false,"description":"The step cannot be gone to now (it depends on an earlier choice). Only meaningful while pressable is not none: the step is drawn disabled and is not pressable. Ignored on the current step."}]}],"events":[{"name":"select","description":"The person pressed a step to go to it, by pointer, touch, Enter, Space or assistive technology; carries the step's value. The stepper does not change value: the product goes to the step (or does not) and sets value."}],"states":["enabled","disabled","hovered","focused","pressed","error"],"behavior":[{"id":"SPR-1","text":"THE stepper SHALL draw each step in exactly one condition: current WHILE value equals the step's value (the first step with that value, SPR-21) and its status is not error; error WHILE its status is error, current or not; complete WHILE its status is complete, or its status is auto and it comes before the current step; incomplete WHILE its status is incomplete, or its status is auto and it comes after the current step or no step is current. WHEN value or a step's status changes THE stepper SHALL draw every step's new condition at once, without a motion of its own beyond the state motion of SPR-17."},{"id":"SPR-2","text":"THE stepper SHALL draw each step's marker as a circle at least comp.stepper.marker.size high and wide, with corners comp.stepper.marker.shape eased by sys.shape.corner-smoothing, filled with the marker color of the step's condition and state (comp.stepper.incomplete.marker.color, comp.stepper.current.marker.color, comp.stepper.complete.marker.color, comp.stepper.error.marker.color at rest) and edged inside its size by a ring comp.stepper.marker.outline.width wide in the marker outline color of the same (comp.stepper.incomplete.marker.outline.color, and so on). An incomplete or current marker SHALL hold the step's number — its place in the flow, counted from 1 — in comp.stepper.marker.label.typescale and the marker content color of its condition, centred, as a left-to-right run whose digits are never reversed; a complete marker SHALL hold the glyph check and an error marker the glyph priority_high instead, in the marker content color of their condition, each in a box comp.stepper.marker.icon.size large through the platform's icon helper with sys.icon.family.selected, sys.icon.fill.selected, the weight comp.stepper.marker.icon.weight and an optical size clamped between sys.icon.optical-size.min and sys.icon.optical-size.max, unmirrored in every layout direction; THE stepper SHALL draw no mark of its own."},{"id":"SPR-3","text":"THE stepper SHALL draw each step's label in comp.stepper.label.typescale and the label color of its condition and state, and, WHERE the step has a description, the description comp.stepper.description.gap under the label in comp.stepper.description.typescale and the description color of the same; it SHALL wrap both where their language allows a break and, for a run with no such place that is longer than the line, inside the run, and SHALL NOT cut them, draw an ellipsis or scroll. A change of condition SHALL NOT change the label's text style, so that no step moves when the current step does."},{"id":"SPR-4","text":"WHILE layout is horizontal and the full form is drawn (SPR-6) THE stepper SHALL lay its steps out in one row of columns of equal width, in order, each column a step's container: its marker at the container's start, comp.stepper.container.padding from its edges, and its label and description under the marker, comp.stepper.marker.gap below it, aligned to the start and as wide as the column less its padding; the row SHALL be exactly as wide as the place it stands in and as high as its tallest step, every step's marker on one line."},{"id":"SPR-5","text":"WHILE layout is vertical THE stepper SHALL lay its steps out in one column, in order, each step's container as wide as the stepper: its marker at the container's start, comp.stepper.container.padding from its edges, and its label and description beside the marker, comp.stepper.marker.gap from it, filling the rest of the width; the marker SHALL be centred on the label's first line, and WHERE the marker is taller than that line the stepper SHALL lower the text by half the difference, so that the marker's top is the content's top."},{"id":"SPR-6","text":"WHILE layout is compact, or layout is horizontal and the width the layout gives the stepper is less than the number of steps times comp.stepper.step.min-width, THE stepper SHALL draw the compact form instead of its steps: the bar — one segment per step in a row as wide as the stepper, comp.stepper.bar.gap apart, each comp.stepper.bar.thickness thick with corners comp.stepper.bar.shape, the segments of the current step and every step before it in comp.stepper.bar.filled.color and the others in comp.stepper.bar.color — then, comp.stepper.position.gap under it, the position in comp.stepper.position.typescale and comp.stepper.position.color, and under that the current step's label as SPR-3 draws a current step's, or an error step's where the current step has an error, preceded there by its marker's glyph priority_high at comp.stepper.marker.icon.size in the error label color. It SHALL decide by the width it is given, not by the window's, and SHALL change form at once WHEN that width crosses the threshold, keeping value. WHILE no step is current THE stepper SHALL draw the bar with no segment filled, and neither the position nor a label."},{"id":"SPR-7","text":"THE stepper SHALL fill the position's places as the product's sentence marks them: {position} with the current step's place counted from 1 and {count} with the number of steps, each written as the platform writes a whole number in the language of the element; it SHALL do nothing else to the sentence, and SHALL draw a sentence without {position} as it is written and in debug builds report it."},{"id":"SPR-8","text":"WHILE a step is followed by another step and the full form is drawn THE stepper SHALL draw a connector from that step's marker to the next step's: a straight line comp.stepper.connector.thickness thick, starting comp.stepper.connector.gap after the step's marker and ending comp.stepper.connector.gap before the next step's marker — across the row on the markers' centre line in the horizontal form, down the markers' centre line in the vertical form — in comp.stepper.connector.complete.color WHILE the step is complete and comp.stepper.connector.color otherwise. No container's fill or state layer SHALL cover a connector, and the connector SHALL be hidden from assistive technology."},{"id":"SPR-9","text":"WHILE pressable is visited THE stepper SHALL make pressable each step that is drawn complete or error, is not current and is not disabled; WHILE pressable is all, each step that is not current and is not disabled; WHILE pressable is none, no step; and in the compact form no step, whatever pressable says. A pressable step SHALL be the platform's own button for the whole of its container, in the focus order in the order of the steps; a step that is not pressable SHALL NOT take focus, SHALL NOT answer a pointer, a press or a key, and SHALL draw no interaction state."},{"id":"SPR-10","text":"WHEN the person activates a pressable step by pointer, touch, Enter, Space or assistive technology THE stepper SHALL emit select exactly once with that step's value, and SHALL NOT change value or any step's condition itself: the product goes to the step and sets value, or keeps the person where they are."},{"id":"SPR-11","text":"WHILE pressable is not none and a step's disabled is true and the step is not current THE stepper SHALL draw the step from the disabled tokens of its condition — its label, description, marker content and ring faded as disabled content, its fill kept, SHALL NOT make it pressable, and SHALL expose it as a disabled button, so that a person who reaches it hears that it cannot be gone to now; WHILE pressable is none THE stepper SHALL draw and expose a step whose disabled is true as it draws any other, because nothing is pressed and so nothing is unavailable. WHILE the current step's disabled is true THE stepper SHALL draw it current and in debug builds report it."},{"id":"SPR-12","text":"WHILE a pressable step is hovered, keyboard-focused or pressed THE stepper SHALL render its container, marker, marker outline, marker content, label, description and opacity from the component tokens of its condition in the highest-precedence active state, with precedence pressed over focused over hovered; focus gained by pointer or touch SHALL NOT select the focused state."},{"id":"SPR-13","text":"WHEN a pressable step receives keyboard focus THE stepper SHALL show the focus ring around that step's container without animation — the system's focus indicator, sys.focus.offset from the container, sys.focus.outer-width wide in the focus-ring color, with the inner stroke of sys.focus.inner-width where the system has one; focus gained by pointer or touch SHALL NOT show it."},{"id":"SPR-14","text":"WHEN a pressable step is pressed by pointer, touch, Enter or Space THE stepper SHALL show the pressed state without delay and SHALL keep it visible for at least sys.motion.duration.press-hold, even when the press ends sooner."},{"id":"SPR-15","text":"WHILE pressed THE stepper SHALL answer as sys.behavior.pressed-feedback names: overlay applies the pressed tokens to the whole container at once; ripple grows the pressed state layer from the point of contact (from the center for keyboard activation); dim applies the pressed opacity to the whole step and draws no state layer; none draws no answer to the press. Under ripple and dim only the container color stays with the state under the press; marker, label, description, opacity and shape still come from the pressed tokens. Under none every part stays with the state under the press. The ripple grows over comp.stepper.motion.feedback-duration with comp.stepper.motion.state-easing, fades over comp.stepper.motion.state-duration with comp.stepper.motion.state-easing once the press has ended and press-hold has passed, and appears whole where motion is reduced."},{"id":"SPR-16","text":"THE stepper SHALL ease its containers' corners, comp.stepper.container.shape, by sys.shape.corner-smoothing (0 is a quarter circle, 0.6 the iOS continuous corner; a platform with only the OS curve draws it for any amount above 0) and show its keyboard focus as sys.behavior.focus-style names (ring or glow); a platform that cannot draw a choice SHALL fall back to the first value and state that in its README."},{"id":"SPR-17","text":"WHEN a step changes between interaction states or between conditions THE stepper SHALL change its colors over comp.stepper.motion.state-duration with comp.stepper.motion.state-easing, and at once where motion is reduced; a glyph or a number that replaces another in a marker SHALL be replaced at once."},{"id":"SPR-18","text":"THE stepper SHALL make every step's container at least sys.target.pointer high and wide for fine pointers and sys.target.touch for touch input — a platform that cannot tell the input type SHALL use sys.target.touch — leaving the room it adds below and after the container's content, so that a pressable step's hit area meets the minimum target without reaching over a neighbouring step's, and so that a pressable and a plain step stand alike."},{"id":"SPR-19","text":"THE stepper SHALL be exposed to assistive technology as an ordered list named by label, of as many items as it has steps, each step one item holding, in this order, its label, the product's word for its condition where it has one — completedText for a complete step, errorText for a step with an error, nothing for an incomplete one — and its description; the current step SHALL be exposed as the current step of the flow (the web's aria-current=\"step\"; the platform's selected trait with its position where it has no current state). Markers, numbers, glyphs, connectors and the bar SHALL be hidden: the list gives each step its place, and the words its condition. WHILE the compact form is drawn THE stepper SHALL instead be exposed as one group named by label holding the position and the current step's label, followed by errorText where the current step has an error, so that what is heard is what is drawn."},{"id":"SPR-20","text":"THE stepper SHALL have no words of its own: it SHALL take completedText, errorText and positionText from the instance's prop and, WHILE that is empty, from the product's words of the same keys; WHILE a word that a drawn step needs was given by nobody THE stepper SHALL expose nothing in its place, still draw the step, and record and report the missing word as the product's words do."},{"id":"SPR-21","text":"WHEN value names no step THE stepper SHALL make no step current; WHEN a step's value is empty or repeats another step's THE stepper SHALL still draw it and treat the first step with a value as the one that value names; WHILE label is empty, a step's label is empty, or the stepper holds fewer than two steps, THE stepper SHALL still render; in debug builds it SHALL report each of these, except an empty value, which names the time before or after the flow."},{"id":"SPR-22","text":"WHILE the text size is enlarged THE stepper SHALL grow each label, description, number and position with it and grow each marker with its number, keeping comp.stepper.marker.size as a minimum and every gap and padding as it is, SHALL wrap and never cut text, and SHALL still choose its form by the width it is given (SPR-6)."},{"id":"SPR-23","text":"WHERE the platform draws with a person's own forced colors (the web's forced-colors mode, and a platform's equivalent where it has one) THE stepper SHALL draw every ring, connector, segment, number, glyph and text in the platform's text color — a pressable step's label in the platform's button text color — the current step's marker filled in the platform's highlight color with its number in the highlight text color, and the filled segments of the bar in the highlight color, and SHALL draw the focus ring in the platform's highlight color; nothing it draws relies on a fill alone."},{"id":"SPR-24","text":"THE stepper SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the stepper is shown THE stepper SHALL draw itself for the new direction at once, without a motion of its own, keeping its focus."},{"id":"SPR-25","text":"WHERE the layout direction is right-to-left THE stepper SHALL mirror its layout by logical start and end — the first step at the right of a horizontal row, the markers at the right of a vertical column, the bar filled from the right — and SHALL keep its reading and focus order first step to last; it SHALL NOT mirror a glyph or reverse a number."},{"id":"SPR-26","text":"THE stepper SHALL lay out each label, description and the position as text of its own direction, isolated from the text around it: it takes the base direction of its first strong character, or the layout direction where it has none, so that a left-to-right name or a number keeps its own order in a right-to-left layout; THE stepper SHALL still place the text and align its lines by the layout direction, not by the text's own."},{"id":"SPR-27","text":"IF the icon set cannot draw a marker's glyph yet (its font is still loading or failed to load) THE stepper SHALL draw nothing in the glyph's place, never the glyph's name as text, keeping the marker's size, fill and ring, and SHALL still expose the step's condition in words; it SHALL show the glyph once the icon set can draw it."},{"id":"SPR-28","text":"WHERE the platform has ARIA attributes (the web), the host carries its list or group role (SPR-19) itself, so what the product writes on it is not moved, but for a name: WHILE label is not empty THE stepper SHALL hold the product's aria-label and aria-labelledby on that host as their data-aria- twins, so that label is its whole name although the platform gives aria-labelledby the precedence, and WHEN label is emptied SHALL give them back as they were written; WHILE label is empty a name the product gives so — aria-label, or aria-labelledby naming an element — SHALL be its name and SHALL NOT be reported as having none in debug builds (SPR-21). WHEN the product removes one, or its data-aria- twin, or sets the ARIA property that reflects it (ariaLabel, ariaLabelledByElements) to null, THE stepper SHALL take it away."}],"accessibility":{"role":"list","keyboard":[{"keys":"Tab / Shift+Tab","action":"Moves focus to the next or previous pressable step, in the order of the steps; a step that cannot be pressed is not a stop."},{"keys":"Enter or Space","action":"Presses the focused step: the stepper emits select with its value, and the product goes there."}],"labeling":"An ordered list named by label (\"Checkout progress\"). Each step is an item read as its label, then its condition in the product's words (completedText, errorText), then its description; the current step is exposed as the current step (aria-current=\"step\"). The list gives each step its place (\"3 of 4\"), so the number in the marker is not read again. In the compact form the stepper is a group named by label that reads the position and the current step's label, as drawn.","minimumTarget":true,"notes":["The stepper is an ordered list with the current item marked, as in the W3C's tutorial on forms in several steps: a step's place comes from the list, its condition from words the product gives, and the current step from aria-current=\"step\". It is not a landmark: it belongs to the flow's content, and a page has one.","Condition is never said by color alone (WCAG 1.4.1): the current marker is filled and holds the number, a complete marker holds a check, an error marker a different glyph, an incomplete marker is a ring; each is also said in words to assistive technology.","Contrast in the default system: the ring of an incomplete step is outline, held to 3:1 on the surface; the current marker's primary fill is held to 3:1, and its number on-primary to 4.5:1 on it; the complete marker's secondary-container fill is not held to 3:1 by itself, and does not need to be, because its check (on-secondary-container, 4.5:1) identifies it. Labels are on-surface or on-surface-variant (4.5:1), the error label error (4.5:1). The connector and the bar are decorative.","Pressing a step only asks to go there (select): the product decides, and moves value. A step that cannot be pressed is plain text and not a stop; a disabled step of a pressable stepper is a disabled button, so that a person hears it cannot be gone to now.","The compact form draws no pressable step: a person goes back with the flow's own Back control. What is drawn is what is heard: the position and the current step.","How a state looks is a value decision of the active design system; the stepper reads the state's tokens and never computes the effect itself.","Not the steps of a procedure: a set of instructions to read, with no position, is Steps, whose markers are hairline rings with no fill, no glyph and no state."]},"tokens":"comp.stepper","fixtures":[{"id":"horizontal","props":{"label":"Checkout","value":"payment","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"account","label":"Account"}},{"kind":"step","props":{"value":"shipping","label":"Shipping"}},{"kind":"step","props":{"value":"payment","label":"Payment"}},{"kind":"step","props":{"value":"review","label":"Review"}}]},{"id":"horizontal-descriptions","props":{"label":"Checkout","value":"shipping","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"account","label":"Account","description":"Signed in"}},{"kind":"step","props":{"value":"shipping","label":"Shipping","description":"Address and delivery"}},{"kind":"step","props":{"value":"gift","label":"Gift wrap","description":"Optional"}},{"kind":"step","props":{"value":"payment","label":"Payment"}}]},{"id":"horizontal-error","props":{"label":"Checkout","value":"payment","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"account","label":"Account"}},{"kind":"step","props":{"value":"shipping","label":"Shipping","status":"error","description":"Postcode missing"}},{"kind":"step","props":{"value":"payment","label":"Payment"}},{"kind":"step","props":{"value":"review","label":"Review"}}]},{"id":"current-error","props":{"label":"Checkout","value":"payment","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"account","label":"Account"}},{"kind":"step","props":{"value":"shipping","label":"Shipping"}},{"kind":"step","props":{"value":"payment","label":"Payment","status":"error","description":"Card declined"}},{"kind":"step","props":{"value":"review","label":"Review"}}]},{"id":"pressable-visited","props":{"label":"Checkout","value":"payment","pressable":"visited","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"account","label":"Account"}},{"kind":"step","props":{"value":"shipping","label":"Shipping"}},{"kind":"step","props":{"value":"payment","label":"Payment"}},{"kind":"step","props":{"value":"review","label":"Review"}}]},{"id":"pressable-disabled","props":{"label":"Set-up","value":"profile","pressable":"all","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"account","label":"Account"}},{"kind":"step","props":{"value":"profile","label":"Profile"}},{"kind":"step","props":{"value":"team","label":"Team","status":"complete"}},{"kind":"step","props":{"value":"billing","label":"Billing","disabled":true,"description":"After a team"}}]},{"id":"finished","props":{"label":"Checkout","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"account","label":"Account","status":"complete"}},{"kind":"step","props":{"value":"shipping","label":"Shipping","status":"complete"}},{"kind":"step","props":{"value":"payment","label":"Payment","status":"complete"}}]},{"id":"long-labels","props":{"label":"Application","value":"documents","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"eligibility","label":"Check whether you can apply"}},{"kind":"step","props":{"value":"documents","label":"Upload proof of identity and address"}},{"kind":"step","props":{"value":"declaration","label":"Declaration"}}]},{"id":"vertical","props":{"label":"Set-up","value":"profile","layout":"vertical","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"account","label":"Create an account","description":"Email and password"}},{"kind":"step","props":{"value":"profile","label":"Your profile","description":"Name and photo"}},{"kind":"step","props":{"value":"team","label":"Invite your team","description":"Optional"}},{"kind":"step","props":{"value":"done","label":"Start working"}}]},{"id":"vertical-error","props":{"label":"Set-up","value":"team","layout":"vertical","pressable":"visited","completedText":"Completed","errorText":"Has an error"},"items":[{"kind":"step","props":{"value":"account","label":"Create an account"}},{"kind":"step","props":{"value":"profile","label":"Your profile","status":"error","description":"Name is required"}},{"kind":"step","props":{"value":"team","label":"Invite your team"}},{"kind":"step","props":{"value":"done","label":"Start working"}}]},{"id":"compact","props":{"label":"Checkout","value":"shipping","layout":"compact","completedText":"Completed","errorText":"Has an error","positionText":"Step {position} of {count}"},"items":[{"kind":"step","props":{"value":"account","label":"Account"}},{"kind":"step","props":{"value":"shipping","label":"Shipping"}},{"kind":"step","props":{"value":"gift","label":"Gift wrap"}},{"kind":"step","props":{"value":"payment","label":"Payment"}},{"kind":"step","props":{"value":"review","label":"Review"}}]},{"id":"compact-error","props":{"label":"Checkout","value":"payment","layout":"compact","completedText":"Completed","errorText":"Has an error","positionText":"Step {position} of {count}"},"items":[{"kind":"step","props":{"value":"account","label":"Account"}},{"kind":"step","props":{"value":"shipping","label":"Shipping"}},{"kind":"step","props":{"value":"payment","label":"Payment","status":"error"}},{"kind":"step","props":{"value":"review","label":"Review"}}]},{"id":"horizontal-rtl","props":{"label":"الدفع","value":"payment","completedText":"مكتمل","errorText":"به خطأ"},"items":[{"kind":"step","props":{"value":"account","label":"الحساب"}},{"kind":"step","props":{"value":"shipping","label":"الشحن","description":"DHL Express"}},{"kind":"step","props":{"value":"payment","label":"الدفع"}},{"kind":"step","props":{"value":"review","label":"المراجعة"}}],"direction":"rtl"},{"id":"compact-rtl","props":{"label":"الدفع","value":"shipping","layout":"compact","completedText":"مكتمل","errorText":"به خطأ","positionText":"الخطوة {position} من {count}"},"items":[{"kind":"step","props":{"value":"account","label":"الحساب"}},{"kind":"step","props":{"value":"shipping","label":"الشحن"}},{"kind":"step","props":{"value":"payment","label":"الدفع"}},{"kind":"step","props":{"value":"review","label":"المراجعة"}}],"direction":"rtl"}],"platforms":{"web":{"status":"alpha","name":"tanrei-stepper","props":{"label":"label","value":"value","layout":"layout","pressable":"pressable","completedText":"completedText","errorText":"errorText","positionText":"positionText"},"events":{"select":"select"},"items":{"step":{"name":"tanrei-stepper-step","props":{"value":"value","label":"label","description":"description","status":"status","disabled":"disabled"},"notes":"A child element: `<tanrei-stepper-step value=\"shipping\" label=\"Shipping\" description=\"…\" status=\"error\" disabled>`, as `<option>` in a `<select>`."}},"parts":{"root":"host","step":"tanrei-stepper-step","container":"tanrei-stepper-step container","marker":"tanrei-stepper-step marker","label":"tanrei-stepper-step label","description":"tanrei-stepper-step description","connector":"tanrei-stepper-step connector","bar":"bar","position":"position","focus-ring":"tanrei-stepper-step container@focus-ring"},"notes":"`<tanrei-stepper label=\"Checkout\" value=\"payment\" layout=\"horizontal\" pressable=\"visited\">` holds `<tanrei-stepper-step>` children, in order. The stepper is a `role=\"list\"` named by `aria-label`, each step host a `role=\"listitem\"` with `aria-current=\"step\"` on the current one; a pressable step draws a native `<button>` in its shadow root around its marker and text, a step that is not pressable the same parts in a `<div>`. The words for a condition are a visually hidden span after the label. The compact form is drawn in the stepper's own shadow root, where the steps are not displayed, and the host's role becomes `group`. The switch from horizontal to compact reads the host's width with a `ResizeObserver` against `comp.stepper.step.min-width` measured from a probe. `select` is a `CustomEvent` with `detail.value`; value is never set by the element. React: `Stepper` and `StepperStep`, generated wrappers. Fixtures fill their stage: 600 wide for a horizontal stepper, 360 for a vertical one, 320 for a compact one."},"swiftui":{"status":"planned","name":"TanreiStepper","props":{"label":"label","value":"current","layout":"layout","pressable":"pressable","completedText":"completedText","errorText":"errorText","positionText":"positionText"},"events":{"select":"onSelect"},"items":{"step":{"name":"TanreiStepperStep","props":{"value":"id","label":"label","description":"description","status":"status","disabled":"disabled"},"notes":"`TanreiStepperStep(id:, label:, description:, status: .auto, disabled:)`, an `Identifiable` value."}},"notes":"`TanreiStepper(_ label:, steps:, current: ID?, layout:, pressable:, onSelect:)`. Not SwiftUI's `Stepper`, which increments a value (the number input's steppers are that). The list is an accessibility container; the current step carries the `.isSelected` trait and its position as its accessibility value, because iOS has no current-step state. The compact switch reads the proposed width (`ViewThatFits`)."},"compose":{"status":"planned","name":"TanreiStepper","props":{"label":"contentDescription","value":"current","layout":"layout","pressable":"pressable","completedText":"completedText","errorText":"errorText","positionText":"positionText"},"events":{"select":"onSelect"},"items":{"step":{"name":"TanreiStepperStep","props":{"value":"value","label":"label","description":"description","status":"status","disabled":"enabled"},"notes":"A data class; `enabled` is the inverse flag."}},"notes":"`TanreiStepper(steps, current, onSelect, layout, pressable, contentDescription, modifier)`. A `collectionInfo` list with `collectionItemInfo` per step; the current step is `selected = true` with its position in `stateDescription`, because Compose has no current-step semantics. The compact switch reads the incoming constraints (`BoxWithConstraints`)."},"flutter":{"status":"planned","name":"TanreiStepper","props":{"label":"semanticLabel","value":"current","layout":"layout","pressable":"pressable","completedText":"completedText","errorText":"errorText","positionText":"positionText"},"events":{"select":"onSelect"},"items":{"step":{"name":"TanreiStepperStep","props":{"value":"value","label":"label","description":"description","status":"status","disabled":"enabled"},"notes":"A value class; `enabled` is the inverse flag."}},"notes":"`TanreiStepper(steps:, current:, onSelect:, layout:, pressable:, semanticLabel:)`, built with the widgets library, without Material's `Stepper`. `Semantics(container: true, label:)` around a list; the current step `Semantics(selected: true)` with its position in its value. The compact switch reads the incoming constraints (`LayoutBuilder`)."},"react-native":{"status":"planned","name":"Stepper","props":{"label":"accessibilityLabel","value":"value","layout":"layout","pressable":"pressable","completedText":"completedText","errorText":"errorText","positionText":"positionText"},"events":{"select":"onSelect"},"items":{"step":{"name":"StepperStep","props":{"value":"value","label":"label","description":"description","status":"status","disabled":"disabled"},"notes":"The element type of the `steps` array: `{ value, label, description?, status?, disabled? }`."}},"notes":"`<Stepper steps={StepperStep[]} value layout pressable onSelect accessibilityLabel />`. The list has `role=\"list\"` where the platform maps it, each step `role=\"listitem\"`; the current step `aria-current` on the web target and `accessibilityState.selected` with its position elsewhere. A pressable step is a `Pressable` with `role=\"button\"`. The compact switch reads `onLayout`."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"steps","title":"Steps","summary":"Sets a procedure out as numbered steps — each a ring with its number, an optional title and a body of the product's content, joined to the next by a hairline — for a reader to work through in order; an ordered list to read, never a control and never a record of progress.","level":"base","listing":"default","anatomy":[{"id":"list","description":"The ordered list itself: one column of steps, as wide as its container gives it. It has no fill, no edge, no padding and no state of its own, and it brings no text color."},{"id":"step","description":"One item of the list: its marker at the start, and beside it its content — a title, where it has one, and a body. A step has no state: none is current, done or failed."},{"id":"marker","description":"What begins a step: a ring in the system's one hairline holding the step's number. At least as high and as wide as the marker's height of the size; a circle in the default system, widened into a pill by a number too long for one. The ring is decorative; the number is the step's number, exposed once with the list item."},{"id":"connector","description":"The line from a step's marker to the next step's: the same hairline, on the marker column's centre line, kept a small distance from both rings. It shows that the steps are one sequence and where a step of several blocks ends. Decorative. The last step has none.","optional":true},{"id":"title","description":"A step's name, in a few words (\"Install\", \"Say where each output goes\"), set at the body's size in a heading weight. Text of its step and not a heading, unless the product gives a heading of its own as the title.","optional":true},{"id":"body","description":"A step's content: what the product puts in it. Text placed directly takes the body's text style; long-form blocks are set as prose; a block that is not text — a code block, a table, tabs — takes the body's whole width.","optional":true}],"props":[{"name":"label","type":"string","default":"","description":"The list's accessible name, in the product's language (\"Installing the package\"). Not drawn. Give one where no heading directly before the steps already says what the procedure is."},{"name":"start","type":"number","default":1,"description":"The number of the first step; each following step's number is one more. For a procedure that a note, a heading or a choice between tabs interrupts and that continues in a second set of steps (\"4, 5, 6\"). A whole number."},{"name":"size","type":"enum","values":["medium","large"],"default":"medium","description":"The size of the steps' text, in prose's two sizes. Medium sets the body in the interface's own text style, for steps among controls: a panel, a dialog, a card. Large sets it in the style for long reading, for a page whose purpose is the text. Steps inside a prose are given that prose's size. A design system may add values.","axis":"tanrei.comp.steps.size"}],"items":[{"name":"step","summary":"One step of the procedure: an optional title and a body. Its number comes from its place in the list and from start, never from a prop of its own.","props":[{"name":"title","type":"string","default":"","description":"The step's name, in a few words. Plain text: drawn first in the step, read with the step, and not a heading. A title that is a heading of the page is given in the title slot instead."}],"slots":[{"name":"title","description":"The title as content of the product's own: a heading of the level the page's outline needs (so the step is in the page's table of contents and can be linked to). Drawn in the title's text style whatever its level; its role and level are kept. Takes the place of the title prop."}]}],"states":["enabled"],"behavior":[{"id":"STP-1","text":"THE steps SHALL lay out its steps in one column, in the order they are given, each step a row of two parts: its marker, in a column at the steps' start edge, and its content — its title, where it has one, and its body — beside it. The marker column SHALL be as wide as the widest marker of the set and never narrower than the marker's height of the size (comp.steps.marker.height.medium for medium, comp.steps.marker.height.large for large), each marker centred in it; every step's content SHALL begin at one edge, comp.steps.marker.gap after that column, and run to the steps' end edge. THE steps SHALL separate the end of one step from the beginning of the next by comp.steps.step.gap, SHALL give the first step no space before it and the last step no space after it, and SHALL draw no fill, no edge around itself and no elevation."},{"id":"STP-2","text":"THE steps SHALL draw each step's marker as a ring with the step's number at its centre: a box at least comp.steps.marker.height.medium high and wide for medium (comp.steps.marker.height.large for large), with corners comp.steps.marker.shape, never larger than half the box's height and eased by sys.shape.corner-smoothing, no fill, and an edge comp.steps.marker.outline.width wide in comp.steps.marker.outline.color drawn inside the box's size; the number SHALL be set on one line in comp.steps.marker.label.typescale.medium for medium (comp.steps.marker.label.typescale.large for large), in the content color of the surface the steps sit on, with at least comp.steps.marker.padding-inline between it and the ring at the start and at the end, so that a number too long for a circle widens its marker into a pill and is never cut."},{"id":"STP-3","text":"THE steps SHALL place each marker at the top of its step with its centre on the centre of the step's first line of text — the title's first line where the step has a title, else the first line of the body; WHERE the marker is taller than that line THE steps SHALL lower the step's content by half the difference, so that the marker's top is the step's top and no marker reaches into the space above its step; WHERE a step begins with a block that is not text (a code block, a table, a picture) THE steps SHALL place the marker's top on that block's top."},{"id":"STP-4","text":"THE steps SHALL number its steps in order: the first step's number is start and each following step's is one more than the one before it. THE number SHALL be written as a whole number in the digits 0 to 9, with no period, bracket or other mark beside it and no word before it. WHEN a step is added, removed or moved, or start changes, THE steps SHALL draw every step's new number at once, without a motion."},{"id":"STP-5","text":"WHILE a step is followed by another step THE steps SHALL draw a connector between their two markers: a straight line comp.steps.connector.thickness thick in comp.steps.connector.color, on the centre line of the marker column, from comp.steps.connector.gap below the upper marker's bottom edge to comp.steps.connector.gap above the lower marker's top edge, through the space between the two steps, however tall the upper step's content is. THE steps SHALL draw no connector after the last step and none for a set of one step; a connector SHALL take no room in the layout, SHALL never be drawn over a marker or over a step's content, and SHALL be kept from assistive technology."},{"id":"STP-6","text":"WHERE a step has a title THE steps SHALL draw it first in the step's content, in comp.steps.title.typescale.medium for medium (comp.steps.title.typescale.large for large) and the content color of the surface the steps sit on, SHALL wrap it and never cut it, and SHALL begin the step's body comp.steps.title.gap below it. A title given as text SHALL be exposed as text of its step and SHALL NOT be a heading; WHERE the product gives the title as content of its own in the step's title slot — a heading of the level its page's outline needs — THE steps SHALL draw it as any title, in the same text style whatever its level, and SHALL change neither its role nor its level. A step with a title and no body SHALL be drawn as its marker and its title alone. THE steps SHALL set the title's letter-spacing by the script of its text, as every title is set (PRS-20): no negative letter-spacing WHERE its language is Chinese, Japanese or Korean, and none WHERE its script joins its letters or stacks marks on them."},{"id":"STP-7","text":"THE steps SHALL draw the content a step is given as that step's body and SHALL give it comp.steps.body.typescale.medium for medium (comp.steps.body.typescale.large for large) as the text style its text takes where nothing inside sets another. THE steps SHALL give the body no color of its own: its text takes the content color of the surface the steps sit on, so the same steps read on a page, in a card and in a callout. The body SHALL wrap and SHALL never be cut or limited to a number of lines. WHERE the body holds more than one block THE steps SHALL separate two blocks that follow each other by comp.steps.body.gap, whatever they are, and SHALL give the first block no space before it and the last block no space after it; the body's long-form blocks — paragraphs, lists, a quote — SHALL otherwise be set as prose of the steps' size sets them (PRS-1 to PRS-3, PRS-19), a link in them SHALL be underlined at rest (PRS-17), and THE steps SHALL add no style to anything inside a component placed in a body."},{"id":"STP-8","text":"THE steps SHALL give every block of a body that is not text — a code block, a table, a set of tabs, a callout, a figure or a picture, any component — the whole inline size of the body, from the edge every step's content begins at (STP-1) to the steps' end edge, and such a block SHALL scroll inside its own box when its content cannot shrink (PRS-15). WHILE the steps sit in a prose that keeps a measure THE steps themselves SHALL take that prose's full width as a block that is not text (PRS-18), and the text blocks of a body SHALL be kept no wider than comp.prose.measure times their font size, from the body's start edge; WHERE the steps sit outside a prose, or in one without a measure, every block of a body SHALL take the body's full inline size."},{"id":"STP-9","text":"WHERE a step's body holds a list THE steps SHALL leave it a list of prose, nested one depth below the steps: an ordered list is marked with lowercase letters and an unordered one with a ring (PRS-9's second depth), set in by prose's own inset from the body's start edge, so that sub-steps never repeat the steps' numbers and never draw markers or connectors of their own. WHERE the product places a set of steps inside a step's body THE steps SHALL draw it as a set of its own, numbered from its own start and laid out in the body's width, and in debug builds SHALL report that steps are nested."},{"id":"STP-10","text":"THE steps SHALL lay itself out as a block in the flow of its container: it SHALL take the whole inline size the container gives it, with its start edge on the start edge of the text around it; it SHALL bring no outer space of its own (PRS-15: the space between it and its neighbours is its container's), SHALL never be wider than its container, SHALL have no minimum width and no maximum width, and SHALL NOT scroll."},{"id":"STP-11","text":"THE steps SHALL NOT take pointer, touch or keyboard input, SHALL NOT take focus or be a stop in the focus order, and SHALL NOT change anything they draw under a pointer, a press or focus: a step has no current, completed, error, hovered, focused, pressed, selected or disabled state, a marker is not a control, and the steps emit no event. What the product places in a body — a link, a code block's copy button, tabs — takes input by its own spec, and text in a title and a body SHALL remain selectable where the platform lets text be selected."},{"id":"STP-12","text":"THE steps SHALL be exposed to assistive technology as an ordered list of as many items as it has steps, named by label where label is not empty, and each step as one item of that list holding, in this order, its number, its title and its body. Each step's number SHALL be exposed exactly once, as the item's number, and SHALL be the number the marker draws (STP-4), also where start is not 1; the ring and the connector SHALL be kept from assistive technology. THE steps SHALL NOT expose a step as current, done or failed, and SHALL add no role to a title or to anything in a body."},{"id":"STP-13","text":"WHEN label, a step's title or a step's body changes THE steps SHALL draw and expose the new value at once, without a motion, and SHALL NOT announce the change by itself."},{"id":"STP-14","text":"WHILE the text size is enlarged THE steps SHALL grow each number, title and body with it and grow each marker with its number, keeping the marker's height of the size as a minimum; THE steps SHALL keep comp.steps.marker.gap, comp.steps.step.gap, comp.steps.title.gap, comp.steps.body.gap and comp.steps.connector.gap as they are, wrap, set no fixed height on a step, lose no content when the reader raises line height, paragraph spacing, letter spacing or word spacing, and SHALL need no horizontal scrolling at a width of 320 points with text at 200 %, except inside a block that scrolls in its own box (STP-8)."},{"id":"STP-15","text":"WHERE the platform draws with a person's own forced colors (the web's forced-colors mode, and a platform's equivalent where it has one) THE steps SHALL draw each ring and each connector in the platform's text color at their own widths, and each number, title and body in that text color; nothing the steps draw relies on a fill."},{"id":"STP-16","text":"WHERE the layout direction is right-to-left THE steps SHALL mirror its two parts and apply its spaces by logical start and end, so that the marker column and the connectors are at the right and each step's content is at its left, beginning at one edge and running to the steps' left edge; a body's blocks that are not text SHALL still take the body's whole inline size (STP-8)."},{"id":"STP-17","text":"THE steps SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the steps are shown THE steps SHALL draw themselves for the new direction at once, without a motion of their own, keeping what they show."},{"id":"STP-18","text":"THE steps SHALL draw a step's number as a left-to-right run whose digits are never reversed, in every layout direction, and SHALL lay out a title given as text as text of its own direction, isolated from the text around it: it takes the base direction of its first strong character, or the layout direction where it has none, so that a command, a file's name and a version keep their own order in a right-to-left layout and reorder nothing beside them; THE steps SHALL still place the title and align its lines by the layout direction, not by the text's own. The body's blocks are laid out as prose lays out a block (PRS-25): each by its own first strong character unless the content states a direction, with its lines aligned to the start edge of the layout."},{"id":"STP-19","text":"WHEN size names a value that the active design system does not have THE steps SHALL render with the default size's tokens, and in debug builds report the unknown value. IF start is not a whole number THE steps SHALL number from 1 and in debug builds report it; a start of zero or below is a whole number and is drawn as it is."},{"id":"STP-20","text":"IF the steps hold no step THE steps SHALL draw nothing, take no space and expose nothing, and in debug builds report that a set of steps is empty. IF a step has neither a title nor a body THE steps SHALL still draw its marker, count it in the numbering and in the list's items, and in debug builds report that a step is empty: a number is never skipped, so the numbers a reader sees are the numbers the content has."}],"accessibility":{"role":"list","keyboard":[],"labeling":"An ordered list, named by label where the product gives one; where a heading directly before the steps says what the procedure is, no label is needed. Each step is a list item read as its number, its title and its body, in that order. The number is the list item's own and is read once; the ring and the connector are decorative and hidden. A title is text of its item, or the product's own heading where the product gave one.","minimumTarget":true,"notes":["Not interactive: the steps take no input and no focus (STP-11), so there is no target of their own to size and minimumTarget holds trivially. What is pressable inside a body — a link, a copy button, tabs — meets the minimum target by its own spec.","Order is carried by structure, not by the drawing: the steps are an ordered list whose items have numbers (STP-12), so a reader who does not see the rings and the connector loses nothing. That is also why forced colors and a missing stylesheet cost nothing but the look.","The number a person hears is the number a person sees (STP-12), also for a set that continues another with start. A platform whose list semantics would announce a position (\"1 of 3\") in place of the drawn number adds the number to the item's text instead of relying on the position.","Contrast is the surface's: the steps bring no text color (STP-2, STP-6, STP-7), so the number, the title and the body have the contrast of the content color of the surface they sit on, which the default system holds to 4.5:1. The ring and the connector are decorative — the number is read without the ring, and the order without the line — and are not held to 3:1, as the divider's line and a quote's line are not.","A title is not a heading by default, because a page whose outline lists every step of every procedure is harder to move through by headings. Where the steps are the page's sections (a long guide with one screen of content per step), give each title as a heading in the title slot; its level is the page's, and the steps do not change it (STP-6).","Steps say nothing about progress (STP-11, STP-12): no step is current, done or failed, and none can be. A flow in which the person is somewhere — a checkout, a set-up wizard — needs a component that exposes the current step, which this is not.","Text size, text spacing and reflow: STP-14. A long procedure is never cut, collapsed or paged by the component."]},"tokens":"comp.steps","fixtures":[{"id":"short","props":{"label":"What to do next"},"items":[{"kind":"step","props":{},"content":"Save the file in the folder that holds the project's settings."},{"kind":"step","props":{},"content":"Name the file in the settings, under the key for the design layer."},{"kind":"step","props":{},"content":"Run the build and commit what it writes."}]},{"id":"titles","props":{"label":"The workflow"},"items":[{"kind":"step","props":{"title":"Propose"},"content":"Write or change the spec, and the tokens where the change needs them."},{"kind":"step","props":{"title":"Validate"},"content":"Check the schemas, the token rules and the contrast of every scheme."},{"kind":"step","props":{"title":"Generate"},"content":"Rebuild the token outputs, the scaffolds and the status matrix."},{"kind":"step","props":{"title":"Implement"},"content":"Build the change on each platform the spec lists, with its tests."},{"kind":"step","props":{"title":"Check"},"content":"Run every check in order. All of them pass before anything is merged."},{"kind":"step","props":{"title":"Record"},"content":"Add a note of the change for the people who will read the release."}]},{"id":"titles-only","props":{"label":"The workflow"},"items":[{"kind":"step","props":{"title":"Propose"},"content":""},{"kind":"step","props":{"title":"Validate"},"content":""},{"kind":"step","props":{"title":"Generate"},"content":""}]},{"id":"long-bodies","props":{"label":"Moving an account"},"items":[{"kind":"step","props":{},"content":"Choose the account to move. An account that is shared with other people can be moved only by the person who opened it; everyone else sees the choice greyed out, with the owner's name beside it, and can ask the owner from there."},{"kind":"step","props":{},"content":"Export the account's data. The export runs on the service and may take an hour for a large mailbox; the page can be closed while it runs, and a message arrives at the account's address when the archive is ready. The archive stays available for seven days and can be asked for again after that."},{"kind":"step","props":{},"content":"Close the old account once the archive has been opened and checked. Closing cannot be undone: the address is released after thirty days and may then be given to someone else."}]},{"id":"long-title","props":{"label":"Moving an account"},"items":[{"kind":"step","props":{"title":"Choose the account to move, or ask its owner to do so when the account is shared with other people and was opened by one of them"},"content":"Choose the account to move. An account that is shared with other people can be moved only by the person who opened it; everyone else sees the choice greyed out, with the owner's name beside it, and can ask the owner from there."},{"kind":"step","props":{"title":"Close the old account"},"content":"Close the old account once the archive has been opened and checked. Closing cannot be undone: the address is released after thirty days and may then be given to someone else."}]},{"id":"single","props":{"label":"What to do next"},"items":[{"kind":"step","props":{},"content":"Run the build and commit what it writes."}]},{"id":"start","props":{"label":"The workflow, continued","start":4},"items":[{"kind":"step","props":{"title":"Implement"},"content":"Build the change on each platform the spec lists, with its tests."},{"kind":"step","props":{"title":"Check"},"content":"Run every check in order. All of them pass before anything is merged."},{"kind":"step","props":{"title":"Record"},"content":"Add a note of the change for the people who will read the release."}]},{"id":"two-digits","props":{"label":"The workflow, continued","start":9},"items":[{"kind":"step","props":{},"content":"Save the file in the folder that holds the project's settings."},{"kind":"step","props":{},"content":"Name the file in the settings, under the key for the design layer."},{"kind":"step","props":{},"content":"Run the build and commit what it writes."}]},{"id":"three-digits","props":{"label":"The workflow, continued","start":99},"items":[{"kind":"step","props":{"title":"Propose"},"content":"Write or change the spec, and the tokens where the change needs them."},{"kind":"step","props":{"title":"Validate"},"content":"Check the schemas, the token rules and the contrast of every scheme."},{"kind":"step","props":{"title":"Generate"},"content":"Rebuild the token outputs, the scaffolds and the status matrix."}]},{"id":"large","props":{"size":"large","label":"The workflow"},"items":[{"kind":"step","props":{"title":"Propose"},"content":"Write or change the spec, and the tokens where the change needs them."},{"kind":"step","props":{"title":"Validate"},"content":"Check the schemas, the token rules and the contrast of every scheme."},{"kind":"step","props":{"title":"Generate"},"content":"Rebuild the token outputs, the scaffolds and the status matrix."},{"kind":"step","props":{"title":"Implement"},"content":"Build the change on each platform the spec lists, with its tests."}]},{"id":"large-short","props":{"size":"large","label":"What to do next"},"items":[{"kind":"step","props":{},"content":"Save the file in the folder that holds the project's settings."},{"kind":"step","props":{},"content":"Name the file in the settings, under the key for the design layer."},{"kind":"step","props":{},"content":"Run the build and commit what it writes."}]},{"id":"large-long-bodies","props":{"size":"large","label":"Moving an account"},"items":[{"kind":"step","props":{},"content":"Choose the account to move. An account that is shared with other people can be moved only by the person who opened it; everyone else sees the choice greyed out, with the owner's name beside it, and can ask the owner from there."},{"kind":"step","props":{},"content":"Export the account's data. The export runs on the service and may take an hour for a large mailbox; the page can be closed while it runs, and a message arrives at the account's address when the archive is ready. The archive stays available for seven days and can be asked for again after that."},{"kind":"step","props":{},"content":"Close the old account once the archive has been opened and checked. Closing cannot be undone: the address is released after thirty days and may then be given to someone else."}]},{"id":"large-two-digits","props":{"size":"large","label":"The workflow, continued","start":9},"items":[{"kind":"step","props":{"title":"Propose"},"content":"Write or change the spec, and the tokens where the change needs them."},{"kind":"step","props":{"title":"Validate"},"content":"Check the schemas, the token rules and the contrast of every scheme."},{"kind":"step","props":{"title":"Generate"},"content":"Rebuild the token outputs, the scaffolds and the status matrix."}]},{"id":"japanese","props":{"size":"large","label":"自分のデザインシステムを作る"},"items":[{"kind":"step","props":{"title":"レイヤーを作る"},"content":"既定のシステムかプリセットのどれかを元にして、プロダクトのレイヤーファイルを作ります。"},{"kind":"step","props":{"title":"出力先を決める"},"content":"設定ファイルに、プラットフォームごとの出力先を書きます。出荷するものだけを並べてください。"},{"kind":"step","props":{"title":"ビルドする"},"content":"ビルドを実行し、書き出されたファイルをそのままコミットします。"}]},{"id":"rtl","props":{"label":"البدء"},"items":[{"kind":"step","props":{"title":"ثبّت الحزمة"},"content":"أضف الحزمة إلى المشروع من سطر الأوامر."},{"kind":"step","props":{"title":"حمّل الأنماط"},"content":"حمّل ورقة الأنماط مرة واحدة قبل أي نمط آخر في الصفحة."},{"kind":"step","props":{"title":"استخدم العناصر"},"content":"اكتب العناصر في الصفحة كما تكتب أي عنصر آخر."}],"direction":"rtl"},{"id":"rtl-two-digits","props":{"label":"البدء","start":9},"items":[{"kind":"step","props":{},"content":"أضف الحزمة إلى المشروع من سطر الأوامر."},{"kind":"step","props":{},"content":"حمّل ورقة الأنماط مرة واحدة قبل أي نمط آخر في الصفحة."},{"kind":"step","props":{},"content":"اكتب العناصر في الصفحة كما تكتب أي عنصر آخر."}],"direction":"rtl"},{"id":"ltr-title-rtl","props":{"label":"البدء"},"items":[{"kind":"step","props":{"title":"npm install"},"content":"أضف الحزمة إلى المشروع من سطر الأوامر."},{"kind":"step","props":{"title":"tokens.css"},"content":"حمّل ورقة الأنماط مرة واحدة قبل أي نمط آخر في الصفحة."},{"kind":"step","props":{"title":"v2.1 beta"},"content":"اكتب العناصر في الصفحة كما تكتب أي عنصر آخر."}],"direction":"rtl"},{"id":"with-code","props":{"size":"large","label":"Use"},"content":"with-code"},{"id":"with-code-medium","props":{"label":"Use"},"content":"with-code"},{"id":"with-table-and-tabs","props":{"size":"large","label":"Your own design system"},"content":"with-table-and-tabs"},{"id":"nested-list","props":{"label":"Moving an account"},"content":"nested-list"},{"id":"in-prose","props":{"label":"Handing a notebook over"},"content":"in-prose"},{"id":"in-prose-large","props":{"size":"large","label":"Handing a notebook over"},"content":"in-prose"},{"id":"titles-as-headings","props":{"size":"large","label":"Handing a notebook over"},"content":"titles-as-headings"},{"id":"with-code-rtl","props":{"size":"large","label":"الاستخدام"},"content":"with-code-rtl","direction":"rtl"}],"platforms":{"web":{"status":"lagging","name":"tanrei-steps","props":{"label":"aria-label","start":"start","size":"data-size"},"items":{"step":{"name":"li","props":{"title":"tanrei-steps-title"},"notes":"An `<li>` of the list; its children are the body. The title is the item's first child where that child is a heading (`h2` to `h6`) or carries `class=\"tanrei-steps-title\"` (a `<p>` for a title that is not a heading): the spec's `title` prop and its title slot are the same element on this platform, told apart by the tag the product chose."}},"notes":"Form: a class on the product's own ordered list, not an element — `<ol class=\"tanrei-steps\" role=\"list\">` with `<li>` children — styled by one optional stylesheet of the package, `@tanrei/web/steps.css`, whose selectors are wrapped in `:where()` so one class on the product's side wins. The list stays the document's list: it is an ordered list before any script runs and for whatever reads the page as built, a Markdown renderer's `<ol>` needs one class and no wrapper, and there is nothing to define, so nothing changes place after the page loads; without the stylesheet it is the browser's numbered list. `start` is the `<ol>`'s own attribute, `label` is `aria-label` (or `aria-labelledby` naming the heading before it), `data-size=\"large\"` is the size. The marker is the item's `::before` showing the item's number from a counter that honours `start` (the implicit `list-item` counter where the three engines agree on it, else a counter of the stylesheet's set from `start` by the package's script); the connector is the item's `::after`, absolutely placed, with `pointer-events: none`. One shared marker column (STP-1) is a grid on the `<ol>` with the items as subgrids. `list-style: none` removes list semantics in one engine's accessibility tree, which is why the contract writes `role=\"list\"` on the `<ol>`; the number in `::before` is generated content, read once with the item (STP-12), and the test of STP-12 is run with a screen reader in each engine. The number is drawn with `unicode-bidi: isolate` and `direction: ltr` (STP-18); a title is `dir=\"auto\"`-like through `unicode-bidi: plaintext` with physical alignment by `:dir()`, as `productText()` does. STP-3 uses `1lh` of the item's first line. Inside a `.tanrei-prose` the list is not an island (it is a class on an `<ol>`, not a Tanrei element), so prose's own rules keep reaching the paragraphs, lists, links and inline code of each body at any depth, with no second prose to open and no limit of depth; `steps.css` takes back from `prose.css` what a set of steps draws itself: the list's inset, its markers, the item gap, the measure on the list (STP-8) and the gap between an item's blocks (STP-7), and a list inside an item is already prose's second depth (STP-9). Outside a prose the stylesheet alone sets the body's text style and the gaps between an item's direct children; long-form content there is wrapped by the product in `<div class=\"tanrei-prose\" data-measure=\"false\">` around the list. Under `forced-colors: active` the ring and the connector are `CanvasText` (STP-15). The package's script, where it is loaded, adds only the debug reports of STP-9, STP-19 and STP-20. React: `Steps` and `Step` render the same `<ol>` and `<li>`; `Step` takes `title` (text, rendered as `<p class=\"tanrei-steps-title\">`) or a heading as its first child."},"swiftui":{"status":"planned","name":"TanreiSteps","props":{"label":"label","start":"start","size":"size"},"items":{"step":{"name":"TanreiStep","props":{"title":"title"},"notes":"`TanreiStep(_ title: String? = nil) { body }` in the steps' view builder; `TanreiStep(title: { Text(…).accessibilityAddTraits(.isHeader) }) { body }` is the title slot."}},"notes":"`TanreiSteps(label:, start:, size:) { TanreiStep(\"Install\") { … } }`. A `Layout` that measures the widest marker, places contents at one edge and draws the connectors in a background; not a `List`, so it brings no rows, separators or scrolling. Each step is an accessibility container whose first element's label is the number; the set is exposed as a list through the platform's list semantics where it has them and named by `label`. The body is the product's views; rendered text goes through the prose layout."},"compose":{"status":"planned","name":"TanreiSteps","props":{"label":"label","start":"start","size":"size"},"items":{"step":{"name":"TanreiStep","props":{"title":"title"},"notes":"`TanreiStep(title: String? = null) { body }` in `TanreiStepsScope`; an overload takes `title: @Composable () -> Unit` with `Modifier.semantics { heading() }` for the title slot."}},"notes":"`TanreiSteps(label, start, size) { TanreiStep(\"Install\") { … } }`. A custom `Layout`, not a `LazyColumn`: a procedure is short and is never recycled. `CollectionInfo` and `CollectionItemInfo` expose the list and each item; the number is the first text of the item; the ring and the connector are drawn in `drawBehind` and have no semantics."},"flutter":{"status":"planned","name":"TanreiSteps","props":{"label":"semanticLabel","start":"start","size":"size"},"items":{"step":{"name":"TanreiStep","props":{"title":"title"},"notes":"`TanreiStep(title: 'Install', child: …)`; `titleWidget:` takes a widget wrapped in `Semantics(header: true)` for the title slot."}},"notes":"`TanreiSteps(semanticLabel:, start:, size:, children: [TanreiStep(…)])`. Not the framework's `Stepper`, which is a control with a current step. A `CustomMultiChildLayout`-style render object for the shared column; connectors painted by a `CustomPainter` excluded from semantics. Follows `Directionality`."},"react-native":{"status":"planned","name":"Steps","props":{"label":"accessibilityLabel","start":"start","size":"size"},"items":{"step":{"name":"Step","props":{"title":"title"},"notes":"`<Step title=\"Install\">…</Step>`; `title` also takes an element with `accessibilityRole=\"header\"` for the title slot."}},"notes":"`<Steps accessibilityLabel=\"…\" start={1} size=\"medium\"><Step title=\"Install\">…</Step></Steps>`. `accessibilityRole=\"list\"` on the container; each step's number is the first text of its item. The marker column's width is measured once per set (`onLayout`). Follows the app's direction where an ancestor's is not known."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"swatch","title":"Swatch","summary":"Shows a color as a sample with its name beside it: a small square or dot of exactly that color, over a checkerboard where the color lets what is behind it through, edged so that a color close to the surface still shows where it ends. A sample to look at, never a control and never a picker.","level":"base","listing":"default","anatomy":[{"id":"container","description":"The sample: a square box of the swatch's size, clipped to a rounded square or to a circle. It carries no state: nothing about it answers a pointer, a press or focus."},{"id":"checkerboard","description":"Squares of two quiet colors under the color, filling the sample. A color that lets what is behind it through shows them; an opaque color covers them entirely.","optional":true},{"id":"fill","description":"The color itself, exactly as given, over the checkerboard.","optional":true},{"id":"outline","description":"One hairline inside the sample's edge, drawn over the color and following its shape, so that a color close to the surface around it still shows where it ends. An empty swatch draws it alone."},{"id":"label","description":"The color's name, beside the sample: what the color is called where it is shown (\"Teal 700\", \"Primary\", \"Bug\").","optional":true},{"id":"supporting-text","description":"A line under the name: the color's value, the token it comes from, or where it is used.","optional":true}],"props":[{"name":"color","type":"string","default":"","description":"The color the sample shows: in every platform a number sign and three, four, six or eight hexadecimal digits in sRGB, either case (#0f766e; the fourth or the last two the alpha, #0f766e80); on the web also any CSS color, a custom property included (var(--tanrei-sys-color-primary)); on a native platform also the platform's own color. Empty shows no color: the edge alone."},{"name":"label","type":"string","default":"","description":"The color's name, in the product's words (\"Teal 700\", \"Primary\", \"Bug\"). Drawn beside the sample, and what assistive technology reads; while labelHidden is true it is the sample's accessible name and is not drawn. The value of the color is not a name: put it in supportingText."},{"name":"supportingText","type":"string","default":"","description":"A line under the name: the color's value (\"#0f766e\"), the token it comes from, or where it is used. Drawn under the label and read after it; while labelHidden is true it is the sample's accessible description and is not drawn."},{"name":"labelHidden","type":"boolean","default":false,"description":"True draws the sample alone, for a place with no room for text (a row of dots): the label becomes the sample's accessible name and supportingText its description, so the color is still told to assistive technology, though not to a person who sees the sample and cannot tell its color. Prefer a visible label."},{"name":"decorative","type":"boolean","default":false,"description":"True draws the sample alone and hides the swatch from assistive technology, for a swatch that stands beside the same name or value in visible text (a table cell that already says \"#0f766e\", a list row titled \"Teal 700\"), so the name is read once. label and supportingText are then neither drawn nor read."},{"name":"size","type":"enum","values":["small","medium","large"],"default":"medium","description":"Small (16) stands beside one line of small text: a table cell, a dense row, a legend. Medium (24) beside a line of body text: a list row, a setting. Large (32) where the color itself is looked at: a palette, a theme's overview. The text beside the sample follows the size. A design system may add values.","axis":"tanrei.comp.swatch.size"},{"name":"shape","type":"enum","values":["square","circle"],"default":"square","description":"Square, a slightly rounded square, is a tile of the color. Circle is a dot: a color that marks something else (a label's color, a series in a legend). A design system may add values.","axis":"tanrei.comp.swatch.shape"}],"states":["enabled"],"behavior":[{"id":"SWC-1","text":"THE swatch SHALL draw its sample as a square box whose side is the container size of its size (comp.swatch.container.size.small for small, comp.swatch.container.size.medium for medium, comp.swatch.container.size.large for large), with the corners of its shape (comp.swatch.container.shape.square for square, comp.swatch.container.shape.circle for circle), never larger than half the box's side (a circle where the value is sys.shape.corner.full) and eased by sys.shape.corner-smoothing, and SHALL clip everything the sample draws to that shape. THE swatch SHALL lay itself out inline with the text or the row it is placed in, its sample one box that the layout neither stretches nor shrinks, and SHALL draw no elevation."},{"id":"SWC-2","text":"WHILE color is a color THE swatch SHALL fill its sample with exactly that color, in sRGB, its alpha included, over the checkerboard (SWC-3), and SHALL mix nothing into the fill: no state layer, no tint, no opacity of its own, no elevation, and no change with the scheme, the contrast level or the design system — the swatch shows the color it is given, and a product that wants a color of the current scheme gives it that role's value."},{"id":"SWC-3","text":"WHILE color is a color THE swatch SHALL draw under the fill, across the whole sample and clipped to its shape, a checkerboard of squares of side comp.swatch.checkerboard.size, alternately comp.swatch.checkerboard.color and comp.swatch.checkerboard.alternate-color, the square at the sample's top-left corner in comp.swatch.checkerboard.color in every layout direction, so that a color that lets what is behind it through is shown as such and an opaque color covers the checkerboard entirely."},{"id":"SWC-4","text":"THE swatch SHALL edge its sample, inside its size and following its shape, with a line comp.swatch.outline.width wide in comp.swatch.outline.color, drawn over the fill, whatever the color: so that a color close to the surface around it — white on a light surface — still shows where it ends."},{"id":"SWC-5","text":"WHILE color is empty THE swatch SHALL draw no fill and no checkerboard, the surface showing through the sample, and the edge of SWC-4, which is then all the sample draws; its label and supporting text SHALL be drawn and read as for any color."},{"id":"SWC-6","text":"THE swatch SHALL read color as a number sign followed by three, four, six or eight hexadecimal digits in either case, with white space before and after it left out, in sRGB — red, green and blue, and where there are four or eight digits the last digit or pair the alpha — as CSS reads that notation (#0f766e80 is the teal at half opacity, #fff white); on the web it SHALL also take any CSS color value, a reference to a custom property included, and draw it as the browser resolves it where the swatch stands, and on a native platform also the platform's own color. IF color is not empty and reads as no color THE swatch SHALL draw as for an empty color (SWC-5) and in debug builds report the value."},{"id":"SWC-7","text":"WHILE labelHidden and decorative are false and label or supportingText is not empty THE swatch SHALL draw beside its sample, comp.swatch.gap.small after it for size small (and so on for each size), one column of text: label in comp.swatch.label.typescale.small for size small (and so on for each size) and comp.swatch.label.color, and under it supportingText in comp.swatch.supporting-text.typescale.small for size small (and so on) and comp.swatch.supporting-text.color, each drawn only where it is not empty. THE swatch SHALL centre the sample and the column of text on each other vertically, SHALL be as wide as its sample, the gap and its longest line, and no wider, and WHERE the place it stands in is narrower SHALL wrap each text at word boundaries rather than cut it, keeping the sample whole. Each text SHALL be laid out in its own direction, isolated from the text around it, so that a value such as #0f766e keeps its order in a right-to-left layout."},{"id":"SWC-8","text":"WHILE labelHidden is true or decorative is true THE swatch SHALL draw its sample alone, with no text and no gap beside it, and SHALL be exactly as large as its sample."},{"id":"SWC-9","text":"WHILE the swatch draws its text (SWC-7) THE swatch SHALL keep its sample from assistive technology and expose its label and then its supportingText as text, in that order, read where the swatch stands, with no role of its own: the color is told by the words, which every person reads, and the sample adds nothing a word does not say."},{"id":"SWC-10","text":"WHILE labelHidden is true and decorative is false THE swatch SHALL be exposed to assistive technology as one image named by label — by supportingText where label is empty — and described by supportingText where label names it, and SHALL expose nothing else: not the color's value unless the product wrote it, not its size or its shape."},{"id":"SWC-11","text":"WHILE decorative is true THE swatch SHALL expose nothing to assistive technology, and SHALL neither draw nor read label and supportingText."},{"id":"SWC-12","text":"IF decorative is false, label and supportingText are both empty and the product gives it no name (SWC-20) THE swatch SHALL draw its sample alone, expose nothing to assistive technology, and in debug builds report that a color is shown without a name: a sample alone tells its color to no one who cannot see it or tell it from another."},{"id":"SWC-13","text":"THE swatch SHALL NOT take pointer, touch or keyboard input, SHALL NOT take focus or be a stop in the focus order, and SHALL NOT change anything it draws under a pointer, a press or focus: it has no hovered, focused, pressed, selected or disabled state, draws no state layer, no ripple and no focus indicator, and emits no event. WHERE the swatch is placed inside an element that takes input (a link, a Button, a list item, a chip, a menu item) THE swatch SHALL let input over it reach that element, stay as it is drawn while that element is hovered, focused or pressed, and add what it exposes (SWC-9, SWC-10) to that element's content in reading order. A swatch that is chosen from a set is a picker's, not this component's."},{"id":"SWC-14","text":"WHEN color, label, supportingText, labelHidden, decorative, size or shape changes THE swatch SHALL draw and expose the new value at once, without a motion, and SHALL NOT announce the change by itself."},{"id":"SWC-15","text":"WHILE the text size is enlarged THE swatch SHALL keep its sample at the container size of its size and let its label and supportingText follow their text styles as they grow, the sample staying centred on the column of text (SWC-7): a sample is a picture of a color and is enlarged with the page, not with the text."},{"id":"SWC-16","text":"WHERE the platform draws with a person's own forced colors (the web's forced-colors mode, and a platform's equivalent where it has one) THE swatch SHALL keep its fill and its checkerboard out of the forced palette, because the color is the content the swatch shows and not a decoration of it, SHALL draw its edge in the platform's text color so that the sample is bounded on any background, and its label and supportingText in the platform's text color."},{"id":"SWC-17","text":"WHERE the layout direction is right-to-left THE swatch SHALL draw its sample at the start, the right, and its text after it, to the left, with the gap applied by logical start and end, and SHALL mirror no drawing of its own: the checkerboard starts at the sample's top-left corner in every direction (SWC-3), and each text keeps its own direction (SWC-7)."},{"id":"SWC-18","text":"THE swatch SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the swatch is shown THE swatch SHALL draw itself for the new direction at once, without a motion of its own, keeping what it shows."},{"id":"SWC-19","text":"WHEN size or shape names a value that the active design system does not have THE swatch SHALL render with the default value's tokens, and in debug builds report the unknown value."},{"id":"SWC-20","text":"WHERE the platform has ARIA attributes (the web), the host carries its image role while it is one (SWC-10) itself, so what the product writes on it is not moved, but for a name: WHILE its name (label, or supportingText where label is empty) is not empty THE swatch SHALL hold the product's aria-label and aria-labelledby on that host as their data-aria- twins, so that its name (label, or supportingText where label is empty) is its whole name although the platform gives aria-labelledby the precedence, and WHEN its name (label, or supportingText where label is empty) is emptied SHALL give them back as they were written; WHILE its name (label, or supportingText where label is empty) is empty a name the product gives so — aria-label, or aria-labelledby naming an element — SHALL be its name and SHALL NOT be reported as having none in debug builds (SWC-12). WHILE decorative is false and it draws its sample alone — labelHidden is true, or it has no text to draw — and it has no name of its own, a name the product gives so SHALL make it one image named by that name, as SWC-10 says of its own: an image the product names is a named image. WHILE it draws its text (SWC-9) or is decorative (SWC-11) it has no role, and SHALL hold them as well, giving them back when it is an image again. WHEN the product removes one, or its data-aria- twin, or sets the ARIA property that reflects it (ariaLabel, ariaLabelledByElements) to null, THE swatch SHALL take it away."}],"accessibility":{"role":"img","keyboard":[],"labeling":"A swatch with its name drawn beside it is text: the sample is hidden and the label, then the supporting text, are read where the swatch stands. A swatch whose label is hidden is one image named by the label and described by the supporting text. A decorative swatch, beside the same name in text, is hidden. A swatch with neither a label nor supporting text is hidden and reported. The color's value is never turned into words by the swatch: a color's name is the product's, in the product's language.","minimumTarget":true,"notes":["Not interactive: the swatch takes no input and no focus (SWC-13), so there is no target to size and minimumTarget holds trivially. A swatch that is pressed is inside a link or a Button, which meets the minimum target by its own spec.","Use of color (WCAG 1.4.1): a sample alone tells a color only to a person who can see it and tell it from its neighbours. The name drawn beside it tells everyone, which is why the label is drawn by default; a hidden label (labelHidden) still names the color to assistive technology, but not to a person with a color vision deficiency who sees the sample. Where there is no room for the name, the product shows it on demand (a tooltip on the element that holds the swatch).","Non-text contrast (WCAG 1.4.11): the swatch's meaning is carried by its text, so the sample's edge is not a graphical object required to understand the content and is not held to 3:1; it is the divider's hairline (outline-variant), which raised-contrast schemes strengthen, and it keeps a color close to the surface from disappearing into it.","Decorative or named is the product's decision and cannot be seen from the swatch: beside \"#0f766e\" in text, a named swatch would be read as \"Teal 700, #0f766e\" twice. The rule the docs page gives: if deleting the swatch loses a name, it is named; otherwise it is decorative.","Contrast in the default system: the label is on-surface and the supporting text on-surface-variant, pairs the token invariants hold to 4.5:1 on every surface tone. The sample's own color is the product's and is not checked: it is content, as a picture is.","Not a picker: a set of swatches of which one is chosen is a selection control with roles, keys and a value of its own (a radio group or a listbox of colors), which this component does not provide and does not imitate."]},"tokens":"comp.swatch","fixtures":[{"id":"default","props":{"color":"#0f766e","label":"Teal 700","supportingText":"#0f766e"}},{"id":"label-only","props":{"color":"#7c3aed","label":"Violet"}},{"id":"small","props":{"color":"#0f766e","label":"Teal 700","supportingText":"#0f766e","size":"small"}},{"id":"large","props":{"color":"#0f766e","label":"Teal 700","supportingText":"#0f766e","size":"large"}},{"id":"circle","props":{"color":"#e11d48","label":"Bug","shape":"circle"}},{"id":"translucent","props":{"color":"#0f766e80","label":"Teal 700 at half opacity","supportingText":"#0f766e80"}},{"id":"near-surface","props":{"color":"#ffffff","label":"White","supportingText":"#ffffff"}},{"id":"empty","props":{"color":"","label":"No color"}},{"id":"label-hidden","props":{"color":"#0f766e","label":"Teal 700","supportingText":"#0f766e","labelHidden":true}},{"id":"dot","props":{"color":"#e11d48","label":"Bug","labelHidden":true,"shape":"circle","size":"small"}},{"id":"decorative","props":{"color":"#0f766e","label":"Teal 700","decorative":true}},{"id":"rtl","direction":"rtl","props":{"color":"#0f766e","label":"أخضر مزرق","supportingText":"#0f766e"}}],"platforms":{"web":{"status":"alpha","name":"tanrei-swatch","props":{"color":"color","label":"label","supportingText":"supportingText","labelHidden":"labelHidden","decorative":"decorative","size":"size","shape":"shape"},"parts":{"container":"sample","checkerboard":"sample","fill":"sample","outline":"sample@outline","label":"label","supporting-text":"supporting-text"},"notes":"`<tanrei-swatch color=\"#0f766e\" label=\"Teal 700\" supporting-text=\"#0f766e\" size shape label-hidden decorative>`. The host is `display: inline-flex`, `vertical-align: middle`, with no `tabindex`, no listeners and `pointer-events` left as they are (SWC-13). The sample is a `span` in the shadow root whose background is two layers: the color as a `linear-gradient` of one color over a `conic-gradient` checkerboard, both clipped by the shared corner rule; the edge is an inset `box-shadow`, drawn over the background. `color` is set as a custom property through `style.setProperty`, so any CSS color the browser resolves where the swatch stands is drawn (`var(--tanrei-sys-color-primary)` included), and a value `CSS.supports('color', …)` refuses is drawn as empty (SWC-6). The sample is `aria-hidden` while the text is drawn; while `label-hidden` it is `role=\"img\"` with `aria-label` and `aria-description`; while decorative or nameless the host is `aria-hidden`. Under `forced-colors: active` the sample keeps `forced-color-adjust: none` and takes a `CanvasText` edge (SWC-16)."},"swiftui":{"status":"planned","name":"TanreiSwatch","props":{"color":"color","label":"label","supportingText":"supportingText","labelHidden":"labelHidden","decorative":"isDecorative","size":"size","shape":"shape"},"notes":"`TanreiSwatch(_ label: String, color: Color?, supportingText:, size:, shape:, labelHidden:, isDecorative:)`, with an initializer that takes the hexadecimal string of SWC-6. `allowsHitTesting(false)`. With its text, one element that combines its children; with labelHidden, an element with the image trait and the label; decorative, `accessibilityHidden(true)`."},"compose":{"status":"planned","name":"TanreiSwatch","props":{"color":"color","label":"label","supportingText":"supportingText","labelHidden":"labelHidden","decorative":"decorative","size":"size","shape":"shape"},"notes":"`TanreiSwatch(color: Color?, label, supportingText, size, shape, labelHidden, decorative)`, with an overload that takes the hexadecimal string of SWC-6. No `clickable` and no `focusable` modifier; with labelHidden, semantics `Role.Image` with the label as `contentDescription`; decorative, `clearAndSetSemantics {}`."},"flutter":{"status":"planned","name":"TanreiSwatch","props":{"color":"color","label":"label","supportingText":"supportingText","labelHidden":"labelHidden","decorative":"decorative","size":"size","shape":"shape"},"notes":"`TanreiSwatch(color: Color?, label:, supportingText:, size:, shape:, labelHidden:, decorative:)`, with `TanreiSwatch.hex(…)` for the string of SWC-6. Wrapped in `IgnorePointer`; with labelHidden, `Semantics(image: true, label:)` over an excluded sample; decorative, `ExcludeSemantics`."},"react-native":{"status":"planned","name":"Swatch","props":{"color":"color","label":"label","supportingText":"supportingText","labelHidden":"labelHidden","decorative":"decorative","size":"size","shape":"shape"},"notes":"`<Swatch color=\"#0f766e\" label=\"Teal 700\" supportingText=\"#0f766e\" />`; `color` is any color React Native parses. `pointerEvents=\"none\"`; with labelHidden, `accessibilityRole=\"image\"` with the label as `accessibilityLabel`; decorative, `accessible={false}` with `importantForAccessibility=\"no-hide-descendants\"`."}}}
|