@weasel-js/ui 1.5.1 → 1.6.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.
- package/dist/chunks/ActionBar-CYvfmEz0.js +57 -0
- package/dist/chunks/ActionBar-CYvfmEz0.js.map +1 -0
- package/dist/chunks/{Badge-Bf8Rd1R6.js → Badge-DZ0lFs14.js} +755 -738
- package/dist/chunks/Badge-DZ0lFs14.js.map +1 -0
- package/dist/chunks/{BandEditor-D8I5Uun-.js → BandEditor-D-nVrVO4.js} +44 -44
- package/dist/chunks/BandEditor-D-nVrVO4.js.map +1 -0
- package/dist/chunks/Button-Dyp31jMt.js +111 -0
- package/dist/chunks/Button-Dyp31jMt.js.map +1 -0
- package/dist/chunks/ButtonBar-smZzFuEo.js +46 -0
- package/dist/chunks/ButtonBar-smZzFuEo.js.map +1 -0
- package/dist/chunks/Callout-xLjnx7Mp.js +119 -0
- package/dist/chunks/Callout-xLjnx7Mp.js.map +1 -0
- package/dist/chunks/{Checkbox-BZZsPaVF.js → Checkbox-ChZz30Ds.js} +5 -5
- package/dist/chunks/Checkbox-ChZz30Ds.js.map +1 -0
- package/dist/chunks/Code-v4tDWuuN.js +24 -0
- package/dist/chunks/Code-v4tDWuuN.js.map +1 -0
- package/dist/chunks/{ColorField-YVf8irfr.js → ColorField-DJSCuSJv.js} +15 -15
- package/dist/chunks/{ColorField-YVf8irfr.js.map → ColorField-DJSCuSJv.js.map} +1 -1
- package/dist/chunks/ColorModeControl-JOEiqtE0.js +47 -0
- package/dist/chunks/ColorModeControl-JOEiqtE0.js.map +1 -0
- package/dist/chunks/{ComboBox-D57tNYDD.js → ComboBox-C1JgIpML.js} +13 -13
- package/dist/chunks/ComboBox-C1JgIpML.js.map +1 -0
- package/dist/chunks/{CurveEditor-BXiMoN9d.js → CurveEditor-f1R4kSbD.js} +2 -2
- package/dist/chunks/{CurveEditor-BXiMoN9d.js.map → CurveEditor-f1R4kSbD.js.map} +1 -1
- package/dist/chunks/DataGrid-CZPrB_3a.js +152 -0
- package/dist/chunks/DataGrid-CZPrB_3a.js.map +1 -0
- package/dist/chunks/DetailList-DHaXX4TG.js +43 -0
- package/dist/chunks/DetailList-DHaXX4TG.js.map +1 -0
- package/dist/chunks/{DetentSlider-BWNSv07Z.js → DetentSlider-BYyaZha6.js} +2 -2
- package/dist/chunks/{DetentSlider-BWNSv07Z.js.map → DetentSlider-BYyaZha6.js.map} +1 -1
- package/dist/chunks/Dialog-GIvjoDQj.js +66 -0
- package/dist/chunks/Dialog-GIvjoDQj.js.map +1 -0
- package/dist/chunks/Disclosure-D79jhmh2.js +58 -0
- package/dist/chunks/Disclosure-D79jhmh2.js.map +1 -0
- package/dist/chunks/DragGhost-DcU7cOwy.js +30 -0
- package/dist/chunks/DragGhost-DcU7cOwy.js.map +1 -0
- package/dist/chunks/{DragHandleGlyph-CppAz4_8.js → DragHandleGlyph-BtBxHjZS.js} +1 -1
- package/dist/chunks/{DragHandleGlyph-CppAz4_8.js.map → DragHandleGlyph-BtBxHjZS.js.map} +1 -1
- package/dist/chunks/{Field-BNqvUJfg.js → Field-xbqRmjsI.js} +6 -6
- package/dist/chunks/Field-xbqRmjsI.js.map +1 -0
- package/dist/chunks/FillStrokeSwatch-BViKXIPx.js +111 -0
- package/dist/chunks/FillStrokeSwatch-BViKXIPx.js.map +1 -0
- package/dist/chunks/{FontFamilySelect-CO19kyOO.js → FontFamilySelect-r9TV_xIH.js} +2 -2
- package/dist/chunks/{FontFamilySelect-CO19kyOO.js.map → FontFamilySelect-r9TV_xIH.js.map} +1 -1
- package/dist/chunks/GradientEditor-BRTxHG-W.js +333 -0
- package/dist/chunks/GradientEditor-BRTxHG-W.js.map +1 -0
- package/dist/chunks/{Icon-QhLhaGFe.js → Icon-BW0qv_U7.js} +50 -21
- package/dist/chunks/Icon-BW0qv_U7.js.map +1 -0
- package/dist/chunks/InlineRange-BwGFDhpT.js +29 -0
- package/dist/chunks/InlineRange-BwGFDhpT.js.map +1 -0
- package/dist/chunks/{Input-B9Vh7ASP.js → Input-Bx2cuUbS.js} +24 -19
- package/dist/chunks/Input-Bx2cuUbS.js.map +1 -0
- package/dist/chunks/ItemList-DzJ2lK0R.js +175 -0
- package/dist/chunks/ItemList-DzJ2lK0R.js.map +1 -0
- package/dist/chunks/ItemList.module-DDUXfuZL.js +14 -0
- package/dist/chunks/ItemList.module-DDUXfuZL.js.map +1 -0
- package/dist/chunks/{Jog-BYrxbAQU.js → Jog-LPoac9s4.js} +10 -10
- package/dist/chunks/Jog-LPoac9s4.js.map +1 -0
- package/dist/chunks/{Keycaps-CGNQV2Pz.js → Keycaps-CKiKOJnJ.js} +75 -69
- package/dist/chunks/Keycaps-CKiKOJnJ.js.map +1 -0
- package/dist/chunks/LayerList-BeGrkLb9.js +427 -0
- package/dist/chunks/LayerList-BeGrkLb9.js.map +1 -0
- package/dist/chunks/ListEditor-C6zLzCsJ.js +74 -0
- package/dist/chunks/ListEditor-C6zLzCsJ.js.map +1 -0
- package/dist/chunks/MenuButton-BcdhrNGh.js +70 -0
- package/dist/chunks/MenuButton-BcdhrNGh.js.map +1 -0
- package/dist/chunks/MeshEditor-BOOIFWnz.js +87 -0
- package/dist/chunks/MeshEditor-BOOIFWnz.js.map +1 -0
- package/dist/chunks/{NumberField-CQzS6TjF.js → NumberField-C1Y7zP-a.js} +27 -22
- package/dist/chunks/NumberField-C1Y7zP-a.js.map +1 -0
- package/dist/chunks/{OptionsBar-BWaYG_OH.js → OptionsBar-DlcagPYK.js} +3 -3
- package/dist/chunks/{OptionsBar-BWaYG_OH.js.map → OptionsBar-DlcagPYK.js.map} +1 -1
- package/dist/chunks/{PaintField-BVYMu3OI.js → PaintField-B2mLRZa4.js} +20 -20
- package/dist/chunks/PaintField-B2mLRZa4.js.map +1 -0
- package/dist/chunks/{PaintInput-BzAHCKro.js → PaintInput-BFKhd83I.js} +27 -27
- package/dist/chunks/PaintInput-BFKhd83I.js.map +1 -0
- package/dist/chunks/{PatternPicker-C4OryrYi.js → PatternPicker-DdfpxoQy.js} +6 -6
- package/dist/chunks/PatternPicker-DdfpxoQy.js.map +1 -0
- package/dist/chunks/{Plot2D-Czvyt_vG.js → Plot2D-lyO7waPQ.js} +1 -1
- package/dist/chunks/{Plot2D-Czvyt_vG.js.map → Plot2D-lyO7waPQ.js.map} +1 -1
- package/dist/chunks/{PointPlotter-Xvb98GwB.js → PointPlotter-DGs9i5P-.js} +2 -2
- package/dist/chunks/{PointPlotter-Xvb98GwB.js.map → PointPlotter-DGs9i5P-.js.map} +1 -1
- package/dist/chunks/{Powerline-B_EH-7Z-.js → Powerline-DBEPceLE.js} +7 -5
- package/dist/chunks/Powerline-DBEPceLE.js.map +1 -0
- package/dist/chunks/Prefs-Ctu0H4-b.js +475 -0
- package/dist/chunks/Prefs-Ctu0H4-b.js.map +1 -0
- package/dist/chunks/Properties-Bbneh1ws.js +281 -0
- package/dist/chunks/Properties-Bbneh1ws.js.map +1 -0
- package/dist/chunks/PropertyField-CDb19d3F.js +756 -0
- package/dist/chunks/PropertyField-CDb19d3F.js.map +1 -0
- package/dist/chunks/{RadioGroup-C6xpdQNg.js → RadioGroup-BK2mD6Q0.js} +6 -6
- package/dist/chunks/RadioGroup-BK2mD6Q0.js.map +1 -0
- package/dist/chunks/{RangeSlider-CzgeGLVS.js → RangeSlider-BiRAOsTh.js} +8 -8
- package/dist/chunks/RangeSlider-BiRAOsTh.js.map +1 -0
- package/dist/chunks/{ResizeHandle-1Ey8AOij.js → ResizeHandle-Cc6EOehs.js} +9 -9
- package/dist/chunks/{ResizeHandle-1Ey8AOij.js.map → ResizeHandle-Cc6EOehs.js.map} +1 -1
- package/dist/chunks/Select-DVValBe1.js +225 -0
- package/dist/chunks/Select-DVValBe1.js.map +1 -0
- package/dist/chunks/SelectionPanel-C5LmZA7b.js +103 -0
- package/dist/chunks/SelectionPanel-C5LmZA7b.js.map +1 -0
- package/dist/chunks/{Sidebar-BlUjn8lD.js → Sidebar-DKKd4R-x.js} +4 -4
- package/dist/chunks/Sidebar-DKKd4R-x.js.map +1 -0
- package/dist/chunks/{SidebarPanel-BqHfz6VK.js → SidebarPanel-u5NsuAZY.js} +15 -19
- package/dist/chunks/SidebarPanel-u5NsuAZY.js.map +1 -0
- package/dist/chunks/{Slider-B2ywUZH6.js → Slider-BwRrWHFW.js} +58 -58
- package/dist/chunks/Slider-BwRrWHFW.js.map +1 -0
- package/dist/chunks/{StatusBar-BFt7Yw5O.js → StatusBar-CdPdmmda.js} +6 -6
- package/dist/chunks/StatusBar-CdPdmmda.js.map +1 -0
- package/dist/chunks/SwatchGrid-C-Zx2Exd.js +73 -0
- package/dist/chunks/SwatchGrid-C-Zx2Exd.js.map +1 -0
- package/dist/chunks/{Switch-Om3t3ASc.js → Switch-DxF7TsEu.js} +5 -5
- package/dist/chunks/Switch-DxF7TsEu.js.map +1 -0
- package/dist/chunks/{Tabs-EAvYywil.js → Tabs-GXEfoe3o.js} +5 -5
- package/dist/chunks/Tabs-GXEfoe3o.js.map +1 -0
- package/dist/chunks/{Timeline-BEyKaBXl.js → Timeline-SgmpQtUV.js} +128 -132
- package/dist/chunks/Timeline-SgmpQtUV.js.map +1 -0
- package/dist/chunks/{Toast-iqLDD_XZ.js → Toast-BfcljZz6.js} +15 -15
- package/dist/chunks/Toast-BfcljZz6.js.map +1 -0
- package/dist/chunks/ToggleBar-Btnl5r7F.js +80 -0
- package/dist/chunks/ToggleBar-Btnl5r7F.js.map +1 -0
- package/dist/chunks/TokenPanel-5ajHEHha.js +634 -0
- package/dist/chunks/TokenPanel-5ajHEHha.js.map +1 -0
- package/dist/chunks/{ToolButton-Dd-1T5aX.js → ToolButton-rzqlFlAc.js} +9 -9
- package/dist/chunks/ToolButton-rzqlFlAc.js.map +1 -0
- package/dist/chunks/{ToolGroup-BBI-W-Gm.js → ToolGroup-4bUBV5k6.js} +3 -3
- package/dist/chunks/ToolGroup-4bUBV5k6.js.map +1 -0
- package/dist/chunks/ToolOptionsBar-BF3TNXA3.js +85 -0
- package/dist/chunks/ToolOptionsBar-BF3TNXA3.js.map +1 -0
- package/dist/chunks/ToolPalette-Uw4PvWwa.js +83 -0
- package/dist/chunks/ToolPalette-Uw4PvWwa.js.map +1 -0
- package/dist/chunks/Tooltip-9XiJF937.js +42 -0
- package/dist/chunks/Tooltip-9XiJF937.js.map +1 -0
- package/dist/chunks/Tree-BGt6P8tI.js +203 -0
- package/dist/chunks/Tree-BGt6P8tI.js.map +1 -0
- package/dist/chunks/{createKeyframeLayer-7j7ukrSx.js → createKeyframeLayer-BzDRCrrh.js} +71 -71
- package/dist/chunks/{createKeyframeLayer-7j7ukrSx.js.map → createKeyframeLayer-BzDRCrrh.js.map} +1 -1
- package/dist/chunks/formatShortcut-BoGqUoWi.js +15 -0
- package/dist/chunks/formatShortcut-BoGqUoWi.js.map +1 -0
- package/dist/chunks/icons-DbScMMqX.js +179 -0
- package/dist/chunks/icons-DbScMMqX.js.map +1 -0
- package/dist/chunks/interactiveTarget-C7QUBaJN.js +24 -0
- package/dist/chunks/interactiveTarget-C7QUBaJN.js.map +1 -0
- package/dist/chunks/{keyGlyph-Bp0wnLHn.js → keyGlyph-CLvUHU8c.js} +1 -1
- package/dist/chunks/{keyGlyph-Bp0wnLHn.js.map → keyGlyph-CLvUHU8c.js.map} +1 -1
- package/dist/chunks/model-BQMvTLnW.js +360 -0
- package/dist/chunks/model-BQMvTLnW.js.map +1 -0
- package/dist/chunks/number-6S8IzXVt.js +89 -0
- package/dist/chunks/number-6S8IzXVt.js.map +1 -0
- package/dist/chunks/paintPreview-DPtZS4yU.js +42 -0
- package/dist/chunks/paintPreview-DPtZS4yU.js.map +1 -0
- package/dist/chunks/paintValue-Bz6AVuh3.js +18 -0
- package/dist/chunks/paintValue-Bz6AVuh3.js.map +1 -0
- package/dist/chunks/prefField-CLkhrvYl.js +197 -0
- package/dist/chunks/prefField-CLkhrvYl.js.map +1 -0
- package/dist/chunks/segmentTooltip-CAkZlW-t.js +29 -0
- package/dist/chunks/segmentTooltip-CAkZlW-t.js.map +1 -0
- package/dist/chunks/segmentedControl.module-D2nw68Yo.js +11 -0
- package/dist/chunks/segmentedControl.module-D2nw68Yo.js.map +1 -0
- package/dist/chunks/{snap-B0WQwetQ.js → snap-DC4Km8xG.js} +1 -1
- package/dist/chunks/{snap-B0WQwetQ.js.map → snap-DC4Km8xG.js.map} +1 -1
- package/dist/chunks/stance-CarrcbbP.js +17 -0
- package/dist/chunks/stance-CarrcbbP.js.map +1 -0
- package/dist/chunks/useReorderDragList-Dcezzgix.js +131 -0
- package/dist/chunks/useReorderDragList-Dcezzgix.js.map +1 -0
- package/dist/chunks/{useRovingTabIndex-Dkpf_KhN.js → useRovingTabIndex-B4uJqiKP.js} +1 -1
- package/dist/chunks/useRovingTabIndex-B4uJqiKP.js.map +1 -0
- package/dist/color/oklch.d.ts +2 -1
- package/dist/color/oklch.d.ts.map +1 -1
- package/dist/color/ramp.d.ts +38 -0
- package/dist/color/ramp.d.ts.map +1 -0
- package/dist/components/ActionBar/ActionBar.d.ts +6 -4
- package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/components/ActionBar/index.js +1 -1
- package/dist/components/Badge/Badge.d.ts +21 -7
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/effects/Aqua.d.ts +1 -1
- package/dist/components/Badge/effects/Aqua.d.ts.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/types.d.ts +6 -5
- package/dist/components/Badge/types.d.ts.map +1 -1
- package/dist/components/BandEditor/index.js +1 -1
- package/dist/components/Button/Button.d.ts +17 -3
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonBar/ButtonBar.d.ts +36 -0
- package/dist/components/ButtonBar/ButtonBar.d.ts.map +1 -0
- package/dist/components/ButtonBar/index.d.ts +3 -0
- package/dist/components/ButtonBar/index.d.ts.map +1 -0
- package/dist/components/ButtonBar/index.js +2 -0
- package/dist/components/Callout/Callout.d.ts +2 -5
- package/dist/components/Callout/Callout.d.ts.map +1 -1
- package/dist/components/Callout/index.d.ts +1 -1
- package/dist/components/Callout/index.d.ts.map +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Code/Code.d.ts +28 -0
- package/dist/components/Code/Code.d.ts.map +1 -0
- package/dist/components/Code/index.d.ts +3 -0
- package/dist/components/Code/index.d.ts.map +1 -0
- package/dist/components/Code/index.js +2 -0
- package/dist/components/ColorField/index.js +1 -1
- package/dist/components/ColorModeControl/ColorModeControl.d.ts +21 -0
- package/dist/components/ColorModeControl/ColorModeControl.d.ts.map +1 -0
- package/dist/components/ColorModeControl/index.d.ts +3 -0
- package/dist/components/ColorModeControl/index.d.ts.map +1 -0
- package/dist/components/ColorModeControl/index.js +2 -0
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/CurveEditor/index.js +3 -3
- package/dist/components/DataGrid/DataGrid.d.ts +22 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/DetailList/DetailList.d.ts +36 -0
- package/dist/components/DetailList/DetailList.d.ts.map +1 -0
- package/dist/components/DetailList/index.d.ts +3 -0
- package/dist/components/DetailList/index.d.ts.map +1 -0
- package/dist/components/DetailList/index.js +2 -0
- package/dist/components/DetentSlider/index.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +8 -2
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Disclosure/Disclosure.d.ts +25 -17
- package/dist/components/Disclosure/Disclosure.d.ts.map +1 -1
- package/dist/components/Disclosure/index.d.ts +2 -2
- package/dist/components/Disclosure/index.d.ts.map +1 -1
- package/dist/components/Disclosure/index.js +2 -2
- package/dist/components/DragGhost/DragGhost.d.ts +21 -0
- package/dist/components/DragGhost/DragGhost.d.ts.map +1 -0
- package/dist/components/DragGhost/index.d.ts +3 -0
- package/dist/components/DragGhost/index.d.ts.map +1 -0
- package/dist/components/DragGhost/index.js +2 -0
- package/dist/components/DragHandleGlyph/index.js +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts +45 -0
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -0
- package/dist/components/FillStrokeSwatch/index.d.ts +3 -0
- package/dist/components/FillStrokeSwatch/index.d.ts.map +1 -0
- package/dist/components/FillStrokeSwatch/index.js +2 -0
- package/dist/components/FontFamilySelect/index.js +1 -1
- package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -1
- package/dist/components/GradientEditor/index.js +1 -1
- package/dist/components/InlineRange/InlineRange.d.ts +6 -2
- package/dist/components/InlineRange/InlineRange.d.ts.map +1 -1
- package/dist/components/InlineRange/index.js +1 -1
- package/dist/components/Input/Input.d.ts +13 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/ItemList/ItemList.d.ts +70 -10
- package/dist/components/ItemList/ItemList.d.ts.map +1 -1
- package/dist/components/ItemList/index.js +1 -1
- package/dist/components/Jog/index.js +1 -1
- package/dist/components/Keycaps/index.d.ts +1 -0
- package/dist/components/Keycaps/index.d.ts.map +1 -1
- package/dist/components/Keycaps/index.js +3 -3
- package/dist/components/Keycaps/keySpecsFromMods.d.ts +2 -0
- package/dist/components/Keycaps/keySpecsFromMods.d.ts.map +1 -1
- package/dist/components/Keycaps/keySpecsFromShortcut.d.ts +16 -0
- package/dist/components/Keycaps/keySpecsFromShortcut.d.ts.map +1 -0
- package/dist/components/LayerList/LayerList.d.ts +79 -0
- package/dist/components/LayerList/LayerList.d.ts.map +1 -0
- package/dist/components/LayerList/index.d.ts +3 -0
- package/dist/components/LayerList/index.d.ts.map +1 -0
- package/dist/components/LayerList/index.js +2 -0
- package/dist/components/LayerList/useSceneLayerList.d.ts +20 -0
- package/dist/components/LayerList/useSceneLayerList.d.ts.map +1 -0
- package/dist/components/ListEditor/ListEditor.d.ts +23 -0
- package/dist/components/ListEditor/ListEditor.d.ts.map +1 -0
- package/dist/components/ListEditor/index.d.ts +3 -0
- package/dist/components/ListEditor/index.d.ts.map +1 -0
- package/dist/components/ListEditor/index.js +2 -0
- package/dist/components/MenuButton/MenuButton.d.ts +6 -2
- package/dist/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/dist/components/MenuButton/index.js +1 -1
- package/dist/components/MeshEditor/index.js +1 -1
- package/dist/components/NumberField/NumberField.d.ts +13 -0
- package/dist/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/components/NumberField/UnitField.d.ts +2 -1
- package/dist/components/NumberField/UnitField.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OptionsBar/index.js +1 -1
- package/dist/components/PaintField/index.js +1 -1
- package/dist/components/PaintInput/index.js +1 -1
- package/dist/components/PatternPicker/index.js +1 -1
- package/dist/components/Plot2D/index.js +1 -1
- package/dist/components/PointPlotter/index.js +1 -1
- package/dist/components/Powerline/Powerline.d.ts +4 -3
- package/dist/components/Powerline/Powerline.d.ts.map +1 -1
- package/dist/components/Powerline/index.js +2 -2
- package/dist/components/Prefs/PrefsDialog.d.ts +10 -2
- package/dist/components/Prefs/PrefsDialog.d.ts.map +1 -1
- package/dist/components/Prefs/PrefsForm.d.ts +26 -25
- package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
- package/dist/components/Prefs/PrefsPane.d.ts +24 -0
- package/dist/components/Prefs/PrefsPane.d.ts.map +1 -0
- package/dist/components/Prefs/PrefsRail.d.ts +32 -0
- package/dist/components/Prefs/PrefsRail.d.ts.map +1 -0
- package/dist/components/Prefs/PrefsRow.d.ts +32 -0
- package/dist/components/Prefs/PrefsRow.d.ts.map +1 -0
- package/dist/components/Prefs/index.d.ts +5 -2
- package/dist/components/Prefs/index.d.ts.map +1 -1
- package/dist/components/Prefs/index.js +3 -3
- package/dist/components/Prefs/prefField.d.ts +36 -0
- package/dist/components/Prefs/prefField.d.ts.map +1 -0
- package/dist/components/Prefs/schema.d.ts +32 -1
- package/dist/components/Prefs/schema.d.ts.map +1 -1
- package/dist/components/Properties/DialogRow.d.ts +33 -0
- package/dist/components/Properties/DialogRow.d.ts.map +1 -0
- package/dist/components/Properties/PropertyField.d.ts +238 -0
- package/dist/components/Properties/PropertyField.d.ts.map +1 -0
- package/dist/components/Properties/PropertyGroup.d.ts +18 -3
- package/dist/components/Properties/PropertyGroup.d.ts.map +1 -1
- package/dist/components/Properties/PropertyPanel.d.ts +50 -256
- package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
- package/dist/components/Properties/Subpanel.d.ts +14 -0
- package/dist/components/Properties/Subpanel.d.ts.map +1 -0
- package/dist/components/Properties/index.d.ts +8 -6
- package/dist/components/Properties/index.d.ts.map +1 -1
- package/dist/components/Properties/index.js +3 -2
- package/dist/components/Properties/storyLayouts.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/ResizeHandle/index.js +1 -1
- package/dist/components/Select/Select.d.ts +56 -5
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +2 -2
- package/dist/components/SelectionPanel/SelectionPanel.d.ts +3 -50
- package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
- package/dist/components/SelectionPanel/index.js +3 -2
- package/dist/components/SelectionPanel/model.d.ts +4 -1
- package/dist/components/SelectionPanel/model.d.ts.map +1 -1
- package/dist/components/SelectionPanel/renderLeaf.d.ts +112 -0
- package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -0
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/SidebarPanel/SidebarPanel.d.ts +2 -2
- package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
- package/dist/components/SidebarPanel/index.js +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/StatusBar/index.js +1 -1
- package/dist/components/SwatchGrid/SwatchGrid.d.ts +34 -0
- package/dist/components/SwatchGrid/SwatchGrid.d.ts.map +1 -0
- package/dist/components/SwatchGrid/index.d.ts +3 -0
- package/dist/components/SwatchGrid/index.d.ts.map +1 -0
- package/dist/components/SwatchGrid/index.js +2 -0
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Timeline/Lane.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleBar/ToggleBar.d.ts +2 -1
- package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
- package/dist/components/ToggleBar/index.js +1 -1
- package/dist/components/TokenPanel/TokenPanel.d.ts +10 -4
- package/dist/components/TokenPanel/TokenPanel.d.ts.map +1 -1
- package/dist/components/TokenPanel/index.d.ts +2 -2
- package/dist/components/TokenPanel/index.d.ts.map +1 -1
- package/dist/components/TokenPanel/index.js +2 -2
- package/dist/components/TokenPanel/tokenTypes.d.ts +24 -0
- package/dist/components/TokenPanel/tokenTypes.d.ts.map +1 -1
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolGroup/index.js +1 -1
- package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts +29 -18
- package/dist/components/ToolOptionsBar/ToolOptionsBar.d.ts.map +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/components/ToolPalette/ToolPalette.d.ts +5 -4
- package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
- package/dist/components/ToolPalette/index.d.ts +1 -0
- package/dist/components/ToolPalette/index.d.ts.map +1 -1
- package/dist/components/ToolPalette/index.js +3 -2
- package/dist/components/Tooltip/Tooltip.d.ts +6 -2
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/Tree/Tree.d.ts +84 -0
- package/dist/components/Tree/Tree.d.ts.map +1 -0
- package/dist/components/Tree/index.d.ts +3 -0
- package/dist/components/Tree/index.d.ts.map +1 -0
- package/dist/components/Tree/index.js +2 -0
- package/dist/components/segmentTooltip.d.ts +30 -0
- package/dist/components/segmentTooltip.d.ts.map +1 -0
- package/dist/components/stance.d.ts +30 -0
- package/dist/components/stance.d.ts.map +1 -0
- package/dist/components/stanceCss.d.ts +31 -0
- package/dist/components/stanceCss.d.ts.map +1 -0
- package/dist/components/stanceSurfaces.d.ts +4 -0
- package/dist/components/stanceSurfaces.d.ts.map +1 -0
- package/dist/format/number.d.ts +13 -3
- package/dist/format/number.d.ts.map +1 -1
- package/dist/icons/Icon.d.ts.map +1 -1
- package/dist/icons/ShapeKindIcon.d.ts +10 -0
- package/dist/icons/ShapeKindIcon.d.ts.map +1 -0
- package/dist/icons/index.d.ts +5 -3
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/paths.d.ts +11 -1
- package/dist/icons/paths.d.ts.map +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +110 -84
- package/dist/index.js.map +1 -1
- package/dist/interactiveTarget.d.ts +9 -0
- package/dist/interactiveTarget.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/useReorderDragList.d.ts +36 -7
- package/dist/useReorderDragList.d.ts.map +1 -1
- package/dist/useRovingTabIndex.d.ts +8 -6
- package/dist/useRovingTabIndex.d.ts.map +1 -1
- package/dist/useScrollSpy.d.ts +48 -0
- package/dist/useScrollSpy.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/chunks/ActionBar-GZdcfdQL.js +0 -62
- package/dist/chunks/ActionBar-GZdcfdQL.js.map +0 -1
- package/dist/chunks/ActionsBar-Fhx_40iP.js +0 -41
- package/dist/chunks/ActionsBar-Fhx_40iP.js.map +0 -1
- package/dist/chunks/Badge-Bf8Rd1R6.js.map +0 -1
- package/dist/chunks/BandEditor-D8I5Uun-.js.map +0 -1
- package/dist/chunks/Button-CExdkQcU.js +0 -90
- package/dist/chunks/Button-CExdkQcU.js.map +0 -1
- package/dist/chunks/Callout-cx5_CWcW.js +0 -122
- package/dist/chunks/Callout-cx5_CWcW.js.map +0 -1
- package/dist/chunks/Checkbox-BZZsPaVF.js.map +0 -1
- package/dist/chunks/ComboBox-D57tNYDD.js.map +0 -1
- package/dist/chunks/DataGrid-BVdDMZkQ.js +0 -104
- package/dist/chunks/DataGrid-BVdDMZkQ.js.map +0 -1
- package/dist/chunks/Dialog-DuOzsR2g.js +0 -61
- package/dist/chunks/Dialog-DuOzsR2g.js.map +0 -1
- package/dist/chunks/Disclosure-9UgDzc7Z.js +0 -47
- package/dist/chunks/Disclosure-9UgDzc7Z.js.map +0 -1
- package/dist/chunks/Field-BNqvUJfg.js.map +0 -1
- package/dist/chunks/GradientEditor-B_ymIr4Q.js +0 -333
- package/dist/chunks/GradientEditor-B_ymIr4Q.js.map +0 -1
- package/dist/chunks/Icon-QhLhaGFe.js.map +0 -1
- package/dist/chunks/InlineRange-DdIlfGqG.js +0 -29
- package/dist/chunks/InlineRange-DdIlfGqG.js.map +0 -1
- package/dist/chunks/Input-B9Vh7ASP.js.map +0 -1
- package/dist/chunks/ItemList-BZJQReXD.js +0 -42
- package/dist/chunks/ItemList-BZJQReXD.js.map +0 -1
- package/dist/chunks/Jog-BYrxbAQU.js.map +0 -1
- package/dist/chunks/Keycaps-CGNQV2Pz.js.map +0 -1
- package/dist/chunks/LayerStack-DOylrQcm.js +0 -142
- package/dist/chunks/LayerStack-DOylrQcm.js.map +0 -1
- package/dist/chunks/MenuButton-DGE-0DP0.js +0 -60
- package/dist/chunks/MenuButton-DGE-0DP0.js.map +0 -1
- package/dist/chunks/MeshEditor-CHoGQ9K8.js +0 -123
- package/dist/chunks/MeshEditor-CHoGQ9K8.js.map +0 -1
- package/dist/chunks/NumberField-CQzS6TjF.js.map +0 -1
- package/dist/chunks/PaintField-BVYMu3OI.js.map +0 -1
- package/dist/chunks/PaintInput-BzAHCKro.js.map +0 -1
- package/dist/chunks/PatternPicker-C4OryrYi.js.map +0 -1
- package/dist/chunks/Powerline-B_EH-7Z-.js.map +0 -1
- package/dist/chunks/Prefs-FuaJBs3t.js +0 -308
- package/dist/chunks/Prefs-FuaJBs3t.js.map +0 -1
- package/dist/chunks/Properties-B3KU69NI.js +0 -874
- package/dist/chunks/Properties-B3KU69NI.js.map +0 -1
- package/dist/chunks/RadioGroup-C6xpdQNg.js.map +0 -1
- package/dist/chunks/RangeSlider-CzgeGLVS.js.map +0 -1
- package/dist/chunks/Select-BMYVh10x.js +0 -127
- package/dist/chunks/Select-BMYVh10x.js.map +0 -1
- package/dist/chunks/SelectionPanel-DTpcQidl.js +0 -572
- package/dist/chunks/SelectionPanel-DTpcQidl.js.map +0 -1
- package/dist/chunks/Sidebar-BlUjn8lD.js.map +0 -1
- package/dist/chunks/SidebarPanel-BqHfz6VK.js.map +0 -1
- package/dist/chunks/Slider-B2ywUZH6.js.map +0 -1
- package/dist/chunks/StatusBar-BFt7Yw5O.js.map +0 -1
- package/dist/chunks/Switch-Om3t3ASc.js.map +0 -1
- package/dist/chunks/Tabs-EAvYywil.js.map +0 -1
- package/dist/chunks/Timeline-BEyKaBXl.js.map +0 -1
- package/dist/chunks/Toast-iqLDD_XZ.js.map +0 -1
- package/dist/chunks/ToggleBar--9As2PWG.js +0 -75
- package/dist/chunks/ToggleBar--9As2PWG.js.map +0 -1
- package/dist/chunks/TokenPanel-BL9hlq7x.js +0 -374
- package/dist/chunks/TokenPanel-BL9hlq7x.js.map +0 -1
- package/dist/chunks/ToolButton-Dd-1T5aX.js.map +0 -1
- package/dist/chunks/ToolGroup-BBI-W-Gm.js.map +0 -1
- package/dist/chunks/ToolOptionsBar-B2xPWzJf.js +0 -27
- package/dist/chunks/ToolOptionsBar-B2xPWzJf.js.map +0 -1
- package/dist/chunks/ToolPalette-BmTDDpmz.js +0 -97
- package/dist/chunks/ToolPalette-BmTDDpmz.js.map +0 -1
- package/dist/chunks/Tooltip-BHre_vbI.js +0 -42
- package/dist/chunks/Tooltip-BHre_vbI.js.map +0 -1
- package/dist/chunks/icons-Btrs-JD7.js +0 -165
- package/dist/chunks/icons-Btrs-JD7.js.map +0 -1
- package/dist/chunks/number-f6PydOZK.js +0 -52
- package/dist/chunks/number-f6PydOZK.js.map +0 -1
- package/dist/chunks/range.module-DSsOIq1R.js +0 -8
- package/dist/chunks/range.module-DSsOIq1R.js.map +0 -1
- package/dist/chunks/schema-MCVT1MLv.js +0 -47
- package/dist/chunks/schema-MCVT1MLv.js.map +0 -1
- package/dist/chunks/segmentedControl.module-DmeUMYe3.js +0 -11
- package/dist/chunks/segmentedControl.module-DmeUMYe3.js.map +0 -1
- package/dist/chunks/useReorderDragList-CSQGd7zQ.js +0 -102
- package/dist/chunks/useReorderDragList-CSQGd7zQ.js.map +0 -1
- package/dist/chunks/useRovingTabIndex-Dkpf_KhN.js.map +0 -1
- package/dist/components/ActionsBar/ActionsBar.d.ts +0 -35
- package/dist/components/ActionsBar/ActionsBar.d.ts.map +0 -1
- package/dist/components/ActionsBar/index.d.ts +0 -3
- package/dist/components/ActionsBar/index.d.ts.map +0 -1
- package/dist/components/ActionsBar/index.js +0 -2
- package/dist/components/LayerStack/LayerStack.d.ts +0 -62
- package/dist/components/LayerStack/LayerStack.d.ts.map +0 -1
- package/dist/components/LayerStack/index.d.ts +0 -2
- package/dist/components/LayerStack/index.d.ts.map +0 -1
- package/dist/components/LayerStack/index.js +0 -2
- package/dist/components/Properties/EffectCard.d.ts +0 -69
- package/dist/components/Properties/EffectCard.d.ts.map +0 -1
- package/dist/components/Properties/PinDot.d.ts +0 -18
- package/dist/components/Properties/PinDot.d.ts.map +0 -1
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./useRovingTabIndex-Dkpf_KhN.js";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import "react";
|
|
4
|
-
var n = {
|
|
5
|
-
root: "_root_1jvhb_6",
|
|
6
|
-
segment: "_segment_1jvhb_28",
|
|
7
|
-
segmentSelected: "_segmentSelected_1jvhb_89",
|
|
8
|
-
segmentMixed: "_segmentMixed_1jvhb_148",
|
|
9
|
-
variant_minimal: "_variant_minimal_1jvhb_158",
|
|
10
|
-
size_sm: "_size_sm_1jvhb_167",
|
|
11
|
-
variant_flat: "_variant_flat_1jvhb_242"
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/components/ToggleBar/ToggleBar.tsx
|
|
15
|
-
function r(r) {
|
|
16
|
-
let { items: i, ariaLabel: a, className: o, height: s, size: c, variant: l } = r, u = r.mode ?? "single", d = (e) => u === "multiple" ? r.value.includes(e) : r.value === e, f = (e) => {
|
|
17
|
-
if (u !== "multiple") return !1;
|
|
18
|
-
let t = r.mixedValues;
|
|
19
|
-
return t !== void 0 && t.includes(e) && !d(e);
|
|
20
|
-
}, p = (e) => () => {
|
|
21
|
-
let t = i[e];
|
|
22
|
-
if (!t.disabled) if (u === "multiple") {
|
|
23
|
-
let e = r.value, n = e.includes(t.value) ? e.filter((e) => e !== t.value) : [...e, t.value];
|
|
24
|
-
r.onChange(n);
|
|
25
|
-
} else {
|
|
26
|
-
if (r.value === t.value) {
|
|
27
|
-
r.allowDeselect && r.onChange(null);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
r.onChange(t.value);
|
|
31
|
-
}
|
|
32
|
-
}, m = u === "single" ? i.findIndex((e) => e.value === r.value) : -1, h = e({
|
|
33
|
-
items: i,
|
|
34
|
-
itemClassName: n.segment,
|
|
35
|
-
tabStopIndex: m >= 0 && !i[m].disabled ? m : void 0,
|
|
36
|
-
onNavigate: u === "single" ? (e) => r.onChange(i[e].value) : void 0,
|
|
37
|
-
onActivate: u === "multiple" ? (e) => p(e)() : void 0
|
|
38
|
-
}), g = s === void 0 ? void 0 : { "--tb-h": `${s}px` }, _ = [
|
|
39
|
-
n.root,
|
|
40
|
-
c && n[`size_${c}`],
|
|
41
|
-
l && n[`variant_${l}`],
|
|
42
|
-
o
|
|
43
|
-
].filter(Boolean).join(" ");
|
|
44
|
-
return /* @__PURE__ */ t("div", {
|
|
45
|
-
ref: h.rootRef,
|
|
46
|
-
className: _,
|
|
47
|
-
role: u === "multiple" ? "group" : "radiogroup",
|
|
48
|
-
"aria-label": a,
|
|
49
|
-
style: g,
|
|
50
|
-
children: i.map((e, r) => {
|
|
51
|
-
let i = d(e.value), a = f(e.value), o = [
|
|
52
|
-
n.segment,
|
|
53
|
-
i && n.segmentSelected,
|
|
54
|
-
a && n.segmentMixed
|
|
55
|
-
].filter(Boolean).join(" ");
|
|
56
|
-
return /* @__PURE__ */ t("button", {
|
|
57
|
-
type: "button",
|
|
58
|
-
role: u === "multiple" ? void 0 : "radio",
|
|
59
|
-
"aria-checked": u === "multiple" ? void 0 : i,
|
|
60
|
-
"aria-pressed": u === "multiple" ? a ? "mixed" : i : void 0,
|
|
61
|
-
"aria-label": e.ariaLabel,
|
|
62
|
-
disabled: e.disabled,
|
|
63
|
-
tabIndex: h.tabIndexFor(r),
|
|
64
|
-
className: o,
|
|
65
|
-
onClick: p(r),
|
|
66
|
-
onKeyDown: h.onKeyDown(r),
|
|
67
|
-
children: e.label
|
|
68
|
-
}, e.value);
|
|
69
|
-
})
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
//#endregion
|
|
73
|
-
export { r as t };
|
|
74
|
-
|
|
75
|
-
//# sourceMappingURL=ToggleBar--9As2PWG.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleBar--9As2PWG.js","names":[],"sources":["../../src/components/ToggleBar/ToggleBar.module.css","../../src/components/ToggleBar/ToggleBar.tsx"],"sourcesContent":["/* Aqua-glass segmented control. The track is a pill-shaped well; the\n selected segment becomes a tinted glass cylinder that reads as the same\n \"lozenge\" family as the standalone Button. Visual params come from the\n `--btn-*` custom properties (see Button.module.css) so the Button Lab\n can tune both surfaces with one set of sliders. */\n.root {\n display: inline-flex;\n height: var(--tb-h, var(--wzl-control-h, 24px));\n padding: 2px;\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0.18) 0%,\n rgba(0, 0, 0, 0.05) 100%\n );\n border-radius: var(--wzl-radius-pill);\n /* Clip segments to the track outline so interior corners read crisp and\n the selected segment's glass treatment doesn't paint over the rounded\n outer pixels. */\n overflow: hidden;\n box-shadow:\n inset 0 1px 2px rgba(0, 0, 0, 0.4),\n 0 1px 0 rgba(255, 255, 255, 0.06);\n user-select: none;\n -webkit-user-select: none;\n touch-action: none;\n}\n\n.segment {\n position: relative;\n flex: 1 1 0;\n min-width: 0;\n /* The track's stretch sizes a segment; without this, labkit's :where(button) height wins and overflows a small bar. */\n height: auto;\n padding: 0 12px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n border: none;\n margin: 0;\n font-family: var(--wzl-font-ui);\n font-weight: var(--wzl-font-weight-normal);\n font-size: var(--btn-fontsize, var(--wzl-font-size));\n line-height: 1;\n color: var(--wzl-fg-muted);\n cursor: pointer;\n /* Only round the outer corners of the bar — middle segments stay square\n so the seams between them don't render as facing parentheses. */\n border-radius: 0;\n isolation: isolate;\n overflow: hidden;\n transition: color var(--wzl-motion-fast);\n}\n\n/* A glyph label is a fixed box, not text that can reflow: without this it is\n the only thing in the segment flex can take width from, and three bars in\n one property row squeeze it to nothing. The side padding drops with it —\n 8px around a 14px glyph is most of a segment. */\n.segment > svg {\n flex: none;\n}\n\n.segment:has(> svg) {\n padding: 0 5px;\n}\n\n.segment:first-child {\n border-radius: var(--wzl-radius-pill) 0 0 var(--wzl-radius-pill);\n}\n\n.segment:last-child {\n border-radius: 0 var(--wzl-radius-pill) var(--wzl-radius-pill) 0;\n}\n\n.segment:only-child {\n border-radius: var(--wzl-radius-pill);\n}\n\n.segment:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: -2px;\n}\n\n.segment:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.segment:hover:not(:disabled):not(.segmentSelected) {\n color: var(--wzl-fg);\n}\n\n/* Selected segment — full Aqua glass cylinder. Mirrors Button.variant_primary. */\n.segmentSelected {\n background: linear-gradient(\n 180deg,\n color-mix(in srgb, var(--wzl-accent) var(--btn-top-alpha, 45%), transparent) 0%,\n color-mix(in srgb, var(--wzl-accent) var(--btn-upper-alpha, 70%), transparent) calc(var(--btn-equator, 52%) - var(--btn-equator-spread, 12%)),\n color-mix(in srgb, var(--wzl-accent) var(--btn-equator-tint, 95%), white) var(--btn-equator, 52%),\n var(--wzl-accent) calc(var(--btn-equator, 52%) + var(--btn-equator-spread, 12%) * 1.6),\n color-mix(in srgb, var(--wzl-accent) var(--btn-base-tint, 70%), black) 100%\n );\n backdrop-filter: blur(var(--btn-blur, 6px)) saturate(var(--btn-saturate, 1.3));\n -webkit-backdrop-filter: blur(var(--btn-blur, 6px)) saturate(var(--btn-saturate, 1.3));\n color: var(--wzl-fg-on-accent);\n text-shadow:\n 0 1px 0 rgba(0, 0, 0, var(--btn-text-shadow, 0.35)),\n var(--btn-text-inset-x, 0px) var(--btn-text-inset-y, 1px) 0 rgba(0, 0, 0, var(--btn-text-inset, 0.55)),\n 0 0 6px rgba(0, 0, 0, calc(var(--btn-text-shadow, 0.35) * 0.5));\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, var(--btn-inset-hi, 0.42)),\n inset 0 -1px 2px rgba(0, 0, 0, var(--btn-inset-lo, 0.3)),\n 0 0 0 1px rgba(0, 0, 0, var(--btn-rim, 0.22)),\n 0 1px 2px rgba(0, 0, 0, var(--btn-drop-near, 0.3)),\n 0 2px 4px rgba(0, 0, 0, calc(var(--btn-drop-far, 0.18) * 0.8));\n}\n\n/* Specular gloss on the selected segment. Top corners inherit the\n segment's radius so they hug the upper edge cleanly; bottom corners\n are flattened so the gloss ends in a straight line at the equator\n instead of two little curves that read as `)(` brackets. */\n.segmentSelected::before {\n content: '';\n position: absolute;\n inset: 1px 1px var(--btn-gloss-bottom, 50%) 1px;\n border-radius: inherit;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, var(--btn-gloss-top, 0.42)) 0%,\n rgba(255, 255, 255, var(--btn-gloss-mid, 0.12)) 60%,\n rgba(255, 255, 255, 0) 100%\n );\n pointer-events: none;\n z-index: 1;\n}\n\n.segmentSelected > * {\n position: relative;\n z-index: 2;\n}\n\n/* Mixed segment (`aria-pressed=\"mixed\"`) — the sources disagree. Reads as a\n deliberate third state rather than a dimmed \"on\": a flat accent wash with\n none of the selected segment's gloss/cylinder treatment, so it can't be\n mistaken for the glass lozenge at a glance. */\n.segmentMixed {\n background: color-mix(in srgb, var(--wzl-accent) 22%, transparent);\n color: var(--wzl-fg);\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wzl-accent) 45%, transparent);\n}\n\n.segmentMixed:hover:not(:disabled) {\n background: color-mix(in srgb, var(--wzl-accent) 32%, transparent);\n}\n\n.variant_minimal .segmentMixed {\n background: color-mix(in srgb, var(--wzl-accent) 18%, transparent);\n box-shadow: none;\n color: var(--wzl-fg);\n}\n\n/* Small variant — ~60% of the default height, with proportionally reduced\n padding and font. Sized for dense surfaces (lab control panels, inline\n filters, etc.). */\n.size_sm {\n height: 17px;\n padding: 1px;\n}\n\n.size_sm .segment {\n padding: 0 8px;\n font-size: var(--wzl-font-size-sm);\n}\n\n/* `.size_sm .segment` outranks the glyph rule above on specificity, so a\n small bar's glyph segments need the tight padding restated to stay\n near-square rather than reading as wide plates. */\n.size_sm .segment:has(> svg) {\n padding: 0 3px;\n}\n\n/* Minimal variant — strips the pill track, glass selected state, inset\n shadows, and outer padding. Used in dense diagnostic surfaces (dispatch\n trace, lab inspectors) where the bar must read as plain text controls. */\n.variant_minimal {\n height: auto;\n padding: 0;\n background: none;\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n box-shadow: none;\n gap: 0;\n}\n\n.variant_minimal .segment {\n padding: 0 6px;\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-medium);\n line-height: 1.4;\n border-radius: 0;\n color: var(--wzl-fg-muted);\n transition: none;\n}\n\n/* Dividers between segments make the mutual-exclusion grouping visible\n without a heavy track. Only the inner edges get a rule — the outer\n border on `.variant_minimal` handles the perimeter. */\n.variant_minimal .segment + .segment {\n border-left: 1px solid var(--wzl-border);\n}\n\n.variant_minimal .segment:first-child,\n.variant_minimal .segment:last-child,\n.variant_minimal .segment:only-child {\n border-radius: 0;\n}\n\n.variant_minimal .segment:hover:not(:disabled):not(.segmentSelected) {\n color: var(--wzl-fg);\n background: var(--wzl-surface-hover);\n}\n\n.variant_minimal .segmentSelected {\n background: none;\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n color: var(--wzl-accent-fg, var(--wzl-accent));\n text-shadow: none;\n box-shadow: none;\n font-weight: var(--wzl-font-weight-medium);\n}\n\n.variant_minimal .segmentSelected::before {\n content: none;\n}\n\n/* Flat variant — no track, no glass, no pill: each segment is its own\n outlined cell. For property panels, where a bar sits in a row beside\n inputs and the glass cylinder makes it the loudest thing on the surface. */\n.variant_flat {\n padding: 0;\n background: none;\n border-radius: var(--wzl-radius-sm);\n box-shadow: none;\n overflow: visible;\n}\n\n.variant_flat .segment {\n border: 1px solid var(--wzl-border-strong);\n border-radius: 0;\n /* Sunken, so an unselected cell sits below the panel and the selected one\n reads as raised without needing the glass treatment back. */\n background: var(--wzl-surface-sunken);\n color: var(--wzl-fg-muted);\n}\n\n/* Adjacent cells share one rule rather than stacking two. */\n.variant_flat .segment + .segment {\n margin-inline-start: -1px;\n}\n\n.variant_flat .segment:first-child {\n border-start-start-radius: var(--wzl-radius-sm);\n border-end-start-radius: var(--wzl-radius-sm);\n}\n\n.variant_flat .segment:last-child {\n border-start-end-radius: var(--wzl-radius-sm);\n border-end-end-radius: var(--wzl-radius-sm);\n}\n\n.variant_flat .segment:hover:not(:disabled):not(.segmentSelected) {\n background: var(--wzl-surface-hover);\n color: var(--wzl-fg);\n}\n\n.variant_flat .segmentSelected {\n background: var(--wzl-accent);\n border-color: var(--wzl-accent);\n color: var(--wzl-fg-on-accent);\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n text-shadow: none;\n box-shadow: none;\n /* Its own border rather than the neighbour's overlapping edge. */\n z-index: 1;\n}\n\n.variant_flat .segmentSelected::before {\n content: none;\n}\n","import { type CSSProperties, type ReactElement, type ReactNode } from 'react';\nimport s from './ToggleBar.module.css';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\n\n/** One segment of a {@link ToggleBar}, identified by its `value`. */\nexport type ToggleBarItem<V extends string | number = string> = {\n value: V;\n label?: ReactNode;\n ariaLabel?: string;\n disabled?: boolean;\n};\n\n/** Segment height and type scale for a {@link ToggleBar}. */\nexport type ToggleBarSize = 'sm' | 'md';\n/** Visual treatment of a {@link ToggleBar}. */\nexport type ToggleBarVariant = 'default' | 'minimal' | 'flat';\n\ntype CommonProps = {\n ariaLabel?: string;\n className?: string;\n height?: number;\n /** Size variant. `sm` is ~60% of the default height with reduced padding\n * and font size — sized for dense surfaces like lab control panels. */\n size?: ToggleBarSize;\n /** Visual variant. `minimal` strips the pill track and glass treatment;\n * selection becomes a flat accent. For dense diagnostic surfaces. */\n variant?: ToggleBarVariant;\n};\n\n/**\n * Props for {@link ToggleBar}, discriminated on `mode`. Single mode is\n * controlled by one value or `null`; multiple mode by an array, and only it\n * accepts `mixedValues`.\n */\nexport type ToggleBarProps<V extends string | number = string> =\n | (CommonProps & {\n mode?: 'single';\n items: readonly ToggleBarItem<V>[];\n value: V | null;\n onChange: (next: V | null) => void;\n allowDeselect?: boolean;\n })\n | (CommonProps & {\n mode: 'multiple';\n items: readonly ToggleBarItem<V>[];\n value: readonly V[];\n /**\n * Values that are neither on nor off — the sources this bar\n * aggregates disagree (a text range that is bold in part of it, a\n * multi-selection whose nodes differ). Rendered `aria-pressed=\"mixed\"`,\n * the ARIA tri-state a toggle button actually has, rather than\n * `SelectionPanel`'s reduced-opacity-plus-`title` workaround for\n * `Switch`, which has no indeterminate state to render.\n *\n * `value` wins where the two lists overlap, so a caller that can't\n * cheaply keep them disjoint doesn't get an ambiguous segment.\n *\n * Clicking a mixed segment turns it fully **on**, matching the\n * everywhere-else convention (and `toggleFlagInRange`'s rule for a\n * partially-styled text range) that a mixed toggle resolves toward\n * the affirmative rather than clearing.\n */\n mixedValues?: readonly V[];\n onChange: (next: V[]) => void;\n });\n\n/**\n * Segmented control for choosing among a fixed set of values — one of them\n * (`mode: 'single'`, the default) or any number (`mode: 'multiple'`).\n *\n * Single mode ignores a click on the already-selected segment unless\n * `allowDeselect` is set. Arrow keys move focus without changing the value;\n * Space and Enter commit.\n */\nexport function ToggleBar<V extends string | number = string>(props: ToggleBarProps<V>): ReactElement {\n const { items, ariaLabel, className, height, size, variant } = props;\n const mode = props.mode ?? 'single';\n\n const isSelected = (value: V): boolean => {\n if (mode === 'multiple') return (props.value as readonly V[]).includes(value);\n return (props.value as V | null) === value;\n };\n\n /** Mixed only in multiple mode, and only where `value` doesn't already\n * claim the segment. Single mode has nothing to be mixed about — its\n * aggregate is one value or none. */\n const isMixed = (value: V): boolean => {\n if (mode !== 'multiple') return false;\n const mixed = (props as { mixedValues?: readonly V[] }).mixedValues;\n return mixed !== undefined && mixed.includes(value) && !isSelected(value);\n };\n\n const handleClick = (index: number) => () => {\n const item = items[index];\n if (item.disabled) return;\n if (mode === 'multiple') {\n const current = props.value as readonly V[];\n const next = current.includes(item.value)\n ? current.filter(v => v !== item.value)\n : [...current, item.value];\n (props.onChange as (n: V[]) => void)(next);\n } else {\n const current = props.value as V | null;\n if (current === item.value) {\n if ((props as { allowDeselect?: boolean }).allowDeselect) {\n (props.onChange as (n: V | null) => void)(null);\n }\n return;\n }\n (props.onChange as (n: V | null) => void)(item.value);\n }\n };\n\n const selectedIndex = mode === 'single'\n ? items.findIndex(it => it.value === (props.value as V | null))\n : -1;\n\n const roving = useRovingTabIndex({\n items,\n itemClassName: s.segment,\n // Single mode is a radiogroup: the tab stop is the current value, and\n // arrow keys move the selection with the focus. Multiple mode is a set of\n // independent toggles — focus alone moves, and Space/Enter flips.\n tabStopIndex: selectedIndex >= 0 && !items[selectedIndex].disabled ? selectedIndex : undefined,\n onNavigate: mode === 'single'\n ? (index) => (props.onChange as (n: V | null) => void)(items[index].value)\n : undefined,\n onActivate: mode === 'multiple' ? (index) => handleClick(index)() : undefined,\n });\n\n const style: CSSProperties | undefined = height !== undefined\n ? ({ ['--tb-h' as string]: `${height}px` } as CSSProperties)\n : undefined;\n\n const rootCls = [\n s.root,\n size && s[`size_${size}`],\n variant && s[`variant_${variant}`],\n className,\n ].filter(Boolean).join(' ');\n\n return (\n <div\n ref={roving.rootRef}\n className={rootCls}\n role={mode === 'multiple' ? 'group' : 'radiogroup'}\n aria-label={ariaLabel}\n style={style}\n >\n {items.map((item, i) => {\n const selected = isSelected(item.value);\n const mixed = isMixed(item.value);\n const cls = [s.segment, selected && s.segmentSelected, mixed && s.segmentMixed]\n .filter(Boolean)\n .join(' ');\n return (\n <button\n key={item.value}\n type=\"button\"\n role={mode === 'multiple' ? undefined : 'radio'}\n aria-checked={mode === 'multiple' ? undefined : selected}\n aria-pressed={mode === 'multiple' ? (mixed ? 'mixed' : selected) : undefined}\n aria-label={item.ariaLabel}\n disabled={item.disabled}\n tabIndex={roving.tabIndexFor(i)}\n className={cls}\n onClick={handleClick(i)}\n onKeyDown={roving.onKeyDown(i)}\n >\n {item.label}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AC0EA,SAAgB,EAA8C,GAAwC;CACpG,IAAM,EAAE,UAAO,cAAW,cAAW,WAAQ,SAAM,eAAY,GACzD,IAAO,EAAM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AEN,EAAM,KAAK,GAAM,MAAM;GACtB,IAAM,IAAW,EAAW,EAAK,MAAM,EACjC,IAAQ,EAAQ,EAAK,MAAM,EAC3B,IAAM;IAAC,EAAE;IAAS,KAAY,EAAE;IAAiB,KAAS,EAAE;IAAa,CAC5E,OAAO,QAAQ,CACf,KAAK,IAAI;AACZ,UACE,kBAAC,UAAD;IAEE,MAAK;IACL,MAAM,MAAS,aAAa,KAAA,IAAY;IACxC,gBAAc,MAAS,aAAa,KAAA,IAAY;IAChD,gBAAc,MAAS,aAAc,IAAQ,UAAU,IAAY,KAAA;IACnE,cAAY,EAAK;IACjB,UAAU,EAAK;IACf,UAAU,EAAO,YAAY,EAAE;IAC/B,WAAW;IACX,SAAS,EAAY,EAAE;IACvB,WAAW,EAAO,UAAU,EAAE;cAE7B,EAAK;IACC,EAbF,EAAK,MAaH;IAEX;EACE,CAAA"}
|
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./Button-CExdkQcU.js";
|
|
2
|
-
import { n as t } from "./Disclosure-9UgDzc7Z.js";
|
|
3
|
-
import { t as n } from "./Select-BMYVh10x.js";
|
|
4
|
-
import { t as r } from "./Input-B9Vh7ASP.js";
|
|
5
|
-
import { n as i } from "./NumberField-CQzS6TjF.js";
|
|
6
|
-
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
import { memo as c, useCallback as l, useMemo as u, useState as d } from "react";
|
|
8
|
-
//#region src/components/TokenPanel/color.ts
|
|
9
|
-
var f = /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i, p = /^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})\b/i, m = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix)\(.+\)$/i, h = new Set([
|
|
10
|
-
"transparent",
|
|
11
|
-
"currentcolor",
|
|
12
|
-
"black",
|
|
13
|
-
"white",
|
|
14
|
-
"gray",
|
|
15
|
-
"silver",
|
|
16
|
-
"red",
|
|
17
|
-
"orange",
|
|
18
|
-
"yellow",
|
|
19
|
-
"gold",
|
|
20
|
-
"lime",
|
|
21
|
-
"green",
|
|
22
|
-
"teal",
|
|
23
|
-
"cyan",
|
|
24
|
-
"blue",
|
|
25
|
-
"navy",
|
|
26
|
-
"purple",
|
|
27
|
-
"magenta",
|
|
28
|
-
"pink",
|
|
29
|
-
"brown"
|
|
30
|
-
]);
|
|
31
|
-
function g() {
|
|
32
|
-
return typeof CSS < "u" && typeof CSS.supports == "function" ? (e) => CSS.supports("color", e) : null;
|
|
33
|
-
}
|
|
34
|
-
function _(e, t = g()) {
|
|
35
|
-
let n = e.trim();
|
|
36
|
-
return !n || n.includes("var(") ? !1 : t ? t(n) : f.test(n) || m.test(n) || h.has(n.toLowerCase());
|
|
37
|
-
}
|
|
38
|
-
function v(e) {
|
|
39
|
-
if (f.test(e)) {
|
|
40
|
-
let t = e.slice(1).toLowerCase();
|
|
41
|
-
return `#${t.length <= 4 ? [...t.slice(0, 3)].map((e) => e + e).join("") : t.slice(0, 6)}`;
|
|
42
|
-
}
|
|
43
|
-
let t = p.exec(e);
|
|
44
|
-
return t ? `#${t.slice(1, 4).map((e) => Math.min(255, Number(e)).toString(16).padStart(2, "0")).join("")}` : null;
|
|
45
|
-
}
|
|
46
|
-
var y;
|
|
47
|
-
function b(e) {
|
|
48
|
-
if (y === void 0) try {
|
|
49
|
-
y = document.createElement("canvas").getContext("2d");
|
|
50
|
-
} catch {
|
|
51
|
-
y = null;
|
|
52
|
-
}
|
|
53
|
-
if (!y) return null;
|
|
54
|
-
y.fillStyle = "#000000", y.fillStyle = e;
|
|
55
|
-
let t = String(y.fillStyle);
|
|
56
|
-
return y.fillStyle = "#ffffff", y.fillStyle = e, t === String(y.fillStyle) ? t : null;
|
|
57
|
-
}
|
|
58
|
-
function x(e) {
|
|
59
|
-
let t = e.trim(), n = v(t);
|
|
60
|
-
if (n) return n;
|
|
61
|
-
let r = typeof document > "u" ? null : b(t);
|
|
62
|
-
return r && r !== t ? v(r) : null;
|
|
63
|
-
}
|
|
64
|
-
var S = {
|
|
65
|
-
panel: "_panel_1vnnk_1",
|
|
66
|
-
section: "_section_1vnnk_7",
|
|
67
|
-
sectionHead: "_sectionHead_1vnnk_17",
|
|
68
|
-
sectionBody: "_sectionBody_1vnnk_26",
|
|
69
|
-
row: "_row_1vnnk_33",
|
|
70
|
-
family: "_family_1vnnk_34",
|
|
71
|
-
name: "_name_1vnnk_41",
|
|
72
|
-
edit: "_edit_1vnnk_50",
|
|
73
|
-
field: "_field_1vnnk_57",
|
|
74
|
-
number: "_number_1vnnk_63",
|
|
75
|
-
unit: "_unit_1vnnk_69",
|
|
76
|
-
swatchInput: "_swatchInput_1vnnk_76",
|
|
77
|
-
chip: "_chip_1vnnk_88",
|
|
78
|
-
curve: "_curve_1vnnk_97",
|
|
79
|
-
strip: "_strip_1vnnk_104",
|
|
80
|
-
swatch: "_swatch_1vnnk_76",
|
|
81
|
-
tight: "_tight_1vnnk_138"
|
|
82
|
-
}, C = [
|
|
83
|
-
{
|
|
84
|
-
id: "color",
|
|
85
|
-
title: "Color"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: "type",
|
|
89
|
-
title: "Type"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: "size",
|
|
93
|
-
title: "Size"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: "motion",
|
|
97
|
-
title: "Motion"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: "depth",
|
|
101
|
-
title: "Depth"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: "other",
|
|
105
|
-
title: "Other"
|
|
106
|
-
}
|
|
107
|
-
], w = /^(?:font|tracking|leading|letter|line-height)/;
|
|
108
|
-
function T(e) {
|
|
109
|
-
switch (e.type) {
|
|
110
|
-
case "color": return "color";
|
|
111
|
-
case "fontFamily":
|
|
112
|
-
case "fontWeight": return "type";
|
|
113
|
-
case "duration":
|
|
114
|
-
case "cubicBezier": return "motion";
|
|
115
|
-
case "shadow":
|
|
116
|
-
case "gradient": return "depth";
|
|
117
|
-
case "dimension":
|
|
118
|
-
case "number": return w.test(e.group) ? "type" : e.type === "number" && (e.group === "z" || e.group === "z-index") ? "depth" : "size";
|
|
119
|
-
default: return "other";
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
var E = String.raw`-?(?:\d+\.?\d*|\.\d+)`, D = RegExp(`^${E}(?:px|rem|em|%|ch|ex|lh|rlh|vh|vw|vmin|vmax|svh|lvh|dvh|cqw|cqh|pt|pc|cm|mm|in|q)$`, "i"), O = RegExp(`^${E}m?s$`), k = RegExp(`^${E}$`), A = RegExp(`^${E}(?:px|rem|em)?$`), j = RegExp(`^cubic-bezier\\(\\s*(${E})\\s*,\\s*(${E})\\s*,\\s*(${E})\\s*,\\s*(${E})\\s*\\)$`, "i"), M = /^(?:repeating-)?(?:linear|radial|conic)-gradient\(/i, N = /,(?![^(]*\))/, P = /[a-z-]+\([^)]*\)|\S+/gi;
|
|
123
|
-
function F(e) {
|
|
124
|
-
return e.split(N).every((e) => {
|
|
125
|
-
let t = e.trim().replace(/^inset\s+/i, "").match(P) ?? [], n = t.filter((e) => A.test(e)), r = t.filter((e) => !A.test(e));
|
|
126
|
-
return n.length >= 2 && n.length <= 4 && r.length <= 1 && r.every((e) => _(e));
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
function I(e) {
|
|
130
|
-
let t = e.trim();
|
|
131
|
-
return t ? O.test(t) ? "duration" : D.test(t) ? "dimension" : k.test(t) ? "number" : j.test(t) ? "cubicBezier" : M.test(t) ? "gradient" : _(t) ? "color" : F(t) ? "shadow" : "string" : "string";
|
|
132
|
-
}
|
|
133
|
-
function L(e) {
|
|
134
|
-
let t = RegExp(`^(${E})([a-z%]*)$`, "i").exec(e.trim());
|
|
135
|
-
return t ? {
|
|
136
|
-
amount: Number(t[1]),
|
|
137
|
-
unit: t[2] ?? ""
|
|
138
|
-
} : null;
|
|
139
|
-
}
|
|
140
|
-
function R(e) {
|
|
141
|
-
let t = j.exec(e.trim());
|
|
142
|
-
if (!t) return null;
|
|
143
|
-
let [n, r, i, a] = t.slice(1, 5).map(Number);
|
|
144
|
-
return [
|
|
145
|
-
n,
|
|
146
|
-
r,
|
|
147
|
-
i,
|
|
148
|
-
a
|
|
149
|
-
];
|
|
150
|
-
}
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/components/TokenPanel/TokenPanel.tsx
|
|
153
|
-
var z = [
|
|
154
|
-
"100",
|
|
155
|
-
"200",
|
|
156
|
-
"300",
|
|
157
|
-
"400",
|
|
158
|
-
"500",
|
|
159
|
-
"600",
|
|
160
|
-
"700",
|
|
161
|
-
"800",
|
|
162
|
-
"900"
|
|
163
|
-
], B = {
|
|
164
|
-
maximumFractionDigits: 4,
|
|
165
|
-
useGrouping: !1
|
|
166
|
-
};
|
|
167
|
-
function V(e, t) {
|
|
168
|
-
let n = /* @__PURE__ */ new Map();
|
|
169
|
-
for (let t of e) t.type === "color" && n.set(t.group, (n.get(t.group) ?? 0) + 1);
|
|
170
|
-
let r = /* @__PURE__ */ new Map(), i = [];
|
|
171
|
-
for (let a of e) {
|
|
172
|
-
if (a.type !== "color" || (n.get(a.group) ?? 0) < t) {
|
|
173
|
-
i.push({
|
|
174
|
-
kind: "row",
|
|
175
|
-
token: a
|
|
176
|
-
});
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
let e = r.get(a.group);
|
|
180
|
-
e || (e = {
|
|
181
|
-
kind: "family",
|
|
182
|
-
group: a.group,
|
|
183
|
-
tokens: []
|
|
184
|
-
}, r.set(a.group, e), i.push(e)), e.tokens.push(a);
|
|
185
|
-
}
|
|
186
|
-
return i;
|
|
187
|
-
}
|
|
188
|
-
function H({ points: e, label: t }) {
|
|
189
|
-
let [n, r, i, a] = e, s = Math.min(0, 1 - r, 1 - a), c = Math.max(1, 1 - r, 1 - a);
|
|
190
|
-
return /* @__PURE__ */ o("svg", {
|
|
191
|
-
className: S.curve,
|
|
192
|
-
viewBox: `-0.1 ${s - .1} 1.2 ${c - s + .2}`,
|
|
193
|
-
role: "img",
|
|
194
|
-
"aria-label": t,
|
|
195
|
-
children: /* @__PURE__ */ o("path", {
|
|
196
|
-
d: `M0 1 C${n} ${1 - r} ${i} ${1 - a} 1 0`,
|
|
197
|
-
fill: "none",
|
|
198
|
-
stroke: "currentColor",
|
|
199
|
-
strokeWidth: .08
|
|
200
|
-
})
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
function U({ token: e, set: t }) {
|
|
204
|
-
let { name: c, type: l, value: d } = e, f = `${c} value`, p = u(() => l === "color" ? x(d) : null, [l, d]);
|
|
205
|
-
if (l === "dimension" || l === "duration" || l === "number") {
|
|
206
|
-
let e = L(d);
|
|
207
|
-
if (e) return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(i, {
|
|
208
|
-
className: S.number,
|
|
209
|
-
"aria-label": f,
|
|
210
|
-
value: e.amount,
|
|
211
|
-
hideSteppers: !0,
|
|
212
|
-
formatOptions: B,
|
|
213
|
-
onChange: (n) => {
|
|
214
|
-
Number.isFinite(n) && t(`${n}${e.unit}`);
|
|
215
|
-
}
|
|
216
|
-
}), e.unit ? /* @__PURE__ */ o("span", {
|
|
217
|
-
className: S.unit,
|
|
218
|
-
children: e.unit
|
|
219
|
-
}) : null] });
|
|
220
|
-
}
|
|
221
|
-
if (l === "fontWeight") return /* @__PURE__ */ o(n, {
|
|
222
|
-
"aria-label": c,
|
|
223
|
-
width: "fit",
|
|
224
|
-
selectedKey: d,
|
|
225
|
-
options: (z.includes(d) ? z : [...z, d]).map((e) => ({
|
|
226
|
-
value: e,
|
|
227
|
-
label: e
|
|
228
|
-
})),
|
|
229
|
-
onSelectionChange: t
|
|
230
|
-
});
|
|
231
|
-
let m = l === "cubicBezier" ? R(d) : null;
|
|
232
|
-
return /* @__PURE__ */ s(a, { children: [m ? /* @__PURE__ */ o(H, {
|
|
233
|
-
points: m,
|
|
234
|
-
label: `${c} curve`
|
|
235
|
-
}) : null, /* @__PURE__ */ o(r, {
|
|
236
|
-
className: S.field,
|
|
237
|
-
"aria-label": f,
|
|
238
|
-
value: d,
|
|
239
|
-
onChange: t,
|
|
240
|
-
leadingAdornment: l === "color" ? p ? /* @__PURE__ */ o("input", {
|
|
241
|
-
type: "color",
|
|
242
|
-
className: S.swatchInput,
|
|
243
|
-
"aria-label": `${c} color`,
|
|
244
|
-
value: p,
|
|
245
|
-
onChange: (e) => t(e.target.value)
|
|
246
|
-
}) : /* @__PURE__ */ o("span", {
|
|
247
|
-
className: S.chip,
|
|
248
|
-
style: { "--token-color": d },
|
|
249
|
-
"aria-hidden": "true"
|
|
250
|
-
}) : void 0
|
|
251
|
-
})] });
|
|
252
|
-
}
|
|
253
|
-
var W = c(function({ token: t, onChange: n }) {
|
|
254
|
-
let r = l((e) => n(t.name, e), [n, t.name]);
|
|
255
|
-
return /* @__PURE__ */ s("div", {
|
|
256
|
-
className: S.row,
|
|
257
|
-
role: "group",
|
|
258
|
-
"aria-label": t.name,
|
|
259
|
-
children: [/* @__PURE__ */ o("span", {
|
|
260
|
-
className: S.name,
|
|
261
|
-
title: t.description || t.name,
|
|
262
|
-
children: t.name
|
|
263
|
-
}), /* @__PURE__ */ s("div", {
|
|
264
|
-
className: S.edit,
|
|
265
|
-
children: [/* @__PURE__ */ o(U, {
|
|
266
|
-
token: t,
|
|
267
|
-
set: r
|
|
268
|
-
}), t.overridden ? /* @__PURE__ */ o(e, {
|
|
269
|
-
variant: "ghost",
|
|
270
|
-
size: "sm",
|
|
271
|
-
ariaLabel: `Reset ${t.name}`,
|
|
272
|
-
onClick: () => n(t.name, null),
|
|
273
|
-
children: "Reset"
|
|
274
|
-
}) : null]
|
|
275
|
-
})]
|
|
276
|
-
});
|
|
277
|
-
}, (e, t) => e.onChange === t.onChange && e.token.name === t.token.name && e.token.type === t.token.type && e.token.value === t.token.value && e.token.overridden === t.token.overridden && e.token.description === t.token.description);
|
|
278
|
-
function G({ group: e, tokens: t, onChange: n }) {
|
|
279
|
-
let [r, i] = d(null), a = t.find((e) => e.name === r) ?? null;
|
|
280
|
-
return /* @__PURE__ */ s("div", {
|
|
281
|
-
className: S.family,
|
|
282
|
-
role: "group",
|
|
283
|
-
"aria-label": e,
|
|
284
|
-
children: [
|
|
285
|
-
/* @__PURE__ */ o("span", {
|
|
286
|
-
className: S.name,
|
|
287
|
-
children: e
|
|
288
|
-
}),
|
|
289
|
-
/* @__PURE__ */ o("div", {
|
|
290
|
-
className: S.strip,
|
|
291
|
-
children: t.map((e) => /* @__PURE__ */ o("button", {
|
|
292
|
-
type: "button",
|
|
293
|
-
className: S.swatch,
|
|
294
|
-
style: { "--token-color": e.value },
|
|
295
|
-
"aria-label": e.name,
|
|
296
|
-
"aria-pressed": e.name === r,
|
|
297
|
-
title: `${e.name}: ${e.value}`,
|
|
298
|
-
"data-overridden": e.overridden ? "" : void 0,
|
|
299
|
-
onClick: () => i((t) => t === e.name ? null : e.name)
|
|
300
|
-
}, e.name))
|
|
301
|
-
}),
|
|
302
|
-
a ? /* @__PURE__ */ o(W, {
|
|
303
|
-
token: a,
|
|
304
|
-
onChange: n
|
|
305
|
-
}) : null
|
|
306
|
-
]
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
function K({ title: e, open: n, onToggle: r, tokens: i, familySize: a, onChange: c }) {
|
|
310
|
-
let l = u(() => V(i, a), [i, a]);
|
|
311
|
-
return /* @__PURE__ */ s("section", {
|
|
312
|
-
className: S.section,
|
|
313
|
-
"aria-label": e,
|
|
314
|
-
children: [/* @__PURE__ */ o(t, {
|
|
315
|
-
className: S.sectionHead,
|
|
316
|
-
open: n,
|
|
317
|
-
onToggle: r,
|
|
318
|
-
label: e,
|
|
319
|
-
children: /* @__PURE__ */ o("span", {
|
|
320
|
-
"aria-hidden": "true",
|
|
321
|
-
children: e
|
|
322
|
-
})
|
|
323
|
-
}), n ? /* @__PURE__ */ o("div", {
|
|
324
|
-
className: S.sectionBody,
|
|
325
|
-
children: l.map((e) => e.kind === "row" ? /* @__PURE__ */ o(W, {
|
|
326
|
-
token: e.token,
|
|
327
|
-
onChange: c
|
|
328
|
-
}, e.token.name) : /* @__PURE__ */ o(G, {
|
|
329
|
-
group: e.group,
|
|
330
|
-
tokens: e.tokens,
|
|
331
|
-
onChange: c
|
|
332
|
-
}, `family:${e.group}`))
|
|
333
|
-
}) : null]
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
function q({ tokens: e, onChange: t, collapsed: n, onCollapsedChange: r, categorize: i = T, familySize: a = 3, density: s = "normal", className: c }) {
|
|
337
|
-
let [l, f] = d({}), p = n ?? l, m = u(() => {
|
|
338
|
-
let t = /* @__PURE__ */ new Map();
|
|
339
|
-
for (let n of e) {
|
|
340
|
-
let e = i(n);
|
|
341
|
-
t.set(e, [...t.get(e) ?? [], n]);
|
|
342
|
-
}
|
|
343
|
-
return t;
|
|
344
|
-
}, [e, i]);
|
|
345
|
-
return /* @__PURE__ */ o("div", {
|
|
346
|
-
className: [
|
|
347
|
-
S.panel,
|
|
348
|
-
s === "tight" && S.tight,
|
|
349
|
-
c
|
|
350
|
-
].filter(Boolean).join(" "),
|
|
351
|
-
children: C.map(({ id: e, title: i }) => {
|
|
352
|
-
let s = m.get(e);
|
|
353
|
-
if (!s) return null;
|
|
354
|
-
let c = !p[e];
|
|
355
|
-
return /* @__PURE__ */ o(K, {
|
|
356
|
-
title: i,
|
|
357
|
-
open: c,
|
|
358
|
-
onToggle: () => {
|
|
359
|
-
n === void 0 && f((t) => ({
|
|
360
|
-
...t,
|
|
361
|
-
[e]: c
|
|
362
|
-
})), r?.(e, c);
|
|
363
|
-
},
|
|
364
|
-
tokens: s,
|
|
365
|
-
familySize: a,
|
|
366
|
-
onChange: t
|
|
367
|
-
}, e);
|
|
368
|
-
})
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
//#endregion
|
|
372
|
-
export { T as i, C as n, I as r, q as t };
|
|
373
|
-
|
|
374
|
-
//# sourceMappingURL=TokenPanel-BL9hlq7x.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TokenPanel-BL9hlq7x.js","names":[],"sources":["../../src/components/TokenPanel/color.ts","../../src/components/TokenPanel/TokenPanel.module.css","../../src/components/TokenPanel/tokenTypes.ts","../../src/components/TokenPanel/TokenPanel.tsx"],"sourcesContent":["const HEX = /^#(?:[\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/i;\nconst RGB = /^rgba?\\(\\s*(\\d{1,3})[\\s,]+(\\d{1,3})[\\s,]+(\\d{1,3})\\b/i;\nconst COLOR_FUNCTION = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix)\\(.+\\)$/i;\nconst KEYWORDS = new Set([\n 'transparent',\n 'currentcolor',\n 'black',\n 'white',\n 'gray',\n 'silver',\n 'red',\n 'orange',\n 'yellow',\n 'gold',\n 'lime',\n 'green',\n 'teal',\n 'cyan',\n 'blue',\n 'navy',\n 'purple',\n 'magenta',\n 'pink',\n 'brown',\n]);\n\ntype Supports = ((value: string) => boolean) | null;\n\nfunction browserSupports(): Supports {\n return typeof CSS !== 'undefined' && typeof CSS.supports === 'function'\n ? (value) => CSS.supports('color', value)\n : null;\n}\n\n/** Whether `value` is a CSS color — the browser's answer where it has `CSS.supports`, a small parser's otherwise. */\nexport function parsesAsColor(value: string, supports: Supports = browserSupports()): boolean {\n const v = value.trim();\n // `CSS.supports` accepts any `var()` for any property.\n if (!v || v.includes('var(')) return false;\n if (supports) return supports(v);\n return HEX.test(v) || COLOR_FUNCTION.test(v) || KEYWORDS.has(v.toLowerCase());\n}\n\nfunction hexOf(v: string): string | null {\n if (HEX.test(v)) {\n const digits = v.slice(1).toLowerCase();\n return `#${digits.length <= 4 ? [...digits.slice(0, 3)].map((d) => d + d).join('') : digits.slice(0, 6)}`;\n }\n const rgb = RGB.exec(v);\n return rgb\n ? `#${rgb\n .slice(1, 4)\n .map((n) => Math.min(255, Number(n)).toString(16).padStart(2, '0'))\n .join('')}`\n : null;\n}\n\nlet paint: CanvasRenderingContext2D | null | undefined;\n\n/** The browser's serialization of a color, through a canvas fill style; null where it has none or rejects `value`. */\nfunction serialized(value: string): string | null {\n if (paint === undefined) {\n try {\n paint = document.createElement('canvas').getContext('2d');\n } catch {\n paint = null;\n }\n }\n if (!paint) return null;\n // A rejected value leaves the previous fill style, so two different ones tell a rejection apart.\n paint.fillStyle = '#000000';\n paint.fillStyle = value;\n const onBlack = String(paint.fillStyle);\n paint.fillStyle = '#ffffff';\n paint.fillStyle = value;\n return onBlack === String(paint.fillStyle) ? onBlack : null;\n}\n\n/** `value` as the `#rrggbb` a color input takes, alpha dropped; null when it cannot be converted. */\nexport function toHex(value: string): string | null {\n const v = value.trim();\n const direct = hexOf(v);\n if (direct) return direct;\n const browser = typeof document === 'undefined' ? null : serialized(v);\n return browser && browser !== v ? hexOf(browser) : null;\n}\n",".panel {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.section {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.section + .section {\n border-top: var(--wzl-border-w) solid var(--wzl-line-subtle);\n}\n\n.sectionHead {\n padding-block: var(--wzl-space-xs);\n color: var(--wzl-fg-muted);\n font-family: var(--wzl-font-display);\n font-size: var(--wzl-font-size-sm);\n letter-spacing: 0.08em;\n text-transform: uppercase;\n}\n\n.sectionBody {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-sm);\n padding-block-end: var(--wzl-space-sm);\n}\n\n.row,\n.family {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.name {\n overflow: hidden;\n color: var(--wzl-fg-muted);\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-sm);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.edit {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-xs);\n min-width: 0;\n}\n\n.field {\n --wzl-font-ui: var(--wzl-font-mono);\n flex: 1;\n min-width: 0;\n}\n\n.number {\n --wzl-font-ui: var(--wzl-font-mono);\n flex: 1;\n min-width: 0;\n}\n\n.unit {\n color: var(--wzl-fg-muted);\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-sm);\n}\n\n/* Padding inflates a native color input past its box in Chrome. */\n.swatchInput {\n box-sizing: border-box;\n flex-shrink: 0;\n width: 18px;\n height: 14px;\n padding: 0;\n background: transparent;\n border: 0;\n border-radius: var(--wzl-radius-sm);\n cursor: pointer;\n}\n\n.chip {\n flex-shrink: 0;\n width: 18px;\n height: 14px;\n background: var(--token-color);\n border-radius: var(--wzl-radius-sm);\n box-shadow: inset 0 0 0 1px var(--wzl-line);\n}\n\n.curve {\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n color: var(--wzl-fg);\n}\n\n.strip {\n display: flex;\n height: var(--wzl-control-h);\n overflow: hidden;\n border: var(--wzl-border-w) solid var(--wzl-line);\n border-radius: var(--wzl-radius-sm);\n}\n\n.swatch {\n flex: 1 1 0;\n min-width: 0;\n height: 100%;\n padding: 0;\n background: var(--token-color);\n border: 0;\n border-radius: 0;\n cursor: pointer;\n}\n\n.swatch[data-overridden] {\n box-shadow: inset 0 -3px 0 var(--wzl-accent);\n}\n\n.swatch[aria-pressed='true'],\n.swatch:focus-visible {\n position: relative;\n z-index: 1;\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: -2px;\n}\n\n/* Tight: a token to a line, with the names on a fixed rail so the values read\n down the panel as a column. A stacked row spends its height on the name and\n lets the field take the whole width, which a set of ninety cannot afford. */\n.tight .sectionBody {\n gap: 2px;\n padding-block-end: var(--wzl-space-xs);\n}\n\n.tight .row {\n flex-direction: row;\n align-items: center;\n gap: var(--wzl-space-xs);\n}\n\n.tight .row > .name {\n flex: 0 0 11rem;\n}\n\n.tight .edit {\n flex: 1 1 auto;\n}\n\n.tight .field,\n.tight .number {\n flex: 0 1 16rem;\n font-variant-numeric: tabular-nums;\n}\n\n.tight .unit {\n font-variant-numeric: tabular-nums;\n}\n\n/* Grid rather than a row, so a picked swatch's editor still spans the full width. */\n.tight .family {\n display: grid;\n grid-template-columns: 11rem minmax(0, 1fr);\n align-items: center;\n column-gap: var(--wzl-space-xs);\n row-gap: 2px;\n}\n\n.tight .family > .row {\n grid-column: 1 / -1;\n}\n\n.tight .strip {\n height: 16px;\n}\n\n.tight .curve {\n width: 16px;\n height: 16px;\n}\n","import { parsesAsColor } from './color';\n\n/** A design token as `TokenPanel` edits it. */\nexport interface TokenEntry {\n /** The custom property, e.g. `--wzl-gray-50`. */\n name: string;\n /** A DTCG type name. A type the panel has no control for edits as text. */\n type: string;\n /** Tokens sharing a group sit together; a color group large enough draws as one row of swatches. */\n group: string;\n value: string;\n /** Whether `value` overrides the token's own, which offers Reset. */\n overridden?: boolean;\n description?: string;\n}\n\nexport type TokenCategory = 'color' | 'type' | 'size' | 'motion' | 'depth' | 'other';\n\n/** The panel's sections, in the order it draws them. */\nexport const TOKEN_CATEGORIES: readonly { id: TokenCategory; title: string }[] = [\n { id: 'color', title: 'Color' },\n { id: 'type', title: 'Type' },\n { id: 'size', title: 'Size' },\n { id: 'motion', title: 'Motion' },\n { id: 'depth', title: 'Depth' },\n { id: 'other', title: 'Other' },\n];\n\nconst TYPE_SCALE = /^(?:font|tracking|leading|letter|line-height)/;\n\n/** The section a token is filed under: by its type, and for a bare dimension or number by its group. */\nexport function tokenCategory(token: TokenEntry): TokenCategory {\n switch (token.type) {\n case 'color':\n return 'color';\n case 'fontFamily':\n case 'fontWeight':\n return 'type';\n case 'duration':\n case 'cubicBezier':\n return 'motion';\n case 'shadow':\n case 'gradient':\n return 'depth';\n case 'dimension':\n case 'number':\n if (TYPE_SCALE.test(token.group)) return 'type';\n if (token.type === 'number' && (token.group === 'z' || token.group === 'z-index')) return 'depth';\n return 'size';\n default:\n return 'other';\n }\n}\n\nconst AMOUNT = String.raw`-?(?:\\d+\\.?\\d*|\\.\\d+)`;\nconst DIMENSION = new RegExp(\n `^${AMOUNT}(?:px|rem|em|%|ch|ex|lh|rlh|vh|vw|vmin|vmax|svh|lvh|dvh|cqw|cqh|pt|pc|cm|mm|in|q)$`,\n 'i',\n);\nconst DURATION = new RegExp(`^${AMOUNT}m?s$`);\nconst NUMBER = new RegExp(`^${AMOUNT}$`);\nconst LENGTH = new RegExp(`^${AMOUNT}(?:px|rem|em)?$`);\nconst BEZIER = new RegExp(`^cubic-bezier\\\\(\\\\s*(${AMOUNT})\\\\s*,\\\\s*(${AMOUNT})\\\\s*,\\\\s*(${AMOUNT})\\\\s*,\\\\s*(${AMOUNT})\\\\s*\\\\)$`, 'i');\nconst GRADIENT = /^(?:repeating-)?(?:linear|radial|conic)-gradient\\(/i;\n/** Commas outside parentheses: a shadow's layers, not a color function's arguments. */\nconst LAYERS = /,(?![^(]*\\))/;\nconst PARTS = /[a-z-]+\\([^)]*\\)|\\S+/gi;\n\nfunction isShadow(value: string): boolean {\n return value.split(LAYERS).every((layer) => {\n const parts = layer.trim().replace(/^inset\\s+/i, '').match(PARTS) ?? [];\n const lengths = parts.filter((part) => LENGTH.test(part));\n const rest = parts.filter((part) => !LENGTH.test(part));\n return lengths.length >= 2 && lengths.length <= 4 && rest.length <= 1 && rest.every((part) => parsesAsColor(part));\n });\n}\n\n/** A DTCG type read off the shape of a value, for a token that arrives without one. `'string'` when nothing fits. */\nexport function inferTokenType(value: string): string {\n const v = value.trim();\n if (!v) return 'string';\n if (DURATION.test(v)) return 'duration';\n if (DIMENSION.test(v)) return 'dimension';\n if (NUMBER.test(v)) return 'number';\n if (BEZIER.test(v)) return 'cubicBezier';\n if (GRADIENT.test(v)) return 'gradient';\n if (parsesAsColor(v)) return 'color';\n if (isShadow(v)) return 'shadow';\n return 'string';\n}\n\n/** A number and its unit, or null for a value that is not one. */\nexport function splitUnit(value: string): { amount: number; unit: string } | null {\n const match = new RegExp(`^(${AMOUNT})([a-z%]*)$`, 'i').exec(value.trim());\n return match ? { amount: Number(match[1]), unit: match[2] ?? '' } : null;\n}\n\n/** The four control points of a `cubic-bezier()`, or null for any other easing. */\nexport function bezierPoints(value: string): readonly [number, number, number, number] | null {\n const match = BEZIER.exec(value.trim());\n if (!match) return null;\n const [x1, y1, x2, y2] = match.slice(1, 5).map(Number) as [number, number, number, number];\n return [x1, y1, x2, y2];\n}\n","import { type CSSProperties, memo, useCallback, useMemo, useState } from 'react';\nimport { Button } from '../Button';\nimport { DisclosureRow } from '../Disclosure';\nimport { Input } from '../Input';\nimport { NumberField } from '../NumberField';\nimport { Select } from '../Select';\nimport { toHex } from './color';\nimport s from './TokenPanel.module.css';\nimport {\n bezierPoints,\n splitUnit,\n TOKEN_CATEGORIES,\n type TokenCategory,\n type TokenEntry,\n tokenCategory,\n} from './tokenTypes';\n\ntype OnChange = (name: string, value: string | null) => void;\n\n/** Props for `<TokenPanel>`. */\nexport interface TokenPanelProps {\n tokens: readonly TokenEntry[];\n /** A token's new value, or null to drop its override. Keep it stable: rows re-render only when it or their token changes. */\n onChange: OnChange;\n /** Sections held closed, by category. Omit to let the panel keep that state itself. */\n collapsed?: Readonly<Partial<Record<TokenCategory, boolean>>>;\n onCollapsedChange?: (category: TokenCategory, collapsed: boolean) => void;\n /** Files a token under a section. Defaults to `tokenCategory`. */\n categorize?: (token: TokenEntry) => TokenCategory;\n /** The fewest colors sharing a group that draw as one row of swatches. Default 3. */\n familySize?: number;\n /**\n * Row layout. `tight` puts a token on one line — name, control, Reset — with the\n * names on a fixed rail so the values read down the panel as a column, and caps\n * the field rather than letting it span the panel. Default `normal` stacks the\n * control under its name.\n */\n density?: 'tight' | 'normal';\n className?: string;\n}\n\nconst WEIGHTS = ['100', '200', '300', '400', '500', '600', '700', '800', '900'];\nconst NUMBER_FORMAT = { maximumFractionDigits: 4, useGrouping: false } as const;\n\ntype Item = { kind: 'row'; token: TokenEntry } | { kind: 'family'; group: string; tokens: TokenEntry[] };\n\nfunction itemsOf(tokens: readonly TokenEntry[], familySize: number): Item[] {\n const colors = new Map<string, number>();\n for (const token of tokens) if (token.type === 'color') colors.set(token.group, (colors.get(token.group) ?? 0) + 1);\n const families = new Map<string, Extract<Item, { kind: 'family' }>>();\n const items: Item[] = [];\n for (const token of tokens) {\n if (token.type !== 'color' || (colors.get(token.group) ?? 0) < familySize) {\n items.push({ kind: 'row', token });\n continue;\n }\n let family = families.get(token.group);\n if (!family) {\n family = { kind: 'family', group: token.group, tokens: [] };\n families.set(token.group, family);\n items.push(family);\n }\n family.tokens.push(token);\n }\n return items;\n}\n\nfunction Curve({ points, label }: { points: readonly [number, number, number, number]; label: string }) {\n const [x1, y1, x2, y2] = points;\n // y is flipped so the curve rises, and the box grows to hold an overshoot.\n const top = Math.min(0, 1 - y1, 1 - y2);\n const bottom = Math.max(1, 1 - y1, 1 - y2);\n return (\n <svg className={s.curve} viewBox={`-0.1 ${top - 0.1} 1.2 ${bottom - top + 0.2}`} role=\"img\" aria-label={label}>\n <path d={`M0 1 C${x1} ${1 - y1} ${x2} ${1 - y2} 1 0`} fill=\"none\" stroke=\"currentColor\" strokeWidth={0.08} />\n </svg>\n );\n}\n\nfunction TokenControl({ token, set }: { token: TokenEntry; set: (value: string) => void }) {\n const { name, type, value } = token;\n const label = `${name} value`;\n const hex = useMemo(() => (type === 'color' ? toHex(value) : null), [type, value]);\n\n if (type === 'dimension' || type === 'duration' || type === 'number') {\n const split = splitUnit(value);\n if (split) {\n return (\n <>\n <NumberField\n className={s.number}\n aria-label={label}\n value={split.amount}\n hideSteppers\n formatOptions={NUMBER_FORMAT}\n onChange={(amount) => {\n if (Number.isFinite(amount)) set(`${amount}${split.unit}`);\n }}\n />\n {split.unit ? <span className={s.unit}>{split.unit}</span> : null}\n </>\n );\n }\n }\n\n if (type === 'fontWeight') {\n const options = (WEIGHTS.includes(value) ? WEIGHTS : [...WEIGHTS, value]).map((weight) => ({\n value: weight,\n label: weight,\n }));\n return <Select aria-label={name} width=\"fit\" selectedKey={value} options={options} onSelectionChange={set} />;\n }\n\n const points = type === 'cubicBezier' ? bezierPoints(value) : null;\n return (\n <>\n {points ? <Curve points={points} label={`${name} curve`} /> : null}\n <Input\n className={s.field}\n aria-label={label}\n value={value}\n onChange={set}\n leadingAdornment={\n type !== 'color' ? undefined : hex ? (\n <input\n type=\"color\"\n className={s.swatchInput}\n aria-label={`${name} color`}\n value={hex}\n onChange={(event) => set(event.target.value)}\n />\n ) : (\n <span className={s.chip} style={{ '--token-color': value } as CSSProperties} aria-hidden=\"true\" />\n )\n }\n />\n </>\n );\n}\n\nconst TokenRow = memo(\n function TokenRow({ token, onChange }: { token: TokenEntry; onChange: OnChange }) {\n const set = useCallback((value: string) => onChange(token.name, value), [onChange, token.name]);\n return (\n <div className={s.row} role=\"group\" aria-label={token.name}>\n <span className={s.name} title={token.description || token.name}>\n {token.name}\n </span>\n <div className={s.edit}>\n <TokenControl token={token} set={set} />\n {token.overridden ? (\n <Button variant=\"ghost\" size=\"sm\" ariaLabel={`Reset ${token.name}`} onClick={() => onChange(token.name, null)}>\n Reset\n </Button>\n ) : null}\n </div>\n </div>\n );\n },\n // Consumers rebuild their entries each render; a row only has to redraw when what it shows changed.\n (a, b) =>\n a.onChange === b.onChange &&\n a.token.name === b.token.name &&\n a.token.type === b.token.type &&\n a.token.value === b.token.value &&\n a.token.overridden === b.token.overridden &&\n a.token.description === b.token.description,\n);\n\nfunction Family({ group, tokens, onChange }: { group: string; tokens: readonly TokenEntry[]; onChange: OnChange }) {\n const [picked, setPicked] = useState<string | null>(null);\n const token = tokens.find((t) => t.name === picked) ?? null;\n return (\n <div className={s.family} role=\"group\" aria-label={group}>\n <span className={s.name}>{group}</span>\n <div className={s.strip}>\n {tokens.map((t) => (\n <button\n key={t.name}\n type=\"button\"\n className={s.swatch}\n style={{ '--token-color': t.value } as CSSProperties}\n aria-label={t.name}\n aria-pressed={t.name === picked}\n title={`${t.name}: ${t.value}`}\n data-overridden={t.overridden ? '' : undefined}\n onClick={() => setPicked((current) => (current === t.name ? null : t.name))}\n />\n ))}\n </div>\n {token ? <TokenRow token={token} onChange={onChange} /> : null}\n </div>\n );\n}\n\nfunction Section({\n title,\n open,\n onToggle,\n tokens,\n familySize,\n onChange,\n}: {\n title: string;\n open: boolean;\n onToggle: () => void;\n tokens: readonly TokenEntry[];\n familySize: number;\n onChange: OnChange;\n}) {\n const items = useMemo(() => itemsOf(tokens, familySize), [tokens, familySize]);\n return (\n <section className={s.section} aria-label={title}>\n <DisclosureRow className={s.sectionHead} open={open} onToggle={onToggle} label={title}>\n <span aria-hidden=\"true\">{title}</span>\n </DisclosureRow>\n {open ? (\n <div className={s.sectionBody}>\n {items.map((item) =>\n item.kind === 'row' ? (\n <TokenRow key={item.token.name} token={item.token} onChange={onChange} />\n ) : (\n <Family key={`family:${item.group}`} group={item.group} tokens={item.tokens} onChange={onChange} />\n ),\n )}\n </div>\n ) : null}\n </section>\n );\n}\n\n/**\n * Edits a set of design tokens by type: collapsible sections by category, a\n * color group drawn as one row of swatches sized to fit, and a control for each\n * type — a number with its unit for dimensions and durations, the nine weights\n * for a font weight, a curve beside a `cubic-bezier()`, a swatch beside a color,\n * and text for everything else.\n */\nexport function TokenPanel({\n tokens,\n onChange,\n collapsed,\n onCollapsedChange,\n categorize = tokenCategory,\n familySize = 3,\n density = 'normal',\n className,\n}: TokenPanelProps) {\n const [ownCollapsed, setOwnCollapsed] = useState<Partial<Record<TokenCategory, boolean>>>({});\n const closed = collapsed ?? ownCollapsed;\n const byCategory = useMemo(() => {\n const sections = new Map<TokenCategory, TokenEntry[]>();\n for (const token of tokens) {\n const category = categorize(token);\n sections.set(category, [...(sections.get(category) ?? []), token]);\n }\n return sections;\n }, [tokens, categorize]);\n\n return (\n <div className={[s.panel, density === 'tight' && s.tight, className].filter(Boolean).join(' ')}>\n {TOKEN_CATEGORIES.map(({ id, title }) => {\n const inSection = byCategory.get(id);\n if (!inSection) return null;\n const open = !closed[id];\n return (\n <Section\n key={id}\n title={title}\n open={open}\n onToggle={() => {\n if (collapsed === undefined) setOwnCollapsed((prev) => ({ ...prev, [id]: open }));\n onCollapsedChange?.(id, open);\n }}\n tokens={inSection}\n familySize={familySize}\n onChange={onChange}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAAA,IAAM,IAAM,8CACN,IAAM,yDACN,IAAiB,oEACjB,IAAW,IAAI,IAAI;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAIF,SAAS,IAA4B;AACnC,QAAO,OAAO,MAAQ,OAAe,OAAO,IAAI,YAAa,cACxD,MAAU,IAAI,SAAS,SAAS,EAAM,GACvC;;AAIN,SAAgB,EAAc,GAAe,IAAqB,GAAiB,EAAW;CAC5F,IAAM,IAAI,EAAM,MAAM;AAItB,QAFI,CAAC,KAAK,EAAE,SAAS,OAAO,GAAS,KACjC,IAAiB,EAAS,EAAE,GACzB,EAAI,KAAK,EAAE,IAAI,EAAe,KAAK,EAAE,IAAI,EAAS,IAAI,EAAE,aAAa,CAAC;;AAG/E,SAAS,EAAM,GAA0B;AACvC,KAAI,EAAI,KAAK,EAAE,EAAE;EACf,IAAM,IAAS,EAAE,MAAM,EAAE,CAAC,aAAa;AACvC,SAAO,IAAI,EAAO,UAAU,IAAI,CAAC,GAAG,EAAO,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,MAAM,IAAI,EAAE,CAAC,KAAK,GAAG,GAAG,EAAO,MAAM,GAAG,EAAE;;CAEzG,IAAM,IAAM,EAAI,KAAK,EAAE;AACvB,QAAO,IACH,IAAI,EACD,MAAM,GAAG,EAAE,CACX,KAAK,MAAM,KAAK,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,CAClE,KAAK,GAAG,KACX;;AAGN,IAAI;AAGJ,SAAS,EAAW,GAA8B;AAChD,KAAI,MAAU,KAAA,EACZ,KAAI;AACF,MAAQ,SAAS,cA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AAU,CAAC,GAAI,EAAS,IAAI,EAAS,IAAI,EAAE,EAAG,EAAM,CAAC;;AAEpE,SAAO;IACN,CAAC,GAAQ,EAAW,CAAC;AAExB,QACE,kBAAC,OAAD;EAAK,WAAW;GAAC,EAAE;GAAO,MAAY,WAAW,EAAE;GAAO;GAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAC3F,EAAiB,KAAK,EAAE,OAAI,eAAY;GACvC,IAAM,IAAY,EAAW,IAAI,EAAG;AACpC,OAAI,CAAC,EAAW,QAAO;GACvB,IAAM,IAAO,CAAC,EAAO;AACrB,UACE,kBAAC,GAAD;IAES;IACD;IACN,gBAAgB;AAEd,KADI,MAAc,KAAA,KAAW,GAAiB,OAAU;MAAE,GAAG;OAAO,IAAK;MAAM,EAAE,EACjF,IAAoB,GAAI,EAAK;;IAE/B,QAAQ;IACI;IACF;IACV,EAVK,EAUL;IAEJ;EACE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolButton-Dd-1T5aX.js","names":[],"sources":["../../src/components/ToolButton/ToolButton.module.css","../../src/components/ToolButton/ToolButton.tsx"],"sourcesContent":[".button {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 2px;\n min-width: 44px;\n padding: 6px 4px;\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n cursor: default;\n font-family: inherit;\n font-size: var(--wzl-font-size-xs);\n line-height: 1.1;\n}\n.button:hover:not([disabled]) {\n background: var(--wzl-surface-hover);\n color: var(--wzl-fg);\n}\n.button:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: -2px;\n}\n.button.active {\n background: var(--wzl-surface-pressed);\n border-color: var(--wzl-accent);\n color: var(--wzl-fg);\n}\n.button[disabled] {\n opacity: 0.4;\n}\n\n.icon { display: block; }\n.icon > svg { display: block; }\n.label { font-size: var(--wzl-font-size-xs); }\n.shortcut {\n color: var(--wzl-fg-muted);\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: var(--wzl-font-size-2xs);\n}\n","import type { KeyboardEvent, ReactNode } from 'react';\nimport { Focusable } from 'react-aria-components';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport s from './ToolButton.module.css';\n\n/** Props for {@link ToolButton}. */\nexport interface ToolButtonProps {\n /** Icon node (typically an SVG component). */\n icon: ReactNode;\n /** Human-readable label shown under the icon. */\n label: string;\n /** Optional shortcut hint (e.g. \"V\" or \"⌘Z\"). */\n shortcut?: string;\n /** Selected/active state — toggles the active visual treatment. */\n active?: boolean;\n /** Disabled state — passes through to the underlying button. */\n disabled?: boolean;\n /**\n * When true, sets `aria-disabled=\"true\"` on the button without using the\n * native `disabled` attribute. This keeps the button focusable and reachable\n * by keyboard (roving-tabindex still applies) while marking it as ineligible\n * to screen readers. The caller is responsible for making `onClick` a no-op.\n */\n ariaDisabled?: boolean;\n /**\n * Whether this button is the currently tabbable member of its toolbar.\n * Toolbars use roving tabindex: exactly one button has `tabIndex=0` at\n * a time; the rest are `-1`. Caller manages which.\n */\n tabbable?: boolean;\n /** Click handler. */\n onClick(): void;\n /** Key handler for the underlying button — a toolbar's roving-tabindex\n * navigation attaches here. */\n onKeyDown?(e: KeyboardEvent<HTMLElement>): void;\n /**\n * Tooltip content. Defaults to `label` (plus `shortcut` if provided).\n */\n title?: string;\n /** Additional class for the root button. */\n className?: string;\n}\n\n/**\n * Generic icon-+-label toolbar button — building block for `ToolPalette`\n * and similar surfaces. Headless about layout direction (parent group\n * supplies flex direction via `ToolGroup`). Theme via `--wzl-*` tokens.\n */\nexport function ToolButton(props: ToolButtonProps) {\n const {\n icon, label, shortcut, active, disabled, ariaDisabled, tabbable,\n onClick, onKeyDown, title, className,\n } = props;\n const resolvedTitle = title ?? (shortcut ? `${label} (${shortcut})` : label);\n const cls = [s.button, active && s.active, className].filter(Boolean).join(' ');\n return (\n <TooltipTrigger isDisabled={disabled}>\n <Focusable isDisabled={disabled}>\n <button\n type=\"button\"\n tabIndex={tabbable ? 0 : -1}\n className={cls}\n aria-current={active ? 'true' : undefined}\n aria-disabled={ariaDisabled ? 'true' : undefined}\n disabled={disabled}\n onClick={onClick}\n onKeyDown={onKeyDown}\n >\n <span className={s.icon} aria-hidden=\"true\">{icon}</span>\n <span className={s.label}>{label}</span>\n {shortcut && <span className={s.shortcut}>{shortcut}</span>}\n </button>\n </Focusable>\n <Tooltip>{resolvedTitle}</Tooltip>\n </TooltipTrigger>\n );\n}\n"],"mappings":";;;;;;;;;;;;ACgDA,SAAgB,EAAW,GAAwB;CACjD,IAAM,EACJ,SAAM,UAAO,aAAU,WAAQ,aAAU,iBAAc,aACvD,YAAS,cAAW,UAAO,iBACzB,GACE,IAAgB,MAAU,IAAW,GAAG,EAAM,IAAI,EAAS,KAAK,IAChE,IAAM;EAAC,EAAE;EAAQ,KAAU,EAAE;EAAQ;EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;AAC/E,QACE,kBAAC,GAAD;EAAgB,YAAY;YAA5B,CACE,kBAAC,GAAD;GAAW,YAAY;aACrB,kBAAC,UAAD;IACE,MAAK;IACL,UAAU,IAAW,IAAI;IACzB,WAAW;IACX,gBAAc,IAAS,SAAS,KAAA;IAChC,iBAAe,IAAe,SAAS,KAAA;IAC7B;IACD;IACE;cARb;KAUE,kBAAC,QAAD;MAAM,WAAW,EAAE;MAAM,eAAY;gBAAQ;MAAY,CAAA;KACzD,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAQ;MAAa,CAAA;KACvC,KAAY,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAW;MAAgB,CAAA;KACpD;;GACC,CAAA,EACZ,kBAAC,GAAD,EAAA,UAAU,GAAwB,CAAA,CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolGroup-BBI-W-Gm.js","names":[],"sources":["../../src/components/ToolGroup/ToolGroup.module.css","../../src/components/ToolGroup/ToolGroup.tsx"],"sourcesContent":[".group {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.group.horizontal {\n flex-direction: row;\n}\n","import type { ReactNode } from 'react';\nimport s from './ToolGroup.module.css';\n\n/** Props for {@link ToolGroup}. */\nexport interface ToolGroupProps {\n children: ReactNode;\n /**\n * Lays children along an axis. `'vertical'` (default) stacks them in\n * a column; `'horizontal'` lays them in a row. Independent of the\n * parent toolbar's own orientation.\n */\n orientation?: 'vertical' | 'horizontal';\n /**\n * Optional `data-group` attribute — useful for parents that want to\n * select the group from CSS or tests by name.\n */\n groupKey?: string;\n /** Accessible name for the group (rendered as `aria-label`). */\n ariaLabel?: string;\n className?: string;\n}\n\n/**\n * Generic toolbar group — a `role=\"group\"` flex container that arranges\n * `<ToolButton>`s (or any children) along a chosen axis. No visual chrome\n * beyond layout; theming lives on the buttons.\n */\nexport function ToolGroup(props: ToolGroupProps) {\n const { children, orientation = 'vertical', groupKey, ariaLabel, className } = props;\n const cls = [s.group, orientation === 'horizontal' && s.horizontal, className]\n .filter(Boolean).join(' ');\n return (\n <div className={cls} role=\"group\" data-group={groupKey} aria-label={ariaLabel}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;AC2BA,SAAgB,EAAU,GAAuB;CAC/C,IAAM,EAAE,aAAU,iBAAc,YAAY,aAAU,cAAW,iBAAc;AAG/E,QACE,kBAAC,OAAD;EAAK,WAHK;GAAC,EAAE;GAAO,MAAgB,gBAAgB,EAAE;GAAY;GAAU,CAC3E,OAAO,QAAQ,CAAC,KAAK,IAEN;EAAK,MAAK;EAAQ,cAAY;EAAU,cAAY;EACjE;EACG,CAAA"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
var n = {
|
|
3
|
-
root: "_root_cfvzx_13",
|
|
4
|
-
label: "_label_cfvzx_25",
|
|
5
|
-
controls: "_controls_cfvzx_6"
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/components/ToolOptionsBar/ToolOptionsBar.tsx
|
|
9
|
-
function r(r) {
|
|
10
|
-
let { label: i, children: a, className: o } = r;
|
|
11
|
-
return /* @__PURE__ */ t("div", {
|
|
12
|
-
className: [n.root, o].filter(Boolean).join(" "),
|
|
13
|
-
role: "toolbar",
|
|
14
|
-
"aria-label": i,
|
|
15
|
-
children: [i !== void 0 && /* @__PURE__ */ e("span", {
|
|
16
|
-
className: n.label,
|
|
17
|
-
children: i
|
|
18
|
-
}), /* @__PURE__ */ e("div", {
|
|
19
|
-
className: n.controls,
|
|
20
|
-
children: a
|
|
21
|
-
})]
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { r as t };
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=ToolOptionsBar-B2xPWzJf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolOptionsBar-B2xPWzJf.js","names":[],"sources":["../../src/components/ToolOptionsBar/ToolOptionsBar.module.css","../../src/components/ToolOptionsBar/ToolOptionsBar.tsx"],"sourcesContent":["/* Horizontal strip reserved above the workspace for contextual tool\n options. Fixed height so mounting/unmounting content never resizes\n the workspace beneath it — that's the whole reason this row exists\n as permanent chrome rather than an on-demand overlay.\n\n Overflow: when controls exceed the available width, `.controls`\n scrolls horizontally rather than wrapping (which would grow the row\n and defeat the fixed-height guarantee above) or clipping (which\n would hide controls with no way to reach them). A flyout/long-press\n affordance was considered and rejected — grouped, directly visible\n layouts are preferred in this repo. */\n\n.root {\n display: flex;\n align-items: center;\n gap: 8px;\n height: var(--wzl-tb-height, 28px);\n padding: 0 8px;\n background: var(--wzl-surface);\n border-bottom: 1px solid var(--wzl-border);\n color: var(--wzl-fg);\n overflow: hidden;\n}\n\n.label {\n flex: 0 0 auto;\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-bold);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: var(--wzl-fg-muted);\n white-space: nowrap;\n}\n\n.controls {\n display: flex;\n align-items: center;\n gap: 6px;\n flex: 1 1 auto;\n min-width: 0;\n height: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: thin;\n}\n\n/* Firefox gets a thin scrollbar for free via `scrollbar-width` above.\n * Chromium/WebKit need it spelled out — on a classic (non-overlay)\n * scrollbar theme (default on Windows Chrome/Edge), an unstyled\n * horizontal scrollbar is ~15-17px tall and renders *inside* this box,\n * clipping/off-centering the row's controls. That would reintroduce the\n * exact height instability the scroll-over-wrap overflow choice above\n * exists to avoid — just at the row's inner edge instead of its outer\n * one. Pin it thin and out of the way instead. */\n.controls::-webkit-scrollbar {\n height: 4px;\n}\n.controls::-webkit-scrollbar-track {\n background: transparent;\n}\n.controls::-webkit-scrollbar-thumb {\n background: var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n}\n","import type { ReactNode } from 'react';\nimport s from './ToolOptionsBar.module.css';\n\n/** Props for {@link ToolOptionsBar}. */\nexport interface ToolOptionsBarProps {\n /**\n * Context label for the row — e.g. the active tool's name. Rendered\n * before the children and doubles as the toolbar's `aria-label`. Omit\n * it and the row still renders (it's a permanently reserved slot), just\n * without an accessible name.\n *\n * Using `label` for both the visible text and `aria-label` means a\n * screen reader announces it twice when landing on the toolbar (\"Text,\n * toolbar\", then \"Text\" again when browsing into the visible span).\n * `aria-labelledby` would avoid the echo at the cost of id plumbing and\n * an awkward no-`id`-to-point-at case when `label` is omitted. The\n * double-announcement is common enough for labelled landmark regions\n * that it's left as-is — considered, not missed.\n */\n label?: string;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * Horizontal strip reserved above the workspace for contextual tool\n * options — its first tenant is the character controls a text tool\n * exposes while a caret range is active. Pure chrome: it renders an\n * optional label and a children slot, nothing else. It knows nothing\n * about text, or about any specific tool — any tool can fill it.\n *\n * The row always renders, even with no `label` and no `children`,\n * because the app reserves its height permanently rather than mounting\n * it on demand — mounting mid-edit would resize the workspace under a\n * canvas that's sized to the page.\n *\n * `role=\"toolbar\"` without roving tabindex: the ARIA authoring practices\n * expect arrow-key roving focus across a toolbar's items, but this\n * component doesn't own or know the shape of its children — they're\n * arbitrary, possibly compound controls (`NumberField`, `Select`,\n * `ColorField`) that already use arrow keys for their own value editing.\n * Imposing roving focus here would fight those controls' own key\n * handling. Tab order falls back to normal DOM order for now; revisit\n * once the first tenant's control set is concrete and a roving-focus\n * contract can be designed in coordination with those controls.\n */\nexport function ToolOptionsBar(props: ToolOptionsBarProps) {\n const { label, children, className } = props;\n const cls = [s.root, className].filter(Boolean).join(' ');\n return (\n <div className={cls} role=\"toolbar\" aria-label={label}>\n {label !== undefined && <span className={s.label}>{label}</span>}\n <div className={s.controls}>{children}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AC8CA,SAAgB,EAAe,GAA4B;CACzD,IAAM,EAAE,UAAO,aAAU,iBAAc;AAEvC,QACE,kBAAC,OAAD;EAAK,WAFK,CAAC,EAAE,MAAM,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAEnC;EAAK,MAAK;EAAU,cAAY;YAAhD,CACG,MAAU,KAAA,KAAa,kBAAC,QAAD;GAAM,WAAW,EAAE;aAAQ;GAAa,CAAA,EAChE,kBAAC,OAAD;GAAK,WAAW,EAAE;GAAW;GAAe,CAAA,CACxC"}
|