From 9b450053009a6bbdccb6af1282aea68fe3ec444a Mon Sep 17 00:00:00 2001 From: Jason Morse <35609178+JasonVMo@users.noreply.github.com> Date: Fri, 20 Nov 2026 16:18:19 -0800 Subject: [PATCH 01/10] Clarify the component authoring handoff Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .changeset/clear-authoring-handoff.md | 5 +++ .../references/shared/portable/context.md | 18 ++++++++--- .../skills/furn-component-authoring/SKILL.md | 31 ++++++++++++------- .../SKILL.md | 29 +++++++++++------ 4 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 .changeset/clear-authoring-handoff.md diff --git a/.changeset/clear-authoring-handoff.md b/.changeset/clear-authoring-handoff.md new file mode 100644 index 0000000000..6f234c110a --- /dev/null +++ b/.changeset/clear-authoring-handoff.md @@ -0,0 +1,5 @@ +--- +"@fluentui-react-native/skills": patch +--- + +Follow the owning component contract's token companion and carry requirement-level source and native qualification evidence through the authoring workflow. diff --git a/packages/agentic/skills/references/shared/portable/context.md b/packages/agentic/skills/references/shared/portable/context.md index f21091cb97..350acf308b 100644 --- a/packages/agentic/skills/references/shared/portable/context.md +++ b/packages/agentic/skills/references/shared/portable/context.md @@ -71,8 +71,16 @@ workloads, capture unrelated windows, or access restricted sources without the necessary authorization. Clean up only resources whose ownership was recorded. Keep credentials and private source bodies out of outputs. -Report checks as passed, failed, skipped, not run, or unsupported. JavaScript -tests, mocks, and bundles do not qualify native behavior. Record the client, -activated skill identity, package/renderer versions, and actual evidence when -making behavior claims. No eval runner or automatic paid invocation is part of -this suite. +Report checks as passed, failed, skipped, not run, or unsupported. Record +excluded input lanes and any manual checks not run. A listed test or story, +a passing contract validator, and JavaScript tests, mocks, and bundles do not +qualify native behavior. + +For a native claim, link the actual result to the requirement it covers and +record the tested revision, endpoint, renderer and package versions, input +lane (when applicable), date, and outcome. When a change affects a requirement +on an endpoint, rerun the affected check or narrow the claim. Keep unaffected +evidence labeled with its original revision and scope. + +Record the client and activated skill identity when reporting workflow +evidence. No eval runner or automatic paid invocation is part of this suite. diff --git a/packages/agentic/skills/skills/furn-component-authoring/SKILL.md b/packages/agentic/skills/skills/furn-component-authoring/SKILL.md index 7c350638bb..6cd009b79d 100644 --- a/packages/agentic/skills/skills/furn-component-authoring/SKILL.md +++ b/packages/agentic/skills/skills/furn-component-authoring/SKILL.md @@ -34,8 +34,9 @@ These shared references are not additional skills. ## Workflow For a plan-only request, perform steps 1-4 read-only and return the proposed -contract revision, selected references, implementation order, and validation -plan. Do not edit files or start native workloads. +contract changes (if any), affected requirement IDs, selected references, +implementation order, and planned evidence and blockers by affected endpoint. +Do not edit files or start native workloads. 1. Read the host instructions and existing component contract. Higher-order components use `SPEC.md` and `spec/` companions; primitives may use a @@ -50,20 +51,28 @@ plan. Do not edit files or start native workloads. higher-order and primitive examples. Do not assume those source paths exist in a consuming application. 4. Establish public props, slots, native roots/refs, state ownership, - accessibility, interaction, tokens, and target platforms. Resolve product - and renderer constraints before implementation. + accessibility, interaction, tokens, and target platforms. Use the affected + requirements to identify what must be verified. Distinguish a theme or + caller visual override from a change to a reviewed default. For requirements + that depend on a native capability, verify the renderer and host + registration on the affected endpoints or record the blocker. 5. Implement types and slots, state and accessibility, styling and slot props, pure rendering, component assembly, and explicit named exports. Keep React Native adaptation distinct from web anatomy. -6. Preserve token meaning and the reviewed contract. Record genuine missing - tokens or platform capabilities rather than guessing substitutes. +6. Preserve token meaning and follow the contract's token companion where + applicable. Visual overrides do not replace component-owned handlers, + refs, focus behavior, or accessibility. Record missing tokens rather than + guessing substitutes. 7. Add focused runtime/type tests and stories for the public API and resolved - native output. Native action, focus, and input claims need native evidence. -8. Reconcile the contract, implementation, and evidence. Source refreshes - propose changes; they never automatically ratify local behavior. + output. Native action, focus, and input claims need native evidence on the + affected endpoints. +8. Reconcile the contract, implementation, and + [qualification evidence](../../references/shared/portable/context.md#permissions-and-evidence) + by requirement. Record new native dependencies and host setup requirements + for consumers. Do not assign a maturity label without the host's readiness + policy and the evidence it requires. 9. Run the target workspace's declared checks, narrowest first, then its - acceptance checks. Report passed, failed, skipped, not run, and unsupported - distinctly. Follow the host's release rules. + acceptance checks. Report the outcomes and follow the host's release rules. Keep one component's types, state, styling, and rendering in one implementation context. In a FURN source checkout, its root/scoped instructions additionally diff --git a/packages/agentic/skills/skills/furn-component-contract-authoring/SKILL.md b/packages/agentic/skills/skills/furn-component-contract-authoring/SKILL.md index 9a24c17755..c04ff057ff 100644 --- a/packages/agentic/skills/skills/furn-component-contract-authoring/SKILL.md +++ b/packages/agentic/skills/skills/furn-component-contract-authoring/SKILL.md @@ -41,7 +41,8 @@ package-relative adapters: provenance, and companions. Preserve unchanged reviewed requirements. 2. Inventory sources, assign stable IDs, state each source's authority, and pin immutable revisions/digests where possible. Record only evidence - whose use and redistribution are authorized. + whose use and redistribution are authorized. Distinguish the source + surfaces actually consulted from those merely available. 3. Separate observations, inferences, and unknowns. Images establish visible appearance, not accessibility or events. CSS and web behavior do not establish native-platform behavior. @@ -51,19 +52,26 @@ package-relative adapters: 5. Draft public API, slots, defaults, state ownership, requirement IDs, tokens, [accessibility](../../references/shared/portable/accessibility.md), interaction/focus/motion, usage, provenance, divergences, and planned - evidence. Identify unresolved token bindings rather than guessing. -6. For the FURN schema, use `SPEC.md` and the `spec/tokens.yaml`, - `spec/accessibility.md`, `spec/interaction.md`, `spec/usage.md`, and - `spec/source.json` companions as defined by the owning contracts - reference. Do not invent a competing schema. Other hosts explicitly - choose their own contract format. + evidence. For each changed requirement, capture the proposed native + behavior, what would verify it, and any unresolved token or platform + capability. Record blockers or deferrals rather than guessing. +6. For the FURN schema, use `SPEC.md` and its `spec/` companions as defined + by the owning contracts reference for the target package version. Follow + the single token companion named by `tokens:` in an existing `SPEC.md`; + preserve its format unless an explicit migration is in scope. If an + installed package omits the existing contract, consult matching authorized + source or report what is missing rather than guessing. For a new contract, + use the owning reference's format guidance. Other hosts choose their own + contract format. 7. Classify source claims as adopted, adapted, intentionally divergent, not applicable, deferred, or unknown. A local-foundation contract must not bypass an existing Flex catalog source; in the FURN schema it is the sole source and is validated by the owning checker. 8. Keep draft/review-required status and no review date until source interpretation, native adaptation, authority, and evidence are explicitly - reviewed. Only that review permits a reviewed contract. + reviewed. Carry the reviewed requirement IDs, planned evidence, and open + blockers into the implementation handoff. A reviewed contract does not + establish native qualification or release readiness. 9. Run the target's declared contract validator when available. Run FURN's source-refresh/checker commands only in its owning source workspace; never infer approval from a successful refresh or an installed dependency. @@ -71,5 +79,6 @@ package-relative adapters: The owning package reference defines exact schema, lifecycle, content boundaries, validation, and drift behavior. Record identities and write original documentation; never copy or lightly transform private source -bodies into public output. Upstream changes are proposals, not automatic -rewrites of a reviewed local contract. +bodies into public output. Candidate drift does not change the pinned +contract. Changing the source identity used by the contract requires renewed +review, not an automatic rewrite. From 5296cc1932e196bc12ababe7cfaf7f970ad9b279 Mon Sep 17 00:00:00 2001 From: Jason Morse Date: Fri, 20 Nov 2026 17:21:26 -0800 Subject: [PATCH 02/10] Scaffold the ToggleButton contract for Button migration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a06f5e29-1851-4153-802e-ea9ae887112d --- .changeset/toggle-button-contract-scaffold.md | 5 + .../components/references/remaining-work.md | 7 + .../components/spec-source-report.json | 15 +- .../src/components/toggle-button/SPEC.md | 84 +++++++++ .../toggle-button/renderToggleButton.tsx | 5 + .../toggle-button/spec/accessibility.md | 18 ++ .../toggle-button/spec/interaction.md | 14 ++ .../components/toggle-button/spec/source.json | 167 ++++++++++++++++++ .../components/toggle-button/spec/tokens.json | 31 ++++ .../components/toggle-button/spec/usage.md | 23 +++ .../toggle-button.scaffold.test.ts | 33 ++++ .../toggle-button/toggle-button.styles.ts | 17 ++ .../components/toggle-button/toggle-button.ts | 5 + .../toggle-button/toggle-button.types.ts | 74 ++++++++ .../toggle-button/useToggleButton.ts | 4 + .../toggle-button/useToggleButtonStyles.ts | 4 + 16 files changed, 503 insertions(+), 3 deletions(-) create mode 100644 .changeset/toggle-button-contract-scaffold.md create mode 100644 packages/agentic/components/src/components/toggle-button/SPEC.md create mode 100644 packages/agentic/components/src/components/toggle-button/renderToggleButton.tsx create mode 100644 packages/agentic/components/src/components/toggle-button/spec/accessibility.md create mode 100644 packages/agentic/components/src/components/toggle-button/spec/interaction.md create mode 100644 packages/agentic/components/src/components/toggle-button/spec/source.json create mode 100644 packages/agentic/components/src/components/toggle-button/spec/tokens.json create mode 100644 packages/agentic/components/src/components/toggle-button/spec/usage.md create mode 100644 packages/agentic/components/src/components/toggle-button/toggle-button.scaffold.test.ts create mode 100644 packages/agentic/components/src/components/toggle-button/toggle-button.styles.ts create mode 100644 packages/agentic/components/src/components/toggle-button/toggle-button.ts create mode 100644 packages/agentic/components/src/components/toggle-button/toggle-button.types.ts create mode 100644 packages/agentic/components/src/components/toggle-button/useToggleButton.ts create mode 100644 packages/agentic/components/src/components/toggle-button/useToggleButtonStyles.ts diff --git a/.changeset/toggle-button-contract-scaffold.md b/.changeset/toggle-button-contract-scaffold.md new file mode 100644 index 0000000000..823361fee8 --- /dev/null +++ b/.changeset/toggle-button-contract-scaffold.md @@ -0,0 +1,5 @@ +--- +'@fluentui-react-native/components': patch +--- + +Add the pre-implementation ToggleButton contract, selected-state tokens, and typed scaffold. ToggleButton is not yet exported; Button's API is unchanged. diff --git a/packages/agentic/components/references/remaining-work.md b/packages/agentic/components/references/remaining-work.md index 5258c6e0ef..b12f52076a 100644 --- a/packages/agentic/components/references/remaining-work.md +++ b/packages/agentic/components/references/remaining-work.md @@ -11,6 +11,13 @@ Open work for the agentic component catalog. Completed work is removed rather th is documented in the owning reference, component contract, or the repository focus references (`focus.common`, `focus.windows-win32`, and `focus.macos`). +## ToggleButton and the Button migration + +The [ToggleButton scaffold](../src/components/toggle-button/SPEC.md) is not exported. Reconcile its promoted source +with the package lock, implement TGB-001 through TGB-005, and qualify actual native Toggle delivery, checked state +and high-contrast selection on each desktop endpoint. Complete the [consumer migration](../src/components/toggle-button/spec/usage.md), +including non-Subtle and square callers, before removing any selection or icon props from Button (TGB-006). + ## Desktop focus qualification - **Issues:** [#4274](https://github.com/microsoft/fluentui-react-native/issues/4274); popup-family restoration in diff --git a/packages/agentic/components/spec-source-report.json b/packages/agentic/components/spec-source-report.json index 2310d78d3e..065076de70 100644 --- a/packages/agentic/components/spec-source-report.json +++ b/packages/agentic/components/spec-source-report.json @@ -147,9 +147,10 @@ "tab", "tablist", "tag", - "text" + "text", + "toggle-button" ], - "adaptedDrafts": [], + "adaptedDrafts": ["toggle-button"], "implemented": [ "accordion", "avatar", @@ -228,7 +229,6 @@ "split-button", "teaching-popover", "textarea", - "toggle-button", "toolbar", "tooltip" ], @@ -808,6 +808,15 @@ "marketplaceDrift": null, "originDrift": null, "candidateStatus": "not-applicable" + }, + { + "component": "toggle-button", + "lifecycle": "contract-draft", + "conformance": "review-required", + "releaseDifferences": [], + "marketplaceDrift": null, + "originDrift": null, + "candidateStatus": "unchecked" } ] } diff --git a/packages/agentic/components/src/components/toggle-button/SPEC.md b/packages/agentic/components/src/components/toggle-button/SPEC.md new file mode 100644 index 0000000000..10f1b148a0 --- /dev/null +++ b/packages/agentic/components/src/components/toggle-button/SPEC.md @@ -0,0 +1,84 @@ +--- +name: toggle-button +platform: react-native (Windows, macOS) +status: contract-draft +source: ./spec/source.json +tokens: ./spec/tokens.json +accessibility: ./spec/accessibility.md +interaction: ./spec/interaction.md +usage: ./spec/usage.md +--- + +# ToggleButton + +## Scope + +A ToggleButton changes one persistent boolean option, such as whether text is bold. Unlike an action-only Button, +its unchecked state is meaningful even when the caller supplies no state prop. It does not own a group, selection +among peers, a popup, or navigation. This is a pre-implementation scaffold, not a package export. + +## Public contract + +- **TGB-001 - API and geometry.** Use one native `Pressable` root and forward the caller's ref to it. There is no + `appearance` prop: the only appearance is Subtle. `size` is `small | medium | large` (default `medium`); `shape` + is `rounded | circular` (default `rounded`, including icon-only). Adopt the refreshed Button's size-specific + minimum heights 24/32/40, stroke-compensated padding, and icon sizes 16/20/20. These are minimum heights, not a + one-line clamp. Do not inherit the legacy Button's implicit circle or square option. +- **TGB-002 - Selection.** `selected` is controlled when supplied, including `false`; otherwise `defaultSelected` + seeds the value once (default `false`). An accepted activation requests `onSelectedChange(next: boolean)` once. + A controlled value does not change until the caller supplies it. `disabled` defaults to `false` and suppresses + every activation route, not the current value. +- **TGB-003 - Slots.** `content` selects the labeled layout. Render optional `leadingIcon`, content, then optional + `trailingIcon`. `selectedLeadingIcon` and `selectedTrailingIcon` replace the respective normal icon while selected; + an absent replacement retains its normal icon. Without content, require one named leading icon and do not accept + either trailing slot. Do not manufacture icon artwork. Reserve the stronger label weight in both states so toggling + does not reflow adjacent controls; the reservation is private and inaccessible. +- **TGB-004 - Visuals.** Reuse the refreshed Button's Subtle layout and unselected visuals. The + [token companion](spec/tokens.json) defines the **selection-specific** bindings, not a second Button geometry + table. Selected uses a soft neutral fill, primary neutral foreground and semibold label. Disabled selected uses + disabled fill and foreground. Resolve disabled before pressed, hovered and rest; selection remains independent. + Use the effective foreground for both icons unless overridden by the caller. Apply component defaults before + theme overrides and caller visuals last. Selection and icon changes are immediate, including under reduced motion. + Qualify an identifiable selected boundary in high contrast separately from focus. +- **TGB-005 - Semantics and input.** Expose one button with a stable accessible name and explicit boolean checked + state. Pointer, Enter/Space and the platform Toggle action each request one transition. Forward native events on + their respective paths; do not synthesize a press from an assistive action. Disabled is announced and not + focusable. Follow the [shared focus policy](../../../references/higher-order-components.md#focus-visual-policy) + on the actual root without moving focus on selection. +- **TGB-006 - Migration.** Keep the existing [Button](../button/SPEC.md) usable until ToggleButton is implemented, + exported, qualified and a migration is available. The [migration examples](spec/usage.md) distinguish Subtle from + non-Subtle callers and remove the old manual double-toggle risk. There is no silent replacement for Primary, + Secondary, Outline, or square toggles. + +## Platform behavior + +Target Windows Fabric, Office Win32, and macOS Fabric and Paper. Button's existing native evidence informs the +design; it does not qualify ToggleButton. The [accessibility companion](spec/accessibility.md) identifies separate +UIA and AX checks, including where the current macOS button role has no verified checked-state read. No mobile +behavior or endpoint qualification is claimed. + +## Divergences from Flex + +- `toggle-button-release-appearance`: the locked 1.5 catalog includes four appearances. The owner chose the + promoted 1.7 Subtle-only model. `flex-component` identifies the package lock; `flex-promoted` identifies the five + directly verified promoted files governing this proposal. The promotion records Enterprise X3 commit + `34d42dee014daed6fe4cd4580bb9e7d526a4cf63`; independent verification there and package-wide repinning remain + outstanding. Do not substitute the GitHub.com mirror HEAD. +- `toggle-button-native-state`: expose the native button/checked and Toggle-action contract rather than a browser + pressed attribute. Actual assistive announcement and invocation are release gates. +- `native-system-focus-visuals`: retain native rings on Windows/macOS and root-modality-aware custom focus on Win32. + Icon-only naming is required; requiring a visible Tooltip is deferred separately from naming. + +## Conformance + +The interface, slot model and native adaptation have had owner review. The contract remains a draft pending source +reconciliation. Only the types and selected token definition are scaffolded; stage signatures are not runnable +components. Do not register a story or add a package export until a real implementation exists. + +| Requirement | Planned implementation and evidence | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| TGB-001, TGB-003 | Type checks for both layouts, forbidden legacy props, native ref; runtime slot order, fallback, wrap and width reservation. | +| TGB-002 | Controlled rejection, uncontrolled toggles, prop changes without notification, disabled suppression, and callback counts. | +| TGB-004 | Test the JSON overlay independently and with refreshed Button. Check theme overrides, caller precedence, high contrast and reduced motion. | +| TGB-005 | Test press and semantic action separately; qualify checked state, accessible name, focus, and one transition per actual input on each desktop endpoint. | +| TGB-006 | Exercise the controlled and uncontrolled replacement in a consumer; audit non-Subtle and square callers before removing legacy props. | diff --git a/packages/agentic/components/src/components/toggle-button/renderToggleButton.tsx b/packages/agentic/components/src/components/toggle-button/renderToggleButton.tsx new file mode 100644 index 0000000000..cf14145f59 --- /dev/null +++ b/packages/agentic/components/src/components/toggle-button/renderToggleButton.tsx @@ -0,0 +1,5 @@ +import type { ReactElement } from 'react'; +import type { ToggleButtonState } from './toggle-button.types'; + +/** Render-stage handoff: order resolved slots without hooks; reserve the selected label's width in both states. */ +export type RenderToggleButton = (state: ToggleButtonState) => ReactElement; diff --git a/packages/agentic/components/src/components/toggle-button/spec/accessibility.md b/packages/agentic/components/src/components/toggle-button/spec/accessibility.md new file mode 100644 index 0000000000..f0a617b59b --- /dev/null +++ b/packages/agentic/components/src/components/toggle-button/spec/accessibility.md @@ -0,0 +1,18 @@ +# ToggleButton accessibility + +The root is the only focus and action target. Use its visible scalar label as the default name or respect an explicit +name or naming reference. Icon-only and rich content need a meaningful name; do not change the name when selection +changes. Icons and the private text used to reserve width are decorative. Preserve unrelated caller state and +custom actions, but the component owns its button role, disabled state and checked value in both directions. + +Use the [shared accessibility resolver](../../../../../../framework-base/references/accessibility.md) to declare +and match Toggle on the same renderer. Preserve caller action labels; do not equate discovery of an action with +successful invocation. Require a working name, state, and focus treatment in light, dark and high contrast. + +| Endpoint | Required evidence before Button migration | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Windows Fabric / Office Win32 | Invoke UIA Toggle; verify checked off/on, one callback, stable name, and disabled suppression. Qualify Narrator separately from UIA properties. | +| macOS Fabric / Paper | Check AX name/role, actual custom-action availability and invocation, and VoiceOver state announcement separately on each renderer. A listed action or ordinary AX press is not a successful Toggle; record unsupported checked projection explicitly. | + +Pointer and keyboard input require independent native evidence. Story or JavaScript assertions alone do not prove +any of the above. diff --git a/packages/agentic/components/src/components/toggle-button/spec/interaction.md b/packages/agentic/components/src/components/toggle-button/spec/interaction.md new file mode 100644 index 0000000000..1072c04e3b --- /dev/null +++ b/packages/agentic/components/src/components/toggle-button/spec/interaction.md @@ -0,0 +1,14 @@ +# ToggleButton interaction + +One enabled activation requests the inverse of the current selection. In controlled mode report the request but +keep rendering the prop, including when a parent declines to change it. In uncontrolled mode commit it and notify +once. Do not reapply `defaultSelected` on rerender or notify for a prop-driven change. + +Use the pressable's activation path for pointer and keyboard. Do not install an additional key-up toggle. +For a recognized accessibility Toggle, request the same change and forward the original accessibility event; +do not call the pointer handler. Other custom action events are forwarded without changing selection. +`onPress` may observe ordinary activation but is not a second selection owner. A disabled control must not change. + +Persistent selection survives release, pointer exit and blur; temporary pressed feedback does not. Do not move +focus on activation or intercept arrows owned by a parent toolbar. Apply the normal native focus policy independently +of selection. Keep the label, indicator swap and color changes immediate. diff --git a/packages/agentic/components/src/components/toggle-button/spec/source.json b/packages/agentic/components/src/components/toggle-button/spec/source.json new file mode 100644 index 0000000000..13ed1ee4a1 --- /dev/null +++ b/packages/agentic/components/src/components/toggle-button/spec/source.json @@ -0,0 +1,167 @@ +{ + "schemaVersion": 2, + "component": "toggle-button", + "lifecycle": "contract-draft", + "conformance": "review-required", + "reviewedAt": null, + "sources": [ + { + "id": "flex-component", + "kind": "flex-skill", + "authority": "normative", + "skill": "flex-components:toggle-button", + "sourceLock": "flex-1.5.0-206c4996", + "sourceLockFingerprint": "a69997212ec1b89510c94176801bf5a146ed7e7d8c80cc7db40ac8f60cf9f119", + "availableSurfaces": ["shared", "web"], + "surfacesConsulted": ["web"], + "sourceFiles": [ + { + "role": "skill", + "marketplacePath": "catalogs/flex/plugins/components/skills/toggle-button/SKILL.md", + "marketplaceBlobSha": "2a6659011d3e65300e0d79f308c17e8ffd19a4b5", + "marketplaceSha256": "c81e561485de4457c394231530e1638ea88dcb1b5c3f140920206c80da78aed0", + "originPath": "plugins/components/skills/toggle-button/SKILL.md", + "originBlobSha": "2a6659011d3e65300e0d79f308c17e8ffd19a4b5", + "originSha256": "c81e561485de4457c394231530e1638ea88dcb1b5c3f140920206c80da78aed0", + "contentDiffers": false + }, + { + "role": "usage", + "marketplacePath": "catalogs/flex/plugins/components/skills/toggle-button/usage.md", + "marketplaceBlobSha": "d3208839e1fb6dd607a324f2fa0d8915b69f8d75", + "marketplaceSha256": "40b3132772ec33bf018dd381a39e2687d955a65f7225a5f8c8a15fde24d316f6", + "originPath": "plugins/components/skills/toggle-button/usage.md", + "originBlobSha": "d3208839e1fb6dd607a324f2fa0d8915b69f8d75", + "originSha256": "40b3132772ec33bf018dd381a39e2687d955a65f7225a5f8c8a15fde24d316f6", + "contentDiffers": false + }, + { + "role": "web:accessibility", + "marketplacePath": "catalogs/flex/plugins/components/skills/toggle-button/web/accessibility.md", + "marketplaceBlobSha": "0a694389ad96b623de73c432b42347bfb557ea12", + "marketplaceSha256": "253c2468791971c8343e535c5ec5060183d98e3fa7823a9393062ceab2d0b683", + "originPath": "plugins/components/skills/toggle-button/web/accessibility.md", + "originBlobSha": "0a694389ad96b623de73c432b42347bfb557ea12", + "originSha256": "253c2468791971c8343e535c5ec5060183d98e3fa7823a9393062ceab2d0b683", + "contentDiffers": false + }, + { + "role": "web:interaction", + "marketplacePath": "catalogs/flex/plugins/components/skills/toggle-button/web/interaction.md", + "marketplaceBlobSha": "6c68faebab37782f7045a65d7dcaaf9c3a01d671", + "marketplaceSha256": "34dba59ff9784c520ca7ee679bec924bea71e67da5b5678b2d1baaff8d045035", + "originPath": "plugins/components/skills/toggle-button/web/interaction.md", + "originBlobSha": "6c68faebab37782f7045a65d7dcaaf9c3a01d671", + "originSha256": "34dba59ff9784c520ca7ee679bec924bea71e67da5b5678b2d1baaff8d045035", + "contentDiffers": false + }, + { + "role": "web:tokens", + "marketplacePath": "catalogs/flex/plugins/components/skills/toggle-button/web/tokens.yaml", + "marketplaceBlobSha": "762e79bfe6c63846c1356871fe83d390ce3d1713", + "marketplaceSha256": "b90437a4f46a07b5c6979e9fb57a0b9700511ecfef382b2a4d5ee70f34c73507", + "originPath": "plugins/components/skills/toggle-button/web/tokens.yaml", + "originBlobSha": "762e79bfe6c63846c1356871fe83d390ce3d1713", + "originSha256": "b90437a4f46a07b5c6979e9fb57a0b9700511ecfef382b2a4d5ee70f34c73507", + "contentDiffers": false + } + ], + "releaseDifferences": [] + }, + { + "id": "flex-promoted", + "kind": "git-files", + "authority": "normative", + "repository": "agency-microsoft/.github-private", + "commit": "9f1df394126dd9ad2339b786ab7dcc090131533c", + "files": [ + { + "role": "skill", + "path": "catalogs/flex/plugins/components/skills/toggle-button/SKILL.md", + "sha256": "33613c9f93fa0e1832676c66497a83dcfdb2b69921de348d39818600b2c042e4" + }, + { + "role": "usage", + "path": "catalogs/flex/plugins/components/skills/toggle-button/usage.md", + "sha256": "539c27673c2ba224f2c5d16c50a134599b1f443f1390fc6ac95b6ee381ff1462" + }, + { + "role": "web:accessibility", + "path": "catalogs/flex/plugins/components/skills/toggle-button/web/accessibility.md", + "sha256": "b8392f68e2fb7d06a95d3396af97dbb3ee7d057cff7acec783a05fd64fcb952a" + }, + { + "role": "web:interaction", + "path": "catalogs/flex/plugins/components/skills/toggle-button/web/interaction.md", + "sha256": "c04e9290ff15a41eb764842da5bc952a2b805b0788bea8fee96b2d1ca236a461" + }, + { + "role": "web:tokens", + "path": "catalogs/flex/plugins/components/skills/toggle-button/web/tokens.yaml", + "sha256": "62be3c8be92e5fdf1828a39e9528a790e233da66a104d39e96f9b305c6d7b468" + } + ] + }, + { + "id": "furn-button", + "kind": "git-files", + "authority": "compatibility-reference", + "repository": "microsoft/fluentui-react-native", + "commit": "9b450053009a6bbdccb6af1282aea68fe3ec444a", + "files": [ + { + "role": "contract", + "path": "packages/agentic/components/src/components/button/SPEC.md", + "sha256": "f0b077aab3819a3ef3ad03d6d4e3cabc2c7b22c563f46d72e6fe5e899c19b339" + }, + { + "role": "accessibility", + "path": "packages/agentic/components/src/components/button/spec/accessibility.md", + "sha256": "caadb8e9a588f765f93f02fe089844af27ef45b95fb7259de003ac973fa46b64" + }, + { + "role": "native:action-transport", + "path": "packages/framework-base/references/accessibility.md", + "sha256": "6a9815af2e008dcc71800e1be53dc011828091163c7758d80bcd36025d3cc0b1" + } + ] + } + ], + "divergences": [ + { "id": "toggle-button-release-appearance", "status": "aligning" }, + { "id": "toggle-button-native-state", "status": "accepted" }, + { "id": "native-system-focus-visuals", "status": "accepted" } + ], + "requirements": [ + { + "id": "TGB-001", + "sources": ["flex-component", "flex-promoted", "furn-button"], + "evidence": ["toggle-button.types.ts"], + "plannedEvidence": ["toggle-button.test.tsx"] + }, + { "id": "TGB-002", "sources": ["flex-promoted", "furn-button"], "plannedEvidence": ["useToggleButton.ts", "toggle-button.test.tsx"] }, + { + "id": "TGB-003", + "sources": ["flex-promoted", "furn-button"], + "evidence": ["toggle-button.types.ts"], + "plannedEvidence": ["renderToggleButton.tsx", "toggle-button.test.tsx"] + }, + { + "id": "TGB-004", + "sources": ["flex-promoted"], + "evidence": ["spec/tokens.json", "toggle-button.styles.ts", "toggle-button.scaffold.test.ts"], + "plannedEvidence": ["useToggleButtonStyles.ts", "toggle-button.stories.tsx"] + }, + { + "id": "TGB-005", + "sources": ["flex-promoted", "furn-button"], + "plannedEvidence": ["toggle-button.test.tsx", "toggle-button.wdio.ts"] + }, + { + "id": "TGB-006", + "sources": ["flex-component", "flex-promoted", "furn-button"], + "evidence": ["spec/usage.md"], + "plannedEvidence": ["toggle-button.stories.tsx"] + } + ] +} diff --git a/packages/agentic/components/src/components/toggle-button/spec/tokens.json b/packages/agentic/components/src/components/toggle-button/spec/tokens.json new file mode 100644 index 0000000000..d95669c247 --- /dev/null +++ b/packages/agentic/components/src/components/toggle-button/spec/tokens.json @@ -0,0 +1,31 @@ +{ + "schemaVersion": 2, + "component": "toggle-button", + "implementation": "toggle-button.styles.ts", + "axes": [ + ["selected", [false, true]], + ["visualState", ["rest", "hovered", "pressed", "disabled"]] + ], + "bindings": { + "root": { + "when.selected.true": { + "backgroundColor": "tokens:color.backgroundNeutralSoft.active", + "borderColor": "transparent", + "when.visualState.disabled": { "backgroundColor": "tokens:color.backgroundNeutralSubtleDisabled.rest" } + } + }, + "content": { + "when.selected.true": { + "color": "tokens:color.foregroundNeutralPrimary.active", + "fontWeight": "tokens:fontWeight.functionalSemibold", + "when.visualState.disabled": { "color": "tokens:color.foregroundNeutralDisabled.rest" } + } + } + }, + "tokenGaps": [ + { + "binding": "root.borderColor", + "detail": "Selected needs a distinguishable high-contrast boundary. Qualify the native system-color mapping before claiming high-contrast support." + } + ] +} diff --git a/packages/agentic/components/src/components/toggle-button/spec/usage.md b/packages/agentic/components/src/components/toggle-button/spec/usage.md new file mode 100644 index 0000000000..134b44a878 --- /dev/null +++ b/packages/agentic/components/src/components/toggle-button/spec/usage.md @@ -0,0 +1,23 @@ +# ToggleButton migration + +These are examples of the intended API, not imports available in this package yet. +Use ToggleButton for a persistent option, Button for a one-time command, and Switch for a settings control. + +```tsx +// Existing Subtle Button; its caller currently changes the value from onPress. +