@weasel-js/ui 1.5.2 → 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 (565) hide show
  1. package/dist/chunks/ActionBar-DCq16yFA.js +57 -0
  2. package/dist/chunks/ActionBar-DCq16yFA.js.map +1 -0
  3. package/dist/chunks/{Badge-CW9pBPFl.js → Badge-CyAIZSDo.js} +758 -741
  4. package/dist/chunks/Badge-CyAIZSDo.js.map +1 -0
  5. package/dist/chunks/{BandEditor-jY-PFKY6.js → BandEditor-Dhm_Xrlr.js} +37 -36
  6. package/dist/chunks/BandEditor-Dhm_Xrlr.js.map +1 -0
  7. package/dist/chunks/Button-BIdXHQOx.js +111 -0
  8. package/dist/chunks/Button-BIdXHQOx.js.map +1 -0
  9. package/dist/chunks/ButtonBar-D5Vi0aj_.js +46 -0
  10. package/dist/chunks/ButtonBar-D5Vi0aj_.js.map +1 -0
  11. package/dist/chunks/Callout-yEn9iPlh.js +119 -0
  12. package/dist/chunks/Callout-yEn9iPlh.js.map +1 -0
  13. package/dist/chunks/{Checkbox-BOsDAY2F.js → Checkbox-DHXTUHO9.js} +1 -1
  14. package/dist/chunks/Checkbox-DHXTUHO9.js.map +1 -0
  15. package/dist/chunks/Code-AsKpgnv6.js +24 -0
  16. package/dist/chunks/Code-AsKpgnv6.js.map +1 -0
  17. package/dist/chunks/{ColorField-BYzgZM9o.js → ColorField-BcMcW8Sa.js} +16 -16
  18. package/dist/chunks/ColorField-BcMcW8Sa.js.map +1 -0
  19. package/dist/chunks/ColorModeControl-ke5PXbBa.js +47 -0
  20. package/dist/chunks/ColorModeControl-ke5PXbBa.js.map +1 -0
  21. package/dist/chunks/{ComboBox-Cz3f0Y_8.js → ComboBox-DpT8lc3p.js} +3 -3
  22. package/dist/chunks/ComboBox-DpT8lc3p.js.map +1 -0
  23. package/dist/chunks/{CurveEditor-DXwSP-iA.js → CurveEditor-BDJXjEvK.js} +35 -35
  24. package/dist/chunks/CurveEditor-BDJXjEvK.js.map +1 -0
  25. package/dist/chunks/DataGrid-D-dZj1BD.js +152 -0
  26. package/dist/chunks/DataGrid-D-dZj1BD.js.map +1 -0
  27. package/dist/chunks/DetailList-BMER1LUZ.js +43 -0
  28. package/dist/chunks/DetailList-BMER1LUZ.js.map +1 -0
  29. package/dist/chunks/{DetentSlider-CAubVX0J.js → DetentSlider-CL8TlX3S.js} +2 -2
  30. package/dist/chunks/DetentSlider-CL8TlX3S.js.map +1 -0
  31. package/dist/chunks/Dialog-BWyNMgpf.js +66 -0
  32. package/dist/chunks/Dialog-BWyNMgpf.js.map +1 -0
  33. package/dist/chunks/Disclosure-0G0uh2fa.js +58 -0
  34. package/dist/chunks/Disclosure-0G0uh2fa.js.map +1 -0
  35. package/dist/chunks/DragGhost-B5_hb9W9.js +30 -0
  36. package/dist/chunks/DragGhost-B5_hb9W9.js.map +1 -0
  37. package/dist/chunks/{DragHandleGlyph-CppAz4_8.js → DragHandleGlyph-Dr7Fgo0I.js} +1 -1
  38. package/dist/chunks/DragHandleGlyph-Dr7Fgo0I.js.map +1 -0
  39. package/dist/chunks/{Field-DWnV8WZY.js → Field--onYxXTF.js} +7 -6
  40. package/dist/chunks/Field--onYxXTF.js.map +1 -0
  41. package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js +111 -0
  42. package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js.map +1 -0
  43. package/dist/chunks/{FontFamilySelect-DxfgTC3G.js → FontFamilySelect-DXlMKWfK.js} +2 -2
  44. package/dist/chunks/FontFamilySelect-DXlMKWfK.js.map +1 -0
  45. package/dist/chunks/GradientEditor-B3a-MsVJ.js +335 -0
  46. package/dist/chunks/GradientEditor-B3a-MsVJ.js.map +1 -0
  47. package/dist/chunks/{Icon-DT0x6HaQ.js → Icon-Cgzy8VgC.js} +28 -20
  48. package/dist/chunks/Icon-Cgzy8VgC.js.map +1 -0
  49. package/dist/chunks/InlineRange-eOj6JpJl.js +29 -0
  50. package/dist/chunks/InlineRange-eOj6JpJl.js.map +1 -0
  51. package/dist/chunks/{Input-DbMKpkXy.js → Input-CHmkfYaD.js} +24 -19
  52. package/dist/chunks/Input-CHmkfYaD.js.map +1 -0
  53. package/dist/chunks/ItemList-Cm-HUWCi.js +174 -0
  54. package/dist/chunks/ItemList-Cm-HUWCi.js.map +1 -0
  55. package/dist/chunks/ItemList.module-BSpCSxan.js +14 -0
  56. package/dist/chunks/ItemList.module-BSpCSxan.js.map +1 -0
  57. package/dist/chunks/{Jog-DkkTlL3_.js → Jog-DESxZ44P.js} +6 -6
  58. package/dist/chunks/Jog-DESxZ44P.js.map +1 -0
  59. package/dist/chunks/{Keycaps-DunVpejA.js → Keycaps-C0H_v2gO.js} +71 -65
  60. package/dist/chunks/Keycaps-C0H_v2gO.js.map +1 -0
  61. package/dist/chunks/LayerList-nz-QYvTF.js +427 -0
  62. package/dist/chunks/LayerList-nz-QYvTF.js.map +1 -0
  63. package/dist/chunks/ListEditor-BQ6AV3Ac.js +74 -0
  64. package/dist/chunks/ListEditor-BQ6AV3Ac.js.map +1 -0
  65. package/dist/chunks/MenuButton-DtaGenKf.js +70 -0
  66. package/dist/chunks/MenuButton-DtaGenKf.js.map +1 -0
  67. package/dist/chunks/MeshEditor-qqGc6hlD.js +87 -0
  68. package/dist/chunks/MeshEditor-qqGc6hlD.js.map +1 -0
  69. package/dist/chunks/{NumberField-CCjEDZCg.js → NumberField-CwJOMmQR.js} +27 -22
  70. package/dist/chunks/NumberField-CwJOMmQR.js.map +1 -0
  71. package/dist/chunks/{OptionsBar-DeQ-vUeZ.js → OptionsBar-DbzAgIln.js} +3 -3
  72. package/dist/chunks/OptionsBar-DbzAgIln.js.map +1 -0
  73. package/dist/chunks/{PaintField-jBOJ32rL.js → PaintField-DaJukRc6.js} +21 -21
  74. package/dist/chunks/PaintField-DaJukRc6.js.map +1 -0
  75. package/dist/chunks/{PaintInput-Qs7Rul5R.js → PaintInput-Byhna3H-.js} +24 -24
  76. package/dist/chunks/PaintInput-Byhna3H-.js.map +1 -0
  77. package/dist/chunks/{PatternPicker-BMpXWboq.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-CXf_f7QD.js → Plot2D-CTXHkL5p.js} +13 -13
  80. package/dist/chunks/Plot2D-CTXHkL5p.js.map +1 -0
  81. package/dist/chunks/{PointPlotter-S_gz7VYt.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-DpqFKiwY.js +476 -0
  86. package/dist/chunks/Prefs-DpqFKiwY.js.map +1 -0
  87. package/dist/chunks/Properties-D_KzDN9K.js +282 -0
  88. package/dist/chunks/Properties-D_KzDN9K.js.map +1 -0
  89. package/dist/chunks/PropertyField-DGCecAnV.js +758 -0
  90. package/dist/chunks/PropertyField-DGCecAnV.js.map +1 -0
  91. package/dist/chunks/{RadioGroup-CsVp3SEu.js → RadioGroup-Bh4-12e-.js} +2 -2
  92. package/dist/chunks/RadioGroup-Bh4-12e-.js.map +1 -0
  93. package/dist/chunks/{RangeSlider-DNr-pJpZ.js → RangeSlider-BKRRTPTZ.js} +1 -1
  94. package/dist/chunks/RangeSlider-BKRRTPTZ.js.map +1 -0
  95. package/dist/chunks/{ResizeHandle-RXFf5fXr.js → ResizeHandle-BKT0XYpx.js} +15 -15
  96. package/dist/chunks/ResizeHandle-BKT0XYpx.js.map +1 -0
  97. package/dist/chunks/Select-CzyfaXzp.js +225 -0
  98. package/dist/chunks/Select-CzyfaXzp.js.map +1 -0
  99. package/dist/chunks/{SelectionPanel-CEbLS-0D.js → SelectionPanel-BgUM1h03.js} +21 -20
  100. package/dist/chunks/SelectionPanel-BgUM1h03.js.map +1 -0
  101. package/dist/chunks/{Sidebar-qn_oSCNX.js → Sidebar-BZ0m4afn.js} +8 -8
  102. package/dist/chunks/Sidebar-BZ0m4afn.js.map +1 -0
  103. package/dist/chunks/{SidebarPanel-Bs6V21hg.js → SidebarPanel-aoIqxbtq.js} +15 -19
  104. package/dist/chunks/SidebarPanel-aoIqxbtq.js.map +1 -0
  105. package/dist/chunks/{Slider-CIIrqiFS.js → Slider-CFwQYQ10.js} +94 -92
  106. package/dist/chunks/Slider-CFwQYQ10.js.map +1 -0
  107. package/dist/chunks/{StatusBar-B4L15DSm.js → StatusBar-DzoPDY4k.js} +8 -8
  108. package/dist/chunks/StatusBar-DzoPDY4k.js.map +1 -0
  109. package/dist/chunks/SwatchGrid-BARC3rnF.js +73 -0
  110. package/dist/chunks/SwatchGrid-BARC3rnF.js.map +1 -0
  111. package/dist/chunks/{Switch-DH5POG0T.js → Switch-CSYmcM8y.js} +1 -1
  112. package/dist/chunks/Switch-CSYmcM8y.js.map +1 -0
  113. package/dist/chunks/{Tabs-BFHikpml.js → Tabs-BbpzLLdY.js} +1 -1
  114. package/dist/chunks/Tabs-BbpzLLdY.js.map +1 -0
  115. package/dist/chunks/{Timeline-DNKY_yiK.js → Timeline--58F7MED.js} +141 -145
  116. package/dist/chunks/Timeline--58F7MED.js.map +1 -0
  117. package/dist/chunks/{Toast-CI1UDuK6.js → Toast-DNBb-24H.js} +1 -1
  118. package/dist/chunks/Toast-DNBb-24H.js.map +1 -0
  119. package/dist/chunks/ToggleBar-DTjGeS0Q.js +82 -0
  120. package/dist/chunks/ToggleBar-DTjGeS0Q.js.map +1 -0
  121. package/dist/chunks/{TokenPanel-BPHq24dc.js → TokenPanel-CMq7uydV.js} +50 -47
  122. package/dist/chunks/TokenPanel-CMq7uydV.js.map +1 -0
  123. package/dist/chunks/{ToolButton-9QzJCmuM.js → ToolButton-CR4sQlxF.js} +4 -4
  124. package/dist/chunks/ToolButton-CR4sQlxF.js.map +1 -0
  125. package/dist/chunks/{ToolGroup-BJiDrH_i.js → ToolGroup-Dpg1LN0l.js} +7 -7
  126. package/dist/chunks/ToolGroup-Dpg1LN0l.js.map +1 -0
  127. package/dist/chunks/{ToolOptionsBar-CAM6RcUH.js → ToolOptionsBar-CtzTlaN2.js} +6 -5
  128. package/dist/chunks/ToolOptionsBar-CtzTlaN2.js.map +1 -0
  129. package/dist/chunks/ToolPalette-CKG9qY6P.js +83 -0
  130. package/dist/chunks/ToolPalette-CKG9qY6P.js.map +1 -0
  131. package/dist/chunks/Tooltip-Clg2mhSt.js +42 -0
  132. package/dist/chunks/Tooltip-Clg2mhSt.js.map +1 -0
  133. package/dist/chunks/Tree-DVOtc9R5.js +203 -0
  134. package/dist/chunks/Tree-DVOtc9R5.js.map +1 -0
  135. package/dist/chunks/{createKeyframeLayer-DKtO0Sw_.js → createKeyframeLayer-Czj6Y235.js} +86 -86
  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-DRQrVThu.js +15 -0
  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-BNZmTow2.js +24 -0
  144. package/dist/chunks/interactiveTarget-BNZmTow2.js.map +1 -0
  145. package/dist/chunks/{keyGlyph-Bp0wnLHn.js → keyGlyph-C0qTakG-.js} +1 -1
  146. package/dist/chunks/keyGlyph-C0qTakG-.js.map +1 -0
  147. package/dist/chunks/model-Du7Lta4C.js +360 -0
  148. package/dist/chunks/model-Du7Lta4C.js.map +1 -0
  149. package/dist/chunks/{number-BHz66zQO.js → number-D3NEx_8r.js} +3 -3
  150. package/dist/chunks/number-D3NEx_8r.js.map +1 -0
  151. package/dist/chunks/paintPreview-CuSZiHpR.js +42 -0
  152. package/dist/chunks/paintPreview-CuSZiHpR.js.map +1 -0
  153. package/dist/chunks/paintValue-BpaGPjV3.js +18 -0
  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-Dnl7nmjQ.js +197 -0
  158. package/dist/chunks/prefField-Dnl7nmjQ.js.map +1 -0
  159. package/dist/chunks/segmentTooltip-CStYHKzd.js +29 -0
  160. package/dist/chunks/segmentTooltip-CStYHKzd.js.map +1 -0
  161. package/dist/chunks/segmentedControl.module-Bv7DEg8f.js +11 -0
  162. package/dist/chunks/segmentedControl.module-Bv7DEg8f.js.map +1 -0
  163. package/dist/chunks/{snap-CEjuWOhN.js → snap-DRjbOiG9.js} +1 -1
  164. package/dist/chunks/snap-DRjbOiG9.js.map +1 -0
  165. package/dist/chunks/stance-BFQpS_fL.js +17 -0
  166. package/dist/chunks/stance-BFQpS_fL.js.map +1 -0
  167. package/dist/chunks/useReorderDragList-B_-5L5Gu.js +131 -0
  168. package/dist/chunks/useReorderDragList-B_-5L5Gu.js.map +1 -0
  169. package/dist/chunks/{useRovingTabIndex-Dkpf_KhN.js → useRovingTabIndex-Bp_hYm_h.js} +1 -1
  170. package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js.map +1 -0
  171. package/dist/color/ramp.d.ts +38 -0
  172. package/dist/color/ramp.d.ts.map +1 -0
  173. package/dist/components/ActionBar/ActionBar.d.ts +7 -5
  174. package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
  175. package/dist/components/ActionBar/index.js +1 -1
  176. package/dist/components/Badge/Badge.d.ts +21 -7
  177. package/dist/components/Badge/Badge.d.ts.map +1 -1
  178. package/dist/components/Badge/effects/Aqua.d.ts +1 -1
  179. package/dist/components/Badge/effects/Aqua.d.ts.map +1 -1
  180. package/dist/components/Badge/index.d.ts +1 -1
  181. package/dist/components/Badge/index.d.ts.map +1 -1
  182. package/dist/components/Badge/index.js +1 -1
  183. package/dist/components/Badge/types.d.ts +6 -5
  184. package/dist/components/Badge/types.d.ts.map +1 -1
  185. package/dist/components/BandEditor/index.js +1 -1
  186. package/dist/components/Button/Button.d.ts +17 -3
  187. package/dist/components/Button/Button.d.ts.map +1 -1
  188. package/dist/components/Button/index.d.ts +1 -1
  189. package/dist/components/Button/index.d.ts.map +1 -1
  190. package/dist/components/Button/index.js +1 -1
  191. package/dist/components/ButtonBar/ButtonBar.d.ts +36 -0
  192. package/dist/components/ButtonBar/ButtonBar.d.ts.map +1 -0
  193. package/dist/components/ButtonBar/index.d.ts +3 -0
  194. package/dist/components/ButtonBar/index.d.ts.map +1 -0
  195. package/dist/components/ButtonBar/index.js +2 -0
  196. package/dist/components/Callout/Callout.d.ts +3 -6
  197. package/dist/components/Callout/Callout.d.ts.map +1 -1
  198. package/dist/components/Callout/index.d.ts +1 -1
  199. package/dist/components/Callout/index.d.ts.map +1 -1
  200. package/dist/components/Callout/index.js +1 -1
  201. package/dist/components/Checkbox/index.js +1 -1
  202. package/dist/components/Code/Code.d.ts +28 -0
  203. package/dist/components/Code/Code.d.ts.map +1 -0
  204. package/dist/components/Code/index.d.ts +3 -0
  205. package/dist/components/Code/index.d.ts.map +1 -0
  206. package/dist/components/Code/index.js +2 -0
  207. package/dist/components/ColorField/ColorField.d.ts +1 -1
  208. package/dist/components/ColorField/ColorField.d.ts.map +1 -1
  209. package/dist/components/ColorField/index.js +1 -1
  210. package/dist/components/ColorModeControl/ColorModeControl.d.ts +21 -0
  211. package/dist/components/ColorModeControl/ColorModeControl.d.ts.map +1 -0
  212. package/dist/components/ColorModeControl/index.d.ts +3 -0
  213. package/dist/components/ColorModeControl/index.d.ts.map +1 -0
  214. package/dist/components/ColorModeControl/index.js +2 -0
  215. package/dist/components/ComboBox/ComboBox.d.ts +2 -2
  216. package/dist/components/ComboBox/ComboBox.d.ts.map +1 -1
  217. package/dist/components/ComboBox/index.js +1 -1
  218. package/dist/components/CurveEditor/CurveEditor.d.ts +1 -1
  219. package/dist/components/CurveEditor/CurveEditor.d.ts.map +1 -1
  220. package/dist/components/CurveEditor/LayeredCurveEditor.d.ts +1 -1
  221. package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -1
  222. package/dist/components/CurveEditor/index.js +3 -3
  223. package/dist/components/DataGrid/DataGrid.d.ts +23 -1
  224. package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
  225. package/dist/components/DataGrid/index.js +1 -1
  226. package/dist/components/DetailList/DetailList.d.ts +36 -0
  227. package/dist/components/DetailList/DetailList.d.ts.map +1 -0
  228. package/dist/components/DetailList/index.d.ts +3 -0
  229. package/dist/components/DetailList/index.d.ts.map +1 -0
  230. package/dist/components/DetailList/index.js +2 -0
  231. package/dist/components/DetentSlider/index.js +1 -1
  232. package/dist/components/Dialog/Dialog.d.ts +9 -3
  233. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  234. package/dist/components/Dialog/index.js +1 -1
  235. package/dist/components/Disclosure/Disclosure.d.ts +26 -18
  236. package/dist/components/Disclosure/Disclosure.d.ts.map +1 -1
  237. package/dist/components/Disclosure/index.d.ts +2 -2
  238. package/dist/components/Disclosure/index.d.ts.map +1 -1
  239. package/dist/components/Disclosure/index.js +2 -2
  240. package/dist/components/DragGhost/DragGhost.d.ts +21 -0
  241. package/dist/components/DragGhost/DragGhost.d.ts.map +1 -0
  242. package/dist/components/DragGhost/index.d.ts +3 -0
  243. package/dist/components/DragGhost/index.d.ts.map +1 -0
  244. package/dist/components/DragGhost/index.js +2 -0
  245. package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts +1 -1
  246. package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts.map +1 -1
  247. package/dist/components/DragHandleGlyph/index.js +1 -1
  248. package/dist/components/Field/Field.d.ts +1 -1
  249. package/dist/components/Field/Field.d.ts.map +1 -1
  250. package/dist/components/Field/index.js +1 -1
  251. package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts +45 -0
  252. package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -0
  253. package/dist/components/FillStrokeSwatch/index.d.ts +3 -0
  254. package/dist/components/FillStrokeSwatch/index.d.ts.map +1 -0
  255. package/dist/components/FillStrokeSwatch/index.js +2 -0
  256. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts +1 -1
  257. package/dist/components/FontFamilySelect/FontFamilySelect.d.ts.map +1 -1
  258. package/dist/components/FontFamilySelect/index.js +1 -1
  259. package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -1
  260. package/dist/components/GradientEditor/index.js +1 -1
  261. package/dist/components/InlineRange/InlineRange.d.ts +6 -2
  262. package/dist/components/InlineRange/InlineRange.d.ts.map +1 -1
  263. package/dist/components/InlineRange/index.js +1 -1
  264. package/dist/components/Input/Input.d.ts +13 -0
  265. package/dist/components/Input/Input.d.ts.map +1 -1
  266. package/dist/components/Input/index.js +1 -1
  267. package/dist/components/ItemList/ItemList.d.ts +70 -10
  268. package/dist/components/ItemList/ItemList.d.ts.map +1 -1
  269. package/dist/components/ItemList/index.js +1 -1
  270. package/dist/components/Jog/Jog.d.ts +1 -1
  271. package/dist/components/Jog/Jog.d.ts.map +1 -1
  272. package/dist/components/Jog/index.js +1 -1
  273. package/dist/components/Keycaps/Keycap.d.ts +1 -1
  274. package/dist/components/Keycaps/Keycap.d.ts.map +1 -1
  275. package/dist/components/Keycaps/Keycaps.d.ts +1 -1
  276. package/dist/components/Keycaps/Keycaps.d.ts.map +1 -1
  277. package/dist/components/Keycaps/index.d.ts +1 -0
  278. package/dist/components/Keycaps/index.d.ts.map +1 -1
  279. package/dist/components/Keycaps/index.js +3 -3
  280. package/dist/components/Keycaps/keySpecsFromMods.d.ts +2 -0
  281. package/dist/components/Keycaps/keySpecsFromMods.d.ts.map +1 -1
  282. package/dist/components/Keycaps/keySpecsFromShortcut.d.ts +16 -0
  283. package/dist/components/Keycaps/keySpecsFromShortcut.d.ts.map +1 -0
  284. package/dist/components/LayerList/LayerList.d.ts +79 -0
  285. package/dist/components/LayerList/LayerList.d.ts.map +1 -0
  286. package/dist/components/LayerList/index.d.ts +3 -0
  287. package/dist/components/LayerList/index.d.ts.map +1 -0
  288. package/dist/components/LayerList/index.js +2 -0
  289. package/dist/components/LayerList/useSceneLayerList.d.ts +20 -0
  290. package/dist/components/LayerList/useSceneLayerList.d.ts.map +1 -0
  291. package/dist/components/ListEditor/ListEditor.d.ts +23 -0
  292. package/dist/components/ListEditor/ListEditor.d.ts.map +1 -0
  293. package/dist/components/ListEditor/index.d.ts +3 -0
  294. package/dist/components/ListEditor/index.d.ts.map +1 -0
  295. package/dist/components/ListEditor/index.js +2 -0
  296. package/dist/components/MenuButton/MenuButton.d.ts +6 -2
  297. package/dist/components/MenuButton/MenuButton.d.ts.map +1 -1
  298. package/dist/components/MenuButton/index.js +1 -1
  299. package/dist/components/MeshEditor/index.js +1 -1
  300. package/dist/components/NumberField/NumberField.d.ts +13 -0
  301. package/dist/components/NumberField/NumberField.d.ts.map +1 -1
  302. package/dist/components/NumberField/UnitField.d.ts +1 -1
  303. package/dist/components/NumberField/UnitField.d.ts.map +1 -1
  304. package/dist/components/NumberField/index.js +1 -1
  305. package/dist/components/OptionsBar/index.js +1 -1
  306. package/dist/components/PaintField/index.js +1 -1
  307. package/dist/components/PaintInput/index.js +1 -1
  308. package/dist/components/PatternPicker/index.js +1 -1
  309. package/dist/components/Plot2D/index.js +1 -1
  310. package/dist/components/PointPlotter/PointPlotter.d.ts +1 -1
  311. package/dist/components/PointPlotter/PointPlotter.d.ts.map +1 -1
  312. package/dist/components/PointPlotter/index.js +1 -1
  313. package/dist/components/Powerline/Powerline.d.ts +5 -4
  314. package/dist/components/Powerline/Powerline.d.ts.map +1 -1
  315. package/dist/components/Powerline/index.js +2 -2
  316. package/dist/components/Prefs/PrefsDialog.d.ts +11 -3
  317. package/dist/components/Prefs/PrefsDialog.d.ts.map +1 -1
  318. package/dist/components/Prefs/PrefsForm.d.ts +27 -26
  319. package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
  320. package/dist/components/Prefs/PrefsPane.d.ts +24 -0
  321. package/dist/components/Prefs/PrefsPane.d.ts.map +1 -0
  322. package/dist/components/Prefs/PrefsRail.d.ts +32 -0
  323. package/dist/components/Prefs/PrefsRail.d.ts.map +1 -0
  324. package/dist/components/Prefs/PrefsRow.d.ts +32 -0
  325. package/dist/components/Prefs/PrefsRow.d.ts.map +1 -0
  326. package/dist/components/Prefs/index.d.ts +5 -2
  327. package/dist/components/Prefs/index.d.ts.map +1 -1
  328. package/dist/components/Prefs/index.js +3 -3
  329. package/dist/components/Prefs/prefField.d.ts +36 -0
  330. package/dist/components/Prefs/prefField.d.ts.map +1 -0
  331. package/dist/components/Prefs/schema.d.ts +30 -0
  332. package/dist/components/Prefs/schema.d.ts.map +1 -1
  333. package/dist/components/Properties/CurveField.d.ts +1 -1
  334. package/dist/components/Properties/CurveField.d.ts.map +1 -1
  335. package/dist/components/Properties/DialogRow.d.ts +33 -0
  336. package/dist/components/Properties/DialogRow.d.ts.map +1 -0
  337. package/dist/components/Properties/PropertyField.d.ts +238 -0
  338. package/dist/components/Properties/PropertyField.d.ts.map +1 -0
  339. package/dist/components/Properties/PropertyGroup.d.ts +12 -3
  340. package/dist/components/Properties/PropertyGroup.d.ts.map +1 -1
  341. package/dist/components/Properties/PropertyPanel.d.ts +34 -238
  342. package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
  343. package/dist/components/Properties/Subpanel.d.ts +14 -0
  344. package/dist/components/Properties/Subpanel.d.ts.map +1 -0
  345. package/dist/components/Properties/index.d.ts +8 -4
  346. package/dist/components/Properties/index.d.ts.map +1 -1
  347. package/dist/components/Properties/index.js +3 -2
  348. package/dist/components/Properties/storyLayouts.d.ts +1 -1
  349. package/dist/components/Properties/storyLayouts.d.ts.map +1 -1
  350. package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
  351. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  352. package/dist/components/RadioGroup/index.js +1 -1
  353. package/dist/components/RangeSlider/RangeSlider.d.ts +1 -1
  354. package/dist/components/RangeSlider/RangeSlider.d.ts.map +1 -1
  355. package/dist/components/RangeSlider/index.js +1 -1
  356. package/dist/components/ResizeHandle/ResizeHandle.d.ts +1 -1
  357. package/dist/components/ResizeHandle/ResizeHandle.d.ts.map +1 -1
  358. package/dist/components/ResizeHandle/index.js +1 -1
  359. package/dist/components/Select/Select.d.ts +40 -7
  360. package/dist/components/Select/Select.d.ts.map +1 -1
  361. package/dist/components/Select/index.d.ts +2 -2
  362. package/dist/components/Select/index.d.ts.map +1 -1
  363. package/dist/components/Select/index.js +2 -2
  364. package/dist/components/SelectionPanel/SelectionPanel.d.ts +1 -1
  365. package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
  366. package/dist/components/SelectionPanel/index.js +2 -2
  367. package/dist/components/SelectionPanel/renderLeaf.d.ts +14 -8
  368. package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -1
  369. package/dist/components/Sidebar/Sidebar.d.ts +1 -1
  370. package/dist/components/Sidebar/Sidebar.d.ts.map +1 -1
  371. package/dist/components/Sidebar/index.js +1 -1
  372. package/dist/components/SidebarPanel/SidebarPanel.d.ts +3 -3
  373. package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
  374. package/dist/components/SidebarPanel/index.js +1 -1
  375. package/dist/components/Slider/Slider.d.ts +2 -1
  376. package/dist/components/Slider/Slider.d.ts.map +1 -1
  377. package/dist/components/Slider/index.js +1 -1
  378. package/dist/components/StatusBar/StatusBar.d.ts +3 -3
  379. package/dist/components/StatusBar/StatusBar.d.ts.map +1 -1
  380. package/dist/components/StatusBar/index.js +1 -1
  381. package/dist/components/SwatchGrid/SwatchGrid.d.ts +34 -0
  382. package/dist/components/SwatchGrid/SwatchGrid.d.ts.map +1 -0
  383. package/dist/components/SwatchGrid/index.d.ts +3 -0
  384. package/dist/components/SwatchGrid/index.d.ts.map +1 -0
  385. package/dist/components/SwatchGrid/index.js +2 -0
  386. package/dist/components/Switch/index.js +1 -1
  387. package/dist/components/Tabs/Tabs.d.ts +4 -4
  388. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  389. package/dist/components/Tabs/index.js +1 -1
  390. package/dist/components/Timeline/Lane.d.ts.map +1 -1
  391. package/dist/components/Timeline/index.js +1 -1
  392. package/dist/components/Toast/Toast.d.ts +1 -1
  393. package/dist/components/Toast/Toast.d.ts.map +1 -1
  394. package/dist/components/Toast/index.js +1 -1
  395. package/dist/components/ToggleBar/ToggleBar.d.ts +2 -1
  396. package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
  397. package/dist/components/ToggleBar/index.js +1 -1
  398. package/dist/components/TokenPanel/TokenPanel.d.ts +1 -1
  399. package/dist/components/TokenPanel/TokenPanel.d.ts.map +1 -1
  400. package/dist/components/TokenPanel/index.js +1 -1
  401. package/dist/components/ToolButton/ToolButton.d.ts +1 -1
  402. package/dist/components/ToolButton/ToolButton.d.ts.map +1 -1
  403. package/dist/components/ToolButton/index.js +1 -1
  404. package/dist/components/ToolGroup/ToolGroup.d.ts +1 -1
  405. package/dist/components/ToolGroup/ToolGroup.d.ts.map +1 -1
  406. package/dist/components/ToolGroup/index.js +1 -1
  407. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts +1 -1
  408. package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts.map +1 -1
  409. package/dist/components/ToolOptionsBar/index.js +1 -1
  410. package/dist/components/ToolPalette/ToolPalette.d.ts +1 -1
  411. package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
  412. package/dist/components/ToolPalette/index.d.ts +1 -0
  413. package/dist/components/ToolPalette/index.d.ts.map +1 -1
  414. package/dist/components/ToolPalette/index.js +3 -2
  415. package/dist/components/Tooltip/Tooltip.d.ts +8 -4
  416. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  417. package/dist/components/Tooltip/index.d.ts +1 -1
  418. package/dist/components/Tooltip/index.d.ts.map +1 -1
  419. package/dist/components/Tooltip/index.js +2 -2
  420. package/dist/components/Tree/Tree.d.ts +84 -0
  421. package/dist/components/Tree/Tree.d.ts.map +1 -0
  422. package/dist/components/Tree/index.d.ts +3 -0
  423. package/dist/components/Tree/index.d.ts.map +1 -0
  424. package/dist/components/Tree/index.js +2 -0
  425. package/dist/components/segmentTooltip.d.ts +30 -0
  426. package/dist/components/segmentTooltip.d.ts.map +1 -0
  427. package/dist/components/stance.d.ts +30 -0
  428. package/dist/components/stance.d.ts.map +1 -0
  429. package/dist/components/stanceCss.d.ts +31 -0
  430. package/dist/components/stanceCss.d.ts.map +1 -0
  431. package/dist/components/stanceSurfaces.d.ts +4 -0
  432. package/dist/components/stanceSurfaces.d.ts.map +1 -0
  433. package/dist/format/number.d.ts +3 -2
  434. package/dist/format/number.d.ts.map +1 -1
  435. package/dist/icons/Icon.d.ts +1 -1
  436. package/dist/icons/Icon.d.ts.map +1 -1
  437. package/dist/icons/ShapeKindIcon.d.ts +10 -0
  438. package/dist/icons/ShapeKindIcon.d.ts.map +1 -0
  439. package/dist/icons/index.d.ts +55 -53
  440. package/dist/icons/index.d.ts.map +1 -1
  441. package/dist/icons/paths.d.ts +2 -0
  442. package/dist/icons/paths.d.ts.map +1 -1
  443. package/dist/index.d.ts +17 -3
  444. package/dist/index.d.ts.map +1 -1
  445. package/dist/index.js +130 -79
  446. package/dist/index.js.map +1 -1
  447. package/dist/interactiveTarget.d.ts +9 -0
  448. package/dist/interactiveTarget.d.ts.map +1 -0
  449. package/dist/overlays/portalHost.d.ts +1 -1
  450. package/dist/overlays/portalHost.d.ts.map +1 -1
  451. package/dist/style.css +1 -1
  452. package/dist/useReorderDragList.d.ts +36 -7
  453. package/dist/useReorderDragList.d.ts.map +1 -1
  454. package/dist/useRovingTabIndex.d.ts +1 -1
  455. package/dist/useScrollSpy.d.ts +48 -0
  456. package/dist/useScrollSpy.d.ts.map +1 -0
  457. package/package.json +8 -8
  458. package/dist/chunks/ActionBar-CLwiY3Jg.js +0 -62
  459. package/dist/chunks/ActionBar-CLwiY3Jg.js.map +0 -1
  460. package/dist/chunks/ActionsBar-D84a4eGy.js +0 -41
  461. package/dist/chunks/ActionsBar-D84a4eGy.js.map +0 -1
  462. package/dist/chunks/Badge-CW9pBPFl.js.map +0 -1
  463. package/dist/chunks/BandEditor-jY-PFKY6.js.map +0 -1
  464. package/dist/chunks/Button-DRSApvnK.js +0 -90
  465. package/dist/chunks/Button-DRSApvnK.js.map +0 -1
  466. package/dist/chunks/Callout-DrNu-9Qr.js +0 -122
  467. package/dist/chunks/Callout-DrNu-9Qr.js.map +0 -1
  468. package/dist/chunks/Checkbox-BOsDAY2F.js.map +0 -1
  469. package/dist/chunks/ColorField-BYzgZM9o.js.map +0 -1
  470. package/dist/chunks/ComboBox-Cz3f0Y_8.js.map +0 -1
  471. package/dist/chunks/CurveEditor-DXwSP-iA.js.map +0 -1
  472. package/dist/chunks/DataGrid-C8KrYtw7.js +0 -104
  473. package/dist/chunks/DataGrid-C8KrYtw7.js.map +0 -1
  474. package/dist/chunks/DetentSlider-CAubVX0J.js.map +0 -1
  475. package/dist/chunks/Dialog-fGqqQ6o_.js +0 -61
  476. package/dist/chunks/Dialog-fGqqQ6o_.js.map +0 -1
  477. package/dist/chunks/Disclosure-CILDfWsU.js +0 -47
  478. package/dist/chunks/Disclosure-CILDfWsU.js.map +0 -1
  479. package/dist/chunks/DragHandleGlyph-CppAz4_8.js.map +0 -1
  480. package/dist/chunks/Field-DWnV8WZY.js.map +0 -1
  481. package/dist/chunks/FontFamilySelect-DxfgTC3G.js.map +0 -1
  482. package/dist/chunks/GradientEditor-rRBmf3G0.js +0 -333
  483. package/dist/chunks/GradientEditor-rRBmf3G0.js.map +0 -1
  484. package/dist/chunks/Icon-DT0x6HaQ.js.map +0 -1
  485. package/dist/chunks/InlineRange-DdIlfGqG.js +0 -29
  486. package/dist/chunks/InlineRange-DdIlfGqG.js.map +0 -1
  487. package/dist/chunks/Input-DbMKpkXy.js.map +0 -1
  488. package/dist/chunks/ItemList-B9zYb0GE.js +0 -42
  489. package/dist/chunks/ItemList-B9zYb0GE.js.map +0 -1
  490. package/dist/chunks/Jog-DkkTlL3_.js.map +0 -1
  491. package/dist/chunks/Keycaps-DunVpejA.js.map +0 -1
  492. package/dist/chunks/LayerStack-CfQ6GsRz.js +0 -142
  493. package/dist/chunks/LayerStack-CfQ6GsRz.js.map +0 -1
  494. package/dist/chunks/MenuButton-C_4nox39.js +0 -60
  495. package/dist/chunks/MenuButton-C_4nox39.js.map +0 -1
  496. package/dist/chunks/MeshEditor-Bipz-Ocl.js +0 -123
  497. package/dist/chunks/MeshEditor-Bipz-Ocl.js.map +0 -1
  498. package/dist/chunks/NumberField-CCjEDZCg.js.map +0 -1
  499. package/dist/chunks/OptionsBar-DeQ-vUeZ.js.map +0 -1
  500. package/dist/chunks/PaintField-jBOJ32rL.js.map +0 -1
  501. package/dist/chunks/PaintInput-Qs7Rul5R.js.map +0 -1
  502. package/dist/chunks/PatternPicker-BMpXWboq.js.map +0 -1
  503. package/dist/chunks/Plot2D-CXf_f7QD.js.map +0 -1
  504. package/dist/chunks/PointPlotter-S_gz7VYt.js.map +0 -1
  505. package/dist/chunks/Powerline-Ak5AWUlK.js +0 -36
  506. package/dist/chunks/Powerline-Ak5AWUlK.js.map +0 -1
  507. package/dist/chunks/Prefs-CNC8tzyN.js +0 -308
  508. package/dist/chunks/Prefs-CNC8tzyN.js.map +0 -1
  509. package/dist/chunks/Properties-Rnb6TAbN.js +0 -891
  510. package/dist/chunks/Properties-Rnb6TAbN.js.map +0 -1
  511. package/dist/chunks/RadioGroup-CsVp3SEu.js.map +0 -1
  512. package/dist/chunks/RangeSlider-DNr-pJpZ.js.map +0 -1
  513. package/dist/chunks/ResizeHandle-RXFf5fXr.js.map +0 -1
  514. package/dist/chunks/Select-BEope086.js +0 -190
  515. package/dist/chunks/Select-BEope086.js.map +0 -1
  516. package/dist/chunks/SelectionPanel-CEbLS-0D.js.map +0 -1
  517. package/dist/chunks/Sidebar-qn_oSCNX.js.map +0 -1
  518. package/dist/chunks/SidebarPanel-Bs6V21hg.js.map +0 -1
  519. package/dist/chunks/Slider-CIIrqiFS.js.map +0 -1
  520. package/dist/chunks/StatusBar-B4L15DSm.js.map +0 -1
  521. package/dist/chunks/Switch-DH5POG0T.js.map +0 -1
  522. package/dist/chunks/Tabs-BFHikpml.js.map +0 -1
  523. package/dist/chunks/Timeline-DNKY_yiK.js.map +0 -1
  524. package/dist/chunks/Toast-CI1UDuK6.js.map +0 -1
  525. package/dist/chunks/ToggleBar-CClus5Cd.js +0 -75
  526. package/dist/chunks/ToggleBar-CClus5Cd.js.map +0 -1
  527. package/dist/chunks/TokenPanel-BPHq24dc.js.map +0 -1
  528. package/dist/chunks/ToolButton-9QzJCmuM.js.map +0 -1
  529. package/dist/chunks/ToolGroup-BJiDrH_i.js.map +0 -1
  530. package/dist/chunks/ToolOptionsBar-CAM6RcUH.js.map +0 -1
  531. package/dist/chunks/ToolPalette-DGkKwE7D.js +0 -97
  532. package/dist/chunks/ToolPalette-DGkKwE7D.js.map +0 -1
  533. package/dist/chunks/Tooltip-C4YBczLq.js +0 -42
  534. package/dist/chunks/Tooltip-C4YBczLq.js.map +0 -1
  535. package/dist/chunks/createKeyframeLayer-DKtO0Sw_.js.map +0 -1
  536. package/dist/chunks/dlog-CMYiRF3Q.js.map +0 -1
  537. package/dist/chunks/icons-DFLytcui.js +0 -165
  538. package/dist/chunks/icons-DFLytcui.js.map +0 -1
  539. package/dist/chunks/keyGlyph-Bp0wnLHn.js.map +0 -1
  540. package/dist/chunks/model-13kZ_-mE.js +0 -483
  541. package/dist/chunks/model-13kZ_-mE.js.map +0 -1
  542. package/dist/chunks/number-BHz66zQO.js.map +0 -1
  543. package/dist/chunks/portalHost-CjpCnuGU.js.map +0 -1
  544. package/dist/chunks/range.module-DSsOIq1R.js +0 -8
  545. package/dist/chunks/range.module-DSsOIq1R.js.map +0 -1
  546. package/dist/chunks/schema-Dft4Cu2p.js +0 -47
  547. package/dist/chunks/schema-Dft4Cu2p.js.map +0 -1
  548. package/dist/chunks/segmentedControl.module-DS72X1ns.js +0 -11
  549. package/dist/chunks/segmentedControl.module-DS72X1ns.js.map +0 -1
  550. package/dist/chunks/snap-CEjuWOhN.js.map +0 -1
  551. package/dist/chunks/useReorderDragList-CSQGd7zQ.js +0 -102
  552. package/dist/chunks/useReorderDragList-CSQGd7zQ.js.map +0 -1
  553. package/dist/chunks/useRovingTabIndex-Dkpf_KhN.js.map +0 -1
  554. package/dist/components/ActionsBar/ActionsBar.d.ts +0 -35
  555. package/dist/components/ActionsBar/ActionsBar.d.ts.map +0 -1
  556. package/dist/components/ActionsBar/index.d.ts +0 -3
  557. package/dist/components/ActionsBar/index.d.ts.map +0 -1
  558. package/dist/components/ActionsBar/index.js +0 -2
  559. package/dist/components/LayerStack/LayerStack.d.ts +0 -62
  560. package/dist/components/LayerStack/LayerStack.d.ts.map +0 -1
  561. package/dist/components/LayerStack/index.d.ts +0 -2
  562. package/dist/components/LayerStack/index.d.ts.map +0 -1
  563. package/dist/components/LayerStack/index.js +0 -2
  564. package/dist/components/Properties/EffectCard.d.ts +0 -69
  565. package/dist/components/Properties/EffectCard.d.ts.map +0 -1
@@ -1,142 +0,0 @@
1
- import { t as e } from "./dlog-CMYiRF3Q.js";
2
- import { t } from "./useReorderDragList-CSQGd7zQ.js";
3
- import { t as n } from "./DragHandleGlyph-CppAz4_8.js";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import { useEffect as a, useState as o } from "react";
6
- var s = {
7
- stack: "_stack_us2jl_4",
8
- head: "_head_us2jl_14",
9
- title: "_title_us2jl_21",
10
- palette: "_palette_us2jl_29",
11
- add: "_add_us2jl_34",
12
- list: "_list_us2jl_51",
13
- dropHint: "_dropHint_us2jl_56",
14
- empty: "_empty_us2jl_62",
15
- card: "_card_us2jl_69",
16
- cardAccented: "_cardAccented_us2jl_76",
17
- cardDragging: "_cardDragging_us2jl_84",
18
- cardHead: "_cardHead_us2jl_88",
19
- handle: "_handle_us2jl_95",
20
- kind: "_kind_us2jl_121",
21
- primary: "_primary_us2jl_122",
22
- remove: "_remove_us2jl_136",
23
- cardBody: "_cardBody_us2jl_151"
24
- };
25
- //#endregion
26
- //#region src/components/LayerStack/LayerStack.tsx
27
- function c({ className: c, title: l, items: u, paletteKinds: d, onAdd: f, onRemove: p, onReorder: m, onPrimaryChange: h, renderBody: g, emptyLabel: _, hideHead: v }) {
28
- let [y, b] = o(() => new Set(u.filter((e) => e.defaultExpanded !== !1).map((e) => e.id)));
29
- a(() => {
30
- b((e) => {
31
- let t = null;
32
- for (let n of u) n.defaultExpanded !== !1 && (e.has(n.id) || (t === null && (t = new Set(e)), t.add(n.id)));
33
- return t ?? e;
34
- });
35
- }, [u]);
36
- let x = t({
37
- items: u.map((e) => ({
38
- id: String(e.id),
39
- label: e.label ?? e.kind ?? String(e.id)
40
- })),
41
- selectedIds: [],
42
- onReorder: (t, n) => {
43
- e("layer-stack", "onReorder", {
44
- ids: t,
45
- targetIndex: n
46
- });
47
- let r = u.map((e) => e.id), i = new Set(t), a = r.filter((e) => !i.has(String(e))), o = u.map((e) => e.id).filter((e) => i.has(String(e))), s = n - r.filter((e, t) => i.has(String(e)) && t < n).length, c = [...a];
48
- c.splice(s, 0, ...o), m(c);
49
- }
50
- }), S = (e) => {
51
- b((t) => {
52
- let n = new Set(t);
53
- return n.has(e) ? n.delete(e) : n.add(e), n;
54
- });
55
- }, C = f ? d ?? [] : [], w = !v && (l !== void 0 || C.length > 0);
56
- return /* @__PURE__ */ i("div", {
57
- className: c ? `${s.stack} ${c}` : s.stack,
58
- children: [w && /* @__PURE__ */ i("div", {
59
- className: s.head,
60
- children: [l !== void 0 && /* @__PURE__ */ r("h2", {
61
- className: s.title,
62
- children: l
63
- }), /* @__PURE__ */ r("div", {
64
- className: s.palette,
65
- children: C.map((t) => /* @__PURE__ */ r("button", {
66
- type: "button",
67
- className: s.add,
68
- onClick: () => {
69
- e("layer-stack", "onAdd", { kind: t }), f?.(t);
70
- },
71
- "aria-label": `Add ${t}`,
72
- children: t
73
- }, t))
74
- })]
75
- }), /* @__PURE__ */ i("div", {
76
- className: s.list,
77
- ref: x.containerProps.ref,
78
- children: [u.map((e, t) => {
79
- let a = y.has(e.id), o = x.state.draggedIds?.[0], c = o === String(e.id), l = x.state.targetIndex === t && o !== String(e.id), d = x.state.targetIndex === u.length && t === u.length - 1, f = [
80
- s.card,
81
- c ? s.cardDragging : "",
82
- e.accent ? s.cardAccented : ""
83
- ].filter(Boolean).join(" "), m = e.accent ? { "--wzl-layer-stack-accent": e.accent } : void 0, { onPointerDown: _ } = x.rowProps(String(e.id), t);
84
- return /* @__PURE__ */ i("div", { children: [
85
- l && /* @__PURE__ */ r("div", { className: s.dropHint }),
86
- /* @__PURE__ */ i("div", {
87
- className: f,
88
- "data-testid": `layer-card-${e.id}`,
89
- style: m,
90
- children: [/* @__PURE__ */ i("div", {
91
- className: s.cardHead,
92
- children: [
93
- /* @__PURE__ */ r("button", {
94
- type: "button",
95
- className: s.handle,
96
- "aria-label": `Drag to reorder layer ${e.id}`,
97
- onPointerDown: _,
98
- onClick: () => S(e.id),
99
- children: e.badge ?? /* @__PURE__ */ r(n, {})
100
- }),
101
- e.primaryValue !== void 0 && e.primaryOptions && h ? /* @__PURE__ */ r("select", {
102
- className: s.primary,
103
- value: e.primaryValue,
104
- "aria-label": `Primary select for layer ${e.id}`,
105
- onChange: (t) => h(e.id, t.target.value),
106
- onClick: (e) => e.stopPropagation(),
107
- children: e.primaryOptions.map((e) => /* @__PURE__ */ r("option", {
108
- value: e,
109
- children: e
110
- }, e))
111
- }) : /* @__PURE__ */ r("span", {
112
- className: s.kind,
113
- children: e.label ?? e.kind
114
- }),
115
- p && /* @__PURE__ */ r("button", {
116
- type: "button",
117
- className: s.remove,
118
- "aria-label": "Remove layer",
119
- onClick: (t) => {
120
- t.stopPropagation(), p(e.id);
121
- },
122
- children: "✕"
123
- })
124
- ]
125
- }), a && /* @__PURE__ */ r("div", {
126
- className: s.cardBody,
127
- children: g(e)
128
- })]
129
- }),
130
- d && /* @__PURE__ */ r("div", { className: s.dropHint })
131
- ] }, e.id);
132
- }), u.length === 0 && /* @__PURE__ */ r("div", {
133
- className: s.empty,
134
- children: _ ?? (C.length > 0 ? "No layers — add one above." : "No layers.")
135
- })]
136
- })]
137
- });
138
- }
139
- //#endregion
140
- export { c as t };
141
-
142
- //# sourceMappingURL=LayerStack-CfQ6GsRz.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LayerStack-CfQ6GsRz.js","names":[],"sources":["../../src/components/LayerStack/LayerStack.module.css","../../src/components/LayerStack/LayerStack.tsx"],"sourcesContent":["/* Authored against labkit's `.lk-root`, which supplied a border-box reset and a\n set of bare-button defaults. weasel-ui has neither, so the stack restates\n both over its own subtree rather than depending on an ancestor class. */\n.stack,\n.stack * {\n box-sizing: border-box;\n}\n\n.stack {\n display: grid;\n gap: var(--wzl-space-4);\n}\n\n.head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--wzl-space-4);\n}\n\n.title {\n margin: 0;\n font-family: var(--wzl-font-display);\n font-weight: var(--wzl-font-weight-light);\n font-size: var(--wzl-font-size-lg);\n color: var(--wzl-fg);\n}\n\n.palette {\n display: flex;\n gap: var(--wzl-space-2);\n}\n\n.add {\n font: inherit;\n height: var(--wzl-control-h);\n background: transparent;\n border: 1px dashed var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n padding: var(--wzl-space-1) var(--wzl-space-4);\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-subtle);\n cursor: pointer;\n}\n\n.add:hover {\n background: var(--wzl-surface-raised);\n color: var(--wzl-fg);\n}\n\n.list {\n display: grid;\n gap: var(--wzl-space-3);\n}\n\n.dropHint {\n height: 2px;\n background: var(--wzl-accent);\n border-radius: var(--wzl-radius-sm);\n}\n\n.empty {\n color: var(--wzl-fg-subtle);\n font-size: var(--wzl-font-size);\n padding: var(--wzl-space-4);\n text-align: center;\n}\n\n.card {\n background: var(--wzl-surface-raised);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-md);\n overflow: hidden;\n}\n\n.cardAccented {\n /* Re-bind --wzl-accent inside the card so descendant controls (slider tracks\n and thumbs, readouts, etc.) tint to the per-card accent instead of the\n global theme accent. Mirrors EffectCard's behavior. */\n --wzl-accent: var(--wzl-layer-stack-accent);\n border-left: 3px solid var(--wzl-layer-stack-accent);\n}\n\n.cardDragging {\n opacity: 0.5;\n}\n\n.cardHead {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-3);\n padding: var(--wzl-space-3) var(--wzl-space-4);\n}\n\n.handle {\n font: inherit;\n background: transparent;\n border: 0;\n color: var(--wzl-fg-subtle);\n padding: var(--wzl-space-1) var(--wzl-space-2);\n cursor: grab;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--wzl-icon-button-size);\n height: var(--wzl-icon-button-size);\n border-radius: var(--wzl-radius-sm);\n font-weight: var(--wzl-font-weight-bold);\n font-size: var(--wzl-font-size);\n}\n\n.cardAccented .handle {\n background: var(--wzl-layer-stack-accent);\n color: white;\n}\n\n.handle:active {\n cursor: grabbing;\n}\n\n.kind,\n.primary {\n flex: 1;\n font-size: var(--wzl-font-size);\n}\n\n.primary {\n background: transparent;\n border: 0;\n color: var(--wzl-fg);\n font: inherit;\n text-transform: uppercase;\n letter-spacing: var(--wzl-tracking-wide);\n}\n\n.remove {\n font: inherit;\n height: var(--wzl-control-h);\n background: transparent;\n border: 0;\n color: var(--wzl-fg-subtle);\n font-size: var(--wzl-font-size-lg);\n cursor: pointer;\n padding: var(--wzl-space-1) var(--wzl-space-3);\n}\n\n.remove:hover {\n color: var(--wzl-fg);\n}\n\n.cardBody {\n padding: var(--wzl-space-4);\n border-top: 1px solid var(--wzl-border);\n}\n","import { type CSSProperties, type ReactNode, type RefCallback, useEffect, useState } from 'react';\nimport { dlog } from '../../dlog';\nimport { useReorderDragList } from '../../useReorderDragList';\nimport { DragHandleGlyph } from '../DragHandleGlyph';\nimport s from './LayerStack.module.css';\n\n/** One card in a layer stack: its identity, the label shown when collapsed,\n * and the optional select hoisted into its header. */\nexport interface LayerStackItem {\n /** Stable id used for keys, onRemove, onReorder. Numeric to match\n * common id-from-nextId conventions; string ids also work. */\n id: number | string;\n /** Short kind label rendered in the header when no primary select\n * is hoisted (e.g. \"shadow\", \"stroke\"). Omit it for items that have no\n * kind; `label` then names the card. */\n kind?: string;\n /** Header text, when the item's name is not its kind. Falls back to\n * `kind`. */\n label?: string;\n /** When present, hoist this select into the card header so the user\n * can switch mode/shape without expanding. */\n primaryValue?: string;\n primaryOptions?: string[];\n /** Accent CSS color used as the left border / index-badge fill. Sets\n * --wzl-layer-stack-accent on the card, which re-binds --wzl-accent\n * for everything inside it. */\n accent?: string;\n /** Optional badge text rendered before the primary control\n * (e.g. tail index \"1\", \"2\", \"3\"). When omitted a drag handle\n * glyph renders in its place. */\n badge?: string;\n /** Initial expanded state. Defaults to true for newly-added items. */\n defaultExpanded?: boolean;\n}\n\n/** Props for `<LayerStack>`. */\nexport interface LayerStackProps {\n /** Heading above the list. Omit it, along with the palette, for a stack\n * whose surroundings already name it. */\n title?: string;\n items: LayerStackItem[];\n /** Kinds the user can add via the header palette. Omit both this and\n * `onAdd` for a stack the user cannot add to. */\n paletteKinds?: string[];\n onAdd?: (kind: string) => void;\n /** Omit for items the user cannot remove; the card then has no ✕. */\n onRemove?: (id: number | string) => void;\n onReorder: (orderedIds: Array<number | string>) => void;\n /** Required for `primaryValue` to render as a select — without a handler\n * the control could not be changed. */\n onPrimaryChange?: (id: number | string, nextValue: string) => void;\n /** Render the body controls for each item. */\n renderBody: (item: LayerStackItem) => ReactNode;\n /** Shown in place of the list when `items` is empty. Defaults to a line\n * that points at the palette, or a bare one when there is no palette. */\n emptyLabel?: ReactNode;\n /** Hide the title + palette row (used when an outer wrap renders its\n * own head — see speech-balloons Tails panel). */\n hideHead?: boolean;\n /** Appended to the root element's class list. The module's own class names\n * are hashed, so this is the supported way to reach the stack from a\n * consumer stylesheet. */\n className?: string;\n}\n\n/** A drag-reorderable stack of expandable cards, with a palette in the header\n * for adding more. The body of each card is the caller's to render. */\nexport function LayerStack({\n className,\n title,\n items,\n paletteKinds,\n onAdd,\n onRemove,\n onReorder,\n onPrimaryChange,\n renderBody,\n emptyLabel,\n hideHead,\n}: LayerStackProps) {\n const [expandedIds, setExpandedIds] = useState<Set<number | string>>(\n () => new Set(items.filter((i) => i.defaultExpanded !== false).map((i) => i.id)),\n );\n\n useEffect(() => {\n setExpandedIds((prev) => {\n let next: Set<number | string> | null = null;\n for (const item of items) {\n if (item.defaultExpanded === false) continue;\n if (prev.has(item.id)) continue;\n if (next === null) next = new Set(prev);\n next.add(item.id);\n }\n return next ?? prev;\n });\n }, [items]);\n\n const dragItems = items.map((it) => ({\n id: String(it.id),\n label: it.label ?? it.kind ?? String(it.id),\n }));\n const drag = useReorderDragList({\n items: dragItems,\n selectedIds: [],\n onReorder: (ids, targetIndex) => {\n dlog('layer-stack', 'onReorder', { ids, targetIndex });\n const orig = items.map((i) => i.id);\n const moving = new Set(ids);\n const remaining = orig.filter((id) => !moving.has(String(id)));\n const movedIds = items.map((i) => i.id).filter((id) => moving.has(String(id)));\n // weasel reports targetIndex against the original list (which includes\n // the dragged row). Each moved item that originally sat before\n // targetIndex needs to shift the insertion point left by one.\n const shift = orig.filter((id, idx) => moving.has(String(id)) && idx < targetIndex).length;\n const adjusted = targetIndex - shift;\n const out = [...remaining];\n out.splice(adjusted, 0, ...movedIds);\n onReorder(out);\n },\n });\n\n const toggleExpanded = (id: number | string) => {\n setExpandedIds((current) => {\n const n = new Set(current);\n if (n.has(id)) n.delete(id);\n else n.add(id);\n return n;\n });\n };\n\n const palette = onAdd ? (paletteKinds ?? []) : [];\n const showHead = !hideHead && (title !== undefined || palette.length > 0);\n\n return (\n <div className={className ? `${s.stack} ${className}` : s.stack}>\n {showHead && (\n <div className={s.head}>\n {title !== undefined && <h2 className={s.title}>{title}</h2>}\n <div className={s.palette}>\n {palette.map((k) => (\n <button\n key={k}\n type=\"button\"\n className={s.add}\n onClick={() => {\n dlog('layer-stack', 'onAdd', { kind: k });\n onAdd?.(k);\n }}\n aria-label={`Add ${k}`}\n >\n {k}\n </button>\n ))}\n </div>\n </div>\n )}\n <div\n className={s.list}\n ref={drag.containerProps.ref as RefCallback<HTMLDivElement>}\n >\n {items.map((item, i) => {\n const expanded = expandedIds.has(item.id);\n const draggedId = drag.state.draggedIds?.[0];\n const isDragging = draggedId === String(item.id);\n const showHintBefore = drag.state.targetIndex === i && draggedId !== String(item.id);\n const showHintAfter = drag.state.targetIndex === items.length && i === items.length - 1;\n const cardCls = [\n s.card,\n isDragging ? s.cardDragging : '',\n item.accent ? s.cardAccented : '',\n ]\n .filter(Boolean)\n .join(' ');\n const cardStyle = item.accent\n ? ({ '--wzl-layer-stack-accent': item.accent } as CSSProperties)\n : undefined;\n const { onPointerDown } = drag.rowProps(String(item.id), i);\n return (\n <div key={item.id}>\n {showHintBefore && <div className={s.dropHint} />}\n <div className={cardCls} data-testid={`layer-card-${item.id}`} style={cardStyle}>\n <div className={s.cardHead}>\n <button\n type=\"button\"\n className={s.handle}\n aria-label={`Drag to reorder layer ${item.id}`}\n onPointerDown={onPointerDown}\n onClick={() => toggleExpanded(item.id)}\n >\n {item.badge ?? <DragHandleGlyph />}\n </button>\n {item.primaryValue !== undefined && item.primaryOptions && onPrimaryChange ? (\n <select\n className={s.primary}\n value={item.primaryValue}\n aria-label={`Primary select for layer ${item.id}`}\n onChange={(e) => onPrimaryChange(item.id, e.target.value)}\n onClick={(e) => e.stopPropagation()}\n >\n {item.primaryOptions.map((o) => (\n <option key={o} value={o}>\n {o}\n </option>\n ))}\n </select>\n ) : (\n <span className={s.kind}>{item.label ?? item.kind}</span>\n )}\n {onRemove && (\n <button\n type=\"button\"\n className={s.remove}\n aria-label=\"Remove layer\"\n onClick={(e) => {\n e.stopPropagation();\n onRemove(item.id);\n }}\n >\n ✕\n </button>\n )}\n </div>\n {expanded && <div className={s.cardBody}>{renderBody(item)}</div>}\n </div>\n {showHintAfter && <div className={s.dropHint} />}\n </div>\n );\n })}\n {items.length === 0 && (\n <div className={s.empty}>\n {emptyLabel ?? (palette.length > 0 ? 'No layers — add one above.' : 'No layers.')}\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;ACmEA,SAAgB,EAAW,EACzB,cACA,UACA,UACA,iBACA,UACA,aACA,cACA,oBACA,eACA,eACA,eACkB;CAClB,IAAM,CAAC,GAAa,KAAkB,QAC9B,IAAI,IAAI,EAAM,QAAQ,MAAM,EAAE,oBAAoB,GAAM,CAAC,KAAK,MAAM,EAAE,GAAG,CAAC,CACjF;AAED,SAAgB;AACd,KAAgB,MAAS;GACvB,IAAI,IAAoC;AACxC,QAAK,IAAM,KAAQ,EACb,GAAK,oBAAoB,OACzB,EAAK,IAAI,EAAK,GAAG,KACjB,MAAS,SAAM,IAAO,IAAI,IAAI,EAAK,GACvC,EAAK,IAAI,EAAK,GAAG;AAEnB,UAAO,KAAQ;IACf;IACD,CAAC,EAAM,CAAC;CAMX,IAAM,IAAO,EAAmB;EAC9B,OALgB,EAAM,KAAK,OAAQ;GACnC,IAAI,OAAO,EAAG,GAAG;GACjB,OAAO,EAAG,SAAS,EAAG,QAAQ,OAAO,EAAG,GAAG;GAC5C,EAEQ;EACP,aAAa,EAAE;EACf,YAAY,GAAK,MAAgB;AAC/B,KAAK,eAAe,aAAa;IAAE;IAAK;IAAa,CAAC;GACtD,IAAM,IAAO,EAAM,KAAK,MAAM,EAAE,GAAG,EAC7B,IAAS,IAAI,IAAI,EAAI,EACrB,IAAY,EAAK,QAAQ,MAAO,CAAC,EAAO,IAAI,OAAO,EAAG,CAAC,CAAC,EACxD,IAAW,EAAM,KAAK,MAAM,EAAE,GAAG,CAAC,QAAQ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AEQ,CAAA;QAEP;UACL,KAAY,kBAAC,OAAD;OAAK,WAAW,EAAE;iBAAW,EAAW,EAAK;OAAO,CAAA,CAC7D;;KACL,KAAiB,kBAAC,OAAD,EAAK,WAAW,EAAE,UAAY,CAAA;KAC5C,EAAA,EA/CI,EAAK,GA+CT;KAER,EACD,EAAM,WAAW,KAChB,kBAAC,OAAD;IAAK,WAAW,EAAE;cACf,MAAe,EAAQ,SAAS,IAAI,+BAA+B;IAChE,CAAA,CAEJ;KACF"}
@@ -1,60 +0,0 @@
1
- import { r as e } from "./portalHost-CjpCnuGU.js";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { Button as r, Menu as i, MenuItem as a, MenuTrigger as o, Popover as s } from "react-aria-components";
4
- var c = {
5
- trigger: "_trigger_1wmxr_1",
6
- label: "_label_1wmxr_30",
7
- chevron: "_chevron_1wmxr_34",
8
- popover: "_popover_1wmxr_41",
9
- menu: "_menu_1wmxr_47",
10
- item: "_item_1wmxr_60"
11
- };
12
- //#endregion
13
- //#region src/components/MenuButton/MenuButton.tsx
14
- function l({ label: l, items: u, onAction: d, isDisabled: f, className: p, "aria-label": m, portalContainer: h }) {
15
- let { anchor: g, portalProps: _ } = e(h);
16
- return /* @__PURE__ */ n(o, { children: [
17
- g,
18
- /* @__PURE__ */ n(r, {
19
- className: [c.trigger, p].filter(Boolean).join(" "),
20
- isDisabled: f,
21
- "aria-label": m,
22
- children: [/* @__PURE__ */ t("span", {
23
- className: c.label,
24
- children: l
25
- }), /* @__PURE__ */ t("svg", {
26
- className: c.chevron,
27
- viewBox: "0 0 10 10",
28
- "aria-hidden": "true",
29
- children: /* @__PURE__ */ t("path", {
30
- d: "M2 4 L5 7 L8 4",
31
- fill: "none",
32
- stroke: "currentColor",
33
- strokeWidth: "1.5",
34
- strokeLinecap: "round",
35
- strokeLinejoin: "round"
36
- })
37
- })]
38
- }),
39
- /* @__PURE__ */ t(s, {
40
- className: c.popover,
41
- "data-weasel-overlay": "",
42
- ..._,
43
- children: /* @__PURE__ */ t(i, {
44
- className: c.menu,
45
- onAction: (e) => d(e),
46
- children: u.map((e) => /* @__PURE__ */ t(a, {
47
- id: e.value,
48
- className: c.item,
49
- isDisabled: e.isDisabled,
50
- textValue: e.textValue ?? (typeof e.label == "string" ? e.label : void 0),
51
- children: e.label
52
- }, e.value))
53
- })
54
- })
55
- ] });
56
- }
57
- //#endregion
58
- export { l as t };
59
-
60
- //# sourceMappingURL=MenuButton-C_4nox39.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MenuButton-C_4nox39.js","names":[],"sources":["../../src/components/MenuButton/MenuButton.module.css","../../src/components/MenuButton/MenuButton.tsx"],"sourcesContent":[".trigger {\n display: inline-flex;\n flex: none;\n align-items: center;\n gap: var(--wzl-space-3);\n height: var(--wzl-control-h);\n padding: 0 var(--wzl-space-3) 0 var(--wzl-space-5);\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size);\n line-height: 1;\n white-space: nowrap;\n cursor: pointer;\n transition: border-color var(--wzl-motion-fast), box-shadow var(--wzl-motion-fast);\n}\n\n.trigger[data-focus-visible] {\n border-color: var(--wzl-focus-ring);\n box-shadow: 0 0 0 1px var(--wzl-focus-ring);\n}\n\n.trigger[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.label {\n color: var(--wzl-fg-subtle);\n}\n\n.chevron {\n width: 10px;\n height: 10px;\n color: var(--wzl-fg-muted);\n flex: 0 0 auto;\n}\n\n.popover {\n min-width: var(--trigger-width);\n max-height: inherit;\n outline: none;\n}\n\n.menu {\n background: var(--wzl-surface-raised);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-md);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);\n padding: var(--wzl-space-2);\n max-height: 280px;\n overflow: auto;\n outline: none;\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size);\n}\n\n.item {\n display: flex;\n align-items: center;\n padding: var(--wzl-space-2) var(--wzl-space-4);\n border-radius: var(--wzl-radius-sm);\n cursor: pointer;\n color: var(--wzl-fg);\n white-space: nowrap;\n outline: none;\n}\n\n.item[data-focused] {\n background: var(--wzl-surface-hover);\n}\n\n.item[data-disabled] {\n opacity: 0.4;\n cursor: not-allowed;\n}\n","import type { ReactNode } from 'react';\nimport {\n Button as RACButton,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n MenuTrigger,\n Popover as RACPopover,\n} from 'react-aria-components';\nimport { useOverlayPortal, type OverlayPortalProps } from '../../overlays/portalHost';\nimport s from './MenuButton.module.css';\n\n/** One row in a {@link MenuButton}'s list. */\nexport type MenuButtonItem<T extends string = string> = {\n value: T;\n label: ReactNode;\n isDisabled?: boolean;\n /** Plain-text form of `label`, for type-to-select and screen readers. A\n * string label supplies this itself. */\n textValue?: string;\n};\n\n/** Props for {@link MenuButton}. */\nexport type MenuButtonProps<T extends string = string> = {\n /** What the button says. It never changes to show a chosen row. */\n label: ReactNode;\n items: ReadonlyArray<MenuButtonItem<T>>;\n /** Fired with the value of the row chosen. */\n onAction: (value: T) => void;\n isDisabled?: boolean;\n className?: string;\n 'aria-label'?: string;\n} & OverlayPortalProps;\n\n/**\n * A button that opens a list and acts on the row chosen — \"Add trial…\",\n * \"Load…\". Unlike a {@link Select} it holds no value, so it sizes to its own\n * label rather than to its widest row.\n */\nexport function MenuButton<T extends string = string>({\n label,\n items,\n onAction,\n isDisabled,\n className,\n 'aria-label': ariaLabel,\n portalContainer,\n}: MenuButtonProps<T>) {\n const { anchor, portalProps } = useOverlayPortal(portalContainer);\n return (\n <MenuTrigger>\n {anchor}\n <RACButton\n className={[s.trigger, className].filter(Boolean).join(' ')}\n isDisabled={isDisabled}\n aria-label={ariaLabel}\n >\n <span className={s.label}>{label}</span>\n <svg className={s.chevron} viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M2 4 L5 7 L8 4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </RACButton>\n {/* `data-weasel-overlay`: see Select — the list renders in a portal,\n outside the subtree the trigger sits in. */}\n <RACPopover className={s.popover} data-weasel-overlay=\"\" {...portalProps}>\n <RACMenu className={s.menu} onAction={(key) => onAction(key as T)}>\n {items.map((item) => (\n <RACMenuItem\n key={item.value}\n id={item.value}\n className={s.item}\n isDisabled={item.isDisabled}\n textValue={item.textValue ?? (typeof item.label === 'string' ? item.label : undefined)}\n >\n {item.label}\n </RACMenuItem>\n ))}\n </RACMenu>\n </RACPopover>\n </MenuTrigger>\n );\n}\n"],"mappings":";;;;;;;;;;;;;ACsCA,SAAgB,EAAsC,EACpD,UACA,UACA,aACA,eACA,cACA,cAAc,GACd,sBACqB;CACrB,IAAM,EAAE,WAAQ,mBAAgB,EAAiB,EAAgB;AACjE,QACE,kBAAC,GAAD,EAAA,UAAA;EACG;EACD,kBAAC,GAAD;GACE,WAAW,CAAC,EAAE,SAAS,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;GAC/C;GACZ,cAAY;aAHd,CAKE,kBAAC,QAAD;IAAM,WAAW,EAAE;cAAQ;IAAa,CAAA,EACxC,kBAAC,OAAD;IAAK,WAAW,EAAE;IAAS,SAAQ;IAAY,eAAY;cACzD,kBAAC,QAAD;KAAM,GAAE;KAAiB,MAAK;KAAO,QAAO;KAAe,aAAY;KAAM,eAAc;KAAQ,gBAAe;KAAU,CAAA;IACxH,CAAA,CACI;;EAGZ,kBAAC,GAAD;GAAY,WAAW,EAAE;GAAS,uBAAoB;GAAG,GAAI;aAC3D,kBAAC,GAAD;IAAS,WAAW,EAAE;IAAM,WAAW,MAAQ,EAAS,EAAS;cAC9D,EAAM,KAAK,MACV,kBAAC,GAAD;KAEE,IAAI,EAAK;KACT,WAAW,EAAE;KACb,YAAY,EAAK;KACjB,WAAW,EAAK,cAAc,OAAO,EAAK,SAAU,WAAW,EAAK,QAAQ,KAAA;eAE3E,EAAK;KACM,EAPP,EAAK,MAOE,CACd;IACM,CAAA;GACC,CAAA;EACD,EAAA,CAAA"}
@@ -1,123 +0,0 @@
1
- import { t as e } from "./ToggleBar-CClus5Cd.js";
2
- import { t } from "./ColorField-BYzgZM9o.js";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { asPaint as i, isMeshGradientFill as a, sampleGradientStops as o } from "@weasel-js/core";
5
- import "react";
6
- //#region src/paintPreview.ts
7
- var s = 24;
8
- function c(e) {
9
- let t = e.patches?.[0]?.colors;
10
- if (!t || t.length < 4) return;
11
- let n = (e) => `color-mix(in srgb, ${e} 0%, transparent)`, r = [
12
- ["0% 0%", t[0]],
13
- ["100% 0%", t[1]],
14
- ["100% 100%", t[2]],
15
- ["0% 100%", t[3]]
16
- ].map(([e, t]) => `radial-gradient(farthest-corner at ${e}, ${t}, ${n(t)})`);
17
- return r.push(`linear-gradient(to bottom, ${t[0]}, ${t[2]})`), r.join(", ");
18
- }
19
- function l(e) {
20
- let t = e.interpolate ?? "rgb", n = [];
21
- for (let r = 0; r <= s; r++) {
22
- let i = r / s;
23
- n.push(`${o(e.stops, i, t)} ${(i * 100).toFixed(1)}%`);
24
- }
25
- return n.join(", ");
26
- }
27
- var u = 180 / Math.PI;
28
- function d(e) {
29
- return `${(e * 100).toFixed(1)}%`;
30
- }
31
- function f(e) {
32
- if (e != null) {
33
- if ((e.fill ?? "solid") === "solid") return e.color;
34
- if (e.fill === "linear-gradient") {
35
- let t = e.to.x - e.from.x, n = e.to.y - e.from.y;
36
- return `linear-gradient(${(t === 0 && n === 0 ? 90 : Math.atan2(t, -n) * u).toFixed(1)}deg, ${l(e)})`;
37
- }
38
- if (e.fill === "radial-gradient") return `radial-gradient(circle ${`at ${d(e.center.x)} ${d(e.center.y)}`}, ${l(e)})`;
39
- if (e.fill === "mesh-gradient") return c(e);
40
- if (e.fill === "conic-gradient") return `conic-gradient(from ${(e.angle * u + 90).toFixed(1)}deg at ${d(e.center.x)} ${d(e.center.y)}, ${l(e)})`;
41
- }
42
- }
43
- var p = {
44
- root: "_root_g12ri_1",
45
- patch: "_patch_g12ri_7",
46
- preview: "_preview_g12ri_13",
47
- corners: "_corners_g12ri_21",
48
- corner: "_corner_g12ri_21"
49
- }, m = [
50
- {
51
- value: "rgb",
52
- label: "sRGB"
53
- },
54
- {
55
- value: "oklab",
56
- label: "OKLab"
57
- },
58
- {
59
- value: "oklch",
60
- label: "OKLCh"
61
- }
62
- ];
63
- function h(a) {
64
- let { value: o, onInput: s, onChange: c, spaceSwitch: l = !0, className: u } = a, d = o.interpolate ?? "rgb", f = (e, t, n) => i({
65
- ...o,
66
- patches: o.patches.map((r, i) => {
67
- if (i !== e) return r;
68
- let [a, o, s, c] = r.colors, l = [
69
- a,
70
- o,
71
- s,
72
- c
73
- ];
74
- return l[t] = n, {
75
- ...r,
76
- colors: l
77
- };
78
- })
79
- });
80
- return /* @__PURE__ */ r("div", {
81
- className: [p.root, u].filter(Boolean).join(" "),
82
- children: [o.patches.map((e, i) => /* @__PURE__ */ r("div", {
83
- className: p.patch,
84
- children: [/* @__PURE__ */ n("span", {
85
- className: p.preview,
86
- "aria-hidden": "true",
87
- style: { background: g(o, i) }
88
- }), /* @__PURE__ */ n("div", {
89
- className: p.corners,
90
- children: e.colors.map((e, r) => /* @__PURE__ */ n(t, {
91
- value: e,
92
- alpha: !0,
93
- "aria-label": `Patch ${i + 1} corner ${r + 1}`,
94
- className: p.corner,
95
- onInput: (e) => s?.(f(i, r, e)),
96
- onChange: (e) => c(f(i, r, e))
97
- }, r))
98
- })]
99
- }, i)), l && /* @__PURE__ */ n(e, {
100
- items: m,
101
- value: d,
102
- size: "sm",
103
- ariaLabel: "Blend space",
104
- onChange: (e) => e && c(i({
105
- ...o,
106
- interpolate: e
107
- }))
108
- })]
109
- });
110
- }
111
- function g(e, t) {
112
- return f({
113
- ...e,
114
- patches: [e.patches[t]]
115
- });
116
- }
117
- function _(e) {
118
- return a(e);
119
- }
120
- //#endregion
121
- export { _ as n, f as r, h as t };
122
-
123
- //# sourceMappingURL=MeshEditor-Bipz-Ocl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MeshEditor-Bipz-Ocl.js","names":[],"sources":["../../src/paintPreview.ts","../../src/components/MeshEditor/MeshEditor.module.css","../../src/components/MeshEditor/MeshEditor.tsx"],"sourcesContent":["// A `FillStyle` as one CSS background string, for the swatches and chips that\n// stand in for a paint in a panel.\n//\n// The gradient kinds are sampled rather than translated stop for stop: CSS\n// blends its own stops in sRGB, so an OKLCh gradient handed over as two stops\n// would preview as the sRGB blend of its ends. Sampling through\n// `sampleGradientStops` in the paint's own space puts the curve into the\n// stops themselves, and the browser only interpolates the short hops between.\n\nimport { sampleGradientStops, type FillStyle } from '@weasel-js/core';\n\n/** Sample count along a previewed gradient. Enough that a hue arc reads as a\n * curve at chip size; a straight sRGB ramp would need a fraction of it. */\nconst SAMPLES = 24;\n\n/**\n * A mesh patch as four corner radials over a flat base.\n *\n * This is an approximation and cannot be anything else — CSS has no mesh, and\n * the real surface only exists once the renderer has baked it. Each corner\n * fades out across the chip and they composite to something bilinear-ish,\n * which is enough for a swatch to say \"this one, not that one\". Zero alpha is\n * written as `color-mix` with `transparent` so a named or packed-alpha color\n * works without being parsed here.\n */\nfunction meshPreview(paint: { patches?: { colors: string[] }[] }): string | undefined {\n const colors = paint.patches?.[0]?.colors;\n if (!colors || colors.length < 4) return undefined;\n const fade = (c: string): string => `color-mix(in srgb, ${c} 0%, transparent)`;\n const at: [string, string][] = [\n ['0% 0%', colors[0]], ['100% 0%', colors[1]],\n ['100% 100%', colors[2]], ['0% 100%', colors[3]],\n ];\n const layers = at.map(([pos, c]) =>\n `radial-gradient(farthest-corner at ${pos}, ${c}, ${fade(c)})`);\n // The base keeps the middle opaque where the four fades have all thinned.\n layers.push(`linear-gradient(to bottom, ${colors[0]}, ${colors[2]})`);\n return layers.join(', ');\n}\n\n/** CSS color stops across the whole ramp, in the gradient's own blend space. */\nfunction sampledStops(paint: Extract<FillStyle, { stops: unknown }>): string {\n const space = paint.interpolate ?? 'rgb';\n const out: string[] = [];\n for (let i = 0; i <= SAMPLES; i++) {\n const t = i / SAMPLES;\n out.push(`${sampleGradientStops(paint.stops, t, space)} ${(t * 100).toFixed(1)}%`);\n }\n return out.join(', ');\n}\n\nconst DEG = 180 / Math.PI;\n\n/** A fraction of the box as a CSS percentage. A gradient in absolute units has\n * no box to be a fraction of, so its geometry only ever approximates here. */\nfunction pct(v: number): string {\n return `${(v * 100).toFixed(1)}%`;\n}\n\n/**\n * `paint` as a CSS `background` value, or `undefined` for a paint with no CSS\n * form — a pattern, a registered kind — which a caller shows as a checker or\n * a placeholder rather than as an invented color.\n *\n * Gradient geometry is honored as far as CSS can carry it: the angle of a\n * linear gradient, the center of a radial or conic one. A paint in `'world'`\n * or `'local'` units is measured in the scene rather than in the chip, so its\n * preview shows the ramp and not the placement.\n */\nexport function paintPreviewCss(paint: FillStyle | null | undefined): string | undefined {\n if (paint == null) return undefined;\n const kind = paint.fill ?? 'solid';\n if (kind === 'solid') return (paint as { color: string }).color;\n\n if (paint.fill === 'linear-gradient') {\n const dx = paint.to.x - paint.from.x;\n const dy = paint.to.y - paint.from.y;\n // CSS measures from \"to top\", clockwise; the paint measures in a\n // y-down plane from +x.\n const angle = dx === 0 && dy === 0 ? 90 : Math.atan2(dx, -dy) * DEG;\n return `linear-gradient(${angle.toFixed(1)}deg, ${sampledStops(paint)})`;\n }\n if (paint.fill === 'radial-gradient') {\n const at = `at ${pct(paint.center.x)} ${pct(paint.center.y)}`;\n return `radial-gradient(circle ${at}, ${sampledStops(paint)})`;\n }\n if ((paint.fill as string) === 'mesh-gradient') {\n return meshPreview(paint as unknown as { patches?: { colors: string[] }[] });\n }\n if (paint.fill === 'conic-gradient') {\n // CSS starts a conic gradient at \"to top\"; the paint starts at +x.\n const from = (paint.angle * DEG + 90).toFixed(1);\n return `conic-gradient(from ${from}deg at ${pct(paint.center.x)} ${pct(paint.center.y)}, ${sampledStops(paint)})`;\n }\n return undefined;\n}\n",".root {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-4);\n}\n\n.patch {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n}\n\n.preview {\n inline-size: 34px;\n block-size: 34px;\n flex: 0 0 auto;\n border-radius: var(--wzl-radius-sm);\n box-shadow: inset 0 0 0 1px var(--wzl-border);\n}\n\n.corners {\n display: grid;\n grid-template-columns: repeat(2, auto);\n gap: var(--wzl-space-2) var(--wzl-space-3);\n min-inline-size: 0;\n}\n\n.corner {\n min-inline-size: 0;\n}\n","import { type ReactElement } from 'react';\nimport {\n asPaint,\n isMeshGradientFill,\n type ColorSpace,\n type FillStyle,\n type MeshGradientFill,\n} from '@weasel-js/core';\nimport { ColorField } from '../ColorField';\nimport { ToggleBar, type ToggleBarItem } from '../ToggleBar';\nimport { paintPreviewCss } from '../../paintPreview';\nimport s from './MeshEditor.module.css';\n\nconst SPACES: readonly ToggleBarItem<ColorSpace>[] = [\n { value: 'rgb', label: 'sRGB' },\n { value: 'oklab', label: 'OKLab' },\n { value: 'oklch', label: 'OKLCh' },\n];\n\n/** Props for {@link MeshEditor}. `onInput` fires throughout a gesture and\n * `onChange` once at its end. */\nexport interface MeshEditorProps {\n value: MeshGradientFill;\n /** Emitted as a `FillStyle`, which is what every paint control passes\n * around — `FillStyle`'s discriminant stays closed over the built-in\n * members, so a registered kind's own shape only travels through it. */\n onInput?: (next: FillStyle) => void;\n onChange: (next: FillStyle) => void;\n /** Show the sRGB / OKLab / OKLCh switch. Default true. */\n spaceSwitch?: boolean;\n className?: string;\n}\n\n/**\n * Editor for a mesh gradient's colors.\n *\n * Geometry is absent for the same reason it is absent from `GradientEditor`:\n * a patch's twelve control points are a thing to drag on the artwork, not a\n * column of numbers in a panel. What is left is what a panel is good at — the\n * color at each corner, and the space the four of them blend through.\n *\n * Corners are numbered in the patch's own walk order, which is the order the\n * paint stores them in, so a corner's number is stable while it is dragged.\n */\nexport function MeshEditor(props: MeshEditorProps): ReactElement {\n const { value, onInput, onChange, spaceSwitch = true, className } = props;\n const space = value.interpolate ?? 'rgb';\n\n const withCorner = (patchIndex: number, corner: number, color: string): FillStyle => asPaint({\n ...value,\n patches: value.patches.map((patch, i) => {\n if (i !== patchIndex) return patch;\n const [a, b, c, d] = patch.colors;\n const next: [string, string, string, string] = [a, b, c, d];\n next[corner] = color;\n return { ...patch, colors: next };\n }),\n });\n\n return (\n <div className={[s.root, className].filter(Boolean).join(' ')}>\n {value.patches.map((patch, patchIndex) => (\n // A patch has no id; its position in the list is its identity, the way\n // a gradient stop's is.\n <div key={patchIndex} className={s.patch}>\n <span\n className={s.preview}\n aria-hidden=\"true\"\n style={{ background: previewOf(value, patchIndex) }}\n />\n <div className={s.corners}>\n {patch.colors.map((color, corner) => (\n <ColorField\n key={corner}\n value={color}\n alpha\n aria-label={`Patch ${patchIndex + 1} corner ${corner + 1}`}\n className={s.corner}\n onInput={(next) => onInput?.(withCorner(patchIndex, corner, next))}\n onChange={(next) => onChange(withCorner(patchIndex, corner, next))}\n />\n ))}\n </div>\n </div>\n ))}\n\n {spaceSwitch && (\n <ToggleBar<ColorSpace>\n items={SPACES}\n value={space}\n size=\"sm\"\n ariaLabel=\"Blend space\"\n onChange={(next) => next && onChange(asPaint({ ...value, interpolate: next }))}\n />\n )}\n </div>\n );\n}\n\n/** One patch as a swatch: the paint with the other patches taken out, so a\n * multi-patch mesh shows which row belongs to which part of it. */\nfunction previewOf(value: MeshGradientFill, patchIndex: number): string | undefined {\n return paintPreviewCss(\n { ...value, patches: [value.patches[patchIndex]] } as unknown as FillStyle,\n );\n}\n\n/** Narrowing for a consumer rendering this behind a kind switch. */\nexport function isMeshPaint(fill: FillStyle | null | undefined): fill is FillStyle & MeshGradientFill {\n return isMeshGradientFill(fill);\n}\n"],"mappings":";;;;;;AAaA,IAAM,IAAU;AAYhB,SAAS,EAAY,GAAiE;CAC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,KAAK,GAAO,MACxB,kBAAC,GAAD;KAEE,OAAO;KACP,OAAA;KACA,cAAY,SAAS,IAAa,EAAE,UAAU,IAAS;KACvD,WAAW,EAAE;KACb,UAAU,MAAS,IAAU,EAAW,GAAY,GAAQ,EAAK,CAAC;KAClE,WAAW,MAAS,EAAS,EAAW,GAAY,GAAQ,EAAK,CAAC;KAClE,EAPK,EAOL,CACF;IACE,CAAA,CACF;KAnBI,EAmBJ,CACN,EAED,KACC,kBAAC,GAAD;GACE,OAAO;GACP,OAAO;GACP,MAAK;GACL,WAAU;GACV,WAAW,MAAS,KAAQ,EAAS,EAAQ;IAAE,GAAG;IAAO,aAAa;IAAM,CAAC,CAAC;GAC9E,CAAA,CAEA;;;AAMV,SAAS,EAAU,GAAyB,GAAwC;AAClF,QAAO,EACL;EAAE,GAAG;EAAO,SAAS,CAAC,EAAM,QAAQ,GAAY;EAAE,CACnD;;AAIH,SAAgB,EAAY,GAA0E;AACpG,QAAO,EAAmB,EAAK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NumberField-CCjEDZCg.js","names":[],"sources":["../../src/components/NumberField/NumberField.module.css","../../src/components/NumberField/NumberField.tsx","../../src/components/NumberField/UnitField.tsx"],"sourcesContent":[".field {\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 0;\n gap: var(--wzl-space-2);\n}\n\n.frame {\n display: flex;\n align-items: stretch;\n height: var(--wzl-field-h, var(--wzl-control-h));\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size);\n line-height: 1;\n overflow: hidden;\n transition: border-color var(--wzl-motion-fast), box-shadow var(--wzl-motion-fast);\n}\n\n.frame:focus-within {\n border-color: var(--wzl-focus-ring);\n box-shadow: 0 0 0 1px var(--wzl-focus-ring);\n}\n\n.field[data-invalid] .frame {\n border-color: var(--wzl-danger);\n}\n\n.field[data-disabled] .frame {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.frame input {\n flex: 1;\n min-width: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font: inherit;\n padding: 0 var(--wzl-field-pad-x);\n text-align: right;\n -moz-appearance: textfield;\n}\n\n.frame input::-webkit-outer-spin-button,\n.frame input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.steppers {\n display: flex;\n flex-direction: column;\n border-left: 1px solid var(--wzl-border);\n}\n\n.stepper {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--wzl-control-h-xs);\n flex: 1;\n background: transparent;\n border: none;\n color: var(--wzl-fg-muted);\n cursor: pointer;\n padding: 0;\n font-size: var(--wzl-font-size-2xs);\n line-height: 1;\n}\n\n.stepper:not(:last-child) {\n border-bottom: 1px solid var(--wzl-border);\n}\n\n.stepper[data-hovered]:not([data-disabled]) {\n background: var(--wzl-surface-hover);\n color: var(--wzl-fg);\n}\n\n.stepper[data-pressed]:not([data-disabled]) {\n background: var(--wzl-surface-pressed);\n}\n\n.stepper[data-disabled] {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Mirrors the property rows' editable readout (`.readoutInput`), so a number\n sitting inside other chrome does not draw a second box around itself. */\n.ghost {\n height: auto;\n background: transparent;\n border-color: transparent;\n color: var(--wzl-accent);\n font-weight: var(--wzl-font-weight-medium);\n}\n\n.ghost input {\n padding: 1px 0;\n}\n\n.ghost:hover {\n background: color-mix(in srgb, currentColor 8%, transparent);\n}\n\n.ghost:focus-within {\n background: var(--wzl-surface-sunken);\n border-color: var(--wzl-focus-ring);\n box-shadow: none;\n}\n\n/* `width='fit'` states the field's width in characters: left alone an `<input>`\n asks for its 20-character intrinsic width, wider than most rows it sits in. */\n.fit {\n width: auto;\n max-width: 100%;\n align-items: flex-start;\n}\n\n.fit .frame {\n width: fit-content;\n max-width: 100%;\n}\n\n.fit .frame input {\n flex: 0 0 auto;\n width: var(--wzl-number-field-width, 9ch);\n}\n","import { forwardRef, type ReactNode, type Ref } from 'react';\nimport {\n NumberField as RACNumberField,\n Label,\n Input as RACInput,\n Group,\n Button as RACButton,\n Text,\n FieldError,\n type NumberFieldProps as RACNumberFieldProps,\n type ValidationResult,\n} from 'react-aria-components';\nimport { fieldClasses } from '../Field/Field';\nimport s from './NumberField.module.css';\n\n/** Props for {@link NumberField}, on top of React Aria's `NumberField` props. */\nexport type NumberFieldProps = Omit<RACNumberFieldProps, 'children' | 'className'> & {\n label?: ReactNode;\n description?: ReactNode;\n errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);\n /** Hide the up/down stepper buttons. Defaults to false. */\n hideSteppers?: boolean;\n /** Render with no box until focused — the readout treatment the property\n * rows use, for a value that sits inside other chrome rather than in a form. */\n ghost?: boolean;\n /** Native input placeholder — e.g. `'Mixed'` for a multi-selection\n * editor with no shared value. */\n placeholder?: string;\n /**\n * `'fill'` (the default) takes the width of whatever row the field sits in.\n * `'fit'` sizes it to `--wzl-number-field-width` (`9ch` by default) plus its\n * own chrome, rather than to the input's 20-character intrinsic width.\n */\n width?: 'fill' | 'fit';\n className?: string;\n};\n\n/**\n * Numeric input with stepper buttons, wrapping React Aria's NumberField and\n * supplying the same label / description / errorMessage slots as `Input`.\n * Arrow keys and scroll step the value; parsing and formatting are React\n * Aria's.\n *\n * `ref` forwards to the underlying `<input>`.\n */\nexport const NumberField = forwardRef(function NumberField(\n props: NumberFieldProps,\n ref: Ref<HTMLInputElement>,\n) {\n const {\n label,\n description,\n errorMessage,\n hideSteppers,\n ghost,\n placeholder,\n width = 'fill',\n className,\n ...rest\n } = props;\n return (\n <RACNumberField\n {...rest}\n className={[s.field, width === 'fit' && s.fit, fieldClasses.root, className]\n .filter(Boolean)\n .join(' ')}\n >\n {label !== undefined && <Label className={fieldClasses.label}>{label}</Label>}\n <Group className={ghost ? `${s.frame} ${s.ghost}` : s.frame}>\n <RACInput ref={ref} placeholder={placeholder} />\n {!hideSteppers && (\n <div className={s.steppers}>\n <RACButton slot=\"increment\" className={s.stepper} aria-label=\"Increment\">▲</RACButton>\n <RACButton slot=\"decrement\" className={s.stepper} aria-label=\"Decrement\">▼</RACButton>\n </div>\n )}\n </Group>\n {description !== undefined && (\n <Text slot=\"description\" className={fieldClasses.hint}>\n {description}\n </Text>\n )}\n <FieldError className={fieldClasses.error}>{errorMessage}</FieldError>\n </RACNumberField>\n );\n});\n","import { useRef, useState } from 'react';\nimport { formatNumber, parseNumber, type UnitTable } from '../../format/number';\nimport { fieldClasses } from '../Field/Field';\nimport s from './NumberField.module.css';\n\n/** Props for {@link UnitField}. */\nexport interface UnitFieldProps {\n /** The value in the unit the field shows. NaN shows an empty field. */\n value: number;\n /** Fired with a value the field read and clamped, in the unit it shows. */\n onChange: (value: number) => void;\n minValue?: number;\n maxValue?: number;\n /** What an arrow key adds or takes away. Defaults to 1. */\n step?: number;\n /** Units a person may type, each mapped to the factor that turns a number\n * in it into the unit the field shows: `{ mm: 0.1, cm: 1 }`. */\n accepts?: Readonly<UnitTable>;\n placeholder?: string;\n /** Render with no box until focused, as {@link NumberField}'s `ghost` does. */\n ghost?: boolean;\n /** As {@link NumberField}'s `width`. */\n width?: 'fill' | 'fit';\n className?: string;\n 'aria-label'?: string;\n}\n\n/**\n * A number typed as text, so it can carry a unit: `12mm` in a field showing\n * centimeters commits `1.2`. Commits on blur or Enter, reverts on Escape or on\n * text it cannot read, clamps to its bounds, and steps with the arrow keys.\n * React Aria's `NumberField` refuses letters as they are typed, which is why\n * this is not that.\n */\nexport function UnitField({\n value,\n onChange,\n minValue,\n maxValue,\n step = 1,\n accepts,\n placeholder,\n ghost,\n width = 'fill',\n className,\n 'aria-label': ariaLabel,\n}: UnitFieldProps) {\n const [draft, setDraft] = useState<string | null>(null);\n const canceled = useRef(false);\n const text = Number.isFinite(value)\n ? formatNumber(value, { useGrouping: false, maximumFractionDigits: 20 })\n : '';\n const clamp = (n: number) =>\n Math.min(maxValue ?? Infinity, Math.max(minValue ?? -Infinity, n));\n const commit = (n: number) => {\n const next = clamp(n);\n if (next !== value) onChange(next);\n };\n\n return (\n <div\n className={[s.field, width === 'fit' && s.fit, fieldClasses.root, className]\n .filter(Boolean)\n .join(' ')}\n >\n <div className={ghost ? `${s.frame} ${s.ghost}` : s.frame}>\n <input\n type=\"text\"\n inputMode=\"decimal\"\n aria-label={ariaLabel}\n placeholder={placeholder}\n value={draft ?? text}\n onChange={(e) => setDraft(e.target.value)}\n onFocus={() => {\n canceled.current = false;\n }}\n onBlur={() => {\n if (draft !== null && !canceled.current) {\n const n = parseNumber(draft, accepts);\n if (Number.isFinite(n)) commit(n);\n }\n setDraft(null);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.currentTarget.blur();\n } else if (e.key === 'Escape') {\n canceled.current = true;\n e.currentTarget.blur();\n } else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n const typed = draft === null ? value : parseNumber(draft, accepts);\n const from = Number.isFinite(typed) ? typed : 0;\n const next = clamp(from + (e.key === 'ArrowUp' ? step : -step));\n setDraft(null);\n if (next !== value) onChange(next);\n }\n }}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;GC6Ca,IAAc,EAAW,SACpC,GACA,GACA;CACA,IAAM,EACJ,UACA,gBACA,iBACA,iBACA,UACA,gBACA,WAAQ,QACR,cACA,GAAG,MACD;AACJ,QACE,kBAAC,GAAD;EACE,GAAI;EACJ,WAAW;GAAC,EAAE;GAAO,MAAU,SAAS,EAAE;GAAK,EAAa;GAAM;GAAU,CACzE,OAAO,QAAQ,CACf,KAAK,IAAI;YAJd;GAMG,MAAU,KAAA,KAAa,kBAAC,GAAD;IAAO,WAAW,EAAa;cAAQ;IAAc,CAAA;GAC7E,kBAAC,GAAD;IAAO,WAAW,IAAQ,GAAG,EAAE,MAAM,GAAG,EAAE,UAAU,EAAE;cAAtD,CACE,kBAAC,GAAD;KAAe;KAAkB;KAAe,CAAA,EAC/C,CAAC,KACA,kBAAC,OAA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Q;AACrC,MAAI,OAAO,SAAS,EAAE,IAAE,EAAO,EAAE;;AAEnC,OAAS,KAAK;;IAEhB,YAAY,MAAM;AAChB,SAAI,EAAE,QAAQ,QACZ,GAAE,cAAc,MAAM;cACb,EAAE,QAAQ,SAEnB,CADA,EAAS,UAAU,IACnB,EAAE,cAAc,MAAM;cACb,EAAE,QAAQ,aAAa,EAAE,QAAQ,aAAa;AACvD,QAAE,gBAAgB;MAClB,IAAM,IAAQ,MAAU,OAAO,IAAQ,EAAY,GAAO,EAAQ,EAE5D,IAAO,GADA,OAAO,SAAS,EAAM,GAAG,IAAQ,MACnB,EAAE,QAAQ,YAAY,IAAO,CAAC,GAAM;AAE/D,MADA,EAAS,KAAK,EACV,MAAS,KAAO,EAAS,EAAK;;;IAGtC,CAAA;GACE,CAAA;EACF,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"OptionsBar-DeQ-vUeZ.js","names":[],"sources":["../../src/components/OptionsBar/OptionsBar.tsx"],"sourcesContent":["import { type CSSProperties, type ReactElement, type ReactNode } from 'react';\nimport s from '../segmentedControl.module.css';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\n\n/**\n * One segment of an {@link OptionsBar}. Unlike `ToggleBar`, each item carries\n * its own selected state and its own `onChange`.\n */\nexport type OptionsBarItem<V extends string | number = string> = {\n value: V;\n label?: ReactNode;\n ariaLabel?: string;\n disabled?: boolean;\n selected: boolean;\n onChange: (next: boolean) => void;\n};\n\n/** Segment height and type scale for an {@link OptionsBar}. */\nexport type OptionsBarSize = 'sm' | 'md';\n/** Visual treatment of an {@link OptionsBar}. */\nexport type OptionsBarVariant = 'default' | 'minimal';\n\n/** Props for {@link OptionsBar}. */\nexport type OptionsBarProps<V extends string | number = string> = {\n items: readonly OptionsBarItem<V>[];\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?: OptionsBarSize;\n /** Visual variant. `minimal` strips the pill track and glass treatment;\n * selection becomes a flat accent. For dense diagnostic surfaces. */\n variant?: OptionsBarVariant;\n};\n\n/**\n * Segmented strip of independent on/off options, each owning its own state.\n * Use it when the segments are unrelated booleans; use `ToggleBar` when they\n * are values of one setting.\n */\nexport function OptionsBar<V extends string | number = string>(props: OptionsBarProps<V>): ReactElement {\n const { items, ariaLabel, className, height, size, variant } = props;\n\n const toggle = (index: number) => {\n const item = items[index];\n if (item.disabled) return;\n item.onChange(!item.selected);\n };\n\n const roving = useRovingTabIndex({ items, itemClassName: s.segment, onActivate: toggle });\n\n const style: CSSProperties | undefined = height !== undefined\n ? ({ ['--wzl-tb-height' 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=\"group\"\n aria-label={ariaLabel}\n style={style}\n >\n {items.map((item, i) => {\n const cls = `${s.segment}${item.selected ? ` ${s.segmentSelected}` : ''}`;\n return (\n <button\n key={item.value}\n type=\"button\"\n aria-pressed={item.selected}\n aria-label={item.ariaLabel}\n disabled={item.disabled}\n tabIndex={roving.tabIndexFor(i)}\n className={cls}\n onClick={() => toggle(i)}\n onKeyDown={roving.onKeyDown(i)}\n >\n {item.label}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;AAyCA,SAAgB,EAA+C,GAAyC;CACtG,IAAM,EAAE,UAAO,cAAW,cAAW,WAAQ,SAAM,eAAY,GAEzD,KAAU,MAAkB;EAChC,IAAM,IAAO,EAAM;AACf,IAAK,YACT,EAAK,SAAS,CAAC,EAAK,SAAS;IAGzB,IAAS,EAAkB;EAAE;EAAO,eAAe,EAAE;EAAS,YAAY;EAAQ,CAAC,EAEnF,IAAmC,MAAW,KAAA,IAEhD,KAAA,IADC,EAAG,mBAA8B,GAAG,EAAO,KAAK,EAG/C,IAAU;EACd,EAAE;EACF,KAAQ,EAAE,QAAQ;EAClB,KAAW,EAAE,WAAW;EACxB;EACD,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;AAE3B,QACE,kBAAC,OAAD;EACE,KAAK,EAAO;EACZ,WAAW;EACX,MAAK;EACL,cAAY;EACL;YAEN,EAAM,KAAK,GAAM,MAAM;GACtB,IAAM,IAAM,GAAG,EAAE,UAAU,EAAK,WAAW,IAAI,EAAE,oBAAoB;AACrE,UACE,kBAAC,UAAD;IAEE,MAAK;IACL,gBAAc,EAAK;IACnB,cAAY,EAAK;IACjB,UAAU,EAAK;IACf,UAAU,EAAO,YAAY,EAAE;IAC/B,WAAW;IACX,eAAe,EAAO,EAAE;IACxB,WAAW,EAAO,UAAU,EAAE;cAE7B,EAAK;IACC,EAXF,EAAK,MAWH;IAEX;EACE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaintField-jBOJ32rL.js","names":[],"sources":["../../src/components/PaintField/PaintField.module.css","../../src/components/PaintField/PaintField.tsx"],"sourcesContent":[".trigger {\n display: inline-flex;\n align-items: center;\n gap: var(--wzl-space-3);\n inline-size: 100%;\n min-inline-size: 0;\n padding: 1px var(--wzl-space-3) 1px 1px;\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n background: var(--wzl-surface);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size-sm);\n cursor: pointer;\n}\n\n.trigger[data-unset] {\n opacity: 0.6;\n}\n\n.trigger[data-focus-visible] {\n outline: none;\n border-color: var(--wzl-focus-ring);\n box-shadow: 0 0 0 1px var(--wzl-focus-ring);\n}\n\n.swatch {\n /* A paint preview at a fixed 26:18 aspect, not a control box. */\n inline-size: 26px;\n block-size: 18px; /* not-a-control */\n flex: 0 0 auto;\n border-radius: calc(var(--wzl-radius-sm) - var(--wzl-border-w));\n /* Checker under the paint, so a translucent one reads as translucent. */\n background-color: var(--wzl-surface-raised);\n box-shadow: inset 0 0 0 1px var(--wzl-border);\n}\n\n/* No paint to show: the checker stands in rather than an invented color. */\n.swatch[data-empty],\n.trigger[data-mixed] .swatch {\n background: repeating-conic-gradient(\n var(--wzl-border) 0% 25%,\n var(--wzl-surface) 0% 50%\n )\n 50% / 8px 8px;\n}\n\n.label {\n flex: 1 1 auto;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n}\n\n.popover {\n outline: none;\n}\n\n.body {\n inline-size: 240px;\n padding: var(--wzl-space-4);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-md);\n background: var(--wzl-surface-raised);\n box-shadow: 0 8px 24px rgb(0 0 0 / 0.3);\n outline: none;\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size);\n}\n","import { type ReactElement } from 'react';\nimport {\n Button as RACButton,\n Dialog as RACDialog,\n DialogTrigger,\n Popover as RACPopover,\n} from 'react-aria-components';\nimport { getPaintKind, type FillStyle, type PaintKind } from '@weasel-js/core';\nimport { useOverlayPortal, type OverlayPortalProps } from '../../overlays/portalHost';\nimport { paintPreviewCss } from '../../paintPreview';\nimport { PaintInput } from '../PaintInput';\nimport s from './PaintField.module.css';\n\n/** Props for {@link PaintField}. `onInput` fires throughout a gesture inside\n * the popover and `onChange` once at its end. */\nexport interface PaintFieldProps extends OverlayPortalProps {\n /** The paint being edited. `null` is an explicit \"no paint\"; `undefined` is\n * no value to show. */\n value: FillStyle | null | undefined;\n /** Indeterminate presentation: the trigger says \"Mixed\" and the editor\n * lights no kind. */\n mixed?: boolean;\n /** Dim the trigger — a value is in effect but was never chosen. */\n unset?: boolean;\n /** Restrict the editor's kind bar. Default: every registered kind. */\n kinds?: readonly PaintKind[];\n /** Offer \"None\" in the editor. Default `true`. */\n allowNone?: boolean;\n onInput?: (next: FillStyle | null) => void;\n onChange: (next: FillStyle | null) => void;\n /** Names the paint this field edits — `Fill`, `Color`. */\n 'aria-label'?: string;\n className?: string;\n}\n\n/** What the trigger says it is holding. */\nfunction kindLabel(paint: FillStyle | null | undefined, mixed: boolean): string {\n if (mixed) return 'Mixed';\n if (paint === null) return 'None';\n if (paint === undefined) return '—';\n return getPaintKind(paint.fill ?? 'solid')?.label ?? (paint.fill ?? 'solid');\n}\n\n/**\n * A whole `FillStyle` in one control slot: a swatch that says which kind it\n * holds, and a popover holding {@link PaintInput}.\n *\n * `PaintInput` itself is a kind bar over a body — six segments and a stop\n * editor — which a property row's control column cannot hold. This is the\n * shape for a narrow slot, and the difference that matters is fidelity: a\n * `ColorField` in that slot reads a gradient's first stop and writes a solid\n * back, so touching the control loses the paint.\n */\nexport function PaintField(props: PaintFieldProps): ReactElement {\n const {\n value, mixed = false, unset = false, kinds, allowNone = true,\n onInput, onChange, className, portalContainer,\n } = props;\n const ariaLabel = props['aria-label'];\n const { anchor, portalProps } = useOverlayPortal(portalContainer);\n const preview = mixed ? undefined : paintPreviewCss(value);\n\n return (\n <DialogTrigger>\n {anchor}\n <RACButton\n className={[s.trigger, className].filter(Boolean).join(' ')}\n aria-label={ariaLabel}\n {...(unset ? { 'data-unset': '' } : {})}\n {...(mixed ? { 'data-mixed': '' } : {})}\n >\n <span\n className={s.swatch}\n aria-hidden=\"true\"\n {...(preview ? { style: { background: preview } } : { 'data-empty': '' })}\n />\n <span className={s.label}>{kindLabel(value, mixed)}</span>\n </RACButton>\n {/* `data-weasel-overlay`: see Select — the popover renders in a portal,\n outside the subtree the trigger sits in. */}\n <RACPopover className={s.popover} data-weasel-overlay=\"\" {...portalProps}>\n <RACDialog className={s.body} aria-label={ariaLabel ? `${ariaLabel} editor` : 'Paint editor'}>\n <PaintInput\n value={value}\n mixed={mixed}\n unset={unset}\n kinds={kinds}\n allowNone={allowNone}\n onInput={onInput}\n onChange={onChange}\n aria-label={ariaLabel}\n />\n </RACDialog>\n </RACPopover>\n </DialogTrigger>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;ACoCA,SAAS,EAAU,GAAqC,GAAwB;AAI9E,QAHI,IAAc,UACd,MAAU,OAAa,SACvB,MAAU,KAAA,IAAkB,MACzB,EAAa,EAAM,QAAQ,QAAQ,EAAE,SAAU,EAAM,QAAQ;;AAatE,SAAgB,EAAW,GAAsC;CAC/D,IAAM,EACJ,UAAO,WAAQ,IAAO,WAAQ,IAAO,UAAO,eAAY,IACxD,YAAS,aAAU,cAAW,uBAC5B,GACE,IAAY,EAAM,eAClB,EAAE,WAAQ,mBAAgB,EAAiB,EAAgB,EAC3D,IAAU,IAAQ,KAAA,IAAY,EAAgB,EAAM;AAE1D,QACE,kBAAC,GAAD,EAAA,UAAA;EACG;EACD,kBAAC,GAAD;GACE,WAAW,CAAC,EAAE,SAAS,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;GAC3D,cAAY;GACZ,GAAK,IAAQ,EAAE,cAAc,IAAI,GAAG,EAAE;GACtC,GAAK,IAAQ,EAAE,cAAc,IAAI,GAAG,EAAE;aAJxC,CAME,kBAAC,QAAD;IACE,WAAW,EAAE;IACb,eAAY;IACZ,GAAK,IAAU,EAAE,OAAO,EAAE,YAAY,GAAS,EAAE,GAAG,EAAE,cAAc,IAAI;IACxE,CAAA,EACF,kBAAC,QAAD;IAAM,WAAW,EAAE;cAAQ,EAAU,GAAO,EAAM;IAAQ,CAAA,CAChD;;EAGZ,kBAAC,GAAD;GAAY,WAAW,EAAE;GAAS,uBAAoB;GAAG,GAAI;aAC3D,kBAAC,GAAD;IAAW,WAAW,EAAE;IAAM,cAAY,IAAY,GAAG,EAAU,WAAW;cAC5E,kBAAC,GAAD;KACS;KACA;KACA;KACA;KACI;KACF;KACC;KACV,cAAY;KACZ,CAAA;IACQ,CAAA;GACD,CAAA;EACC,EAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaintInput-Qs7Rul5R.js","names":[],"sources":["../../src/components/PaintInput/PaintInput.module.css","../../src/components/PaintInput/PaintInput.tsx"],"sourcesContent":["/* Kind switch stacked over whichever paint body it selects. */\n.root {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-3);\n min-inline-size: 0;\n}\n\n/* A value is in effect but nobody chose it. Never louder than mixed. */\n.unset {\n opacity: 0.55;\n}\n\n/* A kind with no editor: named, not editable. */\n.noEditor {\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-muted);\n}\n","import { useCallback, useRef, type ReactElement } from 'react';\nimport {\n getPaintKind,\n listPaintKinds,\n withGradientKind,\n type FillStyle,\n type GradientFill,\n type GradientKind,\n type PaintKind,\n} from '@weasel-js/core';\nimport { Icon } from '../../icons/Icon';\nimport { ICON_PATHS, type IconName } from '../../icons/paths';\nimport { ColorField } from '../ColorField';\nimport { GradientEditor } from '../GradientEditor';\nimport { MeshEditor, isMeshPaint } from '../MeshEditor';\nimport { PatternPicker, type PatternFill } from '../PatternPicker';\nimport { ToggleBar, type ToggleBarItem } from '../ToggleBar';\nimport s from './PaintInput.module.css';\n\n/** What a kind with no color of its own seeds from. */\nconst FALLBACK_COLOR = '#000000ff';\n\n/** The bar's answer for \"no paint at all\". Not a registered kind — absence\n * has no seed, no color and nothing to render — so it is this control's own\n * segment rather than a registry entry. */\nconst NONE = 'none';\n\nconst GRADIENT_KINDS: readonly string[] = [\n 'linear-gradient',\n 'radial-gradient',\n 'conic-gradient',\n];\n\nfunction isGradient(paint: FillStyle | undefined): paint is GradientFill {\n return paint !== undefined && GRADIENT_KINDS.includes(paint.fill ?? '');\n}\n\nfunction isPattern(paint: FillStyle | undefined): paint is PatternFill {\n return paint?.fill === 'pattern';\n}\n\n/** A paint's own discriminant. The solid member leaves `fill` off, and an\n * explicit `null` is the absence of paint rather than an unknown one. */\nfunction kindOf(paint: FillStyle | null | undefined): PaintKind | null {\n if (paint === null) return NONE;\n if (paint === undefined) return null;\n return paint.fill ?? 'solid';\n}\n\n/** Props for {@link PaintInput}. `onInput` fires throughout a gesture and\n * `onChange` once at its end. */\nexport interface PaintInputProps {\n /** The paint being edited. `null` is an explicit \"no paint\"; `undefined`\n * is no value to show. */\n value: FillStyle | null | undefined;\n /** Indeterminate presentation: no kind lit, and the body withheld because\n * there is no single paint to show. */\n mixed?: boolean;\n /** Dim the control — a value is in effect but was never chosen. */\n unset?: boolean;\n /** Restrict the kind bar. Default: every registered kind. */\n kinds?: readonly PaintKind[];\n /** Offer \"None\". Default `true` — the bar answers \"what kind of paint is\n * this?\" and no-paint is one of the answers. Turn it off where the slot\n * cannot express absence. */\n allowNone?: boolean;\n onInput?: (next: FillStyle | null) => void;\n onChange: (next: FillStyle | null) => void;\n /** Names the paint this control edits — `Fill`, `Color`. Carried by the\n * solid body's swatch, which is the part with a value to announce. */\n 'aria-label'?: string;\n className?: string;\n}\n\n/**\n * Editor for a whole `FillStyle` — a kind bar over whichever body that kind\n * wants.\n *\n * The bar is driven by the paint-kind registry rather than a fixed list, so a\n * consumer's registered kind appears in it and renders that entry's `Editor`.\n * The five built-in kinds keep their branch here: their editors live in this\n * package and `@weasel-js/core`, which owns the registry, cannot import it.\n *\n * Geometry is deliberately absent — on a canvas it belongs on the artwork,\n * via `<SceneGradientHandles>`.\n */\nexport function PaintInput(props: PaintInputProps): ReactElement {\n const {\n value, mixed = false, unset = false, kinds, allowNone = true,\n onInput, onChange, className,\n } = props;\n const ariaLabel = props['aria-label'];\n\n // Per-kind memory, so linear → solid → linear comes back with its stops.\n // A ref, not state: it must not survive the control being pointed at a\n // different selection, and nothing renders off it directly.\n const remembered = useRef(new Map<PaintKind, FillStyle>());\n\n const active = mixed ? null : kindOf(value);\n if (value != null && active !== null) remembered.current.set(active, value);\n\n const entries = listPaintKinds().filter(\n (entry) => kinds === undefined || kinds.includes(entry.id),\n );\n const segment = (id: string, label: string, icon: string | undefined): ToggleBarItem<PaintKind> =>\n icon && icon in ICON_PATHS\n // Icon-only: six labelled segments do not fit a property row, and the\n // full label stays the accessible name.\n // 14 to match the panel's other glyph segments. A `sm` bar is 17px tall\n // over 1px of padding, so 15 fills the segment box edge to edge.\n ? { value: id, label: <Icon name={icon as IconName} size={14} />, ariaLabel: label }\n : { value: id, label };\n\n const items: readonly ToggleBarItem<PaintKind>[] = [\n ...(allowNone ? [segment(NONE, 'None', 'paintNone')] : []),\n ...entries.map((entry) => segment(entry.id, entry.label, entry.icon)),\n ];\n\n /** The color a switch seeds from: whatever the current paint shows. */\n const currentColor = useCallback((): string => {\n if (value == null) return FALLBACK_COLOR;\n return getPaintKind(kindOf(value) ?? 'solid')?.colorOf(value) ?? FALLBACK_COLOR;\n }, [value]);\n\n const switchKind = (kind: PaintKind): void => {\n if (kind === active) return;\n if (kind === NONE) {\n onChange(null);\n return;\n }\n const seen = remembered.current.get(kind);\n if (seen !== undefined) {\n onChange(seen);\n return;\n }\n if (value != null && isGradient(value) && GRADIENT_KINDS.includes(kind)) {\n onChange(withGradientKind(value, kind as GradientKind));\n return;\n }\n const entry = getPaintKind(kind);\n if (entry) onChange(entry.seed(currentColor()));\n };\n\n return (\n <div\n className={[s.root, unset && s.unset, className].filter(Boolean).join(' ')}\n title={unset ? 'Not set' : undefined}\n >\n <ToggleBar<PaintKind>\n items={items}\n value={active}\n size=\"sm\"\n ariaLabel=\"Paint kind\"\n onChange={(kind) => kind && switchKind(kind)}\n />\n {renderBody()}\n </div>\n );\n\n function renderBody(): ReactElement | null {\n if (mixed || value === undefined) {\n return (\n <ColorField\n mixed\n aria-label={ariaLabel}\n onChange={(color) => onChange({ fill: 'solid', color })}\n />\n );\n }\n // Absence has nothing to edit. The lit segment is the whole statement.\n if (value === null) return null;\n // A registered `Editor` wins even for a built-in id: re-registering one is\n // how a consumer replaces a kit control, and the built-in branches below\n // are the fallback for the ids that ship without an entry editor.\n const entry = getPaintKind(kindOf(value) ?? 'solid');\n if (entry?.Editor) {\n const Editor = entry.Editor;\n return <Editor value={value} onInput={onInput} onChange={onChange} />;\n }\n if (isGradient(value)) {\n return (\n <GradientEditor\n value={value}\n kindSwitch={false}\n onInput={onInput}\n onChange={onChange}\n />\n );\n }\n if (isPattern(value)) {\n return <PatternPicker value={value} color={currentColor()} onChange={onChange} />;\n }\n if (isMeshPaint(value)) {\n return <MeshEditor value={value} onInput={onInput} onChange={onChange} />;\n }\n const kind = kindOf(value);\n if (kind !== 'solid') {\n // Editing a paint this control cannot represent would overwrite it, so\n // a kind with no editor is shown and left alone.\n return <div className={s.noEditor}>{entry?.label ?? kind}: no editor</div>;\n }\n return (\n <ColorField\n value={currentColor()}\n alpha\n aria-label={ariaLabel}\n onInput={(color) => onInput?.({ fill: 'solid', color })}\n onChange={(color) => onChange({ fill: 'solid', color })}\n />\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;GCoBM,IAAiB,aAKjB,IAAO,QAEP,IAAoC;CACxC;CACA;CACA;CACD;AAED,SAAS,EAAW,GAAqD;AACvE,QAAO,MAAU,KAAA,KAAa,EAAe,SAAS,EAAM,QAAQ,GAAG;;AAGzE,SAAS,EAAU,GAAoD;AACrE,QAAO,GAAO,SAAS;;AAKzB,SAAS,EAAO,GAAuD;AAGrE,QAFI,MAAU,OAAa,IACvB,MAAU,KAAA,IAAkB,OACzB,EAAM,QAAQ;;AAwCvB,SAAgB,EAAW,GAAsC;CAC/D,IAAM,EACJ,UAAO,WAAQ,IAAO,WAAQ,IAAO,UAAO,eAAY,IACxD,YAAS,aAAU,iBACjB,GACE,IAAY,EAAM,eAKlB,IAAa,kBAAO,IAAI,KAA2B,CAAC,EAEpD,IAAS,IAAQ,OAAO,EAAO,EAAM;AAC3C,CAAI,KAAS,QAAQ,MAAW,QAAM,EAAW,QAAQ,IAAI,GAAQ,EAAM;CAE3E,IAAM,IAAU,GAAgB,CAAC,QAC9B,MAAU,MAAU,KAAA,KAAa,EAAM,SAAS,EAAM,GAAG,CAC3D,EACK,KAAW,GAAY,GAAe,MAC1C,KAAQ,KAAQ,IAKZ;EAAE,OAAO;EAAI,OAAO,kBAAC,GAAD;GAAM,MAAM;GAAkB,MAAM;GAAM,CAAA;EAAE,WAAW;EAAO,GAClF;EAAE,OAAO;EAAI;EAAO,EAEpB,IAA6C,CACjD,GAAI,IAAY,CAAC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D;IAAe;IAAgB;IAAmB;IAAY,CAAA;;AAEvE,MAAI,EAAW,EAAM,CACnB,QACE,kBAAC,GAAD;GACS;GACP,YAAY;GACH;GACC;GACV,CAAA;AAGN,MAAI,EAAU,EAAM,CAClB,QAAO,kBAAC,GAAD;GAAsB;GAAO,OAAO,GAAc;GAAY;GAAY,CAAA;AAEnF,MAAI,EAAY,EAAM,CACpB,QAAO,kBAAC,GAAD;GAAmB;GAAgB;GAAmB;GAAY,CAAA;EAE3E,IAAM,IAAO,EAAO,EAAM;AAM1B,SALI,MAAS,UAMX,kBAAC,GAAD;GACE,OAAO,GAAc;GACrB,OAAA;GACA,cAAY;GACZ,UAAU,MAAU,IAAU;IAAE,MAAM;IAAS;IAAO,CAAC;GACvD,WAAW,MAAU,EAAS;IAAE,MAAM;IAAS;IAAO,CAAC;GACvD,CAAA,GATK,kBAAC,OAAD;GAAK,WAAW,EAAE;aAAlB,CAA6B,GAAO,SAAS,GAAK,cAAiB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PatternPicker-BMpXWboq.js","names":[],"sources":["../../src/components/PatternPicker/PatternPicker.module.css","../../src/components/PatternPicker/PatternPicker.tsx"],"sourcesContent":["/* Tile grid over the size switch. */\n.root {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-3);\n min-inline-size: 0;\n}\n\n.grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(var(--wzl-swatch-size, 28px), 1fr));\n gap: 0;\n}\n\n/* The swatch's whole face is its own tile, so it must not carry a flat\n background — and the tile repeats at its own scale, not the swatch's. */\n.swatch {\n width: 100%;\n aspect-ratio: 1 / 1;\n min-width: 0;\n padding: 0;\n border: 0.5px solid var(--wzl-border);\n border-radius: 0;\n cursor: pointer;\n background-color: var(--wzl-surface-sunken);\n background-image: var(--tile-preview);\n background-repeat: repeat;\n background-size: 16px 16px;\n background-clip: padding-box;\n}\n\n.swatch:hover {\n border-color: var(--wzl-fg-muted);\n}\n\n.swatchActive {\n border-color: var(--wzl-accent);\n box-shadow: 0 0 0 1px var(--wzl-accent);\n}\n","import type { ReactElement } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { FillStyle, TilePatternSpec } from '@weasel-js/core';\nimport { tilePreviewCssUrl } from '@weasel-js/svg';\nimport { ToggleBar } from '../ToggleBar';\nimport s from './PatternPicker.module.css';\n\n/** The `pattern` member of the paint union. */\nexport type PatternFill = Extract<FillStyle, { fill: 'pattern' }>;\n\nconst TILES: readonly TilePatternSpec['tile'][] = ['hatch', 'crosshatch', 'dots', 'chunks'];\n\n/** Tile sizes the picker offers, coarse enough that each reads as a\n * distinct texture rather than a nudge. */\nconst TILE_SIZES: readonly { value: number; label: string }[] = [\n { value: 4, label: 'S' },\n { value: 8, label: 'M' },\n { value: 16, label: 'L' },\n { value: 32, label: 'XL' },\n];\n\nconst DEFAULT_TILE_SIZE = 8;\n\n/** Every swatch previews at one size so the grid compares tiles, not scales. */\nconst PREVIEW_SIZE = 16;\n\n/** The spec a pattern paint carries, if it carries one. A consumer-built\n * `TextureHandle` has no spec, so the picker shows no tile selected and\n * replaces it wholesale on the next click. */\nfunction specOf(fill: PatternFill): TilePatternSpec | null {\n return 'tile' in fill.pattern ? fill.pattern : null;\n}\n\n/**\n * A pattern seeded from a color. `units: 'bounds'` anchors the tile to the\n * node's box, so the texture travels with the shape.\n */\nexport function seedPattern(\n tile: TilePatternSpec['tile'],\n from: string,\n size: number = DEFAULT_TILE_SIZE,\n): PatternFill {\n const spec: TilePatternSpec = { tile, color: from, size };\n // `chunks` is a scatter over a ground rather than a line texture; without a\n // background it reads as loose specks on whatever sits beneath.\n if (tile === 'chunks') spec.bg = '#00000000';\n return { fill: 'pattern', pattern: spec, units: 'bounds' };\n}\n\n/** Props for {@link PatternPicker}. */\nexport interface PatternPickerProps {\n /** The pattern paint being edited. */\n value: PatternFill;\n /** The color new tiles are seeded with — the paint's own, normally. */\n color: string;\n /** Committed value: one call per click. A tile pick and a size change are\n * each a complete gesture, so there is no `onInput`. */\n onChange: (next: PatternFill) => void;\n className?: string;\n}\n\n/**\n * Grid of tile swatches over a size switch, each swatch previewing the real\n * tile at the current color.\n *\n * The preview shares its shape mapper with what the renderer paints, so a\n * swatch cannot drift from the texture it selects.\n */\nexport function PatternPicker(props: PatternPickerProps): ReactElement {\n const { value, color, onChange, className } = props;\n const spec = specOf(value);\n const size = spec?.size ?? DEFAULT_TILE_SIZE;\n\n const pick = (tile: TilePatternSpec['tile']): void => {\n onChange(seedPattern(tile, color, size));\n };\n\n const resize = (nextSize: number): void => {\n if (!spec) return;\n onChange({ ...value, pattern: { ...spec, size: nextSize } });\n };\n\n return (\n <div className={[s.root, className].filter(Boolean).join(' ')}>\n <div className={s.grid}>\n {TILES.map((tile) => {\n const preview: TilePatternSpec = { tile, color, size: PREVIEW_SIZE };\n if (tile === 'chunks') preview.bg = '#00000000';\n const selected = spec?.tile === tile;\n return (\n <button\n key={tile}\n type=\"button\"\n className={[s.swatch, selected && s.swatchActive].filter(Boolean).join(' ')}\n style={{ ['--tile-preview' as string]: tilePreviewCssUrl(preview) } as CSSProperties}\n title={tile}\n aria-label={tile}\n aria-pressed={selected}\n onClick={() => pick(tile)}\n />\n );\n })}\n </div>\n <ToggleBar<number>\n items={TILE_SIZES}\n value={size}\n size=\"sm\"\n ariaLabel=\"Tile size\"\n onChange={(v) => v != null && resize(v)}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;GCUM,IAA4C;CAAC;CAAS;CAAc;CAAQ;CAAS,EAIrF,IAA0D;CAC9D;EAAE,OAAO;EAAG,OAAO;EAAK;CACxB;EAAE,OAAO;EAAG,OAAO;EAAK;CACxB;EAAE,OAAO;EAAI,OAAO;EAAK;CACzB;EAAE,OAAO;EAAI,OAAO;EAAM;CAC3B,EAEK,IAAoB,GAGpB,IAAe;AAKrB,SAAS,EAAO,GAA2C;AACzD,QAAO,UAAU,EAAK,UAAU,EAAK,UAAU;;AAOjD,SAAgB,EACd,GACA,GACA,IAAe,GACF;CACb,IAAM,IAAwB;EAAE;EAAM,OAAO;EAAM;EAAM;AAIzD,QADI,MAAS,aAAU,EAAK,KAAK,cAC1B;EAAE,MAAM;EAAW,SAAS;EAAM,OAAO;EAAU;;AAsB5D,SAAgB,EAAc,GAAyC;CACrE,IAAM,EAAE,UAAO,UAAO,aAAU,iBAAc,GACxC,IAAO,EAAO,EAAM,EACpB,IAAO,GAAM,QAAQ,GAErB,KAAQ,MAAwC;AACpD,IAAS,EAAY,GAAM,GAAO,EAAK,CAAC;IAGpC,KAAU,MAA2B;AACpC,OACL,EAAS;GAAE,GAAG;GAAO,SAAS;IAAE,GAAG;IAAM,MAAM;IAAU;GAAE,CAAC;;AAG9D,QACE,kBAAC,OAAD;EAAK,WAAW,CAAC,EAAE,MAAM,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAA7D,CACE,kBAAC,OAAD;GAAK,WAAW,EAAE;aACf,EAAM,KAAK,MAAS;IACnB,IAAM,IAA2B;KAAE;KAAM;KAAO,MAAM;KAAc;AACpE,IAAI,MAAS,aAAU,EAAQ,KAAK;IACpC,IAAM,IAAW,GAAM,SAAS;AAChC,WACE,kBAAC,UAAD;KAEE,MAAK;KACL,WAAW,CAAC,EAAE,QAAQ,KAAY,EAAE,aAAa,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;KAC3E,OAAO,EAAG,kBAA6B,EAAkB,EAAQ,EAAE;KACnE,OAAO;KACP,cAAY;KACZ,gBAAc;KACd,eAAe,EAAK,EAAK;KACzB,EARK,EAQL;KAEJ;GACE,CAAA,EACN,kBAAC,GAAD;GACE,OAAO;GACP,OAAO;GACP,MAAK;GACL,WAAU;GACV,WAAW,MAAM,KAAK,QAAQ,EAAO,EAAE;GACvC,CAAA,CACE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plot2D-CXf_f7QD.js","names":[],"sources":["../../src/components/Plot2D/geometry.ts","../../src/components/Plot2D/ticks.ts","../../src/components/Plot2D/Plot2D.module.css","../../src/components/Plot2D/Plot2D.tsx"],"sourcesContent":["/**\n * Coordinate transforms (model ↔ plot) for Plot2D. Pure / deterministic —\n * no DOM, no React, no state.\n *\n * Model space: caller-defined xRange × yRange. Y axis goes UP.\n * Plot space: 0..width × 0..height in CSS pixels. Y axis goes DOWN (SVG).\n */\n\nexport interface Point {\n x: number;\n y: number;\n}\n\n/**\n * The caller-defined extent of model space, the coordinate system a plot's\n * data lives in.\n */\nexport interface ModelRange {\n xMin: number;\n xMax: number;\n yMin: number;\n yMax: number;\n}\n\n/** The plot's drawing area in CSS pixels. */\nexport interface PlotSize {\n width: number;\n height: number;\n}\n\n/**\n * Maps a model-space point into plot space, flipping the y axis so model y\n * grows upward while SVG y grows downward.\n */\nexport function modelToPlot(p: Point, m: ModelRange, plot: PlotSize): Point {\n const xFrac = (p.x - m.xMin) / (m.xMax - m.xMin);\n const yFrac = (p.y - m.yMin) / (m.yMax - m.yMin);\n return {\n x: xFrac * plot.width,\n // Invert y so model y=0 sits at plot bottom (SVG y grows downward).\n y: (1 - yFrac) * plot.height,\n };\n}\n\n/** The inverse of {@link modelToPlot}. */\nexport function plotToModel(p: Point, m: ModelRange, plot: PlotSize): Point {\n const xFrac = p.x / plot.width;\n const yFrac = 1 - p.y / plot.height;\n return {\n x: m.xMin + xFrac * (m.xMax - m.xMin),\n y: m.yMin + yFrac * (m.yMax - m.yMin),\n };\n}\n","/**\n * Tick placement for a numeric axis. Pure — no DOM, no React.\n */\n\n/** What a tick label formatter knows about the column it is part of. */\nexport interface TickFormatCtx {\n /** Places after the point that every label in the column shares. */\n decimals: number;\n /** Distance between neighboring ticks, or 0 when the ticks were given\n * explicitly and are not evenly spaced. */\n step: number;\n}\n\n/** Turns a tick value into its label. */\nexport type TickFormatter = (value: number, ctx: TickFormatCtx) => string;\n\n/** A column of ticks and the facts its labels share. */\nexport interface TickSet {\n values: number[];\n step: number;\n decimals: number;\n}\n\n/** Options for {@link niceTicks}. */\nexport interface NiceTickOptions {\n /** Smallest gap between neighboring ticks, in px. */\n minSpacing: number;\n /** Ticks closer than this to either end of the axis are dropped, in px.\n * Default 0. */\n inset?: number;\n}\n\nconst MAX_DECIMALS = 20;\n\n/** The smallest of 1, 2 or 5 times a power of ten that is at least `rough`. */\nexport function niceStep(rough: number): number {\n const mag = Math.pow(10, Math.floor(Math.log10(rough)));\n const norm = rough / mag;\n const step = norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 5 ? 5 : 10;\n return step * mag;\n}\n\n/** Places after the point a multiple of `step` needs, for a 1/2/5 step. */\nexport function stepDecimals(step: number): number {\n if (!(step > 0) || !Number.isFinite(step)) return 0;\n return Math.min(MAX_DECIMALS, Math.max(0, -Math.floor(Math.log10(step) + 1e-9)));\n}\n\n/** The most places after the point any of `values` needs. */\nexport function tickDecimals(values: readonly number[]): number {\n let most = 0;\n for (const v of values) {\n if (!Number.isFinite(v)) continue;\n let d = 0;\n while (d < MAX_DECIMALS && Math.abs(Number(v.toFixed(d)) - v) > 1e-9 * Math.max(1, Math.abs(v))) d++;\n most = Math.max(most, d);\n }\n return most;\n}\n\n/**\n * Ticks at round values across `range`, drawn `pixels` long: the finest\n * 1/2/5 step that keeps neighbors `minSpacing` px apart, so a taller plot\n * gets more of them.\n */\nexport function niceTicks(\n range: readonly [number, number],\n pixels: number,\n options: NiceTickOptions,\n): TickSet {\n const none: TickSet = { values: [], step: 0, decimals: 0 };\n const lo = Math.min(range[0], range[1]);\n const hi = Math.max(range[0], range[1]);\n const span = hi - lo;\n const { minSpacing, inset = 0 } = options;\n if (!(span > 0) || !Number.isFinite(span) || !(pixels > 0) || !(minSpacing > 0)) return none;\n\n const unitsPerPx = span / pixels;\n const step = niceStep(minSpacing * unitsPerPx);\n const decimals = stepDecimals(step);\n const from = lo + inset * unitsPerPx;\n const to = hi - inset * unitsPerPx;\n // A tolerance in step units, so a tick sitting exactly on a bound survives\n // the float error in `from / step`.\n const first = Math.ceil(from / step - 1e-9);\n const last = Math.floor(to / step + 1e-9);\n const values: number[] = [];\n for (let i = first; i <= last; i++) values.push(Number((i * step).toFixed(decimals)) + 0);\n return { values, step, decimals };\n}\n\n/** The default label: `value` fixed to the column's shared decimals, with\n * no negative zero. */\nexport function formatTick(value: number, ctx: TickFormatCtx): string {\n const text = value.toFixed(ctx.decimals);\n return /^-0(\\.0*)?$/.test(text) ? text.slice(1) : text;\n}\n",".root {\n /* Component-local vars layered over theme tokens. Consumers override\n * either the plot-* var (component scope) or the wzl-* token (app\n * scope). */\n --plot-bg: var(--wzl-surface-sunken);\n --plot-grid: var(--wzl-line);\n /* Axes get full foreground contrast — they're the plot frame, the\n * most prominent structural element after caller-rendered content. */\n --plot-axis: var(--wzl-fg);\n --plot-tick: var(--wzl-line-subtle);\n --plot-tick-label: var(--wzl-fg-muted);\n /* Knocks the tick line out from behind an inside label. */\n --plot-tick-label-halo: var(--plot-bg);\n\n display: block;\n /* Caller-rendered marks at the very edge (e.g. CurveEditor anchors)\n * extend past the SVG box by their radius — let them paint over the\n * host page instead of being half-clipped. */\n overflow: visible;\n background: var(--plot-bg);\n user-select: none;\n touch-action: none;\n outline: none;\n}\n\n/* Keyboard-only focus ring. Caller opts in via `tabIndex`. */\n.root:focus-visible {\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: 2px;\n}\n\n.grid {\n stroke: var(--plot-grid);\n stroke-width: 1;\n fill: none;\n}\n\n.axis {\n stroke: var(--plot-axis);\n stroke-width: var(--wzl-line-width);\n fill: none;\n}\n\n.tick {\n stroke: var(--plot-tick);\n stroke-width: 1;\n fill: none;\n}\n\n.tickLabels { pointer-events: none; }\n\n.tickLabel {\n fill: var(--plot-tick-label);\n font-size: var(--wzl-font-size-xs);\n font-variant-numeric: tabular-nums;\n}\n\n.tickLabel[data-placement='inside'] {\n stroke: var(--plot-tick-label-halo);\n stroke-width: 3px;\n stroke-linejoin: round;\n paint-order: stroke;\n}\n","import {\n forwardRef, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState,\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactNode,\n} from 'react';\nimport {\n modelToPlot, plotToModel,\n type ModelRange, type Point,\n} from './geometry';\nimport {\n formatTick, niceTicks, tickDecimals,\n type TickFormatCtx, type TickFormatter,\n} from './ticks';\nimport s from './Plot2D.module.css';\nimport { dlog } from '../../dlog';\n\n/** Background grid configuration for a {@link Plot2D}. */\nexport interface GridSettings {\n /** Number of evenly-spaced internal grid lines per axis (excluding\n * the edges). Applied to both x and y. Default 3. */\n divisions?: number;\n /** Stroke color override. When omitted, uses `var(--plot-grid)`. */\n color?: string;\n}\n\n/** Axis-line configuration for a {@link Plot2D}. */\nexport interface AxesSettings {\n /** Stroke color override. When omitted, uses `var(--plot-axis)`. */\n color?: string;\n}\n\n/**\n * Ticks along one axis of a {@link Plot2D}: a line across the plot at each\n * tick value, and a label naming it. Every label in a column is formatted\n * to the same number of decimal places.\n */\nexport interface TickSettings {\n /** Tick values in model space; any outside the range are skipped.\n * Omitted = round 1/2/5 steps, as many as `minSpacing` allows at the\n * plot's current size. */\n values?: readonly number[];\n /** Smallest gap between generated ticks, in px. Default 24 on y, 64 on x. */\n minSpacing?: number;\n /** A generated tick nearer either end of the axis than this is dropped,\n * so its label stays on the plot, in px. Default 4 on y, 16 on x. */\n inset?: number;\n /** Draw a line across the plot at each tick. Default true. */\n lines?: boolean;\n /** Where labels sit: `'inside'` the plot along its left (y) or bottom (x)\n * edge, `'outside'` it past that edge in space the caller leaves free,\n * or `false` for none. Default `'inside'`. */\n labels?: 'inside' | 'outside' | false;\n /** Space between a label and the plot edge it sits against, in px.\n * Default 4. */\n gap?: number;\n /** Label text for a tick. Default {@link formatTick}. */\n format?: TickFormatter;\n}\n\n/** A pointer position given in both of the plot's coordinate systems. */\nexport interface Plot2DCoords {\n plot: Point;\n model: Point;\n}\n\n/** Props for {@link Plot2D}. */\nexport interface Plot2DProps {\n width: number;\n height: number;\n /** Model-space x range. Default [0, 1]. */\n xRange?: readonly [number, number];\n /** Model-space y range. Default [0, 1]. */\n yRange?: readonly [number, number];\n /** Background grid. `false` / `null` / omitted = no grid. Pass `{}`\n * for default (3 divisions per axis) or populated GridSettings. */\n grid?: GridSettings | false | null;\n /** Axis lines. `false` / `null` = no axes. Omitted = default-styled\n * axes (on). Pass AxesSettings to customize. */\n axes?: AxesSettings | false | null;\n /** Ticks at x values. `false` / `null` / omitted = none; `{}` = defaults. */\n xTicks?: TickSettings | false | null;\n /** Ticks at y values. `false` / `null` / omitted = none; `{}` = defaults. */\n yTicks?: TickSettings | false | null;\n /** Forwarded to the underlying svg. Consumer opts into focus this way. */\n tabIndex?: number;\n /** Default `'img'`. A plot holding focusable marks must not be an image,\n * whose children are presentational to assistive technology. */\n role?: string;\n 'aria-label'?: string;\n className?: string;\n style?: CSSProperties;\n /** Pointer down on the SVG. Receives both plot- and model-space coords\n * pre-computed so consumers don't repeat the rect/transform dance. */\n onPointerDown?: (e: ReactPointerEvent<SVGSVGElement>, coords: Plot2DCoords) => void;\n onKeyDown?: (e: ReactKeyboardEvent<SVGSVGElement>) => void;\n children?: ReactNode;\n}\n\n/**\n * Imperative handle on a {@link Plot2D}: the SVG element, its size, and the\n * coordinate conversions, including ones that start from a raw DOM event so a\n * drag tracked on `window` can still map back into the plot.\n */\nexport interface Plot2DHandle {\n readonly svg: SVGSVGElement | null;\n plotToModel(pt: Point): Point;\n modelToPlot(pt: Point): Point;\n /** Convert a DOM event's clientX/clientY (e.g. from a window-attached\n * pointermove during drag) to plot-space. */\n clientToPlot(e: { clientX: number; clientY: number }): Point;\n /** Convenience: clientToPlot → plotToModel. */\n clientToModel(e: { clientX: number; clientY: number }): Point;\n readonly width: number;\n readonly height: number;\n}\n\ntype Axis = 'x' | 'y';\n\nconst TICK_SPACING_PX: Record<Axis, number> = { x: 64, y: 24 };\nconst TICK_INSET_PX: Record<Axis, number> = { x: 16, y: 4 };\nconst LABEL_GAP_PX = 4;\n\ninterface ResolvedTick {\n value: number;\n /** Plot-space position along the axis. */\n at: number;\n label: string;\n}\n\nfunction resolveTicks(\n settings: TickSettings,\n axis: Axis,\n range: readonly [number, number],\n pixels: number,\n toPlot: (v: number) => number,\n): ResolvedTick[] {\n let values: number[];\n let ctx: TickFormatCtx;\n if (settings.values) {\n const lo = Math.min(range[0], range[1]);\n const hi = Math.max(range[0], range[1]);\n const eps = (hi - lo) * 1e-9;\n values = settings.values.filter((v) => v >= lo - eps && v <= hi + eps);\n const gaps = values.slice(1).map((v, i) => v - values[i]);\n const even = gaps.length > 0 && gaps.every((g) => Math.abs(g - gaps[0]) <= Math.abs(gaps[0]) * 1e-9);\n ctx = { decimals: tickDecimals(values), step: even ? gaps[0] : 0 };\n } else {\n const set = niceTicks(range, pixels, {\n minSpacing: settings.minSpacing ?? TICK_SPACING_PX[axis],\n inset: settings.inset ?? TICK_INSET_PX[axis],\n });\n values = set.values;\n ctx = { decimals: set.decimals, step: set.step };\n }\n const format = settings.format ?? formatTick;\n return values.map((value) => ({ value, at: toPlot(value), label: format(value, ctx) }));\n}\n\n/**\n * An SVG plotting surface with an optional grid, axes and ticks. It draws the\n * frame and owns the model-space to plot-space mapping; the plotted content is\n * whatever children are passed, positioned in plot space.\n */\nexport const Plot2D = forwardRef<Plot2DHandle, Plot2DProps>(function Plot2D(props, ref) {\n const {\n width, height,\n xRange = [0, 1],\n yRange = [0, 1],\n grid,\n axes,\n xTicks,\n yTicks,\n tabIndex,\n role = 'img',\n className,\n style,\n onPointerDown,\n onKeyDown,\n children,\n } = props;\n\n const svgRef = useRef<SVGSVGElement | null>(null);\n\n const modelRange: ModelRange = useMemo(\n () => ({ xMin: xRange[0], xMax: xRange[1], yMin: yRange[0], yMax: yRange[1] }),\n [xRange, yRange],\n );\n\n const plotSize = useMemo(() => ({ width, height }), [width, height]);\n\n const clientToPlot = useCallback((e: { clientX: number; clientY: number }): Point => {\n const rect = svgRef.current?.getBoundingClientRect();\n const left = rect?.left ?? 0;\n const top = rect?.top ?? 0;\n return { x: e.clientX - left, y: e.clientY - top };\n }, []);\n\n useEffect(() => {\n dlog('plot2d', 'mount', { width, height });\n return () => dlog('plot2d', 'unmount');\n // Mount/unmount trace: re-running on a resize would log a spurious mount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n useImperativeHandle(ref, () => ({\n get svg() { return svgRef.current; },\n plotToModel: (pt: Point) => plotToModel(pt, modelRange, plotSize),\n modelToPlot: (pt: Point) => modelToPlot(pt, modelRange, plotSize),\n clientToPlot,\n clientToModel: (e) => plotToModel(clientToPlot(e), modelRange, plotSize),\n get width() { return plotSize.width; },\n get height() { return plotSize.height; },\n }), [modelRange, plotSize, clientToPlot]);\n\n const handlePointerDown = useCallback((e: ReactPointerEvent<SVGSVGElement>) => {\n if (!onPointerDown) return;\n const plot = clientToPlot(e);\n const model = plotToModel(plot, modelRange, plotSize);\n onPointerDown(e, { plot, model });\n }, [onPointerDown, clientToPlot, modelRange, plotSize]);\n\n const xTickList = xTicks\n ? resolveTicks(xTicks, 'x', xRange, width, (v) => modelToPlot({ x: v, y: yRange[0] }, modelRange, plotSize).x)\n : [];\n const yTickList = yTicks\n ? resolveTicks(yTicks, 'y', yRange, height, (v) => modelToPlot({ x: xRange[0], y: v }, modelRange, plotSize).y)\n : [];\n\n // An inside y column is right-aligned against its widest label, which only\n // the rendered text can say.\n const yInside = !!yTicks && (yTicks.labels ?? 'inside') === 'inside';\n const yLabelsRef = useRef<SVGGElement | null>(null);\n const [yLabelWidth, setYLabelWidth] = useState(0);\n const yLabelKey = yInside ? yTickList.map((t) => t.label).join('\\n') : '';\n useLayoutEffect(() => {\n if (!yInside) return;\n const measure = (): void => {\n let widest = 0;\n for (const el of yLabelsRef.current?.querySelectorAll('text') ?? []) {\n if (typeof el.getComputedTextLength === 'function') widest = Math.max(widest, el.getComputedTextLength());\n }\n setYLabelWidth((prev) => (prev === widest ? prev : widest));\n };\n measure();\n let live = true;\n // A web font landing after the first measure changes every width.\n document.fonts?.ready.then(() => { if (live) measure(); });\n return () => { live = false; };\n }, [yInside, yLabelKey]);\n\n const cls = [s.root, className].filter(Boolean).join(' ');\n\n const renderTickLines = (axis: Axis, list: ResolvedTick[], settings: TickSettings | false | null | undefined) => {\n if (!settings || settings.lines === false || list.length === 0) return null;\n return (\n <g>\n {list.map((t) => (\n <line\n key={`t${axis}-${t.value}`}\n data-plot-element=\"tick\"\n data-axis={axis}\n className={s.tick}\n {...(axis === 'x'\n ? { x1: t.at, x2: t.at, y1: 0, y2: height }\n : { x1: 0, x2: width, y1: t.at, y2: t.at })}\n />\n ))}\n </g>\n );\n };\n\n const renderTickLabels = (axis: Axis, list: ResolvedTick[], settings: TickSettings | false | null | undefined) => {\n if (!settings || list.length === 0) return null;\n const placement = settings.labels ?? 'inside';\n if (placement === false) return null;\n const outside = placement === 'outside';\n const gap = settings.gap ?? LABEL_GAP_PX;\n let place: { x?: number; y?: number; textAnchor: 'start' | 'middle' | 'end'; dominantBaseline?: 'central' | 'hanging' };\n if (axis === 'y') {\n place = outside\n ? { x: -gap, textAnchor: 'end', dominantBaseline: 'central' }\n : yLabelWidth > 0\n ? { x: gap + yLabelWidth, textAnchor: 'end', dominantBaseline: 'central' }\n : { x: gap, textAnchor: 'start', dominantBaseline: 'central' };\n } else {\n place = outside\n ? { y: height + gap, textAnchor: 'middle', dominantBaseline: 'hanging' }\n : { y: height - gap, textAnchor: 'middle' };\n }\n return (\n <g ref={axis === 'y' ? yLabelsRef : undefined} className={s.tickLabels} aria-hidden=\"true\">\n {list.map((t) => (\n <text\n key={`l${axis}-${t.value}`}\n data-plot-element=\"tick-label\"\n data-axis={axis}\n data-placement={placement}\n className={s.tickLabel}\n x={axis === 'x' ? t.at : place.x}\n y={axis === 'y' ? t.at : place.y}\n textAnchor={place.textAnchor}\n dominantBaseline={place.dominantBaseline}\n >\n {t.label}\n </text>\n ))}\n </g>\n );\n };\n\n return (\n <svg\n ref={svgRef}\n className={cls}\n style={style}\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n role={role}\n aria-label={props['aria-label']}\n tabIndex={tabIndex}\n onPointerDown={onPointerDown ? handlePointerDown : undefined}\n onKeyDown={onKeyDown}\n >\n {grid && (() => {\n const divisions = grid.divisions ?? 3;\n const stroke = grid.color;\n // Evenly-spaced internal divisions, excluding the edges (which\n // belong to the axes). For divisions=3, fractions are 1/4, 2/4, 3/4.\n const fractions: number[] = [];\n for (let i = 1; i <= divisions; i++) fractions.push(i / (divisions + 1));\n return (\n <g>\n {fractions.map((f) => (\n <line\n key={`gx-${f}`}\n data-plot-element=\"grid\"\n className={s.grid}\n stroke={stroke}\n x1={f * width} x2={f * width}\n y1={0} y2={height}\n />\n ))}\n {fractions.map((f) => (\n <line\n key={`gy-${f}`}\n data-plot-element=\"grid\"\n className={s.grid}\n stroke={stroke}\n x1={0} x2={width}\n y1={f * height} y2={f * height}\n />\n ))}\n </g>\n );\n })()}\n {renderTickLines('x', xTickList, xTicks)}\n {renderTickLines('y', yTickList, yTicks)}\n {axes !== false && axes !== null && (() => {\n const stroke = axes?.color;\n return (\n <g>\n <line\n data-plot-element=\"axis\"\n className={s.axis}\n stroke={stroke}\n x1={0} x2={width}\n y1={height} y2={height}\n />\n <line\n data-plot-element=\"axis\"\n className={s.axis}\n stroke={stroke}\n x1={0} x2={0}\n y1={0} y2={height}\n />\n </g>\n );\n })()}\n {renderTickLabels('x', xTickList, xTicks)}\n {renderTickLabels('y', yTickList, yTicks)}\n {children}\n </svg>\n );\n});\n"],"mappings":";;;;AAkCA,SAAgB,EAAY,GAAU,GAAe,GAAuB;CAC1E,IAAM,KAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OACrC,KAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE;AAC3C,QAAO;EACL,GAAG,IAAQ,EAAK;EAEhB,IAAI,IAAI,KAAS,EAAK;EACvB;;AAIH,SAAgB,EAAY,GAAU,GAAe,GAAuB;CAC1E,IAAM,IAAQ,EAAE,IAAI,EAAK,OACnB,IAAQ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;;EAER"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PointPlotter-S_gz7VYt.js","names":[],"sources":["../../src/components/PointPlotter/PointPlotter.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport {\n CurveEditor,\n type AnchorRenderProps,\n type ControlPoint,\n type CurveEditorProps,\n} from '../CurveEditor';\nimport type { GridSettings, AxesSettings, TickSettings } from '../Plot2D';\n\n/** Props for {@link PointPlotter}. */\nexport interface PointPlotterProps {\n /** Plotted points; caller-owned. */\n value: readonly ControlPoint[];\n /** Fires every frame during drag with the live in-flight value. */\n onInput: (next: ControlPoint[]) => void;\n /** Fires once per discrete user action (drag-end, add, delete) with\n * the new value and the value at gesture start. Wire history here. */\n onChange?: (next: ControlPoint[], prev: readonly ControlPoint[]) => void;\n /** Model-space x range. Default [0, 1]. */\n xRange?: readonly [number, number];\n /** Model-space y range. Default [0, 1]. */\n yRange?: readonly [number, number];\n width: number;\n height: number;\n grid?: GridSettings | false | null;\n axes?: AxesSettings | false | null;\n xTicks?: TickSettings | false | null;\n yTicks?: TickSettings | false | null;\n /** Minimum allowed point count. User-initiated deletion is refused\n * while `value.length <= minPoints`. */\n minPoints?: number;\n /** Maximum allowed point count. User-initiated insertion is refused\n * while `value.length >= maxPoints`. */\n maxPoints?: number;\n /** How new points are added. Default `'click-empty'`. Set to `'never'`\n * to disable insertion entirely. */\n addPointMode?: 'click-empty' | 'never';\n /** Built-in undo/redo via keyboard when the component has focus.\n * Default `true`. See `CurveEditor.history` for details. */\n history?: boolean;\n /** Custom per-anchor renderer. See `CurveEditor.renderAnchor`. */\n renderAnchor?: (info: AnchorRenderProps) => ReactNode;\n /** Extra SVG content beneath the anchors. See `CurveEditor.decorations`. */\n decorations?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\n/**\n * 2D point plotter — a CurveEditor with the curve hidden. Anchors,\n * drag, shift+click delete, right-click delete, and click-empty insert\n * are inherited from CurveEditor verbatim, so the two components share\n * gesture semantics and stay in sync as CurveEditor evolves.\n *\n * Differences from CurveEditor: no curve `<path>` drawn, no fill, no\n * endpoint pinning, no interpolation, default `addPointMode` is\n * `'click-empty'` (CurveEditor defaults to `'click-curve'`, which\n * doesn't make sense without a curve to hit-test against).\n */\nexport function PointPlotter(props: PointPlotterProps) {\n const curveProps: CurveEditorProps = {\n ...props,\n addPointMode: props.addPointMode ?? 'click-empty',\n curve: false,\n fill: false,\n endpoints: 'free',\n };\n return <CurveEditor {...curveProps} />;\n}\n"],"mappings":";;;AA2DA,SAAgB,EAAa,GAA0B;AAQrD,QAAO,kBAAC,GAAD;EANL,GAAG;EACH,cAAc,EAAM,gBAAgB;EACpC,OAAO;EACP,MAAM;EACN,WAAW;EAEyB,CAAA"}