@weasel-js/ui 1.6.0 → 1.6.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.
Files changed (438) hide show
  1. package/dist/chunks/{ActionBar-CYvfmEz0.js → ActionBar-DCq16yFA.js} +9 -9
  2. package/dist/chunks/ActionBar-DCq16yFA.js.map +1 -0
  3. package/dist/chunks/{Badge-DZ0lFs14.js → Badge-CyAIZSDo.js} +151 -151
  4. package/dist/chunks/Badge-CyAIZSDo.js.map +1 -0
  5. package/dist/chunks/{BandEditor-D-nVrVO4.js → BandEditor-Dhm_Xrlr.js} +5 -4
  6. package/dist/chunks/BandEditor-Dhm_Xrlr.js.map +1 -0
  7. package/dist/chunks/{Button-Dyp31jMt.js → Button-BIdXHQOx.js} +3 -3
  8. package/dist/chunks/Button-BIdXHQOx.js.map +1 -0
  9. package/dist/chunks/{ButtonBar-smZzFuEo.js → ButtonBar-D5Vi0aj_.js} +4 -4
  10. package/dist/chunks/ButtonBar-D5Vi0aj_.js.map +1 -0
  11. package/dist/chunks/{Callout-xLjnx7Mp.js → Callout-yEn9iPlh.js} +4 -4
  12. package/dist/chunks/Callout-yEn9iPlh.js.map +1 -0
  13. package/dist/chunks/{Checkbox-ChZz30Ds.js → Checkbox-DHXTUHO9.js} +1 -1
  14. package/dist/chunks/Checkbox-DHXTUHO9.js.map +1 -0
  15. package/dist/chunks/{Code-v4tDWuuN.js → Code-AsKpgnv6.js} +3 -3
  16. package/dist/chunks/Code-AsKpgnv6.js.map +1 -0
  17. package/dist/chunks/{ColorField-DJSCuSJv.js → ColorField-BcMcW8Sa.js} +3 -3
  18. package/dist/chunks/ColorField-BcMcW8Sa.js.map +1 -0
  19. package/dist/chunks/{ColorModeControl-JOEiqtE0.js → ColorModeControl-ke5PXbBa.js} +3 -3
  20. package/dist/chunks/ColorModeControl-ke5PXbBa.js.map +1 -0
  21. package/dist/chunks/{ComboBox-C1JgIpML.js → ComboBox-DpT8lc3p.js} +3 -3
  22. package/dist/chunks/ComboBox-DpT8lc3p.js.map +1 -0
  23. package/dist/chunks/{CurveEditor-f1R4kSbD.js → CurveEditor-BDJXjEvK.js} +35 -35
  24. package/dist/chunks/CurveEditor-BDJXjEvK.js.map +1 -0
  25. package/dist/chunks/{DataGrid-CZPrB_3a.js → DataGrid-D-dZj1BD.js} +13 -13
  26. package/dist/chunks/DataGrid-D-dZj1BD.js.map +1 -0
  27. package/dist/chunks/{DetailList-DHaXX4TG.js → DetailList-BMER1LUZ.js} +1 -1
  28. package/dist/chunks/DetailList-BMER1LUZ.js.map +1 -0
  29. package/dist/chunks/{DetentSlider-BYyaZha6.js → DetentSlider-CL8TlX3S.js} +2 -2
  30. package/dist/chunks/DetentSlider-CL8TlX3S.js.map +1 -0
  31. package/dist/chunks/{Dialog-GIvjoDQj.js → Dialog-BWyNMgpf.js} +3 -3
  32. package/dist/chunks/Dialog-BWyNMgpf.js.map +1 -0
  33. package/dist/chunks/{Disclosure-D79jhmh2.js → Disclosure-0G0uh2fa.js} +1 -1
  34. package/dist/chunks/Disclosure-0G0uh2fa.js.map +1 -0
  35. package/dist/chunks/{DragGhost-DcU7cOwy.js → DragGhost-B5_hb9W9.js} +2 -2
  36. package/dist/chunks/DragGhost-B5_hb9W9.js.map +1 -0
  37. package/dist/chunks/{DragHandleGlyph-BtBxHjZS.js → DragHandleGlyph-Dr7Fgo0I.js} +1 -1
  38. package/dist/chunks/DragHandleGlyph-Dr7Fgo0I.js.map +1 -0
  39. package/dist/chunks/{Field-xbqRmjsI.js → Field--onYxXTF.js} +7 -6
  40. package/dist/chunks/Field--onYxXTF.js.map +1 -0
  41. package/dist/chunks/{FillStrokeSwatch-BViKXIPx.js → FillStrokeSwatch-DNb0KXPk.js} +11 -11
  42. package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js.map +1 -0
  43. package/dist/chunks/{FontFamilySelect-r9TV_xIH.js → FontFamilySelect-DXlMKWfK.js} +2 -2
  44. package/dist/chunks/FontFamilySelect-DXlMKWfK.js.map +1 -0
  45. package/dist/chunks/{GradientEditor-BRTxHG-W.js → GradientEditor-B3a-MsVJ.js} +8 -6
  46. package/dist/chunks/GradientEditor-B3a-MsVJ.js.map +1 -0
  47. package/dist/chunks/{Icon-BW0qv_U7.js → Icon-Cgzy8VgC.js} +2 -2
  48. package/dist/chunks/Icon-Cgzy8VgC.js.map +1 -0
  49. package/dist/chunks/{InlineRange-BwGFDhpT.js → InlineRange-eOj6JpJl.js} +1 -1
  50. package/dist/chunks/InlineRange-eOj6JpJl.js.map +1 -0
  51. package/dist/chunks/{Input-Bx2cuUbS.js → Input-CHmkfYaD.js} +2 -2
  52. package/dist/chunks/Input-CHmkfYaD.js.map +1 -0
  53. package/dist/chunks/{ItemList-DzJ2lK0R.js → ItemList-Cm-HUWCi.js} +6 -7
  54. package/dist/chunks/ItemList-Cm-HUWCi.js.map +1 -0
  55. package/dist/chunks/{ItemList.module-DDUXfuZL.js → ItemList.module-BSpCSxan.js} +1 -1
  56. package/dist/chunks/ItemList.module-BSpCSxan.js.map +1 -0
  57. package/dist/chunks/{Jog-LPoac9s4.js → Jog-DESxZ44P.js} +4 -4
  58. package/dist/chunks/Jog-DESxZ44P.js.map +1 -0
  59. package/dist/chunks/{Keycaps-CKiKOJnJ.js → Keycaps-C0H_v2gO.js} +2 -2
  60. package/dist/chunks/Keycaps-C0H_v2gO.js.map +1 -0
  61. package/dist/chunks/{LayerList-BeGrkLb9.js → LayerList-nz-QYvTF.js} +14 -14
  62. package/dist/chunks/LayerList-nz-QYvTF.js.map +1 -0
  63. package/dist/chunks/{ListEditor-C6zLzCsJ.js → ListEditor-BQ6AV3Ac.js} +2 -2
  64. package/dist/chunks/ListEditor-BQ6AV3Ac.js.map +1 -0
  65. package/dist/chunks/{MenuButton-BcdhrNGh.js → MenuButton-DtaGenKf.js} +3 -3
  66. package/dist/chunks/MenuButton-DtaGenKf.js.map +1 -0
  67. package/dist/chunks/{MeshEditor-BOOIFWnz.js → MeshEditor-qqGc6hlD.js} +4 -4
  68. package/dist/chunks/MeshEditor-qqGc6hlD.js.map +1 -0
  69. package/dist/chunks/{NumberField-C1Y7zP-a.js → NumberField-CwJOMmQR.js} +3 -3
  70. package/dist/chunks/NumberField-CwJOMmQR.js.map +1 -0
  71. package/dist/chunks/{OptionsBar-DlcagPYK.js → OptionsBar-DbzAgIln.js} +3 -3
  72. package/dist/chunks/OptionsBar-DbzAgIln.js.map +1 -0
  73. package/dist/chunks/{PaintField-B2mLRZa4.js → PaintField-DaJukRc6.js} +4 -4
  74. package/dist/chunks/PaintField-DaJukRc6.js.map +1 -0
  75. package/dist/chunks/{PaintInput-BFKhd83I.js → PaintInput-Byhna3H-.js} +7 -7
  76. package/dist/chunks/PaintInput-Byhna3H-.js.map +1 -0
  77. package/dist/chunks/{PatternPicker-DdfpxoQy.js → PatternPicker-B-cUt-JT.js} +2 -2
  78. package/dist/chunks/PatternPicker-B-cUt-JT.js.map +1 -0
  79. package/dist/chunks/{Plot2D-lyO7waPQ.js → Plot2D-CTXHkL5p.js} +13 -13
  80. package/dist/chunks/Plot2D-CTXHkL5p.js.map +1 -0
  81. package/dist/chunks/{PointPlotter-DGs9i5P-.js → PointPlotter-Bxo6haKe.js} +5 -4
  82. package/dist/chunks/PointPlotter-Bxo6haKe.js.map +1 -0
  83. package/dist/chunks/Powerline-ExO5GwEr.js +42 -0
  84. package/dist/chunks/Powerline-ExO5GwEr.js.map +1 -0
  85. package/dist/chunks/{Prefs-Ctu0H4-b.js → Prefs-DpqFKiwY.js} +18 -17
  86. package/dist/chunks/Prefs-DpqFKiwY.js.map +1 -0
  87. package/dist/chunks/{Properties-Bbneh1ws.js → Properties-D_KzDN9K.js} +13 -12
  88. package/dist/chunks/Properties-D_KzDN9K.js.map +1 -0
  89. package/dist/chunks/{PropertyField-CDb19d3F.js → PropertyField-DGCecAnV.js} +22 -20
  90. package/dist/chunks/PropertyField-DGCecAnV.js.map +1 -0
  91. package/dist/chunks/{RadioGroup-BK2mD6Q0.js → RadioGroup-Bh4-12e-.js} +2 -2
  92. package/dist/chunks/RadioGroup-Bh4-12e-.js.map +1 -0
  93. package/dist/chunks/{RangeSlider-BiRAOsTh.js → RangeSlider-BKRRTPTZ.js} +1 -1
  94. package/dist/chunks/RangeSlider-BKRRTPTZ.js.map +1 -0
  95. package/dist/chunks/{ResizeHandle-Cc6EOehs.js → ResizeHandle-BKT0XYpx.js} +7 -7
  96. package/dist/chunks/ResizeHandle-BKT0XYpx.js.map +1 -0
  97. package/dist/chunks/{Select-DVValBe1.js → Select-CzyfaXzp.js} +4 -4
  98. package/dist/chunks/Select-CzyfaXzp.js.map +1 -0
  99. package/dist/chunks/{SelectionPanel-C5LmZA7b.js → SelectionPanel-BgUM1h03.js} +2 -2
  100. package/dist/chunks/SelectionPanel-BgUM1h03.js.map +1 -0
  101. package/dist/chunks/{Sidebar-DKKd4R-x.js → Sidebar-BZ0m4afn.js} +8 -8
  102. package/dist/chunks/Sidebar-BZ0m4afn.js.map +1 -0
  103. package/dist/chunks/{SidebarPanel-u5NsuAZY.js → SidebarPanel-aoIqxbtq.js} +3 -3
  104. package/dist/chunks/SidebarPanel-aoIqxbtq.js.map +1 -0
  105. package/dist/chunks/{Slider-BwRrWHFW.js → Slider-CFwQYQ10.js} +60 -58
  106. package/dist/chunks/Slider-CFwQYQ10.js.map +1 -0
  107. package/dist/chunks/{StatusBar-CdPdmmda.js → StatusBar-DzoPDY4k.js} +8 -8
  108. package/dist/chunks/StatusBar-DzoPDY4k.js.map +1 -0
  109. package/dist/chunks/{SwatchGrid-C-Zx2Exd.js → SwatchGrid-BARC3rnF.js} +1 -1
  110. package/dist/chunks/SwatchGrid-BARC3rnF.js.map +1 -0
  111. package/dist/chunks/{Switch-DxF7TsEu.js → Switch-CSYmcM8y.js} +1 -1
  112. package/dist/chunks/Switch-CSYmcM8y.js.map +1 -0
  113. package/dist/chunks/{Tabs-GXEfoe3o.js → Tabs-BbpzLLdY.js} +1 -1
  114. package/dist/chunks/Tabs-BbpzLLdY.js.map +1 -0
  115. package/dist/chunks/{Timeline-SgmpQtUV.js → Timeline--58F7MED.js} +21 -21
  116. package/dist/chunks/Timeline--58F7MED.js.map +1 -0
  117. package/dist/chunks/{Toast-BfcljZz6.js → Toast-DNBb-24H.js} +1 -1
  118. package/dist/chunks/Toast-DNBb-24H.js.map +1 -0
  119. package/dist/chunks/{ToggleBar-Btnl5r7F.js → ToggleBar-DTjGeS0Q.js} +13 -11
  120. package/dist/chunks/ToggleBar-DTjGeS0Q.js.map +1 -0
  121. package/dist/chunks/{TokenPanel-5ajHEHha.js → TokenPanel-CMq7uydV.js} +21 -18
  122. package/dist/chunks/TokenPanel-CMq7uydV.js.map +1 -0
  123. package/dist/chunks/{ToolButton-rzqlFlAc.js → ToolButton-CR4sQlxF.js} +2 -2
  124. package/dist/chunks/ToolButton-CR4sQlxF.js.map +1 -0
  125. package/dist/chunks/{ToolGroup-4bUBV5k6.js → ToolGroup-Dpg1LN0l.js} +7 -7
  126. package/dist/chunks/ToolGroup-Dpg1LN0l.js.map +1 -0
  127. package/dist/chunks/{ToolOptionsBar-BF3TNXA3.js → ToolOptionsBar-CtzTlaN2.js} +6 -5
  128. package/dist/chunks/ToolOptionsBar-CtzTlaN2.js.map +1 -0
  129. package/dist/chunks/{ToolPalette-Uw4PvWwa.js → ToolPalette-CKG9qY6P.js} +6 -6
  130. package/dist/chunks/ToolPalette-CKG9qY6P.js.map +1 -0
  131. package/dist/chunks/{Tooltip-9XiJF937.js → Tooltip-Clg2mhSt.js} +2 -2
  132. package/dist/chunks/Tooltip-Clg2mhSt.js.map +1 -0
  133. package/dist/chunks/{Tree-BGt6P8tI.js → Tree-DVOtc9R5.js} +3 -3
  134. package/dist/chunks/Tree-DVOtc9R5.js.map +1 -0
  135. package/dist/chunks/{createKeyframeLayer-BzDRCrrh.js → createKeyframeLayer-Czj6Y235.js} +32 -32
  136. package/dist/chunks/createKeyframeLayer-Czj6Y235.js.map +1 -0
  137. package/dist/chunks/{dlog-CMYiRF3Q.js → dlog-F0I8KsIW.js} +2 -2
  138. package/dist/chunks/dlog-F0I8KsIW.js.map +1 -0
  139. package/dist/chunks/{formatShortcut-BoGqUoWi.js → formatShortcut-DRQrVThu.js} +2 -2
  140. package/dist/chunks/formatShortcut-DRQrVThu.js.map +1 -0
  141. package/dist/chunks/icons-Dk8SRS8g.js +162 -0
  142. package/dist/chunks/icons-Dk8SRS8g.js.map +1 -0
  143. package/dist/chunks/{interactiveTarget-C7QUBaJN.js → interactiveTarget-BNZmTow2.js} +1 -1
  144. package/dist/chunks/{interactiveTarget-C7QUBaJN.js.map → interactiveTarget-BNZmTow2.js.map} +1 -1
  145. package/dist/chunks/{keyGlyph-CLvUHU8c.js → keyGlyph-C0qTakG-.js} +1 -1
  146. package/dist/chunks/keyGlyph-C0qTakG-.js.map +1 -0
  147. package/dist/chunks/{model-BQMvTLnW.js → model-Du7Lta4C.js} +5 -5
  148. package/dist/chunks/model-Du7Lta4C.js.map +1 -0
  149. package/dist/chunks/{number-6S8IzXVt.js → number-D3NEx_8r.js} +1 -1
  150. package/dist/chunks/number-D3NEx_8r.js.map +1 -0
  151. package/dist/chunks/{paintPreview-DPtZS4yU.js → paintPreview-CuSZiHpR.js} +1 -1
  152. package/dist/chunks/paintPreview-CuSZiHpR.js.map +1 -0
  153. package/dist/chunks/{paintValue-Bz6AVuh3.js → paintValue-BpaGPjV3.js} +3 -3
  154. package/dist/chunks/paintValue-BpaGPjV3.js.map +1 -0
  155. package/dist/chunks/{portalHost-CjpCnuGU.js → portalHost-yTOVuCej.js} +1 -1
  156. package/dist/chunks/portalHost-yTOVuCej.js.map +1 -0
  157. package/dist/chunks/{prefField-CLkhrvYl.js → prefField-Dnl7nmjQ.js} +3 -3
  158. package/dist/chunks/prefField-Dnl7nmjQ.js.map +1 -0
  159. package/dist/chunks/{segmentTooltip-CAkZlW-t.js → segmentTooltip-CStYHKzd.js} +2 -2
  160. package/dist/chunks/segmentTooltip-CStYHKzd.js.map +1 -0
  161. package/dist/chunks/{segmentedControl.module-D2nw68Yo.js → segmentedControl.module-Bv7DEg8f.js} +1 -1
  162. package/dist/chunks/segmentedControl.module-Bv7DEg8f.js.map +1 -0
  163. package/dist/chunks/{snap-DC4Km8xG.js → snap-DRjbOiG9.js} +1 -1
  164. package/dist/chunks/snap-DRjbOiG9.js.map +1 -0
  165. package/dist/chunks/{stance-CarrcbbP.js → stance-BFQpS_fL.js} +1 -1
  166. package/dist/chunks/stance-BFQpS_fL.js.map +1 -0
  167. package/dist/chunks/{useReorderDragList-Dcezzgix.js → useReorderDragList-B_-5L5Gu.js} +2 -2
  168. package/dist/chunks/useReorderDragList-B_-5L5Gu.js.map +1 -0
  169. package/dist/chunks/{useRovingTabIndex-B4uJqiKP.js → useRovingTabIndex-Bp_hYm_h.js} +1 -1
  170. package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js.map +1 -0
  171. package/dist/components/ActionBar/ActionBar.d.ts +1 -1
  172. package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
  173. package/dist/components/ActionBar/index.js +1 -1
  174. package/dist/components/Badge/index.js +1 -1
  175. package/dist/components/BandEditor/index.js +1 -1
  176. package/dist/components/Button/index.js +1 -1
  177. package/dist/components/ButtonBar/index.js +1 -1
  178. package/dist/components/Callout/Callout.d.ts +1 -1
  179. package/dist/components/Callout/Callout.d.ts.map +1 -1
  180. package/dist/components/Callout/index.js +1 -1
  181. package/dist/components/Checkbox/index.js +1 -1
  182. package/dist/components/Code/Code.d.ts +1 -1
  183. package/dist/components/Code/Code.d.ts.map +1 -1
  184. package/dist/components/Code/index.js +1 -1
  185. package/dist/components/ColorField/ColorField.d.ts +1 -1
  186. package/dist/components/ColorField/ColorField.d.ts.map +1 -1
  187. package/dist/components/ColorField/index.js +1 -1
  188. package/dist/components/ColorModeControl/index.js +1 -1
  189. package/dist/components/ComboBox/ComboBox.d.ts +2 -2
  190. package/dist/components/ComboBox/ComboBox.d.ts.map +1 -1
  191. package/dist/components/ComboBox/index.js +1 -1
  192. package/dist/components/CurveEditor/CurveEditor.d.ts +1 -1
  193. package/dist/components/CurveEditor/CurveEditor.d.ts.map +1 -1
  194. package/dist/components/CurveEditor/LayeredCurveEditor.d.ts +1 -1
  195. package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -1
  196. package/dist/components/CurveEditor/index.js +3 -3
  197. package/dist/components/DataGrid/DataGrid.d.ts +1 -1
  198. package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
  199. package/dist/components/DataGrid/index.js +1 -1
  200. package/dist/components/DetailList/DetailList.d.ts +2 -2
  201. package/dist/components/DetailList/DetailList.d.ts.map +1 -1
  202. package/dist/components/DetailList/index.js +1 -1
  203. package/dist/components/DetentSlider/index.js +1 -1
  204. package/dist/components/Dialog/Dialog.d.ts +1 -1
  205. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  206. package/dist/components/Dialog/index.js +1 -1
  207. package/dist/components/Disclosure/Disclosure.d.ts +3 -3
  208. package/dist/components/Disclosure/Disclosure.d.ts.map +1 -1
  209. package/dist/components/Disclosure/index.js +1 -1
  210. package/dist/components/DragGhost/index.js +1 -1
  211. package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts +1 -1
  212. package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts.map +1 -1
  213. package/dist/components/DragHandleGlyph/index.js +1 -1
  214. package/dist/components/Field/Field.d.ts +1 -1
  215. package/dist/components/Field/Field.d.ts.map +1 -1
  216. package/dist/components/Field/index.js +1 -1
  217. package/dist/components/FillStrokeSwatch/index.js +1 -1
  218. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts +1 -1
  219. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts.map +1 -1
  220. package/dist/components/FontFamilySelect/index.js +1 -1
  221. package/dist/components/GradientEditor/index.js +1 -1
  222. package/dist/components/InlineRange/index.js +1 -1
  223. package/dist/components/Input/index.js +1 -1
  224. package/dist/components/ItemList/index.js +1 -1
  225. package/dist/components/Jog/Jog.d.ts +1 -1
  226. package/dist/components/Jog/Jog.d.ts.map +1 -1
  227. package/dist/components/Jog/index.js +1 -1
  228. package/dist/components/Keycaps/Keycap.d.ts +1 -1
  229. package/dist/components/Keycaps/Keycap.d.ts.map +1 -1
  230. package/dist/components/Keycaps/Keycaps.d.ts +1 -1
  231. package/dist/components/Keycaps/Keycaps.d.ts.map +1 -1
  232. package/dist/components/Keycaps/index.js +2 -2
  233. package/dist/components/LayerList/LayerList.d.ts +1 -1
  234. package/dist/components/LayerList/LayerList.d.ts.map +1 -1
  235. package/dist/components/LayerList/index.js +1 -1
  236. package/dist/components/ListEditor/ListEditor.d.ts +1 -1
  237. package/dist/components/ListEditor/ListEditor.d.ts.map +1 -1
  238. package/dist/components/ListEditor/index.js +1 -1
  239. package/dist/components/MenuButton/MenuButton.d.ts +1 -1
  240. package/dist/components/MenuButton/MenuButton.d.ts.map +1 -1
  241. package/dist/components/MenuButton/index.js +1 -1
  242. package/dist/components/MeshEditor/index.js +1 -1
  243. package/dist/components/NumberField/UnitField.d.ts +1 -1
  244. package/dist/components/NumberField/UnitField.d.ts.map +1 -1
  245. package/dist/components/NumberField/index.js +1 -1
  246. package/dist/components/OptionsBar/index.js +1 -1
  247. package/dist/components/PaintField/index.js +1 -1
  248. package/dist/components/PaintInput/index.js +1 -1
  249. package/dist/components/PatternPicker/index.js +1 -1
  250. package/dist/components/Plot2D/index.js +1 -1
  251. package/dist/components/PointPlotter/PointPlotter.d.ts +1 -1
  252. package/dist/components/PointPlotter/PointPlotter.d.ts.map +1 -1
  253. package/dist/components/PointPlotter/index.js +1 -1
  254. package/dist/components/Powerline/Powerline.d.ts +1 -1
  255. package/dist/components/Powerline/Powerline.d.ts.map +1 -1
  256. package/dist/components/Powerline/index.js +2 -2
  257. package/dist/components/Prefs/PrefsDialog.d.ts +1 -1
  258. package/dist/components/Prefs/PrefsDialog.d.ts.map +1 -1
  259. package/dist/components/Prefs/PrefsForm.d.ts +1 -1
  260. package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
  261. package/dist/components/Prefs/PrefsPane.d.ts +1 -1
  262. package/dist/components/Prefs/PrefsPane.d.ts.map +1 -1
  263. package/dist/components/Prefs/PrefsRail.d.ts +1 -1
  264. package/dist/components/Prefs/PrefsRail.d.ts.map +1 -1
  265. package/dist/components/Prefs/PrefsRow.d.ts +1 -1
  266. package/dist/components/Prefs/PrefsRow.d.ts.map +1 -1
  267. package/dist/components/Prefs/index.js +2 -2
  268. package/dist/components/Properties/CurveField.d.ts +1 -1
  269. package/dist/components/Properties/CurveField.d.ts.map +1 -1
  270. package/dist/components/Properties/DialogRow.d.ts +1 -1
  271. package/dist/components/Properties/DialogRow.d.ts.map +1 -1
  272. package/dist/components/Properties/PropertyField.d.ts +2 -2
  273. package/dist/components/Properties/PropertyField.d.ts.map +1 -1
  274. package/dist/components/Properties/PropertyGroup.d.ts +1 -1
  275. package/dist/components/Properties/PropertyGroup.d.ts.map +1 -1
  276. package/dist/components/Properties/PropertyPanel.d.ts +4 -4
  277. package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
  278. package/dist/components/Properties/Subpanel.d.ts +1 -1
  279. package/dist/components/Properties/Subpanel.d.ts.map +1 -1
  280. package/dist/components/Properties/index.js +2 -2
  281. package/dist/components/Properties/storyLayouts.d.ts +1 -1
  282. package/dist/components/Properties/storyLayouts.d.ts.map +1 -1
  283. package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
  284. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  285. package/dist/components/RadioGroup/index.js +1 -1
  286. package/dist/components/RangeSlider/RangeSlider.d.ts +1 -1
  287. package/dist/components/RangeSlider/RangeSlider.d.ts.map +1 -1
  288. package/dist/components/RangeSlider/index.js +1 -1
  289. package/dist/components/ResizeHandle/ResizeHandle.d.ts +1 -1
  290. package/dist/components/ResizeHandle/ResizeHandle.d.ts.map +1 -1
  291. package/dist/components/ResizeHandle/index.js +1 -1
  292. package/dist/components/Select/Select.d.ts +3 -3
  293. package/dist/components/Select/Select.d.ts.map +1 -1
  294. package/dist/components/Select/index.js +1 -1
  295. package/dist/components/SelectionPanel/SelectionPanel.d.ts +1 -1
  296. package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
  297. package/dist/components/SelectionPanel/index.js +2 -2
  298. package/dist/components/Sidebar/Sidebar.d.ts +1 -1
  299. package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
  300. package/dist/components/Sidebar/index.js +1 -1
  301. package/dist/components/SidebarPanel/SidebarPanel.d.ts +1 -1
  302. package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
  303. package/dist/components/SidebarPanel/index.js +1 -1
  304. package/dist/components/Slider/Slider.d.ts +2 -1
  305. package/dist/components/Slider/Slider.d.ts.map +1 -1
  306. package/dist/components/Slider/index.js +1 -1
  307. package/dist/components/StatusBar/StatusBar.d.ts +3 -3
  308. package/dist/components/StatusBar/StatusBar.d.ts.map +1 -1
  309. package/dist/components/StatusBar/index.js +1 -1
  310. package/dist/components/SwatchGrid/index.js +1 -1
  311. package/dist/components/Switch/index.js +1 -1
  312. package/dist/components/Tabs/Tabs.d.ts +4 -4
  313. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  314. package/dist/components/Tabs/index.js +1 -1
  315. package/dist/components/Timeline/index.js +1 -1
  316. package/dist/components/Toast/Toast.d.ts +1 -1
  317. package/dist/components/Toast/Toast.d.ts.map +1 -1
  318. package/dist/components/Toast/index.js +1 -1
  319. package/dist/components/ToggleBar/index.js +1 -1
  320. package/dist/components/TokenPanel/TokenPanel.d.ts +1 -1
  321. package/dist/components/TokenPanel/TokenPanel.d.ts.map +1 -1
  322. package/dist/components/TokenPanel/index.js +1 -1
  323. package/dist/components/ToolButton/ToolButton.d.ts +1 -1
  324. package/dist/components/ToolButton/ToolButton.d.ts.map +1 -1
  325. package/dist/components/ToolButton/index.js +1 -1
  326. package/dist/components/ToolGroup/ToolGroup.d.ts +1 -1
  327. package/dist/components/ToolGroup/ToolGroup.d.ts.map +1 -1
  328. package/dist/components/ToolGroup/index.js +1 -1
  329. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts +1 -1
  330. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts.map +1 -1
  331. package/dist/components/ToolOptionsBar/index.js +1 -1
  332. package/dist/components/ToolPalette/ToolPalette.d.ts +1 -1
  333. package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
  334. package/dist/components/ToolPalette/index.js +2 -2
  335. package/dist/components/Tooltip/Tooltip.d.ts +2 -2
  336. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  337. package/dist/components/Tooltip/index.js +1 -1
  338. package/dist/components/Tree/index.js +1 -1
  339. package/dist/icons/Icon.d.ts +1 -1
  340. package/dist/icons/Icon.d.ts.map +1 -1
  341. package/dist/icons/ShapeKindIcon.d.ts +1 -1
  342. package/dist/icons/ShapeKindIcon.d.ts.map +1 -1
  343. package/dist/icons/index.d.ts +52 -52
  344. package/dist/icons/index.d.ts.map +1 -1
  345. package/dist/index.d.ts +1 -0
  346. package/dist/index.d.ts.map +1 -1
  347. package/dist/index.js +108 -89
  348. package/dist/index.js.map +1 -1
  349. package/dist/overlays/portalHost.d.ts +1 -1
  350. package/dist/overlays/portalHost.d.ts.map +1 -1
  351. package/dist/style.css +1 -1
  352. package/package.json +8 -8
  353. package/dist/chunks/ActionBar-CYvfmEz0.js.map +0 -1
  354. package/dist/chunks/Badge-DZ0lFs14.js.map +0 -1
  355. package/dist/chunks/BandEditor-D-nVrVO4.js.map +0 -1
  356. package/dist/chunks/Button-Dyp31jMt.js.map +0 -1
  357. package/dist/chunks/ButtonBar-smZzFuEo.js.map +0 -1
  358. package/dist/chunks/Callout-xLjnx7Mp.js.map +0 -1
  359. package/dist/chunks/Checkbox-ChZz30Ds.js.map +0 -1
  360. package/dist/chunks/Code-v4tDWuuN.js.map +0 -1
  361. package/dist/chunks/ColorField-DJSCuSJv.js.map +0 -1
  362. package/dist/chunks/ColorModeControl-JOEiqtE0.js.map +0 -1
  363. package/dist/chunks/ComboBox-C1JgIpML.js.map +0 -1
  364. package/dist/chunks/CurveEditor-f1R4kSbD.js.map +0 -1
  365. package/dist/chunks/DataGrid-CZPrB_3a.js.map +0 -1
  366. package/dist/chunks/DetailList-DHaXX4TG.js.map +0 -1
  367. package/dist/chunks/DetentSlider-BYyaZha6.js.map +0 -1
  368. package/dist/chunks/Dialog-GIvjoDQj.js.map +0 -1
  369. package/dist/chunks/Disclosure-D79jhmh2.js.map +0 -1
  370. package/dist/chunks/DragGhost-DcU7cOwy.js.map +0 -1
  371. package/dist/chunks/DragHandleGlyph-BtBxHjZS.js.map +0 -1
  372. package/dist/chunks/Field-xbqRmjsI.js.map +0 -1
  373. package/dist/chunks/FillStrokeSwatch-BViKXIPx.js.map +0 -1
  374. package/dist/chunks/FontFamilySelect-r9TV_xIH.js.map +0 -1
  375. package/dist/chunks/GradientEditor-BRTxHG-W.js.map +0 -1
  376. package/dist/chunks/Icon-BW0qv_U7.js.map +0 -1
  377. package/dist/chunks/InlineRange-BwGFDhpT.js.map +0 -1
  378. package/dist/chunks/Input-Bx2cuUbS.js.map +0 -1
  379. package/dist/chunks/ItemList-DzJ2lK0R.js.map +0 -1
  380. package/dist/chunks/ItemList.module-DDUXfuZL.js.map +0 -1
  381. package/dist/chunks/Jog-LPoac9s4.js.map +0 -1
  382. package/dist/chunks/Keycaps-CKiKOJnJ.js.map +0 -1
  383. package/dist/chunks/LayerList-BeGrkLb9.js.map +0 -1
  384. package/dist/chunks/ListEditor-C6zLzCsJ.js.map +0 -1
  385. package/dist/chunks/MenuButton-BcdhrNGh.js.map +0 -1
  386. package/dist/chunks/MeshEditor-BOOIFWnz.js.map +0 -1
  387. package/dist/chunks/NumberField-C1Y7zP-a.js.map +0 -1
  388. package/dist/chunks/OptionsBar-DlcagPYK.js.map +0 -1
  389. package/dist/chunks/PaintField-B2mLRZa4.js.map +0 -1
  390. package/dist/chunks/PaintInput-BFKhd83I.js.map +0 -1
  391. package/dist/chunks/PatternPicker-DdfpxoQy.js.map +0 -1
  392. package/dist/chunks/Plot2D-lyO7waPQ.js.map +0 -1
  393. package/dist/chunks/PointPlotter-DGs9i5P-.js.map +0 -1
  394. package/dist/chunks/Powerline-DBEPceLE.js +0 -38
  395. package/dist/chunks/Powerline-DBEPceLE.js.map +0 -1
  396. package/dist/chunks/Prefs-Ctu0H4-b.js.map +0 -1
  397. package/dist/chunks/Properties-Bbneh1ws.js.map +0 -1
  398. package/dist/chunks/PropertyField-CDb19d3F.js.map +0 -1
  399. package/dist/chunks/RadioGroup-BK2mD6Q0.js.map +0 -1
  400. package/dist/chunks/RangeSlider-BiRAOsTh.js.map +0 -1
  401. package/dist/chunks/ResizeHandle-Cc6EOehs.js.map +0 -1
  402. package/dist/chunks/Select-DVValBe1.js.map +0 -1
  403. package/dist/chunks/SelectionPanel-C5LmZA7b.js.map +0 -1
  404. package/dist/chunks/Sidebar-DKKd4R-x.js.map +0 -1
  405. package/dist/chunks/SidebarPanel-u5NsuAZY.js.map +0 -1
  406. package/dist/chunks/Slider-BwRrWHFW.js.map +0 -1
  407. package/dist/chunks/StatusBar-CdPdmmda.js.map +0 -1
  408. package/dist/chunks/SwatchGrid-C-Zx2Exd.js.map +0 -1
  409. package/dist/chunks/Switch-DxF7TsEu.js.map +0 -1
  410. package/dist/chunks/Tabs-GXEfoe3o.js.map +0 -1
  411. package/dist/chunks/Timeline-SgmpQtUV.js.map +0 -1
  412. package/dist/chunks/Toast-BfcljZz6.js.map +0 -1
  413. package/dist/chunks/ToggleBar-Btnl5r7F.js.map +0 -1
  414. package/dist/chunks/TokenPanel-5ajHEHha.js.map +0 -1
  415. package/dist/chunks/ToolButton-rzqlFlAc.js.map +0 -1
  416. package/dist/chunks/ToolGroup-4bUBV5k6.js.map +0 -1
  417. package/dist/chunks/ToolOptionsBar-BF3TNXA3.js.map +0 -1
  418. package/dist/chunks/ToolPalette-Uw4PvWwa.js.map +0 -1
  419. package/dist/chunks/Tooltip-9XiJF937.js.map +0 -1
  420. package/dist/chunks/Tree-BGt6P8tI.js.map +0 -1
  421. package/dist/chunks/createKeyframeLayer-BzDRCrrh.js.map +0 -1
  422. package/dist/chunks/dlog-CMYiRF3Q.js.map +0 -1
  423. package/dist/chunks/formatShortcut-BoGqUoWi.js.map +0 -1
  424. package/dist/chunks/icons-DbScMMqX.js +0 -179
  425. package/dist/chunks/icons-DbScMMqX.js.map +0 -1
  426. package/dist/chunks/keyGlyph-CLvUHU8c.js.map +0 -1
  427. package/dist/chunks/model-BQMvTLnW.js.map +0 -1
  428. package/dist/chunks/number-6S8IzXVt.js.map +0 -1
  429. package/dist/chunks/paintPreview-DPtZS4yU.js.map +0 -1
  430. package/dist/chunks/paintValue-Bz6AVuh3.js.map +0 -1
  431. package/dist/chunks/portalHost-CjpCnuGU.js.map +0 -1
  432. package/dist/chunks/prefField-CLkhrvYl.js.map +0 -1
  433. package/dist/chunks/segmentTooltip-CAkZlW-t.js.map +0 -1
  434. package/dist/chunks/segmentedControl.module-D2nw68Yo.js.map +0 -1
  435. package/dist/chunks/snap-DC4Km8xG.js.map +0 -1
  436. package/dist/chunks/stance-CarrcbbP.js.map +0 -1
  437. package/dist/chunks/useReorderDragList-Dcezzgix.js.map +0 -1
  438. package/dist/chunks/useRovingTabIndex-B4uJqiKP.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Slider-BwRrWHFW.js","names":[],"sources":["../../src/components/Slider/Slider.module.css","../../src/components/Slider/Slider.tsx"],"sourcesContent":[".root {\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n touch-action: none;\n}\n\n.row {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n}\n\n.track {\n position: relative;\n flex: 1;\n min-width: 0;\n height: var(--rp-track-height, 24px);\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n cursor: var(--rp-track-cursor, crosshair);\n /* No `overflow: hidden` here — thumbs at extreme values would get\n * clipped at the track edges. The gradient/track-paint clip is\n * applied to `.trackInner` instead, which lets thumbs spill freely. */\n}\n\n.trackInner {\n position: absolute;\n inset: 0;\n border-radius: var(--wzl-radius-sm);\n overflow: hidden;\n}\n\n.thumb {\n position: absolute;\n /* Thumb extends 2px above + below the track for grabbability + visual\n * weight. Track itself stays its natural height; the thumb just spills. */\n top: -2px;\n bottom: -2px;\n width: var(--rp-thumb-size, 14px);\n margin-left: calc(var(--rp-thumb-size, 14px) / -2);\n display: flex;\n align-items: center;\n justify-content: center;\n background: color-mix(in srgb, var(--wzl-fg-muted) 70%, transparent);\n border: 1px solid var(--wzl-border-strong);\n border-radius: var(--wzl-radius-sm);\n cursor: ew-resize;\n /* Frosted-glass over the (often colorful) track. Cheap on modern GPUs;\n * gracefully degrades to just the partial-alpha background on engines\n * without backdrop-filter support. */\n backdrop-filter: blur(3px);\n -webkit-backdrop-filter: blur(3px);\n /* Subtle raise — sells the \"thumb is on top of the track\" hierarchy. */\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n font: var(--wzl-font-weight-medium) var(--wzl-font-size-xs)/var(--wzl-leading-tight) ui-sans-serif, system-ui, sans-serif;\n font-variant-numeric: tabular-nums;\n color: var(--wzl-fg-inverse);\n /* White halo so labels stay legible over wildly varying gradient\n * backgrounds (e.g. labels 'T' / 'P' / 'B' over teal, hue 200° over\n * yellow-green, etc.). */\n text-shadow: 0 0 2px rgba(255, 255, 255, 0.7);\n}\n\n/* A slim slider's thumb is round and flush with the track, matching the\n property rows. The default thumb keeps its 2px spill and rounded-rect face. */\n.slim .thumb {\n top: 50%;\n bottom: auto;\n height: var(--rp-thumb-size);\n transform: translateY(-50%);\n border-radius: 50%;\n border: none;\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n box-shadow: none;\n background: color-mix(in srgb, var(--wzl-accent) var(--wzl-slider-thumb-mix, 70%), transparent);\n}\n\n.thumb:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: 1px;\n}\n\n.thumbActive {\n /* Visual marker for the dragging/focused thumb; subclass-overridable. */\n z-index: 1;\n}\n\n/* The row holds absolutely-positioned labels, so it has to state its own\n height: the text's, not the thumb's. It said 14px — the default thumb's\n size — which left 4px of dead space under the labels at either density. */\n.readoutsBelow {\n position: relative;\n height: calc(var(--wzl-font-size-xs) * var(--wzl-leading-tight));\n margin-top: var(--wzl-space-2);\n}\n\n.readoutBelow {\n position: absolute;\n transform: translateX(-50%);\n font: var(--wzl-font-weight-medium) var(--wzl-font-size-xs)/var(--wzl-leading-tight) ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n color: var(--wzl-fg-muted);\n white-space: nowrap;\n}\n\n.readoutInline {\n display: inline-block;\n margin-left: var(--wzl-space-4);\n font: var(--wzl-font-weight-medium) var(--wzl-font-size-sm)/var(--wzl-leading-tight) ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n color: var(--wzl-fg-muted);\n vertical-align: middle;\n}\n\n.notched {\n background: var(--thumb-svg, none);\n background-size: 100% 100%;\n background-repeat: no-repeat;\n background-color: transparent;\n border: none;\n /* Notched thumbs need to disable the .thumb defaults that paint to\n * the bounding box: backdrop-filter and box-shadow both ignore the\n * SVG's polygon/notch and would render through the notch cutout.\n * Use filter: drop-shadow instead — it traces the actual rendered\n * alpha (i.e. the polygon shape including the cut). */\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n box-shadow: none;\n filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));\n /* Default notched SVG (down-pointing pentagon, matches the perceptual-color experiment). */\n --thumb-svg: url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 30' preserveAspectRatio='none'%3E%3Cpolygon points='0,0 2.52,0 7,10.3 11.48,0 14,0 14,30 0,30' fill='rgba(255,255,255,0.62)' stroke='rgba(0,0,0,0.55)' stroke-width='0.75' stroke-linejoin='miter'/%3E%3C/svg%3E\");\n}\n\n.ticks {\n position: absolute;\n inset: 0;\n /* A mark must never eat the track click that adds a thumb, nor the\n * pointerdown that starts a drag through it. */\n pointer-events: none;\n}\n\n.tick {\n position: absolute;\n top: var(--rp-tick-inset, 20%);\n bottom: var(--rp-tick-inset, 20%);\n width: var(--rp-tick-width, 1px);\n margin-left: calc(var(--rp-tick-width, 1px) / -2);\n border-radius: var(--wzl-radius-pill);\n background: var(--rp-tick-color, var(--wzl-border-strong));\n}\n\n/* The labels hang below the track out of flow, so the row reserves their\n * height and anything after it — the below-thumb readouts — clears them.\n * Padding, not margin: a margin would collapse into whatever follows. */\n.withStopLabels .row {\n padding-bottom: calc(var(--wzl-space-xs) + var(--wzl-font-size-xs) * var(--wzl-leading-tight));\n}\n\n.stopLabels {\n position: absolute;\n left: 0;\n right: 0;\n top: calc(100% + var(--wzl-space-xs));\n height: calc(var(--wzl-font-size-xs) * var(--wzl-leading-tight));\n pointer-events: none;\n}\n\n.stopLabel {\n position: absolute;\n transform: translateX(-50%);\n white-space: nowrap;\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size-xs);\n line-height: var(--wzl-leading-tight);\n font-variant-numeric: tabular-nums;\n color: var(--wzl-fg-subtle);\n}\n\n/* The end labels are pinned inside the track rather than centered on it, so a\n * wide one can't spill past the control and misalign whatever sits beside it. */\n.stopLabel[data-edge=\"start\"] {\n transform: none;\n}\n\n.stopLabel[data-edge=\"end\"] {\n transform: translateX(-100%);\n}\n\n.stopLabel[data-selected] {\n color: var(--wzl-fg);\n font-weight: var(--wzl-font-weight-medium);\n}\n","import { useCallback, useEffect, useMemo, useRef, type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type ReactElement, type ReactNode } from 'react';\nimport { openPointerSession, type PointerSession } from '@weasel-js/core';\nimport s from './Slider.module.css';\nimport { formatNumber } from '../../format/number';\n\n/**\n * Passed to a custom thumb renderer: the thumb box in CSS px, and whether\n * this thumb is the one being dragged.\n */\nexport type ThumbRenderCtx = {\n width: number;\n height: number;\n isActive: boolean;\n};\n\n/**\n * A thumb's appearance — one of the two built-in shapes, or a custom\n * renderer.\n */\nexport type ThumbShape =\n | 'round'\n | 'notched'\n | { render: (ctx: ThumbRenderCtx) => ReactNode };\n\n/**\n * One handle on a {@link Slider}. `bounds` narrows the range this particular\n * thumb may move within, either fixed or computed from the current thumb\n * list.\n */\nexport type Thumb = {\n value: number;\n label?: string;\n shape?: ThumbShape;\n bounds?: [number, number] | ((ctx: BoundsCtx) => [number, number]);\n /**\n * Spoken form of `value`, published as `aria-valuetext`. Required by ARIA\n * whenever `value` is not the quantity the user is choosing — an index into\n * a value list, a log-scaled position — since `aria-valuenow` alone then\n * announces a number that means nothing.\n */\n valueText?: string;\n};\n\n/**\n * Passed to a thumb's `bounds` function: the full thumb list and this thumb's\n * index in it, so a bound can be expressed relative to its neighbors.\n */\nexport type BoundsCtx = {\n thumbs: readonly Thumb[];\n index: number;\n};\n\n/**\n * Passed to `renderTrack`: the track's width in CSS px and a mapping from a\n * slider value to its 0..1 position along the track.\n */\nexport type TrackCtx = {\n trackWidth: number;\n valueToFraction: (v: number) => number;\n};\n\n/** A {@link Slider} stop that carries a label, drawn under the track at the stop. */\nexport type SliderStop = {\n value: number;\n label?: ReactNode;\n};\n\n/**\n * Props for {@link Slider}.\n *\n * `onInput` fires continuously through a drag; `onChange` fires once when it\n * ends and is the one to write to history.\n *\n * `stops` are attractors: a drag that passes within a few pixels of one lands\n * on it, and the arrow keys move stop to stop. `step` still quantizes the\n * values between them. Each one is drawn on the track as a mark; pass\n * `showStops: false` for a track whose own paint already reads as the stops.\n * A stop given as a {@link SliderStop} with a `label` gets that label drawn\n * under it; `stopLabels` narrows the row to the two ends or turns it off.\n *\n * `snap: 'strict'` makes every stop a detent the thumb must rest on: drags and\n * track presses land on the nearest one, and `step` no longer applies.\n * `spacing: 'even'` places the stops at equal intervals, runs the track from\n * the first stop to the last, and maps values linearly within each gap — so a\n * geometric list (0.25/0.5/1/2/4) gets usable room for every stop instead of\n * four crowded into the first fifth. Both need stops; with fewer than two,\n * `'even'` falls back to linear.\n *\n * `trackClick: 'move-nearest'` makes a press on bare track send the closest\n * thumb there and continue as a drag. It is off by default because on a\n * multi-thumb editor a stray click would yank a stop the user was not aiming\n * at; `onAddThumb`, where it is set, keeps the track press.\n *\n * `constraint: 'ordered'` keeps thumbs from crossing each other. Supplying\n * `onAddThumb` makes a click on empty track create a thumb, and supplying\n * `onRemoveThumb` lets a right-click or a drag off the track remove one —\n * both callbacks can decline by returning `null`/`false`. `allowShiftAll`\n * makes shift-drag translate every thumb together.\n */\nexport type SliderProps<T extends Thumb = Thumb> = {\n thumbs: readonly T[];\n onInput: (next: T[]) => void;\n onChange?: (next: T[]) => void;\n min: number;\n max: number;\n step?: number;\n stops?: readonly (number | SliderStop)[];\n showStops?: boolean;\n stopLabels?: 'all' | 'ends' | 'none';\n snap?: 'magnetic' | 'strict';\n spacing?: 'linear' | 'even';\n trackClick?: 'none' | 'move-nearest';\n constraint?: 'free' | 'ordered';\n onAddThumb?: (atValue: number) => T | null;\n onRemoveThumb?: (index: number) => boolean;\n allowShiftAll?: boolean;\n renderTrack?: (ctx: TrackCtx) => ReactNode;\n trackHeight?: number;\n /** `'slim'` drives the track and thumb from the kit's slider tokens, so a\n * Slider matches the property rows. `trackHeight` still wins if given. */\n density?: 'default' | 'slim';\n renderReadout?: (thumb: T, index: number) => ReactNode;\n readoutPlacement?: 'none' | 'inline-after' | 'below-thumb';\n ariaLabel?: string;\n className?: string;\n};\n\nfunction quantize(v: number, step: number | undefined, min: number): number {\n if (step === undefined || step <= 0) return v;\n return Math.round((v - min) / step) * step + min;\n}\n\nfunction clamp(v: number, lo: number, hi: number): number {\n return Math.max(lo, Math.min(hi, v));\n}\n\n/** How close a drag has to come to a stop, in track pixels, to land on it. */\nconst STOP_SNAP_PX = 8;\n\n/** A custom `ThumbShape.render` may put interactive content inside the thumb,\n * and capture would retarget pointerup and kill the click on it. */\nconst NO_CAPTURE = { capture: false } as const;\n\n/** The stops that are actually reachable: inside the range, deduped, ascending.\n * A duplicate keeps the first label given for its value. */\nfunction usableStops(stops: SliderProps['stops'], min: number, max: number): SliderStop[] {\n if (!stops || stops.length === 0) return [];\n const byValue = new Map<number, SliderStop>();\n for (const stop of stops) {\n const s = typeof stop === 'number' ? { value: stop } : stop;\n if (s.value < min || s.value > max) continue;\n const seen = byValue.get(s.value);\n if (!seen || (seen.label === undefined && s.label !== undefined)) byValue.set(s.value, s);\n }\n return [...byValue.values()].sort((a, b) => a.value - b.value);\n}\n\n/** The stop nearest `v` along the track, or `v` itself when none lies within\n * `tolerance` (a track fraction). Measured on the track rather than in value\n * units so evenly spaced stops attract over the same distance. */\nfunction attract(v: number, stops: number[], tolerance: number, toFraction: (v: number) => number): number {\n const f = toFraction(v);\n let best = v;\n let bestGap = tolerance;\n for (const stop of stops) {\n const gap = Math.abs(toFraction(stop) - f);\n if (gap <= bestGap) {\n best = stop;\n bestGap = gap;\n }\n }\n return best;\n}\n\n/** The stop `count` places past `v` in `direction`, saturating at either end. */\nfunction stepStops(stops: number[], v: number, direction: 1 | -1, count: number): number {\n if (direction > 0) {\n const first = stops.findIndex(stop => stop > v);\n if (first === -1) return stops[stops.length - 1];\n return stops[Math.min(stops.length - 1, first + count - 1)];\n }\n let first = -1;\n for (let i = stops.length - 1; i >= 0; i--) {\n if (stops[i] < v) {\n first = i;\n break;\n }\n }\n if (first === -1) return stops[0];\n return stops[Math.max(0, first - (count - 1))];\n}\n\nfunction defaultStep(step: number | undefined, min: number, max: number): number {\n if (step !== undefined && step > 0) return step;\n return (max - min) / 100;\n}\n\n/** Keep a thumb inside its neighbors when `constraint` is `'ordered'`. */\nfunction clampOrdered(\n v: number,\n thumbs: readonly Thumb[],\n index: number,\n min: number,\n max: number,\n step: number | undefined,\n): number {\n const gap = step !== undefined && step > 0 ? step : (max - min) / 1000;\n const lower = index > 0 ? thumbs[index - 1].value + gap : min;\n const upper = index < thumbs.length - 1 ? thumbs[index + 1].value - gap : max;\n return clamp(v, lower, upper);\n}\n\nfunction resolveBounds(thumb: Thumb, ctx: BoundsCtx, fallbackMin: number, fallbackMax: number): [number, number] {\n if (!thumb.bounds) return [fallbackMin, fallbackMax];\n const tuple = typeof thumb.bounds === 'function' ? thumb.bounds(ctx) : thumb.bounds;\n return [tuple[0], tuple[1]];\n}\n\nfunction defaultReadout(thumb: Thumb): string {\n return formatNumber(thumb.value, { minimumFractionDigits: 3, maximumFractionDigits: 3 });\n}\n\n/**\n * Multi-thumb slider over a shared track. The thumb list is fully controlled:\n * every change, live or committed, arrives as a whole new array.\n *\n * Thumbs are draggable, and arrow/Home/End move the focused thumb — those\n * keystrokes fire `onInput` and `onChange` together, since there is no\n * in-flight state to buffer.\n */\nexport function Slider<T extends Thumb = Thumb>(props: SliderProps<T>): ReactElement {\n const { thumbs, onInput, onChange, step, constraint, trackHeight, density, ariaLabel, className } = props;\n\n const stopList = useMemo(() => usableStops(props.stops, props.min, props.max), [props.stops, props.min, props.max]);\n const stops = useMemo(() => stopList.map(stop => stop.value), [stopList]);\n const even = props.spacing === 'even' && stops.length >= 2;\n const strict = props.snap === 'strict' && stops.length > 0;\n const min = even ? stops[0] : props.min;\n const max = even ? stops[stops.length - 1] : props.max;\n\n const trackRef = useRef<HTMLDivElement | null>(null);\n // In-flight thumb buffer during a drag; null when not dragging.\n const dragBufferRef = useRef<T[] | null>(null);\n const sessionRef = useRef<PointerSession | null>(null);\n\n useEffect(() => () => { sessionRef.current?.cancel(); }, []);\n\n const valueToFraction = useCallback(\n (v: number): number => {\n if (max === min) return 0;\n if (!even) return clamp((v - min) / (max - min), 0, 1);\n const gaps = stops.length - 1;\n const x = clamp(v, min, max);\n let i = 0;\n while (i < gaps - 1 && x > stops[i + 1]) i++;\n return (i + (x - stops[i]) / (stops[i + 1] - stops[i])) / gaps;\n },\n [min, max, even, stops],\n );\n\n const fractionToValue = useCallback(\n (f: number): number => {\n const c = clamp(f, 0, 1);\n if (!even) return min + c * (max - min);\n const gaps = stops.length - 1;\n const i = Math.min(gaps - 1, Math.floor(c * gaps));\n return stops[i] + (c * gaps - i) * (stops[i + 1] - stops[i]);\n },\n [min, max, even, stops],\n );\n\n /** The value a pointer at track fraction `f` chooses, before bounds. */\n const valueAt = useCallback(\n (f: number, trackWidth: number): number => {\n const v = fractionToValue(f);\n if (strict) return attract(v, stops, Infinity, valueToFraction);\n const q = clamp(quantize(v, step, min), min, max);\n return stops.length > 0 ? attract(q, stops, STOP_SNAP_PX / trackWidth, valueToFraction) : q;\n },\n [fractionToValue, valueToFraction, strict, stops, step, min, max],\n );\n\n // `seed` replaces the thumb list the drag starts from. A track press moves a\n // thumb before the drag begins, and without seeding, a release with no\n // movement would commit the stale buffer and undo that move.\n const beginThumbDrag = useCallback(\n (origin: Element, down: ReactPointerEvent, index: number, seed?: readonly T[]) => {\n sessionRef.current?.cancel();\n const buf: T[] = (seed ?? thumbs).map(t => ({ ...t }));\n dragBufferRef.current = buf;\n let droppedOff = false;\n\n const onMove = (ev: PointerEvent) => {\n const track = trackRef.current;\n const buffer = dragBufferRef.current;\n if (!track || !buffer) return;\n const rect = track.getBoundingClientRect();\n let v = valueAt((ev.clientX - rect.left) / rect.width, rect.width);\n\n const [bLo, bHi] = resolveBounds(buffer[index], { thumbs: buffer, index }, min, max);\n v = clamp(v, bLo, bHi);\n\n if (constraint === 'ordered') v = clampOrdered(v, buffer, index, min, max, step);\n\n // Drop-off detection: pointer exits the track vertically by more than trackHeight.\n const bandHeight = rect.height;\n if (props.onRemoveThumb) {\n if (ev.clientY < rect.top - bandHeight || ev.clientY > rect.bottom + bandHeight) {\n droppedOff = true;\n } else {\n droppedOff = false;\n }\n }\n\n buffer[index] = { ...buffer[index], value: v };\n onInput(buffer.map(t => ({ ...t })));\n };\n\n // A drag that ends without a release — cancelled pointer, lost capture,\n // an unmount — drops the buffer without committing.\n const onCancel = () => {\n sessionRef.current = null;\n dragBufferRef.current = null;\n };\n\n const onEnd = () => {\n sessionRef.current = null;\n const buffer = dragBufferRef.current;\n dragBufferRef.current = null;\n if (!buffer) return;\n\n if (droppedOff && props.onRemoveThumb) {\n const accepted = props.onRemoveThumb(index);\n if (accepted) {\n const next = buffer.filter((_, i) => i !== index).map(t => ({ ...t })) as T[];\n onInput(next);\n onChange?.(next);\n return;\n }\n }\n\n onChange?.(buffer.map(t => ({ ...t })));\n };\n\n sessionRef.current = openPointerSession(origin, down, { onMove, onEnd, onCancel }, NO_CAPTURE);\n },\n [thumbs, onInput, onChange, valueAt, min, max, step, constraint, props],\n );\n\n const beginShiftAllDrag = useCallback(\n (origin: Element, down: ReactPointerEvent, anchorX: number) => {\n sessionRef.current?.cancel();\n const buf: T[] = thumbs.map(t => ({ ...t }));\n const startValues = buf.map(t => t.value);\n dragBufferRef.current = buf;\n\n const onMove = (ev: PointerEvent) => {\n const track = trackRef.current;\n const buffer = dragBufferRef.current;\n if (!track || !buffer) return;\n const rect = track.getBoundingClientRect();\n const dxFraction = (ev.clientX - anchorX) / rect.width;\n // Evenly spaced gaps span different amounts of value, so equal value\n // offsets would pull the thumbs apart; move them by track distance.\n if (even) {\n const starts = startValues.map(valueToFraction);\n const df = clamp(dxFraction, -Math.min(...starts), 1 - Math.max(...starts));\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = { ...buffer[i], value: fractionToValue(starts[i] + df) };\n }\n onInput(buffer.map(t => ({ ...t })));\n return;\n }\n let dValue = dxFraction * (max - min);\n dValue = quantize(dValue, step, 0);\n\n // Clamp delta so no thumb leaves [min, max] (per-thumb bounds intentionally\n // not enforced — matches the experiment's hue-band shift-translate semantics).\n let allowedNeg = -Infinity;\n let allowedPos = Infinity;\n for (let i = 0; i < startValues.length; i++) {\n allowedNeg = Math.max(allowedNeg, min - startValues[i]);\n allowedPos = Math.min(allowedPos, max - startValues[i]);\n }\n dValue = clamp(dValue, allowedNeg, allowedPos);\n\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = { ...buffer[i], value: clamp(startValues[i] + dValue, min, max) };\n }\n onInput(buffer.map(t => ({ ...t })));\n };\n\n const onCancel = () => {\n sessionRef.current = null;\n dragBufferRef.current = null;\n };\n\n const onEnd = () => {\n sessionRef.current = null;\n const buffer = dragBufferRef.current;\n dragBufferRef.current = null;\n if (buffer) onChange?.(buffer.map(t => ({ ...t })));\n };\n\n sessionRef.current = openPointerSession(origin, down, { onMove, onEnd, onCancel }, NO_CAPTURE);\n },\n [thumbs, onInput, onChange, min, max, step, even, valueToFraction, fractionToValue],\n );\n\n const onThumbPointerDown = (index: number) => (e: ReactPointerEvent) => {\n // Only bail on explicit non-primary buttons (button > 0). jsdom's PointerEvent\n // leaves `button` undefined; treat that as primary so tests can drive drags.\n if (typeof e.button === 'number' && e.button > 0) return;\n // preventDefault below suppresses the focus the press would otherwise\n // give the thumb, and the arrow keys are on the thumb.\n (e.currentTarget as HTMLElement).focus?.();\n e.preventDefault();\n e.stopPropagation();\n const origin = e.currentTarget as HTMLElement;\n if (e.shiftKey && props.allowShiftAll) {\n beginShiftAllDrag(origin, e, e.clientX);\n } else {\n beginThumbDrag(origin, e, index);\n }\n };\n\n const onThumbContextMenu = (index: number) => (e: ReactMouseEvent) => {\n if (!props.onRemoveThumb) return;\n e.preventDefault();\n const accepted = props.onRemoveThumb(index);\n if (!accepted) return;\n const next = thumbs.filter((_, i) => i !== index).map(t => ({ ...t })) as T[];\n onInput(next);\n onChange?.(next);\n };\n\n const onTrackPointerDown = (e: ReactPointerEvent<HTMLDivElement>) => {\n if (typeof e.button === 'number' && e.button > 0) return;\n const wantsMove = (props.trackClick ?? 'none') === 'move-nearest' && thumbs.length > 0;\n if (!props.onAddThumb && !wantsMove) return;\n // If the event originated on a thumb, the thumb's own handler ran first; this is a track click.\n if ((e.target as HTMLElement).closest(`.${s.thumb}`)) return;\n e.preventDefault();\n const track = trackRef.current;\n if (!track) return;\n const rect = track.getBoundingClientRect();\n const v = valueAt((e.clientX - rect.left) / rect.width, rect.width);\n\n if (props.onAddThumb) {\n const created = props.onAddThumb(v);\n if (!created) return;\n const next = [...thumbs.map(t => ({ ...t })), created] as T[];\n onInput(next);\n onChange?.(next);\n return;\n }\n\n let index = 0;\n for (let i = 1; i < thumbs.length; i++) {\n if (Math.abs(thumbs[i].value - v) < Math.abs(thumbs[index].value - v)) index = i;\n }\n const next = thumbs.map(t => ({ ...t })) as T[];\n const [bLo, bHi] = resolveBounds(next[index], { thumbs: next, index }, min, max);\n let moved = clamp(v, bLo, bHi);\n if (constraint === 'ordered') moved = clampOrdered(moved, next, index, min, max, step);\n next[index] = { ...next[index], value: moved };\n onInput(next);\n beginThumbDrag(track, e, index, next);\n };\n\n const onThumbKeyDown = (index: number) => (e: ReactKeyboardEvent) => {\n const stepSize = defaultStep(step, min, max);\n let delta = 0;\n // With stops, a keystroke moves by whole stops rather than by value.\n let stopDelta = 0;\n let snapTo: 'home' | 'end' | null = null;\n\n switch (e.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n delta = e.shiftKey ? stepSize * 10 : stepSize;\n stopDelta = e.shiftKey ? 10 : 1;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n delta = e.shiftKey ? -stepSize * 10 : -stepSize;\n stopDelta = e.shiftKey ? -10 : -1;\n break;\n case 'PageUp':\n delta = stepSize * 10;\n stopDelta = 10;\n break;\n case 'PageDown':\n delta = -stepSize * 10;\n stopDelta = -10;\n break;\n case 'Home':\n snapTo = 'home';\n break;\n case 'End':\n snapTo = 'end';\n break;\n default:\n return;\n }\n\n e.preventDefault();\n const next = thumbs.map(t => ({ ...t }));\n const [bLo, bHi] = resolveBounds(next[index], { thumbs: next, index }, min, max);\n const lo = Math.max(min, bLo);\n const hi = Math.min(max, bHi);\n let v: number;\n if (snapTo === 'home') v = lo;\n else if (snapTo === 'end') v = hi;\n else if (stops.length > 0) {\n v = stepStops(stops, next[index].value, stopDelta > 0 ? 1 : -1, Math.abs(stopDelta));\n } else {\n v = quantize(next[index].value + delta, step, min);\n }\n v = clamp(v, lo, hi);\n if (constraint === 'ordered') v = clampOrdered(v, next, index, lo, hi, step);\n next[index] = { ...next[index], value: v };\n onInput(next);\n onChange?.(next);\n };\n\n const placement = props.readoutPlacement ?? 'none';\n const renderReadout = props.renderReadout;\n\n const slim = density === 'slim';\n const rootVars: Record<string, string> = {};\n if (slim) {\n rootVars['--rp-track-height'] = 'var(--wzl-slider-track-h)';\n rootVars['--rp-thumb-size'] = 'var(--wzl-slider-thumb-size)';\n }\n // An explicit trackHeight wins: a caller who named a number meant it.\n if (trackHeight !== undefined) rootVars['--rp-track-height'] = `${trackHeight}px`;\n\n const labelMode = props.stopLabels ?? 'all';\n const lastStop = stopList.length - 1;\n const labeledStops = labelMode === 'none'\n ? []\n : stopList\n .map((stop, i) => ({ stop, i }))\n .filter(({ stop, i }) => stop.label !== undefined && (labelMode === 'all' || i === 0 || i === lastStop));\n // Inside the track so it shares the track's width, not the row's — an inline\n // readout beside the track would otherwise shift every label off its stop.\n const stopLabelRow = labeledStops.length > 0 && (\n <div className={s.stopLabels} data-slider-stop-labels aria-hidden=\"true\">\n {labeledStops.map(({ stop, i }) => (\n <span\n key={stop.value}\n className={s.stopLabel}\n data-slider-stop-label\n data-selected={thumbs.some(t => t.value === stop.value) ? 'true' : undefined}\n data-edge={i === 0 ? 'start' : i === lastStop ? 'end' : undefined}\n style={{ left: `${valueToFraction(stop.value) * 100}%` }}\n >\n {stop.label}\n </span>\n ))}\n </div>\n );\n const rootClass = [s.root, slim && s.slim, stopLabelRow && s.withStopLabels, className].filter(Boolean).join(' ');\n\n return (\n <div\n className={rootClass}\n style={Object.keys(rootVars).length > 0 ? (rootVars as CSSProperties) : undefined}\n >\n <div className={s.row}>\n <div className={s.track} ref={trackRef} onPointerDown={onTrackPointerDown}>\n {props.renderTrack && (\n <div className={s.trackInner}>\n {props.renderTrack({\n trackWidth: trackRef.current?.getBoundingClientRect().width ?? 0,\n valueToFraction,\n })}\n </div>\n )}\n {(props.showStops ?? true) && stops.length > 0 && (\n <div className={s.ticks} data-slider-ticks aria-hidden=\"true\">\n {stops.map(v => {\n const f = valueToFraction(v);\n return (\n <span\n key={v}\n className={s.tick}\n data-slider-tick\n data-fraction={String(f)}\n style={{ left: `${f * 100}%` }}\n />\n );\n })}\n </div>\n )}\n {stopLabelRow}\n {thumbs.map((thumb, i) => {\n const isNotched = thumb.shape === 'notched';\n const customRender = typeof thumb.shape === 'object' && thumb.shape !== null ? thumb.shape.render : null;\n const cls = `${s.thumb}${isNotched ? ` ${s.notched}` : ''}`;\n return (\n <div\n key={i}\n role=\"slider\"\n tabIndex={0}\n aria-orientation=\"horizontal\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={thumb.value}\n aria-valuetext={thumb.valueText}\n aria-label={[ariaLabel, thumb.label].filter(Boolean).join(' ') || undefined}\n className={cls}\n style={{ left: `${valueToFraction(thumb.value) * 100}%` }}\n onPointerDown={onThumbPointerDown(i)}\n onKeyDown={onThumbKeyDown(i)}\n onContextMenu={onThumbContextMenu(i)}\n >\n {customRender ? customRender({ width: 14, height: 24, isActive: false }) : (thumb.label ?? '')}\n </div>\n );\n })}\n </div>\n {placement === 'inline-after' && (\n <span data-readout=\"inline\" className={s.readoutInline}>\n {thumbs.map((t, i) => (\n <span key={i}>{i > 0 ? ' / ' : ''}{renderReadout ? renderReadout(t, i) : defaultReadout(t)}</span>\n ))}\n </span>\n )}\n </div>\n {placement === 'below-thumb' && (\n <div className={s.readoutsBelow}>\n {thumbs.map((t, i) => (\n <span\n key={i}\n data-readout=\"below\"\n className={s.readoutBelow}\n style={{ left: `${valueToFraction(t.value) * 100}%` }}\n >\n {renderReadout ? renderReadout(t, i) : defaultReadout(t)}\n </span>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AC+HA,SAAS,EAAS,GAAW,GAA0B,GAAqB;AAE1E,QADI,MAAS,KAAA,KAAa,KAAQ,IAAU,IACrC,KAAK,OAAO,IAAI,KAAO,EAAK,GAAG,IAAO;;AAG/C,SAAS,EAA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C5B,IAAe,OAAO,EAAM,SAAU,YAAY,EAAM,UAAU,OAAO,EAAM,MAAM,SAAS,MAC9F,IAAM,GAAG,EAAE,QAAQ,IAAY,IAAI,EAAE,YAAY;AACvD,aACE,kBAAC,OAAD;OAEE,MAAK;OACL,UAAU;OACV,oBAAiB;OACjB,iBAAe;OACf,iBAAe;OACf,iBAAe,EAAM;OACrB,kBAAgB,EAAM;OACtB,cAAY,CAAC,IAAW,EAAM,MAAM,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI,IAAI,KAAA;OAClE,WAAW;OACX,OAAO,EAAE,MAAM,GAAG,EAAgB,EAAM,MAAM,GAAG,IAAI,IAAI;OACzD,eAAe,EAAmB,EAAE;OACpC,WAAW,EAAe,EAAE;OAC5B,eAAe,EAAmB,EAAE;iBAEnC,IAAe,EAAa;QAAE,OAAO;QAAI,QAAQ;QAAI,UAAU;QAAO,CAAC,GAAI,EAAM,SAAS;OACvF,EAhBC,EAgBD;OAER;KACE;OACL,MAAc,kBACb,kBAAC,QAAD;IAAM,gBAAa;IAAS,WAAW,EAAE;cACtC,EAAO,KAAK,GAAG,MACd,kBAAC,QAAD,EAAA,UAAA,CAAe,IAAI,IAAI,QAAQ,IAAI,IAAgB,EAAc,GAAG,EAAE,GAAG,EAAe,EAAE,CAAQ,EAAA,EAAvF,EAAuF,CAClG;IACG,CAAA,CAEH;MACL,MAAc,iBACb,kBAAC,OAAD;GAAK,WAAW,EAAE;aACf,EAAO,KAAK,GAAG,MACd,kBAAC,QAAD;IAEE,gBAAa;IACb,WAAW,EAAE;IACb,OAAO,EAAE,MAAM,GAAG,EAAgB,EAAE,MAAM,GAAG,IAAI,IAAI;cAEpD,IAAgB,EAAc,GAAG,EAAE,GAAG,EAAe,EAAE;IACnD,EANA,EAMA,CACP;GACE,CAAA,CAEJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StatusBar-CdPdmmda.js","names":[],"sources":["../../src/components/StatusBar/StatusBar.module.css","../../src/components/StatusBar/StatusBar.tsx"],"sourcesContent":[".bar {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-8);\n flex-shrink: 0;\n padding: var(--wzl-space-2) var(--wzl-space-6);\n font-family: var(--wzl-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-muted);\n background: var(--wzl-surface);\n border-top: 1px solid var(--wzl-border);\n}\n\n.item {\n white-space: nowrap;\n}\n\n.muted {\n opacity: 0.6;\n font-variant-numeric: tabular-nums;\n}\n\n.hasTitle {\n cursor: help;\n}\n\n.spacer {\n margin-left: auto;\n}\n","import type { ReactNode } from 'react';\nimport s from './StatusBar.module.css';\n\n/** Props for {@link StatusBar}. */\nexport interface StatusBarProps {\n /**\n * Accessible label for the bar. Deliberately not a live region — a status\n * bar's readouts change on every pointer move (zoom, cursor position,\n * selection count), and announcing each one would make a screen reader\n * unusable. Screen-reader users reach the same facts through the controls\n * that own them.\n */\n ariaLabel?: string;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * The thin readout strip along the bottom of an editor window: monospace,\n * one row, items separated by a fixed gap, with an optional spacer that\n * pushes everything after it to the trailing edge.\n *\n * Pure presentation — it holds whatever the app puts in it. Compose with\n * `<StatusBarItem>` and `<StatusBarSpacer>`.\n */\nexport function StatusBar(props: StatusBarProps) {\n const { ariaLabel, children, className } = props;\n return (\n <footer className={[s.bar, className].filter(Boolean).join(' ')} aria-label={ariaLabel}>\n {children}\n </footer>\n );\n}\n\n/** Props for {@link StatusBarItem}. */\nexport interface StatusBarItemProps {\n /**\n * Hover text. Items that carry one also get a `help` cursor, so the\n * affordance is discoverable rather than hidden behind a hover delay.\n */\n title?: string;\n /**\n * Dim the item and use tabular figures. For reference material that\n * shouldn't compete with live readouts — build stamps, hints, units.\n */\n muted?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\n/** One readout in a `<StatusBar>`. */\nexport function StatusBarItem(props: StatusBarItemProps) {\n const { title, muted, children, className } = props;\n const cls = [s.item, muted && s.muted, title !== undefined && s.hasTitle, className]\n .filter(Boolean).join(' ');\n return <span className={cls} title={title}>{children}</span>;\n}\n\n/**\n * Splits a status bar into leading and trailing runs — everything after the\n * spacer is pushed to the trailing edge. Decorative, so it's hidden from the\n * accessibility tree.\n */\nexport function StatusBarSpacer() {\n return <span className={s.spacer} aria-hidden=\"true\" />;\n}\n"],"mappings":";;;;;;;;;;ACyBA,SAAgB,EAAU,GAAuB;CAC/C,IAAM,EAAE,cAAW,aAAU,iBAAc;AAC3C,QACE,kBAAC,UAAD;EAAQ,WAAW,CAAC,EAAE,KAAK,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAAE,cAAY;EAC1E;EACM,CAAA;;AAqBb,SAAgB,EAAc,GAA2B;CACvD,IAAM,EAAE,UAAO,UAAO,aAAU,iBAAc;AAG9C,QAAO,kBAAC,QAAD;EAAM,WAFD;GAAC,EAAE;GAAM,KAAS,EAAE;GAAO,MAAU,KAAA,KAAa,EAAE;GAAU;GAAU,CACjF,OAAO,QAAQ,CAAC,KAAK,IACA;EAAY;EAAQ;EAAgB,CAAA;;AAQ9D,SAAgB,IAAkB;AAChC,QAAO,kBAAC,QAAD;EAAM,WAAW,EAAE;EAAQ,eAAY;EAAS,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwatchGrid-C-Zx2Exd.js","names":[],"sources":["../../src/components/SwatchGrid/SwatchGrid.module.css","../../src/components/SwatchGrid/SwatchGrid.tsx"],"sourcesContent":[".grid {\n display: grid;\n grid-template-columns: repeat(var(--columns), minmax(0, 1fr));\n}\n\n.swatch {\n aspect-ratio: 1 / 1;\n min-inline-size: 0;\n /* A labkit host's :where(button) default sets a control height. */\n block-size: auto;\n padding: 0;\n border: 0.5px solid var(--wzl-border);\n border-radius: 0;\n /* The color over the checker, so a translucent swatch reads as one. */\n background:\n linear-gradient(var(--swatch), var(--swatch)),\n repeating-conic-gradient(var(--wzl-checker-a) 0% 25%, var(--wzl-checker-b) 0% 50%)\n 50% / var(--wzl-checker-size) var(--wzl-checker-size);\n background-clip: padding-box;\n cursor: pointer;\n}\n\n.swatch:hover {\n border-color: var(--wzl-fg-muted);\n}\n\n.swatch[aria-current] {\n border-color: var(--wzl-accent);\n box-shadow: 0 0 0 1px var(--wzl-accent);\n}\n\n.swatch:focus-visible {\n position: relative;\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: 1px;\n}\n\n/* No paint: the checker crossed by the danger diagonal. */\n.swatch[data-none] {\n background:\n linear-gradient(\n 45deg,\n transparent calc(50% - 1px),\n var(--wzl-danger) calc(50% - 1px),\n var(--wzl-danger) calc(50% + 1px),\n transparent calc(50% + 1px)\n ),\n repeating-conic-gradient(var(--wzl-checker-a) 0% 25%, var(--wzl-checker-b) 0% 50%)\n 50% / var(--wzl-checker-size) var(--wzl-checker-size);\n}\n","import { useRef, type CSSProperties, type KeyboardEvent, type ReactElement } from 'react';\nimport s from './SwatchGrid.module.css';\n\n/** One swatch. `value: null` is the \"no paint\" swatch. */\nexport interface SwatchGridOption {\n value: string | null;\n /** Accessible name and tooltip. Defaults to the value, or \"None\". */\n label?: string;\n}\n\n/** Props for {@link SwatchGrid}. */\nexport interface SwatchGridProps {\n options: readonly SwatchGridOption[];\n /** The swatch to mark current, if any matches. */\n value?: string | null;\n /** A click, Enter or Space on a swatch. */\n onChange: (value: string | null) => void;\n /** The alternate target — shift-click, right-click (the browser menu is\n * suppressed) and Shift+Enter. Drawing apps route this to the slot that\n * isn't focused: click for fill, shift-click for stroke. */\n onAltChange?: (value: string | null) => void;\n /** Swatches per row; also the step for ArrowUp/ArrowDown. Default 6. */\n columns?: number;\n 'aria-label'?: string;\n className?: string;\n}\n\nfunction nameOf(o: SwatchGridOption): string {\n return o.label ?? o.value ?? 'None';\n}\n\n/**\n * A palette: a grid of color swatches that apply on click. Keyboard focus\n * roves — one tab stop, on the current swatch, with the arrows moving by one\n * across and by a row up and down.\n *\n * The grid applies nothing itself. `onChange` and `onAltChange` hand the\n * color to the app, which decides what \"apply\" means: set its active paint,\n * write the selection through `useOngoingAction`'s `commit`, or both.\n */\nexport function SwatchGrid(props: SwatchGridProps): ReactElement {\n const { options, value, onChange, onAltChange, className } = props;\n const columns = props.columns ?? 6;\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n const current = value === undefined ? -1 : options.findIndex((o) => o.value === value);\n const tabStop = current >= 0 ? current : 0;\n\n const focusAt = (i: number): void => {\n rootRef.current?.querySelectorAll<HTMLElement>('button')[i]?.focus();\n };\n\n const onKeyDown = (i: number) => (e: KeyboardEvent<HTMLButtonElement>): void => {\n const last = options.length - 1;\n let next = -1;\n switch (e.key) {\n case 'ArrowLeft': next = Math.max(0, i - 1); break;\n case 'ArrowRight': next = Math.min(last, i + 1); break;\n case 'ArrowUp': next = i - columns >= 0 ? i - columns : i; break;\n case 'ArrowDown': next = i + columns <= last ? i + columns : i; break;\n case 'Home': next = 0; break;\n case 'End': next = last; break;\n case 'Enter':\n if (e.shiftKey && onAltChange) {\n e.preventDefault();\n onAltChange(options[i].value);\n }\n return;\n default: return;\n }\n e.preventDefault();\n if (next !== i) focusAt(next);\n };\n\n return (\n <div\n ref={rootRef}\n className={[s.grid, className].filter(Boolean).join(' ')}\n role=\"group\"\n aria-label={props['aria-label']}\n style={{ '--columns': columns } as CSSProperties}\n >\n {options.map((o, i) => {\n const name = nameOf(o);\n return (\n <button\n key={o.value ?? `none-${i}`}\n type=\"button\"\n className={s.swatch}\n aria-label={name}\n title={name}\n tabIndex={i === tabStop ? 0 : -1}\n aria-current={i === current ? 'true' : undefined}\n {...(o.value === null\n ? { 'data-none': '' }\n : { style: { '--swatch': o.value } as CSSProperties })}\n onClick={(e) => {\n if (e.shiftKey && onAltChange) onAltChange(o.value);\n else onChange(o.value);\n }}\n onContextMenu={onAltChange ? (e) => { e.preventDefault(); onAltChange(o.value); } : undefined}\n onKeyDown={onKeyDown(i)}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AC2BA,SAAS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UAAU,MAAM,IAAU,IAAI;IAC9B,gBAAc,MAAM,IAAU,SAAS,KAAA;IACvC,GAAK,EAAE,UAAU,OACb,EAAE,aAAa,IAAI,GACnB,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAmB;IACvD,UAAU,MAAM;AACd,KAAI,EAAE,YAAY,IAAa,EAAY,EAAE,MAAM,GAC9C,EAAS,EAAE,MAAM;;IAExB,eAAe,KAAe,MAAM;AAAsB,KAApB,EAAE,gBAAgB,EAAE,EAAY,EAAE,MAAM;QAAM,KAAA;IACpF,WAAW,EAAU,EAAE;IACvB,EAhBK,EAAE,SAAS,QAAQ,IAgBxB;IAEJ;EACE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Switch-DxF7TsEu.js","names":[],"sources":["../../src/components/Switch/Switch.module.css","../../src/components/Switch/Switch.tsx"],"sourcesContent":[".switch {\n display: inline-flex;\n align-items: center;\n gap: var(--wzl-space-4);\n cursor: pointer;\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size);\n color: var(--wzl-fg);\n user-select: none;\n -webkit-user-select: none;\n}\n\n.switch[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.track {\n position: relative;\n flex: 0 0 auto;\n width: 28px;\n height: 16px;\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border-strong);\n border-radius: var(--wzl-radius-pill);\n transition: background-color var(--wzl-motion-fast), border-color var(--wzl-motion-fast), box-shadow var(--wzl-motion-fast);\n}\n\n.switch[data-focus-visible] .track {\n box-shadow: 0 0 0 2px var(--wzl-focus-ring);\n}\n\n.switch[data-selected] .track {\n background: var(--wzl-accent-strong);\n border-color: var(--wzl-accent-strong);\n}\n\n.thumb {\n position: absolute;\n top: 1px;\n left: 1px;\n width: 12px;\n height: 12px;\n background: var(--wzl-fg);\n border-radius: 50%;\n transition: transform var(--wzl-motion-fast);\n}\n\n.switch[data-selected] .thumb {\n transform: translateX(12px);\n background: var(--wzl-fg-on-accent);\n}\n\n.label {\n line-height: 1.2;\n}\n","import { forwardRef, type ReactNode, type Ref } from 'react';\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from 'react-aria-components';\nimport s from './Switch.module.css';\n\n/**\n * Props for {@link Switch}, on top of React Aria's `Switch` props. The label\n * is passed as children.\n */\nexport type SwitchProps = Omit<RACSwitchProps, 'children' | 'className'> & {\n children?: ReactNode;\n className?: string;\n};\n\n/**\n * On/off toggle wrapping React Aria's Switch, skinned against the `--wzl-*`\n * tokens. Use for a setting that takes effect immediately; use `Checkbox`\n * for one that is submitted with a form.\n *\n * `ref` forwards to the underlying label element.\n */\nexport const Switch = forwardRef(function Switch(\n props: SwitchProps,\n ref: Ref<HTMLLabelElement>,\n) {\n const { children, className, ...rest } = props;\n return (\n <RACSwitch\n {...rest}\n ref={ref}\n className={[s.switch, className].filter(Boolean).join(' ')}\n >\n <span className={s.track}>\n <span className={s.thumb} />\n </span>\n {children !== undefined && <span className={s.label}>{children}</span>}\n </RACSwitch>\n );\n});\n"],"mappings":";;;;;;;;GCuBa,IAAS,EAAW,SAC/B,GACA,GACA;CACA,IAAM,EAAE,aAAU,cAAW,GAAG,MAAS;AACzC,QACE,kBAAC,GAAD;EACE,GAAI;EACC;EACL,WAAW,CAAC,EAAE,QAAQ,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAH5D,CAKE,kBAAC,QAAD;GAAM,WAAW,EAAE;aACjB,kBAAC,QAAD,EAAM,WAAW,EAAE,OAAS,CAAA;GACvB,CAAA,EACN,MAAa,KAAA,KAAa,kBAAC,QAAD;GAAM,WAAW,EAAE;GAAQ;GAAgB,CAAA,CAC5D;;EAEd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tabs-GXEfoe3o.js","names":[],"sources":["../../src/components/Tabs/Tabs.module.css","../../src/components/Tabs/Tabs.tsx"],"sourcesContent":[".tabs {\n display: flex;\n flex-direction: column;\n gap: 0;\n font-family: var(--wzl-font-ui);\n color: var(--wzl-fg);\n}\n\n.tabs[data-orientation=\"horizontal\"] {\n flex-direction: column;\n}\n\n.tabs[data-orientation=\"vertical\"] {\n flex-direction: row;\n gap: var(--wzl-space-6);\n}\n\n.list {\n display: flex;\n gap: var(--wzl-space-1);\n border-bottom: 1px solid var(--wzl-border);\n}\n\n.tabs[data-orientation=\"vertical\"] .list {\n flex-direction: column;\n border-bottom: none;\n border-right: 1px solid var(--wzl-border);\n padding-right: var(--wzl-space-4);\n}\n\n.tab {\n position: relative;\n padding: var(--wzl-space-3) var(--wzl-space-5);\n background: transparent;\n border: none;\n color: var(--wzl-fg-muted);\n font: inherit;\n font-size: var(--wzl-font-size-sm);\n cursor: pointer;\n outline: none;\n transition: color var(--wzl-motion-fast);\n}\n\n.tab[data-hovered]:not([data-disabled]) {\n color: var(--wzl-fg);\n}\n\n.tab[data-selected] {\n color: var(--wzl-fg);\n}\n\n.tab[data-selected]::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: -1px;\n height: 2px;\n background: var(--wzl-accent-strong);\n}\n\n.tabs[data-orientation=\"vertical\"] .tab[data-selected]::after {\n left: auto;\n right: -9px;\n top: 0;\n bottom: 0;\n width: 2px;\n height: auto;\n}\n\n.tab[data-focus-visible] {\n box-shadow: inset 0 0 0 2px var(--wzl-focus-ring);\n border-radius: var(--wzl-radius-sm);\n}\n\n.tab[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.panel {\n padding: var(--wzl-space-6) 0;\n outline: none;\n}\n\n.panel[data-focus-visible] {\n box-shadow: inset 0 0 0 2px var(--wzl-focus-ring);\n border-radius: var(--wzl-radius-sm);\n}\n","import type { ReactNode } from 'react';\nimport {\n Tabs as RACTabs,\n TabList as RACTabList,\n Tab as RACTab,\n TabPanel as RACTabPanel,\n type TabsProps as RACTabsProps,\n type TabListProps as RACTabListProps,\n type TabProps as RACTabProps,\n type TabPanelProps as RACTabPanelProps,\n} from 'react-aria-components';\nimport s from './Tabs.module.css';\n\n/** Props for {@link Tabs}, on top of React Aria's `Tabs` props. */\nexport type TabsProps = Omit<RACTabsProps, 'className' | 'children'> & {\n children?: ReactNode;\n className?: string;\n};\n\n/**\n * Tab set wrapping React Aria's Tabs, skinned against the `--wzl-*` tokens.\n * Holds a {@link TabList} and one {@link TabPanel} per tab.\n */\nexport function Tabs({ children, className, ...rest }: TabsProps) {\n return (\n <RACTabs {...rest} className={[s.tabs, className].filter(Boolean).join(' ')}>\n {children}\n </RACTabs>\n );\n}\n\n/** Props for {@link TabList}, on top of React Aria's `TabList` props. */\nexport type TabListProps<T extends object> = Omit<RACTabListProps<T>, 'className'> & {\n className?: string;\n};\n\n/** The row of tab buttons inside a {@link Tabs}. */\nexport function TabList<T extends object>({ className, ...rest }: TabListProps<T>) {\n return <RACTabList<T> {...rest} className={[s.list, className].filter(Boolean).join(' ')} />;\n}\n\n/** Props for {@link Tab}, on top of React Aria's `Tab` props. */\nexport type TabProps = Omit<RACTabProps, 'className' | 'children'> & {\n children?: ReactNode;\n className?: string;\n};\n\n/** One tab button. Its `id` selects the {@link TabPanel} it reveals. */\nexport function Tab({ children, className, ...rest }: TabProps) {\n return (\n <RACTab {...rest} className={[s.tab, className].filter(Boolean).join(' ')}>\n {children}\n </RACTab>\n );\n}\n\n/** Props for {@link TabPanel}, on top of React Aria's `TabPanel` props. */\nexport type TabPanelProps = Omit<RACTabPanelProps, 'className' | 'children'> & {\n children?: ReactNode;\n className?: string;\n};\n\n/** The content shown for the {@link Tab} whose `id` matches this panel's. */\nexport function TabPanel({ children, className, ...rest }: TabPanelProps) {\n return (\n <RACTabPanel {...rest} className={[s.panel, className].filter(Boolean).join(' ')}>\n {children}\n </RACTabPanel>\n );\n}\n"],"mappings":";;;;;;;;;;ACuBA,SAAgB,EAAK,EAAE,aAAU,cAAW,GAAG,KAAmB;AAChE,QACE,kBAAC,GAAD;EAAS,GAAI;EAAM,WAAW,CAAC,EAAE,MAAM,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EACxE;EACO,CAAA;;AAUd,SAAgB,EAA0B,EAAE,cAAW,GAAG,KAAyB;AACjF,QAAO,kBAAC,GAAD;EAAe,GAAI;EAAM,WAAW,CAAC,EAAE,MAAM,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAAI,CAAA;;AAU9F,SAAgB,EAAI,EAAE,aAAU,cAAW,GAAG,KAAkB;AAC9D,QACE,kBAAC,GAAD;EAAQ,GAAI;EAAM,WAAW,CAAC,EAAE,KAAK,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EACtE;EACM,CAAA;;AAWb,SAAgB,EAAS,EAAE,aAAU,cAAW,GAAG,KAAuB;AACxE,QACE,kBAAC,GAAD;EAAa,GAAI;EAAM,WAAW,CAAC,EAAE,OAAO,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAC7E;EACW,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Timeline-SgmpQtUV.js","names":[],"sources":["../../src/components/Timeline/Timeline.module.css","../../src/components/Timeline/easingSpec.ts","../../src/components/Timeline/EasingPicker.tsx","../../src/components/Timeline/timeScale.ts","../../src/components/Timeline/LaneGraph.tsx","../../src/components/Timeline/Lane.tsx","../../src/components/Timeline/Ruler.tsx","../../src/components/Timeline/Transport.tsx","../../src/components/Timeline/lanes.ts","../../src/components/Timeline/keys.ts","../../src/components/Timeline/Timeline.tsx","../../src/components/Timeline/AnimatedTimeline.tsx"],"sourcesContent":[".ruler {\n position: relative;\n height: var(--wzl-control-h, 24px);\n border-bottom: 1px solid var(--wzl-border);\n background: var(--wzl-surface-raised);\n cursor: ew-resize;\n user-select: none;\n overflow: hidden;\n}\n\n.tick {\n position: absolute;\n top: 0;\n transform: translateX(2px);\n color: var(--wzl-fg-muted);\n pointer-events: none;\n white-space: nowrap;\n}\n\n.tick::before {\n content: '';\n position: absolute;\n left: -2px;\n top: 0;\n bottom: 0;\n border-left: 1px solid var(--wzl-border);\n}\n\n.playhead {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1px;\n background: var(--wzl-accent-strong);\n pointer-events: none;\n}\n\n.lane {\n display: flex;\n align-items: stretch;\n min-height: var(--wzl-control-h-sm);\n border-bottom: 1px solid var(--wzl-line-subtle);\n}\n\n.laneLabel {\n /* Must match `.gutter`'s width exactly, or every key sits off the ruler. */\n box-sizing: border-box;\n flex: 0 0 var(--wzl-timeline-label-w, 120px);\n display: flex;\n align-items: center;\n gap: var(--wzl-space-2);\n padding-inline: var(--wzl-space-3);\n padding-inline-start: calc(var(--wzl-space-3) + var(--depth, 0) * var(--wzl-space-6));\n font-size: var(--wzl-font-size);\n color: var(--wzl-fg);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.lane[data-depth='1'] .laneLabel { --depth: 1; }\n.lane[data-depth='2'] .laneLabel { --depth: 2; }\n.lane[data-depth='3'] .laneLabel { --depth: 3; }\n\n.disclosure { display: inline-flex; flex: none; cursor: pointer; }\n\n.laneTrack {\n position: relative;\n flex: 1 1 auto;\n min-width: 0;\n background: var(--wzl-surface);\n}\n\n.key, .eventMark {\n position: absolute;\n top: 50%;\n width: var(--wzl-handle-size);\n height: var(--wzl-handle-size);\n margin-left: calc(var(--wzl-handle-size) / -2);\n background: var(--wzl-fg-muted);\n cursor: ew-resize;\n}\n\n.key { transform: translateY(-50%) rotate(45deg); }\n.eventMark { transform: translateY(-50%); border-radius: 50%; }\n\n.key[aria-current='true'], .eventMark[aria-current='true'] { background: var(--wzl-accent-strong); }\n.key:focus-visible, .eventMark:focus-visible { outline: 2px solid var(--wzl-focus-ring); outline-offset: 1px; }\n\n/* The key stays drawn where it was committed while its ghost tracks the\n pointer, so the drag reads as a move from somewhere to somewhere. */\n.key[data-dragging='true'], .eventMark[data-dragging='true'] { opacity: 0.4; }\n\n.keyGhost, .eventGhost {\n position: absolute;\n top: 50%;\n width: var(--wzl-handle-size);\n height: var(--wzl-handle-size);\n margin-left: calc(var(--wzl-handle-size) / -2);\n background: var(--wzl-accent-soft);\n border: 1px dashed var(--wzl-accent-strong);\n pointer-events: none;\n}\n\n.keyGhost { transform: translateY(-50%) rotate(45deg); }\n.eventGhost { transform: translateY(-50%); border-radius: 50%; }\n\n.lane[data-mode='graph'] { min-height: 72px; }\n\n/* A numeric lane in graph mode is a curve editor filling the track. */\n.graphHost {\n position: absolute;\n inset: 0;\n}\n\n/* Out-specifies the editor's own defaults: the lane keeps the track's ground\n and the timeline's accent line rather than a plot's. */\n.graphHost .graph {\n --plot-bg: transparent;\n --curve-line: var(--wzl-accent-strong);\n --curve-line-width: 1px;\n}\n\n/* A graph lane's value labels hang off the track's start edge into the label\n column, so the lane's own label ellipsizes before it reaches them. */\n.lane[data-graph='true'] .laneLabel {\n padding-inline-end: calc(var(--wzl-space-3) + var(--wzl-timeline-value-axis-w, 32px));\n}\n\n.nestedBar {\n position: absolute;\n top: 4px;\n bottom: 4px;\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n}\n\n.transport {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n padding: var(--wzl-space-2) var(--wzl-space-3);\n border-bottom: 1px solid var(--wzl-border);\n background: var(--wzl-surface-raised);\n}\n\n.transportButton {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--wzl-icon-button-size);\n padding: var(--wzl-space-1) var(--wzl-space-3);\n /* Sits on `--wzl-surface-raised`, so a transparent fill and a border that\n close in value leave it reading as text rather than as a control. */\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n cursor: pointer;\n}\n\n.transportButton:hover { border-color: var(--wzl-fg-muted); }\n\n.transportButton[aria-checked='true'] {\n background: var(--wzl-accent-soft);\n border-color: var(--wzl-accent-strong);\n color: var(--wzl-accent-fg);\n}\n\n/* The bar's chrome lives on the row, so controls beside `<Transport>` sit\n inside it rather than hanging off the panel's corner. `.transport` keeps its\n own chrome for standalone use. */\n.transportRow {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n padding-inline-end: var(--wzl-space-3);\n border-bottom: 1px solid var(--wzl-border);\n background: var(--wzl-surface-raised);\n}\n\n.transportRow > .transport {\n flex: 1 1 auto;\n border-bottom: 0;\n background: transparent;\n}\n\n/* Last in the row, and growing leftward into the slack `margin-inline-start`\n leaves it: the playhead rewrites this every frame and gains a digit at 10s,\n so anything laid out after it would vibrate. */\n.time {\n margin-inline-start: auto;\n text-align: end;\n font-variant-numeric: tabular-nums;\n color: var(--wzl-fg-muted);\n}\n.rate { display: inline-flex; align-items: center; gap: var(--wzl-space-3); color: var(--wzl-fg-muted); }\n.rateSlider { width: 88px; }\n\n/* The detents carry no labels in a bar this dense, so the chosen rate is said\n once, here, in a fixed-width cell so the controls beside it never shift. */\n.rateReadout {\n min-width: 3ch;\n font-variant-numeric: tabular-nums;\n color: var(--wzl-fg);\n}\n\n.root {\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n /* `--wzl-font-ui` is condensed, so it reads a size smaller than it measures.\n Everything below inherits this; override per rule only to go up. */\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size-sm);\n line-height: var(--wzl-leading-snug);\n}\n\n.label { padding: var(--wzl-space-2) var(--wzl-space-3); color: var(--wzl-fg-muted); }\n\n.body { display: flex; align-items: stretch; }\n.gutter { box-sizing: border-box; flex: 0 0 var(--wzl-timeline-label-w, 120px); border-right: 1px solid var(--wzl-border); }\n.rulerWrap { flex: 1 1 auto; min-width: 0; }\n\n.lanes {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.inspector {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n padding: var(--wzl-space-2) var(--wzl-space-3);\n border-top: 1px solid var(--wzl-border);\n background: var(--wzl-surface-raised);\n}\n\n.segment {\n position: absolute;\n top: 0;\n bottom: 0;\n cursor: pointer;\n}\n\n.segment[aria-current='true'] { background: var(--wzl-accent-soft); }\n.segment:focus-visible { outline: 2px solid var(--wzl-focus-ring); outline-offset: -2px; }\n\n.easingPicker { display: inline-flex; align-items: center; gap: var(--wzl-space-3); }\n.easingLabel { font-variant-numeric: tabular-nums; color: var(--wzl-fg-muted); }\n\n.easingPreview {\n width: 32px;\n height: 32px;\n fill: none;\n stroke: var(--wzl-accent-strong);\n stroke-width: 1;\n border: 1px solid var(--wzl-border);\n}\n\n","import { EASINGS, resolveEasing, type EasingName, type EasingSpec } from '@weasel-js/core';\n\nfunction bezierOf(spec: EasingSpec): readonly [number, number, number, number] | null {\n if (typeof spec === 'object' && spec !== null && 'bezier' in spec) return spec.bezier;\n return null;\n}\n\n/** Control points, for the graph view's draggable handles. `null` means this\n * spec has no handles to drag — the view offers to convert it to a bezier. */\nexport function easingBezier(spec?: EasingSpec): readonly [number, number, number, number] | null {\n if (spec === undefined) return null;\n return bezierOf(spec);\n}\n\n/** What the picker shows for a spec.\n *\n * A function is matched against the built-ins by reference so a consumer that\n * passed `easeOutBack` directly still reads back as `'easeOutBack'`. A wrapped\n * or hand-written function cannot be named and reads as `'custom'` — which is\n * why an editor writes names and control points rather than functions. */\nexport function easingLabel(spec?: EasingSpec): string {\n if (spec === undefined) return 'linear';\n if (typeof spec === 'string') return spec;\n const b = bezierOf(spec);\n if (b) return `cubic-bezier(${b.join(', ')})`;\n for (const [name, fn] of Object.entries(EASINGS)) {\n if (fn === spec) return name;\n }\n return 'custom';\n}\n\n/** `count` evenly spaced samples of the curve over 0..1, for drawing it. */\nexport function sampleEasing(spec: EasingSpec | undefined, count: number): number[] {\n const fn = resolveEasing(spec);\n const out = new Array<number>(count);\n const last = count - 1;\n for (let i = 0; i < count; i++) out[i] = fn(last === 0 ? 0 : i / last);\n return out;\n}\n\n/** Every built-in name, for the picker's list. */\nexport const EASING_NAMES = Object.keys(EASINGS) as EasingName[];\n","import type { ReactElement } from 'react';\nimport type { EasingSpec } from '@weasel-js/core';\nimport s from './Timeline.module.css';\nimport { EASING_NAMES, easingBezier, easingLabel, sampleEasing } from './easingSpec';\n\n/** Samples drawn in the inline curve preview. */\nconst PREVIEW_SAMPLES = 24;\n\n/** Control points for the named curves the picker can convert. A name the table\n * does not cover converts to the CSS default rather than refusing. */\nconst BEZIER_OF: Partial<Record<string, readonly [number, number, number, number]>> = {\n linear: [0, 0, 1, 1],\n easeInQuad: [0.11, 0, 0.5, 0],\n easeOutQuad: [0.5, 1, 0.89, 1],\n easeInOutQuad: [0.45, 0, 0.55, 1],\n easeInCubic: [0.32, 0, 0.67, 0],\n easeOutCubic: [0.33, 1, 0.68, 1],\n easeInOutCubic: [0.65, 0, 0.35, 1],\n easeInSine: [0.12, 0, 0.39, 0],\n easeOutSine: [0.61, 1, 0.88, 1],\n easeInOutSine: [0.37, 0, 0.63, 1],\n};\n\nconst DEFAULT_BEZIER: readonly [number, number, number, number] = [0.25, 0.1, 0.25, 1];\n\nexport interface EasingPickerProps {\n value: EasingSpec | undefined;\n onChange: (next: EasingSpec | undefined) => void;\n}\n\nexport function EasingPicker(props: EasingPickerProps): ReactElement {\n const { value, onChange } = props;\n const bezier = easingBezier(value);\n const label = easingLabel(value);\n const named = bezier === null && (EASING_NAMES as string[]).includes(label);\n const selectValue = bezier !== null ? 'custom' : named ? label : 'linear';\n\n const points = sampleEasing(value, PREVIEW_SAMPLES)\n .map((v, i) => `${(i / (PREVIEW_SAMPLES - 1)) * 100},${100 - v * 100}`)\n .join(' ');\n\n return (\n <div className={s.easingPicker}>\n <label>\n Easing\n <select\n value={selectValue}\n onChange={(e) => onChange(e.target.value === 'linear' ? undefined : e.target.value as EasingSpec)}\n >\n <option value=\"linear\">linear</option>\n {EASING_NAMES.filter((n) => n !== 'linear').map((n) => <option key={n} value={n}>{n}</option>)}\n {bezier !== null ? <option value=\"custom\">custom</option> : null}\n </select>\n </label>\n\n {bezier !== null ? <span className={s.easingLabel}>{label}</span> : (\n <button\n type=\"button\"\n className={s.transportButton}\n onClick={() => onChange({ bezier: BEZIER_OF[selectValue] ?? DEFAULT_BEZIER })}\n >\n Convert to bezier\n </button>\n )}\n\n <svg className={s.easingPreview} data-testid=\"easing-preview\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\">\n <polyline points={points} vectorEffect=\"non-scaling-stroke\" />\n </svg>\n </div>\n );\n}\n","import { niceStep } from '../Plot2D/ticks';\n\n/** A visible span of timeline time, in ms. */\nexport interface TimeWindow {\n from: number;\n to: number;\n}\n\nexport interface TimeScale {\n window: TimeWindow;\n widthPx: number;\n toPx(ms: number): number;\n toMs(px: number): number;\n}\n\n/** Narrowest window the user can zoom to, in ms. Below this the playhead and\n * the keys it sits between stop being separable at any sane track width. */\nconst MIN_SPAN_MS = 1;\n\nexport function createTimeScale(window: TimeWindow, widthPx: number): TimeScale {\n const span = window.to - window.from;\n const perMs = span === 0 ? 0 : widthPx / span;\n const perPx = widthPx === 0 ? 0 : span / widthPx;\n return {\n window,\n widthPx,\n toPx: (ms) => (ms - window.from) * perMs,\n toMs: (px) => window.from + px * perPx,\n };\n}\n\n/** Where `ms` sits in the window, as a fraction. The width-free half of\n * `createTimeScale` — a CSS `left: %` needs no pixel width, and asking for one\n * is what drove three copies of this arithmetic into the lane and the ruler. */\nexport function toFraction(window: TimeWindow, ms: number): number {\n const span = window.to - window.from;\n return span === 0 ? 0 : (ms - window.from) / span;\n}\n\n/** `toFraction` as a CSS percentage. */\nexport function toPercent(window: TimeWindow, ms: number): string {\n return `${toFraction(window, ms) * 100}%`;\n}\n\n/** A duration as a fraction of the window. Distinct from `toFraction`, which\n * measures a position and so subtracts `window.from`. */\nexport function spanFraction(window: TimeWindow, ms: number): number {\n const span = window.to - window.from;\n return span === 0 ? 0 : ms / span;\n}\n\n/** A duration as a CSS percentage, for a width. */\nexport function spanPercent(window: TimeWindow, ms: number): string {\n return `${spanFraction(window, ms) * 100}%`;\n}\n\nfunction clampWindow(w: TimeWindow, bounds: TimeWindow): TimeWindow {\n const span = Math.min(w.to - w.from, bounds.to - bounds.from);\n let from = w.from;\n if (from < bounds.from) from = bounds.from;\n if (from + span > bounds.to) from = bounds.to - span;\n return { from, to: from + span };\n}\n\n/** Scale the window by `factor` about `atMs`, which stays at the same fraction\n * of the track. `factor < 1` zooms in. */\nexport function zoomWindow(\n w: TimeWindow, atMs: number, factor: number, bounds: TimeWindow,\n): TimeWindow {\n const span = w.to - w.from;\n const maxSpan = bounds.to - bounds.from;\n const nextSpan = Math.min(maxSpan, Math.max(MIN_SPAN_MS, span * factor));\n const frac = span === 0 ? 0.5 : (atMs - w.from) / span;\n return clampWindow({ from: atMs - frac * nextSpan, to: atMs + (1 - frac) * nextSpan }, bounds);\n}\n\n/** Shift the window by `byMs`, preserving its span. */\nexport function panWindow(w: TimeWindow, byMs: number, bounds: TimeWindow): TimeWindow {\n return clampWindow({ from: w.from + byMs, to: w.to + byMs }, bounds);\n}\n\n/** Minimum gap between time ticks, in px — the ruler's and the graph grid's. */\nexport const TICK_SPACING_PX = 64;\n\n/** Ruler tick times inside `w`, spaced at least `minSpacingPx` apart. */\nexport function tickTimes(w: TimeWindow, widthPx: number, minSpacingPx: number): number[] {\n const span = w.to - w.from;\n if (widthPx <= 0 || span <= 0) return [];\n const step = niceStep((minSpacingPx / widthPx) * span);\n const out: number[] = [];\n for (let t = Math.ceil(w.from / step) * step; t <= w.to + 1e-9; t += step) {\n out.push(Math.round(t / step) * step);\n }\n return out;\n}\n","import { useLayoutEffect, useMemo, useRef, useState, type ReactElement } from 'react';\nimport type { Keyframe } from '@weasel-js/core';\nimport { LayeredCurveEditor } from '../CurveEditor/LayeredCurveEditor';\nimport {\n applyKeyframeDrag, createKeyframeLayer, type KeyframeLayerState,\n} from '../CurveEditor/createKeyframeLayer';\nimport s from './Timeline.module.css';\nimport { TICK_SPACING_PX, tickTimes, type TimeWindow } from './timeScale';\n\n/** Keeps the extreme keys inside the lane: at the very edge a key centers on\n * the lane's border and hangs half into its neighbor. As a percentage of\n * the lane's height, applied top and bottom. */\nconst V_INSET_PCT = 8;\n\n/** One arrow-key step, in ms; shift multiplies by ten. */\nconst KEY_STEP_MS = 10;\n\nexport interface LaneGraphProps {\n keys: readonly Keyframe<number>[];\n label: string;\n window: TimeWindow;\n /** Ruler time of this track's zero. */\n offset: number;\n /** Ruler times a dragged key snaps to. */\n snapTimes: readonly number[];\n selection: number | null;\n selectedSegment: number | null;\n onSelect: (keyIndex: number) => void;\n onSelectSegment?: (keyIndex: number) => void;\n /** Live during a key drag. */\n onKeysInput?: (keys: readonly Keyframe<number>[]) => void;\n /** Once per edit: a drag's end, a handle's release, a key press. */\n onKeysCommit: (keys: readonly Keyframe<number>[]) => void;\n}\n\n/** The value range a lane plots: its keys' extent, padded so no key sits on\n * the border. A flat track gets a unit span so it still has a middle. */\nfunction valueRange(keys: readonly Keyframe<number>[]): [number, number] {\n const values = keys.map((k) => k.value);\n const lo = Math.min(...values);\n const hi = Math.max(...values);\n const span = hi - lo || 1;\n const pad = (span * V_INSET_PCT) / (100 - 2 * V_INSET_PCT);\n return [lo - pad, lo + span + pad];\n}\n\n/** A numeric lane's graph: one keyframe layer on a curve editor, sized to the\n * lane and windowed to the ruler. */\nexport function LaneGraph(props: LaneGraphProps): ReactElement {\n const {\n keys, label, window: win, offset, snapTimes, selection, selectedSegment,\n onSelect, onSelectSegment, onKeysInput, onKeysCommit,\n } = props;\n\n const hostRef = useRef<HTMLDivElement | null>(null);\n const [size, setSize] = useState({ width: 0, height: 0 });\n useLayoutEffect(() => {\n const el = hostRef.current;\n if (!el) return;\n const update = (): void => {\n const r = el.getBoundingClientRect();\n setSize((prev) => (prev.width === r.width && prev.height === r.height ? prev : { width: r.width, height: r.height }));\n };\n update();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(update);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n const layer = useMemo(() => createKeyframeLayer({\n id: 'keys',\n label,\n formatX: (t) => `${Math.round(t)} ms`,\n // The layer works in track time; the snap candidates are ruler times.\n snapX: snapTimes.map((t) => t - offset),\n xClamp: [0, Infinity],\n step: { x: KEY_STEP_MS },\n }), [label, snapTimes, offset]);\n\n const committed = useMemo<KeyframeLayerState>(\n () => ({ keys, selectedKey: selection, selectedSegment, drag: null }),\n [keys, selection, selectedSegment],\n );\n // Held only while a gesture is in flight, so a consumer echoing live input\n // back through `keys` cannot move the keys out from under the drag.\n const [live, setLive] = useState<KeyframeLayerState | null>(null);\n const state = live ?? committed;\n const stateRef = useRef(state);\n stateRef.current = state;\n\n const layers = useMemo(() => [{ layer, state: state as unknown }], [layer, state]);\n\n const onLayerChange = (_id: string, raw: unknown): void => {\n const next = raw as KeyframeLayerState;\n const prev = stateRef.current;\n if (next.selectedKey !== null && next.selectedKey !== prev.selectedKey) onSelect(next.selectedKey);\n if (next.selectedSegment !== null && next.selectedSegment !== prev.selectedSegment) onSelectSegment?.(next.selectedSegment);\n if (!next.drag) { setLive(null); return; }\n setLive(next);\n // A handle drag writes a fresh easing spec per move; publishing those\n // would grow the consumer's easing cache by one entry per pixel.\n if (next.drag.kind !== 'key') return;\n const applied = applyKeyframeDrag(next).keys;\n if (applied !== next.keys) onKeysInput?.(applied);\n };\n\n const onLayerCommit = (_id: string, raw: unknown, rawPrev: unknown): void => {\n setLive(null);\n const next = raw as KeyframeLayerState;\n if (next.keys !== (rawPrev as KeyframeLayerState).keys) onKeysCommit(next.keys);\n };\n\n const [yLo, yHi] = valueRange(state.keys);\n const ticks = size.width > 0 ? tickTimes(win, size.width, TICK_SPACING_PX) : [];\n\n return (\n <div ref={hostRef} className={s.graphHost}>\n {size.width > 0 && size.height > 0 ? (\n <LayeredCurveEditor\n className={s.graph}\n aria-label={`${label} graph`}\n layers={layers}\n onLayerChange={onLayerChange}\n onLayerCommit={onLayerCommit}\n width={size.width}\n height={size.height}\n xRange={[win.from - offset, win.to - offset]}\n yRange={[yLo, yHi]}\n grid={false}\n axes={false}\n // The ruler's ticks, carried into track time.\n xTicks={{ values: ticks.map((t) => t - offset), labels: false }}\n // Clears a key at the track's start edge, which hangs into the gutter.\n yTicks={{ labels: 'outside', gap: 10 }}\n history={false}\n />\n ) : null}\n </div>\n );\n}\n","import { useEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent, type ReactElement } from 'react';\nimport { openPointerSession, type EventTrack, type Keyframe, type PointerSession, type SampledTrack, type TimelineTrack } from '@weasel-js/core';\nimport { DisclosureMark } from '../Disclosure';\nimport s from './Timeline.module.css';\nimport { createTimeScale, spanPercent, toPercent, type TimeWindow } from './timeScale';\nimport { SNAP_RADIUS_PX, snapToNearest } from '../../snap';\nimport { LaneGraph } from './LaneGraph';\nimport type { LaneRow } from './lanes';\n\n/** One arrow-key step, in ms; shift multiplies by ten. */\nconst KEY_STEP_MS = 10;\n\nexport interface LaneProps {\n row: LaneRow;\n window: TimeWindow;\n mode: 'dope' | 'graph';\n /** Index of the selected key on THIS row, or null. */\n selection: number | null;\n onSelect: (keyIndex: number) => void;\n /** Live during a dope-sheet drag. */\n onKeyInput: (keyIndex: number, toMs: number) => void;\n /** Once, at the end of a dope-sheet gesture. */\n onKeyCommit: (keyIndex: number, toMs: number) => void;\n /** Live during a graph-mode key drag: the row's whole key list. */\n onKeysInput?: (keys: readonly Keyframe<number>[]) => void;\n /** Once per graph-mode edit: the row's whole key list. */\n onKeysCommit?: (keys: readonly Keyframe<number>[]) => void;\n onInsert: (atMs: number) => void;\n onToggleExpand: () => void;\n expanded: boolean;\n /** Times a dragged key snaps to. */\n snapTimes: readonly number[];\n /** Index of the key a selected segment runs INTO, or null. */\n selectedSegment?: number | null;\n onSelectSegment?: (keyIndex: number) => void;\n}\n\nfunction entryTimes(row: LaneRow): number[] {\n if (row.kind === 'sampled') return (row.track as SampledTrack<unknown>).keys.map((k) => k.t);\n if (row.kind === 'event') return (row.track as EventTrack).events.map((e) => e.t);\n return [];\n}\n\nexport function Lane(props: LaneProps): ReactElement {\n const {\n row, window: win, mode, selection, onSelect, onKeyInput, onKeyCommit, onInsert, onToggleExpand, expanded, snapTimes,\n selectedSegment = null, onSelectSegment, onKeysInput, onKeysCommit,\n } = props;\n const trackRef = useRef<HTMLDivElement | null>(null);\n const sessionRef = useRef<PointerSession | null>(null);\n useEffect(() => () => { sessionRef.current?.cancel(); }, []);\n\n // Where the dragged key would land. Owned here rather than derived from the\n // tracks prop, so a drag previews whether or not the consumer wires\n // `onKeyInput` — the committed key stays put underneath as the origin.\n const [drag, setDrag] = useState<{ keyIndex: number; t: number } | null>(null);\n\n const pct = (ms: number): string => toPercent(win, ms + row.offset);\n\n const msAt = (clientX: number): number => {\n const rect = trackRef.current?.getBoundingClientRect();\n if (!rect) return win.from;\n return createTimeScale(win, rect.width).toMs(clientX - rect.left) - row.offset;\n };\n\n const snapPxToMs = (): number => {\n const width = trackRef.current?.getBoundingClientRect().width ?? 0;\n const scale = createTimeScale(win, width);\n return scale.toMs(SNAP_RADIUS_PX) - scale.toMs(0);\n };\n\n // Only a numeric sampled row has an honest value axis to graph.\n const graph = mode === 'graph' && row.numeric;\n const sampledKeys = row.kind === 'sampled' ? (row.track as SampledTrack<number>).keys : [];\n\n const onKeyPointerDown = (i: number) => (e: ReactPointerEvent<HTMLDivElement>): void => {\n if (e.button !== 0) return;\n e.stopPropagation();\n onSelect(i);\n\n // `snapTimes` are ruler times and `msAt` is track-local, so a nested row\n // has to cross into ruler space to snap and back out to commit.\n const at = (ev: { clientX: number; altKey: boolean }): number => {\n const raw = Math.max(0, msAt(ev.clientX));\n return ev.altKey ? raw : snapToNearest(raw + row.offset, snapTimes, snapPxToMs()) - row.offset;\n };\n\n setDrag({ keyIndex: i, t: times[i] });\n\n const end = (): void => {\n setDrag(null);\n sessionRef.current = null;\n };\n // No pointer capture — see `Ruler`, same idiom across the timeline.\n sessionRef.current?.cancel();\n sessionRef.current = openPointerSession(e.currentTarget, e, {\n onMove: (ev) => {\n setDrag({ keyIndex: i, t: at(ev) });\n onKeyInput(i, at(ev));\n },\n onEnd: (ev) => {\n onKeyCommit(i, at(ev));\n end();\n },\n onCancel: end,\n }, { capture: false });\n };\n\n const onKeyDown = (i: number, t: number) => (e: ReactKeyboardEvent<HTMLDivElement>): void => {\n const step = KEY_STEP_MS * (e.shiftKey ? 10 : 1);\n if (e.key === 'ArrowRight') { e.preventDefault(); onKeyCommit(i, t + step); }\n if (e.key === 'ArrowLeft') { e.preventDefault(); onKeyCommit(i, Math.max(0, t - step)); }\n };\n\n const times = entryTimes(row);\n\n return (\n <div className={s.lane} data-depth={row.depth} data-mode={mode} data-graph={graph ? 'true' : undefined}>\n <div className={s.laneLabel}>\n {row.kind === 'timeline' ? (\n <span\n role=\"button\"\n tabIndex={0}\n aria-expanded={expanded}\n data-testid=\"timeline-disclosure\"\n className={s.disclosure}\n onClick={onToggleExpand}\n onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onToggleExpand(); } }}\n >\n <DisclosureMark open={expanded} />\n </span>\n ) : null}\n {row.label}\n </div>\n <div\n className={s.laneTrack}\n ref={trackRef}\n data-testid=\"timeline-lane-track\"\n onDoubleClick={(e) => { if (row.kind === 'sampled') onInsert(Math.max(0, msAt(e.clientX))); }}\n >\n {graph ? (\n <LaneGraph\n keys={sampledKeys}\n label={row.label}\n window={win}\n offset={row.offset}\n snapTimes={snapTimes}\n selection={selection}\n selectedSegment={selectedSegment}\n onSelect={onSelect}\n onSelectSegment={onSelectSegment}\n onKeysInput={onKeysInput}\n onKeysCommit={(keys) => onKeysCommit?.(keys)}\n />\n ) : (\n <>\n {row.kind === 'timeline' ? (\n <div\n className={s.nestedBar}\n data-testid=\"timeline-nested\"\n style={{ left: pct(0), width: spanPercent(win, (row.track as TimelineTrack).timeline.duration ?? 0) }}\n />\n ) : null}\n {row.kind === 'sampled' ? sampledKeys.slice(1).map((k, idx) => {\n const i = idx + 1;\n return (\n <div\n key={`seg-${i}`}\n role=\"button\"\n tabIndex={0}\n aria-label={`${row.label} segment into ${Math.round(k.t)} ms`}\n aria-current={selectedSegment === i ? 'true' : undefined}\n data-testid=\"timeline-segment\"\n className={s.segment}\n style={{ left: pct(sampledKeys[i - 1].t), width: spanPercent(win, k.t - sampledKeys[i - 1].t) }}\n onClick={() => onSelectSegment?.(i)}\n onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onSelectSegment?.(i); } }}\n />\n );\n }) : null}\n {times.map((t, i) => (\n <div\n key={i}\n role=\"button\"\n tabIndex={0}\n aria-label={`${row.label} key at ${Math.round(t)} ms`}\n aria-current={selection === i ? 'true' : undefined}\n data-testid={row.kind === 'event' ? 'timeline-event' : 'timeline-key'}\n data-dragging={drag?.keyIndex === i ? 'true' : undefined}\n className={row.kind === 'event' ? s.eventMark : s.key}\n style={{ left: pct(t) }}\n onPointerDown={onKeyPointerDown(i)}\n onKeyDown={onKeyDown(i, t)}\n />\n ))}\n {drag ? (\n <div\n aria-hidden=\"true\"\n data-testid=\"timeline-key-ghost\"\n className={row.kind === 'event' ? s.eventGhost : s.keyGhost}\n style={{ left: pct(drag.t) }}\n />\n ) : null}\n </>\n )}\n </div>\n </div>\n );\n}\n","import { useEffect, useLayoutEffect, useRef, useState, type PointerEvent as ReactPointerEvent, type ReactElement, type WheelEvent as ReactWheelEvent } from 'react';\nimport { openPointerSession, type PointerSession } from '@weasel-js/core';\nimport s from './Timeline.module.css';\nimport { createTimeScale, panWindow, TICK_SPACING_PX, tickTimes, toPercent, zoomWindow, type TimeWindow } from './timeScale';\n\n/** One wheel notch's zoom factor. */\nconst ZOOM_STEP = 0.0015;\n\nexport interface RulerProps {\n window: TimeWindow;\n /** The full extent the window may cover — normally `{ from: 0, to: duration }`. */\n bounds: TimeWindow;\n playhead: number;\n onScrub: (t: number) => void;\n onWindowChange: (w: TimeWindow) => void;\n}\n\nfunction formatMs(ms: number): string {\n if (ms >= 1000) return `${(ms / 1000).toFixed(ms % 1000 === 0 ? 0 : 2)}s`;\n return `${Math.round(ms)}ms`;\n}\n\nexport function Ruler(props: RulerProps): ReactElement {\n const { window: win, bounds, playhead, onScrub, onWindowChange } = props;\n const trackRef = useRef<HTMLDivElement | null>(null);\n const sessionRef = useRef<PointerSession | null>(null);\n useEffect(() => () => { sessionRef.current?.cancel(); }, []);\n\n // Re-render once the track is mounted so ticks lay out against its real\n // width — `trackRef.current` is null on the render that first attaches it.\n const [width, setWidth] = useState(0);\n useLayoutEffect(() => {\n const el = trackRef.current;\n if (!el) return;\n const update = (): void => setWidth(el.getBoundingClientRect().width);\n update();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(update);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n const widthOf = (): number => trackRef.current?.getBoundingClientRect().width ?? 0;\n const msAt = (clientX: number): number => {\n const rect = trackRef.current?.getBoundingClientRect();\n if (!rect) return win.from;\n const scale = createTimeScale(win, rect.width);\n const raw = scale.toMs(clientX - rect.left);\n return Math.min(win.to, Math.max(win.from, raw));\n };\n\n // `capture: false`: the session tracks the pointer off the ruler on its own,\n // and capture would retarget pointerup and kill the click on non-native\n // children of the scrubbed track.\n const onPointerDown = (e: ReactPointerEvent<HTMLDivElement>): void => {\n if (e.button !== 0) return;\n onScrub(msAt(e.clientX));\n\n sessionRef.current?.cancel();\n const end = (): void => { sessionRef.current = null; };\n sessionRef.current = openPointerSession(e.currentTarget, e, {\n onMove: (ev) => { onScrub(msAt(ev.clientX)); },\n onEnd: end,\n onCancel: end,\n }, { capture: false });\n };\n\n const onWheel = (e: ReactWheelEvent<HTMLDivElement>): void => {\n if (e.ctrlKey) {\n onWindowChange(zoomWindow(win, msAt(e.clientX), Math.exp(e.deltaY * ZOOM_STEP), bounds));\n } else {\n const width = widthOf();\n const perPx = width === 0 ? 0 : (win.to - win.from) / width;\n onWindowChange(panWindow(win, e.deltaY * perPx, bounds));\n }\n };\n\n const ticks = tickTimes(win, width, TICK_SPACING_PX);\n const pct = (ms: number): string => toPercent(win, ms);\n\n return (\n <div\n className={s.ruler}\n ref={trackRef}\n data-testid=\"timeline-ruler\"\n onPointerDown={onPointerDown}\n onWheel={onWheel}\n >\n {ticks.map((t) => (\n <span\n key={t}\n className={s.tick}\n data-testid=\"timeline-tick\"\n style={{ left: pct(t) }}\n >\n {formatMs(t)}\n </span>\n ))}\n <div\n className={s.playhead}\n data-testid=\"timeline-playhead\"\n style={{ left: pct(playhead) }}\n />\n </div>\n );\n}\n","import type { ReactElement } from 'react';\nimport { DetentSlider } from '../DetentSlider';\nimport { PauseIcon, PlayIcon } from '../../icons';\nimport s from './Timeline.module.css';\n\n/** Playback rates the transport offers. */\nconst RATES = [0.25, 0.5, 1, 2, 4] as const;\n\nexport interface TransportProps {\n paused: boolean;\n loop: boolean | number;\n rate: number;\n playhead: number;\n duration: number;\n onPlay: () => void;\n onPause: () => void;\n onLoopChange: (loop: boolean | number) => void;\n onRateChange: (rate: number) => void;\n}\n\nconst seconds = (ms: number): string => `${(ms / 1000).toFixed(2)}s`;\n\nexport function Transport(props: TransportProps): ReactElement {\n const { paused, loop, rate, playhead, duration, onPlay, onPause, onLoopChange, onRateChange } = props;\n const looping = loop !== false && loop !== 0;\n // The handle's scale is whatever anything holding it set, so an off-list rate\n // gets its own detent — `DetentSlider` would otherwise round it to the\n // nearest and label the thumb with a rate the timeline is not running at.\n const rates = RATES.includes(rate as typeof RATES[number])\n ? (RATES as readonly number[])\n : [...RATES, rate].sort((a, b) => a - b);\n\n return (\n <div className={s.transport}>\n <button\n type=\"button\"\n className={s.transportButton}\n aria-label={paused ? 'Play' : 'Pause'}\n onClick={paused ? onPlay : onPause}\n >\n {paused ? <PlayIcon size={14} /> : <PauseIcon size={14} />}\n </button>\n\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={looping}\n aria-label=\"Loop\"\n className={s.transportButton}\n onClick={() => onLoopChange(!looping)}\n >\n ⟲\n </button>\n\n <div className={s.rate}>\n Rate\n <DetentSlider\n ariaLabel=\"Rate\"\n items={rates}\n value={rate}\n onChange={onRateChange}\n formatLabel={(r) => `${r}x`}\n labels=\"none\"\n className={s.rateSlider}\n />\n <span className={s.rateReadout}>{rate}x</span>\n </div>\n\n <span className={s.time} data-testid=\"timeline-time\">\n {seconds(playhead)} / {seconds(duration)}\n </span>\n </div>\n );\n}\n","import type { SampledTrack, Track } from '@weasel-js/core';\n\nexport interface LaneRow {\n /** Stable across re-renders and edits: the dotted index path. */\n key: string;\n /** Index path into the track tree, outermost first. */\n path: number[];\n track: Track;\n label: string;\n /** Nesting depth; 0 for a top-level track. */\n depth: number;\n /** Accumulated `at` from every nested parent, in ms. A key drawn on this row\n * sits at `offset + key.t` on the ruler. */\n offset: number;\n kind: Track['kind'];\n /** True only for a sampled track whose every key value is a number — the\n * sole case where a value axis has an honest meaning. */\n numeric: boolean;\n}\n\nfunction isNumeric(track: Track): boolean {\n if (track.kind !== 'sampled') return false;\n const keys = (track as SampledTrack<unknown>).keys;\n return keys.length > 0 && keys.every((k) => typeof k.value === 'number');\n}\n\n/** Flatten the track tree to rows, descending only into expanded nested\n * timelines. `expanded` holds the `key` of each open nested row. */\nexport function buildLanes(\n tracks: readonly Track[],\n expanded: ReadonlySet<string>,\n): LaneRow[] {\n const out: LaneRow[] = [];\n const walk = (list: readonly Track[], path: number[], depth: number, offset: number): void => {\n list.forEach((track, i) => {\n const nextPath = [...path, i];\n const key = nextPath.join('.');\n out.push({\n key,\n path: nextPath,\n track,\n label: track.label ?? `${track.kind} ${i}`,\n depth,\n offset,\n kind: track.kind,\n numeric: isNumeric(track),\n });\n if (track.kind === 'timeline' && expanded.has(key)) {\n walk(track.timeline.tracks, nextPath, depth + 1, offset + track.at);\n }\n });\n };\n walk(tracks, [], 0, 0);\n return out;\n}\n\n/** The track at an index path, or `undefined` when the path leaves the tree. */\nexport function trackAtPath(tracks: readonly Track[], path: readonly number[]): Track | undefined {\n let list: readonly Track[] = tracks;\n let found: Track | undefined;\n for (const i of path) {\n found = list[i];\n if (!found) return undefined;\n list = found.kind === 'timeline' ? found.timeline.tracks : [];\n }\n return found;\n}\n","import { sampleTrack, type EasingSpec, type EventTrack, type Keyframe, type SampledTrack, type TimelineTrack, type Track } from '@weasel-js/core';\nimport { trackAtPath } from './lanes';\n\nexport interface KeySelection {\n /** Index path into the track tree, outermost first — a `LaneRow.path`. A\n * top-level track is `[i]`; a track inside the nested timeline at `i` is\n * `[i, j]`. */\n trackPath: readonly number[];\n keyIndex: number;\n}\n\nexport interface KeyEdit {\n tracks: Track[];\n selection: KeySelection | null;\n}\n\n/** True when two index paths address the same track. */\nexport function samePath(a: readonly number[], b: readonly number[]): boolean {\n return a.length === b.length && a.every((n, i) => n === b[i]);\n}\n\n/** Shallow-clone one track, replacing only its key list. `onTick`, `fire`,\n * `interpolate` and `interpolator` survive as references, which is what lets a\n * running timeline take an edited track without rewiring. */\nfunction withKeys(track: Track, keys: Keyframe<unknown>[]): Track {\n return { ...(track as SampledTrack<unknown>), keys } as Track;\n}\n\nfunction withEvents(track: Track, events: EventTrack['events']): Track {\n return { ...(track as EventTrack), events } as Track;\n}\n\n/** Replace the track at `path`, cloning the timeline tracks along the way so\n * the caller's tree is untouched at every level, not just the top. */\nfunction replaceAtPath(tracks: readonly Track[], path: readonly number[], next: Track): Track[] {\n const out = tracks.slice();\n const [i, ...rest] = path;\n if (rest.length === 0) {\n out[i] = next;\n return out;\n }\n const parent = out[i];\n if (parent?.kind !== 'timeline') return out;\n const tt = parent as TimelineTrack;\n out[i] = {\n ...tt,\n timeline: { ...tt.timeline, tracks: replaceAtPath(tt.timeline.tracks, rest, next) },\n };\n return out;\n}\n\n/** Move a key or an event crossing to `toMs`, clamped at zero. `toMs` is in the\n * addressed track's own time, not the ruler's — a nested track's keys are\n * measured from its parent's `at`.\n *\n * Re-sorts, and reports the moved entry's new index. `sampleTrack` binary-\n * searches without sorting first, so a drag past a neighbour that left the list\n * unsorted would sample the wrong segment and raise nothing. */\nexport function moveKey(\n tracks: readonly Track[], sel: KeySelection, toMs: number,\n): KeyEdit {\n const track = trackAtPath(tracks, sel.trackPath);\n const t = Math.max(0, toMs);\n\n if (track?.kind === 'sampled') {\n const st = track as SampledTrack<unknown>;\n const moved = { ...st.keys[sel.keyIndex], t };\n const keys = st.keys.filter((_, i) => i !== sel.keyIndex);\n const at = keys.findIndex((k) => k.t > t);\n const keyIndex = at === -1 ? keys.length : at;\n keys.splice(keyIndex, 0, moved);\n return {\n tracks: replaceAtPath(tracks, sel.trackPath, withKeys(track, keys)),\n selection: { trackPath: sel.trackPath, keyIndex },\n };\n }\n\n if (track?.kind === 'event') {\n const et = track as EventTrack;\n const moved = { ...et.events[sel.keyIndex], t };\n const events = et.events.filter((_, i) => i !== sel.keyIndex);\n const at = events.findIndex((e) => e.t > t);\n const keyIndex = at === -1 ? events.length : at;\n events.splice(keyIndex, 0, moved);\n return {\n tracks: replaceAtPath(tracks, sel.trackPath, withEvents(track, events)),\n selection: { trackPath: sel.trackPath, keyIndex },\n };\n }\n\n return { tracks: tracks.slice(), selection: sel };\n}\n\n/** Insert a key at `atMs`, seeded with whatever the track already reads there\n * so inserting alone never changes the motion. */\nexport function insertKey(\n tracks: readonly Track[], trackPath: readonly number[], atMs: number,\n): KeyEdit {\n const track = trackAtPath(tracks, trackPath);\n if (track?.kind !== 'sampled') return { tracks: tracks.slice(), selection: null };\n\n const st = track as SampledTrack<unknown>;\n const t = Math.max(0, atMs);\n const value = st.keys.length === 0 ? 0 : sampleTrack(st, t);\n const keys = st.keys.slice();\n const at = keys.findIndex((k) => k.t > t);\n const keyIndex = at === -1 ? keys.length : at;\n keys.splice(keyIndex, 0, { t, value });\n return {\n tracks: replaceAtPath(tracks, trackPath, withKeys(track, keys)),\n selection: { trackPath, keyIndex },\n };\n}\n\n/** Remove a key, selecting the one before it. */\nexport function deleteKey(tracks: readonly Track[], sel: KeySelection): KeyEdit {\n const track = trackAtPath(tracks, sel.trackPath);\n if (track?.kind !== 'sampled') return { tracks: tracks.slice(), selection: sel };\n\n const st = track as SampledTrack<unknown>;\n const keys = st.keys.filter((_, i) => i !== sel.keyIndex);\n return {\n tracks: replaceAtPath(tracks, sel.trackPath, withKeys(track, keys)),\n selection: keys.length === 0\n ? null\n : { trackPath: sel.trackPath, keyIndex: Math.max(0, sel.keyIndex - 1) },\n };\n}\n\n/** Set the easing shaping the approach INTO the selected key. */\nexport function setKeyEasing(\n tracks: readonly Track[], sel: KeySelection, easing: EasingSpec | undefined,\n): Track[] {\n const track = trackAtPath(tracks, sel.trackPath);\n if (track?.kind !== 'sampled') return tracks.slice();\n\n const st = track as SampledTrack<unknown>;\n const keys = st.keys.slice();\n const { easing: _drop, ...rest } = keys[sel.keyIndex];\n keys[sel.keyIndex] = easing === undefined ? rest : { ...rest, easing };\n return replaceAtPath(tracks, sel.trackPath, withKeys(track, keys));\n}\n\n/** Replace a sampled track's whole key list, keeping its callbacks. */\nexport function setKeys(\n tracks: readonly Track[], trackPath: readonly number[], keys: readonly Keyframe<unknown>[],\n): Track[] {\n const track = trackAtPath(tracks, trackPath);\n if (track?.kind !== 'sampled') return tracks.slice();\n return replaceAtPath(tracks, trackPath, withKeys(track, keys.slice()));\n}\n\n/** Set the selected key's value, leaving its time alone. */\nexport function setKeyValue(\n tracks: readonly Track[], sel: KeySelection, value: unknown,\n): Track[] {\n const track = trackAtPath(tracks, sel.trackPath);\n if (track?.kind !== 'sampled') return tracks.slice();\n\n const st = track as SampledTrack<unknown>;\n const keys = st.keys.slice();\n keys[sel.keyIndex] = { ...keys[sel.keyIndex], value };\n return replaceAtPath(tracks, sel.trackPath, withKeys(track, keys));\n}\n\nexport { snapToNearest as snapTime } from '../../snap';\n","import { useMemo, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactElement, type ReactNode } from 'react';\nimport type { EasingSpec, Keyframe, SampledTrack, Track } from '@weasel-js/core';\nimport s from './Timeline.module.css';\nimport { EasingPicker } from './EasingPicker';\nimport { Lane } from './Lane';\nimport { Ruler } from './Ruler';\nimport { Transport, type TransportProps } from './Transport';\nimport { buildLanes, trackAtPath } from './lanes';\nimport { deleteKey, insertKey, moveKey, samePath, setKeyEasing, setKeys, setKeyValue, type KeySelection } from './keys';\nimport type { TimeWindow } from './timeScale';\n\nexport type { KeySelection } from './keys';\nexport type { TimeWindow } from './timeScale';\n\nexport interface KeyEditorCtx<T = unknown> {\n key: Keyframe<T>;\n track: SampledTrack<T>;\n selection: KeySelection;\n /** Replace the selected key; routed through this component's `onChange`. */\n commit: (next: Keyframe<T>) => void;\n /** Set the easing shaping the approach into this key. */\n setEasing: (easing: EasingSpec | undefined) => void;\n}\n\nexport interface TimelineProps {\n tracks: readonly Track[];\n duration: number;\n playhead: number;\n\n mode?: 'dope' | 'graph';\n onModeChange?: (mode: 'dope' | 'graph') => void;\n\n /** Live during a drag — wire for preview, do not write to history. */\n onInput?: (next: Track[]) => void;\n /** Committed at gesture end: one call per gesture. */\n onChange: (next: Track[]) => void;\n onScrub: (t: number) => void;\n\n /** `false` hides the transport. */\n transport?: Omit<TransportProps, 'playhead' | 'duration'> | false;\n selection?: KeySelection | null;\n onSelect?: (sel: KeySelection | null) => void;\n renderKeyEditor?: (ctx: KeyEditorCtx) => ReactNode;\n\n window?: TimeWindow;\n onWindowChange?: (w: TimeWindow) => void;\n\n label?: ReactNode;\n className?: string;\n}\n\nexport function Timeline(props: TimelineProps): ReactElement {\n const {\n tracks, duration, playhead,\n onInput, onChange, onScrub,\n renderKeyEditor, label, className,\n } = props;\n\n const [expanded, setExpanded] = useState<ReadonlySet<string>>(() => new Set());\n const [ownWindow, setOwnWindow] = useState<TimeWindow>({ from: 0, to: duration });\n const [ownSelection, setOwnSelection] = useState<KeySelection | null>(null);\n const [segmentSelection, setSegmentSelection] = useState<KeySelection | null>(null);\n\n const win = props.window ?? ownWindow;\n const setWindow = props.onWindowChange ?? setOwnWindow;\n const selection = props.selection !== undefined ? props.selection : ownSelection;\n const setSelection = props.onSelect ?? setOwnSelection;\n\n const bounds: TimeWindow = { from: 0, to: duration };\n const rows = useMemo(() => buildLanes(tracks, expanded), [tracks, expanded]);\n\n /** Every key time on every row — what a dragged key snaps to. */\n const snapTimes = useMemo(() => {\n const out = new Set<number>([0, duration]);\n for (const row of rows) {\n if (row.kind === 'sampled') for (const k of (row.track as SampledTrack<unknown>).keys) out.add(k.t + row.offset);\n }\n return [...out];\n }, [rows, duration]);\n\n const toggle = (key: string): void => {\n setExpanded((prev) => {\n const next = new Set(prev);\n if (next.has(key)) next.delete(key); else next.add(key);\n return next;\n });\n };\n\n const onRootKeyDown = (e: ReactKeyboardEvent<HTMLDivElement>): void => {\n if ((e.key === 'Delete' || e.key === 'Backspace') && selection) {\n e.preventDefault();\n const r = deleteKey(tracks, selection);\n onChange(r.tracks);\n setSelection(r.selection);\n }\n };\n\n const selectedTrack = selection ? trackAtPath(tracks, selection.trackPath) : undefined;\n const selectedKey = selectedTrack?.kind === 'sampled'\n ? (selectedTrack as SampledTrack<unknown>).keys[selection!.keyIndex]\n : undefined;\n\n const segmentTrack = segmentSelection ? trackAtPath(tracks, segmentSelection.trackPath) : undefined;\n const segmentKey = segmentTrack?.kind === 'sampled'\n ? (segmentTrack as SampledTrack<unknown>).keys[segmentSelection!.keyIndex]\n : undefined;\n\n return (\n <div\n className={[s.root, className].filter(Boolean).join(' ')}\n data-testid=\"timeline-root\"\n tabIndex={-1}\n onKeyDown={onRootKeyDown}\n >\n {label ? <div className={s.label}>{label}</div> : null}\n\n {props.transport === false ? null : (\n <div className={s.transportRow}>\n <Transport\n {...(props.transport ?? {\n paused: true, loop: false, rate: 1,\n onPlay: () => {}, onPause: () => {},\n onLoopChange: () => {}, onRateChange: () => {},\n })}\n playhead={playhead}\n duration={duration}\n />\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={(props.mode ?? 'dope') === 'graph'}\n aria-label=\"Graph mode\"\n className={s.transportButton}\n onClick={() => props.onModeChange?.((props.mode ?? 'dope') === 'graph' ? 'dope' : 'graph')}\n >\n Graph\n </button>\n </div>\n )}\n\n <div className={s.body}>\n <div className={s.gutter} />\n <div className={s.rulerWrap}>\n <Ruler\n window={win}\n bounds={bounds}\n playhead={playhead}\n onScrub={onScrub}\n onWindowChange={setWindow}\n />\n </div>\n </div>\n\n <div className={s.lanes}>\n {rows.map((row) => {\n const trackPath = row.path;\n return (\n <Lane\n key={row.key}\n row={row}\n window={win}\n mode={props.mode ?? 'dope'}\n selection={selection && samePath(selection.trackPath, trackPath) ? selection.keyIndex : null}\n expanded={expanded.has(row.key)}\n snapTimes={snapTimes}\n onToggleExpand={() => toggle(row.key)}\n onSelect={(keyIndex) => setSelection({ trackPath, keyIndex })}\n onKeyInput={(keyIndex, toMs) => {\n onInput?.(moveKey(tracks, { trackPath, keyIndex }, toMs).tracks);\n }}\n onKeyCommit={(keyIndex, toMs) => {\n const r = moveKey(tracks, { trackPath, keyIndex }, toMs);\n onChange(r.tracks);\n setSelection(r.selection);\n }}\n onKeysInput={(keys) => onInput?.(setKeys(tracks, trackPath, keys))}\n onKeysCommit={(keys) => onChange(setKeys(tracks, trackPath, keys))}\n onInsert={(atMs) => {\n const r = insertKey(tracks, trackPath, atMs);\n onChange(r.tracks);\n setSelection(r.selection);\n }}\n selectedSegment={segmentSelection && samePath(segmentSelection.trackPath, trackPath) ? segmentSelection.keyIndex : null}\n onSelectSegment={(keyIndex) => setSegmentSelection({ trackPath, keyIndex })}\n />\n );\n })}\n </div>\n\n {renderKeyEditor && selection && selectedKey && selectedTrack?.kind === 'sampled' ? (\n <div className={s.inspector}>\n {renderKeyEditor({\n key: selectedKey,\n track: selectedTrack as SampledTrack<unknown>,\n selection,\n commit: (next) => onChange(setKeyValue(tracks, selection, next.value)),\n setEasing: (easing) => onChange(setKeyEasing(tracks, selection, easing)),\n })}\n </div>\n ) : null}\n\n {segmentSelection && segmentKey ? (\n <div className={s.inspector}>\n <EasingPicker\n value={segmentKey.easing}\n onChange={(next) => onChange(setKeyEasing(tracks, segmentSelection, next))}\n />\n </div>\n ) : null}\n </div>\n );\n}\n","import { useCallback, useEffect, useReducer, useRef, type ReactElement } from 'react';\nimport { useVisibleRaf, type TimelineHandle, type Track } from '@weasel-js/core';\nimport { Timeline, type TimelineProps } from './Timeline';\n\nexport interface AnimatedTimelineProps\n extends Omit<TimelineProps, 'tracks' | 'duration' | 'playhead' | 'onChange' | 'onScrub' | 'transport'> {\n handle: TimelineHandle;\n /** `false` hides the transport, as on `<Timeline>`. */\n transport?: false;\n}\n\n/** Binds `<Timeline>` to a live handle.\n *\n * `handle.tracks()` returns the timeline's own array, not a copy, so an edit\n * splices it in place inside `edit()`. Assigning a replacement array would\n * update nothing and raise nothing. */\nexport function AnimatedTimeline(props: AnimatedTimelineProps): ReactElement {\n const { handle, ...rest } = props;\n const [, bump] = useReducer((n: number) => n + 1, 0);\n\n // `subscribe` fires on `edit` only, so the playhead comes from the frame loop.\n useEffect(() => handle.subscribe(bump), [handle]);\n\n // `useVisibleRaf` returns a controller; a continuous loop re-requests from\n // inside its own frame, and nothing runs until something calls `request`.\n // No `onResume` here: this loop measures no elapsed time of its own, it only\n // reads the playhead the animator already advanced.\n const rafRef = useRef<{ request(): void } | null>(null);\n const raf = useVisibleRaf(() => {\n bump();\n if (!handle.isPaused()) rafRef.current?.request();\n });\n rafRef.current = raf;\n useEffect(() => {\n if (!handle.isPaused()) raf.request();\n return () => raf.cancel();\n }, [handle, raf]);\n\n const onChange = useCallback((next: Track[]) => {\n handle.edit(() => {\n const live = handle.tracks() as Track[];\n live.splice(0, live.length, ...next);\n });\n }, [handle]);\n\n const playhead = handle.time();\n const duration = handle.duration();\n\n return (\n <Timeline\n {...rest}\n tracks={handle.tracks()}\n duration={duration}\n playhead={playhead}\n onChange={onChange}\n onScrub={handle.seek}\n transport={props.transport === false ? false : {\n paused: handle.isPaused(),\n loop: handle.loop(),\n rate: handle.timeScale(),\n onPlay: () => {\n // `rearm` declines to revive a timeline at its duration, so resume\n // alone would do nothing. Play-at-end rewinds first.\n if (handle.time() >= duration) handle.seek(0);\n handle.resume();\n raf.request();\n bump();\n },\n onPause: () => { handle.pause(); bump(); },\n onLoopChange: (next) => { handle.setLoop(next); bump(); },\n onRateChange: (next) => { handle.setTimeScale(next); bump(); },\n }}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACEA,SAAS,EAAS,GAAoE;AAEpF,QADI,OAAO,KAAS,YAAY,KAAiB,YAAY,IAAa,EAAK,SACxE;;AAKT,SAAgB,EAAa,GAAqE;AAEhG,QADI,MAAS,KAAA,IAAkB,OACxB,EAAS,EAAK;;AASvB,SAAgB,EAAY,GAA2B;AACrD,KAAI,MAAS,KAAA,EAAW,QAAO;AAC/B,KAAI,OAAO,KAAS,SAAU,QAAO;CACrC,IAAM,IAAI,EAAS,EAAK;AACxB,KAAI,EAAG,QAAO,gBAAgB,EAAE,KAAK,KAAK,CAAC;AAC3C,MAAK,IAAM,CAAC,GAAM,MAAO,OAAO,QAAQ,EAAQ,CAC9C,KAAI,MAAO,EAAM,QAAO;AAE1B,QAAO;;AAIT,SAAgB,EAAa,GAA8B,GAAyB;CAClF,IAAM,IAAK,EAAc,EAAK,EACxB,IAAU,MAAc,EAAM,EAC9B,IAAO,IAAQ;AACrB,MAAK,IAAI,IAAI,GAAG,IAAI,GAAO,IAAK,GAAI,KAAK,EAAG,MAAS,IAAI,IAAI,IAAI,EAAK;AACtE,QAAO;;AAIT,IAAa,IAAe,OAAO,KAAK,EAAQ,ECnC1C,IAAkB,IAIlB,IAAgF;CACpF,QAAQ;EAAC;EAAG;EAAG;EAAG;EAAE;CACpB,YAAY;EAAC;EAAM;EAAG;EAAK;EAAE;CAC7B,aAAa;EAAC;EAAK;EAAG;EAAM;EAAE;CAC9B,eAAe;EAAC;EAAM;EAAG;EAAM;EAAE;CACjC,aAAa;EAAC;EAAM;EAAG;EAAM;EAAE;CAC/B,cAAc;EAAC;EAAM;EAAG;EAAM;EAAE;CAChC,gBAAgB;EAAC;EAAM;EAAG;EAAM;EAAE;CAClC,YAAY;EAAC;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EAAO,UAAU,IAAE,EAAO,SAAS,SAAS;GACjD;AAEF,CADA,EAAO,UAAU,GACjB,SACO,EAAO,UAAU,IAAE,EAAI,SAAS,QACxB,EAAI,QAAQ,GACxB,CAAC,GAAQ,EAAI,CAAC;CAEjB,IAAM,IAAW,GAAa,MAAkB;AAC9C,IAAO,WAAW;GAChB,IAAM,IAAO,EAAO,QAAQ;AAC5B,KAAK,OAAO,GAAG,EAAK,QAAQ,GAAG,EAAK;IACpC;IACD,CAAC,EAAO,CAAC,EAEN,IAAW,EAAO,MAAM,EACxB,IAAW,EAAO,UAAU;AAElC,QACE,kBAAC,GAAD;EACE,GAAI;EACJ,QAAQ,EAAO,QAAQ;EACb;EACA;EACA;EACV,SAAS,EAAO;EAChB,WAAW,EAAM,cAAc,KAAQ,KAAQ;GAC7C,QAAQ,EAAO,UAAU;GACzB,MAAM,EAAO,MAAM;GACnB,MAAM,EAAO,WAAW;GACxB,cAAc;AAMZ,IAHI,EAAO,MAAM,IAAI,KAAU,EAAO,KAAK,EAAE,EAC7C,EAAO,QAAQ,EACf,EAAI,SAAS,EACb,GAAM;;GAER,eAAe;AAAkB,IAAhB,EAAO,OAAO,EAAE,GAAM;;GACvC,eAAe,MAAS;AAAwB,IAAtB,EAAO,QAAQ,EAAK,EAAE,GAAM;;GACtD,eAAe,MAAS;AAA6B,IAA3B,EAAO,aAAa,EAAK,EAAE,GAAM;;GAC5D;EACD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Toast-BfcljZz6.js","names":[],"sources":["../../src/components/Toast/queue.ts","../../src/components/Toast/Toast.module.css","../../src/components/Toast/Toast.tsx"],"sourcesContent":["import { UNSTABLE_ToastQueue } from 'react-aria-components';\nimport { flushSync } from 'react-dom';\n\n/** Severity of a toast, driving its accent color and icon. */\nexport type ToastTone = 'info' | 'success' | 'warning' | 'error';\n\n/** Kit-owned payload rendered inside each toast. */\nexport interface ToastContent {\n title: string;\n description?: string;\n tone: ToastTone;\n}\n\n/** Options for a single toast. */\nexport interface ToastOptions {\n description?: string;\n /**\n * Auto-dismiss delay in ms. Default 8000. `null` — sticky until dismissed.\n * Must be > 0; RAC treats 0 as no timer (sticky).\n */\n ttlMs?: number | null;\n /** Stable identity: re-adding with the same id replaces the earlier toast. */\n id?: string;\n}\n\nconst DEFAULT_TTL_MS = 8000;\n\n// Tracks overlapping toast-triggered view transitions so the `:root`\n// marker class survives until the *last* one settles.\nlet activeToastTransitions = 0;\n\n/**\n * RAC's sanctioned toast-animation hook: wrap every queue mutation in a\n * view transition so entry, exit, and the surviving stack's reflow all\n * animate (choreography lives in `toastViewTransitions.css`). Falls back\n * to a plain synchronous update when the browser lacks the API or the\n * user prefers reduced motion — i.e. exactly the pre-animation behavior.\n * The jsdom test environment always takes the fallback path.\n */\nfunction viewTransitionWrapUpdate(fn: () => void): void {\n const reduceMotion =\n typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;\n if (typeof document === 'undefined' || !('startViewTransition' in document) || reduceMotion) {\n fn();\n return;\n }\n // The marker class scopes the CSS that un-names `:root` (keeps the rest\n // of the page live and interactive during the transition) to\n // toast-owned transitions only.\n const root = document.documentElement;\n activeToastTransitions++;\n root.classList.add('wzl-toast-vt');\n // flushSync: the DOM must reflect the queue change inside the\n // transition callback, before the browser snapshots the new state.\n const vt = document.startViewTransition(() => flushSync(fn));\n // `ready` rejects when the browser skips the transition — routine under\n // a rapid burst of toasts, where each new transition supersedes the\n // in-flight one. The DOM update has still applied by then, but an\n // untouched `ready` surfaces the rejection as a console error, so\n // consume it.\n vt.ready.catch(() => {});\n void vt.finished.finally(() => {\n if (--activeToastTransitions === 0) root.classList.remove('wzl-toast-vt');\n });\n}\n\n// The wrapped RAC queue lives in a module-scoped WeakMap so the public\n// class surface carries no RAC (UNSTABLE_) types — see the design spec's\n// containment rule. `racQueueOf` below is the folder-internal accessor.\nconst RAC_QUEUES = new WeakMap<ToastQueue, UNSTABLE_ToastQueue<ToastContent>>();\n\n/**\n * Kit-owned toast queue. Create isolated instances with\n * `createToastQueue()` (tests, secondary roots); most apps use the\n * module-level `defaultToastQueue` via `toast()`.\n *\n * At most 5 toasts are visible at once; adding a 6th shows immediately\n * and hides the oldest (it returns when a slot frees, with its ttl\n * restarted).\n */\nexport class ToastQueue {\n private keysById = new Map<string, string>();\n\n constructor() {\n RAC_QUEUES.set(\n this,\n new UNSTABLE_ToastQueue<ToastContent>({\n maxVisibleToasts: 5,\n wrapUpdate: viewTransitionWrapUpdate,\n }),\n );\n }\n\n add(tone: ToastTone, title: string, options: ToastOptions = {}): void {\n const { description, ttlMs = DEFAULT_TTL_MS, id } = options;\n const rac = RAC_QUEUES.get(this)!;\n if (id !== undefined) {\n const existing = this.keysById.get(id);\n if (existing !== undefined) rac.close(existing);\n }\n let key: string;\n const racOptions: { timeout?: number; onClose?: () => void } =\n ttlMs === null ? {} : { timeout: ttlMs };\n if (id !== undefined) {\n racOptions.onClose = () => {\n if (this.keysById.get(id) === key) this.keysById.delete(id);\n };\n }\n key = rac.add({ title, description, tone }, racOptions);\n if (id !== undefined) this.keysById.set(id, key);\n }\n\n /** Dismiss the toast previously added with this `id`. No-op if none is live. */\n dismiss(id: string): void {\n const key = this.keysById.get(id);\n if (key !== undefined) RAC_QUEUES.get(this)!.close(key);\n }\n\n /** Dismiss every queued toast. */\n clear(): void {\n RAC_QUEUES.get(this)!.clear();\n this.keysById.clear();\n }\n}\n\n/**\n * Creates an independent toast queue. Most apps use the module-level\n * `defaultToastQueue` that `toast()` writes to; make your own when a surface\n * needs its own stack, and pass it to `ToastRegion`.\n */\nexport function createToastQueue(): ToastQueue {\n return new ToastQueue();\n}\n\n/**\n * Folder-internal bridge to the wrapped RAC queue for `ToastRegion`.\n * Deliberately NOT exported from the Toast folder's `index.ts` — the\n * RAC toast surface is unstable and must not leak past this folder.\n */\nexport function racQueueOf(queue: ToastQueue): UNSTABLE_ToastQueue<ToastContent> {\n return RAC_QUEUES.get(queue)!;\n}\n\n/** Module-level default queue used by `toast()` and `<ToastRegion>`. */\nexport const defaultToastQueue = createToastQueue();\n\ntype ToastFn = {\n (title: string, options?: ToastOptions): void;\n info(title: string, options?: ToastOptions): void;\n success(title: string, options?: ToastOptions): void;\n warning(title: string, options?: ToastOptions): void;\n error(title: string, options?: ToastOptions): void;\n};\n\nfunction tonedAdd(tone: ToastTone) {\n return (title: string, options?: ToastOptions) => defaultToastQueue.add(tone, title, options);\n}\n\n/** Imperative convenience over `defaultToastQueue`. Bare `toast(...)` is `info`. */\nexport const toast: ToastFn = Object.assign(tonedAdd('info'), {\n info: tonedAdd('info'),\n success: tonedAdd('success'),\n warning: tonedAdd('warning'),\n error: tonedAdd('error'),\n});\n",".region {\n position: fixed;\n z-index: 1100;\n display: flex;\n /* RAC unshifts new toasts to the front of the DOM (newest-first), and the\n * ol/li wrappers are display:contents, so the flex direction alone\n * decides which end of the stack the newest toast lands on. Base\n * (bottom corners): column-reverse puts DOM-first (newest) at the\n * bottom, hugging the corner. Top corners override back to column so\n * DOM-first still hugs the top edge. */\n flex-direction: column-reverse;\n gap: var(--wzl-space-4);\n max-width: 360px;\n outline: none;\n}\n\n.bottomRight { bottom: 16px; right: 16px; }\n.bottomLeft { bottom: 16px; left: 16px; }\n.topRight { top: 16px; right: 16px; flex-direction: column; }\n.topLeft { top: 16px; left: 16px; flex-direction: column; }\n\n.toast {\n --toast-accent: var(--wzl-accent-strong);\n /* Groups every toast under one ident so toastViewTransitions.css can\n * target `::view-transition-new/old(.wzl-toast)` without knowing the\n * per-toast view-transition-name (set inline in Toast.tsx). */\n view-transition-class: wzl-toast;\n display: flex;\n align-items: flex-start;\n gap: var(--wzl-space-4);\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-left: 3px solid var(--toast-accent);\n border-radius: var(--wzl-radius-md);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-ui);\n padding: var(--wzl-space-5) var(--wzl-space-6);\n outline: none;\n}\n\n.region[data-focus-visible],\n.toast[data-focus-visible] {\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: 1px;\n}\n\n.toneInfo { /* default accent — uses --toast-accent fallback */ }\n.toneSuccess { --toast-accent: var(--wzl-success, #2ec27e); }\n.toneWarning { --toast-accent: var(--wzl-warning, #d99a3f); }\n.toneError { --toast-accent: var(--wzl-danger); }\n\n.content {\n flex: 1;\n min-width: 0;\n}\n\n.title {\n display: block;\n font-size: var(--wzl-font-size);\n font-weight: var(--wzl-font-weight-bold);\n}\n\n.description {\n display: block;\n margin-top: var(--wzl-space-1);\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-muted);\n}\n\n.close {\n flex: 0 0 auto;\n background: none;\n border: none;\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-lg);\n line-height: 1;\n padding: var(--wzl-space-1) var(--wzl-space-2);\n cursor: pointer;\n border-radius: var(--wzl-radius-sm);\n}\n\n.close:hover {\n color: var(--wzl-fg);\n}\n","import {\n UNSTABLE_ToastRegion as RACToastRegion,\n UNSTABLE_Toast as RACToast,\n UNSTABLE_ToastContent as RACToastContent,\n Text,\n Button,\n} from 'react-aria-components';\nimport { defaultToastQueue, racQueueOf, type ToastQueue, type ToastTone } from './queue';\nimport s from './Toast.module.css';\nimport './toastViewTransitions.css';\n\n/** Screen corner a toast stack anchors to. */\nexport type ToastPlacement = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';\n\n/** Props for {@link ToastRegion}. */\nexport interface ToastRegionProps {\n /** Queue to render. Defaults to the module-level `defaultToastQueue`. */\n queue?: ToastQueue;\n /** Screen corner for the stack. Default `bottom-right`. */\n placement?: ToastPlacement;\n className?: string;\n}\n\nconst placementClass: Record<ToastPlacement, string> = {\n 'bottom-right': s.bottomRight,\n 'bottom-left': s.bottomLeft,\n 'top-right': s.topRight,\n 'top-left': s.topLeft,\n};\n\nconst toneClass: Record<ToastTone, string> = {\n info: s.toneInfo,\n success: s.toneSuccess,\n warning: s.toneWarning,\n error: s.toneError,\n};\n\n/**\n * Renders the toast stack for a queue. Mount once, near the app root.\n * From the underlying React Aria region: landmark semantics (keyboard /\n * F6 reachable), screen-reader announcements, and hover pausing the\n * auto-dismiss timers.\n */\nexport function ToastRegion(props: ToastRegionProps) {\n const { queue = defaultToastQueue, placement = 'bottom-right', className } = props;\n return (\n <RACToastRegion\n queue={racQueueOf(queue)}\n aria-label=\"Notifications\"\n className={[s.region, placementClass[placement], className].filter(Boolean).join(' ')}\n >\n {({ toast: t }) => (\n <RACToast\n toast={t}\n className={[s.toast, toneClass[t.content.tone]].filter(Boolean).join(' ')}\n // Inline style is the one sanctioned exception here: each toast\n // needs a *unique* view-transition-name (so enter/exit/reflow\n // track per-toast), and a class can't mint unique idents. The\n // prefix keeps the ident valid (RAC keys can start with digits).\n style={{ viewTransitionName: `wzl-toast-${t.key.replace(/[^a-zA-Z0-9_-]/g, '_')}` }}\n >\n <RACToastContent className={s.content}>\n <Text slot=\"title\" className={s.title}>{t.content.title}</Text>\n {t.content.description !== undefined && (\n <Text slot=\"description\" className={s.description}>{t.content.description}</Text>\n )}\n </RACToastContent>\n <Button slot=\"close\" className={s.close} aria-label=\"Dismiss notification\">\n ×\n </Button>\n </RACToast>\n )}\n </RACToastRegion>\n );\n}\n"],"mappings":";;;;AAyBA,IAAM,IAAiB,KAInB,IAAyB;AAU7B,SAAS,EAAyB,GAAsB;CACtD,IAAM,IACJ,OAAO,cAAe,cAAc,WAAW,mCAAmC,CAAC;AACrF,KAAI,OAAO,WAAa,OAAe,EAAE,yBAAyB,aAAa,GAAc;AAC3F,KAAI;AACJ;;CAKF,IAAM,IAAO,SAAS;AAEtB,CADA,KACA,EAAK,UAAU,IAAI,eAAe;CAGlC,IAAM,IAAK,SAAS,0BAA0B,EAAU,EAAG,CAAC;AAOvD,CADL,EAAG,MAAM,YAAY,GAAG,EACnB,EAAG,SAAS,cAAc;AAC7B,EAAI,EAAE,MAA2B,KAAG,EAAK,UAAU,OAAO,eAAe;GAC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;CACtB,SAAS,EAAS,UAAU;CAC5B,SAAS,EAAS,UAAU;CAC5B,OAAO,EAAS,QAAQ;CACzB,CAAC;;;;;;;;;;;;;;;GE7II,IAAiD;CACrD,gBAAgB,EAAE;CAClB,eAAe,EAAE;CACjB,aAAa,EAAE;CACf,YAAY,EAAE;CACf,EAEK,IAAuC;CAC3C,MAAM,EAAE;CACR,SAAS,EAAE;CACX,SAAS,EAAE;CACX,OAAO,EAAE;CACV;AAQD,SAAgB,EAAY,GAAyB;CACnD,IAAM,EAAE,WAAQ,GAAmB,eAAY,gBAAgB,iBAAc;AAC7E,QACE,kBAAC,GAAD;EACE,OAAO,EAAW,EAAM;EACxB,cAAW;EACX,WAAW;GAAC,EAAE;GAAQ,EAAe;GAAY;GAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;aAEnF,EAAE,OAAO,QACT,kBAAC,GAAD;GACE,OAAO;GACP,WAAW,CAAC,EAAE,OAAO,EAAU,EAAE,QAAQ,MAAM,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;GAKzE,OAAO,EAAE,oBAAoB,aAAa,EAAE,IAAI,QAAQ,mBAAmB,IAAI,IAAI;aAPrF,CASE,kBAAC,GAAD;IAAiB,WAAW,EAAE;cAA9B,CACE,kBAAC,GAAD;KAAM,MAAK;KAAQ,WAAW,EAAE;eAAQ,EAAE,QAAQ;KAAa,CAAA,EAC9D,EAAE,QAAQ,gBAAgB,KAAA,KACzB,kBAAC,GAAD;KAAM,MAAK;KAAc,WAAW,EAAE;eAAc,EAAE,QAAQ;KAAmB,CAAA,CAEnE;OAClB,kBAAC,GAAD;IAAQ,MAAK;IAAQ,WAAW,EAAE;IAAO,cAAW;cAAuB;IAElE,CAAA,CACA;;EAEE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToggleBar-Btnl5r7F.js","names":[],"sources":["../../src/components/ToggleBar/ToggleBar.module.css","../../src/components/ToggleBar/ToggleBar.tsx"],"sourcesContent":["/* Aqua-glass segmented control. The track is a pill-shaped well; the\n selected segment becomes a tinted glass cylinder that reads as the same\n \"lozenge\" family as the standalone Button. Visual params come from the\n `--btn-*` custom properties (see Button.module.css) so the Button Lab\n can tune both surfaces with one set of sliders. */\n.root {\n display: inline-flex;\n height: var(--tb-h, var(--wzl-control-h, 24px));\n padding: var(--wzl-space-1);\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0.18) 0%,\n rgba(0, 0, 0, 0.05) 100%\n );\n border-radius: var(--wzl-radius-pill);\n /* Clip segments to the track outline so interior corners read crisp and\n the selected segment's glass treatment doesn't paint over the rounded\n outer pixels. */\n overflow: hidden;\n box-shadow:\n inset 0 1px 2px rgba(0, 0, 0, 0.4),\n 0 1px 0 rgba(255, 255, 255, 0.06);\n user-select: none;\n -webkit-user-select: none;\n touch-action: none;\n}\n\n.segment {\n position: relative;\n flex: 1 1 0;\n min-width: 0;\n /* The track's stretch sizes a segment; without this, labkit's :where(button) height wins and overflows a small bar. */\n height: auto;\n padding: 0 var(--wzl-space-6);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n margin: 0;\n font-family: var(--wzl-font-ui);\n font-weight: var(--wzl-font-weight-normal);\n font-size: var(--btn-fontsize, var(--wzl-font-size));\n line-height: 1;\n color: var(--wzl-fg-muted);\n cursor: pointer;\n /* Only round the outer corners of the bar — middle segments stay square\n so the seams between them don't render as facing parentheses. */\n border-radius: 0;\n isolation: isolate;\n overflow: hidden;\n transition: color var(--wzl-motion-fast);\n}\n\n/* A glyph label is a fixed box, not text that can reflow: without this it is\n the only thing in the segment flex can take width from, and three bars in\n one property row squeeze it to nothing. The side padding drops with it —\n 8px around a 14px glyph is most of a segment. */\n.segment > svg {\n flex: none;\n}\n\n.segment:has(> svg) {\n padding: 0 5px;\n}\n\n.segment:first-child {\n border-radius: var(--wzl-radius-pill) 0 0 var(--wzl-radius-pill);\n}\n\n.segment:last-child {\n border-radius: 0 var(--wzl-radius-pill) var(--wzl-radius-pill) 0;\n}\n\n.segment:only-child {\n border-radius: var(--wzl-radius-pill);\n}\n\n.segment:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: -2px;\n}\n\n.segment:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.segment:hover:not(:disabled):not(.segmentSelected) {\n color: var(--wzl-fg);\n}\n\n/* Selected segment — full Aqua glass cylinder. Mirrors Button.variant_primary. */\n.segmentSelected {\n background: linear-gradient(\n 180deg,\n color-mix(in srgb, var(--wzl-accent) var(--btn-top-alpha, 45%), transparent) 0%,\n color-mix(in srgb, var(--wzl-accent) var(--btn-upper-alpha, 70%), transparent) calc(var(--btn-equator, 52%) - var(--btn-equator-spread, 12%)),\n color-mix(in srgb, var(--wzl-accent) var(--btn-equator-tint, 95%), white) var(--btn-equator, 52%),\n var(--wzl-accent) calc(var(--btn-equator, 52%) + var(--btn-equator-spread, 12%) * 1.6),\n color-mix(in srgb, var(--wzl-accent) var(--btn-base-tint, 70%), black) 100%\n );\n backdrop-filter: blur(var(--btn-blur, 6px)) saturate(var(--btn-saturate, 1.3));\n -webkit-backdrop-filter: blur(var(--btn-blur, 6px)) saturate(var(--btn-saturate, 1.3));\n color: var(--wzl-fg-on-accent);\n text-shadow:\n 0 1px 0 rgba(0, 0, 0, var(--btn-text-shadow, 0.35)),\n var(--btn-text-inset-x, 0px) var(--btn-text-inset-y, 1px) 0 rgba(0, 0, 0, var(--btn-text-inset, 0.55)),\n 0 0 6px rgba(0, 0, 0, calc(var(--btn-text-shadow, 0.35) * 0.5));\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, var(--btn-inset-hi, 0.42)),\n inset 0 -1px 2px rgba(0, 0, 0, var(--btn-inset-lo, 0.3)),\n 0 0 0 1px rgba(0, 0, 0, var(--btn-rim, 0.22)),\n 0 1px 2px rgba(0, 0, 0, var(--btn-drop-near, 0.3)),\n 0 2px 4px rgba(0, 0, 0, calc(var(--btn-drop-far, 0.18) * 0.8));\n}\n\n/* Specular gloss on the selected segment. Top corners inherit the\n segment's radius so they hug the upper edge cleanly; bottom corners\n are flattened so the gloss ends in a straight line at the equator\n instead of two little curves that read as `)(` brackets. */\n.segmentSelected::before {\n content: '';\n position: absolute;\n inset: 1px 1px var(--btn-gloss-bottom, 50%) 1px;\n border-radius: inherit;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, var(--btn-gloss-top, 0.42)) 0%,\n rgba(255, 255, 255, var(--btn-gloss-mid, 0.12)) 60%,\n rgba(255, 255, 255, 0) 100%\n );\n pointer-events: none;\n z-index: 1;\n}\n\n.segmentSelected > * {\n position: relative;\n z-index: 2;\n}\n\n/* Mixed segment (`aria-pressed=\"mixed\"`) — the sources disagree. Reads as a\n deliberate third state rather than a dimmed \"on\": a flat accent wash with\n none of the selected segment's gloss/cylinder treatment, so it can't be\n mistaken for the glass lozenge at a glance. */\n.segmentMixed {\n background: color-mix(in srgb, var(--wzl-accent) 22%, transparent);\n color: var(--wzl-fg);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wzl-accent) 45%, transparent);\n}\n\n.segmentMixed:hover:not(:disabled) {\n background: color-mix(in srgb, var(--wzl-accent) 32%, transparent);\n}\n\n.variant_minimal .segmentMixed {\n background: color-mix(in srgb, var(--wzl-accent) 18%, transparent);\n box-shadow: none;\n color: var(--wzl-fg);\n}\n\n/* Small variant — ~60% of the default height, with proportionally reduced\n padding and font. Sized for dense surfaces (lab control panels, inline\n filters, etc.). */\n.size_sm {\n height: 17px;\n padding: 1px;\n}\n\n.size_sm .segment {\n padding: 0 var(--wzl-space-4);\n font-size: var(--wzl-font-size-sm);\n}\n\n/* `.size_sm .segment` outranks the glyph rule above on specificity, so a\n small bar's glyph segments need the tight padding restated to stay\n near-square rather than reading as wide plates. */\n.size_sm .segment:has(> svg) {\n padding: 0 3px;\n}\n\n/* Minimal variant — strips the pill track, glass selected state, inset\n shadows, and outer padding. Used in dense diagnostic surfaces (dispatch\n trace, lab inspectors) where the bar must read as plain text controls. */\n.variant_minimal {\n height: auto;\n padding: 0;\n background: none;\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n box-shadow: none;\n gap: 0;\n}\n\n.variant_minimal .segment {\n padding: 0 var(--wzl-space-3);\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-medium);\n line-height: 1.4;\n border-radius: 0;\n color: var(--wzl-fg-muted);\n transition: none;\n}\n\n/* Dividers between segments make the mutual-exclusion grouping visible\n without a heavy track. Only the inner edges get a rule — the outer\n border on `.variant_minimal` handles the perimeter. */\n.variant_minimal .segment + .segment {\n border-left: 1px solid var(--wzl-border);\n}\n\n.variant_minimal .segment:first-child,\n.variant_minimal .segment:last-child,\n.variant_minimal .segment:only-child {\n border-radius: 0;\n}\n\n.variant_minimal .segment:hover:not(:disabled):not(.segmentSelected) {\n color: var(--wzl-fg);\n background: var(--wzl-surface-hover);\n}\n\n.variant_minimal .segmentSelected {\n background: none;\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n color: var(--wzl-accent-fg, var(--wzl-accent));\n text-shadow: none;\n box-shadow: none;\n font-weight: var(--wzl-font-weight-medium);\n}\n\n.variant_minimal .segmentSelected::before {\n content: none;\n}\n\n/* Flat variant — no track, no glass, no pill: each segment is its own\n outlined cell. For property panels, where a bar sits in a row beside\n inputs and the glass cylinder makes it the loudest thing on the surface. */\n.variant_flat {\n padding: 0;\n background: none;\n border-radius: var(--wzl-radius-sm);\n box-shadow: none;\n overflow: visible;\n}\n\n.variant_flat .segment {\n border: 1px solid var(--wzl-border-strong);\n border-radius: 0;\n /* Sunken, so an unselected cell sits below the panel and the selected one\n reads as raised without needing the glass treatment back. */\n background: var(--wzl-surface-sunken);\n color: var(--wzl-fg-muted);\n}\n\n/* Adjacent cells share one rule rather than stacking two. */\n.variant_flat .segment + .segment {\n margin-inline-start: -1px;\n}\n\n.variant_flat .segment:first-child {\n border-start-start-radius: var(--wzl-radius-sm);\n border-end-start-radius: var(--wzl-radius-sm);\n}\n\n.variant_flat .segment:last-child {\n border-start-end-radius: var(--wzl-radius-sm);\n border-end-end-radius: var(--wzl-radius-sm);\n}\n\n.variant_flat .segment:hover:not(:disabled):not(.segmentSelected) {\n background: var(--wzl-surface-hover);\n color: var(--wzl-fg);\n}\n\n.variant_flat .segmentSelected {\n background: var(--wzl-accent);\n border-color: var(--wzl-accent);\n color: var(--wzl-fg-on-accent);\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n text-shadow: none;\n box-shadow: none;\n /* Its own border rather than the neighbour's overlapping edge. */\n z-index: 1;\n}\n\n.variant_flat .segmentSelected::before {\n content: none;\n}\n","import { type CSSProperties, type ReactElement, type ReactNode } from 'react';\nimport s from './ToggleBar.module.css';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\nimport { SegmentTooltip, segmentTooltipContent, type SegmentTooltipFields } from '../segmentTooltip';\n\n/** One segment of a {@link ToggleBar}, identified by its `value`. */\nexport type ToggleBarItem<V extends string | number = string> = {\n value: V;\n label?: ReactNode;\n ariaLabel?: string;\n disabled?: boolean;\n} & SegmentTooltipFields;\n\n/** Segment height and type scale for a {@link ToggleBar}. */\nexport type ToggleBarSize = 'sm' | 'md';\n/** Visual treatment of a {@link ToggleBar}. */\nexport type ToggleBarVariant = 'default' | 'minimal' | 'flat';\n\ntype CommonProps = {\n ariaLabel?: string;\n className?: string;\n height?: number;\n /** Size variant. `sm` is ~60% of the default height with reduced padding\n * and font size — sized for dense surfaces like lab control panels. */\n size?: ToggleBarSize;\n /** Visual variant. `minimal` strips the pill track and glass treatment;\n * selection becomes a flat accent. For dense diagnostic surfaces. */\n variant?: ToggleBarVariant;\n};\n\n/**\n * Props for {@link ToggleBar}, discriminated on `mode`. Single mode is\n * controlled by one value or `null`; multiple mode by an array, and only it\n * accepts `mixedValues`.\n */\nexport type ToggleBarProps<V extends string | number = string> =\n | (CommonProps & {\n mode?: 'single';\n items: readonly ToggleBarItem<V>[];\n value: V | null;\n onChange: (next: V | null) => void;\n allowDeselect?: boolean;\n })\n | (CommonProps & {\n mode: 'multiple';\n items: readonly ToggleBarItem<V>[];\n value: readonly V[];\n /**\n * Values that are neither on nor off — the sources this bar\n * aggregates disagree (a text range that is bold in part of it, a\n * multi-selection whose nodes differ). Rendered `aria-pressed=\"mixed\"`,\n * the ARIA tri-state a toggle button actually has, rather than\n * `SelectionPanel`'s reduced-opacity-plus-`title` workaround for\n * `Switch`, which has no indeterminate state to render.\n *\n * `value` wins where the two lists overlap, so a caller that can't\n * cheaply keep them disjoint doesn't get an ambiguous segment.\n *\n * Clicking a mixed segment turns it fully **on**, matching the\n * everywhere-else convention (and `toggleFlagInRange`'s rule for a\n * partially-styled text range) that a mixed toggle resolves toward\n * the affirmative rather than clearing.\n */\n mixedValues?: readonly V[];\n onChange: (next: V[]) => void;\n });\n\n/**\n * Segmented control for choosing among a fixed set of values — one of them\n * (`mode: 'single'`, the default) or any number (`mode: 'multiple'`).\n *\n * Single mode ignores a click on the already-selected segment unless\n * `allowDeselect` is set. Arrow keys move focus without changing the value;\n * Space and Enter commit.\n */\nexport function ToggleBar<V extends string | number = string>(props: ToggleBarProps<V>): ReactElement {\n const { items, ariaLabel, className, height, size, variant } = props;\n const mode = props.mode ?? 'single';\n\n const isSelected = (value: V): boolean => {\n if (mode === 'multiple') return (props.value as readonly V[]).includes(value);\n return (props.value as V | null) === value;\n };\n\n /** Mixed only in multiple mode, and only where `value` doesn't already\n * claim the segment. Single mode has nothing to be mixed about — its\n * aggregate is one value or none. */\n const isMixed = (value: V): boolean => {\n if (mode !== 'multiple') return false;\n const mixed = (props as { mixedValues?: readonly V[] }).mixedValues;\n return mixed !== undefined && mixed.includes(value) && !isSelected(value);\n };\n\n const handleClick = (index: number) => () => {\n const item = items[index];\n if (item.disabled) return;\n if (mode === 'multiple') {\n const current = props.value as readonly V[];\n const next = current.includes(item.value)\n ? current.filter(v => v !== item.value)\n : [...current, item.value];\n (props.onChange as (n: V[]) => void)(next);\n } else {\n const current = props.value as V | null;\n if (current === item.value) {\n if ((props as { allowDeselect?: boolean }).allowDeselect) {\n (props.onChange as (n: V | null) => void)(null);\n }\n return;\n }\n (props.onChange as (n: V | null) => void)(item.value);\n }\n };\n\n const selectedIndex = mode === 'single'\n ? items.findIndex(it => it.value === (props.value as V | null))\n : -1;\n\n const roving = useRovingTabIndex({\n items,\n itemClassName: s.segment,\n // Single mode is a radiogroup: the tab stop is the current value, and\n // arrow keys move the selection with the focus. Multiple mode is a set of\n // independent toggles — focus alone moves, and Space/Enter flips.\n tabStopIndex: selectedIndex >= 0 && !items[selectedIndex].disabled ? selectedIndex : undefined,\n onNavigate: mode === 'single'\n ? (index) => (props.onChange as (n: V | null) => void)(items[index].value)\n : undefined,\n onActivate: mode === 'multiple' ? (index) => handleClick(index)() : undefined,\n });\n\n const style: CSSProperties | undefined = height !== undefined\n ? ({ ['--tb-h' as string]: `${height}px` } as CSSProperties)\n : undefined;\n\n const rootCls = [\n s.root,\n size && s[`size_${size}`],\n variant && s[`variant_${variant}`],\n className,\n ].filter(Boolean).join(' ');\n\n return (\n <div\n ref={roving.rootRef}\n className={rootCls}\n role={mode === 'multiple' ? 'group' : 'radiogroup'}\n aria-label={ariaLabel}\n style={style}\n >\n {items.map((item, i) => {\n const selected = isSelected(item.value);\n const mixed = isMixed(item.value);\n const cls = [s.segment, selected && s.segmentSelected, mixed && s.segmentMixed]\n .filter(Boolean)\n .join(' ');\n return (\n <SegmentTooltip key={item.value} content={segmentTooltipContent(item)} disabled={item.disabled}>\n <button\n type=\"button\"\n role={mode === 'multiple' ? undefined : 'radio'}\n aria-checked={mode === 'multiple' ? undefined : selected}\n aria-pressed={mode === 'multiple' ? (mixed ? 'mixed' : selected) : undefined}\n aria-label={item.ariaLabel}\n disabled={item.disabled}\n tabIndex={roving.tabIndexFor(i)}\n className={cls}\n onClick={handleClick(i)}\n onKeyDown={roving.onKeyDown(i)}\n >\n {item.label}\n </button>\n </SegmentTooltip>\n );\n })}\n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D,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;AAE3B,QACE,kBAAC,OAAD;EACE,KAAK,EAAO;EACZ,WAAW;EACX,MAAM,MAAS,aAAa,UAAU;EACtC,cAAY;EACL;YAEN,EAAM,KAAK,GAAM,MAAM;GACtB,IAAM,IAAW,EAAW,EAAK,MAAM,EACjC,IAAQ,EAAQ,EAAK,MAAM,EAC3B,IAAM;IAAC,EAAE;IAAS,KAAY,EAAE;IAAiB,KAAS,EAAE;IAAa,CAC5E,OAAO,QAAQ,CACf,KAAK,IAAI;AACZ,UACE,kBAAC,GAAD;IAAiC,SAAS,EAAsB,EAAK;IAAE,UAAU,EAAK;cACpF,kBAAC,UAAD;KACE,MAAK;KACL,MAAM,MAAS,aAAa,KAAA,IAAY;KACxC,gBAAc,MAAS,aAAa,KAAA,IAAY;KAChD,gBAAc,MAAS,aAAc,IAAQ,UAAU,IAAY,KAAA;KACnE,cAAY,EAAK;KACjB,UAAU,EAAK;KACf,UAAU,EAAO,YAAY,EAAE;KAC/B,WAAW;KACX,SAAS,EAAY,EAAE;KACvB,WAAW,EAAO,UAAU,EAAE;eAE7B,EAAK;KACC,CAAA;IACM,EAfI,EAAK,MAeT;IAEnB;EACE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TokenPanel-5ajHEHha.js","names":[],"sources":["../../src/components/TokenPanel/color.ts","../../src/components/TokenPanel/TokenPanel.module.css","../../src/components/TokenPanel/tokenTypes.ts","../../src/components/TokenPanel/TokenPanel.tsx"],"sourcesContent":["const HEX = /^#(?:[\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/i;\nconst RGB = /^rgba?\\(\\s*(\\d{1,3})[\\s,]+(\\d{1,3})[\\s,]+(\\d{1,3})\\b/i;\nconst COLOR_FUNCTION = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix)\\(.+\\)$/i;\nconst KEYWORDS = new Set([\n 'transparent',\n 'currentcolor',\n 'black',\n 'white',\n 'gray',\n 'silver',\n 'red',\n 'orange',\n 'yellow',\n 'gold',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'navy',\n 'purple',\n 'magenta',\n 'pink',\n 'brown',\n]);\n\ntype Supports = ((value: string) => boolean) | null;\n\nfunction browserSupports(): Supports {\n return typeof CSS !== 'undefined' && typeof CSS.supports === 'function'\n ? (value) => CSS.supports('color', value)\n : null;\n}\n\n/** Whether `value` is a CSS color — the browser's answer where it has `CSS.supports`, a small parser's otherwise. */\nexport function parsesAsColor(value: string, supports: Supports = browserSupports()): boolean {\n const v = value.trim();\n // `CSS.supports` accepts any `var()` for any property.\n if (!v || v.includes('var(')) return false;\n if (supports) return supports(v);\n return HEX.test(v) || COLOR_FUNCTION.test(v) || KEYWORDS.has(v.toLowerCase());\n}\n\nfunction hexOf(v: string): string | null {\n if (HEX.test(v)) {\n const digits = v.slice(1).toLowerCase();\n return `#${digits.length <= 4 ? [...digits.slice(0, 3)].map((d) => d + d).join('') : digits.slice(0, 6)}`;\n }\n const rgb = RGB.exec(v);\n return rgb\n ? `#${rgb\n .slice(1, 4)\n .map((n) => Math.min(255, Number(n)).toString(16).padStart(2, '0'))\n .join('')}`\n : null;\n}\n\nlet paint: CanvasRenderingContext2D | null | undefined;\n\n/** The browser's serialization of a color, through a canvas fill style; null where it has none or rejects `value`. */\nfunction serialized(value: string): string | null {\n if (paint === undefined) {\n try {\n paint = document.createElement('canvas').getContext('2d');\n } catch {\n paint = null;\n }\n }\n if (!paint) return null;\n // A rejected value leaves the previous fill style, so two different ones tell a rejection apart.\n paint.fillStyle = '#000000';\n paint.fillStyle = value;\n const onBlack = String(paint.fillStyle);\n paint.fillStyle = '#ffffff';\n paint.fillStyle = value;\n return onBlack === String(paint.fillStyle) ? onBlack : null;\n}\n\n/** `value` as the `#rrggbb` a color input takes, alpha dropped; null when it cannot be converted. */\nexport function toHex(value: string): string | null {\n const v = value.trim();\n const direct = hexOf(v);\n if (direct) return direct;\n const browser = typeof document === 'undefined' ? null : serialized(v);\n return browser && browser !== v ? hexOf(browser) : null;\n}\n",".panel {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.section {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.section + .section {\n border-top: var(--wzl-border-w) solid var(--wzl-line-subtle);\n}\n\n.sectionHead {\n padding-block: var(--wzl-space-xs);\n color: var(--wzl-fg-muted);\n font-family: var(--wzl-font-display);\n font-size: var(--wzl-font-size-sm);\n letter-spacing: 0.08em;\n text-transform: uppercase;\n}\n\n.sectionBody {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-sm);\n padding-block-end: var(--wzl-space-sm);\n}\n\n.row,\n.family {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-1);\n min-width: 0;\n}\n\n.name {\n overflow: hidden;\n color: var(--wzl-fg-muted);\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-sm);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.edit {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-xs);\n min-width: 0;\n}\n\n.field {\n --wzl-font-ui: var(--wzl-font-mono);\n flex: 1;\n min-width: 0;\n}\n\n.number {\n --wzl-font-ui: var(--wzl-font-mono);\n flex: 1;\n min-width: 0;\n}\n\n.unit {\n color: var(--wzl-fg-muted);\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-sm);\n}\n\n/* Padding inflates a native color input past its box in Chrome. */\n.swatchInput {\n box-sizing: border-box;\n flex-shrink: 0;\n width: 18px;\n height: 14px;\n padding: 0;\n background: transparent;\n border: 0;\n border-radius: var(--wzl-radius-sm);\n cursor: pointer;\n}\n\n.chip {\n flex-shrink: 0;\n width: 18px;\n height: 14px;\n background: var(--token-color);\n border-radius: var(--wzl-radius-sm);\n box-shadow: inset 0 0 0 1px var(--wzl-line);\n}\n\n.curve {\n flex-shrink: 0;\n width: 24px;\n /* Square easing-curve artwork: not-a-control */\n height: 24px;\n color: var(--wzl-fg);\n}\n\n.strip {\n display: flex;\n height: var(--wzl-control-h);\n overflow: hidden;\n border: var(--wzl-border-w) solid var(--wzl-line);\n border-radius: var(--wzl-radius-sm);\n}\n\n.swatch {\n flex: 1 1 0;\n min-width: 0;\n height: 100%;\n padding: 0;\n background: var(--token-color);\n border: 0;\n border-radius: 0;\n cursor: pointer;\n}\n\n.swatch[data-overridden] {\n box-shadow: inset 0 -3px 0 var(--wzl-accent);\n}\n\n.swatch[aria-pressed='true'],\n.swatch:focus-visible {\n position: relative;\n z-index: 1;\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: -2px;\n}\n\n/* A group of sizes: its name over a grid of steps, each labeled by what its name adds. */\n.scale {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-1);\n min-width: 0;\n}\n\n.scaleHead {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-xs);\n min-width: 0;\n}\n\n.steps {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr));\n gap: var(--wzl-space-1) var(--wzl-space-xs);\n}\n\n.rule {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wzl-space-xs) var(--wzl-space-sm);\n min-width: 0;\n}\n\n.ruleLabel {\n color: var(--wzl-fg-subtle);\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-2xs);\n}\n\n.rule .number {\n flex: 0 1 5ch;\n font-variant-numeric: tabular-nums;\n text-align: end;\n}\n\n.step {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.stepLabel {\n overflow: hidden;\n text-align: end;\n color: var(--wzl-fg-subtle);\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-2xs);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.step[data-overridden] .stepLabel {\n color: var(--wzl-accent-fg);\n}\n\n.stepEdit {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-1);\n min-width: 0;\n}\n\n.step > .stepEdit + .stepEdit {\n margin-block-start: var(--wzl-space-1);\n}\n\n.stepEdit .number {\n font-variant-numeric: tabular-nums;\n text-align: end;\n}\n\n/* Tight: a token to a line, with the names on a fixed rail so the values read\n down the panel as a column. A stacked row spends its height on the name and\n lets the field take the whole width, which a set of ninety cannot afford. */\n.tight .sectionBody {\n gap: var(--wzl-space-1);\n padding-block-end: var(--wzl-space-xs);\n}\n\n.tight .row {\n flex-direction: row;\n align-items: center;\n gap: var(--wzl-space-xs);\n}\n\n.tight .row > .name {\n flex: 0 0 11rem;\n}\n\n.tight .edit {\n flex: 1 1 auto;\n}\n\n.tight .field,\n.tight .number {\n flex: 0 1 16rem;\n font-variant-numeric: tabular-nums;\n}\n\n.tight .unit {\n font-variant-numeric: tabular-nums;\n}\n\n.tight .scale {\n display: grid;\n grid-template-columns: 11rem minmax(0, 1fr);\n align-items: start;\n column-gap: var(--wzl-space-xs);\n}\n\n/* Grid rather than a row, so a picked swatch's editor still spans the full width. */\n.tight .family {\n display: grid;\n grid-template-columns: 11rem minmax(0, 1fr);\n align-items: center;\n column-gap: var(--wzl-space-xs);\n row-gap: var(--wzl-space-1);\n}\n\n.tight .family > .row {\n grid-column: 1 / -1;\n}\n\n.tight .strip {\n height: 16px;\n}\n\n.tight .curve {\n width: 16px;\n height: 16px;\n}\n","import { parsesAsColor } from './color';\n\n/** A design token as `TokenPanel` edits it. */\nexport interface TokenEntry {\n /** The custom property, e.g. `--wzl-gray-50`. */\n name: string;\n /** A DTCG type name. A type the panel has no control for edits as text. */\n type: string;\n /** Tokens sharing a group sit together; a color group large enough draws as one row of swatches. */\n group: string;\n value: string;\n /** Whether `value` overrides the token's own, which offers Reset. */\n overridden?: boolean;\n description?: string;\n}\n\n/** How a scale's steps follow from its base: one multiplier per step, a constant ratio, or a constant step. */\nexport type TokenScaleRule =\n | { kind: 'factors'; factors: readonly number[] }\n | { kind: 'ratio'; ratio: number }\n | { kind: 'step'; step: number };\n\n/** A group whose steps are generated from a base, so the panel edits the base and the rule rather than each step. */\nexport interface TokenScale {\n /** The generated tokens, smallest first. Anything else in the group draws as an ordinary step. */\n tokens: readonly string[];\n base: number;\n rule: TokenScaleRule;\n}\n\nconst round2 = (n: number) => Math.round(n * 100) / 100;\n\n/**\n * The same scale under another rule, fitted to the amounts its steps have now.\n * A ratio or step counts from the first step, so switching to one moves the\n * base there.\n */\nexport function refitScale(scale: TokenScale, kind: TokenScaleRule['kind'], amounts: readonly number[]): TokenScale {\n const first = amounts[0] ?? scale.base;\n const last = amounts.at(-1) ?? first;\n const spans = Math.max(1, amounts.length - 1);\n switch (kind) {\n case 'factors':\n return { ...scale, rule: { kind, factors: amounts.map((a) => (scale.base ? round2(a / scale.base) : 1)) } };\n case 'ratio':\n return { ...scale, base: first, rule: { kind, ratio: first > 0 ? round2((last / first) ** (1 / spans)) : 1 } };\n case 'step':\n return { ...scale, base: first, rule: { kind, step: round2((last - first) / spans) } };\n }\n}\n\nexport type TokenCategory = 'color' | 'type' | 'size' | 'motion' | 'depth' | 'other';\n\n/** The panel's sections, in the order it draws them. */\nexport const TOKEN_CATEGORIES: readonly { id: TokenCategory; title: string }[] = [\n { id: 'color', title: 'Color' },\n { id: 'type', title: 'Type' },\n { id: 'size', title: 'Size' },\n { id: 'motion', title: 'Motion' },\n { id: 'depth', title: 'Depth' },\n { id: 'other', title: 'Other' },\n];\n\nconst TYPE_SCALE = /^(?:font|tracking|leading|letter|line-height)/;\n\n/** The section a token is filed under: by its type, and for a bare dimension or number by its group. */\nexport function tokenCategory(token: TokenEntry): TokenCategory {\n switch (token.type) {\n case 'color':\n return 'color';\n case 'fontFamily':\n case 'fontWeight':\n return 'type';\n case 'duration':\n case 'cubicBezier':\n return 'motion';\n case 'shadow':\n case 'gradient':\n return 'depth';\n case 'dimension':\n case 'number':\n if (TYPE_SCALE.test(token.group)) return 'type';\n if (token.type === 'number' && (token.group === 'z' || token.group === 'z-index')) return 'depth';\n return 'size';\n default:\n return 'other';\n }\n}\n\nconst AMOUNT = String.raw`-?(?:\\d+\\.?\\d*|\\.\\d+)`;\nconst DIMENSION = new RegExp(\n `^${AMOUNT}(?:px|rem|em|%|ch|ex|lh|rlh|vh|vw|vmin|vmax|svh|lvh|dvh|cqw|cqh|pt|pc|cm|mm|in|q)$`,\n 'i',\n);\nconst DURATION = new RegExp(`^${AMOUNT}m?s$`);\nconst NUMBER = new RegExp(`^${AMOUNT}$`);\nconst LENGTH = new RegExp(`^${AMOUNT}(?:px|rem|em)?$`);\nconst BEZIER = new RegExp(`^cubic-bezier\\\\(\\\\s*(${AMOUNT})\\\\s*,\\\\s*(${AMOUNT})\\\\s*,\\\\s*(${AMOUNT})\\\\s*,\\\\s*(${AMOUNT})\\\\s*\\\\)$`, 'i');\nconst GRADIENT = /^(?:repeating-)?(?:linear|radial|conic)-gradient\\(/i;\n/** Commas outside parentheses: a shadow's layers, not a color function's arguments. */\nconst LAYERS = /,(?![^(]*\\))/;\nconst PARTS = /[a-z-]+\\([^)]*\\)|\\S+/gi;\n\nfunction isShadow(value: string): boolean {\n return value.split(LAYERS).every((layer) => {\n const parts = layer.trim().replace(/^inset\\s+/i, '').match(PARTS) ?? [];\n const lengths = parts.filter((part) => LENGTH.test(part));\n const rest = parts.filter((part) => !LENGTH.test(part));\n return lengths.length >= 2 && lengths.length <= 4 && rest.length <= 1 && rest.every((part) => parsesAsColor(part));\n });\n}\n\n/** A DTCG type read off the shape of a value, for a token that arrives without one. `'string'` when nothing fits. */\nexport function inferTokenType(value: string): string {\n const v = value.trim();\n if (!v) return 'string';\n if (DURATION.test(v)) return 'duration';\n if (DIMENSION.test(v)) return 'dimension';\n if (NUMBER.test(v)) return 'number';\n if (BEZIER.test(v)) return 'cubicBezier';\n if (GRADIENT.test(v)) return 'gradient';\n if (parsesAsColor(v)) return 'color';\n if (isShadow(v)) return 'shadow';\n return 'string';\n}\n\n/** A number and its unit, or null for a value that is not one. */\nexport function splitUnit(value: string): { amount: number; unit: string } | null {\n const match = new RegExp(`^(${AMOUNT})([a-z%]*)$`, 'i').exec(value.trim());\n return match ? { amount: Number(match[1]), unit: match[2] ?? '' } : null;\n}\n\n/** The four control points of a `cubic-bezier()`, or null for any other easing. */\nexport function bezierPoints(value: string): readonly [number, number, number, number] | null {\n const match = BEZIER.exec(value.trim());\n if (!match) return null;\n const [x1, y1, x2, y2] = match.slice(1, 5).map(Number) as [number, number, number, number];\n return [x1, y1, x2, y2];\n}\n","import { type CSSProperties, memo, useCallback, useMemo, useState } from 'react';\nimport { Focusable } from 'react-aria-components';\nimport { Button } from '../Button';\nimport { DisclosureRow } from '../Disclosure';\nimport { Input } from '../Input';\nimport { NumberField } from '../NumberField';\nimport { Select } from '../Select';\nimport { ToggleBar, type ToggleBarItem } from '../ToggleBar';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport { toHex } from './color';\nimport s from './TokenPanel.module.css';\nimport {\n bezierPoints,\n refitScale,\n splitUnit,\n TOKEN_CATEGORIES,\n type TokenCategory,\n type TokenEntry,\n type TokenScale,\n type TokenScaleRule,\n tokenCategory,\n} from './tokenTypes';\n\ntype OnChange = (name: string, value: string | null) => void;\n\n/** Props for `<TokenPanel>`. */\nexport interface TokenPanelProps {\n tokens: readonly TokenEntry[];\n /** A token's new value, or null to drop its override. Keep it stable: rows re-render only when it or their token changes. */\n onChange: OnChange;\n /** Sections held closed, by category. Omit to let the panel keep that state itself. */\n collapsed?: Readonly<Partial<Record<TokenCategory, boolean>>>;\n onCollapsedChange?: (category: TokenCategory, collapsed: boolean) => void;\n /** Groups generated from a base, by group name. Such a group edits its base and rule above its steps. */\n scales?: Readonly<Record<string, TokenScale>>;\n /** A scale's new base or rule. The panel does not regenerate the steps; the consumer does, through `onChange`. */\n onScaleChange?: (group: string, scale: TokenScale) => void;\n /** Files a token under a section. Defaults to `tokenCategory`. */\n categorize?: (token: TokenEntry) => TokenCategory;\n /** The fewest colors, or sizes, sharing a group that draw as one row of swatches or one grid of steps. Default 3. */\n familySize?: number;\n /**\n * Row layout. `tight` puts a token on one line — name, control, Reset — with the\n * names on a fixed rail so the values read down the panel as a column, and caps\n * the field rather than letting it span the panel. Default `normal` stacks the\n * control under its name.\n */\n density?: 'tight' | 'normal';\n className?: string;\n}\n\nconst WEIGHTS = ['100', '200', '300', '400', '500', '600', '700', '800', '900'];\nconst NUMBER_FORMAT = { maximumFractionDigits: 4, useGrouping: false } as const;\n\ntype FamilyKind = 'family' | 'scale';\ntype Item = { kind: 'row'; token: TokenEntry } | { kind: FamilyKind; group: string; tokens: TokenEntry[] };\n\nconst SCALAR = new Set(['dimension', 'duration', 'number']);\n\nfunction familyKindOf(token: TokenEntry): FamilyKind | null {\n if (token.type === 'color') return 'family';\n return SCALAR.has(token.type) && splitUnit(token.value) ? 'scale' : null;\n}\n\nfunction itemsOf(tokens: readonly TokenEntry[], familySize: number): Item[] {\n const counts = new Map<string, number>();\n for (const token of tokens) {\n const kind = familyKindOf(token);\n if (kind) counts.set(`${kind}:${token.group}`, (counts.get(`${kind}:${token.group}`) ?? 0) + 1);\n }\n const families = new Map<string, Extract<Item, { kind: FamilyKind }>>();\n const items: Item[] = [];\n for (const token of tokens) {\n const kind = familyKindOf(token);\n const key = `${kind}:${token.group}`;\n if (!kind || (counts.get(key) ?? 0) < familySize) {\n items.push({ kind: 'row', token });\n continue;\n }\n let family = families.get(key);\n if (!family) {\n family = { kind, group: token.group, tokens: [] };\n families.set(key, family);\n items.push(family);\n }\n family.tokens.push(token);\n }\n return items;\n}\n\n/** Each name's segments past those every name in the set shares; a name that is all shared keeps its last. */\nfunction stepLabels(names: readonly string[]): string[] {\n const split = names.map((name) => name.replace(/^--/, '').split('-'));\n let shared = 0;\n while (split.every((segments) => segments.length > shared && segments[shared] === split[0]?.[shared])) shared++;\n return split.map((segments) => segments.slice(shared).join('-') || (segments.at(-1) ?? ''));\n}\n\nfunction Curve({ points, label }: { points: readonly [number, number, number, number]; label: string }) {\n const [x1, y1, x2, y2] = points;\n // y is flipped so the curve rises, and the box grows to hold an overshoot.\n const top = Math.min(0, 1 - y1, 1 - y2);\n const bottom = Math.max(1, 1 - y1, 1 - y2);\n return (\n <svg className={s.curve} viewBox={`-0.1 ${top - 0.1} 1.2 ${bottom - top + 0.2}`} role=\"img\" aria-label={label}>\n <path d={`M0 1 C${x1} ${1 - y1} ${x2} ${1 - y2} 1 0`} fill=\"none\" stroke=\"currentColor\" strokeWidth={0.08} />\n </svg>\n );\n}\n\nfunction TokenControl({ token, set }: { token: TokenEntry; set: (value: string) => void }) {\n const { name, type, value } = token;\n const label = `${name} value`;\n const hex = useMemo(() => (type === 'color' ? toHex(value) : null), [type, value]);\n\n if (type === 'dimension' || type === 'duration' || type === 'number') {\n const split = splitUnit(value);\n if (split) {\n return (\n <>\n <NumberField\n className={s.number}\n aria-label={label}\n value={split.amount}\n hideSteppers\n formatOptions={NUMBER_FORMAT}\n onChange={(amount) => {\n if (Number.isFinite(amount)) set(`${amount}${split.unit}`);\n }}\n />\n {split.unit ? <span className={s.unit}>{split.unit}</span> : null}\n </>\n );\n }\n }\n\n if (type === 'fontWeight') {\n const options = (WEIGHTS.includes(value) ? WEIGHTS : [...WEIGHTS, value]).map((weight) => ({\n value: weight,\n label: weight,\n }));\n return <Select aria-label={name} width=\"fit\" selectedKey={value} options={options} onSelectionChange={set} />;\n }\n\n const points = type === 'cubicBezier' ? bezierPoints(value) : null;\n return (\n <>\n {points ? <Curve points={points} label={`${name} curve`} /> : null}\n <Input\n className={s.field}\n aria-label={label}\n value={value}\n onChange={set}\n leadingAdornment={\n type !== 'color' ? undefined : hex ? (\n <input\n type=\"color\"\n className={s.swatchInput}\n aria-label={`${name} color`}\n value={hex}\n onChange={(event) => set(event.target.value)}\n />\n ) : (\n <span className={s.chip} style={{ '--token-color': value } as CSSProperties} aria-hidden=\"true\" />\n )\n }\n />\n </>\n );\n}\n\nconst TokenRow = memo(\n function TokenRow({ token, onChange }: { token: TokenEntry; onChange: OnChange }) {\n const set = useCallback((value: string) => onChange(token.name, value), [onChange, token.name]);\n return (\n <div className={s.row} role=\"group\" aria-label={token.name}>\n <span className={s.name} title={token.description || token.name}>\n {token.name}\n </span>\n <div className={s.edit}>\n <TokenControl token={token} set={set} />\n {token.overridden ? (\n <Button variant=\"ghost\" size=\"sm\" ariaLabel={`Reset ${token.name}`} onClick={() => onChange(token.name, null)}>\n Reset\n </Button>\n ) : null}\n </div>\n </div>\n );\n },\n // Consumers rebuild their entries each render; a row only has to redraw when what it shows changed.\n (a, b) =>\n a.onChange === b.onChange &&\n a.token.name === b.token.name &&\n a.token.type === b.token.type &&\n a.token.value === b.token.value &&\n a.token.overridden === b.token.overridden &&\n a.token.description === b.token.description,\n);\n\nfunction Family({ group, tokens, onChange }: { group: string; tokens: readonly TokenEntry[]; onChange: OnChange }) {\n const [picked, setPicked] = useState<string | null>(null);\n const token = tokens.find((t) => t.name === picked) ?? null;\n return (\n <div className={s.family} role=\"group\" aria-label={group}>\n <span className={s.name}>{group}</span>\n <div className={s.strip}>\n {tokens.map((t) => (\n <TooltipTrigger key={t.name} delay={0}>\n <Focusable>\n <button\n type=\"button\"\n className={s.swatch}\n style={{ '--token-color': t.value } as CSSProperties}\n aria-label={t.name}\n aria-pressed={t.name === picked}\n data-overridden={t.overridden ? '' : undefined}\n onClick={() => setPicked((current) => (current === t.name ? null : t.name))}\n />\n </Focusable>\n <Tooltip>{t.name}</Tooltip>\n </TooltipTrigger>\n ))}\n </div>\n {token ? <TokenRow token={token} onChange={onChange} /> : null}\n </div>\n );\n}\n\nfunction ScaleStep({\n token,\n label,\n showUnit,\n factor,\n onChange,\n onFactorChange,\n}: {\n token: TokenEntry;\n label: string;\n showUnit: boolean;\n factor?: number;\n onChange: OnChange;\n onFactorChange?: (factor: number) => void;\n}) {\n const split = splitUnit(token.value);\n if (!split) return null;\n return (\n <div className={s.step} title={token.description || token.name} data-overridden={token.overridden ? '' : undefined}>\n <span className={s.stepLabel}>{label}</span>\n <span className={s.stepEdit}>\n <NumberField\n className={s.number}\n aria-label={`${token.name} value`}\n value={split.amount}\n hideSteppers\n formatOptions={NUMBER_FORMAT}\n onChange={(amount) => {\n if (Number.isFinite(amount)) onChange(token.name, `${amount}${split.unit}`);\n }}\n />\n {showUnit && split.unit ? <span className={s.unit}>{split.unit}</span> : null}\n </span>\n {factor !== undefined && onFactorChange ? (\n <span className={s.stepEdit}>\n <span className={s.unit}>×</span>\n <NumberField\n className={s.number}\n aria-label={`${token.name} factor`}\n value={factor}\n hideSteppers\n formatOptions={NUMBER_FORMAT}\n onChange={(next) => {\n if (Number.isFinite(next)) onFactorChange(next);\n }}\n />\n </span>\n ) : null}\n </div>\n );\n}\n\nconst RULES: readonly ToggleBarItem<TokenScaleRule['kind']>[] = [\n { value: 'factors', label: 'each', ariaLabel: 'factors' },\n { value: 'ratio', label: 'ratio' },\n { value: 'step', label: 'step' },\n];\n\nfunction ScaleRuleControls({\n group,\n scale,\n unit,\n amounts,\n onScaleChange,\n}: {\n group: string;\n scale: TokenScale;\n unit: string;\n amounts: readonly number[];\n onScaleChange: (scale: TokenScale) => void;\n}) {\n const { rule } = scale;\n const param =\n rule.kind === 'ratio'\n ? { key: 'ratio' as const, value: rule.ratio }\n : rule.kind === 'step'\n ? { key: 'step' as const, value: rule.step }\n : null;\n return (\n <div className={s.rule}>\n <span className={s.stepEdit}>\n <span className={s.ruleLabel}>base</span>\n <NumberField\n className={s.number}\n aria-label={`${group} base`}\n value={scale.base}\n hideSteppers\n formatOptions={NUMBER_FORMAT}\n onChange={(base) => {\n if (Number.isFinite(base)) onScaleChange({ ...scale, base });\n }}\n />\n {unit ? <span className={s.unit}>{unit}</span> : null}\n </span>\n <ToggleBar\n ariaLabel={`${group} rule`}\n size=\"sm\"\n items={RULES}\n value={rule.kind}\n onChange={(kind) => {\n if (kind && kind !== rule.kind) onScaleChange(refitScale(scale, kind, amounts));\n }}\n />\n {param ? (\n <span className={s.stepEdit}>\n {param.key === 'ratio' ? <span className={s.unit}>×</span> : <span className={s.unit}>+</span>}\n <NumberField\n className={s.number}\n aria-label={`${group} ${param.key}`}\n value={param.value}\n hideSteppers\n formatOptions={NUMBER_FORMAT}\n onChange={(value) => {\n if (Number.isFinite(value)) onScaleChange({ ...scale, rule: { kind: param.key, [param.key]: value } as TokenScaleRule });\n }}\n />\n </span>\n ) : null}\n </div>\n );\n}\n\nfunction Scale({\n group,\n tokens,\n generator,\n onChange,\n onScaleChange,\n}: {\n group: string;\n tokens: readonly TokenEntry[];\n generator?: TokenScale;\n onChange: OnChange;\n onScaleChange?: (group: string, scale: TokenScale) => void;\n}) {\n const labels = useMemo(() => stepLabels(tokens.map((t) => t.name)), [tokens]);\n const units = new Set(tokens.map((t) => splitUnit(t.value)?.unit ?? ''));\n const unit = units.size === 1 ? [...units][0] : null;\n const overridden = tokens.filter((t) => t.overridden);\n return (\n <div className={s.scale} role=\"group\" aria-label={group}>\n <span className={s.scaleHead}>\n <span className={s.name}>{group}</span>\n {unit ? <span className={s.unit}>{unit}</span> : null}\n {overridden.length > 0 ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n ariaLabel={`Reset ${group}`}\n onClick={() => {\n for (const t of overridden) onChange(t.name, null);\n }}\n >\n Reset\n </Button>\n ) : null}\n </span>\n {generator && onScaleChange ? (\n <ScaleRuleControls\n group={group}\n scale={generator}\n unit={unit ?? ''}\n amounts={generator.tokens.map(\n (name) => splitUnit(tokens.find((t) => t.name === name)?.value ?? '')?.amount ?? generator.base,\n )}\n onScaleChange={(next) => onScaleChange(group, next)}\n />\n ) : null}\n <div className={s.steps}>\n {tokens.map((t, i) => {\n const rule = generator?.rule;\n const at = generator ? generator.tokens.indexOf(t.name) : -1;\n const factor = rule?.kind === 'factors' && at >= 0 ? rule.factors[at] : undefined;\n return (\n <ScaleStep\n key={t.name}\n token={t}\n label={labels[i] ?? t.name}\n showUnit={unit === null}\n factor={factor}\n onChange={onChange}\n onFactorChange={\n generator && onScaleChange && rule?.kind === 'factors'\n ? (next) =>\n onScaleChange(group, {\n ...generator,\n rule: { kind: 'factors', factors: rule.factors.map((f, j) => (j === at ? next : f)) },\n })\n : undefined\n }\n />\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction Section({\n title,\n open,\n onToggle,\n tokens,\n familySize,\n scales,\n onChange,\n onScaleChange,\n}: {\n title: string;\n open: boolean;\n onToggle: () => void;\n tokens: readonly TokenEntry[];\n familySize: number;\n scales?: Readonly<Record<string, TokenScale>>;\n onChange: OnChange;\n onScaleChange?: (group: string, scale: TokenScale) => void;\n}) {\n const items = useMemo(() => itemsOf(tokens, familySize), [tokens, familySize]);\n return (\n <section className={s.section} aria-label={title}>\n <DisclosureRow className={s.sectionHead} open={open} onToggle={onToggle} label={title}>\n <span aria-hidden=\"true\">{title}</span>\n </DisclosureRow>\n {open ? (\n <div className={s.sectionBody}>\n {items.map((item) =>\n item.kind === 'row' ? (\n <TokenRow key={item.token.name} token={item.token} onChange={onChange} />\n ) : item.kind === 'scale' ? (\n <Scale\n key={`scale:${item.group}`}\n group={item.group}\n tokens={item.tokens}\n generator={scales?.[item.group]}\n onChange={onChange}\n onScaleChange={onScaleChange}\n />\n ) : (\n <Family key={`family:${item.group}`} group={item.group} tokens={item.tokens} onChange={onChange} />\n ),\n )}\n </div>\n ) : null}\n </section>\n );\n}\n\n/**\n * Edits a set of design tokens by type: collapsible sections by category, a\n * color group drawn as one row of swatches sized to fit, a group of sizes drawn\n * as one grid of numbers labeled by step — with its base and rule above it when\n * `scales` says how it is generated — and a control for each\n * type — a number with its unit for dimensions and durations, the nine weights\n * for a font weight, a curve beside a `cubic-bezier()`, a swatch beside a color,\n * and text for everything else.\n */\nexport function TokenPanel({\n tokens,\n onChange,\n collapsed,\n onCollapsedChange,\n scales,\n onScaleChange,\n categorize = tokenCategory,\n familySize = 3,\n density = 'normal',\n className,\n}: TokenPanelProps) {\n const [ownCollapsed, setOwnCollapsed] = useState<Partial<Record<TokenCategory, boolean>>>({});\n const closed = collapsed ?? ownCollapsed;\n const byCategory = useMemo(() => {\n const sections = new Map<TokenCategory, TokenEntry[]>();\n for (const token of tokens) {\n const category = categorize(token);\n sections.set(category, [...(sections.get(category) ?? []), token]);\n }\n return sections;\n }, [tokens, categorize]);\n\n return (\n <div className={[s.panel, density === 'tight' && s.tight, className].filter(Boolean).join(' ')}>\n {TOKEN_CATEGORIES.map(({ id, title }) => {\n const inSection = byCategory.get(id);\n if (!inSection) return null;\n const open = !closed[id];\n return (\n <Section\n key={id}\n title={title}\n open={open}\n onToggle={() => {\n if (collapsed === undefined) setOwnCollapsed((prev) => ({ ...prev, [id]: open }));\n onCollapsedChange?.(id, open);\n }}\n tokens={inSection}\n familySize={familySize}\n scales={scales}\n onChange={onChange}\n onScaleChange={onScaleChange}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAM,IAAM,8CACN,IAAM,yDACN,IAAiB,oEACjB,IAAW,IAAI,IAAI;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAIF,SAAS,IAA4B;AACnC,QAAO,OAAO,MAAQ,OAAe,OAAO,IAAI,YAAa,cACxD,MAAU,IAAI,SAAS,SAAS,EAAM,GACvC;;AAIN,SAAgB,EAAc,GAAe,IAAqB,GAAiB,EAAW;CAC5F,IAAM,IAAI,EAAM,MAAM;AAItB,QAFI,CAAC,KAAK,EAAE,SAAS,OAAO,GAAS,KACjC,IAAiB,EAAS,EAAE,GACzB,EAAI,KAAK,EAAE,IAAI,EAAe,KAAK,EAAE,IAAI,EAAS,IAAI,EAAE,aAAa,CAAC;;AAG/E,SAAS,EAAM,GAA0B;AACvC,KAAI,EAAI,KAAK,EAAE,EAAE;EACf,IAAM,IAAS,EAAE,MAAM,EAAE,CAAC,aAAa;AACvC,SAAO,IAAI,EAAO,UAAU,IAAI,CAAC,GAAG,EAAO,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,MAAM,IAAI,EAAE,CAAC,KAAK,GAAG,GAAG,EAAO,MAAM,GAAG,EAAE;;CAEzG,IAAM,IAAM,EAAI,KAAK,EA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AK;MAAM,EAAE,EACjF,IAAoB,GAAI,EAAK;;IAE/B,QAAQ;IACI;IACJ;IACE;IACK;IACf,EAZK,EAYL;IAEJ;EACE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToolButton-rzqlFlAc.js","names":[],"sources":["../../src/components/ToolButton/ToolButton.module.css","../../src/components/ToolButton/ToolButton.tsx"],"sourcesContent":[".button {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--wzl-space-1);\n min-width: 44px;\n padding: var(--wzl-space-3) var(--wzl-space-2);\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n cursor: default;\n font-family: inherit;\n font-size: var(--wzl-font-size-xs);\n line-height: 1.1;\n}\n.button:hover:not([disabled]) {\n background: var(--wzl-surface-hover);\n color: var(--wzl-fg);\n}\n.button:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: -2px;\n}\n.button.active {\n background: var(--wzl-surface-pressed);\n border-color: var(--wzl-accent);\n color: var(--wzl-fg);\n}\n.button[disabled] {\n opacity: 0.4;\n}\n\n.icon { display: block; }\n.icon > svg { display: block; }\n.label { font-size: var(--wzl-font-size-xs); }\n.shortcut {\n color: var(--wzl-fg-muted);\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: var(--wzl-font-size-2xs);\n}\n","import type { KeyboardEvent, ReactNode } from 'react';\nimport { Focusable } from 'react-aria-components';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport s from './ToolButton.module.css';\n\n/** Props for {@link ToolButton}. */\nexport interface ToolButtonProps {\n /** Icon node (typically an SVG component). */\n icon: ReactNode;\n /** Human-readable label shown under the icon. */\n label: string;\n /** Optional shortcut hint (e.g. \"V\" or \"⌘Z\"). */\n shortcut?: string;\n /** Selected/active state — toggles the active visual treatment. */\n active?: boolean;\n /** Disabled state — passes through to the underlying button. */\n disabled?: boolean;\n /**\n * When true, sets `aria-disabled=\"true\"` on the button without using the\n * native `disabled` attribute. This keeps the button focusable and reachable\n * by keyboard (roving-tabindex still applies) while marking it as ineligible\n * to screen readers. The caller is responsible for making `onClick` a no-op.\n */\n ariaDisabled?: boolean;\n /**\n * Whether this button is the currently tabbable member of its toolbar.\n * Toolbars use roving tabindex: exactly one button has `tabIndex=0` at\n * a time; the rest are `-1`. Caller manages which.\n */\n tabbable?: boolean;\n /** Click handler. */\n onClick(): void;\n /** Key handler for the underlying button — a toolbar's roving-tabindex\n * navigation attaches here. */\n onKeyDown?(e: KeyboardEvent<HTMLElement>): void;\n /**\n * Tooltip content. Defaults to `label` (plus `shortcut` if provided).\n */\n title?: string;\n /** Additional class for the root button. */\n className?: string;\n}\n\n/**\n * Generic icon-+-label toolbar button — building block for `ToolPalette`\n * and similar surfaces. Headless about layout direction (parent group\n * supplies flex direction via `ToolGroup`). Theme via `--wzl-*` tokens.\n */\nexport function ToolButton(props: ToolButtonProps) {\n const {\n icon, label, shortcut, active, disabled, ariaDisabled, tabbable,\n onClick, onKeyDown, title, className,\n } = props;\n const resolvedTitle = title ?? (shortcut ? `${label} (${shortcut})` : label);\n const cls = [s.button, active && s.active, className].filter(Boolean).join(' ');\n return (\n <TooltipTrigger isDisabled={disabled}>\n <Focusable isDisabled={disabled}>\n <button\n type=\"button\"\n tabIndex={tabbable ? 0 : -1}\n className={cls}\n aria-current={active ? 'true' : undefined}\n aria-disabled={ariaDisabled ? 'true' : undefined}\n disabled={disabled}\n onClick={onClick}\n onKeyDown={onKeyDown}\n >\n <span className={s.icon} aria-hidden=\"true\">{icon}</span>\n <span className={s.label}>{label}</span>\n {shortcut && <span className={s.shortcut}>{shortcut}</span>}\n </button>\n </Focusable>\n <Tooltip>{resolvedTitle}</Tooltip>\n </TooltipTrigger>\n );\n}\n"],"mappings":";;;;;;;;;;;;ACgDA,SAAgB,EAAW,GAAwB;CACjD,IAAM,EACJ,SAAM,UAAO,aAAU,WAAQ,aAAU,iBAAc,aACvD,YAAS,cAAW,UAAO,iBACzB,GACE,IAAgB,MAAU,IAAW,GAAG,EAAM,IAAI,EAAS,KAAK,IAChE,IAAM;EAAC,EAAE;EAAQ,KAAU,EAAE;EAAQ;EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;AAC/E,QACE,kBAAC,GAAD;EAAgB,YAAY;YAA5B,CACE,kBAAC,GAAD;GAAW,YAAY;aACrB,kBAAC,UAAD;IACE,MAAK;IACL,UAAU,IAAW,IAAI;IACzB,WAAW;IACX,gBAAc,IAAS,SAAS,KAAA;IAChC,iBAAe,IAAe,SAAS,KAAA;IAC7B;IACD;IACE;cARb;KAUE,kBAAC,QAAD;MAAM,WAAW,EAAE;MAAM,eAAY;gBAAQ;MAAY,CAAA;KACzD,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAQ;MAAa,CAAA;KACvC,KAAY,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAW;MAAgB,CAAA;KACpD;;GACC,CAAA,EACZ,kBAAC,GAAD,EAAA,UAAU,GAAwB,CAAA,CACnB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToolGroup-4bUBV5k6.js","names":[],"sources":["../../src/components/ToolGroup/ToolGroup.module.css","../../src/components/ToolGroup/ToolGroup.tsx"],"sourcesContent":[".group {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-1);\n}\n.group.horizontal {\n flex-direction: row;\n}\n","import type { ReactNode } from 'react';\nimport s from './ToolGroup.module.css';\n\n/** Props for {@link ToolGroup}. */\nexport interface ToolGroupProps {\n children: ReactNode;\n /**\n * Lays children along an axis. `'vertical'` (default) stacks them in\n * a column; `'horizontal'` lays them in a row. Independent of the\n * parent toolbar's own orientation.\n */\n orientation?: 'vertical' | 'horizontal';\n /**\n * Optional `data-group` attribute — useful for parents that want to\n * select the group from CSS or tests by name.\n */\n groupKey?: string;\n /** Accessible name for the group (rendered as `aria-label`). */\n ariaLabel?: string;\n className?: string;\n}\n\n/**\n * Generic toolbar group — a `role=\"group\"` flex container that arranges\n * `<ToolButton>`s (or any children) along a chosen axis. No visual chrome\n * beyond layout; theming lives on the buttons.\n */\nexport function ToolGroup(props: ToolGroupProps) {\n const { children, orientation = 'vertical', groupKey, ariaLabel, className } = props;\n const cls = [s.group, orientation === 'horizontal' && s.horizontal, className]\n .filter(Boolean).join(' ');\n return (\n <div className={cls} role=\"group\" data-group={groupKey} aria-label={ariaLabel}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;AC2BA,SAAgB,EAAU,GAAuB;CAC/C,IAAM,EAAE,aAAU,iBAAc,YAAY,aAAU,cAAW,iBAAc;AAG/E,QACE,kBAAC,OAAD;EAAK,WAHK;GAAC,EAAE;GAAO,MAAgB,gBAAgB,EAAE;GAAY;GAAU,CAC3E,OAAO,QAAQ,CAAC,KAAK,IAEN;EAAK,MAAK;EAAQ,cAAY;EAAU,cAAY;EACjE;EACG,CAAA"}