@tanrei/mcp 0.0.0-stage → 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/LICENSE +202 -0
- package/NOTICE +57 -0
- package/README.md +150 -2
- package/bin/tanrei-mcp.js +15 -0
- package/dist/server.js +4515 -0
- package/dist/vocabulary/docs/governance/mimicry-gaps.json +666 -0
- 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 +24 -0
- package/dist/vocabulary/tokens/comp/accordion.tokens.json +459 -0
- package/dist/vocabulary/tokens/comp/app-bar.tokens.json +308 -0
- package/dist/vocabulary/tokens/comp/app-shell.tokens.json +248 -0
- package/dist/vocabulary/tokens/comp/avatar.tokens.json +199 -0
- package/dist/vocabulary/tokens/comp/badge.tokens.json +101 -0
- package/dist/vocabulary/tokens/comp/bottom-sheet.tokens.json +326 -0
- package/dist/vocabulary/tokens/comp/breadcrumbs.tokens.json +253 -0
- package/dist/vocabulary/tokens/comp/button-group.tokens.json +140 -0
- package/dist/vocabulary/tokens/comp/button-with-menu.tokens.json +810 -0
- package/dist/vocabulary/tokens/comp/button.tokens.json +1355 -0
- package/dist/vocabulary/tokens/comp/calendar.tokens.json +500 -0
- package/dist/vocabulary/tokens/comp/callout.tokens.json +510 -0
- package/dist/vocabulary/tokens/comp/card.tokens.json +204 -0
- package/dist/vocabulary/tokens/comp/carousel.tokens.json +469 -0
- package/dist/vocabulary/tokens/comp/chat-composer.tokens.json +343 -0
- package/dist/vocabulary/tokens/comp/checkbox.tokens.json +587 -0
- package/dist/vocabulary/tokens/comp/chip.tokens.json +716 -0
- package/dist/vocabulary/tokens/comp/code-block.tokens.json +473 -0
- package/dist/vocabulary/tokens/comp/color-input.tokens.json +49 -0
- package/dist/vocabulary/tokens/comp/combobox.tokens.json +756 -0
- package/dist/vocabulary/tokens/comp/copy-button.tokens.json +56 -0
- package/dist/vocabulary/tokens/comp/date-time-picker.tokens.json +797 -0
- package/dist/vocabulary/tokens/comp/description-list.tokens.json +203 -0
- package/dist/vocabulary/tokens/comp/dialog.tokens.json +340 -0
- package/dist/vocabulary/tokens/comp/divider.tokens.json +139 -0
- package/dist/vocabulary/tokens/comp/drop-zone.tokens.json +151 -0
- package/dist/vocabulary/tokens/comp/embedded-text-input.tokens.json +103 -0
- package/dist/vocabulary/tokens/comp/empty-state.tokens.json +154 -0
- package/dist/vocabulary/tokens/comp/field-group.tokens.json +211 -0
- package/dist/vocabulary/tokens/comp/field.tokens.json +308 -0
- package/dist/vocabulary/tokens/comp/figure.tokens.json +269 -0
- package/dist/vocabulary/tokens/comp/file-item.tokens.json +445 -0
- package/dist/vocabulary/tokens/comp/file-picker.tokens.json +282 -0
- package/dist/vocabulary/tokens/comp/file-upload.tokens.json +30 -0
- package/dist/vocabulary/tokens/comp/handle.tokens.json +343 -0
- package/dist/vocabulary/tokens/comp/image-preview.tokens.json +327 -0
- package/dist/vocabulary/tokens/comp/inline-code.tokens.json +86 -0
- package/dist/vocabulary/tokens/comp/input-box.tokens.json +1073 -0
- package/dist/vocabulary/tokens/comp/keyboard-shortcut.tokens.json +194 -0
- package/dist/vocabulary/tokens/comp/link-card.tokens.json +321 -0
- package/dist/vocabulary/tokens/comp/link.tokens.json +321 -0
- package/dist/vocabulary/tokens/comp/list-row.tokens.json +249 -0
- package/dist/vocabulary/tokens/comp/list.tokens.json +328 -0
- package/dist/vocabulary/tokens/comp/loading-indicator.tokens.json +218 -0
- package/dist/vocabulary/tokens/comp/main-action-button.tokens.json +418 -0
- package/dist/vocabulary/tokens/comp/marquee-text.tokens.json +110 -0
- package/dist/vocabulary/tokens/comp/menu.tokens.json +1124 -0
- package/dist/vocabulary/tokens/comp/menubar.tokens.json +279 -0
- 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 +448 -0
- package/dist/vocabulary/tokens/comp/navigation-drawer.tokens.json +1126 -0
- package/dist/vocabulary/tokens/comp/number-input.tokens.json +75 -0
- package/dist/vocabulary/tokens/comp/number-ticker.tokens.json +77 -0
- package/dist/vocabulary/tokens/comp/one-time-code-input.tokens.json +246 -0
- package/dist/vocabulary/tokens/comp/page-header.tokens.json +247 -0
- package/dist/vocabulary/tokens/comp/pagination.tokens.json +233 -0
- package/dist/vocabulary/tokens/comp/popover.tokens.json +363 -0
- package/dist/vocabulary/tokens/comp/previous-next-links.tokens.json +194 -0
- package/dist/vocabulary/tokens/comp/progress-indicator.tokens.json +218 -0
- package/dist/vocabulary/tokens/comp/prose.tokens.json +283 -0
- package/dist/vocabulary/tokens/comp/radio-button.tokens.json +413 -0
- 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 +761 -0
- package/dist/vocabulary/tokens/comp/segmented-button.tokens.json +414 -0
- package/dist/vocabulary/tokens/comp/select.tokens.json +687 -0
- package/dist/vocabulary/tokens/comp/side-sheet.tokens.json +332 -0
- package/dist/vocabulary/tokens/comp/size-transition.tokens.json +49 -0
- package/dist/vocabulary/tokens/comp/skeleton.tokens.json +114 -0
- package/dist/vocabulary/tokens/comp/slider.tokens.json +436 -0
- package/dist/vocabulary/tokens/comp/snackbar.tokens.json +1160 -0
- 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/steps.tokens.json +190 -0
- package/dist/vocabulary/tokens/comp/swatch.tokens.json +208 -0
- package/dist/vocabulary/tokens/comp/switch.tokens.json +350 -0
- package/dist/vocabulary/tokens/comp/tab-view.tokens.json +142 -0
- package/dist/vocabulary/tokens/comp/table-of-contents.tokens.json +429 -0
- package/dist/vocabulary/tokens/comp/table.tokens.json +553 -0
- package/dist/vocabulary/tokens/comp/tabs.tokens.json +1058 -0
- package/dist/vocabulary/tokens/comp/tag-group.tokens.json +68 -0
- package/dist/vocabulary/tokens/comp/tag.tokens.json +551 -0
- package/dist/vocabulary/tokens/comp/text-input.tokens.json +96 -0
- package/dist/vocabulary/tokens/comp/timeline.tokens.json +239 -0
- package/dist/vocabulary/tokens/comp/toolbar.tokens.json +270 -0
- package/dist/vocabulary/tokens/comp/tooltip.tokens.json +391 -0
- package/dist/vocabulary/tokens/comp/tree-view.tokens.json +478 -0
- package/dist/vocabulary/tokens/dial/dial.tokens.json +137 -0
- package/dist/vocabulary/tokens/fidelity/cupertino.fidelity.json +165 -0
- package/dist/vocabulary/tokens/fidelity/m3-like.fidelity.json +388 -0
- 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/fidelity/reference/material-web.json +802 -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 +194 -0
- package/dist/vocabulary/tokens/generated/tanrei/components.json +1764 -0
- package/dist/vocabulary/tokens/icon-sets/material-symbols.icon-set.json +279 -0
- package/dist/vocabulary/tokens/ref/typeface.tokens.json +116 -0
- package/dist/vocabulary/tokens/schema/icon-set.schema.json +82 -0
- package/dist/vocabulary/tokens/schema/system.schema.json +859 -0
- package/dist/vocabulary/tokens/sys/behavior.tokens.json +184 -0
- package/dist/vocabulary/tokens/sys/color.vocabulary.json +58 -0
- package/dist/vocabulary/tokens/sys/elevation.tokens.json +362 -0
- package/dist/vocabulary/tokens/sys/measure.tokens.json +442 -0
- package/dist/vocabulary/tokens/sys/motion.tokens.json +1421 -0
- package/dist/vocabulary/tokens/sys/scroll-edge.tokens.json +50 -0
- package/dist/vocabulary/tokens/sys/shape.tokens.json +169 -0
- package/dist/vocabulary/tokens/sys/space.tokens.json +256 -0
- package/dist/vocabulary/tokens/sys/state.tokens.json +83 -0
- package/dist/vocabulary/tokens/sys/typescale.tokens.json +551 -0
- package/dist/vocabulary/tokens/systems/core.system.json +1889 -0
- package/dist/vocabulary/tokens/systems/cupertino.system.json +859 -0
- package/dist/vocabulary/tokens/systems/m3-like/comp/fab-menu.tokens.json +499 -0
- package/dist/vocabulary/tokens/systems/m3-like.system.json +1181 -0
- package/dist/vocabulary/tokens/systems/tanrei.system.json +707 -0
- package/dist/vocabulary/tokens/tanrei.resolver.json +400 -0
- package/package.json +52 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"callout","title":"Callout","summary":"A notice that is part of the content and stays there: a note, a caution, the reason for something or a summary of what is wrong, in the flow of the page, as a quiet fill or an outline, in the colors and with the glyph of a status where it has one, with an optional title, actions and a close button; announced only when it appears in answer to something.","level":"base","listing":"default","anatomy":[{"id":"container","description":"The block that holds the notice, as wide as its place in the layout and as tall as its content, flat on the surface it sits on. Filled in the tonal look (a quiet neutral, or a status's quiet container) and edged in the outlined look. It carries no state: nothing about it answers a pointer, a press or focus."},{"id":"outline","description":"The outlined look's edge: one hairline inside the container, the same in every status.","optional":true},{"id":"icon","description":"The glyph at the start, on the first line of the text: the status's glyph from the system's icon set (info, warning, error or check_circle, the ones a snackbar draws), or the glyph the product names. In the status's own color, a little softer than the text. Decorative: the status is given in words.","optional":true},{"id":"title","description":"A few words that name the notice, above the body. Plain text unless the product gives a heading; it wraps and is never cut.","optional":true},{"id":"body","description":"The notice itself: the product's content, from one sentence to several paragraphs with lists, links, code and tables. Long-form blocks in it are prose."},{"id":"actions","description":"One or two of the product's own Buttons or links that follow up on the notice, in a row below the text.","optional":true},{"id":"close-button","description":"An icon-only Button of the size comp.callout.close-button.size names (small in the default system) showing the close glyph at the end of the first row, in the variant comp.callout.close-button.variant names (tonal in the default system) and, on a filled look, in the tone of that fill: its content color, so that its container is that color made translucent and its glyph is that color. The callout places it and chooses its variant and its tone; everything else it reads from Button's own tokens. The only part of a callout that answers a pointer, a press or focus, and it answers as a Button.","optional":true}],"props":[{"name":"title","type":"string","default":"","description":"A few words above the body that name the notice (\"Not published yet\"). Plain text, never a heading. Empty draws the body alone. The title slot takes its place where the product needs a heading of its own level or inline content."},{"name":"status","type":"enum","values":["default","info","warning","error","success"],"default":"default","description":"What the notice is, in the names the snackbar and the tag use. default: a neutral aside, with no glyph unless the product gives one. info, warning, error and success draw the look in that status's color roles with that status's glyph; a live callout is announced assertively for warning and error. Use them for what they mean everywhere in the system: advice is not a success."},{"name":"statusLabel","type":"string","default":"","description":"The status in words, in the product's language (\"Warning\"), read by assistive technology before the title and the body and not drawn, so that the status never rests on color and glyph alone. For a callout whose title does not itself say the status; needed when it has a status and no title. Ignored while status is default."},{"name":"variant","type":"enum","values":["tonal","outlined"],"default":"tonal","description":"How much the callout weighs. tonal: a quiet fill, the default. outlined: no fill and one hairline, for a callout on a tinted surface or inside a filled card, where a fill would vanish, and for many callouts close together. A design system may add values.","axis":"tanrei.comp.callout.variant"},{"name":"size","type":"enum","values":["medium","large"],"default":"medium","description":"The size of the text, in prose's two sizes. medium sets the body in the interface's own text style, for a callout among controls: a form, a panel, a dialog. large sets it in the style for long reading, for a callout in a page whose purpose is the text. Paddings, the glyph and the close button are the same at both. A design system may add values.","axis":"tanrei.comp.callout.size"},{"name":"live","type":"boolean","default":false,"description":"Whether the callout is announced. False, the default, is for a callout that is part of what was written: it is a note, read where it stands. True is for one that appears or changes in answer to something (a summary of a form's errors after a submit, a notice that the file changed underneath the person): it is a live region, announced once when it is shown and when its content changes, politely or, for warning and error, assertively. It changes nothing that is drawn."},{"name":"closable","type":"boolean","default":false,"description":"Draws a close button, for a notice the person may put away (an announcement, a hint they have read). A caution that qualifies the content beside it should not be closable."},{"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":"open","type":"boolean","default":true,"description":"Whether the callout is shown. The close button sets it to false; the product sets it to show a callout again or to show one in answer to something. A callout that is not open draws nothing and takes no space; it opens and closes in one motion of its height and its opacity (CLO-13)."}],"slots":[{"name":"default","description":"The body: text, or the product's own blocks (paragraphs, lists, a table, a code block, any component). Long-form blocks are laid out as prose of the callout's size."},{"name":"icon","description":"A glyph of the system's icon set, by name, drawn in place of the status glyph, or as the glyph of a callout without a status (a tip's lightbulb).","fixture":"glyph"},{"name":"title","description":"The product's own title content in place of the title prop: text with inline content, or a heading of the level the page's outline needs. The callout draws it in the title's style and changes neither its role nor its level.","fixture":"text"},{"name":"actions","description":"The actions: the product's own Buttons or links, one or two. The callout lays them out below the text and does nothing else to them.","fixture":"button"}],"events":[{"name":"dismiss","description":"The person closed the callout with its close button. Emitted exactly once, after open became false; never emitted when the product sets open."}],"states":["enabled"],"behavior":[{"id":"CLO-1","text":"THE callout SHALL draw a container as wide as the layout it is placed in gives it (CLO-22) and as tall as its content, with corners comp.callout.container.shape eased by sys.shape.corner-smoothing and no elevation, padded by comp.callout.container.padding-block above its first line and below its last block, by comp.callout.container.padding-inline at the start, and at the end by comp.callout.container.padding-inline where the text meets it or by comp.callout.container.padding-inline-end-with-close after the close button. Inside it SHALL lay out, from the start: the glyph, where it has one (CLO-5, CLO-6); comp.callout.icon.gap after it a column that takes the remaining width and holds the title (CLO-7), the body (CLO-8) and the actions (CLO-9), in that order; and comp.callout.container.gap after that column the close button, where it has one (CLO-10). THE callout SHALL centre the glyph and the close button on the first line of the text (the title's, or the body's without a title) and keep them there however tall the text grows, and any height the container has beyond its content SHALL lie below the content."},{"id":"CLO-2","text":"WHILE status is default THE callout SHALL fill its container with the container color of its variant and draw its title, its body and a glyph the product gave in that variant's title, body and icon colors: comp.callout.container.color.tonal, comp.callout.title.color.tonal, comp.callout.body.color.tonal and comp.callout.icon.color.tonal for tonal, and outlined's tokens of the same names (comp.callout.container.color.outlined, comp.callout.body.color.outlined, and so on)."},{"id":"CLO-3","text":"WHILE status is info, warning, error or success THE callout SHALL draw its container, its title, its body and its glyph from the parts of its variant prefixed with the status: for a tonal info callout comp.callout.info.container.color.tonal, comp.callout.info.title.color.tonal, comp.callout.info.body.color.tonal and comp.callout.info.icon.color.tonal; for outlined, and for warning, error and success, their own tokens of the same names (comp.callout.error.icon.color.outlined, comp.callout.success.container.color.tonal, and so on). A status SHALL change these colors, the glyph (CLO-5), the tone of the close button (CLO-10) and how a live callout is announced (CLO-21), and nothing else: the callout's size, shape, layout and edge stay those of its variant and size."},{"id":"CLO-4","text":"WHILE variant is outlined THE callout SHALL draw an edge comp.callout.outline.width wide in comp.callout.outline.color inside its container's size, following its corners, in every status, without changing the callout's size or the place of its content; WHILE variant is tonal it SHALL draw no edge. A status SHALL NOT color the edge: it is the system's one hairline."},{"id":"CLO-5","text":"WHILE status is info, warning, error or success and the icon slot is empty THE callout SHALL draw that status's glyph from the system's icon set (info for info, warning for warning, error for error, check_circle for success), the glyphs a snackbar draws, in a box of comp.callout.icon.size, in its form's icon color (CLO-3) drawn at comp.callout.icon.opacity (an opacity of the glyph alone, which fades nothing else), with sys.icon.family.unselected and sys.icon.fill.unselected, sys.icon.weight and an optical size clamped between sys.icon.optical-size.min and sys.icon.optical-size.max. The glyph so drawn SHALL keep 3:1 against its container in every scheme of the default system, and against every surface role in the outlined look. THE callout SHALL keep the glyph from assistive technology, which is given the status in words (CLO-20). WHILE status is default and the icon slot is empty THE callout SHALL draw no glyph and no room for one: the text starts at the start padding."},{"id":"CLO-6","text":"WHERE the icon slot holds a glyph THE callout SHALL draw it in the place, the box, the color and the opacity CLO-5 gives the status glyph (the icon color of its form, CLO-2 and CLO-3), in every status and without one, SHALL draw no status glyph beside it, and SHALL keep it from assistive technology: the product's glyph says what kind of notice this is (advice, an experiment, something new), and the words say it to everyone."},{"id":"CLO-7","text":"WHILE title is not empty THE callout SHALL draw it above the body in the text style of its size (comp.callout.title.typescale.medium for medium, comp.callout.title.typescale.large for large) and the title color of its form (CLO-2, CLO-3), with comp.callout.title.gap between it and the body; the title SHALL wrap and SHALL never be cut. WHERE the title slot holds content THE callout SHALL draw that content in the title's place, style and color instead of the title prop, and SHALL change neither its role nor its level: a title given as text is plain text and never a heading, and a title the product gives as a heading stays a heading of the level the product gave it, drawn as every other title is. WHILE both are empty THE callout SHALL draw the body alone, on the first line. THE callout 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":"CLO-8","text":"THE callout SHALL draw the content of its default slot as its body, below the title, and SHALL give it the text style of its size (comp.callout.body.typescale.medium for medium, comp.callout.body.typescale.large for large) and the body color of its form (CLO-2, CLO-3) as the style and color its text takes where nothing inside sets another. The body SHALL wrap and SHALL never be cut or limited to a number of lines. WHERE the body holds long-form blocks (paragraphs, lists, a quote, a table, a code block) they SHALL be laid out as prose of the callout's size (PRS-1, PRS-5), without a measure of their own, so that the first block has no space before it and the last none after it and the body is exactly as tall as its content; the callout SHALL add no style to anything inside a component placed in its body, and a link in the body SHALL be underlined at rest (PRS-17)."},{"id":"CLO-9","text":"WHERE the actions slot holds content THE callout SHALL lay it out as a row below the text (the body, or the title where there is no body), comp.callout.actions.gap below it, starting at the text's start edge, with comp.callout.actions.item-gap between two actions along the row and between rows where they wrap; an action's label SHALL NOT be cut to make the row fit. The actions are the product's own Buttons and links: THE callout SHALL NOT restyle them, SHALL NOT answer their presses and SHALL NOT close when one is activated. They SHALL follow the body in reading order and in the focus order, before the close button."},{"id":"CLO-10","text":"WHILE closable is true THE callout SHALL draw at the end of its first row an icon-only Button of the size comp.callout.close-button.size names showing the glyph close of the system's icon set and named by closeLabel, in the variant comp.callout.close-button.variant names and, in every look but outlined, in the tone of its form (BTN-45): the body color of that form (comp.callout.body.color.tonal without a status, comp.callout.info.body.color.tonal for info, and so on), the content color of the fill it stands on, so that its container is that color made translucent and its glyph is that color; both given through the channel a Button reads from the component that places it, and otherwise unrestyled: it reads Button's own tokens, answers hover, focus and press as any Button does and keeps its own minimum target (BTN-5). The outlined look has no fill, so its close button takes no tone and is drawn as the variant draws it on the surface the callout sits on. THE callout's container, its text and its glyph SHALL NOT change under a pointer, a press or focus: the callout itself has no states. WHILE closable is false THE callout SHALL draw no close button and keep no room for one."},{"id":"CLO-11","text":"WHEN the user activates the close button by pointer, touch, Enter or Space THE callout SHALL set open to false, emit dismiss exactly once and close (CLO-13). THE callout SHALL NOT close by itself after a time, and SHALL NOT answer Escape: it is part of the content, and Escape belongs to whatever overlay or field the person is in."},{"id":"CLO-12","text":"WHEN a callout closes while focus is inside it THE callout SHALL move focus to the element that had it before focus entered the callout or, where that element no longer exists or cannot take focus, leave focus to the platform's default, so that the next Tab reaches what followed the callout; WHEN it closes while focus is elsewhere it SHALL NOT move focus."},{"id":"CLO-13","text":"WHILE open is false THE callout SHALL draw nothing, take no space and expose nothing to assistive technology, and its content SHALL NOT be reachable by focus. WHEN open becomes false while the callout is drawn THE callout SHALL close in one motion, in its layout, over comp.callout.motion.disclosure-duration with comp.callout.motion.disclosure-easing (sys.motion.role.disclosure and sys.motion.easing.spatial): its height goes to none with its content fixed to its top edge, nothing inside it moving or scrolling, while its opacity goes from whole to transparent; what stands below it moves with its bottom edge at every frame, and the space its container keeps beside it (a gap, a margin) closes over the same motion, so that nothing that follows moves by a jump when it is gone (MOT-5). WHEN open becomes true THE callout SHALL open along the same path the other way: from no height and transparent to its height and whole, what follows moving with it from the place it had without the callout. WHEN open changes while the callout moves THE callout SHALL turn round from the height and the opacity then drawn (MOT-2). What assistive technology and focus are given SHALL change at once, not after the motion: from the moment open becomes false the callout exposes nothing, nothing in it can take focus (focus has left it, CLO-12) and nothing of it is announced; from the moment open becomes true it is exposed as CLO-20 says, a live callout is announced (CLO-21), and its content is reachable by focus. WHERE motion is reduced, and while the callout draws its first frames (MOT-3), THE callout SHALL appear or disappear at once (MOT-6). A callout that comes to have content or loses it while open is true (CLO-31) changes at once. THE callout SHALL emit dismiss only for a close the person made (CLO-11), never when the product sets open."},{"id":"CLO-19","text":"THE callout SHALL ease its container 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); a platform that cannot draw it SHALL fall back to a quarter circle and state that in its README. Its close button's corners and its focus indicator are the Button's (BTN-10)."},{"id":"CLO-20","text":"WHILE live is false THE callout SHALL be exposed to assistive technology as a note: a part of the content that qualifies what is around it, read where it stands in reading order, named by its title where it has one and otherwise by statusLabel where status is not default and the product gave one. WHILE status is not default and statusLabel is not empty THE callout SHALL expose statusLabel as text before the title and the body, set apart so that it is read as a phrase of its own (\"Warning, …\"), and SHALL NOT draw it; WHILE status is default it SHALL ignore statusLabel. A callout that is not live SHALL NOT be announced when it is shown or when its content changes, SHALL NOT move focus, and SHALL NOT be a stop in the focus order: static content is not an alert."},{"id":"CLO-21","text":"WHILE live is true THE callout SHALL be a live region in place of a note. WHEN it is shown after its page or view was first presented (open becomes true, or the product adds it), and WHEN its title, its body or its status changes while it is shown, THE callout SHALL have assistive technology announce it once: statusLabel first when status is not default, then the title when it has one, then the whole body. 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, as a snackbar does, and SHALL NOT move keyboard or screen-reader focus. A live callout that is drawn with the first presentation of its page or view SHALL NOT announce itself then. live SHALL change nothing that is drawn."},{"id":"CLO-22","text":"THE callout SHALL lay itself out as a block in the flow of its container: it SHALL take the whole inline size the container gives it, in a page, in a list item, in a tab's panel, in a card or in another callout's body alike, 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, no maximum width and no measure of its own, and SHALL NOT scroll: content that cannot shrink (a table, a line of code) scrolls inside its own box. THE callout SHALL NOT float over the content, stick to an edge while the content scrolls or raise itself above it: where it stands is the product's layout."},{"id":"CLO-23","text":"WHILE the text size is enlarged THE callout SHALL grow its title and its body with it, keep its paddings and gaps, wrap, and grow in height; it SHALL keep the glyph's box at comp.callout.icon.size and the close button at its own size (a Button's icon-only circle, BTN-12), both still centred on the first line (CLO-1), SHALL cut nothing and set no fixed height, SHALL 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 %."},{"id":"CLO-24","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 callout SHALL draw an edge comp.callout.outline.width wide in the platform's text color inside its container in every variant and status, its title, body and glyph in that text color with the glyph whole (no opacity), links in the platform's link color and still underlined, and its close button as a Button draws itself there, so that a look whose fill the mode removes is still a bounded block; the status SHALL then rest on the glyph's shape, the title's words and statusLabel."},{"id":"CLO-25","text":"WHERE the layout direction is right-to-left THE callout SHALL mirror the order of its content and apply its paddings by logical start and end: the glyph at the right, the text after it, the actions starting at the text's right edge and the close button at the left."},{"id":"CLO-26","text":"THE callout 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 callout is shown THE callout SHALL draw itself for the new direction at once, without a motion of its own, keeping its open state and its focus."},{"id":"CLO-27","text":"WHERE the layout direction is right-to-left THE callout SHALL draw the glyph of its icon slot mirrored left to right exactly when the system's icon set marks that glyph's name as mirrored or the product forces mirroring for that use, and unmirrored when the product forbids it: the icon helper mirrors the glyph inside its own box, about the box's vertical centre line, changing neither its place, size, color and opacity nor the order CLO-25 gives. THE callout SHALL NOT mirror a glyph itself, SHALL NOT mirror content the product gives as an image or a view of its own rather than by a glyph's name, and its own glyphs (the four status glyphs) are drawn through the same helper, which mirrors none of them under the default icon set; the close button's glyph is the Button's (BTN-19)."},{"id":"CLO-28","text":"THE callout 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 left-to-right name, a number with its unit and a version keep their own order in a right-to-left layout and reorder nothing beside them; THE callout 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":"CLO-29","text":"WHILE the system's icon set cannot yet draw a glyph the callout draws itself (a status's glyph, or the icon slot's; its font is still loading) THE callout 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 and closeLabel SHALL still reach assistive technology. The close button's glyph is the Button's to draw."},{"id":"CLO-30","text":"WHEN variant or size names a value that the active design system does not have, or status names a value this spec does not have, THE callout SHALL render with the default value (the default variant's or size's tokens, status default), and in debug builds report the unknown value."},{"id":"CLO-31","text":"IF the title, the title slot and the body are all empty THE callout SHALL draw nothing, take no space and expose nothing, and in debug builds report that a callout has no content: a glyph, actions or a close button alone are not a notice. WHILE status is not default and both the title and statusLabel are empty THE callout SHALL still render and in debug builds report that the status is not given in words; 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; IF statusLabel is not empty while status is default THE callout SHALL ignore it and in debug builds report it."},{"id":"CLO-32","text":"WHERE the platform has ARIA attributes (the web), the host carries its note or live region role (CLO-20, CLO-21) itself, so what the product writes on it is not moved, but for a name: WHILE its name (its title, else statusLabel) is not empty THE callout SHALL hold the product's aria-label and aria-labelledby on that host as their data-aria- twins, so that its name (its title, else statusLabel) is its whole name although the platform gives aria-labelledby the precedence, and WHEN its name (its title, else statusLabel) is emptied SHALL give them back as they were written; WHILE its name (its title, else statusLabel) is empty a name the product gives so — aria-label, or aria-labelledby naming an element — SHALL be its name. WHILE it is closed or empty (CLO-13) it exposes nothing, and SHALL hold them as well, giving them back when it is shown. WHEN the product removes one, or its data-aria- twin, or sets the ARIA property that reflects it (ariaLabel, ariaLabelledByElements) to null, THE callout SHALL take it away."}],"accessibility":{"role":"note","keyboard":[{"keys":"Tab","action":"Reaches, at the callout's place in the page, the links and controls of the body, then the actions, then the close button. The callout itself is not a stop, and showing one never moves focus."},{"keys":"Enter or Space","action":"Activates the focused close button: the callout closes and focus returns to where it was before it entered the callout (CLO-12)."}],"labeling":"A callout that is not live is a note (the note role on the web), read where it stands, named by its title or, without one, by statusLabel. A live callout is a live region instead: 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), announced once when it is shown after its page was presented and when its content changes. In both, statusLabel is exposed as text before the title and the body; the glyph is hidden. A title given as text is plain text; a heading in the title slot keeps its level. The close button's name is closeLabel. Actions are the product's own controls with their own names.","minimumTarget":true,"notes":["Static content is not an alert. A callout written into a page (a note in documentation, a caution above a procedure) must not interrupt a screen reader when the page loads or be repeated as a status message: it is read in order, as the paragraph before it is. live is for what appears or changes in answer to something, and even then a callout that the page is first presented with is not announced (CLO-21).","A summary of a form's errors is a live callout with the error status, shown after the submit. Whether focus also moves to it is the product's decision, by its own means (the callout takes no focus by itself): moving focus to the summary suits a long form whose first error may be off screen; announcing it and moving focus to the first field in error suits a short one. Do not do both.","A notice for a whole page or screen (a banner: the connection is lost, the file changed on disk, a trial ends) is a callout placed by the product above that region's content, live, usually with an action or a close button. Put it where it comes first in reading order for the region it concerns.","WCAG 1.4.1 (use of color): a status is never told by color alone. A status form draws the status's glyph, a shape of the icon set, and the status is in the title's words or in statusLabel (CLO-20). The component cannot tell whether a title says its status, so that is the product's to check: \"Accessibility\" on a warning needs statusLabel \"Warning\"; \"Warning: not published yet\" does not.","WCAG 1.3.1 (info and relationships): the callout does not decide whether its title is a heading. Most titles are labels of a note and should stay text, or the page's outline fills with entries such as \"Note\". Where a callout does open a part of the page that people navigate to, the product gives a heading of the right level in the title slot.","WCAG 1.4.3 and 1.4.11 (contrast) in the default system: the title and the body are a role on its paired role (on-secondary-container on secondary-container, on-info-container on info-container, on-surface on a surface), each held to 4.5:1 by the token invariants. The glyph is drawn at an opacity of its color, so its contrast is that of the color as drawn: at least 3.5:1 on its own status container and on every surface, in every scheme. A link in the body is the system's link color, underlined: at least 4.6:1 on every tonal container (7.2:1 in the high-contrast schemes). The outlined look's edge is decorative.","Actions are the product's Buttons. A filled or a tonal Button brings its own fill and keeps its own contrast; the label of an outlined or a text Button sits on the callout's fill, where the default system's primary keeps at least 13:1 on every tonal container. A tonal Button has the fill of the tonal callout without a status and cannot be seen as a button there: use outlined or text. The focus indicator of a product's control in the body or the actions is the system's focus color, at least 4.6:1 on every tonal container of the default system.","A closable callout that returns on every visit is noise: when the person closes one, the product should remember it. The callout only reports the close (dismiss).","Do not nest callouts, and do not stack several at the top of a page: two notices of the same weight side by side cancel each other. One callout may hold a list of points.","Forced colors (CLO-24): a tonal callout loses its fill, so every look gains an edge in the text color. Statuses then differ by glyph and words alone.","Web: the body, the title slot and the actions are light-DOM children of `<tanrei-callout>`, so they stay in the document: they are found by search in the page, translated, selected and read without script, and before the element is defined they show as plain blocks in the page's own text styles, without the fill, the glyph and the close button. A title given by the `headline` attribute is not shown until the element is defined; content pages should use the title slot.","The callout itself has no states: nothing about its container, its text or its glyph answers a pointer, a press or focus. Its close button is a Button, and answers them as every Button does.","WCAG 1.4.11 (non-text contrast) and 2.4.13 (focus appearance) for the close button: in a filled look it is drawn in the tone of the fill (BTN-45), its glyph in the fill's content color (the body color, held to 4.5:1 on the fill by the token invariants) over a container of that color at comp.button.tone.container.opacity. In the default system the glyph keeps against that blend, in every status, at least 9.5:1 at rest in the light schemes and 7.7:1 in the dark ones, and at least 6.0:1 hovered, focused or pressed in every scheme; the focus indicator's outer stroke, in the same color on the callout's fill, keeps at least 12:1. In the outlined look it is the variant's own Button on the surface, whose glyph the Button's own tokens hold."]},"tokens":"comp.callout","fixtures":[{"id":"tonal","props":{},"content":"Sizes are minimums: a control grows with enlarged text."},{"id":"outlined","props":{"variant":"outlined"},"content":"Sizes are minimums: a control grows with enlarged text."},{"id":"tonal-info","props":{"variant":"tonal","status":"info","statusLabel":"Information"},"content":"The web draws this revision; the other platforms follow."},{"id":"tonal-warning","props":{"variant":"tonal","status":"warning","statusLabel":"Warning"},"content":"A border that is the only cue a control exists must keep 3:1 against its surface."},{"id":"tonal-error","props":{"variant":"tonal","status":"error","statusLabel":"Error"},"content":"The file could not be read. Nothing was changed."},{"id":"tonal-success","props":{"variant":"tonal","status":"success","statusLabel":"Success"},"content":"Every contrast check passes in all six schemes."},{"id":"outlined-info","props":{"variant":"outlined","status":"info","statusLabel":"Information"},"content":"The web draws this revision; the other platforms follow."},{"id":"outlined-warning","props":{"variant":"outlined","status":"warning","statusLabel":"Warning"},"content":"A border that is the only cue a control exists must keep 3:1 against its surface."},{"id":"outlined-error","props":{"variant":"outlined","status":"error","statusLabel":"Error"},"content":"The file could not be read. Nothing was changed."},{"id":"outlined-success","props":{"variant":"outlined","status":"success","statusLabel":"Success"},"content":"Every contrast check passes in all six schemes."},{"id":"title","props":{"title":"Sizes are minimums"},"content":"A control grows with enlarged text, so a height is never a fixed value."},{"id":"title-info","props":{"status":"info","title":"A revised spec, not yet on every platform"},"content":"The web draws this revision. SwiftUI, Compose, Flutter and React Native still draw the previous one."},{"id":"title-outlined-warning","props":{"variant":"outlined","status":"warning","statusLabel":"Warning","title":"Accessibility"},"content":"A preset is held to its original, not to these contrast thresholds."},{"id":"title-only","props":{"status":"success","title":"All checks passed"}},{"id":"large","props":{"size":"large"},"content":"Sizes are minimums: a control grows with enlarged text."},{"id":"large-title-info","props":{"size":"large","status":"info","title":"A revised spec, not yet on every platform"},"content":"The web draws this revision. SwiftUI, Compose, Flutter and React Native still draw the previous one."},{"id":"large-outlined-error","props":{"size":"large","variant":"outlined","status":"error","statusLabel":"Error"},"content":"The file could not be read. Nothing was changed."},{"id":"icon","props":{"title":"Tip"},"content":"Keep an action enabled and explain what is missing when it is used.","slots":{"icon":"lightbulb"}},{"id":"icon-outlined","props":{"variant":"outlined","title":"Tip"},"content":"Keep an action enabled and explain what is missing when it is used.","slots":{"icon":"lightbulb"}},{"id":"icon-info","props":{"status":"info","title":"Experimental"},"content":"This behaviour may change in a later version.","slots":{"icon":"science"}},{"id":"title-slot","props":{"status":"info"},"content":"The title is the product's own content, drawn in the title's style.","slots":{"title":"Where the split button went"}},{"id":"actions","props":{"status":"warning","title":"The file changed on disk"},"content":"You have edits here that are not in it. Nothing is overwritten until you choose.","slots":{"actions":["Reload from disk","Keep mine"]}},{"id":"actions-outlined","props":{"variant":"outlined"},"content":"A newer version of this page is available.","slots":{"actions":"Reload"}},{"id":"closable","props":{"closable":true,"closeLabel":"Close"},"content":"Search now covers the release notes."},{"id":"closable-outlined-info","props":{"variant":"outlined","status":"info","statusLabel":"Information","closable":true,"closeLabel":"Close"},"content":"Search now covers the release notes."},{"id":"closable-title-actions","props":{"status":"error","title":"Three fields need attention","closable":true,"closeLabel":"Close","live":true},"content":"Enter a name, choose a start date, and give an address that can receive mail.","slots":{"actions":["Go to the first field"]}},{"id":"status-label","props":{"status":"warning","statusLabel":"Warning"},"content":"Deleting a layer also deletes every token it declares."},{"id":"live-success","props":{"status":"success","statusLabel":"Success","live":true},"content":"Your changes are saved."},{"id":"long-body","props":{"status":"info","title":"A revised spec, not yet on every platform"},"content":"The specification, the tokens and the web element carry the new name, and the web draws this revision. SwiftUI, Compose, Flutter and React Native still ship the previous revision under the old name, so their code on this page uses the old names; it changes when each platform renames the component. Until then the status matrix shows them as lagging, and the roadmap lists what each of them owes."},{"id":"long-title","props":{"status":"warning","title":"The native platforms have not renamed this component yet, and their examples on this page still use the name it had before the proposal that renamed it","closable":true,"closeLabel":"Close"},"content":"It changes when each platform renames the component."},{"id":"tonal-info-rtl","props":{"status":"info","title":"ملاحظة"},"content":"يرسم الويب هذه المراجعة؛ المنصات الأخرى تتبعها لاحقًا.","direction":"rtl"},{"id":"closable-actions-rtl","props":{"status":"warning","title":"تغيّر الملف على القرص","closable":true,"closeLabel":"إغلاق"},"content":"لن يُستبدل شيء حتى تختار.","slots":{"actions":["إعادة التحميل","الاحتفاظ بنسختي"]},"direction":"rtl"},{"id":"icon-rtl","props":{"title":"التالي"},"content":"تابع إلى الصفحة التالية لإعداد النظام.","slots":{"icon":"arrow_forward"},"direction":"rtl"},{"id":"ltr-title-rtl","props":{"variant":"outlined","status":"success","title":"v2.1 beta"},"content":"تم نشر هذا الإصدار.","direction":"rtl"},{"id":"docs-note","props":{"size":"large","status":"info","title":"Note"},"content":"Text styles are named by level, never by size."},{"id":"docs-tip","props":{"size":"large","title":"Tip"},"content":"Prefer keeping an action enabled and explaining what is missing when it is used.","slots":{"icon":"lightbulb"}},{"id":"docs-caution","props":{"size":"large","status":"warning","title":"Back up before you migrate"},"content":"The migration rewrites the database in place. The steps below show how to keep a copy you can restore."},{"id":"docs-danger","props":{"size":"large","status":"error","title":"Danger"},"content":"This command deletes every generated file and cannot be undone."}],"platforms":{"web":{"status":"lagging","name":"tanrei-callout","props":{"title":"headline","status":"status","statusLabel":"statusLabel","variant":"variant","size":"size","live":"live","closable":"closable","closeLabel":"closeLabel","open":"open"},"events":{"dismiss":"dismiss"},"parts":{"container":"container","outline":"container@outline","icon":"icon","title":"title","body":"body","actions":"actions","close-button":"close-button"},"notes":"`<tanrei-callout>` with the body as light-DOM children, the glyph in the `icon` slot, the title in the `title` slot (`<p slot=\"title\">`, or `<h3 slot=\"title\">` where it is a heading) or the `headline` attribute (HTML's global `title` attribute would show a tooltip over the whole block, as the snackbar's and the app bar's), and Buttons or links in the `actions` slot. `statusLabel` and `closeLabel` are the `status-label` and `close-label` attributes. `open` is a boolean property that defaults to true; the `open` attribute spells it, and `open=\"false\"` is how markup starts a callout closed. The host is `display: block` with no margin, `role=\"note\"` and `aria-labelledby` naming the title, set through ElementInternals where axe can see it and as attributes otherwise; with `live` the host's role is `status` or `alert` by status, and the announcement is made through a visually hidden live region in the shadow root that exists from the element's first render, so that a callout opened later is announced (CLO-21). `statusLabel` is drawn as visually hidden text before the title in the shadow root, followed by a comma and a space; the glyph is `aria-hidden`. The body takes the form's content color and the size's text style through inherited `color` and `font`, so text placed directly in the element is styled, and a body that is rendered Markdown is wrapped by the product in `<div class=\"tanrei-prose\" data-measure=\"false\">` with the callout's `data-size` (prose re-enters inside a Tanrei element). The glyph's opacity is applied to its color (a mix with transparent), never as an element's `opacity`. The close button is a `<tanrei-button size=\"small\">` with the close glyph in its `icon` slot and `close-label` as its `label`, in the shadow root (part `close-button`); the callout gives it the variant `--tanrei-comp-callout-close-button-variant` names and, in a look with a fill, the tone of its form (the form's `body-color` custom property) through the Button's internal channel, after each update (CLO-10). Under `forced-colors: active` the container takes a `CanvasText` border of the outline width (CLO-24). The stylesheet of `@tanrei/web` gives `tanrei-callout:not(:defined)` `display: block`, so the content keeps its place before the element is defined. `dismiss` is a CustomEvent. Opening and closing (CLO-13): the container stands in a box of the shadow root whose height follows `open` through `AnimatedSize`, anchored at its start, over `--tanrei-comp-callout-motion-disclosure-duration` with `--tanrei-comp-callout-motion-disclosure-easing`, the container's opacity moving on the same tokens; closing, the host stays drawn (a custom state over `open=\"false\"`) until the motion has ended, its box `inert` and `aria-hidden` from the first frame; the space its container keeps beside it (a gap, a margin) is measured from rest and moved as the host's `margin-block-end` on the box's clock."},"swiftui":{"status":"planned","name":"TanreiCallout","props":{"title":"title","status":"status","statusLabel":"statusLabel","variant":"variant","size":"size","live":"isLive","closable":"isClosable","closeLabel":"closeLabel","open":"isPresented"},"events":{"dismiss":"onDismiss"},"notes":"`TanreiCallout(_ title: String? = nil, status:, statusLabel:, variant:, size:, isLive:, isClosable:, closeLabel:, isPresented:, icon:, onDismiss:) { body } actions: { … }`, the body and the actions as `@ViewBuilder`s, the glyph by name through `icon:`, and a second initializer whose title is a `@ViewBuilder` (the title slot; `.accessibilityAddTraits(.isHeader)` is the product's). `isPresented` is a `Binding<Bool>` that defaults to a constant true. The container is an accessibility container labelled by the title or `statusLabel`; a live callout posts `AccessibilityNotification.Announcement` at default priority, or high for warning and error."},"compose":{"status":"planned","name":"TanreiCallout","props":{"title":"title","status":"status","statusLabel":"statusDescription","variant":"variant","size":"size","live":"live","closable":"closable","closeLabel":"closeDescription","open":"visible"},"events":{"dismiss":"onDismiss"},"notes":"`TanreiCallout(title, status, statusDescription, variant, size, live, closable, closeDescription, visible, icon, onDismiss, titleContent, actions) { body }`, the body, `titleContent` and `actions` as composable lambdas, the glyph by name through `icon`. `visible` is hoisted state: the close button calls `onDismiss` and the product sets it. The container merges no descendants and carries `paneTitle`-free semantics: a content description of the status description on a leading invisible node, and for a live callout `liveRegion` polite or assertive by status."},"flutter":{"status":"planned","name":"TanreiCallout","props":{"title":"title","status":"status","statusLabel":"statusSemanticLabel","variant":"variant","size":"size","live":"live","closable":"closable","closeLabel":"closeSemanticLabel","open":"visible"},"events":{"dismiss":"onDismiss"},"notes":"`TanreiCallout(title: …, status:, statusSemanticLabel:, variant:, size:, live:, closable:, closeSemanticLabel:, visible:, icon:, titleWidget:, actions:, onDismiss:, child:)`, the body as `child`, the title slot as `titleWidget`, the actions as a list of widgets, the glyph by name through `icon`. `visible` is the product's state; the close button calls `onDismiss`. A `Semantics(container: true, label:)` over the block, with `liveRegion: true` for a live callout and `SemanticsService.announce` with its assertiveness for warning and error."},"react-native":{"status":"planned","name":"Callout","props":{"title":"title","status":"status","statusLabel":"statusAccessibilityLabel","variant":"variant","size":"size","live":"live","closable":"closable","closeLabel":"closeAccessibilityLabel","open":"open"},"events":{"dismiss":"onDismiss"},"notes":"`<Callout title=\"…\" status=\"warning\">…</Callout>`; the body is `children`, the title slot is the `titleContent` prop, the actions are the `actions` prop (elements), and the glyph is the `icon` prop (a glyph name). `open` is controlled when given, with `onDismiss`. A live callout sets `accessibilityLiveRegion` (polite or assertive) on Android and calls `AccessibilityInfo.announceForAccessibility` on iOS. Follows the app's direction where an ancestor's is not known."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"card","title":"Card","summary":"Sets a group of related content apart from its background, and can be one action that opens what it shows, or one link to it.","level":"base","listing":"default","anatomy":[{"id":"container","description":"The shape that holds the content, clips it to its corners and, for an interactive card, carries hover, focus and press."},{"id":"outline","description":"The border of the outlined variant.","optional":true},{"id":"content","description":"Whatever the product puts in the card. The card does not lay it out; it only insets it, clips it and hands it a content color."},{"id":"focus-ring","description":"Gap-then-ring indicator shown for keyboard focus of an interactive card.","optional":true}],"props":[{"name":"variant","type":"enum","values":["elevated","filled","outlined"],"default":"outlined","description":"How the card separates from its background: by depth (elevated), by tone (filled) or by an edge (outlined). Pick by the background, not by importance. A design system may add values.","axis":"tanrei.comp.card.variant"},{"name":"interactive","type":"boolean","default":false,"description":"Makes the whole card one pressable action (it emits click). Its content must then contain no other interactive element. A card whose action is to go somewhere takes href instead and is a link, not a button."},{"name":"disabled","type":"boolean","default":false,"description":"Prevents interaction and removes an interactive card or a link card from the focus order. Ignored unless interactive is true or href is set: a card that is neither an action nor a link cannot be disabled."},{"name":"href","type":"string","default":"","description":"The destination: an address as the platform's links take one (a URL; on the web a path or a fragment as well). Not empty, it makes the whole card one link — a link card — whether interactive is set or not: the link role, one tab stop, activated by pointer, touch or Enter and not by Space, opened by the platform as its own links are, and drawn exactly as an interactive card is (CRD-19, CRD-20). Its content must then contain no other interactive element, as an interactive card's."},{"name":"target","type":"enum","values":["same","new"],"default":"same","description":"Where the destination opens. same: where the person is — the same tab on the web, the app's own handling of the address elsewhere. new: a new context — a new tab or window on the web, outside the current screen elsewhere — which the card says through targetLabel; the card draws no mark, because its content is the product's (CRD-21). Ignored without href."},{"name":"targetLabel","type":"string","default":"","description":"What assistive technology reads after the link's name while target is new (\"opens in a new tab\"). Tanrei ships no words of its own, so the product gives them in its own language, as it gives a chip its removeLabel. Required while target is new; ignored otherwise.","words":"targetLabel"},{"name":"inset","type":"boolean","default":true,"description":"Insets the content by the card's padding. Set it to false for content that reaches the card's edges (a photo on top); that content pads its own text."},{"name":"label","type":"string","default":"","description":"The accessible name. For an interactive card or a link card, normally the text of its heading; without it the whole content becomes the name. For a card that is neither, a label makes it a named group."}],"slots":[{"name":"default","description":"The content: any layout of media, text and — only when interactive is false and href is empty — actions."}],"events":[{"name":"click","description":"An interactive card or a link card was activated by pointer, touch, keyboard or assistive technology. A link card emits it before its destination opens; a product that takes the navigation itself (a client-side router) cancels it (CRD-20)."}],"states":["enabled","disabled","hovered","focused","pressed"],"behavior":[{"id":"CRD-1","text":"WHEN the user activates an interactive card by pointer, touch, Enter or Space — a link card (CRD-19) by pointer, touch or Enter — THE card SHALL emit click exactly once."},{"id":"CRD-2","text":"WHILE disabled is true and either interactive is true or href is not empty THE card SHALL NOT emit click, SHALL NOT be focusable and SHALL expose the disabled state to assistive technology."},{"id":"CRD-3","text":"WHILE an interactive card is hovered, keyboard-focused or pressed THE card SHALL render its container, outline, elevation, content color and opacity from the component tokens of 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":"CRD-4","text":"WHEN an interactive card receives keyboard focus THE card SHALL show the focus ring without animation; focus gained by pointer or touch SHALL NOT show it."},{"id":"CRD-5","text":"WHERE the visual size of an interactive card is below the minimum target THE card SHALL extend its 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."},{"id":"CRD-6","text":"WHILE disabled is true and either interactive is true or href is not empty THE card SHALL render its container, outline, elevation, content color and opacity from the disabled component tokens of its variant."},{"id":"CRD-7","text":"WHEN variant names a value that the active design system does not have THE card SHALL render with the default value's tokens, and in debug builds report the unknown value."},{"id":"CRD-8","text":"WHEN the card is pressed by pointer, touch, Enter or Space THE card 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. A press — held, or moved with the pointer down — SHALL NOT select the card's text nor start a drag of it: the card is one action, as a button is, and the platform keeps a button's text from selection."},{"id":"CRD-9","text":"WHILE pressed THE card 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 control 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, outline, elevation, 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.card.motion.feedback-duration with comp.card.motion.state-easing, fades over comp.card.motion.state-duration with comp.card.motion.state-easing once the press has ended and press-hold has passed, and appears whole where motion is reduced."},{"id":"CRD-10","text":"THE card SHALL ease its container 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":"CRD-11","text":"WHILE interactive is false and href is empty THE card SHALL NOT be focusable, SHALL NOT emit click, SHALL NOT draw a hover, focus or press answer, SHALL ignore disabled, and SHALL render from the resting tokens of its variant."},{"id":"CRD-12","text":"WHILE inset is true THE card SHALL place its content comp.card.container.padding inside the container on every side; WHILE inset is false the content SHALL reach the container's edges. In both cases THE card SHALL clip its content to the container's shape, draw the outline of the outlined variant (comp.card.outline.width wide) above the content, and grow with its content: the card has no height of its own."},{"id":"CRD-13","text":"THE card SHALL hand its content the content color of its variant and state (comp.card.outlined.content.color for outlined at rest, and so on) as the platform's inherited foreground (the web's inherited color, SwiftUI's foreground style, Compose's content color, Flutter's default text and icon style); on React Native, which has no inherited text color, it SHALL provide the color through the Tanrei context that Tanrei's text components read. Plain text given as content, where the platform must style it, SHALL take sys.typescale.body."},{"id":"CRD-14","text":"WHILE interactive is true THE card SHALL be exactly one focusable element with the button role (the link role WHILE href is not empty, CRD-19), named by label, over a name the product gives it on the element (aria-label or aria-labelledby), or, WHILE label is empty, by the name the product gives it on the element — aria-label, or aria-labelledby naming an element — or else by the text of its content merged in reading order, and in debug builds SHALL report, WHILE it has neither label nor a name of the product's, that it has no label; WHILE interactive is false and href is empty THE card SHALL have no role of its own and leave its content's semantics untouched, except that WHERE label is set it SHALL be a group named by label."},{"id":"CRD-15","text":"WHILE interactive is true or href is not empty THE card's content SHALL contain no interactive element (button, link, field, toggle or anything else focusable); a platform that can inspect its content (the web, on every slot change) SHALL report one in debug builds, and a platform that cannot SHALL state the rule in its README and docs page."},{"id":"CRD-16","text":"WHEN the elevation or the colors of an interactive card change between states THE card SHALL animate the change over comp.card.motion.state-duration with comp.card.motion.state-easing, and SHALL change them at once where motion is reduced."},{"id":"CRD-17","text":"WHEN the layout direction is right-to-left THE card SHALL apply its padding and clipping by logical start and end so that it mirrors, SHALL grow a ripple from the point of contact as in left-to-right, and SHALL NOT mirror its content itself: the content follows the layout direction."},{"id":"CRD-18","text":"THE card 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 card is shown THE card SHALL draw itself for the new direction at once, without a motion of its own, keeping what it shows and its state."},{"id":"CRD-19","text":"WHILE href is not empty THE card SHALL be a link card, whether interactive is true or false: exactly one focusable element with the link role and not the button role, named as CRD-14 names an interactive card, its content presentational and held to CRD-15; the platform's own link to href (the web's anchor element; SwiftUI's Link; on Compose, Flutter and React Native an element with the platform's link semantics whose address is opened by the platform's opener), so that whatever the platform gives a link — on the web its context menu, opening in a new tab or window, copying and dragging its address, and the address shown before it is followed — is the platform's, and not the card's to draw or to take over; and everything this spec says of an interactive card other than its role and its keys — its states, focus ring, minimum target, press answer, corners, motion and disabled look (CRD-3 to CRD-6, CRD-8 to CRD-10, CRD-16) — SHALL hold for a link card from the same tokens, with no look of its own for a link and none for a destination already visited."},{"id":"CRD-20","text":"WHEN the user activates a link card by pointer, touch or Enter THE card SHALL emit click exactly once and then open href where target names, unless the product cancelled that click, in which case it SHALL open nothing: the product's own router has taken the navigation. It SHALL show the pressed state as CRD-8 and CRD-9 say and SHALL NOT hold the navigation back for sys.motion.duration.press-hold. THE card SHALL NOT activate a link card on Space, which on the web scrolls the page as it does on any link, and SHALL NOT show the pressed state for it; WHERE the platform gives its links other keys or gestures (on the web a modified or a middle click that opens a new tab, on Apple platforms a long press that previews) THE card SHALL leave them to the platform."},{"id":"CRD-21","text":"WHILE the card is a link card and target is new THE card SHALL open href in a new context — on the web a new tab or window that is given no handle to the page that opened it; on the other platforms outside the screen the person is on, as the platform's opener decides. THE card SHALL draw no mark of its own for it, because its content is the product's to lay out (CRD-12): a product that shows that the card opens elsewhere puts the glyph open_in_new of the system's icon set in the content, through the icon helper. WHILE target is new THE card SHALL expose targetLabel as its description, read after its name and role, and WHILE targetLabel is empty SHALL still render and in debug builds report that a link that opens a new context does not say so. WHILE target is same THE card SHALL ignore targetLabel."},{"id":"CRD-22","text":"WHILE href is not empty and disabled is true THE card SHALL NOT be a link that can be followed: it SHALL render as CRD-6 says, SHALL expose the link role with the disabled state and no destination, SHALL NOT be focusable, SHALL NOT emit click, and SHALL open nothing by any means the platform gives a link (on the web the anchor carries no href, so there is no context menu entry, no drag and no new tab for it)."},{"id":"CRD-23","text":"WHEN target names a value the card does not define THE card SHALL behave as same, and in debug builds report the unknown value. IF href is only white space, or names a script to run rather than a place to go (the web's javascript: scheme), or cannot be read as an address by the platform, THE card SHALL be the card its interactive makes it, without a destination, and in the last two cases report it in debug builds."},{"id":"CRD-24","text":"WHERE the platform has ARIA attributes (the web), WHEN the product sets an aria- attribute on the host, by the attribute or by the ARIA property that reflects it, THE card SHALL move it to the data-aria- attribute of the same name, so that the host is no second node with its name, description or state, and SHALL expose it on the element that carries its role — an id reference by the elements it names in the host's tree or a tree around it, an error message as part of the description while the card is invalid — except those the card owns (aria-disabled), which it SHALL move and not expose. WHEN the product removes the aria- attribute or its data-aria- twin, or sets the ARIA property that reflects it (ariaLabel, ariaDescribedByElements…) to null, THE card SHALL take it off that element. WHEN the product sets an aria- attribute the card owns THE card SHALL report it in debug builds."}],"accessibility":{"role":"button (link while href is set)","keyboard":[{"keys":"Tab","action":"Moves focus to an interactive card or a link card. A card that is neither is not a tab stop; focus moves through its content."},{"keys":"Enter or Space","action":"Activates an interactive card. A link card is activated by Enter alone: Space does what it does on any link (on the web it scrolls the page)."}],"labeling":"The role is button while interactive is true and link while href is set; otherwise the card has no role, or is a group when label is set. An interactive card's or a link card's name is label — normally its heading's text — or, without one, its whole content read as one string (reported in debug builds). Their content is presentational: its headings and images are read as part of the name, not as separate elements. While target is new, targetLabel is a link card's description.","minimumTarget":true,"notes":["Never nest interactive elements in an interactive card or a link card: assistive technology cannot reach them (the card is one element) and a press on them would also activate the card. A card that needs its own buttons or links stays plain, and its primary action or destination is one of them: a heading that is a link, or a link Button.","Web: an interactive card draws a shadow element with role button and tabindex 0 around the slot (not a <button>, whose content model forbids block content); Enter activates on keydown and Space on keyup, as a native button does. A link card draws an anchor around the slot instead, which HTML allows around block content that holds nothing interactive. In debug builds either inspects the slotted content on every slotchange for focusable or interactive descendants and reports them.","SwiftUI, Compose, Flutter and React Native merge the content into the one accessible element (SwiftUI's button, Compose's merged clickable semantics, Flutter's merged semantics, React Native's accessible Pressable). None of them can reliably detect a nested interactive element, so each states the rule in its README; their tests assert that the merged element is the only one exposed.","Text size does not clip a card: it grows with its content at 200% text size.","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.","A card with a destination is a link: one element with the link role, the platform's own link, Enter and not Space, so that on the web the card can be opened in a new tab and its address copied. No visited state is drawn.","A link card that opens a new context says so through targetLabel. The card draws no mark of its own, since it does not lay out its content; a product that shows one puts the glyph open_in_new of the system's icon set in the content, where the icon helper mirrors it in a right-to-left layout."]},"tokens":"comp.card","fixtures":[{"id":"outlined","props":{"variant":"outlined"},"content":"Quarterly report. Revenue grew 12% over the previous quarter."},{"id":"filled","props":{"variant":"filled"},"content":"Quarterly report. Revenue grew 12% over the previous quarter."},{"id":"elevated","props":{"variant":"elevated"},"content":"Quarterly report. Revenue grew 12% over the previous quarter."},{"id":"outlined-flush","props":{"variant":"outlined","inset":false},"content":"Quarterly report. Revenue grew 12% over the previous quarter."},{"id":"outlined-interactive","props":{"variant":"outlined","interactive":true,"label":"Quarterly report"},"content":"Quarterly report. Revenue grew 12% over the previous quarter."},{"id":"outlined-disabled","props":{"variant":"outlined","interactive":true,"disabled":true,"label":"Quarterly report"},"content":"Quarterly report. Revenue grew 12% over the previous quarter."},{"id":"elevated-disabled","props":{"variant":"elevated","interactive":true,"disabled":true,"label":"Quarterly report"},"content":"Quarterly report. Revenue grew 12% over the previous quarter."},{"id":"outlined-link","props":{"variant":"outlined","href":"/getting-started/","label":"Getting started"},"content":"Getting started. Install and use Tanrei on your platform."},{"id":"filled-link-new","props":{"variant":"filled","href":"https://example.com/tanrei","label":"Source","target":"new","targetLabel":"opens in a new tab"},"content":"Source. The repository, its issues and its releases."},{"id":"outlined-link-disabled","props":{"variant":"outlined","href":"/getting-started/","disabled":true,"label":"Getting started"},"content":"Getting started. Install and use Tanrei on your platform."}],"platforms":{"web":{"status":"lagging","name":"tanrei-card","props":{"variant":"variant","interactive":"interactive","disabled":"disabled","inset":"flush","label":"label","href":"href","target":"target","targetLabel":"targetLabel"},"events":{"click":"click"},"parts":{"container":"container","outline":"outline","content":"content","focus-ring":"container@focus-ring"},"notes":"The content is the default slot. `inset` is its inverse, the boolean property `flush` (attribute `flush`), false by default: an HTML boolean attribute cannot default to true, and a property has its attribute's name. `click` fires only while interactive is true and disabled is false. With `href` the shadow root holds an `<a part=\"container\">` around the slot in place of the element with role button; `click` then fires for a link card too. The link form: `href` is the `href` attribute; `target` is the `target` attribute with the values `same` and `new` (the HTML spellings `_self` and `_blank` are read as those two; anything else is `same` and reported); `targetLabel` is the `target-label` attribute. Web-only, forwarded to the anchor and to nothing else: `rel` (to which `new` adds `noopener`) and `download`. Cancelling `click` (`preventDefault()`) cancels the navigation, which is how a client-side router takes it; a modified or a middle click is the browser's. A disabled link is the anchor without `href`, with `role=\"link\"` and `aria-disabled=\"true\"`, as the navigation drawer's destination already is. Space is not handed to the press controller. `element.click()` follows the link."},"swiftui":{"status":"lagging","name":"TanreiCard","props":{"variant":"variant","interactive":"action","disabled":"disabled","inset":"inset","label":"label","href":"destination","target":"target","targetLabel":"targetLabel"},"events":{"click":"action"},"notes":"SwiftUI idiom (as `Button`): the initializer that takes `action:` makes the card interactive; the one without it is a plain container. `disabled` follows `.disabled(_:)`; `label` sets `accessibilityLabel`. Content is a `@ViewBuilder`. Not built on this platform yet: the initializer that takes `destination: URL` in place of `action:` draws the same control as a SwiftUI `Link`, so the address is opened by the environment's `openURL` — an app that routes addresses itself provides an `OpenURLAction`, which is how the navigation is cancelled — and VoiceOver reads the link trait. `target: TanreiLinkTarget = .same` and `targetLabel` (the accessibility hint) are parameters of that initializer alone."},"compose":{"status":"lagging","name":"TanreiCard","props":{"variant":"variant","interactive":"onClick","disabled":"enabled","inset":"inset","label":"contentDescription","href":"href","target":"target","targetLabel":"targetLabel"},"events":{"click":"onClick"},"notes":"Compose idiom (as `Card`): the overload with a non-null `onClick` is interactive; `enabled` is the inverse flag. Content is a `ColumnScope` lambda and reads the content color from `LocalTanreiContentColor` and plain text's style from `LocalTanreiTextStyle`, Tanrei's own locals (the package does not depend on Material, whose `LocalContentColor` it would otherwise be). Not built on this platform yet: the overload that takes `href: String` (`onClick` is then optional and called first) opens the address through `LocalUriHandler.current` after `onClick`; an app that routes addresses itself provides its own `UriHandler`. Compose has no link role for a clickable element (only link annotations inside text), so the node drops `Role.Button` and carries no role, and the README says so. `target: TanreiLinkTarget = TanreiLinkTarget.Same`; `targetLabel` is appended to the node's state description."},"flutter":{"status":"lagging","name":"TanreiCard","props":{"variant":"variant","interactive":"onTap","disabled":"enabled","inset":"inset","label":"semanticLabel","href":"href","target":"target","targetLabel":"targetSemanticLabel"},"events":{"click":"onTap"},"notes":"Flutter idiom: a non-null `onTap` makes the card interactive. `enabled: false` disables it while keeping its interactive look (as `ListTile`), because a null `onTap` already means not interactive. Content is `child`. Not built on this platform yet: the `TanreiCard.link` constructor (`href` is a `Uri`) has `Semantics(link: true)` with the address as its `linkUrl`. The package has no plugin dependency, so the address is opened by the nearest `TanreiLinkOpener`, an inherited widget the app provides once (calling `url_launcher`, or its own router); without one the control opens nothing and reports it in debug builds. `target` is a `TanreiLinkTarget`; `targetSemanticLabel` is the semantics hint."},"react-native":{"status":"lagging","name":"Card","props":{"variant":"variant","interactive":"onPress","disabled":"disabled","inset":"inset","label":"accessibilityLabel","href":"href","target":"target","targetLabel":"targetLabel"},"events":{"click":"onPress"},"notes":"A non-null `onPress` makes the card interactive (an accessible `Pressable` with the button role); without it the card is a `View`. Content is `children`. Not built on this platform yet: a Card with `href` has `accessibilityRole=\"link\"` and opens the address with `Linking.openURL` after `onPress`, unless `onPress` called `event.preventDefault()`. `target` is `\"same\" | \"new\"`; `targetLabel` is the `accessibilityHint`."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"carousel","title":"Carousel","summary":"Lets people browse a row of visual items that scrolls sideways around one item in focus, in the centre or at the start, the others narrower or smaller as they move away and always the same gap apart, each item opening what it shows; a featured row may loop, show its position in dots and advance by itself, with a control to stop it.","level":"base","listing":"default","anatomy":[{"id":"row","description":"The row of items: as wide as the carousel, scrolling sideways, padded at its start and end. Items scroll under the padding to its edges, every two neighbours the same gap apart."},{"id":"item","description":"One item of the row (an item of the item kind). The item in focus is the hero, in the middle of the row unless heroAlignment puts it at the start; with fluid widths the others narrow as they move away from it, and with scaleOthers they are drawn smaller."},{"id":"item.container","description":"The item's rounded box. It clips the item's content, fills what the content leaves uncovered, and carries hover, focus and press."},{"id":"item.content","description":"What the product puts in the item (an image, a poster). The carousel lays it out at the hero's width and aligns it in the container (centred, or toward the hero), so a narrower item shows part of it."},{"id":"focus-ring","description":"Gap-then-ring indicator for keyboard focus: inside an item's container, which the row would otherwise clip, and around the indicator's or the playback control's container.","optional":true},{"id":"previous","description":"The previous control: an icon-only Button over the row's inline start, centred on the row's height, that moves the row back by one resting position. Drawn as navigation says, while there are at least two resting positions (CRL-41).","optional":true},{"id":"next","description":"The next control: an icon-only Button over the row's inline end, centred on the row's height, that moves the row on by one resting position. Drawn as navigation says, while there are at least two resting positions (CRL-41).","optional":true},{"id":"controls","description":"The controls row directly below the items, drawn while the indicator or the playback control is. It does not scroll.","optional":true},{"id":"indicator","description":"The dots, centred in the controls row: one per resting position, the current one stretched, the stretch following the scroll. One control (a slider) whose container carries hover, focus and press.","optional":true},{"id":"indicator.dot","description":"One dot: a pill of the dot size, stretched toward the active width as the row nears its position; the current dot may fill to show the time until autoplay moves on."},{"id":"playback","description":"The playback control at the end of the controls row, drawn while autoplay is on: an icon-only button, a circle, that pauses and plays.","optional":true},{"id":"playback.icon","description":"The glyph of the icon set: `pause` while autoplay is playing, `play_arrow` while it is paused. Never mirrored."}],"props":[{"name":"heroAlignment","type":"enum","values":["start","center"],"default":"center","description":"Where the item in focus (the hero) sits: in the middle, with items on both sides (the default), or at the inner start edge (the left in a left-to-right language), with items after it only. Not a token axis: geometry, read from the same tokens."},{"name":"itemWidth","type":"number","default":null,"description":"The width the hero is laid out at, in the platform's unit (CSS px, pt, dp, logical pixels); null takes comp.carousel.container.large-width. With fixed widths every item is this wide (at most the inner width); with fluid widths the hero is kept between a floor and a cap that leave room for the others (CRL-9). Choose it from the content's shape: a product's posters and thumbnails differ."},{"name":"fluidWidth","type":"boolean","default":true,"description":"Whether item widths change fluidly: true narrows the items beside the hero (on both sides of a hero in the centre) to a medium and a small width, each width following the scroll; false makes every item the hero's width, the ones that do not fit cut by the carousel's edges."},{"name":"contentAlignment","type":"enum","values":["center","toward-hero"],"default":"center","description":"With fluid widths, where a narrowed item's content is anchored: center shows its middle; toward-hero aligns the items after the hero to their start and the items before it to their end, so each shows the side nearest the hero. Ignored while fluidWidth is false."},{"name":"scaleOthers","type":"boolean","default":false,"description":"Whether the items other than the hero are drawn smaller, down to comp.carousel.container.min-scale, the scale following the scroll and the gap between drawn items staying the same. It applies with fluid or fixed widths."},{"name":"snap","type":"boolean","default":true,"description":"Whether the row settles at an item when a scroll ends; false lets it rest wherever the scroll ends."},{"name":"loop","type":"boolean","default":false,"description":"Whether the row is endless: scrolling past the last item continues to the first, and back. Takes effect only with two or more items; with fewer it is ignored."},{"name":"navigation","type":"enum","values":["auto","always","none"],"default":"auto","description":"Whether the previous and next controls are drawn over the ends of the row (CRL-41, CRL-42). auto draws them where the primary pointer is fine and can hover — a mouse or a trackpad, where no finger swipes the row — and shows them while the pointer is over the carousel or focus is within it; always draws them on every device and shows them at all times; none draws neither. Keep auto wherever you can: without the controls a person with a mouse moves the row only with Shift and the wheel, or with the indicator where it is drawn, and never with a single press (WCAG 2.5.7)."},{"name":"indicator","type":"boolean","default":false,"description":"Whether the dots are drawn below the items: one per resting position, the current one stretched. For a short featured row; a long row to browse needs none."},{"name":"autoplay","type":"boolean","default":false,"description":"Whether the row advances by itself, one item every autoplayInterval. It holds while the carousel is hovered, has focus within, is pressed or is hidden, and never runs where motion is reduced (CRL-32 to CRL-34)."},{"name":"autoplayInterval","type":"number","default":null,"description":"How long the row rests at an item before autoplay moves on, in milliseconds; null takes comp.carousel.autoplay.interval. Give text-heavy items more time than images."},{"name":"paused","type":"boolean","default":false,"description":"Whether autoplay is paused, by the person (with the playback control) or by the product. The playback control changes it and emits pausedChange; a product that sets it emits nothing."},{"name":"playbackControl","type":"boolean","default":true,"description":"Whether the playback control is drawn while autoplay is on. A product may hide it, but should keep it wherever it can: on touch there is no hover, and without it a person cannot stop the motion (WCAG 2.2.2)."},{"name":"autoplayProgress","type":"boolean","default":false,"description":"Whether the current dot fills to show the time until autoplay moves on. Needs indicator; ignored while autoplay is off or paused."},{"name":"playLabel","type":"string","default":"","description":"The playback control's accessible name while autoplay is paused (\"Play the slideshow\"). Required while the control can be drawn.","words":"playLabel"},{"name":"pauseLabel","type":"string","default":"","description":"The playback control's accessible name while autoplay is playing (\"Pause the slideshow\"). Required while the control can be drawn.","words":"pauseLabel"},{"name":"previousLabel","type":"string","default":"","description":"The previous control's accessible name (\"Previous walk\"). Required while the control can be drawn.","words":"previousItemLabel"},{"name":"nextLabel","type":"string","default":"","description":"The next control's accessible name (\"Next walk\"). Required while the control can be drawn.","words":"nextItemLabel"},{"name":"label","type":"string","default":"","description":"Names the carousel's list, and its indicator, for assistive technology (\"Recently played\"). Required."}],"items":[{"name":"item","summary":"One item of the row: the product's content in a rounded box, one action named by its label.","props":[{"name":"label","type":"string","default":"","description":"The item's accessible name: what its content shows (\"Coast path, 12 photos\"). Required; the content itself is not read. It is also the indicator's value text while the item is in focus."}],"slots":[{"name":"default","description":"The item's content. A fixture item's content is the name of a glyph: the harness draws it centred in the content box (the hero's width, the row's height) at sys.icon.medium through the icon helper, with the family and fill of an unselected icon, in the item's content color, on the item's container color."}],"events":[{"name":"click","description":"The item was activated by pointer, touch, keyboard or assistive technology."}]}],"events":[{"name":"pausedChange","description":"The person paused or played autoplay with the playback control; carries the new paused value. Not emitted when the product sets paused, nor for the holds of CRL-33."}],"states":["enabled","hovered","focused","pressed"],"behavior":[{"id":"CRL-1","text":"WHEN the user activates an item by pointer, touch, Enter or Space THE carousel SHALL emit that item's click exactly once; a press that turns into a scroll (a drag beyond the platform's touch slop, a fling) SHALL NOT activate the item it started on."},{"id":"CRL-2","text":"WHILE an item, the indicator or the playback control is hovered, keyboard-focused or pressed THE carousel SHALL render that part's container, content color and opacity, and an item's shape, from the component tokens of its highest-precedence active state, with precedence pressed over focused over hovered; focus gained by pointer or touch SHALL NOT select the focused state."},{"id":"CRL-3","text":"WHEN an item, the indicator or the playback control receives keyboard focus THE carousel SHALL show the focus ring without animation, inside an item's container, which the row would otherwise clip, and around the indicator's or the playback control's container; focus gained by pointer or touch SHALL NOT show it."},{"id":"CRL-4","text":"THE carousel SHALL make each item's hit area its drawn container with half of comp.carousel.layout.gap on each side, which for a small item at comp.carousel.container.small-min-width is sys.target.touch wide with the default tokens, and SHALL NOT let the hit area of an item that fills a slot fall below sys.target.pointer wide for a fine pointer or sys.target.touch for touch; a system whose widths give less SHALL still extend the hit area without changing the drawn item, and the row's height SHALL NOT be below the target either. An item on its way between the last slot and an edge slot (CRL-12) is narrower than any slot: its hit area SHALL be its drawn container with half of the gap on each side and no wider, so that it never covers its neighbour's."},{"id":"CRL-5","text":"WHEN a carousel item or the playback control is pressed by pointer, touch, Enter or Space, or the indicator by pointer or touch, THE carousel SHALL show that part's pressed state without delay and SHALL keep it visible for at least sys.motion.duration.press-hold, even when the press ends sooner; the indicator's SHALL last as long as the press does."},{"id":"CRL-6","text":"WHILE a carousel item, the indicator or the playback control is pressed THE carousel 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 control 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.carousel.motion.feedback-duration with comp.carousel.motion.state-easing, fades over comp.carousel.motion.state-duration with comp.carousel.motion.state-easing once the press has ended and press-hold has passed, and appears whole where motion is reduced."},{"id":"CRL-7","text":"THE carousel SHALL ease the corners of its items' containers, the indicator's container and the playback control 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 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":"CRL-8","text":"THE carousel SHALL be as wide as its parent; its row of items SHALL be comp.carousel.layout.height tall unless the product sizes the carousel through the platform's own sizing, in which case the row takes that height less the controls row (CRL-28), and every item SHALL be as tall as the row. It SHALL lay its items out in one row in the order given, comp.carousel.layout.gap apart (g), inside comp.carousel.layout.padding-inline at its start and its end: the inner width W is the carousel's width less that padding twice. Items SHALL scroll under the padding to the carousel's edges and be clipped there. WHERE the parent proposes no width — it is as wide as its content, as a table cell, an inline block or a flex item that is not stretched is — THE carousel SHALL be as wide as one hero item and its padding, L (CRL-9) plus comp.carousel.layout.padding-inline twice, whatever its items, heroAlignment, fluidWidth, scaleOthers and controls row, and SHALL keep that width while it lays its items out; the inner width W is then L."},{"id":"CRL-9","text":"THE carousel SHALL take L from itemWidth, or from comp.carousel.container.large-width while itemWidth is null, and SHALL make the hero slot H wide. WHILE fluidWidth is false H SHALL be L, at most W. WHILE fluidWidth is true H SHALL be L kept between a floor and a cap: WHILE heroAlignment is center, the floor (W − 4 × g − 2 × comp.carousel.container.small-max-width) / 3 and the cap W − 2 × (g + comp.carousel.container.small-max-width); WHILE heroAlignment is start, the floor (W − 2 × g − comp.carousel.container.small-max-width) / 2 and the cap W − g − comp.carousel.container.small-max-width. IF fluidWidth is true and that cap is less than comp.carousel.container.small-max-width THE carousel SHALL lay the row out as it does with fixed widths (CRL-13), H being W."},{"id":"CRL-10","text":"WHILE fluidWidth is true THE carousel SHALL fill the width E that the hero slot leaves on each side where items follow it (on both sides, E = (W − H) / 2 − g, WHILE heroAlignment is center; after it, E = W − H − g, WHILE heroAlignment is start) with slots g apart, going outward from the hero: IF E − g is less than 2 × comp.carousel.container.small-min-width, one small slot E wide; otherwise a medium slot M wide and then a small slot S wide, where S is (E − g) / 3 kept between comp.carousel.container.small-min-width and comp.carousel.container.small-max-width and M = E − g − S. IF M is then greater than H, M SHALL be H and S SHALL be E − g − H. Widths SHALL NOT be rounded before the items are placed; CRL-40 says where a platform that draws on whole device pixels puts the rounding."},{"id":"CRL-11","text":"THE carousel SHALL place the hero slot, where the item in focus sits, WHILE heroAlignment is center with its middle at the middle of the inner width (its start h at (W − H) / 2), and WHILE heroAlignment is start at the inner start edge (h is 0); and SHALL place the other slots of CRL-10, on both sides of it at the centre and after it at the start, each one g beyond the slot before it going outward, measured between the slots' drawn edges."},{"id":"CRL-12","text":"THE carousel SHALL place its items by a scroll position p, a number of items that advances by one for every H + g the row is scrolled. WHILE loop is not in effect (CRL-27) p SHALL run from 0 to N − 1 (N the number of items), except where CRL-13 ends the range sooner for a hero at the start; the resting positions are the whole numbers in the range and, where the range ends at a fraction, its end, D of them in all, so D is N wherever the range is not ended sooner. Item i, counted from 0, sits at slot position s = i − p. Slot 0 is the hero slot and slots 1, 2 and on follow it toward the end; WHILE heroAlignment is center slots −1, −2 and on precede it toward the start, and WHILE heroAlignment is start no slot precedes it (CRL-10, CRL-11, CRL-13). WHILE fluidWidth is true, beyond the last slot on each side lies an edge slot of no width, g beyond that slot — before a hero at the start, g before the hero slot itself — so that at a whole p nothing is drawn beyond the last slots; an item at or beyond an edge slot SHALL NOT be drawn. An item's start and width SHALL be the linear interpolation between those of the two slots around s. So at p = 0 the first item is the hero and nothing is drawn before it, and as p grows each item moves toward the start, growing from nothing at the edge slot to H as it reaches slot 0 and narrowing again to nothing as it leaves, a hero at the start narrowing against the inner start edge; at the end of the range the last item is the hero and the slots after it are empty."},{"id":"CRL-13","text":"WHILE fluidWidth is false THE carousel SHALL make every slot H wide, slot k starting at h + k × (H + g), h being the hero slot's start (CRL-11), with no edge slot: the slots go on beyond the carousel's edges, where the items are clipped (CRL-8), so that CRL-12's interpolation starts item i at h + s × (H + g). WHILE scaleOthers is also true the slots other than the hero's take the widths and the places CRL-26 gives them. WHILE heroAlignment is start, scaleOthers is false and loop is not in effect, the range of p SHALL end where the last item ends at the inner end edge, at the greater of 0 and (N × (H + g) − g − W) / (H + g), so that WHILE every item fits in W the row does not scroll."},{"id":"CRL-14","text":"WHEN the user scrolls the carousel by touch, pen, trackpad, a horizontal wheel or Shift with a vertical wheel THE carousel SHALL follow the scroll; WHILE snap is true, WHEN the scroll ends (a drag released, a wheel or trackpad gesture over) THE carousel SHALL settle at a resting position: the next one in the direction of a fling, or else the nearest one, over comp.carousel.motion.scroll-duration with comp.carousel.motion.scroll-easing, at once where motion is reduced; WHILE snap is false it SHALL come to rest wherever the scroll ends. A fling is a release faster than the platform's minimum fling velocity (Android's ViewConfiguration.getScaledMinimumFlingVelocity, Flutter's kMinFlingVelocity) or, where the platform names none (the web, SwiftUI, React Native), 0.5 points per millisecond. A release's velocity is the pointer's over its last moves: WHERE the pointer has not moved for longer than the time after which the platform's velocity tracker takes a pointer as stopped (40 milliseconds in Android's VelocityTracker, Jetpack Compose's VelocityTracker and Flutter's VelocityTracker) or, where the platform names none (the web, SwiftUI, React Native), 40 milliseconds before the release THE carousel SHALL take the release as having no velocity, so that a drag that stops where it is wanted and is let go there is no fling, however fast it moved before it stopped. A horizontal wheel, a trackpad and Shift with a vertical wheel are physical in every layout direction: THE carousel SHALL move the row the way the platform's own scrolling containers move for that input and SHALL NOT reverse it in a right-to-left layout, so that Shift with a wheel turned down, which brings into view what lies further to the right, moves toward later items in left-to-right and toward earlier items in right-to-left."},{"id":"CRL-15","text":"THE carousel SHALL lay each item's content out H wide and as tall as the row, and SHALL clip it to the item's container and its comp.carousel.container.shape corners; WHILE fluidWidth is false or contentAlignment is center the content SHALL be centred on the container, and WHILE fluidWidth is true and contentAlignment is toward-hero an item after the hero (s above 0) SHALL align the content's start edge with its container's start edge and an item before it (s below 0) the content's end edge with its container's end edge, so that a narrowed item shows the side of its content nearest the hero and the content glides inside the item as it widens and narrows."},{"id":"CRL-16","text":"THE carousel SHALL fill each item's container with comp.carousel.item.container.color at rest, under its content, whatever the item's state, and SHALL hand the content comp.carousel.item.content.color as the platform's inherited foreground (the web's inherited color, SwiftUI's foreground style, Compose's content color, Flutter's default text and icon style, React Native's Tanrei text context). Because an item's content usually covers it (an image), the carousel SHALL draw the state layer over the content: comp.carousel.item.state-layer.color at sys.state.hover-state-layer-opacity, sys.state.focus-state-layer-opacity or sys.state.pressed-state-layer-opacity for the item's highest-precedence state, and the ripple of CRL-6 in the same layer, so hover, focus and press show on any content; the container color under the content is the resting fill only."},{"id":"CRL-17","text":"THE carousel SHALL be at most five Tab stops, in this order: the playback control while it is drawn (CRL-35), so that the motion can be stopped before anything else is reached; the previous and then the next control while they are drawn (CRL-41), before the items, so that a person can move the row before reading it; the items, as one stop, at the item that last had keyboard focus in it or else at the resting item (the item at slot 0 while fluidWidth is true, heroAlignment is center or snap is true, and otherwise the first item wholly in view); and the indicator while it is drawn (CRL-29). WHILE an item has keyboard focus Right Arrow and Left Arrow SHALL move focus to the next and previous item, from the last to the first and the first to the last WHILE loop is in effect and otherwise without wrapping, and Home and End to the first and last item; in a right-to-left layout Left Arrow SHALL move to the next item and Right Arrow to the previous."},{"id":"CRL-18","text":"WHEN an item receives keyboard focus or assistive-technology focus THE carousel SHALL scroll, over comp.carousel.motion.scroll-duration with comp.carousel.motion.scroll-easing (at once where motion is reduced), so that WHILE fluidWidth is true, heroAlignment is center or snap is true the item sits at slot 0 or, where the range ends first, at the resting position nearest it, going the shorter way round WHILE loop is in effect; and otherwise so that the whole item is in view, scrolling as little as that needs."},{"id":"CRL-19","text":"THE carousel SHALL expose its items as a list named by label, and each item as one element with the button role, named by its label, with its position among the items and their number; it SHALL hide each item's content from assistive technology (the label names the item), and SHALL keep items that are out of view exposed, in order, so that a screen reader reaches every item (CRL-18 brings it into view). The indicator (CRL-31), the playback control (CRL-35) and the previous and next controls (CRL-41) SHALL be outside the list and SHALL NOT be counted among its items."},{"id":"CRL-20","text":"WHILE an item's label is empty THE carousel SHALL still render it, and in debug builds report that it has no accessible name; WHILE the carousel's label is empty it SHALL report that the list and the indicator have no name; WHILE autoplay and playbackControl are true and playLabel or pauseLabel is empty it SHALL report the missing name; WHILE the previous and next controls are drawn (CRL-41) and previousLabel or nextLabel is empty it SHALL report the missing name; and WHILE indicator is true and the dots do not fit (CRL-29) it SHALL report that they are not drawn. An item's content SHALL contain no interactive element; a platform that can inspect it (the web, on every slot change) SHALL report one in debug builds, and a platform that cannot SHALL state the rule in its README."},{"id":"CRL-21","text":"WHEN the carousel's width or its items change THE carousel SHALL arrange its slots again and keep the resting item (CRL-17) where it was, as far as the new range allows, without motion; WHEN the number of items falls below two it SHALL stop looping (CRL-27) and advancing (CRL-32), and no longer draw the indicator, the playback control or the previous and next controls."},{"id":"CRL-22","text":"WHEN the colors of an item, the indicator or the playback control change between states THE carousel SHALL animate them over comp.carousel.motion.state-duration with comp.carousel.motion.state-easing, and SHALL change them at once where motion is reduced."},{"id":"CRL-23","text":"WHEN the layout direction is right-to-left THE carousel SHALL mirror its row and its controls row: the inner start edge at the right, items moving toward the right as p grows, the padding, the scroll direction, the start and end sides of contentAlignment, the order of the dots, the playback control's side and the sides of the previous and next controls (the previous control at the right) all mirrored; it SHALL grow a ripple from the point of contact as in left-to-right, and SHALL NOT mirror an item's content or the pause and play_arrow glyphs. The chevron_left and chevron_right glyphs of the previous and next controls SHALL be drawn mirrored exactly when the system's icon set marks the name as mirrored, by the Button's own icon helper; THE carousel SHALL NOT mirror a glyph itself."},{"id":"CRL-24","text":"WHEN heroAlignment, contentAlignment or navigation names a value the carousel does not define THE carousel SHALL render with that prop's default value, and in debug builds report the unknown value; WHEN itemWidth or autoplayInterval is not a positive number THE carousel SHALL treat it as null and in debug builds report it."},{"id":"CRL-25","text":"WHILE the text size is enlarged THE carousel SHALL keep its height, slots and items as they are: it holds no text of its own, and an item's content follows the text size itself."},{"id":"CRL-26","text":"WHILE scaleOthers is true THE carousel SHALL give the hero slot the scale 1 and every other slot the scale comp.carousel.container.min-scale, and SHALL draw each item's container at the scale interpolated between the two slots around s, which is 1 − (1 − comp.carousel.container.min-scale) × the lesser of 1 and |s|: as tall as the row times that scale, centred on the row's height, with its content drawn at that scale. WHILE fluidWidth is false a slot SHALL also be H times its scale wide, and the slots SHALL be placed g apart from drawn edge to drawn edge going outward from the hero slot, so that the smaller items close up to their neighbours; WHILE fluidWidth is true the slots keep the widths of CRL-10, which already fill the row, and only the height and the content take the scale. The corners of a scaled container SHALL stay the radius of comp.carousel.container.shape (or of its state's shape token) and SHALL NOT be multiplied by the scale; the item's focus ring SHALL be drawn at its own width inside the drawn container, and the item's hit area (CRL-4) SHALL follow the drawn container. The scale SHALL follow the scroll where motion is reduced as well, because the person's own scroll drives it."},{"id":"CRL-27","text":"WHILE loop is true and there are at least two items THE carousel SHALL scroll without end in both directions: p SHALL take any value, every whole number SHALL be a resting position, and item i SHALL sit at the one slot position s that differs from i − p by a whole multiple of N and lies above −N / 2 and at most N / 2 WHILE heroAlignment is center, or above −1 and at most N − 1 WHILE heroAlignment is start, so that scrolling past the last item continues to the first and before the first to the last. Each item SHALL be drawn once: with fluid widths and enough items for every slot and both edge slots an item passes from one side to the other at the edge slots, where it has no width, and with fewer items, or with fixed widths and too few items to reach beyond both edges, a slot stays empty and an item that passes to the other side may appear there at once. WHILE there are fewer than two items THE carousel SHALL ignore loop; loop is in effect only while both conditions hold."},{"id":"CRL-28","text":"WHILE the indicator (CRL-29) or the playback control (CRL-35) is drawn THE carousel SHALL draw, directly below its row of items, a controls row as wide as the carousel and comp.carousel.controls.height tall that does not scroll, with the indicator's container centred on the carousel's width and the playback control at its inline end, its end edge at the inner end edge, both centred on the row's height; WHILE neither is drawn there SHALL be no controls row. The indicator SHALL stay centred whether or not the playback control is drawn."},{"id":"CRL-29","text":"WHILE indicator is true and there are at least two resting positions THE carousel SHALL draw the indicator: D dots in reading order, comp.carousel.dot.gap apart, each comp.carousel.dot.size tall with round ends, inside a container that reaches comp.carousel.controls.indicator-padding-inline beyond the first and last dot, is comp.carousel.controls.button-size tall and has comp.carousel.controls.shape corners. The indicator's position q follows p: between resting positions j and j + 1 it runs linearly from j to j + 1, and WHILE loop is in effect q is p less a whole multiple of N, from 0 up to N, its distance to a dot measured around the ring. Dot j SHALL be comp.carousel.dot.size + (comp.carousel.dot.active-width − comp.carousel.dot.size) × w wide, w being the greater of 0 and 1 − the distance from q to j, and SHALL be drawn in comp.carousel.dot.color with a fill of comp.carousel.indicator.content.color over it at opacity w, across its whole width unless CRL-36 says otherwise, so that the current dot is stretched and in the active color and the stretch and the color pass to the next dot as the row scrolls. IF the container would be wider than W − 2 × (sys.target.touch + g) THE carousel SHALL NOT draw the indicator."},{"id":"CRL-30","text":"WHEN the person presses the indicator by pointer or touch anywhere in its hit area THE carousel SHALL move the row to the resting position of the dot nearest the press and, while the press moves along the dots, to the dot nearest it, each move over comp.carousel.motion.scroll-duration with comp.carousel.motion.scroll-easing (at once where motion is reduced); WHILE the indicator has keyboard focus Right Arrow and Left Arrow SHALL move the row to the next and previous resting position (wrapping WHILE loop is in effect, and otherwise not), Home and End to the first and last, mirrored in a right-to-left layout; WHEN assistive technology increments or decrements the indicator it SHALL move by one resting position. Focus SHALL stay on the indicator, and the items' Tab stop (CRL-17) SHALL become the resting item the move brings."},{"id":"CRL-31","text":"THE carousel SHALL expose the indicator as one slider (the adjustable trait on Apple platforms), named by label, horizontal, with the lowest value 1, the highest D and the value of the resting position nearest q counted from 1, and SHALL give it as value text the label of the item that position brings to slot 0 or, where the range ends first, the resting item there; its dots SHALL NOT be exposed one by one."},{"id":"CRL-32","text":"WHILE autoplay is true, paused is false, there are at least two resting positions, motion is not reduced (CRL-34) and no hold of CRL-33 is in effect THE carousel SHALL advance to the next resting position each time autoplayInterval (or comp.carousel.autoplay.interval while it is null) has passed with the row at rest, scrolling over comp.carousel.motion.autoplay-duration with comp.carousel.motion.autoplay-easing; from the last resting position it SHALL go on to the first, forward WHILE loop is in effect and otherwise back across the row over the same duration. An advance SHALL NOT move focus, change the items' Tab stop, or make an announcement."},{"id":"CRL-33","text":"WHILE a pointer is over the carousel (its row or its controls row), focus is anywhere within it however it came there, the person is pressing or dragging the row or the indicator, or the platform reports the carousel's window or document hidden, THE carousel SHALL NOT advance and SHALL hold the time that has passed; WHEN the last hold ends it SHALL continue from the time it held. WHEN the person moves the row (a scroll, a key, the indicator, the previous or the next control) the time SHALL start again from zero once the row comes to rest. WHEN the person activates the playback control to play, the hover and focus holds in effect at that moment SHALL end, and each SHALL apply again only once the pointer or focus has left the carousel and entered it again."},{"id":"CRL-34","text":"WHILE motion is reduced THE carousel SHALL NOT advance by itself, whatever autoplay and paused say, and SHALL NOT draw the playback control or the autoplay progress; WHEN motion stops being reduced it SHALL start autoplay again (paused permitting) with the time from zero. Where motion is reduced the width, the scale and the dots SHALL still follow a scroll the person makes."},{"id":"CRL-35","text":"WHILE autoplay is true, playbackControl is true, there are at least two resting positions and motion is not reduced THE carousel SHALL draw the playback control in the controls row: an icon-only button, a comp.carousel.controls.button-size square with comp.carousel.controls.shape corners, filled with comp.carousel.playback.container.color, holding the icon set's pause glyph while paused is false and play_arrow while paused is true, comp.carousel.controls.icon.size, in comp.carousel.playback.content.color, with the family and fill of an unselected icon, sys.icon.weight and its optical size clamped to sys.icon.optical-size.min and sys.icon.optical-size.max. It SHALL be exposed with the button role, named by pauseLabel while paused is false and by playLabel while paused is true, with no pressed or selected state. WHEN the person activates it THE carousel SHALL toggle paused, emit pausedChange with the new value and keep focus on it, and on play the time SHALL start from zero; WHEN the product sets paused THE carousel SHALL emit nothing."},{"id":"CRL-36","text":"WHILE autoplayProgress is true, the indicator is drawn, autoplay is true, paused is false and motion is not reduced THE carousel SHALL draw the fill of CRL-29 only on the dot of the resting position the row last came to rest at, from that dot's start edge across the part of its width that the time passed (CRL-33) is of the interval, growing with the time and stopping while a hold is in effect, and on no other dot, so that the dot stands in comp.carousel.dot.color and fills with comp.carousel.indicator.content.color until the row moves on, the fill fading as the dot narrows."},{"id":"CRL-37","text":"THE carousel SHALL give the playback control a hit area centred on it of at least sys.target.touch for touch and sys.target.pointer for a fine pointer, and the indicator a hit area as wide as its container, at least sys.target.touch wide, that reaches the bottom edge of the controls row and, toward the row of items above it, halfway across the space the controls row leaves above the indicator; with the default tokens both fit inside the controls row, which is never lower than the controls it holds (comp.carousel.controls.height, 36 in the default system), and CRL-29 keeps them apart. WHERE the controls row is taller than the playback control THE carousel SHALL let its hit area reach toward the row of items no further than halfway across the space the controls row leaves above it, so that a press on an item, or in the nearer half of the space between an item and either control, goes to the item."},{"id":"CRL-38","text":"WHILE the icon set's font has not loaded THE carousel SHALL keep the playback control's glyph box and draw nothing in it, never the glyph's name as text."},{"id":"CRL-39","text":"THE carousel 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 carousel is shown THE carousel SHALL draw itself for the new direction at once, without a motion of its own, keeping the item at rest (the same item in reading order, not the same scroll offset), its playback and its focus."},{"id":"CRL-40","text":"THE carousel SHALL keep the distance from the drawn end edge of an item's container to the drawn start edge of the next item's container equal to comp.carousel.layout.gap, for every two neighbouring items that are both drawn, at every scroll position: at rest and at every moment of a drag, a fling, a settle, an advance and a move by the keys or the dots, in every combination of heroAlignment, fluidWidth, scaleOthers, contentAlignment, snap and loop, and in both layout directions. The edges are those of the container as it is drawn, after any scale (CRL-26), not those of a box laid out before the scale. THE carousel SHALL place every item it draws in a frame from the same scroll position p, and SHALL NOT ease, delay or animate an item's start, width or scale apart from p. A platform that draws on whole device pixels SHALL round each item's start edge and take its end edge from the next item's rounded start edge less the gap as that platform rounds it, so that the rounding falls on an item's width and never on a gap, and no two gaps in view differ."},{"id":"CRL-41","text":"WHILE navigation is auto or always and there are at least two resting positions THE carousel SHALL draw a previous control over the inline start of its row and a next control over its inline end, above the items: the previous control's start edge at the inner start edge and the next control's end edge at the inner end edge, both centred on the row's height. They SHALL be icon-only Buttons of the size comp.carousel.navigation.button.size names (medium in the default system) in the variant comp.carousel.navigation.button.variant names, given through the channel a Button reads from the component that places it and otherwise unrestyled, showing the icon set's chevron_left and chevron_right glyphs and named by previousLabel and nextLabel. WHILE navigation is auto THE carousel SHALL draw them only where the primary pointer is fine and can hover; WHILE navigation is none, or there are fewer than two resting positions, it SHALL draw neither."},{"id":"CRL-42","text":"WHILE navigation is auto THE carousel SHALL show the previous and next controls only while a pointer is over the carousel (its row or its controls row) or focus is within it, however it came there, fading them in and out over comp.carousel.motion.state-duration with comp.carousel.motion.state-easing, at once where motion is reduced; hidden, they SHALL keep their place in the Tab order (CRL-17) and stay exposed to assistive technology with their names and states, so that a keyboard reaches them and focus shows them. WHILE navigation is always THE carousel SHALL show them at all times."},{"id":"CRL-43","text":"WHEN the person activates the previous or the next control THE carousel SHALL move the row to the resting position before or after the one it is at — while it is moving, the one it is moving to; between two resting positions, the nearest one before or after where it is — over comp.carousel.motion.scroll-duration with comp.carousel.motion.scroll-easing (at once where motion is reduced), from the first to the last and from the last to the first WHILE loop is in effect. Focus SHALL stay on the control, and the items' Tab stop (CRL-17) SHALL become the resting item the move brings. WHILE loop is not in effect THE carousel SHALL disable the previous control while the row is at, or moving to, the first resting position, and the next control at the last: drawn and exposed as disabled and refusing activation, but kept in the Tab order and keeping focus, so that the stops do not change as the row moves and focus is never lost when a control reaches its end."},{"id":"CRL-44","text":"WHEN the control height (dial.control.height) is N THE carousel's playback control (CRL-35) SHALL be a square of comp.carousel.controls.button-size, which is sys.control.height.medium held at sys.target.minimum, and the dots' container (CRL-29) that tall, so that the controls row stands as tall as an icon-only Button of the default size; the controls row (comp.carousel.controls.height) SHALL stay at least as tall as the touch target."}],"accessibility":{"role":"list","keyboard":[{"keys":"Tab / Shift+Tab","action":"Moves through the carousel's stops: the playback control (while it is drawn), the previous and next controls (while they are drawn), then the items as one stop (the item that last had focus, or else the resting item), then the indicator (while it is drawn), and on out (CRL-17)."},{"keys":"Right Arrow / Left Arrow","action":"On an item: moves focus to the next or previous item and brings it into place. On the indicator: moves the row to the next or previous position. Both wrap only while the carousel loops, and are mirrored in right-to-left layouts."},{"keys":"Home / End","action":"On an item: moves focus to the first or last item and brings it into place. On the indicator: moves the row to the first or last position."},{"keys":"Enter or Space","action":"On an item: activates it (its click). On the playback control: pauses or plays autoplay. On the previous or the next control: moves the row back or on by one position (CRL-43)."}],"labeling":"The items are a list named by label. Each item is one button named by its label, with its position and the number of items; its content is not read. The indicator is one slider named by label, whose value text is the current item's label. The playback control is a button named by pauseLabel while playing and by playLabel while paused. Items out of view are still reachable, and focusing one scrolls it into place. The previous and next controls are buttons named by previousLabel and nextLabel, disabled at the ends of a row that does not loop.","minimumTarget":true,"notes":["Scrolling is never the only way to reach an item (WCAG 2.5.7, 2.1.1): the previous and next controls move the row one position with a single press of a mouse — drawn by default wherever the primary pointer is fine and can hover —, and the arrow keys, the indicator and screen-reader focus move through every item and bring it into place. The row draws no scroll bar, so without the controls a mouse could move the row only with Shift and the wheel.","Where the previous and next controls are, and when. They stand over the ends of the row, as the arrows of Ant Design's and Mantine's carousels and the overlay layouts of Fluent 2's do, not in the controls row, which exists only for a featured row with dots or autoplay. By default (auto) they are drawn only for a pointer that is fine and can hover, and shown while it is over the carousel or focus is within it: a touch screen moves the row with the finger's own swipe, and there the controls would stand over the items for good. A product whose people need them on touch as well sets always. Their place in the Tab sequence is the WAI-ARIA carousel example's: the playback control, then previous and next, then the slides.","A previous or next control at the end of a row that does not loop is disabled but keeps focus and its place in the Tab order (the Button's focusableWhenDisabled), so that pressing next again and again never drops focus to the page, and the number of stops does not change with the scroll.","An item entering or leaving at an edge of a row with fluid widths is, between resting positions, narrower than a touch target (CRL-4, CRL-12). A row that snaps never rests there; a row that does not snap can, and the arrow keys, the indicator and a further scroll all bring that item to a slot, where it has its whole target.","A carousel in a parent that proposes no width — a table cell, an inline block, a flex item that is not stretched — is one hero and its padding wide (CRL-8), whatever its items. Two consequences follow. With fluid widths its hero is laid out narrower than itemWidth there, since the others keep their room beside it (CRL-9); give the carousel a width, or turn fluidWidth off, where the hero must be itemWidth wide. And that width is also its least width as a flex or grid item whose least width is automatic, so in a row narrower than that it goes past the row's end unless the product sets its least width to 0 (on the web, min-width: 0) or gives it a width.","Autoplay (WCAG 2.2.2 Pause, Stop, Hide). A carousel that advances by itself holds while it is hovered, while focus is anywhere in it, while it is pressed and while it is hidden, and it never advances where the platform's reduced-motion setting is on (CRL-33, CRL-34). While autoplay is on, the playback control is drawn by default and is the first Tab stop, so a keyboard user reaches it before the items (CRL-17).","Keep playback controllable. A product may hide the playback control (playbackControl false), but it should keep it wherever it can. The holds are not a way to stop the motion: on touch there is no hover, a finger on the carousel holds it only while it stays there, and a screen reader that reads without moving focus does not hold it at all. Without the control, a person on a phone can stop an autoplaying carousel only through the system's reduced-motion setting. Hide it only where the product gives the person another way to stop the motion, such as a pause for all moving content on the page.","Autoplay makes no announcement and never moves focus (CRL-32). A person who wants to know what changed finds the current item as the indicator's value.","Loop keeps the arrow keys and the indicator going round, but Home and End still go to the first and last item, so a person can always find the ends of an endless row.","The indicator is one slider, not a row of unlabelled buttons: one Tab stop, the arrow keys to move, the current item's label as its value. Its hit area is the whole container and the controls row's height, so the dots need no target of their own.","The current dot is told apart by its stretched shape, not by color alone (WCAG 1.4.1), and the other dots use the functional outline role (3:1 against the surface).","Web: the host has no role; a shadow element with role list, named by label, holds the item slot, so the slotted `<tanrei-carousel-item>` elements (role listitem, around a shadow element with role button and tabindex, roving: 0 on the Tab stop, -1 on the others) are its items, as the interactive card draws its button. The indicator is a shadow element with role slider and tabindex 0, and the playback control a native `<button>`; both sit after the list, outside it. Compose has no list role: the row gives `collectionInfo` and each item `collectionItemInfo` with `Role.Button`; the indicator is a `progressBarRangeInfo` with `setProgress`. Flutter reads each item's position through `IndexedSemantics`, and the indicator is a `Semantics(slider: true)` with increase and decrease actions. SwiftUI's indicator is `accessibilityAdjustableAction`, React Native's the adjustable role with increment and decrement actions. SwiftUI and React Native have no position-in-set property for a custom container, so there the screen reader's own count of the items stands in for CRL-19's position and number; their READMEs say so.","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.carousel","fixtures":[{"id":"centered","props":{"label":"Featured walks","previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"}]},{"id":"fixed-width","props":{"label":"Walks near you","fluidWidth":false,"snap":false,"previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"}]},{"id":"scaled","props":{"label":"Featured walks","fluidWidth":false,"scaleOthers":true,"loop":true,"previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"}]},{"id":"loop","props":{"label":"Featured walks","loop":true,"previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"}]},{"id":"content-toward-hero","props":{"label":"Walks near you","itemWidth":120,"contentAlignment":"toward-hero","loop":true,"previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"},{"kind":"item","props":{"label":"Summit"},"content":"filter_hdr"}]},{"id":"navigation","props":{"label":"Featured walks","navigation":"always","previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"}]},{"id":"indicator","props":{"label":"Featured walks","indicator":true,"previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"},{"kind":"item","props":{"label":"Summit"},"content":"filter_hdr"}]},{"id":"autoplay","props":{"label":"Featured walks","indicator":true,"autoplay":true,"playLabel":"Play the slideshow","pauseLabel":"Pause the slideshow","previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"},{"kind":"item","props":{"label":"Summit"},"content":"filter_hdr"}]},{"id":"autoplay-progress","props":{"label":"Featured walks","indicator":true,"autoplay":true,"autoplayProgress":true,"playLabel":"Play the slideshow","pauseLabel":"Pause the slideshow","previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"},{"kind":"item","props":{"label":"Summit"},"content":"filter_hdr"}]},{"id":"autoplay-paused","props":{"label":"Featured walks","indicator":true,"autoplay":true,"paused":true,"autoplayProgress":true,"playLabel":"Play the slideshow","pauseLabel":"Pause the slideshow","previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"},{"kind":"item","props":{"label":"Dunes"},"content":"sunny"},{"kind":"item","props":{"label":"Summit"},"content":"filter_hdr"}]},{"id":"playback-control","props":{"label":"Featured walks","autoplay":true,"playLabel":"Play the slideshow","pauseLabel":"Pause the slideshow","previousLabel":"Previous walk","nextLabel":"Next walk"},"items":[{"kind":"item","props":{"label":"Coast path"},"content":"landscape"},{"kind":"item","props":{"label":"Old forest"},"content":"forest"},{"kind":"item","props":{"label":"Lake shore"},"content":"water"},{"kind":"item","props":{"label":"City park"},"content":"park"}]}],"platforms":{"web":{"status":"lagging","name":"tanrei-carousel","props":{"heroAlignment":"heroAlignment","itemWidth":"itemWidth","fluidWidth":"fixedWidth","contentAlignment":"contentAlignment","scaleOthers":"scaleOthers","snap":"freeScroll","loop":"loop","navigation":"navigation","indicator":"indicator","autoplay":"autoplay","autoplayInterval":"autoplayInterval","paused":"paused","playbackControl":"noPlaybackControl","autoplayProgress":"autoplayProgress","playLabel":"playLabel","pauseLabel":"pauseLabel","previousLabel":"previousLabel","nextLabel":"nextLabel","label":"label"},"events":{"pausedChange":"pausedchange"},"items":{"item":{"name":"tanrei-carousel-item","props":{"label":"label"},"events":{"click":"click"},"notes":"A `<tanrei-carousel-item>` child; its content is its default slot."}},"notes":"Attributes: `hero-alignment`, `item-width` (a number of CSS pixels; without it the property is null), `content-alignment`, `scale-others`, `loop`, `indicator`, `autoplay`, `autoplay-interval` (milliseconds), `paused`, `autoplay-progress`, `play-label`, `pause-label`, `navigation` (reflected), `previous-label`, `next-label`. `fluidWidth`, `snap` and `playbackControl` are their inverses, the boolean properties `fixedWidth`, `freeScroll` and `noPlaybackControl` (attributes `fixed-width`, `free-scroll` and `no-playback-control`), false by default: an HTML boolean attribute cannot default to true, and a property has its attribute's name. `pausedchange` is a CustomEvent whose `detail.paused` is the new value. Built on a native horizontal scroller (so wheel, trackpad and touch scroll as the platform does) whose track is as long as the scroll range; the items are placed from its scroll offset (CRL-12), and the settle animates the scroll offset over comp.carousel.motion.scroll-duration and scroll-easing once the scroll ends (`scrollend`, or 100 ms without a scroll event, because not every engine sends `scrollend` after a wheel), since a smooth `scrollTo` cannot follow the tokens. Fling 0.5 px/ms, measured from the finger's last touch moves over their own time stamps; after a fling the settle starts at the release, and the browser's momentum is held until it ends. While loop is in effect the track is several turns long and the offset is moved by a whole number of turns (N × (H + g)) when the row rests near either end, which draws nothing new. Autoplay reads whether motion is reduced (`prefers-reduced-motion`, or the root's `data-tanrei-motion=\"reduce\"`) and `document.visibilityState` when it would advance and listens for their changes; the hover hold is `pointerenter` / `pointerleave` on the host, the focus hold `focusin` / `focusout`. The items are placed from one scroll position in one pass, each start rounded to a device pixel and each end taken from the next start (CRL-40). The previous and next controls are `<tanrei-button>` elements with `focusable-when-disabled`, given their variant through the Button's group-item channel; auto draws them under `(hover: hover) and (pointer: fine)` and shows them while the host matches `:hover` or `:focus-within`. Snapshot harness: a 400 × 200 stage (the carousel fills it: W 368), or 400 × 248 for the fixtures with a controls row, on a `surface` page, scrolled to its start, the pointer outside, motion not reduced and the autoplay clock stopped at the start of its interval."},"swiftui":{"status":"lagging","name":"TanreiCarousel","props":{"heroAlignment":"heroAlignment","itemWidth":"itemWidth","fluidWidth":"fluidWidth","contentAlignment":"contentAlignment","scaleOthers":"scaleOthers","snap":"snap","loop":"loop","navigation":"navigation","indicator":"showsIndicator","autoplay":"autoplay","autoplayInterval":"autoplayInterval","paused":"isPaused","playbackControl":"showsPlaybackControl","autoplayProgress":"showsAutoplayProgress","playLabel":"playLabel","pauseLabel":"pauseLabel","previousLabel":"previousLabel","nextLabel":"nextLabel","label":"label"},"events":{"pausedChange":"isPaused"},"items":{"item":{"name":"TanreiCarouselItem","props":{"label":"label"},"events":{"click":"action"},"notes":"`TanreiCarouselItem(_ label: String, action: @escaping () -> Void) { content }`."}},"notes":"Lagging: ships an earlier revision of this spec, with `layout` and its three values, and no loop, dots or autoplay, and so owes the hero centred by default, the edge slots of no width, the scaled slots closed up and the constant gap as well (CRL-9 to CRL-13, CRL-26, CRL-40), the width of one hero and its padding in a parent that proposes no width (CRL-8), and the previous and next controls with their props navigation, previousLabel and nextLabel (CRL-41 to CRL-43). Target API: `TanreiCarousel(_ label: String, heroAlignment: .center, itemWidth: CGFloat? = nil, fluidWidth: true, contentAlignment: .center, scaleOthers: false, snap: true, loop: false, showsIndicator: false, autoplay: false, autoplayInterval: Duration? = nil, isPaused: Binding<Bool>, showsPlaybackControl: true, showsAutoplayProgress: false, playLabel:, pauseLabel:) { TanreiCarouselItem(…) { … } }`; `pausedChange` is the `isPaused` binding, set only by the control. A horizontal `ScrollView` whose content is a track as long as the scroll range, the items placed from the scroll offset by a custom `Layout` (read from `scrollPosition` and the track's geometry), settled by a custom `ScrollTargetBehavior` (iOS 17). The list is an `accessibilityElement(children: .contain)` named by label, and each item a button. SwiftUI has no position-in-set property for a custom container, so VoiceOver's own count of the container's elements stands in; the README says so. Autoplay reads `accessibilityReduceMotion` and `scenePhase`. Snapshot harness: a 400 × 200 frame (400 × 248 with a controls row) on a `surface` page."},"compose":{"status":"lagging","name":"TanreiCarousel","props":{"heroAlignment":"heroAlignment","itemWidth":"itemWidth","fluidWidth":"fluidWidth","contentAlignment":"contentAlignment","scaleOthers":"scaleOthers","snap":"snap","loop":"loop","navigation":"navigation","indicator":"indicator","autoplay":"autoplay","autoplayInterval":"autoplayInterval","paused":"paused","playbackControl":"playbackControl","autoplayProgress":"autoplayProgress","playLabel":"playLabel","pauseLabel":"pauseLabel","previousLabel":"previousLabel","nextLabel":"nextLabel","label":"contentDescription"},"events":{"pausedChange":"onPausedChange"},"items":{"item":{"name":"TanreiCarouselItem","props":{"label":"label"},"events":{"click":"onClick"},"notes":"`TanreiCarouselItem(label, onClick) { content }`, called from the carousel's item lambda."}},"notes":"Lagging: ships an earlier revision of this spec, with `layout` and its three values, and no loop, dots or autoplay, and so owes the hero centred by default, the edge slots of no width, the scaled slots closed up and the constant gap as well (CRL-9 to CRL-13, CRL-26, CRL-40), the width of one hero and its padding in a parent that proposes no width (CRL-8), and the previous and next controls with their props navigation, previousLabel and nextLabel (CRL-41 to CRL-43). Target API: `TanreiCarousel(itemCount, contentDescription, heroAlignment, itemWidth: Dp? = null, fluidWidth = true, contentAlignment, scaleOthers = false, snap = true, loop = false, indicator = false, autoplay = false, autoplayInterval: Duration? = null, paused = false, onPausedChange, playbackControl = true, autoplayProgress = false, playLabel, pauseLabel) { index -> TanreiCarouselItem(…) { … } }`, as Material's carousels take an item lambda; built on `Modifier.scrollable` and a custom `Layout`, not Material's carousel (the package does not depend on Material). Settling uses a `SnapFlingBehavior` whose fling threshold is `ViewConfiguration`'s. No list role: `collectionInfo` on the row and `collectionItemInfo` with `Role.Button` on each item. Autoplay reads the animator duration scale (0 is reduced motion) and the lifecycle's resumed state. Snapshot harness: a 400 × 200 dp box (400 × 248 with a controls row) on a `surface` page."},"flutter":{"status":"lagging","name":"TanreiCarousel","props":{"heroAlignment":"heroAlignment","itemWidth":"itemWidth","fluidWidth":"fluidWidth","contentAlignment":"contentAlignment","scaleOthers":"scaleOthers","snap":"snap","loop":"loop","navigation":"navigation","indicator":"indicator","autoplay":"autoplay","autoplayInterval":"autoplayInterval","paused":"paused","playbackControl":"playbackControl","autoplayProgress":"autoplayProgress","playLabel":"playLabel","pauseLabel":"pauseLabel","previousLabel":"previousLabel","nextLabel":"nextLabel","label":"semanticLabel"},"events":{"pausedChange":"onPausedChanged"},"items":{"item":{"name":"TanreiCarouselItem","props":{"label":"label"},"events":{"click":"onTap"},"notes":"`TanreiCarouselItem(label:, onTap:, child:)`, one of the carousel's `children`."}},"notes":"Lagging: ships an earlier revision of this spec, with `layout` and its three values, and no loop, dots or autoplay, and so owes the hero centred by default, the edge slots of no width, the scaled slots closed up and the constant gap as well (CRL-9 to CRL-13, CRL-26, CRL-40), the width of one hero and its padding in a parent that proposes no width (CRL-8), and the previous and next controls with their props navigation, previousLabel and nextLabel (CRL-41 to CRL-43). Target API: `TanreiCarousel(semanticLabel:, heroAlignment: TanreiCarouselHeroAlignment.center, itemWidth: null, fluidWidth: true, contentAlignment: TanreiCarouselContentAlignment.center, scaleOthers: false, snap: true, loop: false, indicator: false, autoplay: false, autoplayInterval: null, paused: false, onPausedChanged:, playbackControl: true, autoplayProgress: false, playLabel:, pauseLabel:, children: [...])`, built on the widgets library's `Scrollable` with a custom layout and `ScrollPhysics` that settle (CRL-14), not Material's `CarouselView`. Each item is `Semantics(button: true, label:)` inside `IndexedSemantics`, and the scrollable reports `semanticChildCount`, so the position and the number of items are read; the whole is a `Semantics(label:, explicitChildNodes: true)` container. Autoplay reads `MediaQuery.disableAnimationsOf` and the app lifecycle. Snapshot harness: a golden of a 400 × 200 surface (400 × 248 with a controls row) on a `surface` page."},"react-native":{"status":"lagging","name":"Carousel","props":{"heroAlignment":"heroAlignment","itemWidth":"itemWidth","fluidWidth":"fluidWidth","contentAlignment":"contentAlignment","scaleOthers":"scaleOthers","snap":"snap","loop":"loop","navigation":"navigation","indicator":"indicator","autoplay":"autoplay","autoplayInterval":"autoplayInterval","paused":"paused","playbackControl":"playbackControl","autoplayProgress":"autoplayProgress","playLabel":"playLabel","pauseLabel":"pauseLabel","previousLabel":"previousLabel","nextLabel":"nextLabel","label":"accessibilityLabel"},"events":{"pausedChange":"onPausedChange"},"items":{"item":{"name":"CarouselItem","props":{"label":"label"},"events":{"click":"onPress"},"notes":"`<CarouselItem label onPress>{content}</CarouselItem>`, a child of `Carousel`."}},"notes":"Lagging: ships an earlier revision of this spec, with `layout` and its three values, and no loop, dots or autoplay, and so owes the hero centred by default, the edge slots of no width, the scaled slots closed up and the constant gap as well (CRL-9 to CRL-13, CRL-26, CRL-40), the width of one hero and its padding in a parent that proposes no width (CRL-8), and the previous and next controls with their props navigation, previousLabel and nextLabel (CRL-41 to CRL-43). Target API: `<Carousel accessibilityLabel heroAlignment itemWidth fluidWidth contentAlignment scaleOthers snap loop indicator autoplay autoplayInterval paused onPausedChange playbackControl autoplayProgress playLabel pauseLabel>{items}</Carousel>`: a horizontal `ScrollView` whose content is as long as the scroll range, the items placed from an `Animated` value of its offset; it settles with `scrollTo` after the drag or momentum ends (fling 0.5 pt/ms). The carousel has `role=\"list\"` and each item the `button` role. React Native has no position-in-set property, so an item's position and the number of items are left to the screen reader's own count of the list; the README says so. Autoplay reads `AccessibilityInfo.isReduceMotionEnabled` and `AppState`. No virtualization. Snapshot harness: a 400 × 200 view (400 × 248 with a controls row) on a `surface` page."}}}
|