@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":"avatar","title":"Avatar","summary":"Stands for a person, or for a team or a project, by a small picture, by initials or a glyph where there is no picture, in a round or a square box of three sizes; several are shown as one overlapping group that counts the ones it does not draw. A picture, never a control.","level":"base","listing":"default","anatomy":[{"id":"container","description":"The square box of the avatar's size, clipped to a circle or to a rounded square, with a quiet fill that shows behind the initials, the glyph, a picture that is still loading and the transparent parts of a picture. It carries no state: nothing about it answers a pointer, a press or focus."},{"id":"image","description":"The picture the product names by its address, filling the box and clipped to its shape. Drawn once it has loaded.","optional":true},{"id":"label","description":"The initials the product gives, drawn at the centre of the box where there is no picture to show. A picture of a name, not text to be read: the name is the avatar's label.","optional":true},{"id":"icon","description":"The fallback glyph, at the centre of the box, where there is neither a picture nor initials: the glyph the product names, or the system's own (a person for a circle, a neutral mark for a square).","optional":true},{"id":"group","description":"Several avatars drawn as one row in which each lies a little over the one before it, with a gap around each so that two pictures are read as two. The group gives its avatars their size and shape.","optional":true},{"id":"overflow","description":"The last box of a group that does not draw all its members: an avatar-sized box in the fallback's colors holding a plus sign and the number of members not drawn.","optional":true}],"props":[{"name":"src","type":"string","default":"","description":"The address of the picture. Empty, or a picture that has not loaded or cannot be loaded, draws the fallback: initials where the product gave some, otherwise a glyph."},{"name":"label","type":"string","default":"","description":"The name of the person or the thing the avatar stands for, in full (\"Ada Lovelace\", \"Design team\"). Not drawn: it is the avatar's accessible name while decorative is false. In the group form it is the group's name (\"Reviewers\")."},{"name":"initials","type":"string","default":"","description":"The one or two characters drawn where there is no picture (\"AL\", \"山\"). The product makes them: which characters stand for a name depends on its writing system and its order, which the avatar cannot know. Never read by assistive technology."},{"name":"decorative","type":"boolean","default":false,"description":"True hides the avatar from assistive technology, for an avatar that stands beside the same name in visible text (a byline, a list row, a comment's header), so the name is read once. False, for an avatar that stands alone, exposes it as an image named by label. Ignored for the members of a group."},{"name":"size","type":"enum","values":["small","medium","large"],"default":"medium","description":"Small (24) stands beside one line of text: a byline, a table cell, a mention. Medium (40) is a list row's or a comment's avatar. Large (56) heads a person's own page or card. A group gives its size to every member. A design system may add values.","axis":"tanrei.comp.avatar.size"},{"name":"shape","type":"enum","values":["circle","square"],"default":"circle","description":"Circle is a person. Square, a rounded square, is something that is not one person: a team, a project, an organisation, a bot. A group gives its shape to every member. A design system may add values.","axis":"tanrei.comp.avatar.shape"},{"name":"max","type":"number","default":0,"description":"Group form only. The most boxes the group draws, the overflow box included; 0 draws every member. A whole number of 2 or more: with more members than this, the group draws one fewer member than max and then the overflow box."},{"name":"total","type":"number","default":null,"description":"Group form only. How many members there are, where the product gives the group fewer than exist (the first five of a team of two hundred). Null counts the members given."},{"name":"overflowLabel","type":"string","default":"","description":"Group form only. What assistive technology reads for the overflow box: the whole sentence in the product's language, with one place, {count}, which the group fills with the number of members not drawn (\"{count} more\", \"ほか{count}人\"). Written once as the product's words, it serves every group. A sentence that is right for every number, or a prop set per count where the language needs another form for one. Empty reads the product's words; with neither, the drawn text (\"+12\").","words":"avatarGroupOverflowLabel","places":[{"name":"count","kind":"number","description":"The number of members not drawn, in full: above 99 too, where the drawn text stops at 99 and a plus sign.","required":true}]}],"items":[{"name":"member","summary":"One avatar of a group: an avatar with its own picture, name, initials and glyph, drawn at the group's size and shape.","component":"avatar","props":[{"name":"src","type":"string","default":"","description":"The address of the member's picture."},{"name":"label","type":"string","default":"","description":"The member's name. Always exposed in a group: the names are what the group says."},{"name":"initials","type":"string","default":"","description":"The member's initials, drawn where there is no picture."}]}],"slots":[{"name":"icon","description":"The fallback glyph: a glyph of the system's icon set, by name, drawn through the platform's icon helper where there is neither a picture nor initials. Empty draws the system's own fallback glyph.","fixture":"glyph"}],"states":["enabled"],"behavior":[{"id":"AVT-1","text":"THE avatar SHALL draw a square box whose side is the container size of its size (comp.avatar.container.size.small for small, comp.avatar.container.size.medium for medium, comp.avatar.container.size.large for large), with the corners of its shape (comp.avatar.container.shape.circle for circle, comp.avatar.container.shape.square for square), never larger than half the box's side (a circle where the value is sys.shape.corner.full) and eased by sys.shape.corner-smoothing, filled with comp.avatar.container.color, and SHALL clip everything it draws to that shape. THE avatar SHALL lay itself out inline with the text or the row it is placed in, as one unbreakable box that the layout neither stretches nor shrinks, and SHALL draw no edge and no elevation."},{"id":"AVT-2","text":"THE avatar SHALL draw exactly one of three things at the centre of its box (and two only for the cross-fade in which its picture arrives, AVT-4), the first of these that it has: the picture src names, once that picture has loaded (AVT-3, AVT-4); else initials, where initials is not empty (AVT-5); else a glyph (AVT-6). THE avatar SHALL never draw an empty box, a broken-picture mark or the picture's address, and SHALL NOT make initials out of label."},{"id":"AVT-3","text":"WHILE the picture of src has loaded THE avatar SHALL draw it over the whole box, scaled so that it covers the box with its proportions kept and its centre on the box's centre, clipped to the box's shape, over comp.avatar.container.color (which shows through the picture's transparent parts), and SHALL draw neither initials nor a glyph. THE avatar SHALL NOT mirror, tint or otherwise change the picture in any layout direction or scheme."},{"id":"AVT-4","text":"WHILE src is not empty and its picture has not yet loaded THE avatar SHALL draw its fallback (AVT-2) in the box, at the avatar's full size, so that nothing changes place when the picture arrives; WHEN the picture has loaded THE avatar SHALL fade it in over the fallback while the fallback fades out beneath it, one cross-fade of opacity over comp.avatar.motion.picture-duration on comp.avatar.motion.picture-easing (sys.motion.role.state.default and sys.motion.easing.state), in which nothing changes place or size; reduced motion keeps it, as a change of opacity is not motion (MOT-6). WHERE the picture loads while the avatar draws its first frames (MOT-3), or the platform already holds it when the avatar asks for it (in its memory of the pictures it has loaded), THE avatar SHALL draw it at once, in the fallback's place. IF the picture cannot be loaded THE avatar SHALL keep the fallback, SHALL NOT ask for the picture again by itself, and in debug builds SHALL report the address that failed. WHEN src changes THE avatar SHALL draw the fallback at once, until the new picture has loaded and fades in. WHILE src is empty THE avatar SHALL ask for nothing."},{"id":"AVT-5","text":"WHERE the avatar draws initials THE avatar SHALL set them on one line at the centre of the box, in the text style of its size (comp.avatar.label.typescale.small for small, comp.avatar.label.typescale.medium for medium, comp.avatar.label.typescale.large for large) and in comp.avatar.label.color, as the product wrote them: it SHALL NOT change their case, and SHALL draw no more than the first two characters as a reader counts them (grapheme clusters), reporting in debug builds a value that is longer. THE avatar SHALL lay the initials out as text of their own direction, isolated from the text around the avatar, and SHALL keep them from assistive technology."},{"id":"AVT-6","text":"WHERE the avatar draws a glyph THE avatar SHALL draw the glyph of its icon slot, or, where the slot is empty, the system's fallback glyph for its shape (person for circle, category for square), in a box of the icon size of its size (comp.avatar.icon.size.small for small, comp.avatar.icon.size.medium for medium, comp.avatar.icon.size.large for large) at the centre of the avatar, in comp.avatar.icon.color, 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, and SHALL keep it from assistive technology."},{"id":"AVT-7","text":"THE avatar SHALL NOT take pointer, touch or keyboard input, SHALL NOT take focus or be a stop in the focus order, and SHALL NOT change anything it draws under a pointer, a press or focus: it has no hovered, focused, pressed, selected or disabled state, draws no state layer, no ripple and no focus indicator, and emits no event."},{"id":"AVT-8","text":"WHERE the avatar is placed inside an element that takes input (a link, a Button, a list item, a chip, a card that is pressed as a whole) THE avatar SHALL let input over it reach that element, SHALL stay as it is drawn while that element is hovered, focused or pressed (the state and the focus indicator are drawn by that element, on its own container), and SHALL NOT become a second target inside it; WHILE decorative is false THE avatar SHALL add its label to that element's content in reading order, so that a link or a Button that holds an avatar and nothing else is named by the avatar's label. An avatar that leads somewhere or opens something is that composition: the avatar has no destination and no action of its own."},{"id":"AVT-9","text":"WHILE decorative is false and label is not empty THE avatar SHALL be exposed to assistive technology as one image named by label, whether it draws a picture, initials or a glyph, and SHALL expose nothing else: not the initials, not the glyph's name, not the picture's address, and not its size or shape. WHILE decorative is true THE avatar SHALL expose nothing. IF decorative is false, label is empty and the product gives it no name (AVT-24) THE avatar SHALL expose nothing and in debug builds report that an avatar has no name."},{"id":"AVT-10","text":"WHEN label, initials, the icon slot's glyph, size or shape changes THE avatar SHALL draw and expose the new value at once, without a motion, and SHALL NOT announce the change by itself."},{"id":"AVT-11","text":"WHILE the text size is enlarged THE avatar SHALL keep its box at the container size of its size and its glyph at the size of AVT-6, and SHALL let its initials, and a group's count (AVT-17), follow their text style as it grows, no larger than the glyph's box of the same size (comp.avatar.icon.size.small for small, comp.avatar.icon.size.medium for medium, comp.avatar.icon.size.large for large), so that they still stand whole inside the box: an avatar is a picture and is enlarged with the page, not with the text, as a glyph's box is, while the letters it holds grow as far as the box leaves room for them."},{"id":"AVT-12","text":"WHERE the avatar is the anchor of a badge THE avatar SHALL be drawn exactly as it is without one: its square box is the anchor's bounds, the badge is placed by that box's top-end corner and drawn outside the avatar's clip (BDG-1, BDG-3, BDG-7), and the badge's label is added to the avatar's description after its name (BDG-8). THE avatar SHALL have no dot, count or status of its own."},{"id":"AVT-13","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 avatar SHALL draw an edge sys.border.hairline wide in the platform's text color inside its box, following its shape, and its initials or its glyph in that text color, so that a fallback whose fill the mode removes is still a bounded mark; THE avatar SHALL leave a picture's own colors as they are."},{"id":"AVT-14","text":"THE avatar 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 avatar is shown THE avatar SHALL draw itself for the new direction at once, without a motion of its own, keeping what it shows. A single avatar is the same in both directions but for its glyph (AVT-15): its picture is never mirrored and its initials keep their own order (AVT-5)."},{"id":"AVT-15","text":"WHERE the layout direction is right-to-left THE avatar 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 nor its size, color and fill. THE avatar SHALL NOT mirror a glyph itself, and SHALL NOT mirror its picture or its initials."},{"id":"AVT-16","text":"WHERE the avatar is given members THE avatar SHALL be a group: it SHALL draw its members in one row that does not wrap, in the order they are given from the start edge, each as an avatar of the group's size and shape with that member's own picture, initials or glyph (AVT-2 to AVT-6), and SHALL ignore its own src, initials, icon slot and decorative. Each box after the first SHALL lie over the end of the one before it by the overlap of the group's size (comp.avatar.group.overlap.small for small, comp.avatar.group.overlap.medium for medium, comp.avatar.group.overlap.large for large) and be drawn above it, and every box SHALL be surrounded, outside its own edge and following its shape, by a gap comp.avatar.group.outline.width wide in comp.avatar.group.outline.color that takes no room in the layout. THE group SHALL be as wide as its boxes less their overlaps, and as high as one box."},{"id":"AVT-17","text":"WHILE the group has more members than max and max is 2 or more THE group SHALL draw the first max less one members and then, as its last box, an overflow box: a box of the group's size and shape filled with comp.avatar.container.color, placed and surrounded as a member is (AVT-16), holding on one line, in the label style of the group's size (AVT-5) and comp.avatar.label.color, a plus sign followed by the number of members not drawn. WHILE max is 0, or the group has no more members than max, THE group SHALL draw every member and no overflow box, unless total says more exist (AVT-18). THE overflow box SHALL take no input and SHALL NOT be a control: showing the members it counts is the product's, beside the group."},{"id":"AVT-18","text":"WHILE total is greater than the number of members the group is given THE group SHALL count as not drawn every member up to total, and SHALL draw the overflow box with that number after the members it draws: where the members given fit within max less one, or max is 0, all of them are drawn before it. THE group SHALL write the number in the current locale's digits with no grouping separator, SHALL draw 99 followed by a plus sign in place of a number above 99, at every size, so that the box never holds more than three characters (the exact number stays in overflowLabel, AVT-19), and SHALL lay the sign and the number out as one left-to-right run isolated from the text around it, so that the plus sign stays before the digits in a right-to-left layout."},{"id":"AVT-19","text":"THE group SHALL be exposed to assistive technology as one group named by its label, holding in order one image for each member it draws, each named by that member's label whatever decorative says, and then, where it draws an overflow box, one text: overflowLabel — from the instance's prop or, WHILE that is empty, from the product's words of the key avatarGroupOverflowLabel — with its place {count} filled by the number of members not drawn, in the current locale's digits with no grouping separator and never cut at 99 as the drawn text is (AVT-18); else the drawn text. Another text between braces, and a brace that opens or closes nothing, SHALL be read as written and reported in debug builds; a sentence without {count} SHALL be read as written and reported in debug builds, because it does not say how many. THE gaps SHALL be kept from assistive technology. IF the group's label is empty THE group SHALL expose its members without a group's name and in debug builds report that a group has no name; IF a member's label is empty THE group SHALL expose nothing for that member and in debug builds report it."},{"id":"AVT-20","text":"WHERE the layout direction is right-to-left THE group SHALL lay its row out from the right: the first member is at the right, each following box lies over the left end of the one before it and above it, and the overflow box is the leftmost; the order assistive technology reads SHALL stay the order given."},{"id":"AVT-21","text":"WHEN the group's members, max, total, size or shape change THE group SHALL draw and expose the new row at once, without a motion, and SHALL NOT announce the change by itself."},{"id":"AVT-22","text":"WHEN size or shape names a value that the active design system does not have THE avatar SHALL render with the default value's tokens, and in debug builds report the unknown value. IF max is 1, negative or not a whole number THE group SHALL draw as for 0 and in debug builds report it; IF total is not null and is less than the number of members given, negative or not a whole number THE group SHALL count the members given and in debug builds report it."},{"id":"AVT-23","text":"IF the avatar is a group and every member has been removed THE group SHALL draw nothing, take no space and expose nothing. IF max, total or overflowLabel is set on an avatar that has no members THE avatar SHALL ignore it and in debug builds report it."},{"id":"AVT-24","text":"WHERE the platform has ARIA attributes (the web), an avatar's host and a group's host carries its role (AVT-9, AVT-19) itself, so what the product writes on it is not moved, but for a name: WHILE label is not empty THE avatar SHALL hold the product's aria-label and aria-labelledby on that host as their data-aria- twins, so that label is its whole name although the platform gives aria-labelledby the precedence, and WHEN label is emptied SHALL give them back as they were written; WHILE label is empty a name the product gives so — aria-label, or aria-labelledby naming an element — SHALL be its name and SHALL NOT be reported as having none in debug builds (AVT-9, AVT-19). WHILE an avatar's label is empty and decorative is false (or it is a member of a group) a name the product gives so SHALL make it one image named by that name, as AVT-9 says of its label: an image the product names is a named image. WHILE an avatar is decorative and not a member, or a group has no members (AVT-23), it exposes nothing, and THE avatar SHALL hold them as well, giving them back when it is exposed again. WHEN the product removes one, or its data-aria- twin, or sets the ARIA property that reflects it (ariaLabel, ariaLabelledByElements) to null, THE avatar SHALL take it away."}],"accessibility":{"role":"img","keyboard":[],"labeling":"An avatar that stands alone is an image named by label, the full name of the person or the thing, whatever it draws; the initials, the glyph and the picture's address are never read. An avatar beside the same name in visible text is decorative and hidden. A group is a group named by its label, holding one named image for each member it draws and, last, the overflow's text (overflowLabel, or the drawn count). Inside a link or a Button, the avatar's label is part of that element's name.","minimumTarget":true,"notes":["Not interactive: the avatar takes no input and no focus (AVT-7), so there is no target to size and minimumTarget holds trivially. An avatar that is pressed is inside a link or a Button, and that element meets the minimum target by its own spec; a small (24) avatar alone in a link needs the link's target, not its own box, to be large enough.","Decorative or named is the product's decision and cannot be seen from the avatar: beside \"Ada Lovelace\" in text a named avatar would be read as \"Ada Lovelace, image, Ada Lovelace\". The rule the docs page gives: if deleting the avatar loses a name, it is named; otherwise it is decorative.","The name is the name, not a description of the picture: \"Ada Lovelace\", never \"Photo of Ada Lovelace\" and never the initials.","Contrast in the default system: the initials, the count and the glyph are on-surface-variant on surface-container-highest, a pair the token invariants hold to 4.5:1 for secondary content on every surface tone. The fill against the surface around it is not held to a ratio: the avatar is not a control, and what it says is its name.","A picture brings its own colors, which the avatar does not check. A picture with a pale edge on a pale surface loses its outline; the avatar draws no ring around a picture, so a product whose pictures are often pale chooses the square or gives the surface behind them a tone.","A badge on an avatar (AVT-12) says that something is waiting, in the badge's one color and with the badge's label in words. Presence (online, away, busy) is a status that a color alone would carry; say it in words beside the name, with a tag where it needs a mark.","Forced colors (AVT-13): every fallback gains an edge in the text color; pictures are left alone.","A group's overflow box is text, not a control. Where the people it counts matter (who else can see this), the product lists them: a link or a Button beside the group that opens the full list."]},"tokens":"comp.avatar","fixtures":[{"id":"initials","props":{"label":"Ada Lovelace","initials":"AL"}},{"id":"initials-small","props":{"label":"Ada Lovelace","initials":"AL","size":"small"}},{"id":"initials-large","props":{"label":"Ada Lovelace","initials":"AL","size":"large"}},{"id":"initials-cjk","props":{"label":"山田 花子","initials":"山"}},{"id":"glyph","props":{"label":"Someone without a picture"}},{"id":"glyph-small","props":{"label":"Someone without a picture","size":"small"}},{"id":"glyph-large","props":{"label":"Someone without a picture","size":"large"}},{"id":"icon","props":{"label":"Build service"},"slots":{"icon":"smart_toy"}},{"id":"square","props":{"label":"Design team","initials":"DT","shape":"square"}},{"id":"square-glyph","props":{"label":"A project","shape":"square"}},{"id":"square-small","props":{"label":"Design team","initials":"DT","shape":"square","size":"small"}},{"id":"square-large","props":{"label":"Design team","initials":"DT","shape":"square","size":"large"}},{"id":"image","props":{"label":"Ada Lovelace","initials":"AL","src":"fixtures/avatar.png"}},{"id":"image-square","props":{"label":"Design team","initials":"DT","shape":"square","src":"fixtures/avatar.png"}},{"id":"image-failed","props":{"label":"Ada Lovelace","initials":"AL","src":"fixtures/missing.png"}},{"id":"decorative","props":{"label":"Ada Lovelace","initials":"AL","decorative":true,"size":"small"}},{"id":"icon-rtl","props":{"label":"خدمة المساعدة"},"slots":{"icon":"help"},"direction":"rtl"},{"id":"initials-rtl","props":{"label":"ليلى حسن","initials":"لح"},"direction":"rtl"},{"id":"group","props":{"label":"Authors"},"items":[{"kind":"member","props":{"label":"Ada Lovelace","initials":"AL"}},{"kind":"member","props":{"label":"Grace Hopper","initials":"GH"}},{"kind":"member","props":{"label":"Katherine Johnson","initials":"KJ"}}]},{"id":"group-max","props":{"label":"Reviewers","max":4,"overflowLabel":"{count} more"},"items":[{"kind":"member","props":{"label":"Ada Lovelace","initials":"AL"}},{"kind":"member","props":{"label":"Grace Hopper","initials":"GH"}},{"kind":"member","props":{"label":"Katherine Johnson","initials":"KJ"}},{"kind":"member","props":{"label":"Hedy Lamarr","initials":"HL"}},{"kind":"member","props":{"label":"Annie Easley","initials":"AE"}},{"kind":"member","props":{"label":"Mary Jackson","initials":"MJ"}}]},{"id":"group-total","props":{"label":"Members","max":4,"total":240,"overflowLabel":"{count} more"},"items":[{"kind":"member","props":{"label":"Ada Lovelace","initials":"AL"}},{"kind":"member","props":{"label":"Grace Hopper"}},{"kind":"member","props":{"label":"Katherine Johnson","initials":"KJ"}}]},{"id":"group-small","props":{"label":"Authors","size":"small"},"items":[{"kind":"member","props":{"label":"Ada Lovelace","initials":"AL"}},{"kind":"member","props":{"label":"Grace Hopper","initials":"GH"}}]},{"id":"group-large","props":{"label":"Authors","size":"large","max":3,"overflowLabel":"{count} more"},"items":[{"kind":"member","props":{"label":"Ada Lovelace","initials":"AL"}},{"kind":"member","props":{"label":"Grace Hopper","initials":"GH"}},{"kind":"member","props":{"label":"Katherine Johnson","initials":"KJ"}},{"kind":"member","props":{"label":"Hedy Lamarr","initials":"HL"}}]},{"id":"group-square","props":{"label":"Teams","shape":"square"},"items":[{"kind":"member","props":{"label":"Design team","initials":"DT"}},{"kind":"member","props":{"label":"Platform team","initials":"PT"}},{"kind":"member","props":{"label":"Docs team"}}]},{"id":"group-image","props":{"label":"Authors"},"items":[{"kind":"member","props":{"label":"Ada Lovelace","initials":"AL","src":"fixtures/avatar.png"}},{"kind":"member","props":{"label":"Grace Hopper","initials":"GH","src":"fixtures/avatar.png"}},{"kind":"member","props":{"label":"Katherine Johnson","initials":"KJ"}}]},{"id":"group-max-rtl","direction":"rtl","props":{"label":"المراجعون","max":4,"overflowLabel":"و{count} آخرون"},"items":[{"kind":"member","props":{"label":"ليلى حسن","initials":"لح"}},{"kind":"member","props":{"label":"Ada Lovelace","initials":"AL"}},{"kind":"member","props":{"label":"عمر خالد","initials":"عخ"}},{"kind":"member","props":{"label":"Grace Hopper","initials":"GH"}},{"kind":"member","props":{"label":"Katherine Johnson","initials":"KJ"}},{"kind":"member","props":{"label":"Hedy Lamarr","initials":"HL"}}]}],"platforms":{"web":{"status":"lagging","name":"tanrei-avatar","props":{"src":"src","label":"label","initials":"initials","decorative":"decorative","size":"size","shape":"shape","max":"max","total":"total","overflowLabel":"overflowLabel"},"items":{"member":{"name":"tanrei-avatar","props":{"src":"src","label":"label","initials":"initials"},"notes":"A `<tanrei-avatar>` child of `<tanrei-avatar-group>`, with all of an avatar's own attributes and its `icon` slot. The group sets the member's size and shape and makes it named."}},"notes":"Two elements: `<tanrei-avatar src label initials size shape decorative>` with the fallback glyph in its `icon` slot, and the group form as `<tanrei-avatar-group label max total overflow-label size shape>` whose light-DOM children are the `<tanrei-avatar>` members (the spec's group props are the group element's attributes; `overflowLabel` is reflected as `overflow-label`). The avatar's host is `display: inline-block`, `flex: none`, `vertical-align: middle`, with `role=\"img\"` and `aria-label` while it is named and `aria-hidden=\"true\"` while decorative, set through ElementInternals where axe can see it and as attributes otherwise; no `tabindex`, no listeners, and `pointer-events` left as they are, so a press over an avatar inside a link or a Button reaches that element (AVT-8). The picture is an `<img alt=\"\" decoding=\"async\">` in the shadow root with `object-fit: cover`, kept hidden until its `load` (and its decode), then faded in while the fallback fades out — at once where the picture was `complete` as soon as its address was set, the browser's list of available images — and removed on `error` (AVT-4); `loading`, `referrerpolicy` and `crossorigin` are forwarded to it and mean nothing off the web. Initials are one `dir=\"auto\"` run cut to two grapheme clusters with `Intl.Segmenter` (AVT-5). **Before the element is defined** the stylesheet of `@tanrei/web` gives `tanrei-avatar:not(:defined)` the box of its `size` and `shape` attributes in the container color and hides its children, so a page of avatars does not move when the script arrives; no picture, initials or name show until then, which is why a byline writes the name as text beside a decorative avatar. `tanrei-avatar-group:not(:defined)` is an inline flex row of those boxes. The group is `role=\"group\"` with `aria-label`; it sets `size`, `shape` and the named state on its members, hides the members past the limit with `hidden` (they stay in the document), and draws the overflow box in its own shadow root as `aria-hidden` text beside a visually hidden run that carries `overflow-label` (AVT-19). The gap of AVT-16 is an `outline` (or a `box-shadow` spread) in `--tanrei-comp-avatar-group-outline-color`, never a border, so it takes no room; later members are above earlier ones by document order, which needs no `z-index`. Under `forced-colors: active` the box takes a `CanvasText` border and the `<img>` keeps `forced-color-adjust: none` (AVT-13). A badge on an avatar is `<tanrei-badge label=\"3 unread\"><tanrei-avatar …></tanrei-avatar></tanrei-badge>`; a link is `<tanrei-link href=\"…\"><tanrei-avatar label=\"Ada Lovelace\" …></tanrei-avatar></tanrei-link>` or a plain anchor."},"swiftui":{"status":"planned","name":"TanreiAvatar","props":{"src":"url","label":"name","initials":"initials","decorative":"isDecorative","size":"size","shape":"shape","max":"max","total":"total","overflowLabel":"overflowLabel"},"items":{"member":{"name":"TanreiAvatar","props":{"src":"url","label":"name","initials":"initials"},"notes":"A `TanreiAvatar` in the group's builder."}},"notes":"`TanreiAvatar(_ name: String, url: URL?, initials:, icon:, size:, shape:, isDecorative:)`, the fallback glyph given by name through `icon:`; the picture through `AsyncImage`, whose placeholder and failure phases both draw the fallback. The group form is `TanreiAvatarGroup(_ name: String, max:, total:, overflowLabel:, size:, shape:) { TanreiAvatar(…) … }`, which carries the spec's group props. Not a `Button`; `allowsHitTesting(false)` so a press reaches a `Link`, a `Button` or a row that holds it. One accessibility element with the image trait and the name as its label, or hidden while decorative; the group is `accessibilityElement(children: .contain)` with the group's label."},"compose":{"status":"planned","name":"TanreiAvatar","props":{"src":"model","label":"name","initials":"initials","decorative":"decorative","size":"size","shape":"shape","max":"max","total":"total","overflowLabel":"overflowDescription"},"items":{"member":{"name":"TanreiAvatar","props":{"src":"model","label":"name","initials":"initials"},"notes":"A `TanreiAvatar` call in the group's content."}},"notes":"`TanreiAvatar(name, model, initials, icon, size, shape, decorative)`, the fallback glyph given by name through `icon`. The package keeps no image-loading dependency: `model` is handed to a painter the app provides through a composition local, and a painter that reports loading or failure draws the fallback (the same arrangement the chip's avatar needs; the platform's agent settles it). The group form is `TanreiAvatarGroup(name, max, total, overflowDescription, size, shape) { TanreiAvatar(…) … }`. No `clickable` and no `focusable` modifier; semantics are `Role.Image` with the name as `contentDescription`, cleared while decorative; the group is a semantics node with the group's name that contains its members."},"flutter":{"status":"planned","name":"TanreiAvatar","props":{"src":"image","label":"name","initials":"initials","decorative":"decorative","size":"size","shape":"shape","max":"max","total":"total","overflowLabel":"overflowSemanticLabel"},"items":{"member":{"name":"TanreiAvatar","props":{"src":"image","label":"name","initials":"initials"},"notes":"A `TanreiAvatar` in the group's `children`."}},"notes":"`TanreiAvatar(name: …, image: ImageProvider?, initials:, icon:, size:, shape:, decorative:)`, the fallback glyph given by name through `icon`; the picture through `Image(image:, frameBuilder:, errorBuilder:)`, both builders drawing the fallback. The group form is `TanreiAvatarGroup(name: …, max:, total:, overflowSemanticLabel:, size:, shape:, children: [TanreiAvatar(…), …])`. Wrapped in `IgnorePointer`, with no `Focus`. `Semantics(image: true, label: name)` over the drawn parts, which are excluded, or `ExcludeSemantics` while decorative; the group is `Semantics(container: true, label: name)`."},"react-native":{"status":"planned","name":"Avatar","props":{"src":"source","label":"name","initials":"initials","decorative":"decorative","size":"size","shape":"shape","max":"max","total":"total","overflowLabel":"overflowAccessibilityLabel"},"items":{"member":{"name":"Avatar","props":{"src":"source","label":"name","initials":"initials"},"notes":"An `<Avatar>` child of `<AvatarGroup>`."}},"notes":"`<Avatar name=\"Ada Lovelace\" source={{ uri }} initials=\"AL\" />`; the fallback glyph is the `icon` prop (a glyph name). The picture is an `Image` whose `onLoad` shows it and whose `onError` keeps the fallback. The group form is `<AvatarGroup name=\"Reviewers\" max={4} total={…} overflowAccessibilityLabel=\"…\">` with `<Avatar>` children. `pointerEvents=\"none\"` and not `focusable`. One accessible element with `accessibilityRole=\"image\"` and the name as `accessibilityLabel`, or `accessible={false}` with `importantForAccessibility=\"no-hide-descendants\"` while decorative. Follows the app's direction where an ancestor's is not known."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"badge","title":"Badge","summary":"Marks an icon, a navigation item or an avatar with a dot or a small count to show that something is waiting.","level":"base","listing":"default","anatomy":[{"id":"container","description":"The pill that holds the count: at least as wide as it is high, so a single digit sits in a circle."},{"id":"dot","description":"The container's form when there is no count: a small circle with no label.","optional":true},{"id":"label","description":"The count, or the capped count followed by a plus sign.","optional":true},{"id":"outline","description":"A ring outside the dot or the pill that separates the badge from what it overlaps."}],"props":[{"name":"count","type":"number","default":null,"description":"How many things are waiting. Null draws the dot (something is new, the number is unknown or unimportant); 0 draws nothing; above 0 draws the number."},{"name":"max","type":"number","default":999,"description":"The largest count shown as it is; a larger one shows as max followed by a plus sign (999+)."},{"name":"label","type":"string","default":"","description":"What assistive technology reads after the anchor's own name (\"3 unread\"). With no label, the displayed count is read; a dot needs one."}],"slots":[{"name":"default","description":"The anchor the badge sits on, which it needs: an icon, an icon-only Button, a navigation item or an avatar. Its first element is the anchor; a badge with no element to sit on draws nothing (BDG-16). In fixtures the anchor is the glyph of the system's icon set that the fixture's content names, drawn at the icon size sys.icon.medium in the color on-surface-variant; its accessible name is that glyph name (\"mail\"), and the badge adds the fixture's label to it as its value (\"mail, 3 unread\")."}],"states":["enabled"],"behavior":[{"id":"BDG-1","text":"WHILE count is null THE badge SHALL draw a circle of diameter comp.badge.dot.size in comp.badge.container.color with no label, its center comp.badge.dot.offset inside the anchor's top-end corner on both axes; the dot is a circle whatever corners the container has."},{"id":"BDG-2","text":"WHILE count is above 0 THE badge SHALL draw a container at least comp.badge.container.height high and at least as wide as it is high, with comp.badge.container.padding-inline on each side of its label and corners of comp.badge.container.shape, filled with comp.badge.container.color, and the label centered in comp.badge.label.typescale and comp.badge.label.color."},{"id":"BDG-3","text":"WHILE count is above 0 THE badge SHALL place the center of the container's leading circle (a square of the container's drawn height at its start) comp.badge.container.offset inside the anchor's top-end corner on both axes, so that a longer count grows toward the end, away from the anchor."},{"id":"BDG-4","text":"WHEN count is greater than max THE badge SHALL show max followed by a plus sign (999+ with the default max) instead of count, and SHALL otherwise show count in full."},{"id":"BDG-5","text":"WHILE count is 0 THE badge SHALL draw nothing and expose nothing to assistive technology, and its anchor SHALL render and be announced as it would without a badge."},{"id":"BDG-6","text":"THE badge SHALL draw comp.badge.outline.width of comp.badge.outline.color around the dot or the container, outside its edge, without changing the badge's size or position."},{"id":"BDG-7","text":"THE badge SHALL NOT change its anchor's size or position, SHALL NOT take space in the layout (it may extend past the anchor's bounds), and SHALL NOT take pointer, touch or keyboard input: input over the badge reaches the anchor."},{"id":"BDG-8","text":"THE badge SHALL hide its drawn dot and number from assistive technology and SHALL add label to its anchor's accessible description, so that the anchor is announced with its own name followed by label; WHILE label is empty and count is above 0 THE badge SHALL add the displayed text instead (for example 999+)."},{"id":"BDG-9","text":"WHILE count is null and label is empty THE badge SHALL still render, and in debug builds report that the dot tells assistive technology nothing."},{"id":"BDG-10","text":"WHEN count or label changes THE badge SHALL update its anchor's accessible description and SHALL NOT announce the change by itself."},{"id":"BDG-11","text":"WHERE the layout direction is right-to-left THE badge SHALL take the anchor's top-left corner as its top-end corner and grow toward the left, and SHALL isolate its label from the surrounding direction so that a capped count keeps its plus sign after the digits."},{"id":"BDG-12","text":"THE badge SHALL format count and max with the current locale's digits and no grouping separator, and SHALL draw digits with tabular figures where the font has them, so that a changing count does not shift its neighbours."},{"id":"BDG-13","text":"WHILE the text size is enlarged THE badge SHALL grow its container with its label, keep the center of the leading circle — a square of the grown container's height — at its placement, and keep the dot at comp.badge.dot.size."},{"id":"BDG-14","text":"IF count is negative or not a number THE badge SHALL render as for 0; IF count is not a whole number THE badge SHALL use it rounded down; IF max is below 1 THE badge SHALL use its default of 999; in each case debug builds SHALL report the value."},{"id":"BDG-15","text":"THE badge 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 badge is shown THE badge SHALL draw itself for the new direction at once, without a motion of its own, keeping what it shows and its state."},{"id":"BDG-16","text":"IF the badge has no anchor THE badge SHALL draw nothing, take no space and expose nothing to assistive technology, whatever its count and label, and in debug builds report that a badge needs an anchor; WHEN an anchor is given to it THE badge SHALL draw itself on that anchor (BDG-1, BDG-3) and describe it (BDG-8) at once, and WHEN its anchor is taken away it SHALL give the anchor back its own description and draw nothing again."}],"accessibility":{"role":"none","keyboard":[],"labeling":"The badge has no role or name of its own. label (or, without one, the displayed count) becomes part of the anchor's accessible description, so the anchor is announced as, for example, \"Inbox, button, 3 unread\". The drawn number is hidden, so it is never read twice.","minimumTarget":true,"notes":["Not interactive: the badge takes no input (BDG-7), so the minimum target is the anchor's and the badge never shrinks or covers it for input.","A dot conveys its meaning by color and position only, so a dot without a label fails for screen reader users (BDG-9); give it one (\"new messages\").","Where the count must be announced when it changes (a live chat), the product uses a live region; the badge does not announce by itself (BDG-10).","A badge marks an anchor and never stands alone in a line or a row (BDG-16). A count that stands by itself, such as the count at the end of a navigation drawer's row, a tree view's row or a menu item, is text, read in its place as the row's own words: that component's trailing text. A word that names a state is a tag.","How the description reaches the anchor is each platform's idiom: the web sets it on the slotted anchor (an ID reference cannot cross the shadow root), Apple platforms append it to the anchor's accessibility value, Compose merges it into the anchor's semantics as a state description, Flutter adds it to the anchor's semantics value, React Native to its accessibility value."]},"tokens":"comp.badge","fixtures":[{"id":"dot","props":{"label":"New messages"},"content":"notifications"},{"id":"count-single","props":{"count":3,"label":"3 unread"},"content":"notifications"},{"id":"count-double","props":{"count":42,"label":"42 unread"},"content":"notifications"},{"id":"count-overflow","props":{"count":1200,"label":"More than 999 unread"},"content":"notifications"},{"id":"count-custom-max","props":{"count":120,"max":99,"label":"More than 99 unread"},"content":"notifications"},{"id":"count-zero","props":{"count":0,"label":"No unread messages"},"content":"notifications"}],"platforms":{"web":{"status":"lagging","name":"tanrei-badge","props":{"count":"count","max":"max","label":"label"},"parts":{"container":"container","dot":"container","label":"label","outline":"container@outline"},"notes":"Wraps its anchor in the default slot. No `count` attribute is the dot. The badge sets `aria-description` on the slotted anchor and keeps its own shadow content `aria-hidden`."},"swiftui":{"status":"lagging","name":"TanreiBadge","props":{"count":"count","max":"max","label":"label"},"notes":"`TanreiBadge(count: Int?, max:, label:) { anchor }`, with a `.tanreiBadge(_:max:label:)` modifier for the same view (SwiftUI's own `.badge` works only in lists and tab bars). `count: nil` is the dot."},"compose":{"status":"lagging","name":"TanreiBadge","props":{"count":"count","max":"max","label":"contentDescription"},"notes":"One composable plays Material's `BadgedBox` and `Badge` together: `TanreiBadge(count: Int?, max, contentDescription) { anchor }`. `count = null` is the dot."},"flutter":{"status":"lagging","name":"TanreiBadge","props":{"count":"count","max":"max","label":"semanticLabel"},"notes":"As Flutter's `Badge.count`, with the anchor as `child`; `count: null` is the dot (Flutter's plain `Badge`)."},"react-native":{"status":"lagging","name":"Badge","props":{"count":"count","max":"max","label":"label"},"notes":"The anchor is `children`. `label` is appended to the anchor's `accessibilityValue.text`, not set as the badge's own `accessibilityLabel`: the badge itself is not an accessibility element."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"bottom-sheet","title":"Bottom sheet","summary":"Shows supplementary content or a short task in a surface that rises from the bottom edge, either over the lower part of the content while the rest stays usable, or as a modal step that dims and blocks everything else until it is dismissed.","level":"composed","listing":"default","builtFrom":["modal-layer"],"anatomy":[{"id":"scrim","description":"The modal layer's scrim over everything behind a modal sheet (MDL-1). It blocks presses and, while the sheet is dismissible, a press on it asks the sheet to close. A standard sheet draws none.","optional":true},{"id":"container","description":"The raised surface docked to the bottom edge of the area it covers, centred and no wider than its maximum width, its top corners rounded and its bottom corners square. Its color reaches under the bottom system inset."},{"id":"drag-handle","description":"The control at the top of the sheet: a Handle without a value, always drawn, that carries hover, focus and press on its box, with the grip centred in it. Activating it moves the sheet between its two heights.","optional":true},{"id":"drag-handle.grip","description":"The Handle's line: the short rounded bar drawn in the handle's box that says the sheet can be dragged.","optional":true},{"id":"header","description":"The row below the drag handle's row (or at the top without one) that holds the headline and the close button. Drawn while headline is not empty or closable is true; it stays in place while the content scrolls.","optional":true},{"id":"headline","description":"What the sheet is about (\"Share photo\"), a heading. It names the sheet where label is empty.","optional":true},{"id":"close-button","description":"An icon-only Button of the size comp.bottom-sheet.close-button.size names (small in the default system) showing the close glyph at the end of the header, in the variant comp.bottom-sheet.close-button.variant names (tonal in the default system), as every host's close button is. The sheet places it and chooses its variant; everything else it reads from Button's own tokens.","optional":true},{"id":"divider","description":"A hairline across the sheet below the header: drawn whenever the header is in the default system, or only while the content is scrolled away from its top under dividerVisibility scroll.","optional":true},{"id":"content","description":"Whatever the product puts in the sheet: a list of choices, a form, details. The sheet insets it (unless inset is false), clips it, hands it a content color and scrolls it; it does not lay it out."},{"id":"focus-ring","description":"Gap-then-ring indicator around the drag handle's box, shown for keyboard focus.","optional":true}],"props":[{"name":"variant","type":"enum","values":["standard","modal"],"default":"modal","description":"Standard sits over the lower part of the content while the content above stays usable (a layout region); modal dims and blocks everything else and holds focus until it closes (a modal overlay). Both read the same container tokens: the scrim and the behaviour set them apart. Not a token axis."},{"name":"open","type":"boolean","default":false,"description":"Whether the sheet is shown. The product opens it, and closes it in answer to close (or from its own controls); on SwiftUI, where it is a binding, the sheet writes false itself."},{"name":"detent","type":"enum","values":["partial","full"],"default":"partial","description":"The height the sheet rests at while its content is taller than it: partial takes comp.bottom-sheet.container.partial-fraction of the area; full reaches up to comp.bottom-sheet.container.margin-block-start below the area's top. A sheet whose content is shorter than its partial height has one height, and detent changes nothing. The person moves between the two by dragging or with the drag handle (detentChange)."},{"name":"dismissible","type":"boolean","default":true,"description":"Whether a drag below the sheet's lowest height asks it to close and, for a modal sheet, whether Escape, the platform's back and a press on the scrim do too. Set it to false only when the person must finish the sheet's task with one of its own controls."},{"name":"handle","type":"boolean","default":true,"description":"Draws the drag handle at the top of the sheet. Without it the sheet can still be dragged by its padding and content (BSH-9), but a keyboard or switch user has no way to change its height, so leave it on for a sheet whose content can be taller than its partial height."},{"name":"handleLabel","type":"string","default":"","description":"The drag handle's accessible name (\"Resize sheet\"); its expanded state is exposed with it. Required while the handle is interactive (BSH-11).","words":"handleLabel"},{"name":"inset","type":"boolean","default":true,"description":"Insets the content by comp.bottom-sheet.container.padding. Set it to false for content that pads itself or reaches the edges (a list whose rows carry their own padding)."},{"name":"label","type":"string","default":"","description":"Names the sheet for assistive technology (\"Share photo\"): the modal dialog, or the standard sheet's region. Required unless headline names it."},{"name":"headline","type":"string","default":"","description":"What the sheet is about (\"Share photo\"), drawn in its header (BSH-28). While label is empty it is the sheet's accessible name."},{"name":"closable","type":"boolean","default":false,"description":"Draws the close button at the end of the header (BSH-29). False by default: the drag handle and, for a modal sheet, the scrim are the sheet's ways out. Set it where a person who cannot drag needs one they can see — a standard sheet, or a sheet without a handle."},{"name":"closeLabel","type":"string","default":"","description":"The close button's accessible name (\"Close sharing\"). Required while closable is true.","words":"closeLabel"},{"name":"dividerVisibility","type":"enum","values":["auto","always","scroll"],"default":"auto","description":"When the divider below the header is drawn. always: whenever the header is drawn, at rest as well as while the content is scrolled. scroll: only while the content is scrolled away from its top. auto takes comp.bottom-sheet.divider.visibility, the design system's answer (always in the default system)."}],"slots":[{"name":"default","description":"The content. A fixture's content string is plain text, which takes sys.typescale.body in the content color (BSH-8)."}],"events":[{"name":"close","description":"The sheet asks to be closed: its close button (BSH-29), a released drag below its lowest height, or for a modal sheet a press on the scrim, Escape or the platform's back. Carries which of these it was, named close, drag, scrim, escape or back (in the platform's casing). The close button asks whatever dismissible says; the others only while dismissible is true."},{"name":"detentChange","description":"The person moved the sheet to its other height, by a drag or with the drag handle. Carries the new detent (partial or full). Not emitted when the product sets detent."}],"states":["enabled","hovered","focused","pressed"],"behavior":[{"id":"BSH-1","text":"WHEN open becomes true THE bottom sheet SHALL slide its container up to its height (BSH-6) from its own height below the bottom edge of the area it covers, whole and unscaled whatever sys.behavior.appearance says (a sheet slides from its edge) — WHILE variant is modal over the whole window on its modal layer, fading the layer's scrim in comp.bottom-sheet.scrim.color and comp.bottom-sheet.scrim.blur in behind it in step, over the same duration and curve (MDL-1, MDL-7); WHILE variant is standard over the bottom of the parent the product placed it in, with no scrim — over comp.bottom-sheet.motion.enter-duration with comp.bottom-sheet.motion.enter-easing; WHEN open becomes false THE bottom sheet SHALL slide it down the same way out of view from wherever it is drawn, over comp.bottom-sheet.motion.exit-duration with comp.bottom-sheet.motion.exit-easing, WHILE variant is modal taking the scrim away at once (MOT-8) and keeping the container drawn until the slide ends; WHILE it leaves, in either variant, neither the container nor the scrim SHALL take pointer input, so that a press reaches what lies under them (MOT-7). A slide turned round SHALL go on from where it has got to. WHERE motion is reduced it SHALL only fade the container in and out in place without sliding, and the scrim in with it, over sys.motion.role.reduced, or appear and disappear at once on a platform whose reduced-motion setting removes every animation (Android's). WHEN a modal sheet is mounted with open true it SHALL appear without its motion while the document has not yet been first painted, and with it when it is mounted after that; a standard sheet mounted with open true SHALL appear in place without motion, being a layout region (BSH-4)."},{"id":"BSH-2","text":"WHILE variant is modal and the sheet is open THE bottom sheet SHALL make everything outside it inert, keep the content behind it from scrolling and keep focus inside it, as its modal layer does (MDL-2, MDL-4): a modal overlay."},{"id":"BSH-3","text":"WHEN open changes from false to true THE bottom sheet SHALL move focus to the element in it that the product marked for initial focus (the platform's own mark, named in the platform notes) or, without one, to its container, so that assistive technology reads its label first; WHEN it closes while focus is inside it THE bottom sheet SHALL return focus to the element that had it when the sheet opened — or, WHERE a standard sheet opened under a modal surface it is not inside, to the element that had focus before that surface opened — or, where that element no longer exists or cannot take focus, to the platform's default for a closed overlay. Focus SHALL move when the sheet opens or closes, not when its motion ends. This holds for both variants (a modal sheet moves and returns focus as its modal layer does, MDL-3, MDL-5); a standard sheet mounted with open true SHALL NOT move focus, and a modal sheet mounted with open true SHALL move focus in as if it had just opened, because it makes everything behind it unfocusable and focus must be somewhere it can reach."},{"id":"BSH-4","text":"WHILE variant is standard THE bottom sheet SHALL draw no scrim, SHALL NOT make anything inert, SHALL NOT keep focus inside it, SHALL let Tab and Shift+Tab move focus between it and the content it covers without closing it, and SHALL ignore Escape and the platform's back: a standard sheet is a layout region, not an overlay. The product places it over the content it covers, in a parent that holds both; the sheet SHALL dock to that parent's bottom edge, SHALL NOT resize or pad the content, and SHALL let presses on the part of the parent above it reach the content."},{"id":"BSH-5","text":"WHILE dismissible is true, WHEN the user presses the scrim, presses Escape or uses the platform's back WHILE variant is modal, as its modal layer answers them (MDL-6), or releases a drag that asks to close (BSH-9) in either variant, THE bottom sheet SHALL emit close exactly once with the reason scrim, escape, back or drag, and SHALL then be closed: through its binding where open is one (SwiftUI), and by the product setting open to false where open is a plain value (web, Compose, Flutter, React Native). WHILE dismissible is false THE bottom sheet SHALL ignore these inputs and emit nothing for them (its close button, BSH-29, still asks); a press on the scrim SHALL still reach nothing behind it."},{"id":"BSH-6","text":"THE bottom sheet SHALL be as tall as its drag handle's row, its header (BSH-28) and its content (with its insets), but no taller than its detent allows: WHILE detent is partial, comp.bottom-sheet.container.partial-fraction of the height of the area it covers; WHILE detent is full, that height less comp.bottom-sheet.container.margin-block-start. The area is the window below its top system inset for a modal sheet, and the parent the product placed it in for a standard sheet; WHILE the on-screen keyboard is shown the area SHALL end at the keyboard's top edge, so that the sheet sits on the keyboard and both heights are taken from the smaller area. The sheet has two heights only WHILE its content is taller than its partial height; otherwise it has one, and detent changes nothing."},{"id":"BSH-7","text":"THE bottom sheet SHALL draw its container at the bottom edge of the area, as wide as the area but no wider than comp.bottom-sheet.container.max-width and centred in it, filled with comp.bottom-sheet.container.color, raised by comp.bottom-sheet.container.elevation, with its top corners rounded by comp.bottom-sheet.container.shape and its bottom corners square; it SHALL extend its color under the bottom system inset and keep its content above that inset, and WHILE the on-screen keyboard is shown it SHALL sit on the keyboard (BSH-6) with its content above it."},{"id":"BSH-8","text":"THE bottom sheet SHALL lay out, top to bottom, the drag handle's row WHILE handle is true (BSH-12), the header WHILE there is one (BSH-28) and then its content. WHILE inset is true it SHALL inset the content by comp.bottom-sheet.container.padding from its start, end and bottom edges, and from its top edge WHILE handle is false and no header is drawn, and SHALL start it comp.bottom-sheet.content.padding-block-start below the header WHILE a header is drawn, so that its first line keeps clear of the header and its divider; WHILE inset is false the content SHALL reach the container's edges, below the handle's row and the header. It SHALL clip the content to the container's shape, SHALL hand it comp.bottom-sheet.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), and plain text given as content, where the platform must style it, SHALL take sys.typescale.body."},{"id":"BSH-9","text":"WHEN the user drags the sheet vertically — by its handle's row, by the padding around its content, or by its content where BSH-10 lets the drag reach the sheet — beyond the platform's touch slop THE bottom sheet SHALL follow the finger or pointer, never above its full height; WHEN the drag is released it SHALL settle at the next height in the direction of a fling, or else at the height nearest to where it was released, over comp.bottom-sheet.motion.enter-duration with comp.bottom-sheet.motion.enter-easing (at once where motion is reduced). A release below half of the sheet's lowest height, or a downward fling from its lowest height, SHALL ask to close WHILE dismissible is true (BSH-5, BSH-20); WHILE dismissible is false the sheet SHALL settle at its lowest height instead. 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; the touch slop is the platform's own (Android's ViewConfiguration.getScaledTouchSlop, Flutter's kTouchSlop) or, where the platform names none, 8 points. 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 bottom sheet 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. WHEN a drag ends at the height it did not start from THE bottom sheet SHALL set detent to it and emit detentChange exactly once with it."},{"id":"BSH-10","text":"WHILE the content is taller than the room the sheet gives it THE bottom sheet SHALL scroll the content inside the container, below the handle's row, and SHALL let assistive technology and keyboard focus scroll it at either height; a drag upward on the content SHALL first raise the sheet to its full height and then scroll the content, and a drag downward on the content SHALL first scroll the content to its top and then lower the sheet."},{"id":"BSH-11","text":"WHILE handle is true and the sheet has two heights THE bottom sheet SHALL make the drag handle one focus stop, a button named by handleLabel with the expanded state, true WHILE detent is full (its label and expanded, HDL-8), and WHEN the user activates it by pointer, touch, Enter or Space (its activate, HDL-7) THE bottom sheet SHALL move to its other height as BSH-9 settles and emit detentChange exactly once with the new detent; WHILE the sheet has one height the handle SHALL still be drawn at rest but SHALL NOT be focusable, pressable or exposed to assistive technology. WHILE the handle is interactive and handleLabel is empty it SHALL still render, and in debug builds report that the handle has no accessible name."},{"id":"BSH-12","text":"WHILE handle is true THE bottom sheet SHALL draw at its top a row holding the drag handle — a Handle of axis vertical and size medium, with no value and revealed — centred across the sheet with comp.bottom-sheet.handle.margin-block above and below it, and SHALL give that Handle its own tokens in place of the Handle's: the box comp.bottom-sheet.handle.container-width wide and comp.bottom-sheet.handle.container-height high with comp.bottom-sheet.handle.container-shape corners (HDL-3), the grip — the Handle's line — comp.bottom-sheet.handle.grip-width long and comp.bottom-sheet.handle.grip-height thick (HDL-1), and the container, line and state-layer colors of each state from the drag-handle control (comp.bottom-sheet.drag-handle.container.color, comp.bottom-sheet.drag-handle.grip.color, comp.bottom-sheet.drag-handle.state-layer.color, and so on for each state), its opacity in each state, and comp.bottom-sheet.motion.state-duration, comp.bottom-sheet.motion.state-easing and comp.bottom-sheet.motion.feedback-duration as its motion; in the default system each of them aliases the Handle's own. The row SHALL stay in place while the content scrolls."},{"id":"BSH-13","text":"WHILE the drag handle is hovered, keyboard-focused or pressed THE bottom sheet SHALL render the handle's box, grip and opacity from the component tokens of the highest-precedence active state, with precedence pressed over focused over hovered, and the grip at the Handle's length and thickness of a handle in use (HDL-4); focus gained by pointer or touch SHALL NOT select the focused state. A drag that starts on the handle SHALL keep it pressed while the sheet follows the drag, as a Handle is held for as long as a drag lasts (HDL-11)."},{"id":"BSH-14","text":"WHEN the drag handle receives keyboard focus THE bottom sheet SHALL show the focus ring around the handle's box without animation; focus gained by pointer or touch SHALL NOT show it."},{"id":"BSH-15","text":"THE bottom sheet SHALL give the drag handle the Handle's hit area (HDL-5): at least sys.target.touch wide and high for touch input and sys.target.pointer for fine pointers, centred on its box, without changing its drawn size, and the Handle's vertical resize cursor; a platform that cannot tell the input type SHALL use sys.target.touch. Below its box the hit area SHALL reach no further than half of comp.bottom-sheet.handle.margin-block, the space between the box and what follows the row (HDL-5's cap), so that a press nearer the header or the content under the handle's row goes to them (BTN-5). A press on the rest of the handle's row drags the sheet as BSH-9 says."},{"id":"BSH-16","text":"WHEN the drag handle is pressed by pointer, touch, Enter or Space THE drag handle 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 (HDL-11)."},{"id":"BSH-17","text":"WHILE pressed THE drag handle 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; grip and opacity still come from the pressed tokens. Under none every part stays with the state under the press. The ripple grows over comp.bottom-sheet.motion.feedback-duration with comp.bottom-sheet.motion.state-easing, fades over comp.bottom-sheet.motion.state-duration with comp.bottom-sheet.motion.state-easing once the press has ended and press-hold has passed, and appears whole where motion is reduced."},{"id":"BSH-18","text":"THE bottom sheet SHALL ease its container's top corners and the drag handle's box 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 the handle's 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":"BSH-19","text":"WHEN the drag handle's colors, or its grip's length and thickness, change between states THE bottom sheet SHALL animate them over comp.bottom-sheet.motion.state-duration with comp.bottom-sheet.motion.state-easing, and SHALL change them at once where motion is reduced."},{"id":"BSH-20","text":"WHEN a released drag asks to close THE bottom sheet SHALL emit close (BSH-5), hold where the drag left it for one frame, and then slide out from there as BSH-1 says IF open has become false, or settle back at its lowest height as BSH-9 says IF open is still true (the product declined to close it)."},{"id":"BSH-21","text":"WHEN the product changes detent while the sheet is open THE bottom sheet SHALL move to the new height over comp.bottom-sheet.motion.enter-duration with comp.bottom-sheet.motion.enter-easing (at once where motion is reduced) and SHALL NOT emit detentChange; where detent is a plain value (web, Compose, Flutter, React Native), a height the person chose (BSH-9, BSH-11) SHALL stay until the product sets detent again, and where it is a binding (SwiftUI) the sheet SHALL write the new detent to it."},{"id":"BSH-22","text":"THE bottom sheet SHALL expose its container, WHILE variant is modal, as a modal dialog named by label and, WHILE variant is standard, as a region named by label (a landmark on the web) — by the headline WHILE label is empty (BSH-28); WHILE label and headline are both empty it SHALL still render, and in debug builds report that it has no accessible name. The drag handle's grip, the Handle's line, SHALL be hidden from assistive technology; the handle itself is exposed only as BSH-11 says."},{"id":"BSH-23","text":"WHEN a dialog, a menu or another modal sheet opens from a modal bottom sheet THE bottom sheet SHALL stay below it, become inert with the rest of the window, and on the other overlay's closing receive back the focus that overlay returns, as its modal layer does (MDL-8, MDL-9); Escape SHALL dismiss only the topmost overlay. WHEN two modal bottom sheets open in the same update, one after the other, THE bottom sheet SHALL stack them in the order they open, as if the later had opened from the earlier: focus SHALL go into the later one only, the later SHALL return focus on closing to the element the earlier moves focus to as it opens (BSH-3), and the earlier, closed after it, SHALL return focus to the element that had it before either opened."},{"id":"BSH-24","text":"WHILE the text size is enlarged THE bottom sheet SHALL grow with its content up to the height its detent allows and scroll the content beyond it (BSH-10), grow its header with a headline that wraps, and SHALL NOT scale the drag handle, nor the close button beyond what the Button itself does."},{"id":"BSH-25","text":"WHEN variant or detent names a value the bottom sheet does not define THE bottom sheet SHALL render with the default value, and in debug builds report the unknown value."},{"id":"BSH-26","text":"WHEN the layout direction is right-to-left THE bottom sheet SHALL keep its container and its drag handle centred, and its content SHALL follow the layout direction."},{"id":"BSH-27","text":"THE bottom sheet 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 bottom sheet is shown THE bottom sheet SHALL draw itself for the new direction at once, without a motion of its own, keeping its open state, its height and its focus."},{"id":"BSH-28","text":"WHILE headline is not empty or closable is true THE bottom sheet SHALL draw a header below the drag handle's row (or at the top of the container without one): a row at least comp.bottom-sheet.header.height high holding the headline from comp.bottom-sheet.container.padding after the start edge, in comp.bottom-sheet.headline.typescale and comp.bottom-sheet.headline.color, wrapping onto more lines rather than truncating and growing the row with it, exposed as a heading, and, WHILE closable is true, the close button ending comp.bottom-sheet.header.padding-inline-end before the end edge and comp.bottom-sheet.header.gap after the headline, both centred in the row; below it, a divider comp.bottom-sheet.divider.width thick in comp.bottom-sheet.divider.color across the sheet's full width WHILE dividerVisibility (or, for auto, comp.bottom-sheet.divider.visibility) is always, or is scroll and the content is scrolled away from its top, shown and hidden at once. The header SHALL NOT scroll with the content, and a drag on it SHALL move the sheet as a drag on the handle's row does (BSH-9). WHILE headline is not empty it SHALL name the sheet where label is empty. A dividerVisibility the sheet does not define SHALL be drawn as auto, and reported in debug builds."},{"id":"BSH-29","text":"WHILE closable is true THE bottom sheet SHALL draw its close button as an icon-only Button of the size comp.bottom-sheet.close-button.size names showing the glyph close of the system's icon set and named by closeLabel, in the variant comp.bottom-sheet.close-button.variant names, 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); WHEN the user activates it THE bottom sheet SHALL emit close exactly once with the reason close, in either variant and whatever dismissible says, and SHALL then be closed as BSH-5 says. WHILE closable is true and closeLabel is empty it SHALL still draw the button, and in debug builds report that the button has no accessible name. THE bottom sheet SHALL draw no close mark of its own."},{"id":"BSH-30","text":"WHILE handle is false, dismissible is true and closable is false THE bottom sheet SHALL still render, and in debug builds report that it shows no way out a person can see: a drag, Escape and the scrim still close it, but nothing on screen says so to a person who cannot drag."},{"id":"BSH-31","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 bottom sheet 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 its container (BSH-22) — its dialog WHILE variant is modal, its region otherwise — an id reference by the elements it names in the host's tree or a tree around it, a description after its own. WHILE label or headline is not empty it is the container's name (BSH-22), over a name given so; WHILE both are empty, a name given so is the container's name and SHALL NOT be reported as having none in debug builds. 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 bottom sheet SHALL take it off that element."}],"accessibility":{"role":"dialog","keyboard":[{"keys":"Tab / Shift+Tab","action":"Moves focus through the drag handle (while it is interactive), the close button (while closable is true) and the content's focusable elements, in that order. In an open modal sheet it wraps and never leaves the sheet; from a standard sheet it moves on to the content, and the sheet stays open."},{"keys":"Enter or Space","action":"On the drag handle, moves the sheet to its other height (partial or full). On the close button, asks the sheet to close (close, reason close)."},{"keys":"Escape","action":"Asks an open modal sheet to close (close, reason escape) while dismissible is true; with stacked overlays, only the topmost. A standard sheet ignores it."}],"labeling":"The sheet is named by label, or by its headline where label is empty: a modal dialog while variant is modal, a region while it is standard. The headline is a heading; the close button is named by closeLabel; the divider is decorative. The drag handle, while the sheet has two heights, is a button named by handleLabel with the expanded state (true at full height); at one height it is hidden. The grip is decorative.","minimumTarget":true,"notes":["Dragging is never the only way (WCAG 2.5.7): the drag handle changes the height with a single press or from the keyboard, and a modal sheet closes with Escape, back or a press on the scrim. A standard sheet, and a modal one whose dismissible is false, closes only by a drag, its close button or the product: set closable, or put a Close or Done button in its content.","The standard form is a layout region, although it covers the bottom of the content rather than pushing it aside: the person works in the content and in the sheet at once, so focus leaving it never closes it. The modal form is a modal overlay.","Web: the modal form is a native <dialog> opened with showModal() inside the shadow root, so the rest of the page is inert and the sheet is in the top layer; ::backdrop draws the scrim. Its cancel event (Escape) is cancelled and becomes close with the reason escape; the product then sets open to false. The standard form is a region (a <section> named by label) positioned at the bottom of its containing block. The `autofocus` attribute on a slotted element marks initial focus.","Where a platform presents the modal sheet in a window of its own (Compose's Dialog, React Native's Modal), the window's own dim and transition are switched off and Tanrei draws the scrim and the motion, so every platform draws the same color.","The sheet does not move or pad the content a standard sheet covers; a product whose content must stay visible above the sheet pads its scrolling content by the sheet's partial height.","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.bottom-sheet","fixtures":[{"id":"modal","props":{"open":true,"label":"Save photo","handleLabel":"Resize sheet"},"content":"Choose where to save the photo. You can change this later in Settings."},{"id":"modal-partial","props":{"open":true,"detent":"partial","label":"Terms of service","handleLabel":"Resize sheet"},"content":"Please read these terms before you continue. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. By continuing you agree to them. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. Please read these terms before you continue. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. By continuing you agree to them. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. Please read these terms before you continue. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. By continuing you agree to them. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. Please read these terms before you continue. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change."},{"id":"modal-full","props":{"open":true,"detent":"full","label":"Terms of service","handleLabel":"Resize sheet"},"content":"Please read these terms before you continue. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. By continuing you agree to them. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. Please read these terms before you continue. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. By continuing you agree to them. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. Please read these terms before you continue. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. By continuing you agree to them. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change. Please read these terms before you continue. They describe what the service does, what it does not do, how your data is stored and for how long, how you can export or delete it, what happens when you close your account, how disputes are resolved, and how these terms may change."},{"id":"no-handle","props":{"open":true,"handle":false,"label":"Save photo"},"content":"Choose where to save the photo. You can change this later in Settings."},{"id":"standard","props":{"variant":"standard","open":true,"label":"Nearby places","handleLabel":"Resize sheet"},"content":"Three cafés and a bakery are open within a ten-minute walk."},{"id":"modal-header","props":{"open":true,"headline":"Save photo","closable":true,"closeLabel":"Close","handleLabel":"Resize sheet"},"content":"Choose where to save the photo. You can change this later in Settings."},{"id":"no-handle-header","props":{"open":true,"handle":false,"headline":"Save photo","closable":true,"closeLabel":"Close"},"content":"Choose where to save the photo. You can change this later in Settings."},{"id":"standard-header","props":{"variant":"standard","open":true,"label":"Cafés and bakeries nearby","headline":"Nearby places","closable":true,"closeLabel":"Close nearby places","handleLabel":"Resize sheet"},"content":"Three cafés and a bakery are open within a ten-minute walk."}],"platforms":{"web":{"status":"lagging","name":"tanrei-bottom-sheet","props":{"variant":"variant","open":"open","detent":"detent","dismissible":"closedby","handle":"noHandle","handleLabel":"handleLabel","inset":"flush","label":"label","headline":"headline","closable":"closable","closeLabel":"closeLabel","dividerVisibility":"dividerVisibility"},"events":{"close":"close","detentChange":"detentchange"},"parts":{"scrim":"container@backdrop","container":"container","drag-handle":"handle","drag-handle.grip":"grip","header":"header","headline":"headline","close-button":"close-button","divider":"divider","content":"content","focus-ring":"handle@focus-ring"},"notes":"`dismissible` is HTML's own `closedby` attribute, as on `<tanrei-dialog>`: `any` (the default) or `none`. `handle` and `inset` are their inverses, the boolean properties `noHandle` and `flush` (attributes `no-handle` and `flush`), false by default: an HTML boolean attribute cannot default to true, and a property has its attribute's name. `handleLabel` is the `handle-label` attribute, `closeLabel` the `close-label` attribute and `dividerVisibility` the `divider-visibility` attribute (`auto` reads `--tanrei-comp-bottom-sheet-divider-visibility` from the cascade with a style query, and where the browser has none the sheet writes the name it read on its header when it renders). The close button is a `<tanrei-button>` in the shadow root, icon-only (the close glyph in its `icon` slot, its `label` from `close-label`), whose variant comes from the resolved comp.bottom-sheet.close-button.variant through the internal channel a Button reads from its host; the headline is an `<h2>`. `close` is a CustomEvent whose `detail.reason` is `close`, `drag`, `scrim`, `escape` or `back` (`back` when a modal sheet's native `cancel` arrives without an Escape key, as Android's back gesture sends it), and `detentchange` one whose `detail.detent` is the new detent; the element sets `detent` itself before firing it. The product sets `open` to false from `close`. The content is the default slot. Drags use pointer events with `touch-action: none` on the handle's row and the top edge; the content scrolls natively and hands the drag over at its top (BSH-10). Fling 0.5 px/ms, slop 8 px. Insets are `env(safe-area-inset-bottom)`; the on-screen keyboard is read from `visualViewport`. Snapshot harness: a 400 × 720 viewport with a `surface` page; the sheet opened by `open`; the screenshot is the viewport, since a modal sheet and its backdrop are in the top layer. The drag handle is a `<tanrei-handle>` in the shadow root, its `container` and `line` exported as the parts `handle` and `grip`; the sheet sets the Handle's custom properties to its own tokens on it (BSH-12), answers its `activate`, and keeps it `inert` while the sheet has one height (BSH-11)."},"swiftui":{"status":"lagging","name":"tanreiBottomSheet","props":{"variant":"variant","open":"isPresented","detent":"detent","dismissible":"dismissible","handle":"handle","handleLabel":"handleLabel","inset":"inset","label":"label","headline":"headline","closable":"closable","closeLabel":"closeLabel","dividerVisibility":"dividerVisibility"},"events":{"close":"onClose","detentChange":"detent"},"notes":"A view modifier on the view the sheet covers, as `.sheet` is: `.tanreiBottomSheet(isPresented: Binding<Bool>, variant:, detent: Binding<TanreiBottomSheetDetent>, dismissible:, handle:, handleLabel:, inset:, label:, onClose: ((TanreiSheetCloseReason) -> Void)?, content:)`. Closing writes false to `isPresented` and then calls `onClose` with the reason; a height the person chose is written to `detent` (detentChange). Modal: on iOS presented with `.fullScreenCover`, a clear presentation background and the system transition off, as `tanreiDialog` is (that presentation hides the rest of the app from VoiceOver); Tanrei draws the scrim, the sheet and the drag with a `DragGesture` (fling from its `velocity`, 0.5 pt/ms). Not the native `.sheet`: its dim cannot take the scrim token, and on iPad in a regular width it becomes a centred form, not a bottom sheet. macOS, which has no full-screen cover, draws the modal sheet as an overlay of the modified view with the modal trait. Standard: `.overlay(alignment: .bottom)` of the modified view. Initial focus is `.defaultFocus` or an `@AccessibilityFocusState` the product passes; Escape is `.onKeyPress(.escape)` and the escape gesture `.accessibilityAction(.escape)`. Snapshot harness: renders `TanreiBottomSheetSurface` (the sheet and, for a modal sheet, the scrim) in place in a 400 × 720 frame over a `surface` page, because a snapshot of the presenting view does not include a presented window. Not built on this platform yet: the header — headline, closable, closeLabel and dividerVisibility, the close reason close (BSH-28, BSH-29) — and the report of a sheet with no way out a person can see (BSH-30). Not built on this platform yet: the scrim of a modal sheet taken away at once as it begins to close (BSH-1, MOT-8)."},"compose":{"status":"lagging","name":"TanreiBottomSheet","props":{"variant":"variant","open":"visible","detent":"detent","dismissible":"dismissible","handle":"handle","handleLabel":"handleLabel","inset":"inset","label":"contentDescription","headline":"headline","closable":"closable","closeLabel":"closeLabel","dividerVisibility":"dividerVisibility"},"events":{"close":"onClose","detentChange":"onDetentChange"},"notes":"`TanreiBottomSheet(visible, onClose: (TanreiSheetCloseReason) -> Unit, variant, detent, onDetentChange, dismissible, handle, handleLabel, inset, contentDescription, initialFocus: FocusRequester?, content)`. `visible` rather than calling it only while open, so that the exit motion can run before the sheet goes; the caller sets `visible` to false from `onClose`. The sheet keeps a height the person chose until `detent` changes (BSH-21). Modal: drawn in a `Dialog` window of its own, as `TanreiDialog` and the modal drawer are, with `usePlatformDefaultWidth = false`, `decorFitsSystemWindows = false` and the window's own dim off (Tanrei draws the scrim); the window traps focus, answers back and hides the content behind from TalkBack; the sheet sets a pane title from `contentDescription`. Standard: fills its parent (a `Box` over the content) and draws the sheet at its bottom edge; the part above takes no touches. Drag with `Modifier.draggable` and nested scroll for BSH-10; fling and slop from `ViewConfiguration`. Snapshot harness: renders `TanreiBottomSheetContent` (the sheet and, for a modal sheet, the scrim) in place in a 400 × 720 dp box over a `surface` page; the window itself is covered by instrumented tests. Not built on this platform yet: the header — headline, closable, closeLabel and dividerVisibility, the close reason close (BSH-28, BSH-29) — and the report of a sheet with no way out a person can see (BSH-30). Not built on this platform yet: the scrim of a modal sheet taken away at once as it begins to close (BSH-1, MOT-8)."},"flutter":{"status":"lagging","name":"TanreiBottomSheet","props":{"variant":"variant","open":"open","detent":"detent","dismissible":"dismissible","handle":"showHandle","handleLabel":"handleSemanticLabel","inset":"inset","label":"semanticLabel","headline":"headline","closable":"showCloseButton","closeLabel":"closeButtonSemanticLabel","dividerVisibility":"dividerVisibility"},"events":{"close":"onClose","detentChange":"onDetentChanged"},"notes":"`TanreiBottomSheet(variant:, open:, onClose: ValueChanged<TanreiSheetCloseReason>, detent:, onDetentChanged:, dismissible:, showHandle:, handleSemanticLabel:, inset:, semanticLabel:, child:)`, controlled: the caller sets `open` to false from `onClose`. The product places it in a `Stack` over what it covers — for a modal sheet, a `Stack` over the whole page, as the modal navigation drawer — not `showModalBottomSheet`, which needs Material. The modal form draws its scrim over the whole `Stack`, keeps focus in a `FocusScope`, blocks the page's semantics (`BlockSemantics`), names itself with `Semantics(scopesRoute: true, namesRoute: true)`, answers back through `PopScope` and Escape through `Shortcuts`/`Actions`. Initial focus is `autofocus: true` on a focusable widget. Drag with a vertical drag recogniser; fling `kMinFlingVelocity`, slop `kTouchSlop`. Snapshot harness: a golden of the whole 400 × 720 surface with the sheet in a `Stack` over a `surface` page. Not built on this platform yet: the header — headline, closable, closeLabel and dividerVisibility, the close reason close (BSH-28, BSH-29) — and the report of a sheet with no way out a person can see (BSH-30). Not built on this platform yet: the scrim of a modal sheet taken away at once as it begins to close (BSH-1, MOT-8)."},"react-native":{"status":"lagging","name":"BottomSheet","props":{"variant":"variant","open":"open","detent":"detent","dismissible":"dismissible","handle":"handle","handleLabel":"handleLabel","inset":"inset","label":"accessibilityLabel","headline":"headline","closable":"closable","closeLabel":"closeLabel","dividerVisibility":"dividerVisibility"},"events":{"close":"onClose","detentChange":"onDetentChange"},"notes":"Controlled: `open`, `onClose(reason)`, `detent`, `onDetentChange`; the caller sets `open` to false from `onClose`. Modal: presented in a transparent `Modal` with `animationType=\"none\"`, `statusBarTranslucent` and `navigationBarTranslucent` (Tanrei draws the scrim and the motion); `onRequestClose` (Android back, and Escape on a hardware keyboard) is close with the reason `back` or `escape`. Standard: a `View` positioned absolutely at the bottom of its parent. Drags with `PanResponder` (no gesture-handler dependency): slop 8 pt, fling 0.5 pt/ms. The on-screen keyboard is read from `Keyboard` events. Initial focus is an `initialFocusRef` the product passes, moved with `AccessibilityInfo.setAccessibilityFocus`. Insets come from the sheet's own `insets` prop, falling back to `TanreiProvider`'s `insets`; the package takes no safe-area dependency. Snapshot harness: renders `BottomSheetSurface` (the sheet and, for a modal sheet, the scrim) in place in a 400 × 720 view over a `surface` page, since a `Modal` is a native window the snapshot does not include. React Native cannot hand one gesture from the sheet to the content's native scroll view partway through, so BSH-10's hand-off takes two gestures there; the package takes no gesture-handler dependency (as it takes no safe-area one). Not built on this platform yet: the header — headline, closable, closeLabel and dividerVisibility, the close reason close (BSH-28, BSH-29) — and the report of a sheet with no way out a person can see (BSH-30). Not built on this platform yet: the scrim of a modal sheet taken away at once as it begins to close (BSH-1, MOT-8)."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"breadcrumbs","title":"Breadcrumbs","summary":"Shows where a page sits in a hierarchy of pages and leads back up it: the levels above as links, in order from the top, with the page itself last.","level":"base","listing":"default","anatomy":[{"id":"root","description":"The navigation landmark and, in it, one ordered list of the levels, from the top of the hierarchy to the page. On one line by default."},{"id":"container","description":"The shape behind a level that is a link, and behind the overflow button. It has no fill at rest and takes no room in the layout: it is where hover, focus and press are drawn."},{"id":"label","description":"A level's text, in the trail's text style."},{"id":"underline","description":"The line under the label of a level that is a link, in the label's color. When it is drawn is a choice (BRC-30): at rest in the default system, where it is what says that a level leads somewhere. The current page and a level without a destination have none."},{"id":"icon","description":"A glyph of the system's icon set that the product names for a level (a house for the top), before the label or in its place. Decorative.","optional":true},{"id":"separator","description":"The glyph chevron_right between two neighbouring levels, drawn by the trail. Decorative; mirrored in a right-to-left layout by the icon helper."},{"id":"overflow-button","description":"An icon-only button showing more_horiz that stands where levels were taken out of a trail too long for its width, and opens a menu of them.","optional":true},{"id":"menu","description":"The menu of the levels that were taken out, in the trail's order: a Tanrei menu, opened from the overflow button.","optional":true},{"id":"focus-ring","description":"The indicator shown for keyboard focus, around a link's or the overflow button's container."}],"props":[{"name":"label","type":"string","default":"","description":"The accessible name of the landmark (\"Breadcrumbs\"), in the product's language. Tanrei ships no words of its own. It tells this landmark from the page's other navigation, so it is required."},{"name":"overflow","type":"enum","values":["collapse","wrap"],"default":"collapse","description":"What a trail longer than its width does. collapse: it stays on one line and its middle levels go behind the overflow button, as many as the width asks for (BRC-9). wrap: every level stays in the trail, which runs over as many lines as it needs (BRC-15)."},{"name":"overflowLabel","type":"string","default":"","description":"The accessible name of the overflow button (\"Show hidden levels\"), in the product's language. Required while overflow is collapse; ignored while it is wrap.","words":"breadcrumbsOverflowLabel"},{"name":"underline","type":"enum","values":["auto","always","hover","never"],"default":"auto","description":"When the levels that are links are underlined. always: at rest and in every state. hover: while a level is hovered, focused from the keyboard or pressed, and not at rest. never: in no state. Auto takes comp.breadcrumbs.underline.visibility, the design system's answer (always in the default system). It applies to every level of the trail."}],"items":[{"name":"item","summary":"One level of the hierarchy: a link to it, the page the person is on, or the name of a level that has no page.","props":[{"name":"label","type":"string","default":"","description":"The level's name: the title of its page, as short as the product has it. It is the item's accessible name, drawn or not."},{"name":"href","type":"string","default":"","description":"The destination: an address as the platform's links take one. With one the level is a link; without one it is text — the current page, or a level that has no page of its own (BRC-3)."},{"name":"current","type":"boolean","default":false,"description":"The level is the page the person is on. Only the last item may be current. It is exposed as the current page and drawn heavier, without an underline; give it no href, so that it is text and not a link to where the person already is (BRC-4)."},{"name":"icon","type":"string","default":"","description":"The name of a glyph of the system's icon set, drawn before the label (\"home\" for the top of the hierarchy). Empty: no glyph."},{"name":"iconOnly","type":"boolean","default":false,"description":"Draws the glyph alone and keeps the label as the accessible name. Ignored while icon is empty."}],"events":[{"name":"click","description":"A level that is a link was activated by pointer, touch, Enter or assistive technology, in the trail or in the menu. It is emitted before the destination opens; a product that takes the navigation itself (a client-side router) cancels it (BRC-22)."}]}],"states":["enabled","hovered","focused","pressed"],"behavior":[{"id":"BRC-1","text":"THE breadcrumbs SHALL be one navigation landmark named by label that holds one ordered list of its items, in the order the product gave them — from the top of the hierarchy to the page — each a list item with its position in the list, and nothing else that assistive technology reads but the overflow button; WHILE label is empty THE breadcrumbs SHALL still render, and in debug builds report that the landmark has no accessible name. WHILE it has no item THE breadcrumbs SHALL draw nothing, take no room and expose no landmark."},{"id":"BRC-2","text":"WHILE an item's href is a destination and its current is false THE breadcrumbs SHALL draw that level as the platform's own link to it (the web's anchor element in the document itself, not in a shadow root; 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, the address shown before it is followed, a crawler that reads it, and a link that works before any script has run — is the platform's, and not the trail's to draw or to take over; it SHALL expose the link role, named by the item's label, and SHALL draw the label in comp.breadcrumbs.label.typescale and comp.breadcrumbs.item.content.color and, WHILE its underline is shown (BRC-30), with an underline comp.breadcrumbs.underline.width thick, comp.breadcrumbs.underline.offset below the text's baseline, in the label's color of its state, under the text only and not under a glyph. In the default system the underline is shown at rest and in every state: there, in a trail as in a sentence, the underline and not the color says that a level leads somewhere."},{"id":"BRC-3","text":"WHILE an item has no destination and its current is false THE breadcrumbs SHALL draw that level as text — its label in comp.breadcrumbs.label.typescale and comp.breadcrumbs.label.color, with no underline and no container — which is not focusable, answers no hover, focus or press, has no role of its own and emits nothing: it names a level of the hierarchy that has no page. IF an item's href 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 breadcrumbs SHALL draw that level so too, and in debug builds report it."},{"id":"BRC-4","text":"WHILE the last item's current is true THE breadcrumbs SHALL expose that level as the current page (on the web aria-current with the value page; on a platform without that state, the selected state) and SHALL draw its label in comp.breadcrumbs.current.content.color, with no underline, at the emphasized weight of its text style — that style's weight plus sys.typescale.emphasis.body — so that it is told from the levels above it by more than its color. WHILE that item has no destination it SHALL be text as BRC-3 says: not focusable, without states and without an event. WHILE it has a destination it SHALL be a link as BRC-2 says that keeps this look and answers hover, focus and press with the tokens of the current part. IF current is true on an item that is not the last THE breadcrumbs SHALL draw that item as if current were false, and in debug builds report it."},{"id":"BRC-5","text":"THE breadcrumbs SHALL open a destination in the context the person is in and in no other, SHALL draw no mark for a new context and SHALL draw no state for a destination already visited: the levels of one hierarchy replace the page the person is on, and a level's colors say what it is and what state it is in."},{"id":"BRC-6","text":"THE breadcrumbs SHALL draw one separator between every two neighbouring entries of the trail — levels and the overflow button alike — and none before the first or after the last: the glyph chevron_right of the system's icon set in a box comp.breadcrumbs.separator.size large, in comp.breadcrumbs.separator.color, comp.breadcrumbs.separator.gap from the entry on either side, centred on the line of the label beside it, drawn through the platform's icon helper 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. A separator SHALL be hidden from assistive technology, SHALL be no part of a level's name, link or hit area, and SHALL keep its color in every state of the levels beside it."},{"id":"BRC-7","text":"WHILE an item's icon names a glyph THE breadcrumbs SHALL draw it before the label in the reading direction, in a box comp.breadcrumbs.icon.size large, comp.breadcrumbs.container.gap from the label, centred on the label's line, in the color of the level's label and state, through the icon helper as BRC-6 draws a separator, hidden from assistive technology. WHILE iconOnly is also true THE breadcrumbs SHALL draw the glyph alone, with no label and no underline, its container a square one line of the trail's text high around it, and SHALL keep the item's label as its accessible name. WHILE an item's label is empty THE breadcrumbs SHALL still render it, and in debug builds report that the level has no name."},{"id":"BRC-8","text":"WHILE overflow is collapse THE breadcrumbs SHALL set the trail on one line, each label on one line, as wide as its entries need and no wider than the layout gives it, aligned to the start, and SHALL NOT wrap or scroll it."},{"id":"BRC-9","text":"WHILE overflow is collapse and the trail is wider than the width the layout gives it THE breadcrumbs SHALL take levels out of the trail and draw the overflow button once, in the place of the first level it took out: first the levels between the first and the last, beginning with the one next to the first and going on toward the last, each only if what is left still does not fit; then, if the first level, the button and the last level still do not fit, the first level as well, so that the button begins the trail. It SHALL NOT take out the last level, SHALL take out no more levels than the width asks for, and SHALL measure the trail with its separators and gaps, by the width it is given and not by the window's."},{"id":"BRC-10","text":"THE breadcrumbs SHALL draw the overflow button as the glyph more_horiz of the system's icon set in a box comp.breadcrumbs.icon.size large, in comp.breadcrumbs.overflow.content.color, drawn as BRC-6 draws a separator, in a container that is a square one line of the trail's text high with corners comp.breadcrumbs.container.shape; it SHALL be one list item of the trail holding one focusable element with the button role, named by overflowLabel, that says it opens a menu and whether that menu is open, and WHILE overflowLabel is empty SHALL still render and in debug builds report that the button has no accessible name. WHILE no level is taken out THE breadcrumbs SHALL draw no overflow button."},{"id":"BRC-11","text":"WHEN the user activates the overflow button by pointer, touch, Enter or Space THE breadcrumbs SHALL open a menu anchored to it, below it with the start edges aligned, that lists the levels taken out in the trail's order, each named by its label and showing its glyph where it has one: a level with a destination as an item that is a link to it, a level without one as a disabled item. What the menu draws, how focus enters it and moves in it, and how it closes are the menu's own (its spec's behaviours), and WHEN it closes without a level having been followed THE breadcrumbs SHALL return focus to the overflow button."},{"id":"BRC-12","text":"WHEN the width the layout gives the trail, a label, the text size or the layout direction changes THE breadcrumbs SHALL decide again which levels are taken out, at once and without a motion of its own; a level that fits again SHALL return to its place in the trail. WHEN a level that holds keyboard focus is taken out THE breadcrumbs SHALL move focus to the overflow button, and WHEN the overflow button is removed while it holds focus or its menu is open THE breadcrumbs SHALL close the menu and move focus to the first level that returned."},{"id":"BRC-13","text":"WHILE a level is taken out of the trail THE breadcrumbs SHALL keep it out of the list assistive technology reads and out of the focus order, reached through the menu alone; WHERE the platform's links are elements of a document (the web) THE breadcrumbs SHALL keep that level's link in the document, hidden, so that the whole trail is there for whatever reads the page as built and before any script has run."},{"id":"BRC-14","text":"WHILE overflow is collapse and the overflow button with the last level alone is still wider than the width the layout gives, or the trail has one level that is, THE breadcrumbs SHALL cut that level's label with an ellipsis at the end of its own direction (BRC-28), keeping the button, the separator and a glyph whole; the full label SHALL remain what assistive technology reads."},{"id":"BRC-15","text":"WHILE overflow is wrap THE breadcrumbs SHALL keep every level in the trail and draw no overflow button: it SHALL break the trail onto as many lines as it needs, comp.breadcrumbs.row-gap apart and aligned to the start, only after a separator, so that a separator ends a line and never begins one; a label longer than a line SHALL wrap where its language allows a break and, for a run with no such place, inside the run, and SHALL NOT be cut."},{"id":"BRC-16","text":"WHILE a level that is a link or the overflow button is hovered, keyboard-focused or pressed THE breadcrumbs SHALL render its container, its content — the label with its underline and glyph, or the button's glyph — and its opacity from the component tokens of its part (item, current, overflow) in the highest-precedence active state, with precedence pressed over focused over hovered; focus gained by pointer or touch SHALL NOT select the focused state. The container SHALL be the box of the content, with corners comp.breadcrumbs.container.shape, and SHALL take no room and move nothing beside it."},{"id":"BRC-17","text":"WHEN a level that is a link or the overflow button receives keyboard focus THE breadcrumbs SHALL show the focus ring around its container without animation — the system's focus indicator, sys.focus.offset from the container, sys.focus.outer-width wide in the focus-ring color, with the inner stroke of sys.focus.inner-width where the system has one — and, for a label that runs over several lines of a wrapped trail, around its part of each line; focus gained by pointer or touch SHALL NOT show it."},{"id":"BRC-18","text":"WHEN a level that is a link is pressed by pointer, touch or Enter, or the overflow button by pointer, touch, Enter or Space, THE breadcrumbs SHALL show the pressed state without delay and SHALL keep it visible for at least sys.motion.duration.press-hold, even when the press ends sooner."},{"id":"BRC-19","text":"WHILE pressed THE breadcrumbs 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, 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.breadcrumbs.motion.feedback-duration with motion.state-easing, fades over motion.state-duration with motion.state-easing once the press has ended and press-hold has passed, and appears whole where motion is reduced."},{"id":"BRC-20","text":"THE breadcrumbs 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":"BRC-21","text":"THE breadcrumbs SHALL change a level or the overflow button between its states over comp.breadcrumbs.motion.state-duration with comp.breadcrumbs.motion.state-easing, and at once where motion is reduced."},{"id":"BRC-22","text":"WHEN the user activates a level that is a link in the trail by pointer, touch or Enter THE breadcrumbs SHALL emit that item's click exactly once and then open its href, unless the product cancelled that click, in which case it SHALL open nothing: the product's own router has taken the navigation. It SHALL NOT hold the navigation back for sys.motion.duration.press-hold. THE breadcrumbs SHALL NOT activate a link in the trail on Space, which on the web scrolls the page as it does on any link, and SHALL NOT show the pressed state for it; a level listed in the menu is the menu's link item, whose keys and activation are the menu's own (MNU-53, MNU-54: its click is emitted once and can be cancelled, the menu closes, then the destination opens, and Space activates it as it does every row of a menu); 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 breadcrumbs SHALL leave them to the platform."},{"id":"BRC-23","text":"WHERE the visual size of a level that is a link or of the overflow button is below the minimum target THE breadcrumbs 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 or the room it takes, on the axis of the trail no further than halfway to the entry beside it, and, WHILE the trail runs over several lines (BRC-15), across them no further than half comp.breadcrumbs.row-gap toward a line above or below that level, so that no two hit areas overlap; a platform that cannot tell the input type SHALL use sys.target.touch."},{"id":"BRC-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 breadcrumbs SHALL draw a level that is a link, with its underline and glyph, in the platform's link color, the current page, a level without a destination and the separators in its text color, the overflow button's glyph in its button text color, and the focus ring in its highlight color, and SHALL draw the underline of a level that is a link at rest, whatever underline and the tokens it follows say: the colors are then the person's, and nothing holds a link's color apart from a text level's."},{"id":"BRC-25","text":"WHILE the text size is enlarged THE breadcrumbs SHALL grow with its text — its labels, its containers and its hit areas — keeping comp.breadcrumbs.separator.gap, comp.breadcrumbs.container.gap, comp.breadcrumbs.underline.width, comp.breadcrumbs.underline.offset, comp.breadcrumbs.row-gap and its glyphs at comp.breadcrumbs.icon.size and comp.breadcrumbs.separator.size, and SHALL decide again what fits (BRC-12)."},{"id":"BRC-26","text":"THE breadcrumbs 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 breadcrumbs is shown THE breadcrumbs SHALL draw itself for the new direction at once, without a motion of its own, keeping its focus and whether its menu is open."},{"id":"BRC-27","text":"WHERE the layout direction is right-to-left THE breadcrumbs SHALL lay the trail out from the right — the top of the hierarchy at the right and the page at the left, a level's glyph at the right of its label, the menu opening with its right edge on the button's — and SHALL draw each separator mirrored left to right, pointing to the left, the way the trail reads: the icon helper mirrors it inside its own box because the system's icon set marks chevron_right as mirrored. It SHALL draw a level's own glyph mirrored exactly when the icon set marks that glyph's name or the product forces mirroring for that use, and unmirrored when the product forbids it. THE breadcrumbs SHALL NOT mirror a glyph itself, and the reading and focus order SHALL stay from the top of the hierarchy to the page."},{"id":"BRC-28","text":"THE breadcrumbs SHALL lay out each label 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 sign or unit and a version keep their own order in a right-to-left layout and reorder nothing beside them; THE breadcrumbs SHALL still place the label by the layout direction, not by the text's own, and SHALL cut a label that does not fit (BRC-14) at the end of its own direction, so that a left-to-right label in a right-to-left layout loses its right end and never its beginning."},{"id":"BRC-29","text":"WHEN overflow names a value the breadcrumbs does not have THE breadcrumbs SHALL behave as collapse, and in debug builds report the unknown value."},{"id":"BRC-30","text":"THE breadcrumbs SHALL show the underline of every level that is a link as its underline prop names: WHILE underline is auto, as comp.breadcrumbs.underline.visibility names, which follows sys.behavior.link-underline unless a design system sets the trail apart; WHILE underline is always, hover or never, as that value names, whatever the tokens say. always draws the line at rest and in every state; hover draws none at rest and draws it WHILE the level is hovered, keyboard-focused or pressed, the line arriving and leaving with that state as BRC-16 renders it and moving no level; never draws none in any state, and hover, focus and press are still shown by the container, the label color and the focus ring. The links of the overflow menu are menu items and are never underlined. WHEN underline, or the token it follows, changes THE breadcrumbs SHALL draw the other form at once, keeping its focus and what it has collapsed; WHEN underline names a value the breadcrumbs does not define THE breadcrumbs SHALL treat it as auto and in debug builds report the unknown value. A platform that cannot draw a choice SHALL fall back to the first value, always, and state that in its README."},{"id":"BRC-31","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 breadcrumbs 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 its navigation landmark (BRC-1) — an id reference by the elements it names in the host's tree or a tree around it, a description after its own. WHILE label is not empty it is the landmark's name, over a name given so; WHILE label is empty, a name given so is the landmark's name and SHALL NOT be reported as having none in debug builds. 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 breadcrumbs SHALL take it off that element."}],"accessibility":{"role":"navigation","keyboard":[{"keys":"Tab","action":"Moves focus through the levels that are links and the overflow button, in the trail's order: each is a tab stop, as the links of a navigation region are. Text levels and levels behind the button are passed."},{"keys":"Enter","action":"Follows the focused link; on the overflow button, opens the menu. Space does what it does on any link (on the web it scrolls the page)."},{"keys":"Space","action":"On the overflow button, opens the menu."},{"keys":"Arrow keys, Home, End, Escape","action":"In the open menu, as the menu's spec says: move among the hidden levels; Escape closes it and returns focus to the button."}],"labeling":"The landmark is named by label, which is required. Each level is named by its label, drawn or not (iconOnly); its glyph is decorative. The current page carries the current state; nothing is added to its name. The overflow button is named by overflowLabel, which is required while overflow is collapse, and says that it opens a menu. Separators are hidden from assistive technology.","minimumTarget":true,"notes":["The current page is text by default, not a link. A link to the page a person is on leads nowhere, and adds a tab stop to every page of a product; as text it is still read in its place in the list, with the current state. A product that needs it to be a link (a page whose views change under one address) gives the item a destination, and it is then a link with the same look (BRC-4). A product whose page heading stands right under the trail may leave the current page out: the trail then ends at the parent, and no item is current.","In the default system a level that is a link is underlined, and the current page and a level without a page are not. That difference, with the heavier weight of the current page, is what tells them apart; color is not asked to (WCAG 1.4.1). The link color there is the primary's, which no scheme holds apart from the text color, so it could not.","A design system or a product may choose hover or never for the trail (BRC-30). A level that is a link is then told from a level that is text by its color, so the build holds the link color 3:1 apart from comp.breadcrumbs.label.color in every scheme where the choice is not always (an error in the default system, a warning in a product's layer). A trail whose every level above the current page is a link has no text level to be confused with, and the current page stays heavier; the check holds all the same, because one level without a page is enough. Forced colors draw the underline whatever was chosen (BRC-24).","The trail is a list of links in a landmark, not a toolbar: every link is a tab stop, and the arrow keys do nothing outside the menu.","Collapsing hides nothing from a person: every level taken out is in the menu, one press away, and the button says that it opens a menu. A trail that should never hide a level sets overflow to wrap. On the web the hidden levels' anchors stay in the document (BRC-13).","The last label is cut only when the button and it alone do not fit (BRC-14). The current page is usually the heading right under the trail, so the cut text is on the page in full; a product where it is not uses wrap.","The target. A level is a link that stands by itself, so its hit area is extended to sys.target without changing what is drawn (BRC-23), bounded halfway to its neighbours. Short labels beside each other keep the spacing WCAG 2.5.8 asks: a separator with its two gaps is 24 wide under the default system.","Text must remain readable at 200% text size: the trail grows with its text and collapses or wraps by the width it has; nothing has a fixed height (BRC-25).","Contrast in the default system: sys.color.link, on-surface and on-surface-variant are each held to 4.5:1 (7:1 in the high-contrast schemes) on every surface by the token invariants; the overflow glyph and the separators are on-surface-variant. The focus ring is held to 3:1 against every surface.","How a state looks is a value decision of the active design system (a state-layer mix in Tanrei, a dim or no hover at all elsewhere). The trail reads the state's tokens and never computes the effect itself.","A trail shows where a page is in the hierarchy, not the way a person came. A product that publishes the same hierarchy as structured data for search engines writes that itself, from the same items."]},"tokens":"comp.breadcrumbs","fixtures":[{"id":"default","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Components","href":"/components/"}},{"kind":"item","props":{"label":"Button","current":true}}]},{"id":"two-levels","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Components","href":"/components/"}},{"kind":"item","props":{"label":"Button","current":true}}]},{"id":"single","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Home","current":true}}]},{"id":"current-link","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Components","href":"/components/"}},{"kind":"item","props":{"label":"Button","current":true,"href":"/components/button/"}}]},{"id":"no-current","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Components","href":"/components/"}}]},{"id":"text-level","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Components"}},{"kind":"item","props":{"label":"Button","current":true}}]},{"id":"home-icon","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Home","href":"/","icon":"home"}},{"kind":"item","props":{"label":"Components","href":"/components/"}},{"kind":"item","props":{"label":"Button","current":true}}]},{"id":"home-icon-only","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Home","href":"/","icon":"home","iconOnly":true}},{"kind":"item","props":{"label":"Components","href":"/components/"}},{"kind":"item","props":{"label":"Button","current":true}}]},{"id":"long-trail","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Documentation","href":"/docs/"}},{"kind":"item","props":{"label":"Foundations","href":"/docs/foundations/"}},{"kind":"item","props":{"label":"Design tokens","href":"/docs/foundations/tokens/"}},{"kind":"item","props":{"label":"Component tokens","href":"/docs/foundations/tokens/component/"}},{"kind":"item","props":{"label":"State tokens","href":"/docs/foundations/tokens/component/states/"}},{"kind":"item","props":{"label":"Pattern rules of a design system","href":"/docs/foundations/tokens/component/states/rules/"}},{"kind":"item","props":{"label":"How a disabled container is derived","current":true}}]},{"id":"long-trail-wrap","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels","overflow":"wrap"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Documentation","href":"/docs/"}},{"kind":"item","props":{"label":"Foundations","href":"/docs/foundations/"}},{"kind":"item","props":{"label":"Design tokens","href":"/docs/foundations/tokens/"}},{"kind":"item","props":{"label":"Component tokens","href":"/docs/foundations/tokens/component/"}},{"kind":"item","props":{"label":"State tokens","href":"/docs/foundations/tokens/component/states/"}},{"kind":"item","props":{"label":"Pattern rules of a design system","href":"/docs/foundations/tokens/component/states/rules/"}},{"kind":"item","props":{"label":"How a disabled container is derived","current":true}}]},{"id":"long-current","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Guides","href":"/guides/"}},{"kind":"item","props":{"label":"Right-to-left layouts: where a component takes its direction from, which glyphs mirror, and which never do, with every case the icon set decides","current":true}}]},{"id":"default-rtl","props":{"label":"مسار التنقل","overflowLabel":"إظهار المستويات المخفية"},"items":[{"kind":"item","props":{"label":"الرئيسية","href":"/ar/"}},{"kind":"item","props":{"label":"المكوّنات","href":"/ar/components/"}},{"kind":"item","props":{"label":"الزر","current":true}}],"direction":"rtl"},{"id":"home-icon-only-rtl","props":{"label":"مسار التنقل","overflowLabel":"إظهار المستويات المخفية"},"items":[{"kind":"item","props":{"label":"الرئيسية","href":"/ar/","icon":"home","iconOnly":true}},{"kind":"item","props":{"label":"المكوّنات","href":"/ar/components/"}},{"kind":"item","props":{"label":"الزر","current":true}}],"direction":"rtl"},{"id":"long-trail-rtl","props":{"label":"مسار التنقل","overflowLabel":"إظهار المستويات المخفية"},"items":[{"kind":"item","props":{"label":"الرئيسية","href":"/ar/"}},{"kind":"item","props":{"label":"التوثيق","href":"/ar/docs/"}},{"kind":"item","props":{"label":"الأسس","href":"/ar/docs/foundations/"}},{"kind":"item","props":{"label":"رموز التصميم","href":"/ar/docs/foundations/tokens/"}},{"kind":"item","props":{"label":"رموز المكوّنات","href":"/ar/docs/foundations/tokens/component/"}},{"kind":"item","props":{"label":"رموز الحالات","href":"/ar/docs/foundations/tokens/component/states/"}},{"kind":"item","props":{"label":"قواعد الأنماط في نظام التصميم","href":"/ar/docs/foundations/tokens/component/states/rules/"}},{"kind":"item","props":{"label":"كيف يُشتق لون الحاوية المعطّلة","current":true}}],"direction":"rtl"},{"id":"ltr-label-rtl","props":{"label":"مسار التنقل","overflowLabel":"إظهار المستويات المخفية"},"items":[{"kind":"item","props":{"label":"الرئيسية","href":"/ar/"}},{"kind":"item","props":{"label":"Web Components","href":"/ar/platforms/web/"}},{"kind":"item","props":{"label":"tanrei-button 1.2","current":true}}],"direction":"rtl"},{"id":"underline-always","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels","underline":"always"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Components","href":"/components/"}},{"kind":"item","props":{"label":"Button","current":true}}]},{"id":"underline-hover","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels","underline":"hover"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Components","href":"/components/"}},{"kind":"item","props":{"label":"Button","current":true}}]},{"id":"underline-never","props":{"label":"Breadcrumbs","overflowLabel":"Show hidden levels","underline":"never"},"items":[{"kind":"item","props":{"label":"Home","href":"/"}},{"kind":"item","props":{"label":"Components","href":"/components/"}},{"kind":"item","props":{"label":"Button","current":true}}]}],"platforms":{"web":{"status":"lagging","name":"tanrei-breadcrumbs","props":{"label":"label","overflow":"overflow","overflowLabel":"overflowLabel","underline":"underline"},"items":{"item":{"name":"a","props":{"label":"textContent","href":"href","current":"aria-current","icon":"data-icon","iconOnly":"data-icon-only"},"events":{"click":"click"},"notes":"The product's own child of the element, in the document: an `<a href>` for a level with a destination, a `<span>` for one without. The label is its text; `aria-current=\"page\"` marks the current page; `data-icon=\"home\"` names a glyph and `data-icon-only` hides the text from sight, not from the name."}},"notes":"An element around the product's own anchors, which stay in the document (BRC-2, BRC-13): `<tanrei-breadcrumbs label=\"Breadcrumbs\" overflow-label=\"Show hidden levels\"><a href=\"/\">Home</a><a href=\"/components/\">Components</a><span aria-current=\"page\">Button</span></tanrei-breadcrumbs>`. It is an element and not a class, as Link and Previous and next links are, because collapsing by width has to measure, which a stylesheet cannot do. The shadow root holds the landmark (`<nav aria-label>`), the ordered list with one `<li>` and one slot for each child (assigned by the element), the separators, and the overflow `<li>` with its button and a `tanrei-menu` whose items are links to the hidden levels; a hidden level's `<li>` is not displayed, and its anchor is still in the document. Before the element is defined, and with scripting off, a rule of the package's stylesheet for `tanrei-breadcrumbs:not(:defined)` draws the children as the wrap form — every level, separators from the icon font, links underlined — so the trail is complete and usable without script, without the landmark. `overflow-label` is the attribute of `overflowLabel`. The levels in the trail take the Link stylesheet's rules for a standalone link with this component's tokens. The menu's items are the menu's link items (MNU-53 to MNU-57). React: `Breadcrumbs` renders the element and its children and takes a `render` prop for a router's link. `underline=\"always | hover | never\"` on the element; without it the trail follows `--tanrei-comp-breadcrumbs-underline-visibility`, read as the Link reads its own (a container style query, and `data-underline-system` on the document's root where the browser has none). The slotted anchors are styled by the element's `::slotted` rules, so the choice needs nothing on the anchors themselves."},"swiftui":{"status":"planned","name":"TanreiBreadcrumbs","props":{"label":"label","overflow":"overflow","overflowLabel":"overflowLabel","underline":"underline"},"items":{"item":{"name":"TanreiBreadcrumbsItem","props":{"label":"label","href":"destination","current":"isCurrent","icon":"icon","iconOnly":"iconOnly"},"events":{"click":"action"},"notes":"A value: `TanreiBreadcrumbsItem(\"Components\", destination: url, action:)`; `destination` is an optional `URL`. `action` runs before the address opens and returns whether the link should still open it."}},"notes":"`TanreiBreadcrumbs(label:overflowLabel:overflow:items:)`. Levels are built on SwiftUI's `Link`; the trail measures itself in a custom `Layout` and collapses there; the menu is `TanreiMenu`. The container is an accessibility container named by `label`; the current page has the `isSelected` trait. Not built on this platform yet: `underline`, an optional value of the same enumeration the Link takes; absent is auto."},"compose":{"status":"planned","name":"TanreiBreadcrumbs","props":{"label":"contentDescription","overflow":"overflow","overflowLabel":"overflowContentDescription","underline":"underline"},"items":{"item":{"name":"TanreiBreadcrumbsItem","props":{"label":"label","href":"href","current":"current","icon":"icon","iconOnly":"iconOnly"},"events":{"click":"onClick"},"notes":"A data class; `href` is nullable. `onClick` returns false to keep the address closed; otherwise `LocalUriHandler.current` opens it."}},"notes":"`TanreiBreadcrumbs(items, contentDescription, overflowContentDescription, overflow, modifier)`. A custom `Layout` (or `SubcomposeLayout`) measures and collapses; the menu is `TanreiMenu`. Compose has no navigation landmark and no link role for a clickable element: the row is a semantics group with `collectionInfo`, the current page is `selected`, and the README says what is not exposed. Not built on this platform yet: `underline`, an optional value of the same enumeration the Link takes; absent is auto."},"flutter":{"status":"planned","name":"TanreiBreadcrumbs","props":{"label":"semanticLabel","overflow":"overflow","overflowLabel":"overflowSemanticLabel","underline":"underline"},"items":{"item":{"name":"TanreiBreadcrumbsItem","props":{"label":"label","href":"href","current":"isCurrent","icon":"icon","iconOnly":"iconOnly"},"events":{"click":"onPressed"},"notes":"A value class; `href` is nullable. `onPressed` returns false to keep the address closed; otherwise the opener the app provides opens it."}},"notes":"`TanreiBreadcrumbs(items: …, semanticLabel: …, overflowSemanticLabel: …, overflow: …)`. A `MultiChildRenderObjectWidget` (or `CustomMultiChildLayout`) measures and collapses; the menu is `TanreiMenu`. `Semantics(container: true, label:)` around the row; each link `Semantics(link: true)`, the current page `selected`. Not built on this platform yet: `underline`, an optional value of the same enumeration the Link takes; absent is auto."},"react-native":{"status":"planned","name":"Breadcrumbs","props":{"label":"accessibilityLabel","overflow":"overflow","overflowLabel":"overflowAccessibilityLabel","underline":"underline"},"items":{"item":{"name":"BreadcrumbsItem","props":{"label":"label","href":"href","current":"current","icon":"icon","iconOnly":"iconOnly"},"events":{"click":"onPress"},"notes":"An object of the `items` prop. `onPress` receives an event whose `preventDefault()` keeps the address closed; otherwise `Linking.openURL(href)`."}},"notes":"`<Breadcrumbs accessibilityLabel=\"Breadcrumbs\" overflowAccessibilityLabel=\"Show hidden levels\" items={[…]} />`. Each link is a `Text` with `accessibilityRole=\"link\"`; the trail measures its levels with `onLayout` and collapses in a second pass; the menu is `Menu`. `accessibilityState` carries `selected` for the current page. Follows the app's direction where an ancestor's is not known. Not built on this platform yet: `underline`, an optional value of the same enumeration the Link takes; absent is auto."}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"button-group","title":"Button group","summary":"Lays out a few related Buttons in a row or a column, spaced apart or joined into one shape by a divider or a gap, places the completing and the backing-out actions where people expect them, and names the Buttons as a group.","level":"base","listing":"default","anatomy":[{"id":"group","description":"The row or column that holds the Buttons. It places and spaces the Buttons, joins them in the connected variant, and names them as a group. It draws nothing of its own but the dividers of a connected group."},{"id":"button","description":"A Tanrei Button placed in the group: icon-only, label-only or both, its icon on either side, a toggle or not. It is drawn from its own tokens and keeps its own states, focus, events and semantics."},{"id":"inner-corner","description":"In the connected variant, a corner of a Button that faces its neighbour. The group sets it.","optional":true},{"id":"outer-corner","description":"In the connected variant, a corner at an end of the joined shape: the start corners of the first Button and the end corners of the last in a row, the top corners of the first and the bottom corners of the last in a column. The group sets it.","optional":true},{"id":"divider","description":"In the connected variant under divider, the line on the seam between two Buttons that touch. The group draws it; under gap there is none.","optional":true}],"props":[{"name":"variant","type":"enum","values":["standard","connected"],"default":"standard","description":"standard spaces the Buttons apart. connected joins them into one shape with rounded outer ends, by a divider or by a narrow gap (separation), for a closely related set (Bold, Italic, Underline; Previous, Today, Next)."},{"name":"orientation","type":"enum","values":["horizontal","vertical"],"default":"horizontal","description":"horizontal lays the Buttons out in one row; vertical stacks them in one column, every Button as wide as the column. The confirming and dismissive Buttons change places with the orientation (BGR-13, BGR-14)."},{"name":"separation","type":"enum","values":["auto","divider","gap"],"default":"auto","description":"How the Buttons of a connected group are joined. divider: they touch, and a line is drawn on each seam. gap: they stand a narrow gap apart, with tighter corners where they face each other. Auto takes comp.button-group.connected.separation, the design system's answer (divider in the default system). Ignored while variant is standard."},{"name":"fullWidth","type":"boolean","default":false,"description":"The group fills its container's width and its Buttons share it equally (in a column, each is the container's width). For the actions at the foot of a dialog, a picker or a side sheet."},{"name":"size","type":"enum","values":["small","medium","large"],"default":"medium","description":"The size of the Buttons it holds, as the Button's size: set on the group, it is the size of every Button in it that sets none of its own (BGR-26). Only a size set on the group is passed down, not this default: a group that sets none leaves each Button at its own default, or at the size a container around the group sets. A Button's own size always wins. A size a design system adds to the Button may be named."},{"name":"label","type":"string","default":"","description":"The accessible name of the group (\"Text style\"). Optional: a group of actions that are each named by their own label needs none."}],"items":[{"name":"button","summary":"A Button in the group: the button component, placed, spaced and (when connected) given its corners and minimum size by the group, otherwise drawn and behaving as it does anywhere.","component":"button","props":[{"name":"variant","type":"enum","values":["filled","tonal","elevated","outlined","text"],"default":"filled","description":"Its emphasis, as the Button's variant."},{"name":"size","type":"enum","values":["small","medium","large"],"default":"medium","description":"Its height, as the Button's size. To give every Button of a group one size, set the group's size (BGR-26) and none on its Buttons."},{"name":"width","type":"enum","values":["default","narrow","wide"],"default":"default","description":"An icon-only Button's width, as the Button's width. A connected group still widens it to its minimum (BGR-3)."},{"name":"icon","type":"string","default":"","description":"The glyph in the Button's icon slot, by its name in the system's icon set. Empty for a label-only Button. It is how a fixture fills that slot; in an application the icon slot is filled as the Button's own spec says."},{"name":"iconPosition","type":"enum","values":["leading","trailing"],"default":"leading","description":"Which side of the label the icon is on, as the Button's iconPosition."},{"name":"label","type":"string","default":"","description":"Its accessible name, as the Button's label prop. Required for an icon-only Button."},{"name":"toggle","type":"boolean","default":false,"description":"As the Button's toggle."},{"name":"selected","type":"boolean","default":false,"description":"As the Button's selected."},{"name":"disabled","type":"boolean","default":false,"description":"As the Button's disabled."},{"name":"destructive","type":"boolean","default":false,"description":"As the Button's destructive: the action deletes or discards something a person may not get back (Delete, Discard, Remove member). The group leaves it as set and gives it no look of its own (BGR-19): the Button draws it in the error role at its variant's emphasis (BTN-40). Its label still says what it deletes (BTN-42)."},{"name":"confirming","type":"boolean","default":false,"description":"The Button completes the task (OK, Save, Next, Delete). The group places it at the end of a row and at the top of a column (BGR-13, BGR-14). It changes the Button's place only, never its look (BGR-19)."},{"name":"dismissive","type":"boolean","default":false,"description":"The Button backs out of the task (Cancel, Back, Not now). The group places it at the start of a row and at the bottom of a column (BGR-13, BGR-14). It changes the Button's place only, never its look (BGR-19)."}],"slots":[{"name":"label","description":"Its label, as the Button's default slot. A fixture item's content is this label; an icon-only item has none."},{"name":"icon","description":"Its glyph, as the Button's icon slot. A fixture fills it through the icon prop."}],"events":[{"name":"click","description":"The Button was activated, as the Button's click."},{"name":"change","description":"A toggle Button was switched, as the Button's change."}]}],"states":["enabled"],"behavior":[{"id":"BGR-1","text":"WHILE orientation is horizontal THE button group SHALL lay out its items in one row, in the order BGR-13 gives, each at its own size and width unless fullWidth is true (BGR-17): WHILE variant is standard comp.button-group.standard.gap apart and centred on the row's middle; WHILE variant is connected joined as its separation names (BGR-21) — comp.button-group.connected.gap apart under gap, touching under divider — and each stretched to the height of the tallest item (a Button's height is a minimum), so that the joined shape stays even when a label wraps or text is enlarged."},{"id":"BGR-2","text":"WHILE variant is connected and orientation is horizontal THE button group SHALL give the start corners of the first item and the end corners of the last the radius comp.button-group.connected.horizontal.outer-shape, and each corner that faces a neighbouring item the radius comp.button-group.connected.inner-shape WHILE its separation is gap and no radius, a square corner, WHILE its separation is divider (BGR-21), each capped at half the item's height and eased by sys.shape.corner-smoothing; the item's fill, outline, state layer, ripple and focus ring SHALL follow the resulting shape. WHILE variant is standard THE button group SHALL leave every corner of every item as the item draws it."},{"id":"BGR-3","text":"WHILE variant is connected THE button group SHALL make each item at least sys.target.touch for touch input and sys.target.pointer for fine pointers along the direction in which it meets its neighbours — wide in a row, high in a column — because joined items cannot extend a hit area over each other: an icon-only Button narrower than that widens its container around its centred icon, and a Button lower than that in a column grows its container around its centred content. Across the other direction the items SHALL extend their hit areas as BTN-5 says. A platform that cannot tell the input type SHALL use sys.target.touch."},{"id":"BGR-4","text":"WHILE variant is standard and the hit areas that two neighbouring items extend (BTN-5) overlap THE button group SHALL give every press on an item's visible bounds to that item, and a press in the gap between two items to the nearer one, so that neighbouring hit areas meet at the middle of the gap. comp.button-group.standard.gap is what keeps each item's target whole there: at sys.target.touch minus an item's width (in a row) or height (in a column) or more, no hit areas overlap and every item keeps its full target between its neighbours, as the default system's gap does for every Button size; a layer that narrows the gap narrows the targets between items."},{"id":"BGR-5","text":"THE button group SHALL NOT restyle its items beyond BGR-2, BGR-3, BGR-12, BGR-16, BGR-17, BGR-22 and BGR-23: each item SHALL render from its own tokens, answer hover, focus and press itself, switch itself WHILE its toggle is true, emit its own events, keep its own semantics and be its own Tab stop in the order BGR-15 gives; the group itself SHALL NOT take focus, SHALL NOT handle arrow keys and SHALL keep no selection of its own."},{"id":"BGR-6","text":"WHILE label is not empty THE button group SHALL expose itself to assistive technology as a group named by label that contains its items; WHILE label is empty THE button group SHALL expose no element of its own, only its items, unless the product names it (BGR-25)."},{"id":"BGR-7","text":"WHERE orientation is horizontal, fullWidth is false and the row is wider than the space its layout gives it THE button group SHALL narrow its labelled Buttons in proportion to their widths, down to the width of their longest word, letting their labels wrap as a Button's label does when its layout gives it less width, and SHALL keep icon-only Buttons at their width; it SHALL NOT wrap the row onto a second line or scroll it, and in debug builds SHALL report a row that still does not fit."},{"id":"BGR-8","text":"WHEN the layout direction is right-to-left THE button group SHALL, in a row, put its start at the right — the dismissive items at the right and the confirming items at the left (BGR-13), the first placed item's outer corners on its right — and mirror which corners are inner corners; in a column it SHALL keep the top-to-bottom order of BGR-14. Each item's content SHALL follow the layout direction as the Button's does."},{"id":"BGR-9","text":"WHEN variant, orientation or separation names a value the button group does not define THE button group SHALL render with that prop's default (standard, horizontal, auto), and in debug builds report the unknown value."},{"id":"BGR-10","text":"WHILE the group holds fewer than two items, or content that is not a Tanrei Button, THE button group SHALL still render it, a single item keeping every corner as it draws it, and in debug builds report it; a platform that cannot inspect its content SHALL state the rule in its README and docs page."},{"id":"BGR-11","text":"WHEN an item becomes disabled, is added or is removed, or its confirming or dismissive changes, THE button group SHALL place its items again by BGR-13 and BGR-14 and recompute which corners are inner and outer corners, where its dividers are (BGR-24) and which items carry the outer padding of BGR-23, at once, without animation; a disabled item SHALL keep its place, its gap or its dividers, and its corners, and an item that has focus while it moves SHALL keep it."},{"id":"BGR-12","text":"WHILE orientation is vertical THE button group SHALL lay out its items in one column, top to bottom in the order BGR-14 gives, comp.button-group.standard.gap apart WHILE variant is standard and, WHILE variant is connected, comp.button-group.connected.gap apart under gap and touching under divider (BGR-21), and SHALL make every item as wide as the column — the widest item's width, or the container's width WHILE fullWidth is true — its content centred as a Button centres it in a wider container. WHERE the column is given less width than its widest item every item SHALL take that width and its label SHALL wrap as BGR-7 says; the column SHALL NOT scroll."},{"id":"BGR-13","text":"WHILE orientation is horizontal THE button group SHALL place its items from start to end in three runs: first the items whose dismissive is true, then the items with neither flag, then the items whose confirming is true; within each run the items SHALL keep the order they were given in. The start is the left in a left-to-right layout and the right in a right-to-left one (BGR-8)."},{"id":"BGR-14","text":"WHILE orientation is vertical THE button group SHALL place its items from top to bottom in three runs: first the items whose confirming is true, then the items with neither flag, then the items whose dismissive is true; within each run the items SHALL keep the order they were given in, the first on top, in either layout direction."},{"id":"BGR-15","text":"THE button group SHALL make the focus order, and the order in which assistive technology reads its items, the placed order of BGR-13 and BGR-14 — start to end in a row, top to bottom in a column — whatever order the items were given in; a platform whose visual reordering the focus order does not follow (the web's CSS order) SHALL reorder the items themselves in the tree that focus and assistive technology walk."},{"id":"BGR-16","text":"WHILE variant is connected and orientation is vertical THE button group SHALL give the top corners of the first item and the bottom corners of the last the radius comp.button-group.connected.vertical.outer-shape, and every other corner of every item comp.button-group.connected.inner-shape WHILE its separation is gap and no radius, a square corner, WHILE its separation is divider (BGR-21), each capped at half the item's height and eased by sys.shape.corner-smoothing; the item's fill, outline, state layer, ripple and focus ring SHALL follow the resulting shape."},{"id":"BGR-17","text":"WHILE fullWidth is true and orientation is horizontal THE button group SHALL take the whole width its container gives it and divide it, less the gaps (none under divider), into equal shares, one per item, whatever each item holds: a label shorter than its share SHALL be centred in it, a label longer SHALL wrap as BGR-7 says, and an icon-only Button SHALL widen its container around its centred icon. WHERE a share is narrower than an item's minimum width (BGR-3, or an icon-only Button's own width) THE button group SHALL give that item its minimum, share the rest equally among the others, and in debug builds report it. WHILE fullWidth is false THE button group SHALL take its natural width."},{"id":"BGR-18","text":"IF an item's confirming and dismissive are both true THE button group SHALL place it among the items with neither flag and in debug builds report it."},{"id":"BGR-19","text":"THE button group SHALL NOT change an item's look, emphasis or semantics for its confirming or dismissive: the flags decide its place only. A destructive confirming action (Delete) takes its look from its own variant and its own destructive (BTN-40), and a Button is not made filled, or destructive, by being confirming."},{"id":"BGR-20","text":"THE button group 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 button group is shown THE button group SHALL draw itself for the new direction at once, without a motion of its own, keeping what it shows and its state."},{"id":"BGR-21","text":"WHILE variant is connected THE button group SHALL join its items as its separation names: WHILE separation is auto, as comp.button-group.connected.separation names, which follows sys.behavior.separation unless a design system sets it apart; WHILE separation is divider or gap, as that value names, whatever the tokens say. Under gap the items SHALL stand comp.button-group.connected.gap apart with nothing drawn between them and the inner corners of BGR-2 and BGR-16; under divider the items SHALL touch, with square inner corners and the divider of BGR-22 on each seam. WHILE variant is standard THE button group SHALL ignore separation and space its items by comp.button-group.standard.gap. WHEN separation, or the token it follows, changes THE button group SHALL draw the other form at once, without animation, keeping the order, the focus and the state of its items. A platform that cannot draw a choice SHALL fall back to the first value, divider, and state that in its README."},{"id":"BGR-22","text":"WHILE variant is connected and its separation is divider THE button group SHALL draw, on each seam between two neighbouring items that BGR-24 says carries one, a line comp.button-group.connected.divider.thickness thick, in the color BGR-24 names (comp.button-group.connected.divider.color, or comp.button-group.connected.divider.on-fill.color between two emphasis fills), centred on the seam, over the items' fills and state layers, running along the seam — top to bottom in a row, start to end in a column — and stopping comp.button-group.connected.divider.inset short of each end of it. The line SHALL take no space of its own, SHALL NOT take a press (a press on it goes to the item under the point), SHALL NOT be exposed to assistive technology and SHALL keep its color whatever state its neighbours are in. Each item SHALL draw neither its outline nor the ring of its elevation along an edge that meets a seam, whether or not a line is drawn on it, so that the divider is the only line a seam can carry and the outline of an outlined group runs once around the joined shape, in the color of its rules in the default system; an item's state layer, ripple and focus ring SHALL still follow that item's own shape."},{"id":"BGR-23","text":"WHILE variant is connected and orientation is horizontal THE button group SHALL add comp.button-group.connected.horizontal.outer-inset to the inline padding of the first item at its start and of the last item at its end, under either separation, so that content beside a rounded outer end looks as far from it as from the tighter corner on its other side: a labelled Button SHALL be wider by that amount with its content moved inward by it, and an icon-only Button SHALL be wider by that amount with its glyph centred in what is left, half of it nearer its neighbour. A single item (BGR-10) SHALL get none; a column SHALL add none, its ends not being full (BGR-16); WHILE fullWidth is true the shares of BGR-17 SHALL be divided first and the padding taken inside the end items' shares. In a right-to-left layout the start is the right, as BGR-8 says."},{"id":"BGR-24","text":"WHILE variant is connected and its separation is divider THE button group SHALL draw the line of BGR-22 on a seam only WHILE the two items it joins rest on the same fill: the colors from which they render their containers at rest — comp.button.outlined.container.color for an outlined Button, and so on for each variant, and for a toggle the selected or the unselected part of its variant (BTN-15) — are the same color in the active scheme, two containers that have no fill counting as the same. WHILE the two fills differ (a selected toggle beside an unselected one, a filled Button beside an outlined one) THE button group SHALL draw no line on that seam, because the edge of the fill already marks it, and the two items SHALL still draw neither outline nor elevation ring along it (BGR-22). A toggle of the text variant has no fill, selected or not, so its seams keep their lines. THE button group SHALL draw the line in comp.button-group.connected.divider.color, and in comp.button-group.connected.divider.on-fill.color WHILE both items rest on an emphasis fill: a filled Button that is not a toggle, or a selected toggle of the filled, tonal, elevated or outlined variant. It SHALL compare the fills the items have at rest: hover, focus and press SHALL neither add nor remove a line nor change its color, and a disabled item SHALL be compared by the look it has when enabled, so that disabling an item moves no line (BGR-11). WHEN an item's selected, toggle or variant changes THE button group SHALL change the lines beside it over comp.button-group.motion.state-duration on comp.button-group.motion.state-easing (sys.motion.role.state.default and sys.motion.easing.state): a line that a seam comes to carry SHALL fade in, a line it stops carrying SHALL fade out, and a line that changes color SHALL fade from the one color to the other, a change of opacity and color alone in which nothing changes place or size, turned round from what is drawn where it changes again during it (MOT-2). Which seams carry a line SHALL be decided at once, and the item's selected state and what it exposes to assistive technology SHALL change at once, not at the end of the motion. WHERE motion is reduced THE button group SHALL draw the lines as they rest at once, as it SHALL in the frames in which it is first drawn (MOT-3) and WHEN its items are placed again (BGR-11) or joined in the other form (BGR-21)."},{"id":"BGR-25","text":"WHERE the platform has ARIA attributes (the web), the host carries its group role (BGR-6) itself, so what the product writes on it is not moved, but for a name: WHILE label is not empty THE button group SHALL hold the product's aria-label and aria-labelledby on that host as their data-aria- twins, so that label is its whole name although the platform gives aria-labelledby the precedence, and WHEN label is emptied SHALL give them back as they were written; WHILE label is empty a name the product gives so — aria-label, or aria-labelledby naming an element — SHALL be its name. WHILE label is empty and the product names it so THE button group SHALL be exposed as a group named by that name, as with a label: a group the product names is a named group, and a name on an element with no role would name nothing. WHEN the product removes one, or its data-aria- twin, or sets the ARIA property that reflects it (ariaLabel, ariaLabelledByElements) to null, THE button group SHALL take it away."},{"id":"BGR-26","text":"WHILE size is set THE button group SHALL give it to every Button it holds that sets no size of its own, which is then drawn at it (BTN-48), and a Button that sets its own SHALL keep it; WHILE size is not set THE button group SHALL give none, so that each Button is drawn at its own default, or at the size a container around the group sets: only a size set on a container is passed down. WHEN size is set, changed or removed THE button group SHALL have its Buttons drawn at the size they now take at once. A size the Button does not have SHALL be drawn as BTN-7 says. THE button group SHALL draw nothing of its own by its size: its gaps, corners, dividers and outer padding stay those of its variant and separation, around Buttons of the height they are drawn at."}],"accessibility":{"role":"group","keyboard":[{"keys":"Tab / Shift+Tab","action":"Moves focus to each enabled item in turn in the placed order (BGR-15): start to end in a row, top to bottom in a column."},{"keys":"Enter or Space","action":"Activates the focused item, as the Button itself says (a toggle switches)."}],"labeling":"label, when given, names the group (\"Text style\"). Each item is named as it is anywhere: a Button by its label text, an icon-only Button by its label prop.","minimumTarget":true,"notes":["A button group is a layout of actions: each item is its own Tab stop with its own semantics. A row that should be one Tab stop with arrow keys is a toolbar; one choice among several is a single-selection control: tabs where it changes the content below, a radio group where it sets a value, or a segmented button in a system that ships one.","A toggle Button in a group keeps its own on/off state; the group does not make its toggles exclusive. One choice among several is a single-selection control: tabs where it changes the content below, a radio group where it sets a value, or a segmented button in a system that ships one.","confirming and dismissive are not announced: they decide where a Button is, and focus and reading follow that place, so a screen-reader user meets the actions in the same order a sighted user sees them.","The two flags describe the task, not the tone: in \"Cancel · Delete\" Delete is confirming. A destructive action is told apart by its own look (the Button's destructive) and its label, not by its place.","Compose has no group role: the group is a traversal group whose content description is label, and each item keeps its own role.","Text size: Buttons in a group grow as they do anywhere; a connected row stretches every item to the tallest, and a column makes every item as wide as the widest.","A divider is decoration: it is not exposed, takes no press and is no boundary a person must find. What tells two joined Buttons apart for assistive technology is that each is its own button with its own name; for sight, their content and the line or the gap between them.","A seam between a selected and an unselected toggle carries no line: the fill of the selected item ends there, at a contrast far above 3:1 against its neighbour, and that edge is the boundary. The selected state itself is exposed by the toggle (BTN-14), never by the line.","In the default system the outline of an outlined group and its rules are the hairline (the divider's color), far below 3:1 against the surface. That is within WCAG 1.4.11: each Button is identified by its label or its icon, not by its edge."]},"tokens":"comp.button-group","fixtures":[{"id":"standard","props":{"variant":"standard"},"items":[{"kind":"button","props":{"variant":"outlined"},"content":"Cancel"},{"kind":"button","props":{"variant":"tonal"},"content":"Save draft"},{"kind":"button","props":{"variant":"filled"},"content":"Publish"}]},{"id":"small","props":{"variant":"standard","size":"small"},"items":[{"kind":"button","props":{"variant":"outlined"},"content":"Cancel"},{"kind":"button","props":{"variant":"filled"},"content":"Publish"}]},{"id":"standard-icon-only","props":{"variant":"standard","label":"Post actions"},"items":[{"kind":"button","props":{"variant":"text","icon":"edit","label":"Edit"}},{"kind":"button","props":{"variant":"text","icon":"share","label":"Share"}},{"kind":"button","props":{"variant":"text","icon":"delete","label":"Delete"}}]},{"id":"standard-mixed","props":{"variant":"standard","label":"Message actions"},"items":[{"kind":"button","props":{"variant":"tonal","icon":"star","label":"Star","toggle":true,"selected":true}},{"kind":"button","props":{"variant":"tonal","icon":"reply"},"content":"Reply"},{"kind":"button","props":{"variant":"tonal","icon":"expand_more","iconPosition":"trailing"},"content":"Move"}]},{"id":"connected","props":{"variant":"connected","label":"Clipboard"},"items":[{"kind":"button","props":{"variant":"outlined"},"content":"Cut"},{"kind":"button","props":{"variant":"outlined"},"content":"Copy"},{"kind":"button","props":{"variant":"outlined"},"content":"Paste"}]},{"id":"connected-divider","props":{"variant":"connected","separation":"divider","label":"Clipboard"},"items":[{"kind":"button","props":{"variant":"outlined"},"content":"Cut"},{"kind":"button","props":{"variant":"outlined"},"content":"Copy"},{"kind":"button","props":{"variant":"outlined"},"content":"Paste"}]},{"id":"connected-gap","props":{"variant":"connected","separation":"gap","label":"Clipboard"},"items":[{"kind":"button","props":{"variant":"outlined"},"content":"Cut"},{"kind":"button","props":{"variant":"outlined"},"content":"Copy"},{"kind":"button","props":{"variant":"outlined"},"content":"Paste"}]},{"id":"connected-divider-filled","props":{"variant":"connected","separation":"divider","label":"Clipboard"},"items":[{"kind":"button","props":{"variant":"filled"},"content":"Cut"},{"kind":"button","props":{"variant":"filled"},"content":"Copy"},{"kind":"button","props":{"variant":"filled"},"content":"Paste"}]},{"id":"connected-gap-filled","props":{"variant":"connected","separation":"gap","label":"Clipboard"},"items":[{"kind":"button","props":{"variant":"filled"},"content":"Cut"},{"kind":"button","props":{"variant":"filled"},"content":"Copy"},{"kind":"button","props":{"variant":"filled"},"content":"Paste"}]},{"id":"connected-divider-tonal","props":{"variant":"connected","separation":"divider","label":"Clipboard"},"items":[{"kind":"button","props":{"variant":"tonal"},"content":"Cut"},{"kind":"button","props":{"variant":"tonal"},"content":"Copy"},{"kind":"button","props":{"variant":"tonal"},"content":"Paste"}]},{"id":"connected-divider-elevated","props":{"variant":"connected","separation":"divider","label":"Clipboard"},"items":[{"kind":"button","props":{"variant":"elevated"},"content":"Cut"},{"kind":"button","props":{"variant":"elevated"},"content":"Copy"},{"kind":"button","props":{"variant":"elevated"},"content":"Paste"}]},{"id":"connected-toggles","props":{"variant":"connected","label":"Text style"},"items":[{"kind":"button","props":{"variant":"tonal","icon":"format_bold","label":"Bold","toggle":true,"selected":true}},{"kind":"button","props":{"variant":"tonal","icon":"format_italic","label":"Italic","toggle":true,"selected":false}},{"kind":"button","props":{"variant":"tonal","icon":"format_underlined","label":"Underline","toggle":true,"selected":false}}]},{"id":"connected-gap-toggles","props":{"variant":"connected","label":"Text style","separation":"gap"},"items":[{"kind":"button","props":{"variant":"tonal","icon":"format_bold","label":"Bold","toggle":true,"selected":true}},{"kind":"button","props":{"variant":"tonal","icon":"format_italic","label":"Italic","toggle":true,"selected":false}},{"kind":"button","props":{"variant":"tonal","icon":"format_underlined","label":"Underline","toggle":true,"selected":false}}]},{"id":"connected-outlined-toggles","props":{"variant":"connected","separation":"divider","label":"Text style"},"items":[{"kind":"button","props":{"variant":"outlined","icon":"format_bold","label":"Bold","toggle":true,"selected":false}},{"kind":"button","props":{"variant":"outlined","icon":"format_italic","label":"Italic","toggle":true,"selected":true}},{"kind":"button","props":{"variant":"outlined","icon":"format_underlined","label":"Underline","toggle":true,"selected":true}}]},{"id":"connected-mixed","props":{"variant":"connected","label":"Date"},"items":[{"kind":"button","props":{"variant":"outlined","icon":"chevron_left"},"content":"Previous"},{"kind":"button","props":{"variant":"outlined"},"content":"Today"},{"kind":"button","props":{"variant":"outlined","icon":"chevron_right","iconPosition":"trailing"},"content":"Next"},{"kind":"button","props":{"variant":"outlined","icon":"calendar_month","label":"Pick a date"}}]},{"id":"connected-large","props":{"variant":"connected","label":"Date"},"items":[{"kind":"button","props":{"variant":"tonal","size":"large"},"content":"Previous"},{"kind":"button","props":{"variant":"tonal","size":"large"},"content":"Today"},{"kind":"button","props":{"variant":"tonal","size":"large"},"content":"Next"}]},{"id":"connected-disabled","props":{"variant":"connected","label":"Clipboard"},"items":[{"kind":"button","props":{"variant":"outlined"},"content":"Cut"},{"kind":"button","props":{"variant":"outlined","disabled":true},"content":"Copy"},{"kind":"button","props":{"variant":"outlined"},"content":"Paste"}]},{"id":"connected-vertical","props":{"variant":"connected","orientation":"vertical","label":"Calendar view"},"items":[{"kind":"button","props":{"variant":"outlined"},"content":"Day"},{"kind":"button","props":{"variant":"outlined"},"content":"Week"},{"kind":"button","props":{"variant":"outlined"},"content":"Month"}]},{"id":"connected-vertical-gap","props":{"variant":"connected","orientation":"vertical","label":"Calendar view","separation":"gap"},"items":[{"kind":"button","props":{"variant":"outlined"},"content":"Day"},{"kind":"button","props":{"variant":"outlined"},"content":"Week"},{"kind":"button","props":{"variant":"outlined"},"content":"Month"}]},{"id":"connected-vertical-toggles","props":{"variant":"connected","orientation":"vertical","label":"Zoom"},"items":[{"kind":"button","props":{"variant":"tonal","icon":"add","label":"Zoom in"}},{"kind":"button","props":{"variant":"tonal","icon":"remove","label":"Zoom out"}}]},{"id":"vertical-unflagged","props":{"variant":"standard","orientation":"vertical"},"items":[{"kind":"button","props":{"variant":"tonal"},"content":"1"},{"kind":"button","props":{"variant":"tonal"},"content":"2"},{"kind":"button","props":{"variant":"tonal"},"content":"3"}]},{"id":"order-cancel-ok","props":{"variant":"standard"},"items":[{"kind":"button","props":{"variant":"tonal","dismissive":true},"content":"Cancel"},{"kind":"button","props":{"variant":"tonal","confirming":true},"content":"OK"}]},{"id":"order-cancel-ok-vertical","props":{"variant":"standard","orientation":"vertical"},"items":[{"kind":"button","props":{"variant":"tonal","dismissive":true},"content":"Cancel"},{"kind":"button","props":{"variant":"tonal","confirming":true},"content":"OK"}]},{"id":"order-cancel-delete","props":{"variant":"standard"},"items":[{"kind":"button","props":{"variant":"tonal","dismissive":true},"content":"Cancel"},{"kind":"button","props":{"variant":"tonal","destructive":true,"confirming":true},"content":"Delete"}]},{"id":"order-back-next","props":{"variant":"standard"},"items":[{"kind":"button","props":{"variant":"filled","confirming":true},"content":"Next"},{"kind":"button","props":{"variant":"outlined","dismissive":true},"content":"Back"}]},{"id":"order-back-next-vertical","props":{"variant":"standard","orientation":"vertical"},"items":[{"kind":"button","props":{"variant":"filled","confirming":true},"content":"Next"},{"kind":"button","props":{"variant":"outlined","dismissive":true},"content":"Back"}]},{"id":"order-three-runs-vertical","props":{"variant":"standard","orientation":"vertical"},"items":[{"kind":"button","props":{"variant":"text","dismissive":true},"content":"Cancel"},{"kind":"button","props":{"variant":"tonal"},"content":"Save draft"},{"kind":"button","props":{"variant":"filled","confirming":true},"content":"Publish"}]},{"id":"order-rtl","direction":"rtl","props":{"variant":"standard"},"items":[{"kind":"button","props":{"variant":"tonal","dismissive":true},"content":"Cancel"},{"kind":"button","props":{"variant":"tonal","confirming":true},"content":"OK"}]},{"id":"full-width","props":{"variant":"standard","fullWidth":true},"items":[{"kind":"button","props":{"variant":"tonal","dismissive":true},"content":"Cancel"},{"kind":"button","props":{"variant":"tonal","confirming":true},"content":"OK"}]},{"id":"full-width-vertical","props":{"variant":"standard","orientation":"vertical","fullWidth":true},"items":[{"kind":"button","props":{"variant":"tonal","dismissive":true},"content":"Not now"},{"kind":"button","props":{"variant":"tonal","confirming":true},"content":"Allow"}]}],"platforms":{"web":{"status":"lagging","name":"tanrei-button-group","props":{"variant":"variant","orientation":"orientation","separation":"separation","fullWidth":"fullWidth","size":"size","label":"label"},"items":{"button":{"name":"tanrei-button","props":{"variant":"variant","size":"size","width":"width","icon":"slot=\"icon\"","iconPosition":"iconPosition","label":"label","toggle":"toggle","selected":"selected","disabled":"disabled","destructive":"destructive","confirming":"confirming","dismissive":"dismissive"},"events":{"click":"click","change":"change"},"notes":"A `tanrei-button` child, as anywhere: its label is its content and its glyph a `tanrei-icon` in its `icon` slot. `confirming` and `dismissive` are boolean attributes on the child that the group reads (a MutationObserver re-places the items when they change, BGR-11); the Button itself draws nothing for them."}},"parts":{"group":"host","button":"tanrei-button","inner-corner":{"noBox":"The group sets the corner radius of a Button's container where it faces a neighbour: a property of that box, not a box of its own."},"outer-corner":{"noBox":"The group sets the corner radius of a Button's container at an end of the joined shape: a property of that box, not a box of its own."},"divider":"divider"},"notes":"`<tanrei-button-group variant=\"connected\" orientation=\"vertical\" full-width label=\"Text style\">` holds `tanrei-button` children. It places them without moving them in the author's DOM: its shadow root has three slots in the order of the orientation (dismissive, unflagged, confirming in a row; confirming, unflagged, dismissive in a column) and assigns each child to one with manual slot assignment, so focus and the accessibility tree, which walk the flat tree, follow the placed order (BGR-15) and CSS `order` is not used. It sets role group and `aria-label` on its own element only while label is not empty (ElementInternals is not used for the role: axe-core does not see semantics set through it). It gives a connected item its corners and minimum size through CSS custom properties that Button reads on its container (`--tanrei-group-start-radius`, `--tanrei-group-end-radius`, and in a column the top and bottom radii, `--tanrei-group-min-width`, `--tanrei-group-min-height`); these are an internal contract between Tanrei elements, not a styling API. Each item also learns its place in the group through an internal controller, because three things cannot be done with custom properties alone: a label that may wrap (BGR-7, BGR-17), corners that never animate and pill ends held to half the measured height (BGR-11), and a hit area that stops at half the gap (BGR-4). It reports other children in debug builds (BGR-10). `separation` is an attribute (`auto`, `divider`, `gap`); auto reads the name in `--tanrei-comp-button-group-connected-separation`. Under divider the group draws each rule itself, in its shadow root over the seam, and tells each item through the same internal controller which of its edges meet a seam (no outline, no ring) and how much padding to add at an outer end (BGR-22, BGR-23). A divider draws its line twice, in `::before` in connected.divider.color and in `::after` in connected.divider.on-fill.color, and shows one of them or neither by its opacity, so that a line that comes, goes or changes color is a transition of opacity alone (BGR-24); a divider whose seam the group's placement or form changes is drawn at once. Owed on the web: `orientation=\"vertical\"` must really stack the items (BGR-12, BGR-14, BGR-16) — today the element and the review gallery draw every vertical fixture as a row — and its fixtures must be drawn as columns in the gallery and the baselines."},"swiftui":{"status":"lagging","name":"TanreiButtonGroup","props":{"variant":"variant","orientation":"orientation","separation":"separation","fullWidth":"fullWidth","size":"size","label":"label"},"items":{"button":{"name":"TanreiButton","props":{"variant":"variant","size":"size","width":"width","icon":"icon","iconPosition":"iconPosition","label":"label","toggle":"isSelected","selected":"isSelected","disabled":"disabled","destructive":"role","confirming":"tanreiGroupPlacement(.confirming)","dismissive":"tanreiGroupPlacement(.dismissive)"},"events":{"click":"action","change":"isSelected"},"notes":"A `TanreiButton` child, as anywhere. A toggle is a Button given an `isSelected` binding. The two flags are one modifier, `.tanreiGroupPlacement(.confirming)` or `(.dismissive)`, a `LayoutValueKey` the group's layout reads, as `.layoutPriority` is read by a stack; one enum cannot be both (BGR-18 cannot arise)."}},"notes":"Lagging: ships an earlier revision, a row of Buttons and the retired icon-only kind with no orientation, placement flags or full width. The target: `TanreiButtonGroup(variant:, orientation:, fullWidth:, label:) { TanreiButton … }`, a custom `Layout` that places its subviews by BGR-13 and BGR-14 and gives them `.accessibilitySortPriority` in that order so VoiceOver and keyboard focus follow it (BGR-15). The group passes a connected item its corners and minimum size through an environment value that `TanreiButton` reads (internal to the package). With a label it is `.accessibilityElement(children: .contain)` with `.accessibilityLabel(label)`. The group reads its content through a variadic view, as the menu and tabs do, so it reports fewer than two items and content that is not a Tanrei Button in debug builds (BGR-10). Also owed: `separation` (auto, divider, gap), the divider of BGR-22, the outer padding of BGR-23 and the nine new fixtures; reading comp.button-group.connected.separation as a typed choice needs the native token emitters to write a component's choice of kind as a typed enumeration, which they do not yet."},"compose":{"status":"lagging","name":"TanreiButtonGroup","props":{"variant":"variant","orientation":"orientation","separation":"separation","fullWidth":"fullWidth","size":"size","label":"contentDescription"},"items":{"button":{"name":"TanreiButton","props":{"variant":"variant","size":"size","width":"width","icon":"icon","iconPosition":"iconPosition","label":"contentDescription","toggle":"onCheckedChange","selected":"checked","disabled":"enabled","destructive":"destructive","confirming":"Modifier.confirming()","dismissive":"Modifier.dismissive()"},"events":{"click":"onClick","change":"onCheckedChange"},"notes":"A `TanreiButton` child, as anywhere; a toggle is a Button given `checked` and `onCheckedChange`, and `enabled` is disabled's inverse. The two flags are modifiers of the group's scope, `Modifier.confirming()` and `Modifier.dismissive()`, parent data the group's layout reads, as `RowScope.weight` is."}},"notes":"Lagging: ships an earlier revision, a row of Buttons and the retired icon-only kind with no orientation, placement flags or full width. The target: `TanreiButtonGroup(variant, orientation, fullWidth, contentDescription) { TanreiButton(…) }`, a custom `Layout` whose items read a `CompositionLocal` for their corners and minimum size (internal to the library). It places the items by BGR-13 and BGR-14 and sets `traversalIndex` in that order so TalkBack and focus follow it (BGR-15). With a content description it is `semantics { isTraversalGroup = true; contentDescription = … }`; Compose has no group role. Debug builds report content that is not a Tanrei Button, and a group of fewer than two items (BGR-10). Also owed: `separation` (auto, divider, gap), the divider of BGR-22, the outer padding of BGR-23 and the nine new fixtures; reading comp.button-group.connected.separation as a typed choice needs the native token emitters to write a component's choice of kind as a typed enumeration, which they do not yet."},"flutter":{"status":"lagging","name":"TanreiButtonGroup","props":{"variant":"variant","orientation":"orientation","separation":"separation","fullWidth":"fullWidth","size":"size","label":"semanticLabel"},"items":{"button":{"name":"TanreiButton","props":{"variant":"variant","size":"size","width":"width","icon":"icon","iconPosition":"iconAlignment","label":"semanticLabel","toggle":"isSelected","selected":"isSelected","disabled":"onPressed","destructive":"isDestructiveAction","confirming":"TanreiButtonGroupItem.placement","dismissive":"TanreiButtonGroupItem.placement"},"events":{"click":"onPressed","change":"onPressed"},"notes":"A `TanreiButton` child, as anywhere; a null `onPressed` disables it, and a non-null `isSelected` makes it a toggle. The two flags are one `ParentDataWidget`, `TanreiButtonGroupItem(placement: TanreiGroupPlacement.confirming | .dismissive, child:)`, as `Flexible` is for a `Flex`; one enum cannot be both (BGR-18 cannot arise)."}},"notes":"Lagging: ships an earlier revision, a row of Buttons and the retired icon-only kind with no orientation, placement flags or full width. The target: `TanreiButtonGroup(variant:, orientation:, fullWidth:, semanticLabel:, children: [TanreiButton(…)])`, a `MultiChildRenderObjectWidget` that places its children by BGR-13 and BGR-14 and wraps each in a `FocusTraversalOrder` and `Semantics(sortKey:)` in that order (BGR-15); the items read an `InheritedWidget` for their corners and minimum size (internal to the package). With a label it is `Semantics(container: true, label:, explicitChildNodes: true)`. Children of another type are reported in debug builds (BGR-10). Also owed: `separation` (auto, divider, gap), the divider of BGR-22, the outer padding of BGR-23 and the nine new fixtures; reading comp.button-group.connected.separation as a typed choice needs the native token emitters to write a component's choice of kind as a typed enumeration, which they do not yet."},"react-native":{"status":"lagging","name":"ButtonGroup","props":{"variant":"variant","orientation":"orientation","separation":"separation","fullWidth":"fullWidth","size":"size","label":"accessibilityLabel"},"items":{"button":{"name":"Button","props":{"variant":"variant","size":"size","width":"width","icon":"icon","iconPosition":"iconPosition","label":"accessibilityLabel","toggle":"toggle","selected":"selected","disabled":"disabled","destructive":"destructive","confirming":"confirming","dismissive":"dismissive"},"events":{"click":"onPress","change":"onSelectedChange"},"notes":"A `Button` child, as anywhere. `confirming` and `dismissive` are props on the child that the group reads from its children; the Button itself draws nothing for them."}},"notes":"Lagging: ships an earlier revision, a row of Buttons and the retired icon-only kind with no orientation, placement flags or full width. The target: `<ButtonGroup variant orientation fullWidth accessibilityLabel>{…}</ButtonGroup>` with `Button` children, which it renders in the order of BGR-13 and BGR-14 (reordering the children themselves, so focus and the screen reader follow it, BGR-15) and which read a React context for their corners and minimum size (internal to the package). With a label it has `role=\"group\"` and `accessibilityLabel`; without one it adds no accessibility element. Children of another type are reported in development builds (BGR-10). Also owed: `separation` (auto, divider, gap), the divider of BGR-22, the outer padding of BGR-23 and the nine new fixtures; reading comp.button-group.connected.separation as a typed choice needs the native token emitters to write a component's choice of kind as a typed enumeration, which they do not yet."}}}
|