# Bone Flow #035 Switch Specification v1.0

Component ID: #035  
Component: Switch  
Implementation: v1.0.6  
Status: Development / Browser Runtime NOT RUN

## 1. Source boundary

`000-Development-Order_v1.1.1.md` defines #035 Switch as the next Input UI, but does not define detailed Switch-specific Properties. This v1.0.6 therefore keeps the formally completed Input UI common structure from #033 Checkbox v1.0.30 and the corrected dependency/runtime path confirmed in #034 Radio v1.0.33, while separating the Switch-specific rendering and public naming. It is not Completed until user localhost Runtime QA passes.

## 2. Switch v1.0.6 contract

- Bone type: `SWITCH`
- Bone value: boolean `true` / `false`
- Public state naming: `value` / `on`
- Native control: `input[type=checkbox]` used only as the accessible binary input primitive, with `role="switch"`
- Visual: Switch-specific track + thumb; not a Checkbox glyph
- `getOn()` / `setOn()` are provided in addition to common `getValue()` / `setValue()`
- string / number / object values are not implicitly coerced to boolean

## 3. Editing / commit

- `editingValue` and `committedValue` are separate
- user change commits when `changeCommit=true`
- `required=true` requires ON (`true`)
- `readonly` and `disabled` block user commit
- `Bone.value` is updated only by a valid commit

## 4. Common Input UI surface retained

- Japanese / English Property display
- Theme: default / dark / light / neon
- Background / Appearance
- Parent dependency
- width / height
- 9-way position; default `top-left`
- input alignment
- Active Border Effect / color / direction / speed
- Active Border Effect is applied only while the Switch has focus (`.is-focused`); ON/OFF value does not trigger the Effect
- #020 Bone Label delegation with label gap / font size linkage
- independent Security Test
- #002 Joint connection image
- WAIT / BLOCKED
- Smoke / Validation
- JSON / Markdown Runtime Report
- Completion gate

## 5. Formal dependencies

- #001 Bone Core v1.0.0: `BoneCore.normalize()`
- #002 Bone Joint v1.1.36: `BoneJoint.createDeliveryChannel()`
- #020 Bone Label: `BoneLabel.create()` / `BoneLabel.getOutput()`
- #017 Bone Text: used through #020 Label
- #022 Bone Hover Border Effect v1.0.1: Active Border Effect rendering

The Component does not implement a private delivery queue/retry path and does not use a non-existent `send()` API.

## 6. Security / Untrusted IN

- plain-data inspection only
- getter/setter payload properties are rejected
- unsafe Proxy/property inspection is rejected
- rejected input preserves the committed value
- Security rejection exposes code / message / result without modifying normal Preview state

## 7. OUT WAIT / BLOCKED

`commit -> #002 createDeliveryChannel()` is the formal delivery path.

- READY: deliver immediately
- WAITING: #002 FIFO queue, deliver after Target READY
- BLOCKED: connection remains, unsafe value is not delivered

## 8. QA state at package creation

Package QA and Node QA may pass before Browser Runtime. They are not Browser Runtime PASS.

Browser Runtime: **NOT RUN**  
Completion: **false**


## Display Pattern v1.0.3

`displayPattern` は Switch 固有の表示パターンを選択する。デフォルトは `standard` で、v1.0.1 の Track + 丸Thumb表示を維持する。

- `standard` — 現状の Track + 丸Thumb（デフォルト）
- `soft-rounded` — 角丸弱め
- `text` — ON / OFF文字入り
- `icon` — 状態アイコン入り
- `button` — ボタン型

`appearance` Property は v1.0.3 で削除する。表示外観の違いは `displayPattern` が担当する。Theme、背景色、9方向配置、Parent Dependency、Active Border Effect、Label、Security、WAIT/BLOCKED の責務は変更しない。


## v1.0.3 correction

- `appearance` Property removed.
- Standard / soft-rounded / text / icon track patterns use one track/thumb geometry source; ON thumb reaches the right inset consistently.
- Button pattern has no moving thumb and always renders `OFF` / `ON` text according to editing state.


## v1.0.4 correction

- `theme=neon` + `displayPattern=button` + ON のとき、button固有OFF背景指定が一般の`:checked`背景を上書きしていたため、ON文字が見えなくなる状態を修正。
- Standalone button の`:checked`背景を `--bsw-accent` に固定し、Parent Dependency のchecked背景経路は変更しない。

## v1.0.5 correction

- Browser Smoke `S16B` now verifies the `standard` option's default-selected contract instead of the user's current selection.
- Browser Validation `V13` no longer calls `getOptions()` on an instance after `destroy()`; it validates `appearance` removal through `defaults()` and `normalizeOptions({})`.
- No Switch runtime behavior, Property, or CSS contract was changed.


## v1.0.6 Active Border Effect delegation

- Active Border Effect rendering is delegated to completed #022 Bone Hover Border Effect v1.0.1.
- #035 remains responsible for deciding Active state: input focus sets Active ON; blur sets Active OFF.
- ON/OFF value, `checked`, and `value=true` do not activate the effect.
- Supported delegated effects: `normal` / `neon` / `spin` / `cross` / `blink`.
- Effect color / direction / speed are passed to #022.
- Existing Switch-specific value, displayPattern, Label, Security, Joint WAIT/BLOCKED, connection-image and Completion contracts are unchanged.
