@weasel-js/ui 1.2.0 → 1.3.0

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 (267) hide show
  1. package/dist/chunks/{ActionBar-BvPEd_GW.js → ActionBar-BTev_ZZl.js} +21 -21
  2. package/dist/chunks/ActionBar-BTev_ZZl.js.map +1 -0
  3. package/dist/chunks/{ActionsBar-9aR5N3lU.js → ActionsBar-CBi_dV4B.js} +4 -4
  4. package/dist/chunks/{ActionsBar-9aR5N3lU.js.map → ActionsBar-CBi_dV4B.js.map} +1 -1
  5. package/dist/chunks/{Badge-dQzbkk-C.js → Badge-9dPfvYOk.js} +672 -670
  6. package/dist/chunks/Badge-9dPfvYOk.js.map +1 -0
  7. package/dist/chunks/{BandEditor-D3i6l299.js → BandEditor-DeE-Nhyh.js} +46 -46
  8. package/dist/chunks/BandEditor-DeE-Nhyh.js.map +1 -0
  9. package/dist/chunks/{Button-9QNIYugK.js → Button-CIu40Epu.js} +28 -28
  10. package/dist/chunks/Button-CIu40Epu.js.map +1 -0
  11. package/dist/chunks/{Callout-cJHJ4kIN.js → Callout-CxDNb9iE.js} +35 -35
  12. package/dist/chunks/Callout-CxDNb9iE.js.map +1 -0
  13. package/dist/chunks/Checkbox-Chtrlh19.js +47 -0
  14. package/dist/chunks/Checkbox-Chtrlh19.js.map +1 -0
  15. package/dist/chunks/ColorField-CSSRv3jG.js +60 -0
  16. package/dist/chunks/ColorField-CSSRv3jG.js.map +1 -0
  17. package/dist/chunks/{ComboBox-ONQISwtI.js → ComboBox-BIQ8KP4h.js} +28 -28
  18. package/dist/chunks/ComboBox-BIQ8KP4h.js.map +1 -0
  19. package/dist/chunks/{CurveEditor-SmwwvrsA.js → CurveEditor-DiJk0NhK.js} +117 -116
  20. package/dist/chunks/{CurveEditor-SmwwvrsA.js.map → CurveEditor-DiJk0NhK.js.map} +1 -1
  21. package/dist/chunks/DataGrid-BgiEYBLo.js +107 -0
  22. package/dist/chunks/DataGrid-BgiEYBLo.js.map +1 -0
  23. package/dist/chunks/Dialog-RzrboT4Q.js +59 -0
  24. package/dist/chunks/Dialog-RzrboT4Q.js.map +1 -0
  25. package/dist/chunks/DragHandleGlyph-CJbzRigu.js +47 -0
  26. package/dist/chunks/DragHandleGlyph-CJbzRigu.js.map +1 -0
  27. package/dist/chunks/{Field-VQwmrIna.js → Field-DrRby9vo.js} +6 -6
  28. package/dist/chunks/Field-DrRby9vo.js.map +1 -0
  29. package/dist/chunks/GradientEditor-BuVR6pt-.js +308 -0
  30. package/dist/chunks/GradientEditor-BuVR6pt-.js.map +1 -0
  31. package/dist/chunks/InlineRange-B-Jkv8AA.js +24 -0
  32. package/dist/chunks/InlineRange-B-Jkv8AA.js.map +1 -0
  33. package/dist/chunks/Input-BnxOPY4N.js +55 -0
  34. package/dist/chunks/Input-BnxOPY4N.js.map +1 -0
  35. package/dist/chunks/{Keycaps-CFX7UAj8.js → Keycaps-Dk33JOiH.js} +15 -15
  36. package/dist/chunks/Keycaps-Dk33JOiH.js.map +1 -0
  37. package/dist/chunks/LayerStack-DQYvGNPA.js +145 -0
  38. package/dist/chunks/LayerStack-DQYvGNPA.js.map +1 -0
  39. package/dist/chunks/NumberField-BQ-KaK7T.js +59 -0
  40. package/dist/chunks/NumberField-BQ-KaK7T.js.map +1 -0
  41. package/dist/chunks/{OptionsBar-CHvH4n4u.js → OptionsBar-BecAPCID.js} +4 -4
  42. package/dist/chunks/{OptionsBar-CHvH4n4u.js.map → OptionsBar-BecAPCID.js.map} +1 -1
  43. package/dist/chunks/PaintInput-K5W4Uho3.js +205 -0
  44. package/dist/chunks/PaintInput-K5W4Uho3.js.map +1 -0
  45. package/dist/chunks/PatternPicker-BdLSj_f_.js +93 -0
  46. package/dist/chunks/PatternPicker-BdLSj_f_.js.map +1 -0
  47. package/dist/chunks/Plot2D-BEjpJhk-.js +134 -0
  48. package/dist/chunks/Plot2D-BEjpJhk-.js.map +1 -0
  49. package/dist/chunks/{PointPlotter-BUIse9c4.js → PointPlotter-C_tZb122.js} +2 -2
  50. package/dist/chunks/{PointPlotter-BUIse9c4.js.map → PointPlotter-C_tZb122.js.map} +1 -1
  51. package/dist/chunks/{Powerline-BYWdK8QH.js → Powerline-Cc-Av8Pc.js} +2 -2
  52. package/dist/chunks/{Powerline-BYWdK8QH.js.map → Powerline-Cc-Av8Pc.js.map} +1 -1
  53. package/dist/chunks/Prefs-CRTRAud6.js +300 -0
  54. package/dist/chunks/Prefs-CRTRAud6.js.map +1 -0
  55. package/dist/chunks/Properties-BRrWSBHM.js +648 -0
  56. package/dist/chunks/Properties-BRrWSBHM.js.map +1 -0
  57. package/dist/chunks/RadioGroup-BrtV1Clm.js +49 -0
  58. package/dist/chunks/RadioGroup-BrtV1Clm.js.map +1 -0
  59. package/dist/chunks/RangeSlider-CJfhxDn6.js +52 -0
  60. package/dist/chunks/RangeSlider-CJfhxDn6.js.map +1 -0
  61. package/dist/chunks/{ResizeHandle-BOpmtOOj.js → ResizeHandle-Csz3DPew.js} +8 -8
  62. package/dist/chunks/{ResizeHandle-BOpmtOOj.js.map → ResizeHandle-Csz3DPew.js.map} +1 -1
  63. package/dist/chunks/{Select-CHsuQCp0.js → Select-BYhHGmMl.js} +32 -32
  64. package/dist/chunks/Select-BYhHGmMl.js.map +1 -0
  65. package/dist/chunks/SelectionPanel-D2IYlj_K.js +446 -0
  66. package/dist/chunks/SelectionPanel-D2IYlj_K.js.map +1 -0
  67. package/dist/chunks/{Sidebar-DP_nyJze.js → Sidebar-DrBQZ9nP.js} +1 -1
  68. package/dist/chunks/{Sidebar-DP_nyJze.js.map → Sidebar-DrBQZ9nP.js.map} +1 -1
  69. package/dist/chunks/SidebarPanel-Dbqb79Kx.js +59 -0
  70. package/dist/chunks/SidebarPanel-Dbqb79Kx.js.map +1 -0
  71. package/dist/chunks/Slider-DbOt9Dji.js +257 -0
  72. package/dist/chunks/Slider-DbOt9Dji.js.map +1 -0
  73. package/dist/chunks/{StatusBar-DBO0E0Yd.js → StatusBar-B6lPbvrF.js} +6 -6
  74. package/dist/chunks/StatusBar-B6lPbvrF.js.map +1 -0
  75. package/dist/chunks/Switch-BSr-vaAC.js +27 -0
  76. package/dist/chunks/Switch-BSr-vaAC.js.map +1 -0
  77. package/dist/chunks/Tabs-CIa-Idzu.js +41 -0
  78. package/dist/chunks/Tabs-CIa-Idzu.js.map +1 -0
  79. package/dist/chunks/{Toast-DFw4IrD_.js → Toast-C0UnBqQu.js} +31 -31
  80. package/dist/chunks/{Toast-DFw4IrD_.js.map → Toast-C0UnBqQu.js.map} +1 -1
  81. package/dist/chunks/{ToggleBar-BP1zFcvg.js → ToggleBar-1wDRwSGN.js} +11 -10
  82. package/dist/chunks/ToggleBar-1wDRwSGN.js.map +1 -0
  83. package/dist/chunks/{ToolButton-ClPz5L6j.js → ToolButton-Bd9l_I8f.js} +16 -16
  84. package/dist/chunks/ToolButton-Bd9l_I8f.js.map +1 -0
  85. package/dist/chunks/{ToolGroup-BTIwd4U4.js → ToolGroup-gizXwttA.js} +1 -1
  86. package/dist/chunks/{ToolGroup-BTIwd4U4.js.map → ToolGroup-gizXwttA.js.map} +1 -1
  87. package/dist/chunks/{ToolOptionsBar-JvmY7iNe.js → ToolOptionsBar-CXjeTE1d.js} +4 -4
  88. package/dist/chunks/ToolOptionsBar-CXjeTE1d.js.map +1 -0
  89. package/dist/chunks/{ToolPalette-DAiVhdtV.js → ToolPalette-3YpkSNfj.js} +24 -24
  90. package/dist/chunks/ToolPalette-3YpkSNfj.js.map +1 -0
  91. package/dist/chunks/Tooltip-Di7vxbFa.js +40 -0
  92. package/dist/chunks/Tooltip-Di7vxbFa.js.map +1 -0
  93. package/dist/chunks/dlog-CMYiRF3Q.js +38 -0
  94. package/dist/chunks/dlog-CMYiRF3Q.js.map +1 -0
  95. package/dist/chunks/{keyGlyph-BDH5fqkO.js → keyGlyph-D3X08tSp.js} +1 -1
  96. package/dist/chunks/{keyGlyph-BDH5fqkO.js.map → keyGlyph-D3X08tSp.js.map} +1 -1
  97. package/dist/chunks/number-llMRJPJW.js +18 -0
  98. package/dist/chunks/number-llMRJPJW.js.map +1 -0
  99. package/dist/chunks/segmentedControl.module-YXqIjnmu.js +11 -0
  100. package/dist/chunks/segmentedControl.module-YXqIjnmu.js.map +1 -0
  101. package/dist/chunks/useReorderDragList-RSJqj18B.js +109 -0
  102. package/dist/chunks/useReorderDragList-RSJqj18B.js.map +1 -0
  103. package/dist/chunks/{useRovingTabIndex-DBZtq4IH.js → useRovingTabIndex-CuUl6DLF.js} +1 -1
  104. package/dist/chunks/{useRovingTabIndex-DBZtq4IH.js.map → useRovingTabIndex-CuUl6DLF.js.map} +1 -1
  105. package/dist/components/ActionBar/index.js +1 -1
  106. package/dist/components/ActionsBar/index.js +1 -1
  107. package/dist/components/Badge/Badge.d.ts.map +1 -1
  108. package/dist/components/Badge/index.js +1 -1
  109. package/dist/components/BandEditor/index.js +1 -1
  110. package/dist/components/Button/index.js +1 -1
  111. package/dist/components/Callout/index.js +1 -1
  112. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  113. package/dist/components/Checkbox/index.js +1 -1
  114. package/dist/components/ColorField/ColorField.d.ts.map +1 -1
  115. package/dist/components/ColorField/index.js +1 -1
  116. package/dist/components/ComboBox/index.js +1 -1
  117. package/dist/components/CurveEditor/index.js +1 -1
  118. package/dist/components/DataGrid/index.js +1 -1
  119. package/dist/components/Dialog/index.js +1 -1
  120. package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts +12 -0
  121. package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts.map +1 -0
  122. package/dist/components/DragHandleGlyph/index.d.ts +3 -0
  123. package/dist/components/DragHandleGlyph/index.d.ts.map +1 -0
  124. package/dist/components/DragHandleGlyph/index.js +2 -0
  125. package/dist/components/Field/index.js +1 -1
  126. package/dist/components/GradientEditor/SceneGradientHandles.d.ts +41 -0
  127. package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -0
  128. package/dist/components/GradientEditor/index.d.ts +1 -0
  129. package/dist/components/GradientEditor/index.d.ts.map +1 -1
  130. package/dist/components/GradientEditor/index.js +2 -2
  131. package/dist/components/InlineRange/InlineRange.d.ts +17 -0
  132. package/dist/components/InlineRange/InlineRange.d.ts.map +1 -0
  133. package/dist/components/InlineRange/index.d.ts +2 -0
  134. package/dist/components/InlineRange/index.d.ts.map +1 -0
  135. package/dist/components/InlineRange/index.js +2 -0
  136. package/dist/components/Input/Input.d.ts +1 -1
  137. package/dist/components/Input/index.js +1 -1
  138. package/dist/components/Keycaps/index.js +2 -2
  139. package/dist/components/LayerStack/LayerStack.d.ts +49 -0
  140. package/dist/components/LayerStack/LayerStack.d.ts.map +1 -0
  141. package/dist/components/LayerStack/index.d.ts +2 -0
  142. package/dist/components/LayerStack/index.d.ts.map +1 -0
  143. package/dist/components/LayerStack/index.js +2 -0
  144. package/dist/components/NumberField/NumberField.d.ts +1 -1
  145. package/dist/components/NumberField/index.js +1 -1
  146. package/dist/components/OptionsBar/index.js +1 -1
  147. package/dist/components/PaintInput/PaintInput.d.ts +40 -0
  148. package/dist/components/PaintInput/PaintInput.d.ts.map +1 -0
  149. package/dist/components/PaintInput/index.d.ts +2 -0
  150. package/dist/components/PaintInput/index.d.ts.map +1 -0
  151. package/dist/components/PaintInput/index.js +2 -0
  152. package/dist/components/PatternPicker/PatternPicker.d.ts +31 -0
  153. package/dist/components/PatternPicker/PatternPicker.d.ts.map +1 -0
  154. package/dist/components/PatternPicker/index.d.ts +2 -0
  155. package/dist/components/PatternPicker/index.d.ts.map +1 -0
  156. package/dist/components/PatternPicker/index.js +2 -0
  157. package/dist/components/Plot2D/index.js +1 -1
  158. package/dist/components/PointPlotter/index.js +1 -1
  159. package/dist/components/Powerline/index.js +2 -2
  160. package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
  161. package/dist/components/Prefs/index.d.ts +1 -1
  162. package/dist/components/Prefs/index.d.ts.map +1 -1
  163. package/dist/components/Prefs/index.js +1 -1
  164. package/dist/components/Prefs/schema.d.ts +4 -92
  165. package/dist/components/Prefs/schema.d.ts.map +1 -1
  166. package/dist/components/Properties/CurveField.d.ts +37 -0
  167. package/dist/components/Properties/CurveField.d.ts.map +1 -0
  168. package/dist/components/Properties/EffectCard.d.ts +68 -0
  169. package/dist/components/Properties/EffectCard.d.ts.map +1 -0
  170. package/dist/components/Properties/PropertyGroup.d.ts +24 -0
  171. package/dist/components/Properties/PropertyGroup.d.ts.map +1 -0
  172. package/dist/components/Properties/PropertyPanel.d.ts +181 -0
  173. package/dist/components/Properties/PropertyPanel.d.ts.map +1 -0
  174. package/dist/components/Properties/index.d.ts +9 -0
  175. package/dist/components/Properties/index.d.ts.map +1 -0
  176. package/dist/components/Properties/index.js +2 -0
  177. package/dist/components/Properties/storyLayouts.d.ts +11 -0
  178. package/dist/components/Properties/storyLayouts.d.ts.map +1 -0
  179. package/dist/components/RadioGroup/index.js +1 -1
  180. package/dist/components/RangeSlider/index.js +1 -1
  181. package/dist/components/ResizeHandle/index.js +1 -1
  182. package/dist/components/Select/index.js +1 -1
  183. package/dist/components/SelectionPanel/SelectionPanel.d.ts +32 -1
  184. package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
  185. package/dist/components/SelectionPanel/index.js +1 -1
  186. package/dist/components/Sidebar/index.js +1 -1
  187. package/dist/components/SidebarPanel/index.js +1 -1
  188. package/dist/components/Slider/index.js +1 -1
  189. package/dist/components/StatusBar/index.js +1 -1
  190. package/dist/components/Switch/Switch.d.ts +1 -1
  191. package/dist/components/Switch/index.js +1 -1
  192. package/dist/components/Tabs/index.js +1 -1
  193. package/dist/components/Toast/index.js +1 -1
  194. package/dist/components/ToggleBar/ToggleBar.d.ts +1 -1
  195. package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
  196. package/dist/components/ToggleBar/index.js +1 -1
  197. package/dist/components/ToolButton/index.js +1 -1
  198. package/dist/components/ToolGroup/index.js +1 -1
  199. package/dist/components/ToolOptionsBar/index.js +1 -1
  200. package/dist/components/ToolPalette/index.js +1 -1
  201. package/dist/components/Tooltip/index.js +1 -1
  202. package/dist/components/paintValue.d.ts +8 -0
  203. package/dist/components/paintValue.d.ts.map +1 -0
  204. package/dist/format/number.d.ts +13 -0
  205. package/dist/format/number.d.ts.map +1 -1
  206. package/dist/icons/Icon.d.ts +17 -0
  207. package/dist/icons/Icon.d.ts.map +1 -0
  208. package/dist/icons/index.d.ts +50 -0
  209. package/dist/icons/index.d.ts.map +1 -0
  210. package/dist/icons/paths.d.ts +71 -0
  211. package/dist/icons/paths.d.ts.map +1 -0
  212. package/dist/index.d.ts +9 -1
  213. package/dist/index.d.ts.map +1 -1
  214. package/dist/index.js +190 -48
  215. package/dist/index.js.map +1 -1
  216. package/dist/style.css +1 -1
  217. package/package.json +4 -3
  218. package/dist/chunks/ActionBar-BvPEd_GW.js.map +0 -1
  219. package/dist/chunks/Badge-dQzbkk-C.js.map +0 -1
  220. package/dist/chunks/BandEditor-D3i6l299.js.map +0 -1
  221. package/dist/chunks/Button-9QNIYugK.js.map +0 -1
  222. package/dist/chunks/Callout-cJHJ4kIN.js.map +0 -1
  223. package/dist/chunks/Checkbox-KQ5L8APP.js +0 -47
  224. package/dist/chunks/Checkbox-KQ5L8APP.js.map +0 -1
  225. package/dist/chunks/ColorField-ykpiD3XU.js +0 -60
  226. package/dist/chunks/ColorField-ykpiD3XU.js.map +0 -1
  227. package/dist/chunks/ComboBox-ONQISwtI.js.map +0 -1
  228. package/dist/chunks/DataGrid-DZQ4Chbd.js +0 -210
  229. package/dist/chunks/DataGrid-DZQ4Chbd.js.map +0 -1
  230. package/dist/chunks/Dialog-CqwdJv_t.js +0 -59
  231. package/dist/chunks/Dialog-CqwdJv_t.js.map +0 -1
  232. package/dist/chunks/Field-VQwmrIna.js.map +0 -1
  233. package/dist/chunks/GradientEditor-Bg6SX64V.js +0 -280
  234. package/dist/chunks/GradientEditor-Bg6SX64V.js.map +0 -1
  235. package/dist/chunks/Input-DpkwYtUY.js +0 -55
  236. package/dist/chunks/Input-DpkwYtUY.js.map +0 -1
  237. package/dist/chunks/Keycaps-CFX7UAj8.js.map +0 -1
  238. package/dist/chunks/NumberField-BbzI0GtU.js +0 -59
  239. package/dist/chunks/NumberField-BbzI0GtU.js.map +0 -1
  240. package/dist/chunks/Plot2D-CEnhzodm.js +0 -168
  241. package/dist/chunks/Plot2D-CEnhzodm.js.map +0 -1
  242. package/dist/chunks/Prefs-BMR9wMiZ.js +0 -238
  243. package/dist/chunks/Prefs-BMR9wMiZ.js.map +0 -1
  244. package/dist/chunks/RadioGroup-CIpHr3g6.js +0 -49
  245. package/dist/chunks/RadioGroup-CIpHr3g6.js.map +0 -1
  246. package/dist/chunks/RangeSlider-CaDogGTj.js +0 -52
  247. package/dist/chunks/RangeSlider-CaDogGTj.js.map +0 -1
  248. package/dist/chunks/Select-CHsuQCp0.js.map +0 -1
  249. package/dist/chunks/SelectionPanel-D_wk_8ZN.js +0 -303
  250. package/dist/chunks/SelectionPanel-D_wk_8ZN.js.map +0 -1
  251. package/dist/chunks/SidebarPanel-BVTQ1ZyM.js +0 -59
  252. package/dist/chunks/SidebarPanel-BVTQ1ZyM.js.map +0 -1
  253. package/dist/chunks/Slider-tGbqoAZH.js +0 -259
  254. package/dist/chunks/Slider-tGbqoAZH.js.map +0 -1
  255. package/dist/chunks/StatusBar-DBO0E0Yd.js.map +0 -1
  256. package/dist/chunks/Switch-JyVSSAzC.js +0 -27
  257. package/dist/chunks/Switch-JyVSSAzC.js.map +0 -1
  258. package/dist/chunks/Tabs-Df0sDomx.js +0 -41
  259. package/dist/chunks/Tabs-Df0sDomx.js.map +0 -1
  260. package/dist/chunks/ToggleBar-BP1zFcvg.js.map +0 -1
  261. package/dist/chunks/ToolButton-ClPz5L6j.js.map +0 -1
  262. package/dist/chunks/ToolOptionsBar-JvmY7iNe.js.map +0 -1
  263. package/dist/chunks/ToolPalette-DAiVhdtV.js.map +0 -1
  264. package/dist/chunks/Tooltip-DXJbdR5B.js +0 -40
  265. package/dist/chunks/Tooltip-DXJbdR5B.js.map +0 -1
  266. package/dist/chunks/segmentedControl.module-DCyuDbj1.js +0 -11
  267. package/dist/chunks/segmentedControl.module-DCyuDbj1.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Keycaps-Dk33JOiH.js","names":[],"sources":["../../src/components/Keycaps/Keycaps.module.css","../../src/components/Keycaps/Keycap.tsx","../../src/components/Keycaps/Keycaps.tsx","../../src/components/Keycaps/keySpecsFromMods.ts"],"sourcesContent":["/* Keystroke \"key cap\" styling — each modifier and key in its own bordered chip. */\n.keys {\n display: inline-flex;\n gap: 3px;\n /* Bottom-align so chips with text labels and chips with icon glyphs\n (arrows, modifier symbols) line up at the same bottom edge. Baseline\n drifts because text baselines sit above icon centers. */\n align-items: flex-end;\n /* When this whole sequence sits inline in surrounding text (e.g.\n \"Press <KeySequence> to confirm.\"), the row anchors to the\n surrounding line's bottom edge, not its baseline. */\n vertical-align: bottom;\n flex-wrap: wrap;\n}\n\n.keysEmpty {\n color: var(--wzl-fg-muted);\n}\n\n.sep {\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-sm);\n line-height: 1;\n}\n\n.key {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 18px;\n padding: 0 4px;\n /* Light face, slightly-darker-than-face border, dark glyph — reads as\n a real keycap rather than a recessed slot in the panel. */\n background: var(--wzl-fg, #e6e7e9);\n border: 1px solid #25272c;\n border-bottom-width: 2px;\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-surface);\n /* Keycaps are a deliberate exception to the site theme — the design-\n system UI font (often a display face like Oswald) is wrong for\n keyboard chips. Use a neutral sans stack so labels read like real\n key legends. Consumers wanting a specific face per chip pass the\n `font` prop on KeyCap. */\n font-family: ui-sans-serif, system-ui, sans-serif;\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-bold);\n line-height: 1;\n}\n\n/* Default chip is square — letters, digits, and single glyphs (⎋ ⌫ ↑ etc.)\n sit in a uniform key-cap box. */\n.key[data-kind='square'] {\n width: 18px;\n padding: 0;\n}\n\n/* Modifiers (⌘ ⇪ ⌥ ⌃) are wider to match the visual weight of how they\n appear on a real keyboard — and to differentiate them from the keys\n they modify in a stack. */\n.key[data-kind='modifier'] {\n min-width: 26px;\n padding: 0 6px;\n}\n\n/* Tab / Enter / Space — actual wide keys on a real keyboard. */\n.key[data-kind='wide'] {\n min-width: 32px;\n padding: 0 8px;\n}\n\n/* Optional/inverted (default variant): face flips to dark; legend drops\n to 60% opacity; dotted border drops to 40% opacity. Three soft cues\n stacked for \"may be held but isn't required.\" */\n.key[data-inverted] {\n background: var(--wzl-surface);\n color: color-mix(in srgb, var(--wzl-fg, #e6e7e9) 60%, transparent);\n border-style: dotted;\n border-color: color-mix(in srgb, var(--wzl-fg, #e6e7e9) 40%, transparent);\n border-width: 1.5px;\n border-bottom-width: 1.5px;\n}\n\n/* Minimal variant — no fill, borders and legend follow currentColor.\n Useful inline in colored prose / next to colored badges where the\n chip should take the surrounding text color. */\n.key[data-variant='minimal'] {\n background: transparent;\n border-color: currentColor;\n color: currentColor;\n}\n\n/* Optional + minimal: dotted border at full currentColor, legend at full\n currentColor. The dotted pattern alone carries the \"optional\" cue here\n — minimal's whole point is to defer color to the surrounding context,\n so dimming would fight that. (Default variant uses graded opacity as a\n stacked cue; minimal keeps it crisp.) */\n.key[data-variant='minimal'][data-inverted] {\n border-style: dotted;\n border-color: currentColor;\n color: currentColor;\n border-width: 1.5px;\n border-bottom-width: 1.5px;\n}\n","import type { CSSProperties } from 'react';\nimport s from './Keycaps.module.css';\n\nconst MODIFIER_GLYPHS = new Set(['⌘', '⇪', '⌥', '⌃', '⇧']);\nconst WIDE_GLYPHS = new Set(['⇥', '↵', '␣']);\n\n/**\n * Width class of a keycap: a modifier glyph, a multi-character legend that\n * needs a wider chip, or a single character in a square one.\n */\nexport type KeycapKind = 'modifier' | 'wide' | 'square';\n\n/**\n * Picks the chip width for a legend — modifier glyphs and anything longer\n * than one character get the wider forms.\n */\nexport function inferKeycapKind(label: string): KeycapKind {\n if (MODIFIER_GLYPHS.has(label)) return 'modifier';\n if (WIDE_GLYPHS.has(label)) return 'wide';\n if (label.length > 1) return 'wide';\n return 'square';\n}\n\n/** Visual style of a keycap chip. */\nexport type KeyCapVariant = 'default' | 'minimal';\n\n/** Props for {@link KeyCap}. */\nexport interface KeyCapProps {\n /** Glyph rendered in the chip (modifier or key). */\n label: string;\n /** Marks the chip as not required to trigger the action. In the default\n * variant the chip face inverts (dark face / light glyph) for\n * emphasis. In the `'minimal'` variant the chip's border becomes\n * dotted to read as \"may be held, but isn't required.\" */\n inverted?: boolean;\n /** Visual style. `'default'` (default) renders a filled chip; `'minimal'`\n * renders an unfilled chip whose border and legend are `currentColor`\n * — useful inline in colored prose / next to colored badges where the\n * chip should take the surrounding text color. */\n variant?: KeyCapVariant;\n className?: string;\n /** Optional inline style. Useful for one-off width overrides (e.g.\n * building a keyboard-layout where the space bar spans several\n * standard-key widths). The component sets no inline styles of its\n * own — everything else comes from the CSS module. */\n style?: CSSProperties;\n /** Override the chip's font-family. Accepts any CSS font-family\n * string. When omitted, the chip inherits from the design-system\n * UI font token (`--wzl-font-ui`). Useful for one-off cases where\n * a different face is desired — though the canonical move is to\n * override the CSS variable at the consumer's scope, not the prop. */\n font?: string;\n}\n\n/** Single bordered keycap chip for one glyph (modifier or key). Use\n * `KeySequence` to render a full shortcut. */\nexport function KeyCap({ label, inverted = false, variant = 'default', className, style, font }: KeyCapProps) {\n const resolvedStyle = font ? { ...style, fontFamily: font } : style;\n return (\n <kbd\n className={[s.key, className].filter(Boolean).join(' ')}\n data-kind={inferKeycapKind(label)}\n data-variant={variant === 'default' ? undefined : variant}\n data-inverted={inverted || undefined}\n style={resolvedStyle}\n >\n {label}\n </kbd>\n );\n}\n","import { Fragment } from 'react';\nimport s from './Keycaps.module.css';\nimport { KeyCap, inferKeycapKind, type KeyCapVariant } from './Keycap';\n\n/** One key in a shortcut. */\nexport interface KeySpec {\n /** Glyph rendered in the chip (modifier or key). */\n label: string;\n /** When true, the chip renders inverted to mark it as not required to\n * trigger the action (e.g. an optional modifier). Defaults to false. */\n optional?: boolean;\n}\n\n/** Props for {@link KeySequence}. */\nexport interface KeySequenceProps {\n /** Keys to render. `undefined` or empty renders a muted em-dash.\n * Modifiers are always rendered first regardless of input order; relative\n * order within each group is preserved. */\n keys: readonly KeySpec[] | undefined;\n /** Character inserted between the trailing modifier chip and the first\n * non-modifier chip (e.g. `'+'` renders `⌘ + K`). `null` or `''`\n * suppresses it. Defaults to `'+'`. */\n separator?: string | null;\n /** Forwarded to every `KeyCap` in the sequence. `'minimal'` renders\n * unfilled chips whose border + legend are `currentColor`. */\n variant?: KeyCapVariant;\n /** Forwarded to every `KeyCap` in the sequence. Overrides the design-\n * system UI font for that chip only. */\n font?: string;\n className?: string;\n}\n\n/** Renders a shortcut as a row of `KeyCap` chips, one per key. Optional\n * keys render inverted to distinguish them from required ones. */\nexport function KeySequence({ keys, separator = '+', variant = 'default', font, className }: KeySequenceProps) {\n if (!keys || keys.length === 0) {\n return <span className={[s.keysEmpty, className].filter(Boolean).join(' ')}>—</span>;\n }\n const ordered = keys\n .map((k, i) => ({ k, i }))\n .sort((a, b) => {\n const am = inferKeycapKind(a.k.label) === 'modifier' ? 0 : 1;\n const bm = inferKeycapKind(b.k.label) === 'modifier' ? 0 : 1;\n return am - bm || a.i - b.i;\n })\n .map(({ k }) => k);\n const sepIdx = ordered.findIndex((k) => inferKeycapKind(k.label) !== 'modifier');\n const showSep = !!separator && sepIdx > 0 && sepIdx < ordered.length;\n return (\n <span className={[s.keys, className].filter(Boolean).join(' ')}>\n {ordered.map((k, i) => (\n <Fragment key={i}>\n {showSep && i === sepIdx ? <span className={s.sep}>{separator}</span> : null}\n <KeyCap label={k.label} inverted={k.optional ?? false} variant={variant} font={font} />\n </Fragment>\n ))}\n </span>\n );\n}\n","import type { KeySpec } from './Keycaps';\n\n/** Logical modifier name. Matches the kit's `ModifierKey` in shape — kept as a\n * local type so `weasel-ui` stays independent of `@weasel-js/core`. */\nexport type LogicalMod = 'mod' | 'shift' | 'alt' | 'ctrl' | 'meta';\n\n/** Detected (or overridden) platform. `'mod'` resolves to ⌘ on macOS,\n * Ctrl on Windows / Linux. */\nexport type Platform = 'macos' | 'windows' | 'linux';\n\n/** Visual form of a modifier or named-key label.\n *\n * - `'auto'` (default): the per-entry, per-platform default — whatever\n * label is actually printed on the physical key. macOS keys show the\n * Apple glyphs (⌘ ⌥ ⌃ ⇧ ⎋ ↵ ⇥). Windows keys mostly show text\n * (Ctrl, Alt, Shift) BUT the Win key shows its logo (⊞) and the\n * context-menu key shows ▤. Linux mirrors Windows with Super (⊞).\n * - `'symbol'` forces the Apple-style glyph everywhere a symbolic form\n * exists. Entries without a widely-recognized symbol still fall\n * back to text.\n * - `'text'` always spells the label out (Cmd / Option / Esc / Enter). */\nexport type LegendStyle = 'auto' | 'symbol' | 'text';\n\n/** A modifier to render, named platform-independently. */\nexport interface LogicalModSpec {\n name: LogicalMod;\n /** Marks this modifier as optional (may be held but isn't required).\n * Forwarded as the resulting `KeySpec.optional`. */\n optional?: boolean;\n}\n\n/** Options for {@link keySpecsFromMods}. */\nexport interface KeySpecsFromModsOptions {\n /** Override OS detection. Defaults to the detected platform, or\n * `'macos'` when detection is unavailable (e.g. in tests, or when\n * `navigator` is missing). */\n platform?: Platform;\n /** Defaults to `'auto'` (symbol on macOS, text everywhere else). Pass\n * `'symbol'` or `'text'` to force a specific style regardless of\n * platform. */\n legend?: LegendStyle;\n}\n\nconst MOD_BY_PLATFORM: Record<LogicalMod, Record<Platform, Record<LegendStyle, string>>> = {\n mod: {\n macos: { auto: '⌘', symbol: '⌘', text: 'Cmd' },\n windows: { auto: 'Ctrl', symbol: 'Ctrl', text: 'Ctrl' },\n linux: { auto: 'Ctrl', symbol: 'Ctrl', text: 'Ctrl' },\n },\n shift: {\n macos: { auto: '⇧', symbol: '⇧', text: 'Shift' },\n windows: { auto: '⇧', symbol: '⇧', text: 'Shift' },\n linux: { auto: '⇧', symbol: '⇧', text: 'Shift' },\n },\n alt: {\n macos: { auto: '⌥', symbol: '⌥', text: 'Option' },\n windows: { auto: 'Alt', symbol: 'Alt', text: 'Alt' },\n linux: { auto: 'Alt', symbol: 'Alt', text: 'Alt' },\n },\n ctrl: {\n macos: { auto: '⌃', symbol: '⌃', text: 'Control' },\n windows: { auto: 'Ctrl', symbol: 'Ctrl', text: 'Ctrl' },\n linux: { auto: 'Ctrl', symbol: 'Ctrl', text: 'Ctrl' },\n },\n // Windows/Linux Meta has a recognized symbol on the physical key (⊞ Win\n // logo / Super logo), so `auto` shows it. Use `text` for Win / Super.\n meta: {\n macos: { auto: '⌘', symbol: '⌘', text: 'Cmd' },\n windows: { auto: '⊞', symbol: '⊞', text: 'Win' },\n linux: { auto: '⊞', symbol: '⊞', text: 'Super' },\n },\n};\n\n/** Detect the user's OS from the browser environment. UA sniffing — not\n * 100% reliable, but adequate for picking a modifier-glyph convention.\n * Falls back to `'macos'` (matches the kit's docs convention) when\n * `navigator` is unavailable. */\nexport function detectPlatform(): Platform {\n if (typeof navigator === 'undefined') return 'macos';\n // Prefer the modern userAgentData when available (Chromium-only today).\n const uaData = (navigator as Navigator & { userAgentData?: { platform?: string } }).userAgentData;\n const raw = (uaData?.platform ?? navigator.userAgent ?? '').toLowerCase();\n if (raw.includes('mac') || raw.includes('darwin') || raw.includes('iphone') || raw.includes('ipad')) return 'macos';\n if (raw.includes('win')) return 'windows';\n if (raw.includes('linux') || raw.includes('x11')) return 'linux';\n return 'macos';\n}\n\n/**\n * Map a list of **logical** modifiers (`'mod'`, `'shift'`, …) to **visual**\n * `KeySpec`s appropriate for the current platform.\n *\n * The kit-side gesture grammar uses logical names so the same route reads\n * correctly on every OS — `'mod'` means \"Cmd on Mac, Ctrl on Win/Linux\".\n * `KeySequence` is purely visual and renders the labels you give it; this\n * helper is the bridge.\n *\n * ```ts\n * <KeySequence\n * keys={keySpecsFromMods([{ name: 'mod' }, { name: 'shift', optional: true }])}\n * />\n * ```\n *\n * On a Mac: renders `⌘ ⇧`. On Windows: renders `Ctrl Shift`. Pass an\n * explicit `platform` to override detection (e.g. for docs that always\n * show the macOS form). Pass `legend: 'text'` to force \"Cmd\" over \"⌘\"\n * even on macOS.\n */\nexport function keySpecsFromMods(\n mods: readonly LogicalModSpec[],\n opts: KeySpecsFromModsOptions = {},\n): readonly KeySpec[] {\n const platform = opts.platform ?? detectPlatform();\n const legend = opts.legend ?? 'auto';\n return mods.map((m) => {\n const label = MOD_BY_PLATFORM[m.name][platform][legend];\n return m.optional ? { label, optional: true } : { label };\n });\n}\n\n/** Per-platform × per-legend table for named, non-modifier keys. `auto`\n * is whatever's printed on the physical key for that platform. Arrows\n * are universal symbols on every platform. */\nconst NAMED_KEY: Record<string, Record<Platform, Record<LegendStyle, string>>> = {\n Escape: { macos: { auto: '⎋', symbol: '⎋', text: 'Esc' }, windows: { auto: 'Esc', symbol: 'Esc', text: 'Esc' }, linux: { auto: 'Esc', symbol: 'Esc', text: 'Esc' } },\n Enter: { macos: { auto: '↵', symbol: '↵', text: 'Return' }, windows: { auto: 'Enter', symbol: 'Enter', text: 'Enter' }, linux: { auto: 'Enter', symbol: 'Enter', text: 'Enter' } },\n Return: { macos: { auto: '↵', symbol: '↵', text: 'Return' }, windows: { auto: 'Enter', symbol: 'Enter', text: 'Enter' }, linux: { auto: 'Enter', symbol: 'Enter', text: 'Enter' } },\n Tab: { macos: { auto: '⇥', symbol: '⇥', text: 'Tab' }, windows: { auto: 'Tab', symbol: 'Tab', text: 'Tab' }, linux: { auto: 'Tab', symbol: 'Tab', text: 'Tab' } },\n Space: { macos: { auto: '␣', symbol: '␣', text: 'Space' }, windows: { auto: 'Space', symbol: 'Space', text: 'Space' }, linux: { auto: 'Space', symbol: 'Space', text: 'Space' } },\n ' ': { macos: { auto: '␣', symbol: '␣', text: 'Space' }, windows: { auto: 'Space', symbol: 'Space', text: 'Space' }, linux: { auto: 'Space', symbol: 'Space', text: 'Space' } },\n Backspace: { macos: { auto: '⌫', symbol: '⌫', text: 'Backspace' }, windows: { auto: 'Backspace', symbol: 'Backspace', text: 'Backspace' }, linux: { auto: 'Backspace', symbol: 'Backspace', text: 'Backspace' } },\n Delete: { macos: { auto: '⌦', symbol: '⌦', text: 'Delete' }, windows: { auto: 'Delete', symbol: 'Delete', text: 'Delete' }, linux: { auto: 'Delete', symbol: 'Delete', text: 'Delete' } },\n // Context-menu key (the right-Ctrl-area key on Windows / Linux keyboards\n // with a ▤ icon). Mac has no equivalent; falls back to text 'Menu'.\n ContextMenu: { macos: { auto: 'Menu', symbol: 'Menu', text: 'Menu' }, windows: { auto: '▤', symbol: '▤', text: 'Menu' }, linux: { auto: '▤', symbol: '▤', text: 'Menu' } },\n ArrowUp: { macos: { auto: '↑', symbol: '↑', text: '↑' }, windows: { auto: '↑', symbol: '↑', text: '↑' }, linux: { auto: '↑', symbol: '↑', text: '↑' } },\n ArrowDown: { macos: { auto: '↓', symbol: '↓', text: '↓' }, windows: { auto: '↓', symbol: '↓', text: '↓' }, linux: { auto: '↓', symbol: '↓', text: '↓' } },\n ArrowLeft: { macos: { auto: '←', symbol: '←', text: '←' }, windows: { auto: '←', symbol: '←', text: '←' }, linux: { auto: '←', symbol: '←', text: '←' } },\n ArrowRight: { macos: { auto: '→', symbol: '→', text: '→' }, windows: { auto: '→', symbol: '→', text: '→' }, linux: { auto: '→', symbol: '→', text: '→' } },\n};\n\n/**\n * Render a raw `KeyboardEvent.key` value as a platform-appropriate\n * `KeySpec`. Named non-modifier keys (Esc, Enter, Tab, Space, Backspace,\n * Delete, arrows) get the platform's conventional form. Letter / digit /\n * other keys pass through upper-cased.\n *\n * ```ts\n * keySpecFromKey('Escape', { platform: 'macos' }) // { label: '⎋' }\n * keySpecFromKey('Escape', { platform: 'windows' }) // { label: 'Esc' }\n * keySpecFromKey('p') // { label: 'P' }\n * ```\n *\n * Symbol mode is only meaningful on macOS — Windows / Linux keyboards\n * print the text form on the physical key, so symbol mode there falls\n * back to text.\n */\nexport function keySpecFromKey(\n raw: string,\n opts: KeySpecsFromModsOptions & { optional?: boolean } = {},\n): KeySpec {\n const platform = opts.platform ?? detectPlatform();\n const legend = opts.legend ?? 'auto';\n const entry = NAMED_KEY[raw];\n const label = entry ? entry[platform][legend] : raw.length === 1 ? raw.toUpperCase() : raw;\n return opts.optional ? { label, optional: true } : { label };\n}\n"],"mappings":";;;;;;;GCGM,IAAkB,IAAI,IAAI;CAAC;CAAK;CAAK;CAAK;CAAK;CAAI,CAAC,EACpD,IAAc,IAAI,IAAI;CAAC;CAAK;CAAK;CAAI,CAAC;AAY5C,SAAgB,EAAgB,GAA2B;AAIzD,QAHI,EAAgB,IAAI,EAAM,GAAS,aACnC,EAAY,IAAI,EAAM,IACtB,EAAM,SAAS,IAAU,SACtB;;AAoCT,SAAgB,EAAO,EAAE,UAAO,cAAW,IAAO,aAAU,WAAW,cAAW,UAAO,WAAqB;CAC5G,IAAM,IAAgB,IAAO;EAAE,GAAG;EAAO,YAAY;EAAM,GAAG;AAC9D,QACE,kBAAC,OAAD;EACE,WAAW,CAAC,EAAE,KAAK,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EACvD,aAAW,EAAgB,EAAM;EACjC,gBAAc,MAAY,YAAY,KAAA,IAAY;EAClD,iBAAe,KAAY,KAAA;EAC3B,OAAO;YAEN;EACG,CAAA;;;;ACjCV,SAAgB,EAAY,EAAE,SAAM,eAAY,KAAK,aAAU,WAAW,SAAM,gBAA+B;AAC7G,KAAI,CAAC,KAAQ,EAAK,WAAW,EAC3B,QAAO,kBAAC,QAAD;EAAM,WAAW,CAAC,EAAE,WAAW,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAAE;EAAQ,CAAA;CAEtF,IAAM,IAAU,EACb,KAAK,GAAG,OAAO;EAAE;EAAG;EAAG,EAAE,CACzB,MAAM,GAAG,OACG,EAAgB,EAAE,EAAE,MAAM,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} from "./useReorderDragList-RSJqj18B.js";
3
+ import { t as n } from "./DragHandleGlyph-CJbzRigu.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_17awo_4",
8
+ head: "_head_17awo_14",
9
+ title: "_title_17awo_21",
10
+ palette: "_palette_17awo_29",
11
+ add: "_add_17awo_34",
12
+ list: "_list_17awo_51",
13
+ dropHint: "_dropHint_17awo_56",
14
+ empty: "_empty_17awo_62",
15
+ card: "_card_17awo_69",
16
+ cardAccented: "_cardAccented_17awo_76",
17
+ cardDragging: "_cardDragging_17awo_84",
18
+ cardHead: "_cardHead_17awo_88",
19
+ handle: "_handle_17awo_95",
20
+ kind: "_kind_17awo_121",
21
+ primary: "_primary_17awo_122",
22
+ remove: "_remove_17awo_136",
23
+ cardBody: "_cardBody_17awo_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, hideHead: _ }) {
28
+ let [v, y] = o(() => new Set(u.filter((e) => e.defaultExpanded !== !1).map((e) => e.id)));
29
+ a(() => {
30
+ y((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 b = t({
37
+ items: u.map((e) => ({
38
+ id: String(e.id),
39
+ label: e.kind
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
+ }), x = (e) => {
51
+ y((t) => {
52
+ let n = new Set(t);
53
+ return n.has(e) ? n.delete(e) : n.add(e), n;
54
+ });
55
+ };
56
+ return /* @__PURE__ */ i("div", {
57
+ className: c ? `${s.stack} ${c}` : s.stack,
58
+ children: [!_ && /* @__PURE__ */ i("div", {
59
+ className: s.head,
60
+ children: [/* @__PURE__ */ r("h2", {
61
+ className: s.title,
62
+ children: l
63
+ }), /* @__PURE__ */ r("div", {
64
+ className: s.palette,
65
+ children: d.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: b.containerProps.ref,
78
+ onPointerMove: b.containerProps.onPointerMove,
79
+ onPointerUp: b.containerProps.onPointerUp,
80
+ onPointerCancel: b.containerProps.onPointerCancel,
81
+ children: [u.map((e, t) => {
82
+ let a = v.has(e.id), o = b.state.draggedIds?.[0], c = o === String(e.id), l = b.state.targetIndex === t && o !== String(e.id), d = b.state.targetIndex === u.length && t === u.length - 1, f = [
83
+ s.card,
84
+ c ? s.cardDragging : "",
85
+ e.accent ? s.cardAccented : ""
86
+ ].filter(Boolean).join(" "), m = e.accent ? { "--wzl-layer-stack-accent": e.accent } : void 0, { onPointerDown: _ } = b.rowProps(String(e.id), t);
87
+ return /* @__PURE__ */ i("div", { children: [
88
+ l && /* @__PURE__ */ r("div", { className: s.dropHint }),
89
+ /* @__PURE__ */ i("div", {
90
+ className: f,
91
+ "data-testid": `layer-card-${e.id}`,
92
+ style: m,
93
+ children: [/* @__PURE__ */ i("div", {
94
+ className: s.cardHead,
95
+ children: [
96
+ /* @__PURE__ */ r("button", {
97
+ type: "button",
98
+ className: s.handle,
99
+ "aria-label": `Drag to reorder layer ${e.id}`,
100
+ onPointerDown: _,
101
+ onClick: () => x(e.id),
102
+ children: e.badge ?? /* @__PURE__ */ r(n, {})
103
+ }),
104
+ e.primaryValue !== void 0 && e.primaryOptions ? /* @__PURE__ */ r("select", {
105
+ className: s.primary,
106
+ value: e.primaryValue,
107
+ "aria-label": `Primary select for layer ${e.id}`,
108
+ onChange: (t) => h(e.id, t.target.value),
109
+ onClick: (e) => e.stopPropagation(),
110
+ children: e.primaryOptions.map((e) => /* @__PURE__ */ r("option", {
111
+ value: e,
112
+ children: e
113
+ }, e))
114
+ }) : /* @__PURE__ */ r("span", {
115
+ className: s.kind,
116
+ children: e.kind
117
+ }),
118
+ /* @__PURE__ */ r("button", {
119
+ type: "button",
120
+ className: s.remove,
121
+ "aria-label": "Remove layer",
122
+ onClick: (t) => {
123
+ t.stopPropagation(), p(e.id);
124
+ },
125
+ children: "✕"
126
+ })
127
+ ]
128
+ }), a && /* @__PURE__ */ r("div", {
129
+ className: s.cardBody,
130
+ children: g(e)
131
+ })]
132
+ }),
133
+ d && /* @__PURE__ */ r("div", { className: s.dropHint })
134
+ ] }, e.id);
135
+ }), u.length === 0 && /* @__PURE__ */ r("div", {
136
+ className: s.empty,
137
+ children: "No layers — add one above."
138
+ })]
139
+ })]
140
+ });
141
+ }
142
+ //#endregion
143
+ export { c as t };
144
+
145
+ //# sourceMappingURL=LayerStack-DQYvGNPA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayerStack-DQYvGNPA.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: 8px;\n}\n\n.head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\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: 4px;\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: 2px 8px;\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: 6px;\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: 8px;\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: 6px;\n padding: 6px 8px;\n}\n\n.handle {\n font: inherit;\n background: transparent;\n border: 0;\n color: var(--wzl-fg-subtle);\n padding: 2px 4px;\n cursor: grab;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 22px;\n height: 22px;\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: 2px 6px;\n}\n\n.remove:hover {\n color: var(--wzl-fg);\n}\n\n.cardBody {\n padding: 8px;\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\"). */\n kind: 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 title: string;\n items: LayerStackItem[];\n /** Kinds the user can add via the header palette. */\n paletteKinds: string[];\n onAdd: (kind: string) => void;\n onRemove: (id: number | string) => void;\n onReorder: (orderedIds: Array<number | string>) => void;\n onPrimaryChange: (id: number | string, nextValue: string) => void;\n /** Render the body controls for each item. */\n renderBody: (item: LayerStackItem) => 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 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) => ({ id: String(it.id), label: it.kind }));\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 return (\n <div className={className ? `${s.stack} ${className}` : s.stack}>\n {!hideHead && (\n <div className={s.head}>\n <h2 className={s.title}>{title}</h2>\n <div className={s.palette}>\n {paletteKinds.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 onPointerMove={drag.containerProps.onPointerMove}\n onPointerUp={drag.containerProps.onPointerUp}\n onPointerCancel={drag.containerProps.onPointerCancel}\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 ? (\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.kind}</span>\n )}\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 </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}>No layers — add one above.</div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;ACsDA,SAAgB,EAAW,EACzB,cACA,UACA,UACA,iBACA,UACA,aACA,cACA,oBACA,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;CAGX,IAAM,IAAO,EAAmB;EAC9B,OAFgB,EAAM,KAAK,OAAQ;GAAE,IAAI,OAAO,EAAG,GAAG;GAAE,OAAO,EAAG;GAAM,EAEjE;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,MAAO,EAAO,IAAI,OAAO,EAAG,CAAC,CAAC,EAKxE,IAAW,IADH,EAAK,QAAQ,GAAI,MAAQ,EAAO,IAAI,OAAO,EAAG,CAAC,IAAI,IAAM,EAAY,CA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AAW,KAChB,kBAAC,OAAD;IAAK,WAAW,EAAE;cAAO;IAAgC,CAAA,CAEvD;KACF"}
@@ -0,0 +1,59 @@
1
+ import { n as e } from "./Field-DrRby9vo.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { forwardRef as r } from "react";
4
+ import { Button as i, FieldError as a, Group as o, Input as s, Label as c, NumberField as l, Text as u } from "react-aria-components";
5
+ var d = {
6
+ field: "_field_1o8zh_1",
7
+ frame: "_frame_1o8zh_9",
8
+ steppers: "_steppers_1o8zh_57",
9
+ stepper: "_stepper_1o8zh_57"
10
+ }, f = r(function(r, f) {
11
+ let { label: p, description: m, errorMessage: h, hideSteppers: g, placeholder: _, className: v, ...y } = r;
12
+ return /* @__PURE__ */ n(l, {
13
+ ...y,
14
+ className: [
15
+ d.field,
16
+ e.root,
17
+ v
18
+ ].filter(Boolean).join(" "),
19
+ children: [
20
+ p !== void 0 && /* @__PURE__ */ t(c, {
21
+ className: e.label,
22
+ children: p
23
+ }),
24
+ /* @__PURE__ */ n(o, {
25
+ className: d.frame,
26
+ children: [/* @__PURE__ */ t(s, {
27
+ ref: f,
28
+ placeholder: _
29
+ }), !g && /* @__PURE__ */ n("div", {
30
+ className: d.steppers,
31
+ children: [/* @__PURE__ */ t(i, {
32
+ slot: "increment",
33
+ className: d.stepper,
34
+ "aria-label": "Increment",
35
+ children: "▲"
36
+ }), /* @__PURE__ */ t(i, {
37
+ slot: "decrement",
38
+ className: d.stepper,
39
+ "aria-label": "Decrement",
40
+ children: "▼"
41
+ })]
42
+ })]
43
+ }),
44
+ m !== void 0 && /* @__PURE__ */ t(u, {
45
+ slot: "description",
46
+ className: e.hint,
47
+ children: m
48
+ }),
49
+ /* @__PURE__ */ t(a, {
50
+ className: e.error,
51
+ children: h
52
+ })
53
+ ]
54
+ });
55
+ });
56
+ //#endregion
57
+ export { f as t };
58
+
59
+ //# sourceMappingURL=NumberField-BQ-KaK7T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberField-BQ-KaK7T.js","names":[],"sources":["../../src/components/NumberField/NumberField.module.css","../../src/components/NumberField/NumberField.tsx"],"sourcesContent":[".field {\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 0;\n gap: 4px;\n}\n\n.frame {\n display: flex;\n align-items: stretch;\n height: 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 8px;\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: 18px;\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","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 /** Native input placeholder — e.g. `'Mixed'` for a multi-selection\n * editor with no shared value. */\n placeholder?: string;\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 { label, description, errorMessage, hideSteppers, placeholder, className, ...rest } = props;\n return (\n <RACNumberField\n {...rest}\n className={[s.field, fieldClasses.root, className].filter(Boolean).join(' ')}\n >\n {label !== undefined && <Label className={fieldClasses.label}>{label}</Label>}\n <Group className={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"],"mappings":";;;;;;;;;GCoCa,IAAc,EAAW,SACpC,GACA,GACA;CACA,IAAM,EAAE,UAAO,gBAAa,iBAAc,iBAAc,gBAAa,cAAW,GAAG,MAAS;AAC5F,QACE,kBAAC,GAAD;EACE,GAAI;EACJ,WAAW;GAAC,EAAE;GAAO,EAAa;GAAM;GAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAF9E;GAIG,MAAU,KAAA,KAAa,kBAAC,GAAD;IAAO,WAAW,EAAa;cAAQ;IAAc,CAAA;GAC7E,kBAAC,GAAD;IAAO,WAAW,EAAE;cAApB,CACE,kBAAC,GAAD;KAAe;KAAkB;KAAe,CAAA,EAC/C,CAAC,KACA,kBAAC,OAAD;KAAK,WAAW,EAAE;eAAlB,CACE,kBAAC,GAAD;MAAW,MAAK;MAAY,WAAW,EAAE;MAAS,cAAW;gBAAY;MAAa,CAAA,EACtF,kBAAC,GAAD;MAAW,MAAK;MAAY,WAAW,EAAE;MAAS,cAAW;gBAAY;MAAa,CAAA,CAClF;OAEF;;GACP,MAAgB,KAAA,KACf,kBAAC,GAAD;IAAM,MAAK;IAAc,WAAW,EAAa;cAC9C;IACI,CAAA;GAET,kBAAC,GAAD;IAAY,WAAW,EAAa;cAAQ;IAA0B,CAAA;GACvD;;EAEnB"}
@@ -1,7 +1,7 @@
1
- import { t as e } from "./useRovingTabIndex-DBZtq4IH.js";
2
- import { t } from "./segmentedControl.module-DCyuDbj1.js";
3
- import "react";
1
+ import { t as e } from "./useRovingTabIndex-CuUl6DLF.js";
2
+ import { t } from "./segmentedControl.module-YXqIjnmu.js";
4
3
  import { jsx as n } from "react/jsx-runtime";
4
+ import "react";
5
5
  //#region src/components/OptionsBar/OptionsBar.tsx
6
6
  function r(r) {
7
7
  let { items: i, ariaLabel: a, className: o, height: s, size: c, variant: l } = r, u = (e) => {
@@ -42,4 +42,4 @@ function r(r) {
42
42
  //#endregion
43
43
  export { r as t };
44
44
 
45
- //# sourceMappingURL=OptionsBar-CHvH4n4u.js.map
45
+ //# sourceMappingURL=OptionsBar-BecAPCID.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OptionsBar-CHvH4n4u.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
+ {"version":3,"file":"OptionsBar-BecAPCID.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"}
@@ -0,0 +1,205 @@
1
+ import { t as e } from "./ToggleBar-1wDRwSGN.js";
2
+ import { t } from "./ColorField-CSSRv3jG.js";
3
+ import { r as n } from "./GradientEditor-BuVR6pt-.js";
4
+ import { t as r } from "./PatternPicker-BdLSj_f_.js";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { getPaintKind as o, listPaintKinds as s, withGradientKind as c } from "@weasel-js/core";
7
+ import { useCallback as l, useRef as u } from "react";
8
+ //#region src/icons/paths.ts
9
+ var d = {
10
+ clone: "<path d=\"M7 7.4V4.6A1.6 1.6 0 0 1 8.6 3h6.8A1.6 1.6 0 0 1 17 4.6v6.8a1.6 1.6 0 0 1-1.6 1.6H12.6\" stroke-linecap=\"butt\"/><rect x=\"3\" y=\"7\" width=\"10\" height=\"10\" rx=\"1.6\"/><path d=\"M5.7 10.8h4.6M5.7 13.4h3\" stroke-width=\"1\"/>",
11
+ reset: "<path d=\"M7.28 4.88A5.8 5.8 0 1 0 12.72 4.88\"/><path d=\"M13.81 7.57 12.72 4.88 15.56 4.28\"/>",
12
+ close: "<path d=\"M5 5 15 15M15 5 5 15\" stroke-width=\"1.75\"/>",
13
+ export: "<path d=\"M4 12.6v2.9A1.5 1.5 0 0 0 5.5 17h9a1.5 1.5 0 0 0 1.5-1.5v-2.9\"/><path d=\"M10 3.2v8.5\"/><path d=\"M11.7 9.35 10 11.7 8.3 9.35\"/><path d=\"M6.8 14.7h6.4\" stroke-width=\"1\"/>",
14
+ zoomIn: "<circle cx=\"9\" cy=\"9\" r=\"5.4\"/><path d=\"M12.82 12.82 16.9 16.9\"/><path d=\"M9 6.7v4.6M6.7 9h4.6\"/>",
15
+ pan: "<path d=\"M10 8.1V3.2M10 11.9V16.8M8.1 10H3.2M11.9 10H16.8\"/><path d=\"M8.26 5.27 10 3.2 11.74 5.27M11.74 14.73 10 16.8 8.26 14.73M5.27 11.74 3.2 10 5.27 8.26M14.73 8.26 16.8 10 14.73 11.74\"/><circle cx=\"10\" cy=\"10\" r=\"1.9\"/>",
16
+ add: "<path d=\"M10 4.9v10.2M4.9 10h10.2\"/>",
17
+ remove: "<path d=\"M4.9 10h10.2\"/>",
18
+ delete: "<path d=\"M3.6 5.8h12.8M8 5.8V4.5A1.1 1.1 0 0 1 9.1 3.4h1.8A1.1 1.1 0 0 1 12 4.5v1.3\"/><path d=\"M5.2 5.8v9.6A1.6 1.6 0 0 0 6.8 17h6.4a1.6 1.6 0 0 0 1.6-1.6V5.8\"/><path d=\"M8.4 8.8v5.2M11.6 8.8v5.2\" stroke-width=\"1\"/>",
19
+ sort: "<path d=\"M3.6 5.6h7.2M3.6 10h8.8M3.6 14.4h5\"/><path d=\"M15.3 5.4v9.4\"/><path d=\"M16.97 12.81 15.3 14.8 13.63 12.81\"/>",
20
+ undo: "<path d=\"M4.4 8.4h6.8a3.6 3.6 0 0 1 0 7.2H8.6\"/><path d=\"M6.47 10.14 4.4 8.4 6.47 6.66\"/>",
21
+ redo: "<path d=\"M15.6 8.4H8.8a3.6 3.6 0 0 0 0 7.2H11.4\"/><path d=\"M13.53 6.66 15.6 8.4 13.53 10.14\"/>",
22
+ zoomOut: "<circle cx=\"9\" cy=\"9\" r=\"5.4\"/><path d=\"M12.82 12.82 16.9 16.9\"/><path d=\"M6.7 9h4.6\"/>",
23
+ fit: "<path d=\"M3.2 7.2V4.4A1.2 1.2 0 0 1 4.4 3.2h2.8M12.8 3.2h2.8A1.2 1.2 0 0 1 16.8 4.4v2.8M16.8 12.8v2.8a1.2 1.2 0 0 1-1.2 1.2h-2.8M7.2 16.8H4.4a1.2 1.2 0 0 1-1.2-1.2v-2.8\"/><rect x=\"7.4\" y=\"8.2\" width=\"5.2\" height=\"3.6\" rx=\"0.8\" stroke-width=\"1\"/>",
24
+ snapshot: "<path d=\"M3.8 8.3A1.4 1.4 0 0 1 5.2 6.9h1.9L8 5.1h4l.9 1.8h1.9A1.4 1.4 0 0 1 16.2 8.3v6A1.4 1.4 0 0 1 14.8 15.7H5.2A1.4 1.4 0 0 1 3.8 14.3z\"/><circle cx=\"10\" cy=\"11\" r=\"2.75\"/>",
25
+ play: "<path d=\"M7.6 5.2 15.6 10 7.6 14.8Z\"/>",
26
+ pause: "<path d=\"M7.8 5.2v9.6M12.2 5.2v9.6\"/>",
27
+ stop: "<rect x=\"5.6\" y=\"5.6\" width=\"8.8\" height=\"8.8\" rx=\"1.4\"/>",
28
+ step: "<path d=\"M6.4 5.4 13 10 6.4 14.6Z\"/><path d=\"M15.2 5.4v9.2\"/>",
29
+ crosshair: "<circle cx=\"10\" cy=\"10\" r=\"5.6\"/><path d=\"M10 2.8v4.4M10 12.8v4.4M2.8 10h4.4M12.8 10h4.4\"/>",
30
+ fullscreen: "<path d=\"M11.6 3.6h4.8v4.8M8.4 16.4H3.6v-4.8\"/><path d=\"M16.4 3.6 11.2 8.8M3.6 16.4 8.8 11.2\"/>",
31
+ compare: "<rect x=\"3.4\" y=\"4.6\" width=\"13.2\" height=\"10.8\" rx=\"1.6\"/><path d=\"M10 4.6v10.8\" stroke-width=\"1\"/><path d=\"M5.2 7.6h3.4M5.2 10h2.6M5.2 12.4h3.4\" stroke-width=\"1\"/><path d=\"M11.4 7.6h3.4M11.4 10h3.4M11.4 12.4h1.8\" stroke-width=\"1\"/>",
32
+ filter: "<path d=\"M3.4 4.6h13.2L11.8 11v5.4L8.2 14.8V11z\"/>",
33
+ search: "<circle cx=\"9\" cy=\"9\" r=\"5.4\"/><path d=\"M12.82 12.82 16.9 16.9\"/>",
34
+ layers: "<path d=\"M10 2.8 17.2 6.6 10 10.4 2.8 6.6z\"/><path d=\"M2.8 10 10 13.8 17.2 10\" stroke-width=\"1\"/><path d=\"M2.8 13.4 10 17.2 17.2 13.4\" stroke-width=\"1\"/>",
35
+ lock: "<rect x=\"4.6\" y=\"9\" width=\"10.8\" height=\"8\" rx=\"1.6\"/><path d=\"M7.2 9V6.6a2.8 2.8 0 0 1 5.6 0V9\"/>",
36
+ unlock: "<rect x=\"4.6\" y=\"9\" width=\"10.8\" height=\"8\" rx=\"1.6\"/><path d=\"M7.2 9V6.6a2.8 2.8 0 0 1 5.6 0\"/>",
37
+ visible: "<path d=\"M2.6 10C4.6 6.6 7.1 5 10 5s5.4 1.6 7.4 5c-2 3.4-4.5 5-7.4 5s-5.4-1.6-7.4-5z\"/><circle cx=\"10\" cy=\"10\" r=\"2.2\"/>",
38
+ hidden: "<path d=\"M2.6 10C4.6 6.6 7.1 5 10 5s5.4 1.6 7.4 5c-2 3.4-4.5 5-7.4 5s-5.4-1.6-7.4-5z\"/><circle cx=\"10\" cy=\"10\" r=\"2.2\"/><path d=\"M4.2 15.8 15.8 4.2\"/>",
39
+ pin: "<path d=\"M8.2 3.4v5.2l-2 2.6h7.6l-2-2.6V3.4z\"/><path d=\"M7 3.4h6\"/><path d=\"M10 11.2v5.4\"/>",
40
+ link: "<path d=\"M8.6 11.4a3.4 3.4 0 0 1 0-4.8l2.2-2.2a3.4 3.4 0 0 1 4.8 4.8l-1.1 1.1\"/><path d=\"M11.4 8.6a3.4 3.4 0 0 1 0 4.8l-2.2 2.2a3.4 3.4 0 0 1-4.8-4.8l1.1-1.1\"/>",
41
+ collapse: "<path d=\"M14.16 4.05 10 7.8 5.84 4.05M5.84 15.95 10 12.2 14.16 15.95\"/>",
42
+ expand: "<path d=\"M5.84 8.15 10 4.4 14.16 8.15M14.16 11.85 10 15.6 5.84 11.85\"/>",
43
+ tune: "<path d=\"M3.4 6h13.2M3.4 10h13.2M3.4 14h13.2\" stroke-width=\"1.25\"/><circle cx=\"7\" cy=\"6\" r=\"1.8\"/><circle cx=\"12.6\" cy=\"10\" r=\"1.8\"/><circle cx=\"9\" cy=\"14\" r=\"1.8\"/>",
44
+ grid: "<rect x=\"3.4\" y=\"3.4\" width=\"13.2\" height=\"13.2\" rx=\"1.4\"/><path d=\"M7.8 3.4v13.2M12.2 3.4v13.2M3.4 7.8h13.2M3.4 12.2h13.2\" stroke-width=\"1\"/>",
45
+ snap: "<path d=\"M5.4 15.6V9.4a4.6 4.6 0 0 1 9.2 0v6.2h-3.2V9.4a1.4 1.4 0 0 0-2.8 0v6.2z\"/><path d=\"M5.4 12.8h3.2M11.4 12.8h3.2\" stroke-width=\"1\"/>",
46
+ measure: "<rect x=\"2.6\" y=\"7.4\" width=\"14.8\" height=\"5.2\" rx=\"1.2\"/><path d=\"M6 7.4v2.2M9.4 7.4v3M12.8 7.4v2.2\" stroke-width=\"1\"/>",
47
+ randomize: "<rect x=\"3.6\" y=\"3.6\" width=\"12.8\" height=\"12.8\" rx=\"2\"/><circle cx=\"7.2\" cy=\"7.2\" r=\"1\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"10\" cy=\"10\" r=\"1\" fill=\"currentColor\" stroke=\"none\"/><circle cx=\"12.8\" cy=\"12.8\" r=\"1\" fill=\"currentColor\" stroke=\"none\"/>",
48
+ refresh: "<path d=\"M4.27 12.09A6.1 6.1 0 0 1 14.67 6.08\"/><path d=\"M14.67 3.38 14.67 6.08 12.01 5.61\"/><path d=\"M15.73 7.91A6.1 6.1 0 0 1 5.33 13.92\"/><path d=\"M5.33 16.62 5.33 13.92 7.99 14.39\"/>",
49
+ info: "<circle cx=\"10\" cy=\"10\" r=\"7\"/><path d=\"M10 9.4v4.4\"/><path d=\"M10 6.5h0\"/>",
50
+ warning: "<path d=\"M10 3.4 17.4 16.2H2.6z\"/><path d=\"M10 8.4v3.4\"/><path d=\"M10 14h0\"/>",
51
+ error: "<circle cx=\"10\" cy=\"10\" r=\"7\"/><path d=\"M7.6 7.6 12.4 12.4M12.4 7.6 7.6 12.4\"/>",
52
+ busy: "<path d=\"M10 3.2A6.8 6.8 0 1 1 3.2 10\"/>",
53
+ strokeWidth: "<path d=\"M3.4 5.6h13.2\" stroke-width=\"1\"/><path d=\"M3.4 10h13.2\" stroke-width=\"2\"/><path d=\"M3.4 15.2h13.2\" stroke-width=\"3.4\"/>",
54
+ strokeCap: "<path d=\"M2.5 10H12\" stroke-linecap=\"butt\"/><path d=\"M12 6V14\" stroke-width=\"1\"/>",
55
+ strokeJoin: "<path d=\"M4.4 15.5 10 5.5 15.6 15.5\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\"/>",
56
+ strokeAlign: "<circle cx=\"10\" cy=\"10\" r=\"6.2\"/>",
57
+ capButt: "<path d=\"M5.5 5.25H14.5V14.75H5.5Z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linejoin=\"miter\"/>",
58
+ capRound: "<path d=\"M3.13 5.25H12.13V14.75H3.13Z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linejoin=\"miter\"/><path d=\"M12.13 4.5A5.5 5.5 0 0 1 12.13 15.5Z\" fill=\"currentColor\" stroke=\"none\"/>",
59
+ capSquare: "<path d=\"M3.13 5.25H12.13V14.75H3.13Z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linejoin=\"miter\"/><path d=\"M12.13 4.5H17.63V15.5H12.13Z\" fill=\"currentColor\" stroke=\"none\"/>",
60
+ joinMiter: "<path d=\"M10 3.5 15.6 15.5H4.4Z\" fill=\"currentColor\" stroke=\"none\"/>",
61
+ joinRound: "<path d=\"M4.4 15.5V12a5.6 5.6 0 0 1 11.2 0v3.5Z\" fill=\"currentColor\" stroke=\"none\"/>",
62
+ joinBevel: "<path d=\"M6.8 8.2h6.4l2.4 7.3H4.4Z\" fill=\"currentColor\" stroke=\"none\"/>",
63
+ alignInner: "<path d=\"M10 3.8A6.2 6.2 0 1 0 10 16.2A6.2 6.2 0 1 0 10 3.8Z\" fill=\"currentColor\" stroke=\"none\"/>",
64
+ alignCenter: "<path d=\"M10 2.1A7.9 7.9 0 1 0 10 17.9A7.9 7.9 0 1 0 10 2.1ZM10 5.5A4.5 4.5 0 1 0 10 14.5A4.5 4.5 0 1 0 10 5.5Z\" fill=\"currentColor\" stroke=\"none\" fill-rule=\"evenodd\"/>",
65
+ alignOuter: "<path d=\"M0 0H20V20H0ZM10 3.8A6.2 6.2 0 1 0 10 16.2A6.2 6.2 0 1 0 10 3.8Z\" fill=\"currentColor\" stroke=\"none\" fill-rule=\"evenodd\"/>",
66
+ dashSolid: "<path d=\"M2 10h16\" stroke-width=\"3\" stroke-linecap=\"butt\"/>",
67
+ dashDashed: "<path d=\"M2 10h16\" stroke-width=\"3\" stroke-linecap=\"butt\" stroke-dasharray=\"6 4\"/>",
68
+ dashDotted: "<path d=\"M2 10h16\" stroke-width=\"3\" stroke-linecap=\"butt\" stroke-dasharray=\"2.5 2\"/>",
69
+ dashCustom: "<path d=\"M2 10h16\" stroke-width=\"3\" stroke-linecap=\"butt\" stroke-dasharray=\"5 2 2 2\"/>",
70
+ paintSolid: "<path d=\"M3.4 3.4H16.6V16.6H3.4Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"1\"/>",
71
+ paintLinear: "<path d=\"M3.4 3.4H6.7V16.6H3.4Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"1\"/><path d=\"M6.7 3.4H10V16.6H6.7Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.68\"/><path d=\"M10 3.4H13.3V16.6H10Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.42\"/><path d=\"M13.3 3.4H16.6V16.6H13.3Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.2\"/>",
72
+ paintRadial: "<path d=\"M3.4 3.4H16.6V16.6H3.4ZM4.95 4.95H15.05V15.05H4.95Z\" fill=\"currentColor\" fill-rule=\"evenodd\" stroke=\"none\" fill-opacity=\"0.7\"/><path d=\"M4.95 4.95H15.05V15.05H4.95ZM6.5 6.5H13.5V13.5H6.5Z\" fill=\"currentColor\" fill-rule=\"evenodd\" stroke=\"none\" fill-opacity=\"0.53\"/><path d=\"M6.5 6.5H13.5V13.5H6.5ZM8.05 8.05H11.95V11.95H8.05Z\" fill=\"currentColor\" fill-rule=\"evenodd\" stroke=\"none\" fill-opacity=\"0.37\"/><path d=\"M8.05 8.05H11.95V11.95H8.05Z\" fill=\"currentColor\" fill-rule=\"evenodd\" stroke=\"none\" fill-opacity=\"0.2\"/>",
73
+ paintConic: "<path d=\"M10 10L16.6 3.4L16.6 16.6Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"1\"/><path d=\"M10 10L16.6 16.6L3.4 16.6Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.68\"/><path d=\"M10 10L3.4 16.6L3.4 3.4Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.42\"/><path d=\"M10 10L3.4 3.4L16.6 3.4Z\" fill=\"currentColor\" stroke=\"none\" fill-opacity=\"0.2\"/>",
74
+ paintPattern: "<path d=\"M3.4 3.4L4.7 3.4L3.4 4.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M8.7 3.4L11.3 3.4L3.4 11.3L3.4 8.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M15.3 3.4L16.6 3.4L16.6 4.7L4.7 16.6L3.4 16.6L3.4 15.3Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M16.6 8.7L16.6 11.3L11.3 16.6L8.7 16.6Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M16.6 15.3L16.6 16.6L15.3 16.6Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M15.3 3.4L16.6 3.4L16.6 4.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M8.7 3.4L11.3 3.4L16.6 8.7L16.6 11.3Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M3.4 3.4L4.7 3.4L16.6 15.3L16.6 16.6L15.3 16.6L3.4 4.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M11.3 16.6L8.7 16.6L3.4 11.3L3.4 8.7Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M4.7 16.6L3.4 16.6L3.4 15.3Z\" fill=\"currentColor\" stroke=\"none\"/>",
75
+ paintNone: "<path d=\"M3.4 3.4H16.6V16.6H3.4Z\"/><path d=\"M3.4 16.6L16.6 3.4\" stroke=\"var(--wzl-danger, #d94a3f)\" stroke-width=\"1.8\" stroke-linecap=\"butt\"/>"
76
+ }, f = {
77
+ viewBox: "0 0 20 20",
78
+ fill: "none",
79
+ stroke: "currentColor",
80
+ strokeWidth: 1.5,
81
+ strokeLinecap: "round",
82
+ strokeLinejoin: "round"
83
+ };
84
+ function p({ name: e, className: t, size: n = 20, label: r }) {
85
+ return /* @__PURE__ */ i("svg", {
86
+ ...f,
87
+ className: t,
88
+ width: n,
89
+ height: n,
90
+ role: r ? "img" : void 0,
91
+ "aria-label": r,
92
+ "aria-hidden": r ? void 0 : !0,
93
+ dangerouslySetInnerHTML: { __html: d[e] }
94
+ });
95
+ }
96
+ var m = {
97
+ root: "_root_1c3p1_2",
98
+ unset: "_unset_1c3p1_10"
99
+ }, h = "#000000ff", g = "none", _ = [
100
+ "linear-gradient",
101
+ "radial-gradient",
102
+ "conic-gradient"
103
+ ];
104
+ function v(e) {
105
+ return e !== void 0 && _.includes(e.fill ?? "");
106
+ }
107
+ function y(e) {
108
+ return e?.fill === "pattern";
109
+ }
110
+ function b(e) {
111
+ return e === null ? g : e === void 0 ? null : e.fill ?? "solid";
112
+ }
113
+ function x(f) {
114
+ let { value: x, mixed: S = !1, unset: C = !1, kinds: w, allowNone: T = !0, onInput: E, onChange: D, className: O } = f, k = f["aria-label"], A = u(/* @__PURE__ */ new Map()), j = S ? null : b(x);
115
+ x != null && j !== null && A.current.set(j, x);
116
+ let M = s().filter((e) => w === void 0 || w.includes(e.id)), N = (e, t, n) => n && n in d ? {
117
+ value: e,
118
+ label: /* @__PURE__ */ i(p, {
119
+ name: n,
120
+ size: 14
121
+ }),
122
+ ariaLabel: t
123
+ } : {
124
+ value: e,
125
+ label: t
126
+ }, P = [...T ? [N(g, "None", "paintNone")] : [], ...M.map((e) => N(e.id, e.label, e.icon))], F = l(() => x == null ? h : o(b(x) ?? "solid")?.colorOf(x) ?? h, [x]), I = (e) => {
127
+ if (e === j) return;
128
+ if (e === g) {
129
+ D(null);
130
+ return;
131
+ }
132
+ let t = A.current.get(e);
133
+ if (t !== void 0) {
134
+ D(t);
135
+ return;
136
+ }
137
+ if (x != null && v(x) && _.includes(e)) {
138
+ D(c(x, e));
139
+ return;
140
+ }
141
+ let n = o(e);
142
+ n && D(n.seed(F()));
143
+ };
144
+ return /* @__PURE__ */ a("div", {
145
+ className: [
146
+ m.root,
147
+ C && m.unset,
148
+ O
149
+ ].filter(Boolean).join(" "),
150
+ title: C ? "Not set" : void 0,
151
+ children: [/* @__PURE__ */ i(e, {
152
+ items: P,
153
+ value: j,
154
+ size: "sm",
155
+ ariaLabel: "Paint kind",
156
+ onChange: (e) => e && I(e)
157
+ }), L()]
158
+ });
159
+ function L() {
160
+ if (S || x === void 0) return /* @__PURE__ */ i(t, {
161
+ mixed: !0,
162
+ "aria-label": k,
163
+ onChange: (e) => D({
164
+ fill: "solid",
165
+ color: e
166
+ })
167
+ });
168
+ if (x === null) return null;
169
+ let e = o(b(x) ?? "solid");
170
+ if (e?.Editor) {
171
+ let t = e.Editor;
172
+ return /* @__PURE__ */ i(t, {
173
+ value: x,
174
+ onInput: E,
175
+ onChange: D
176
+ });
177
+ }
178
+ return v(x) ? /* @__PURE__ */ i(n, {
179
+ value: x,
180
+ kindSwitch: !1,
181
+ onInput: E,
182
+ onChange: D
183
+ }) : y(x) ? /* @__PURE__ */ i(r, {
184
+ value: x,
185
+ color: F(),
186
+ onChange: D
187
+ }) : /* @__PURE__ */ i(t, {
188
+ value: F(),
189
+ alpha: !0,
190
+ "aria-label": k,
191
+ onInput: (e) => E?.({
192
+ fill: "solid",
193
+ color: e
194
+ }),
195
+ onChange: (e) => D({
196
+ fill: "solid",
197
+ color: e
198
+ })
199
+ });
200
+ }
201
+ }
202
+ //#endregion
203
+ export { p as n, d as r, x as t };
204
+
205
+ //# sourceMappingURL=PaintInput-K5W4Uho3.js.map