@weasel-js/ui 0.5.0 → 0.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-CiKvEvXi.js +63 -0
- package/dist/chunks/ActionBar-CiKvEvXi.js.map +1 -0
- package/dist/chunks/ActionsBar-CzU6Of3B.js +94 -0
- package/dist/chunks/ActionsBar-CzU6Of3B.js.map +1 -0
- package/dist/chunks/Badge-DU8ihE7Z.js +2942 -0
- package/dist/chunks/Badge-DU8ihE7Z.js.map +1 -0
- package/dist/chunks/Button-9QNIYugK.js +87 -0
- package/dist/chunks/Button-9QNIYugK.js.map +1 -0
- package/dist/chunks/Callout-CvTKW1sd.js +114 -0
- package/dist/chunks/Callout-CvTKW1sd.js.map +1 -0
- package/dist/chunks/Checkbox-BeWFZr1M.js +47 -0
- package/dist/chunks/Checkbox-BeWFZr1M.js.map +1 -0
- package/dist/chunks/ColorField-B7vHaU5G.js +60 -0
- package/dist/chunks/ColorField-B7vHaU5G.js.map +1 -0
- package/dist/chunks/ComboBox-yfrxG0_I.js +88 -0
- package/dist/chunks/ComboBox-yfrxG0_I.js.map +1 -0
- package/dist/chunks/CurveEditor-BEQtef4P.js +786 -0
- package/dist/chunks/CurveEditor-BEQtef4P.js.map +1 -0
- package/dist/chunks/DataGrid-mUq38k0Q.js +186 -0
- package/dist/chunks/DataGrid-mUq38k0Q.js.map +1 -0
- package/dist/chunks/Dialog-tAi14bY3.js +58 -0
- package/dist/chunks/Dialog-tAi14bY3.js.map +1 -0
- package/dist/chunks/Field-4cagmYlT.js +31 -0
- package/dist/chunks/Field-4cagmYlT.js.map +1 -0
- package/dist/chunks/Input-DRei6KJr.js +55 -0
- package/dist/chunks/Input-DRei6KJr.js.map +1 -0
- package/dist/chunks/Keycaps-B9dJMYx_.js +397 -0
- package/dist/chunks/Keycaps-B9dJMYx_.js.map +1 -0
- package/dist/chunks/NumberField-BAmJwxw0.js +59 -0
- package/dist/chunks/NumberField-BAmJwxw0.js.map +1 -0
- package/dist/chunks/OptionsBar-CHOP_CiW.js +98 -0
- package/dist/chunks/OptionsBar-CHOP_CiW.js.map +1 -0
- package/dist/chunks/Plot2D-CEnhzodm.js +168 -0
- package/dist/chunks/Plot2D-CEnhzodm.js.map +1 -0
- package/dist/chunks/PointPlotter-Dvh5cyOC.js +16 -0
- package/dist/chunks/PointPlotter-Dvh5cyOC.js.map +1 -0
- package/dist/chunks/Powerline-W_yqAVMc.js +36 -0
- package/dist/chunks/Powerline-W_yqAVMc.js.map +1 -0
- package/dist/chunks/Prefs-NOoGuUHy.js +238 -0
- package/dist/chunks/Prefs-NOoGuUHy.js.map +1 -0
- package/dist/chunks/RadioGroup-DUlTy95a.js +49 -0
- package/dist/chunks/RadioGroup-DUlTy95a.js.map +1 -0
- package/dist/chunks/RangeSlider-Bks9GQuO.js +52 -0
- package/dist/chunks/RangeSlider-Bks9GQuO.js.map +1 -0
- package/dist/chunks/Select-BV70VU5O.js +97 -0
- package/dist/chunks/Select-BV70VU5O.js.map +1 -0
- package/dist/chunks/SelectionPanel-D_U7GKup.js +283 -0
- package/dist/chunks/SelectionPanel-D_U7GKup.js.map +1 -0
- package/dist/chunks/Sidebar-Bk9_TPhX.js +26 -0
- package/dist/chunks/Sidebar-Bk9_TPhX.js.map +1 -0
- package/dist/chunks/SidebarPanel-Nd9Od5WD.js +59 -0
- package/dist/chunks/SidebarPanel-Nd9Od5WD.js.map +1 -0
- package/dist/chunks/Slider-sUJGgmKR.js +221 -0
- package/dist/chunks/Slider-sUJGgmKR.js.map +1 -0
- package/dist/chunks/Switch-iUmlnP_b.js +27 -0
- package/dist/chunks/Switch-iUmlnP_b.js.map +1 -0
- package/dist/chunks/Tabs-DCs-Ww2f.js +41 -0
- package/dist/chunks/Tabs-DCs-Ww2f.js.map +1 -0
- package/dist/chunks/Toast-NdSJo2vj.js +128 -0
- package/dist/chunks/Toast-NdSJo2vj.js.map +1 -0
- package/dist/chunks/ToggleBar-BfcvLaOr.js +120 -0
- package/dist/chunks/ToggleBar-BfcvLaOr.js.map +1 -0
- package/dist/chunks/ToolButton-GAzBOvcR.js +53 -0
- package/dist/chunks/ToolButton-GAzBOvcR.js.map +1 -0
- package/dist/chunks/ToolGroup-Btg47vJF.js +25 -0
- package/dist/chunks/ToolGroup-Btg47vJF.js.map +1 -0
- package/dist/chunks/ToolPalette-C8V-I-uX.js +117 -0
- package/dist/chunks/ToolPalette-C8V-I-uX.js.map +1 -0
- package/dist/chunks/Tooltip-Clgn4trm.js +39 -0
- package/dist/chunks/Tooltip-Clgn4trm.js.map +1 -0
- package/dist/chunks/keyGlyph-BDH5fqkO.js +22 -0
- package/dist/chunks/keyGlyph-BDH5fqkO.js.map +1 -0
- package/dist/color/oklch.d.ts +14 -0
- package/dist/color/oklch.d.ts.map +1 -0
- package/dist/components/ActionBar/ActionBar.d.ts +36 -0
- package/dist/components/ActionBar/ActionBar.d.ts.map +1 -0
- package/dist/components/ActionBar/index.d.ts +3 -0
- package/dist/components/ActionBar/index.d.ts.map +1 -0
- package/dist/components/ActionBar/index.js +2 -0
- package/dist/components/ActionsBar/ActionsBar.d.ts +20 -0
- package/dist/components/ActionsBar/ActionsBar.d.ts.map +1 -0
- package/dist/components/ActionsBar/index.d.ts +3 -0
- package/dist/components/ActionsBar/index.d.ts.map +1 -0
- package/dist/components/ActionsBar/index.js +2 -0
- package/dist/components/Badge/Badge.d.ts +50 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/bases/ChamferedRect.d.ts +8 -0
- package/dist/components/Badge/bases/ChamferedRect.d.ts.map +1 -0
- package/dist/components/Badge/bases/OctantBSpline.d.ts +71 -0
- package/dist/components/Badge/bases/OctantBSpline.d.ts.map +1 -0
- package/dist/components/Badge/bases/OctantSpline.d.ts +79 -0
- package/dist/components/Badge/bases/OctantSpline.d.ts.map +1 -0
- package/dist/components/Badge/bases/Polygon.d.ts +8 -0
- package/dist/components/Badge/bases/Polygon.d.ts.map +1 -0
- package/dist/components/Badge/bases/Powerline.d.ts +13 -0
- package/dist/components/Badge/bases/Powerline.d.ts.map +1 -0
- package/dist/components/Badge/bases/Puzzle.d.ts +15 -0
- package/dist/components/Badge/bases/Puzzle.d.ts.map +1 -0
- package/dist/components/Badge/bases/Quatrefoil.d.ts +46 -0
- package/dist/components/Badge/bases/Quatrefoil.d.ts.map +1 -0
- package/dist/components/Badge/bases/Ribbon.d.ts +12 -0
- package/dist/components/Badge/bases/Ribbon.d.ts.map +1 -0
- package/dist/components/Badge/bases/RoundedRect.d.ts +14 -0
- package/dist/components/Badge/bases/RoundedRect.d.ts.map +1 -0
- package/dist/components/Badge/bases/edgeProfiles.d.ts +6 -0
- package/dist/components/Badge/bases/edgeProfiles.d.ts.map +1 -0
- package/dist/components/Badge/bases/index.d.ts +24 -0
- package/dist/components/Badge/bases/index.d.ts.map +1 -0
- package/dist/components/Badge/bases/polygonSampler.d.ts +4 -0
- package/dist/components/Badge/bases/polygonSampler.d.ts.map +1 -0
- package/dist/components/Badge/bases/types.d.ts +69 -0
- package/dist/components/Badge/bases/types.d.ts.map +1 -0
- package/dist/components/Badge/effects/Aqua.d.ts +49 -0
- package/dist/components/Badge/effects/Aqua.d.ts.map +1 -0
- package/dist/components/Badge/effects/Bevel.d.ts +11 -0
- package/dist/components/Badge/effects/Bevel.d.ts.map +1 -0
- package/dist/components/Badge/effects/Bevel2.d.ts +11 -0
- package/dist/components/Badge/effects/Bevel2.d.ts.map +1 -0
- package/dist/components/Badge/effects/Bites.d.ts +10 -0
- package/dist/components/Badge/effects/Bites.d.ts.map +1 -0
- package/dist/components/Badge/effects/Metal.d.ts +41 -0
- package/dist/components/Badge/effects/Metal.d.ts.map +1 -0
- package/dist/components/Badge/effects/Outline.d.ts +17 -0
- package/dist/components/Badge/effects/Outline.d.ts.map +1 -0
- package/dist/components/Badge/effects/Perforations.d.ts +11 -0
- package/dist/components/Badge/effects/Perforations.d.ts.map +1 -0
- package/dist/components/Badge/effects/Puffs.d.ts +10 -0
- package/dist/components/Badge/effects/Puffs.d.ts.map +1 -0
- package/dist/components/Badge/effects/Rivets.d.ts +13 -0
- package/dist/components/Badge/effects/Rivets.d.ts.map +1 -0
- package/dist/components/Badge/effects/Scallops.d.ts +10 -0
- package/dist/components/Badge/effects/Scallops.d.ts.map +1 -0
- package/dist/components/Badge/effects/Shadow.d.ts +11 -0
- package/dist/components/Badge/effects/Shadow.d.ts.map +1 -0
- package/dist/components/Badge/effects/Sheen.d.ts +10 -0
- package/dist/components/Badge/effects/Sheen.d.ts.map +1 -0
- package/dist/components/Badge/effects/Spikes.d.ts +20 -0
- package/dist/components/Badge/effects/Spikes.d.ts.map +1 -0
- package/dist/components/Badge/effects/Sunbeams.d.ts +29 -0
- package/dist/components/Badge/effects/Sunbeams.d.ts.map +1 -0
- package/dist/components/Badge/effects/Woodgrain.d.ts +12 -0
- package/dist/components/Badge/effects/Woodgrain.d.ts.map +1 -0
- package/dist/components/Badge/effects/index.d.ts +40 -0
- package/dist/components/Badge/effects/index.d.ts.map +1 -0
- package/dist/components/Badge/effects/rangeMask.d.ts +13 -0
- package/dist/components/Badge/effects/rangeMask.d.ts.map +1 -0
- package/dist/components/Badge/index.d.ts +4 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/Badge/shapeControls.d.ts +29 -0
- package/dist/components/Badge/shapeControls.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Beavis.d.ts +11 -0
- package/dist/components/Badge/shapes/Beavis.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Cloud.d.ts +11 -0
- package/dist/components/Badge/shapes/Cloud.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Coffin.d.ts +12 -0
- package/dist/components/Badge/shapes/Coffin.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Crest.d.ts +8 -0
- package/dist/components/Badge/shapes/Crest.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Hexagon.d.ts +10 -0
- package/dist/components/Badge/shapes/Hexagon.d.ts.map +1 -0
- package/dist/components/Badge/shapes/House.d.ts +9 -0
- package/dist/components/Badge/shapes/House.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Notched.d.ts +10 -0
- package/dist/components/Badge/shapes/Notched.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Perforated.d.ts +8 -0
- package/dist/components/Badge/shapes/Perforated.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Pill.d.ts +4 -0
- package/dist/components/Badge/shapes/Pill.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Plain.d.ts +4 -0
- package/dist/components/Badge/shapes/Plain.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Plaque.d.ts +12 -0
- package/dist/components/Badge/shapes/Plaque.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Postage.d.ts +9 -0
- package/dist/components/Badge/shapes/Postage.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Quatrefoil.d.ts +19 -0
- package/dist/components/Badge/shapes/Quatrefoil.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Receipt.d.ts +9 -0
- package/dist/components/Badge/shapes/Receipt.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Ribbon.d.ts +13 -0
- package/dist/components/Badge/shapes/Ribbon.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Scalloped.d.ts +9 -0
- package/dist/components/Badge/shapes/Scalloped.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Shield.d.ts +11 -0
- package/dist/components/Badge/shapes/Shield.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Sparkler.d.ts +10 -0
- package/dist/components/Badge/shapes/Sparkler.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Square.d.ts +8 -0
- package/dist/components/Badge/shapes/Square.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Starburst.d.ts +11 -0
- package/dist/components/Badge/shapes/Starburst.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Urn.d.ts +4 -0
- package/dist/components/Badge/shapes/Urn.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Wood.d.ts +4 -0
- package/dist/components/Badge/shapes/Wood.d.ts.map +1 -0
- package/dist/components/Badge/shapes/index.d.ts +46 -0
- package/dist/components/Badge/shapes/index.d.ts.map +1 -0
- package/dist/components/Badge/types.d.ts +39 -0
- package/dist/components/Badge/types.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +29 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Button/index.js +2 -0
- package/dist/components/Callout/Callout.d.ts +67 -0
- package/dist/components/Callout/Callout.d.ts.map +1 -0
- package/dist/components/Callout/index.d.ts +3 -0
- package/dist/components/Callout/index.d.ts.map +1 -0
- package/dist/components/Callout/index.js +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +15 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/Checkbox/index.js +2 -0
- package/dist/components/ColorField/ColorField.d.ts +28 -0
- package/dist/components/ColorField/ColorField.d.ts.map +1 -0
- package/dist/components/ColorField/index.d.ts +2 -0
- package/dist/components/ColorField/index.d.ts.map +1 -0
- package/dist/components/ColorField/index.js +2 -0
- package/dist/components/ComboBox/ComboBox.d.ts +36 -0
- package/dist/components/ComboBox/ComboBox.d.ts.map +1 -0
- package/dist/components/ComboBox/index.d.ts +3 -0
- package/dist/components/ComboBox/index.d.ts.map +1 -0
- package/dist/components/ComboBox/index.js +2 -0
- package/dist/components/CurveEditor/CurveEditor.d.ts +41 -0
- package/dist/components/CurveEditor/CurveEditor.d.ts.map +1 -0
- package/dist/components/CurveEditor/LayeredCurveEditor.d.ts +40 -0
- package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -0
- package/dist/components/CurveEditor/catmullRom.d.ts +35 -0
- package/dist/components/CurveEditor/catmullRom.d.ts.map +1 -0
- package/dist/components/CurveEditor/createFunctionLayer.d.ts +72 -0
- package/dist/components/CurveEditor/createFunctionLayer.d.ts.map +1 -0
- package/dist/components/CurveEditor/hitTest.d.ts +29 -0
- package/dist/components/CurveEditor/hitTest.d.ts.map +1 -0
- package/dist/components/CurveEditor/index.d.ts +7 -0
- package/dist/components/CurveEditor/index.d.ts.map +1 -0
- package/dist/components/CurveEditor/index.js +2 -0
- package/dist/components/CurveEditor/interpolation.d.ts +15 -0
- package/dist/components/CurveEditor/interpolation.d.ts.map +1 -0
- package/dist/components/CurveEditor/layerTypes.d.ts +103 -0
- package/dist/components/CurveEditor/layerTypes.d.ts.map +1 -0
- package/dist/components/CurveEditor/monotone.d.ts +25 -0
- package/dist/components/CurveEditor/monotone.d.ts.map +1 -0
- package/dist/components/CurveEditor/setCurveOp.d.ts +35 -0
- package/dist/components/CurveEditor/setCurveOp.d.ts.map +1 -0
- package/dist/components/DataGrid/DataGrid.d.ts +34 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -0
- package/dist/components/DataGrid/index.d.ts +3 -0
- package/dist/components/DataGrid/index.d.ts.map +1 -0
- package/dist/components/DataGrid/index.js +2 -0
- package/dist/components/Dialog/Dialog.d.ts +29 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/index.d.ts +3 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Dialog/index.js +2 -0
- package/dist/components/Field/Field.d.ts +25 -0
- package/dist/components/Field/Field.d.ts.map +1 -0
- package/dist/components/Field/index.d.ts +3 -0
- package/dist/components/Field/index.d.ts.map +1 -0
- package/dist/components/Field/index.js +2 -0
- package/dist/components/Input/Input.d.ts +28 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/index.d.ts +3 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Input/index.js +2 -0
- package/dist/components/Keycaps/Keycap.d.ts +34 -0
- package/dist/components/Keycaps/Keycap.d.ts.map +1 -0
- package/dist/components/Keycaps/Keycaps.d.ts +29 -0
- package/dist/components/Keycaps/Keycaps.d.ts.map +1 -0
- package/dist/components/Keycaps/index.d.ts +8 -0
- package/dist/components/Keycaps/index.d.ts.map +1 -0
- package/dist/components/Keycaps/index.js +3 -0
- package/dist/components/Keycaps/keyGlyph.d.ts +7 -0
- package/dist/components/Keycaps/keyGlyph.d.ts.map +1 -0
- package/dist/components/Keycaps/keySpecsFromMods.d.ts +81 -0
- package/dist/components/Keycaps/keySpecsFromMods.d.ts.map +1 -0
- package/dist/components/NumberField/NumberField.d.ts +25 -0
- package/dist/components/NumberField/NumberField.d.ts.map +1 -0
- package/dist/components/NumberField/index.d.ts +3 -0
- package/dist/components/NumberField/index.d.ts.map +1 -0
- package/dist/components/NumberField/index.js +2 -0
- package/dist/components/OptionsBar/OptionsBar.d.ts +25 -0
- package/dist/components/OptionsBar/OptionsBar.d.ts.map +1 -0
- package/dist/components/OptionsBar/index.d.ts +3 -0
- package/dist/components/OptionsBar/index.d.ts.map +1 -0
- package/dist/components/OptionsBar/index.js +2 -0
- package/dist/components/Plot2D/Plot2D.d.ts +60 -0
- package/dist/components/Plot2D/Plot2D.d.ts.map +1 -0
- package/dist/components/Plot2D/geometry.d.ts +24 -0
- package/dist/components/Plot2D/geometry.d.ts.map +1 -0
- package/dist/components/Plot2D/index.d.ts +3 -0
- package/dist/components/Plot2D/index.d.ts.map +1 -0
- package/dist/components/Plot2D/index.js +2 -0
- package/dist/components/PointPlotter/PointPlotter.d.ts +51 -0
- package/dist/components/PointPlotter/PointPlotter.d.ts.map +1 -0
- package/dist/components/PointPlotter/index.d.ts +2 -0
- package/dist/components/PointPlotter/index.d.ts.map +1 -0
- package/dist/components/PointPlotter/index.js +2 -0
- package/dist/components/Powerline/Powerline.d.ts +32 -0
- package/dist/components/Powerline/Powerline.d.ts.map +1 -0
- package/dist/components/Powerline/index.d.ts +5 -0
- package/dist/components/Powerline/index.d.ts.map +1 -0
- package/dist/components/Powerline/index.js +3 -0
- package/dist/components/Prefs/PrefsDialog.d.ts +21 -0
- package/dist/components/Prefs/PrefsDialog.d.ts.map +1 -0
- package/dist/components/Prefs/PrefsForm.d.ts +42 -0
- package/dist/components/Prefs/PrefsForm.d.ts.map +1 -0
- package/dist/components/Prefs/index.d.ts +4 -0
- package/dist/components/Prefs/index.d.ts.map +1 -0
- package/dist/components/Prefs/index.js +2 -0
- package/dist/components/Prefs/schema.d.ts +85 -0
- package/dist/components/Prefs/schema.d.ts.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +16 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup/index.d.ts +3 -0
- package/dist/components/RadioGroup/index.d.ts.map +1 -0
- package/dist/components/RadioGroup/index.js +2 -0
- package/dist/components/RangeSlider/RangeSlider.d.ts +18 -0
- package/dist/components/RangeSlider/RangeSlider.d.ts.map +1 -0
- package/dist/components/RangeSlider/index.d.ts +3 -0
- package/dist/components/RangeSlider/index.d.ts.map +1 -0
- package/dist/components/RangeSlider/index.js +2 -0
- package/dist/components/Select/Select.d.ts +39 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/Select/index.js +2 -0
- package/dist/components/SelectionPanel/SelectionPanel.d.ts +46 -0
- package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -0
- package/dist/components/SelectionPanel/index.d.ts +3 -0
- package/dist/components/SelectionPanel/index.d.ts.map +1 -0
- package/dist/components/SelectionPanel/index.js +2 -0
- package/dist/components/SelectionPanel/model.d.ts +43 -0
- package/dist/components/SelectionPanel/model.d.ts.map +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +31 -0
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar/index.d.ts +3 -0
- package/dist/components/Sidebar/index.d.ts.map +1 -0
- package/dist/components/Sidebar/index.js +2 -0
- package/dist/components/SidebarPanel/SidebarPanel.d.ts +35 -0
- package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -0
- package/dist/components/SidebarPanel/index.d.ts +3 -0
- package/dist/components/SidebarPanel/index.d.ts.map +1 -0
- package/dist/components/SidebarPanel/index.js +2 -0
- package/dist/components/Slider/Slider.d.ts +43 -0
- package/dist/components/Slider/Slider.d.ts.map +1 -0
- package/dist/components/Slider/index.d.ts +3 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Slider/index.js +2 -0
- package/dist/components/Switch/Switch.d.ts +11 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/Switch/index.js +2 -0
- package/dist/components/Tabs/Tabs.d.ts +22 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/index.d.ts +3 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tabs/index.js +2 -0
- package/dist/components/Toast/Toast.d.ts +18 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/index.d.ts +5 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/queue.d.ts +56 -0
- package/dist/components/Toast/queue.d.ts.map +1 -0
- package/dist/components/ToggleBar/ToggleBar.d.ts +35 -0
- package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -0
- package/dist/components/ToggleBar/index.d.ts +3 -0
- package/dist/components/ToggleBar/index.d.ts.map +1 -0
- package/dist/components/ToggleBar/index.js +2 -0
- package/dist/components/ToolButton/ToolButton.d.ts +41 -0
- package/dist/components/ToolButton/ToolButton.d.ts.map +1 -0
- package/dist/components/ToolButton/index.d.ts +3 -0
- package/dist/components/ToolButton/index.d.ts.map +1 -0
- package/dist/components/ToolButton/index.js +2 -0
- package/dist/components/ToolGroup/ToolGroup.d.ts +25 -0
- package/dist/components/ToolGroup/ToolGroup.d.ts.map +1 -0
- package/dist/components/ToolGroup/index.d.ts +3 -0
- package/dist/components/ToolGroup/index.d.ts.map +1 -0
- package/dist/components/ToolGroup/index.js +2 -0
- package/dist/components/ToolPalette/ToolPalette.d.ts +27 -0
- package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -0
- package/dist/components/ToolPalette/formatShortcut.d.ts +17 -0
- package/dist/components/ToolPalette/formatShortcut.d.ts.map +1 -0
- package/dist/components/ToolPalette/index.d.ts +4 -0
- package/dist/components/ToolPalette/index.d.ts.map +1 -0
- package/dist/components/ToolPalette/index.js +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +24 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/index.js +2 -0
- package/dist/dlog.d.ts +33 -0
- package/dist/dlog.d.ts.map +1 -0
- package/dist/format/number.d.ts +13 -0
- package/dist/format/number.d.ts.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -6749
- package/dist/index.js.map +1 -1
- package/dist/paintGradientTrack.d.ts +15 -0
- package/dist/paintGradientTrack.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/useReorderDragList.d.ts +35 -0
- package/dist/useReorderDragList.d.ts.map +1 -0
- package/package.json +8 -4
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { forwardRef as e, useCallback as t, useEffect as n, useImperativeHandle as r, useMemo as i, useRef as a } from "react";
|
|
2
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
//#region src/dlog.ts
|
|
4
|
+
var c = ["weasel.debug", "weaseldraw.debug"], l = null;
|
|
5
|
+
function u() {
|
|
6
|
+
let e = {
|
|
7
|
+
all: !1,
|
|
8
|
+
set: /* @__PURE__ */ new Set()
|
|
9
|
+
};
|
|
10
|
+
if (typeof localStorage > "u") return e;
|
|
11
|
+
try {
|
|
12
|
+
for (let e of c) {
|
|
13
|
+
let t = localStorage.getItem(e);
|
|
14
|
+
if (!(t == null || t === "")) return t === "1" || t === "true" || t === "*" ? {
|
|
15
|
+
all: !0,
|
|
16
|
+
set: /* @__PURE__ */ new Set()
|
|
17
|
+
} : {
|
|
18
|
+
all: !1,
|
|
19
|
+
set: new Set(t.split(/[\s,]+/).filter(Boolean))
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return e;
|
|
23
|
+
} catch {
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function d() {
|
|
28
|
+
return l === null && (l = u()), l;
|
|
29
|
+
}
|
|
30
|
+
function f(e) {
|
|
31
|
+
let t = d();
|
|
32
|
+
return t.all || t.set.has(e);
|
|
33
|
+
}
|
|
34
|
+
function p(e, ...t) {
|
|
35
|
+
f(e) && console.debug(`[${e}]`, ...t);
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/Plot2D/geometry.ts
|
|
39
|
+
function m(e, t, n) {
|
|
40
|
+
let r = (e.x - t.xMin) / (t.xMax - t.xMin), i = (e.y - t.yMin) / (t.yMax - t.yMin);
|
|
41
|
+
return {
|
|
42
|
+
x: r * n.width,
|
|
43
|
+
y: (1 - i) * n.height
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function h(e, t, n) {
|
|
47
|
+
let r = e.x / n.width, i = 1 - e.y / n.height;
|
|
48
|
+
return {
|
|
49
|
+
x: t.xMin + r * (t.xMax - t.xMin),
|
|
50
|
+
y: t.yMin + i * (t.yMax - t.yMin)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
var g = {
|
|
54
|
+
root: "_root_1djm7_1",
|
|
55
|
+
grid: "_grid_1djm7_28",
|
|
56
|
+
axis: "_axis_1djm7_34"
|
|
57
|
+
}, _ = e(function(e, c) {
|
|
58
|
+
let { width: l, height: u, xRange: d = [0, 1], yRange: f = [0, 1], grid: _, axes: v, tabIndex: y, className: b, style: x, onPointerDown: S, onKeyDown: C, children: w } = e, T = a(null), E = i(() => ({
|
|
59
|
+
xMin: d[0],
|
|
60
|
+
xMax: d[1],
|
|
61
|
+
yMin: f[0],
|
|
62
|
+
yMax: f[1]
|
|
63
|
+
}), [d, f]), D = i(() => ({
|
|
64
|
+
width: l,
|
|
65
|
+
height: u
|
|
66
|
+
}), [l, u]), O = t((e) => {
|
|
67
|
+
let t = T.current?.getBoundingClientRect(), n = t?.left ?? 0, r = t?.top ?? 0;
|
|
68
|
+
return {
|
|
69
|
+
x: e.clientX - n,
|
|
70
|
+
y: e.clientY - r
|
|
71
|
+
};
|
|
72
|
+
}, []);
|
|
73
|
+
n(() => (p("plot2d", "mount", {
|
|
74
|
+
width: l,
|
|
75
|
+
height: u
|
|
76
|
+
}), () => p("plot2d", "unmount")), []), r(c, () => ({
|
|
77
|
+
get svg() {
|
|
78
|
+
return T.current;
|
|
79
|
+
},
|
|
80
|
+
plotToModel: (e) => h(e, E, D),
|
|
81
|
+
modelToPlot: (e) => m(e, E, D),
|
|
82
|
+
clientToPlot: O,
|
|
83
|
+
clientToModel: (e) => h(O(e), E, D),
|
|
84
|
+
get width() {
|
|
85
|
+
return D.width;
|
|
86
|
+
},
|
|
87
|
+
get height() {
|
|
88
|
+
return D.height;
|
|
89
|
+
}
|
|
90
|
+
}), [
|
|
91
|
+
E,
|
|
92
|
+
D,
|
|
93
|
+
O
|
|
94
|
+
]);
|
|
95
|
+
let k = t((e) => {
|
|
96
|
+
if (!S) return;
|
|
97
|
+
let t = O(e);
|
|
98
|
+
S(e, {
|
|
99
|
+
plot: t,
|
|
100
|
+
model: h(t, E, D)
|
|
101
|
+
});
|
|
102
|
+
}, [
|
|
103
|
+
S,
|
|
104
|
+
O,
|
|
105
|
+
E,
|
|
106
|
+
D
|
|
107
|
+
]);
|
|
108
|
+
return /* @__PURE__ */ s("svg", {
|
|
109
|
+
ref: T,
|
|
110
|
+
className: [g.root, b].filter(Boolean).join(" "),
|
|
111
|
+
style: x,
|
|
112
|
+
width: l,
|
|
113
|
+
height: u,
|
|
114
|
+
viewBox: `0 0 ${l} ${u}`,
|
|
115
|
+
role: "img",
|
|
116
|
+
tabIndex: y,
|
|
117
|
+
onPointerDown: S ? k : void 0,
|
|
118
|
+
onKeyDown: C,
|
|
119
|
+
children: [
|
|
120
|
+
_ && (() => {
|
|
121
|
+
let e = _.divisions ?? 3, t = _.color, n = [];
|
|
122
|
+
for (let t = 1; t <= e; t++) n.push(t / (e + 1));
|
|
123
|
+
return /* @__PURE__ */ s("g", { children: [n.map((e) => /* @__PURE__ */ o("line", {
|
|
124
|
+
"data-plot-element": "grid",
|
|
125
|
+
className: g.grid,
|
|
126
|
+
stroke: t,
|
|
127
|
+
x1: e * l,
|
|
128
|
+
x2: e * l,
|
|
129
|
+
y1: 0,
|
|
130
|
+
y2: u
|
|
131
|
+
}, `gx-${e}`)), n.map((e) => /* @__PURE__ */ o("line", {
|
|
132
|
+
"data-plot-element": "grid",
|
|
133
|
+
className: g.grid,
|
|
134
|
+
stroke: t,
|
|
135
|
+
x1: 0,
|
|
136
|
+
x2: l,
|
|
137
|
+
y1: e * u,
|
|
138
|
+
y2: e * u
|
|
139
|
+
}, `gy-${e}`))] });
|
|
140
|
+
})(),
|
|
141
|
+
v !== !1 && v !== null && (() => {
|
|
142
|
+
let e = v?.color;
|
|
143
|
+
return /* @__PURE__ */ s("g", { children: [/* @__PURE__ */ o("line", {
|
|
144
|
+
"data-plot-element": "axis",
|
|
145
|
+
className: g.axis,
|
|
146
|
+
stroke: e,
|
|
147
|
+
x1: 0,
|
|
148
|
+
x2: l,
|
|
149
|
+
y1: u,
|
|
150
|
+
y2: u
|
|
151
|
+
}), /* @__PURE__ */ o("line", {
|
|
152
|
+
"data-plot-element": "axis",
|
|
153
|
+
className: g.axis,
|
|
154
|
+
stroke: e,
|
|
155
|
+
x1: 0,
|
|
156
|
+
x2: 0,
|
|
157
|
+
y1: 0,
|
|
158
|
+
y2: u
|
|
159
|
+
})] });
|
|
160
|
+
})(),
|
|
161
|
+
w
|
|
162
|
+
]
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
//#endregion
|
|
166
|
+
export { f as a, p as i, m as n, h as r, _ as t };
|
|
167
|
+
|
|
168
|
+
//# sourceMappingURL=Plot2D-CEnhzodm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plot2D-CEnhzodm.js","names":[],"sources":["../../src/dlog.ts","../../src/components/Plot2D/geometry.ts","../../src/components/Plot2D/Plot2D.module.css","../../src/components/Plot2D/Plot2D.tsx"],"sourcesContent":["/**\n * Namespaced, opt-in console tracing. Off by default; production builds\n * may strip the calls entirely depending on the bundler.\n *\n * Enable in the browser:\n *\n * localStorage.setItem('weasel.debug', '*') // all namespaces\n * localStorage.setItem('weasel.debug', 'curve-editor') // just curve editor\n * localStorage.setItem('weasel.debug', 'curve-editor,layer-stack')\n *\n * Each component picks a stable namespace and calls `dlog(namespace, ...)`.\n * Useful for tracing pointer/event flows that are hard to capture\n * post-hoc (drag handlers, gesture sequences, selection mutations).\n *\n * The flag is read once and cached for the page session — reload to\n * pick up changes. Cheap hot-path checks (one nullish-coalesce + Set\n * lookup) so leaving calls in place is fine.\n *\n * Mirrors `src/debug/flag.ts` in the kit. Two impls live here because\n * weasel-ui doesn't depend on the kit, but both read the same\n * localStorage keys so behavior is uniform. See the kit copy for the\n * canonical list of kit-level namespaces.\n *\n * Known weasel-ui namespaces:\n * - plot2d — Plot2D mount / unmount\n * - curve-editor — CurveEditor pointer flow\n */\n\nconst KEYS = ['weasel.debug', 'weaseldraw.debug'] as const;\n\ninterface Cached {\n all: boolean;\n set: Set<string>;\n}\n\nlet cached: Cached | null = null;\n\nfunction read(): Cached {\n const empty: Cached = { all: false, set: new Set() };\n if (typeof localStorage === 'undefined') return empty;\n try {\n for (const k of KEYS) {\n const v = localStorage.getItem(k);\n if (v == null || v === '') continue;\n if (v === '1' || v === 'true' || v === '*') return { all: true, set: new Set() };\n return { all: false, set: new Set(v.split(/[\\s,]+/).filter(Boolean)) };\n }\n return empty;\n } catch {\n return empty;\n }\n}\n\nfunction get(): Cached {\n if (cached === null) cached = read();\n return cached;\n}\n\n/** True when `namespace` (or `*`) is enabled. */\nexport function isDebugEnabled(namespace: string): boolean {\n const c = get();\n return c.all || c.set.has(namespace);\n}\n\n/** Conditional `console.debug` — no-op unless `namespace` (or `*`) is enabled.\n * Each call is prefixed with `[namespace]` so the source is searchable. */\nexport function dlog(namespace: string, ...args: unknown[]): void {\n if (!isDebugEnabled(namespace)) return;\n // eslint-disable-next-line no-console\n console.debug(`[${namespace}]`, ...args);\n}\n","/**\n * Coordinate transforms (model ↔ plot) for Plot2D. Pure / deterministic —\n * no DOM, no React, no state.\n *\n * Model space: caller-defined xRange × yRange. Y axis goes UP.\n * Plot space: 0..width × 0..height in CSS pixels. Y axis goes DOWN (SVG).\n */\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface ModelRange {\n xMin: number;\n xMax: number;\n yMin: number;\n yMax: number;\n}\n\nexport interface PlotSize {\n width: number;\n height: number;\n}\n\nexport function modelToPlot(p: Point, m: ModelRange, plot: PlotSize): Point {\n const xFrac = (p.x - m.xMin) / (m.xMax - m.xMin);\n const yFrac = (p.y - m.yMin) / (m.yMax - m.yMin);\n return {\n x: xFrac * plot.width,\n // Invert y so model y=0 sits at plot bottom (SVG y grows downward).\n y: (1 - yFrac) * plot.height,\n };\n}\n\nexport function plotToModel(p: Point, m: ModelRange, plot: PlotSize): Point {\n const xFrac = p.x / plot.width;\n const yFrac = 1 - p.y / plot.height;\n return {\n x: m.xMin + xFrac * (m.xMax - m.xMin),\n y: m.yMin + yFrac * (m.yMax - m.yMin),\n };\n}\n",".root {\n /* Component-local vars layered over theme tokens. Consumers override\n * either the plot-* var (component scope) or the wzl-* token (app\n * scope). */\n --plot-bg: var(--wzl-surface-sunken);\n --plot-grid: var(--wzl-line);\n /* Axes get full foreground contrast — they're the plot frame, the\n * most prominent structural element after caller-rendered content. */\n --plot-axis: var(--wzl-fg);\n\n display: block;\n /* Caller-rendered marks at the very edge (e.g. CurveEditor anchors)\n * extend past the SVG box by their radius — let them paint over the\n * host page instead of being half-clipped. */\n overflow: visible;\n background: var(--plot-bg);\n user-select: none;\n touch-action: none;\n outline: none;\n}\n\n/* Keyboard-only focus ring. Caller opts in via `tabIndex`. */\n.root:focus-visible {\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: 2px;\n}\n\n.grid {\n stroke: var(--plot-grid);\n stroke-width: 1;\n fill: none;\n}\n\n.axis {\n stroke: var(--plot-axis);\n stroke-width: var(--wzl-line-width);\n fill: none;\n}\n","import {\n forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef,\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactNode,\n} from 'react';\nimport {\n modelToPlot, plotToModel,\n type ModelRange, type Point,\n} from './geometry';\nimport s from './Plot2D.module.css';\nimport { dlog } from '../../dlog';\n\nexport interface GridSettings {\n /** Number of evenly-spaced internal grid lines per axis (excluding\n * the edges). Applied to both x and y. Default 3. */\n divisions?: number;\n /** Stroke color override. When omitted, uses `var(--plot-grid)`. */\n color?: string;\n}\n\nexport interface AxesSettings {\n /** Stroke color override. When omitted, uses `var(--plot-axis)`. */\n color?: string;\n}\n\nexport interface Plot2DCoords {\n plot: Point;\n model: Point;\n}\n\nexport interface Plot2DProps {\n width: number;\n height: number;\n /** Model-space x range. Default [0, 1]. */\n xRange?: readonly [number, number];\n /** Model-space y range. Default [0, 1]. */\n yRange?: readonly [number, number];\n /** Background grid. `false` / `null` / omitted = no grid. Pass `{}`\n * for default (3 divisions per axis) or populated GridSettings. */\n grid?: GridSettings | false | null;\n /** Axis lines. `false` / `null` = no axes. Omitted = default-styled\n * axes (on). Pass AxesSettings to customize. */\n axes?: AxesSettings | false | null;\n /** Forwarded to the underlying svg. Consumer opts into focus this way. */\n tabIndex?: number;\n className?: string;\n style?: CSSProperties;\n /** Pointer down on the SVG. Receives both plot- and model-space coords\n * pre-computed so consumers don't repeat the rect/transform dance. */\n onPointerDown?: (e: ReactPointerEvent<SVGSVGElement>, coords: Plot2DCoords) => void;\n onKeyDown?: (e: ReactKeyboardEvent<SVGSVGElement>) => void;\n children?: ReactNode;\n}\n\nexport interface Plot2DHandle {\n readonly svg: SVGSVGElement | null;\n plotToModel(pt: Point): Point;\n modelToPlot(pt: Point): Point;\n /** Convert a DOM event's clientX/clientY (e.g. from a window-attached\n * pointermove during drag) to plot-space. */\n clientToPlot(e: { clientX: number; clientY: number }): Point;\n /** Convenience: clientToPlot → plotToModel. */\n clientToModel(e: { clientX: number; clientY: number }): Point;\n readonly width: number;\n readonly height: number;\n}\n\nexport const Plot2D = forwardRef<Plot2DHandle, Plot2DProps>(function Plot2D(props, ref) {\n const {\n width, height,\n xRange = [0, 1],\n yRange = [0, 1],\n grid,\n axes,\n tabIndex,\n className,\n style,\n onPointerDown,\n onKeyDown,\n children,\n } = props;\n\n const svgRef = useRef<SVGSVGElement | null>(null);\n\n const modelRange: ModelRange = useMemo(\n () => ({ xMin: xRange[0], xMax: xRange[1], yMin: yRange[0], yMax: yRange[1] }),\n [xRange, yRange],\n );\n\n const plotSize = useMemo(() => ({ width, height }), [width, height]);\n\n const clientToPlot = useCallback((e: { clientX: number; clientY: number }): Point => {\n const rect = svgRef.current?.getBoundingClientRect();\n const left = rect?.left ?? 0;\n const top = rect?.top ?? 0;\n return { x: e.clientX - left, y: e.clientY - top };\n }, []);\n\n useEffect(() => {\n dlog('plot2d', 'mount', { width, height });\n return () => dlog('plot2d', 'unmount');\n }, []);\n useImperativeHandle(ref, () => ({\n get svg() { return svgRef.current; },\n plotToModel: (pt: Point) => plotToModel(pt, modelRange, plotSize),\n modelToPlot: (pt: Point) => modelToPlot(pt, modelRange, plotSize),\n clientToPlot,\n clientToModel: (e) => plotToModel(clientToPlot(e), modelRange, plotSize),\n get width() { return plotSize.width; },\n get height() { return plotSize.height; },\n }), [modelRange, plotSize, clientToPlot]);\n\n const handlePointerDown = useCallback((e: ReactPointerEvent<SVGSVGElement>) => {\n if (!onPointerDown) return;\n const plot = clientToPlot(e);\n const model = plotToModel(plot, modelRange, plotSize);\n onPointerDown(e, { plot, model });\n }, [onPointerDown, clientToPlot, modelRange, plotSize]);\n\n const cls = [s.root, className].filter(Boolean).join(' ');\n\n return (\n <svg\n ref={svgRef}\n className={cls}\n style={style}\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n tabIndex={tabIndex}\n onPointerDown={onPointerDown ? handlePointerDown : undefined}\n onKeyDown={onKeyDown}\n >\n {grid && (() => {\n const divisions = grid.divisions ?? 3;\n const stroke = grid.color;\n // Evenly-spaced internal divisions, excluding the edges (which\n // belong to the axes). For divisions=3, fractions are 1/4, 2/4, 3/4.\n const fractions: number[] = [];\n for (let i = 1; i <= divisions; i++) fractions.push(i / (divisions + 1));\n return (\n <g>\n {fractions.map((f) => (\n <line\n key={`gx-${f}`}\n data-plot-element=\"grid\"\n className={s.grid}\n stroke={stroke}\n x1={f * width} x2={f * width}\n y1={0} y2={height}\n />\n ))}\n {fractions.map((f) => (\n <line\n key={`gy-${f}`}\n data-plot-element=\"grid\"\n className={s.grid}\n stroke={stroke}\n x1={0} x2={width}\n y1={f * height} y2={f * height}\n />\n ))}\n </g>\n );\n })()}\n {axes !== false && axes !== null && (() => {\n const stroke = axes?.color;\n return (\n <g>\n <line\n data-plot-element=\"axis\"\n className={s.axis}\n stroke={stroke}\n x1={0} x2={width}\n y1={height} y2={height}\n />\n <line\n data-plot-element=\"axis\"\n className={s.axis}\n stroke={stroke}\n x1={0} x2={0}\n y1={0} y2={height}\n />\n </g>\n );\n })()}\n {children}\n </svg>\n );\n});\n"],"mappings":";;;AA4BA,IAAM,IAAO,CAAC,gBAAgB,mBA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,CAAC,EAAE,MAAM,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAKtC;EACJ;EACA;EACC;EACR,SAAS,OAAO,EAAM,GAAG;EACzB,MAAK;EACK;EACV,eAAe,IAAgB,IAAoB,KAAA;EACxC;YAVb;GAYG,YAAe;IACd,IAAM,IAAY,EAAK,aAAa,GAC9B,IAAS,EAAK,OAGd,IAAsB,EAAE;IAC9B,KAAK,IAAI,IAAI,GAAG,KAAK,GAAW,KAAK,EAAU,KAAK,KAAK,IAAY,GAAG;IACxE,OACE,kBAAC,KAAD,EAAA,UAAA,CACG,EAAU,KAAK,MACd,kBAAC,QAAD;KAEE,qBAAkB;KAClB,WAAW,EAAE;KACL;KACR,IAAI,IAAI;KAAO,IAAI,IAAI;KACvB,IAAI;KAAG,IAAI;KACX,EANK,MAAM,IAMX,CACF,EACD,EAAU,KAAK,MACd,kBAAC,QAAD;KAEE,qBAAkB;KAClB,WAAW,EAAE;KACL;KACR,IAAI;KAAG,IAAI;KACX,IAAI,IAAI;KAAQ,IAAI,IAAI;KACxB,EANK,MAAM,IAMX,CACF,CACA,EAAA,CAAA;OAEJ;GACH,MAAS,MAAS,MAAS,eAAe;IACzC,IAAM,IAAS,GAAM;IACrB,OACE,kBAAC,KAAD,EAAA,UAAA,CACE,kBAAC,QAAD;KACE,qBAAkB;KAClB,WAAW,EAAE;KACL;KACR,IAAI;KAAG,IAAI;KACX,IAAI;KAAQ,IAAI;KAChB,CAAA,EACF,kBAAC,QAAD;KACE,qBAAkB;KAClB,WAAW,EAAE;KACL;KACR,IAAI;KAAG,IAAI;KACX,IAAI;KAAG,IAAI;KACX,CAAA,CACA,EAAA,CAAA;OAEJ;GACH;GACG;;EAER"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { n as e } from "./CurveEditor-BEQtef4P.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/PointPlotter/PointPlotter.tsx
|
|
4
|
+
function n(n) {
|
|
5
|
+
return /* @__PURE__ */ t(e, {
|
|
6
|
+
...n,
|
|
7
|
+
addPointMode: n.addPointMode ?? "click-empty",
|
|
8
|
+
curve: !1,
|
|
9
|
+
fill: !1,
|
|
10
|
+
endpoints: "free"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as t };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=PointPlotter-Dvh5cyOC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointPlotter-Dvh5cyOC.js","names":[],"sources":["../../src/components/PointPlotter/PointPlotter.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport {\n CurveEditor,\n type AnchorRenderProps,\n type ControlPoint,\n type CurveEditorProps,\n} from '../CurveEditor';\nimport type { GridSettings, AxesSettings } from '../Plot2D';\n\nexport interface PointPlotterProps {\n /** Plotted points; caller-owned. */\n value: readonly ControlPoint[];\n /** Fires every frame during drag with the live in-flight value. */\n onChange: (next: ControlPoint[]) => void;\n /** Fires once per discrete user action (drag-end, add, delete) with\n * the new value and the value at gesture start. Wire history here. */\n onChangeCommit?: (next: ControlPoint[], prev: readonly ControlPoint[]) => void;\n /** Model-space x range. Default [0, 1]. */\n xRange?: readonly [number, number];\n /** Model-space y range. Default [0, 1]. */\n yRange?: readonly [number, number];\n width: number;\n height: number;\n grid?: GridSettings | false | null;\n axes?: AxesSettings | false | null;\n /** Minimum allowed point count. User-initiated deletion is refused\n * while `value.length <= minPoints`. */\n minPoints?: number;\n /** Maximum allowed point count. User-initiated insertion is refused\n * while `value.length >= maxPoints`. */\n maxPoints?: number;\n /** How new points are added. Default `'click-empty'`. Set to `'never'`\n * to disable insertion entirely. */\n addPointMode?: 'click-empty' | 'never';\n /** Built-in undo/redo via keyboard when the component has focus.\n * Default `true`. See `CurveEditor.history` for details. */\n history?: boolean;\n /** Custom per-anchor renderer. See `CurveEditor.renderAnchor`. */\n renderAnchor?: (info: AnchorRenderProps) => ReactNode;\n /** Extra SVG content beneath the anchors. See `CurveEditor.decorations`. */\n decorations?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\n\n/**\n * 2D point plotter — a CurveEditor with the curve hidden. Anchors,\n * drag, shift+click delete, right-click delete, and click-empty insert\n * are inherited from CurveEditor verbatim, so the two components share\n * gesture semantics and stay in sync as CurveEditor evolves.\n *\n * Differences from CurveEditor: no curve `<path>` drawn, no fill, no\n * endpoint pinning, no interpolation, default `addPointMode` is\n * `'click-empty'` (CurveEditor defaults to `'click-curve'`, which\n * doesn't make sense without a curve to hit-test against).\n */\nexport function PointPlotter(props: PointPlotterProps) {\n const curveProps: CurveEditorProps = {\n ...props,\n addPointMode: props.addPointMode ?? 'click-empty',\n curve: false,\n fill: false,\n endpoints: 'free',\n };\n return <CurveEditor {...curveProps} />;\n}\n"],"mappings":";;;AAwDA,SAAgB,EAAa,GAA0B;CAQrD,OAAO,kBAAC,GAAD;EANL,GAAG;EACH,cAAc,EAAM,gBAAgB;EACpC,OAAO;EACP,MAAM;EACN,WAAW;EAEyB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { t as e } from "./Badge-DU8ihE7Z.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
var n = {
|
|
4
|
+
row: "_row_q3wun_1",
|
|
5
|
+
matrix: "_matrix_q3wun_7",
|
|
6
|
+
segment: "_segment_q3wun_15"
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/components/Powerline/Powerline.tsx
|
|
10
|
+
function r({ segments: r, startCap: i = "flat", size: a, variant: o, depth: s, gap: c, className: l, ...u }) {
|
|
11
|
+
return /* @__PURE__ */ t("span", {
|
|
12
|
+
className: [n.row, l].filter(Boolean).join(" "),
|
|
13
|
+
style: c === void 0 ? void 0 : { "--powerline-gap": typeof c == "number" ? `${c}px` : c },
|
|
14
|
+
"aria-label": u["aria-label"],
|
|
15
|
+
children: r.map((c, l) => /* @__PURE__ */ t(e, {
|
|
16
|
+
base: "powerline",
|
|
17
|
+
baseParams: {
|
|
18
|
+
leftEdge: l === 0 ? i : r[l - 1].endCap ?? "flat",
|
|
19
|
+
rightEdge: c.endCap ?? "flat",
|
|
20
|
+
...s !== void 0 && { depth: s }
|
|
21
|
+
},
|
|
22
|
+
tone: c.tone,
|
|
23
|
+
variant: c.variant ?? o,
|
|
24
|
+
size: c.size ?? a,
|
|
25
|
+
onClick: c.onClick,
|
|
26
|
+
href: c.href,
|
|
27
|
+
"aria-label": c["aria-label"],
|
|
28
|
+
className: n.segment,
|
|
29
|
+
children: c.text
|
|
30
|
+
}, l))
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { r as t };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=Powerline-W_yqAVMc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Powerline-W_yqAVMc.js","names":[],"sources":["../../src/components/Powerline/Powerline.module.css","../../src/components/Powerline/Powerline.tsx"],"sourcesContent":[".row {\n display: inline-flex;\n align-items: stretch;\n gap: var(--powerline-gap, 0.2em);\n}\n\n.matrix {\n display: grid;\n gap: 12px;\n}\n\n/* Reset Badge's opinionated text defaults — Powerline segments should pick up\n * the surrounding text style instead of forcing uppercase / 10px / extra\n * tracking. Consumers can still override via className on Powerline. */\n.segment {\n font-size: inherit;\n text-transform: none;\n letter-spacing: normal;\n}\n","import type { CSSProperties, ReactNode } from 'react';\nimport { Badge } from '../Badge/Badge';\nimport type { BadgeSize, BadgeTone, BadgeVariant } from '../Badge/types';\nimport type { EdgeCap } from '../Badge/bases/edgeProfiles';\nimport s from './Powerline.module.css';\n\nexport interface PowerlineSegment {\n text: ReactNode;\n /** Cap on this segment's right edge. Next segment's left edge adopts the same profile. */\n endCap?: EdgeCap;\n tone?: BadgeTone;\n variant?: BadgeVariant;\n size?: BadgeSize;\n onClick?: () => void;\n href?: string;\n 'aria-label'?: string;\n}\n\nexport interface PowerlineProps {\n segments: PowerlineSegment[];\n /** Left edge of the first segment. Defaults to 'flat'. */\n startCap?: EdgeCap;\n /** Default size for every segment (per-segment `size` wins). */\n size?: BadgeSize;\n /** Default variant for every segment (per-segment `variant` wins). */\n variant?: BadgeVariant;\n /** Protrusion depth in CSS px, passed through to every segment's base. */\n depth?: number;\n /** Visible gap between adjacent segments. Number → px; string → literal CSS length.\n * Default: `0.2em` (scales with the row's font size). Pass `0` for flush. */\n gap?: number | string;\n className?: string;\n 'aria-label'?: string;\n}\n\nexport function Powerline({\n segments,\n startCap = 'flat',\n size,\n variant,\n depth,\n gap,\n className,\n ...rest\n}: PowerlineProps) {\n const cls = [s.row, className].filter(Boolean).join(' ');\n const style: CSSProperties | undefined = gap !== undefined\n ? { ['--powerline-gap' as never]: typeof gap === 'number' ? `${gap}px` : gap }\n : undefined;\n return (\n <span className={cls} style={style} aria-label={rest['aria-label']}>\n {segments.map((seg, i) => {\n const leftEdge: EdgeCap = i === 0 ? startCap : (segments[i - 1].endCap ?? 'flat');\n const rightEdge: EdgeCap = seg.endCap ?? 'flat';\n return (\n <Badge\n key={i}\n base=\"powerline\"\n baseParams={{ leftEdge, rightEdge, ...(depth !== undefined && { depth }) }}\n tone={seg.tone}\n variant={seg.variant ?? variant}\n size={seg.size ?? size}\n onClick={seg.onClick}\n href={seg.href}\n aria-label={seg['aria-label']}\n className={s.segment}\n >\n {seg.text}\n </Badge>\n );\n })}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;ACmCA,SAAgB,EAAU,EACxB,aACA,cAAW,QACX,SACA,YACA,UACA,QACA,cACA,GAAG,KACc;CAKjB,OACE,kBAAC,QAAD;EAAM,WALI,CAAC,EAAE,KAAK,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAKjC;EAAY,OAJU,MAAQ,KAAA,IAE7C,KAAA,IADA,EAAG,mBAA6B,OAAO,KAAQ,WAAW,GAAG,EAAI,MAAM,GAAK;EAG1C,cAAY,EAAK;YAClD,EAAS,KAAK,GAAK,MAIhB,kBAAC,GAAD;GAEE,MAAK;GACL,YAAY;IAAE,UANQ,MAAM,IAAI,IAAY,EAAS,IAAI,GAAG,UAAU;IAM9C,WALD,EAAI,UAAU;IAKF,GAAI,MAAU,KAAA,KAAa,EAAE,UAAO;IAAG;GAC1E,MAAM,EAAI;GACV,SAAS,EAAI,WAAW;GACxB,MAAM,EAAI,QAAQ;GAClB,SAAS,EAAI;GACb,MAAM,EAAI;GACV,cAAY,EAAI;GAChB,WAAW,EAAE;aAEZ,EAAI;GACC,EAZD,EAYC,CAEV;EACG,CAAA"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { n as e, t } from "./Tooltip-Clgn4trm.js";
|
|
2
|
+
import { t as n } from "./Checkbox-BeWFZr1M.js";
|
|
3
|
+
import { t as r } from "./ColorField-B7vHaU5G.js";
|
|
4
|
+
import { t as i } from "./Input-DRei6KJr.js";
|
|
5
|
+
import { t as a } from "./NumberField-BAmJwxw0.js";
|
|
6
|
+
import { n as o, t as s } from "./RadioGroup-DUlTy95a.js";
|
|
7
|
+
import { t as c } from "./RangeSlider-Bks9GQuO.js";
|
|
8
|
+
import { t as l } from "./Select-BV70VU5O.js";
|
|
9
|
+
import { t as u } from "./Switch-iUmlnP_b.js";
|
|
10
|
+
import { t as d } from "./Dialog-tAi14bY3.js";
|
|
11
|
+
import { useMemo as f } from "react";
|
|
12
|
+
import { Focusable as p } from "react-aria-components";
|
|
13
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
|
+
//#region src/components/Prefs/schema.ts
|
|
15
|
+
function _(e) {
|
|
16
|
+
return "kind" in e;
|
|
17
|
+
}
|
|
18
|
+
function v(e, t) {
|
|
19
|
+
let n = e;
|
|
20
|
+
for (let e of t.split(".")) {
|
|
21
|
+
if (typeof n != "object" || !n) return;
|
|
22
|
+
n = n[e];
|
|
23
|
+
}
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
function y(e, t) {
|
|
27
|
+
if (_(e)) return e.hidden && !t ? null : e;
|
|
28
|
+
let n = e, r = {};
|
|
29
|
+
for (let [e, i] of Object.entries(n.children)) {
|
|
30
|
+
let n = y(i, t);
|
|
31
|
+
n && (r[e] = n);
|
|
32
|
+
}
|
|
33
|
+
return Object.keys(r).length === 0 ? null : {
|
|
34
|
+
...e,
|
|
35
|
+
children: r
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
var b = {
|
|
39
|
+
columns: "_columns_112g7_5",
|
|
40
|
+
column: "_column_112g7_5",
|
|
41
|
+
panel: "_panel_112g7_23",
|
|
42
|
+
subpanel: "_subpanel_112g7_33",
|
|
43
|
+
groupHeader: "_groupHeader_112g7_44",
|
|
44
|
+
groupTitle: "_groupTitle_112g7_57",
|
|
45
|
+
groupDesc: "_groupDesc_112g7_72",
|
|
46
|
+
rows: "_rows_112g7_79",
|
|
47
|
+
row: "_row_112g7_79",
|
|
48
|
+
rowLabel: "_rowLabel_112g7_95",
|
|
49
|
+
help: "_help_112g7_104",
|
|
50
|
+
rowControl: "_rowControl_112g7_128",
|
|
51
|
+
textarea: "_textarea_112g7_135",
|
|
52
|
+
unrenderable: "_unrenderable_112g7_147",
|
|
53
|
+
titleRow: "_titleRow_112g7_154"
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/Prefs/PrefsForm.tsx
|
|
57
|
+
function x(e) {
|
|
58
|
+
let { schema: t, values: n, onChange: r, renderers: i, showHidden: a = !1, className: o } = e, s = f(() => y(t, a), [t, a]), c = {
|
|
59
|
+
values: n,
|
|
60
|
+
onChange: r,
|
|
61
|
+
renderers: i
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ h("div", {
|
|
64
|
+
className: [b.columns, o].filter(Boolean).join(" "),
|
|
65
|
+
children: Object.entries(s?.children ?? {}).map(([e, t]) => /* @__PURE__ */ h("div", {
|
|
66
|
+
className: b.column,
|
|
67
|
+
children: _(t) ? /* @__PURE__ */ h(C, {
|
|
68
|
+
ctx: c,
|
|
69
|
+
path: e,
|
|
70
|
+
pref: t
|
|
71
|
+
}) : /* @__PURE__ */ h(S, {
|
|
72
|
+
ctx: c,
|
|
73
|
+
group: t,
|
|
74
|
+
path: e,
|
|
75
|
+
depth: 0
|
|
76
|
+
})
|
|
77
|
+
}, e))
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function S({ ctx: e, group: t, path: n, depth: r }) {
|
|
81
|
+
return /* @__PURE__ */ g("div", {
|
|
82
|
+
className: r === 0 ? b.panel : b.subpanel,
|
|
83
|
+
children: [/* @__PURE__ */ g("div", {
|
|
84
|
+
className: b.groupHeader,
|
|
85
|
+
children: [/* @__PURE__ */ h("h3", {
|
|
86
|
+
className: b.groupTitle,
|
|
87
|
+
children: t.name
|
|
88
|
+
}), t.description !== void 0 && /* @__PURE__ */ h("p", {
|
|
89
|
+
className: b.groupDesc,
|
|
90
|
+
children: t.description
|
|
91
|
+
})]
|
|
92
|
+
}), /* @__PURE__ */ h("div", {
|
|
93
|
+
className: b.rows,
|
|
94
|
+
children: Object.entries(t.children).map(([t, i]) => {
|
|
95
|
+
let a = `${n}.${t}`;
|
|
96
|
+
return _(i) ? /* @__PURE__ */ h(C, {
|
|
97
|
+
ctx: e,
|
|
98
|
+
path: a,
|
|
99
|
+
pref: i
|
|
100
|
+
}, t) : /* @__PURE__ */ h(S, {
|
|
101
|
+
ctx: e,
|
|
102
|
+
group: i,
|
|
103
|
+
path: a,
|
|
104
|
+
depth: r + 1
|
|
105
|
+
}, t);
|
|
106
|
+
})
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function C({ ctx: n, path: r, pref: i }) {
|
|
111
|
+
let a = v(n.values, r), o = {
|
|
112
|
+
path: r,
|
|
113
|
+
pref: i,
|
|
114
|
+
value: a === void 0 ? i.default : a,
|
|
115
|
+
setValue: (e) => n.onChange(r, e)
|
|
116
|
+
}, s = n.renderers?.[i.kind], c = s ? s(o) : w(o);
|
|
117
|
+
return s && c === null ? null : i.block ? /* @__PURE__ */ h(m, { children: c }) : /* @__PURE__ */ g("label", {
|
|
118
|
+
className: b.row,
|
|
119
|
+
children: [/* @__PURE__ */ g("span", {
|
|
120
|
+
className: b.rowLabel,
|
|
121
|
+
children: [i.name, i.description ? /* @__PURE__ */ g(e, { children: [/* @__PURE__ */ h(p, { children: /* @__PURE__ */ h("button", {
|
|
122
|
+
type: "button",
|
|
123
|
+
className: b.help,
|
|
124
|
+
"aria-label": `About ${i.name}`,
|
|
125
|
+
children: "ⓘ"
|
|
126
|
+
}) }), /* @__PURE__ */ h(t, { children: i.description })] }) : null]
|
|
127
|
+
}), /* @__PURE__ */ h("span", {
|
|
128
|
+
className: b.rowControl,
|
|
129
|
+
children: c
|
|
130
|
+
})]
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function w(e) {
|
|
134
|
+
let { pref: t, value: d, setValue: f } = e;
|
|
135
|
+
switch (t.kind) {
|
|
136
|
+
case "boolean": {
|
|
137
|
+
let e = t, r = !!d;
|
|
138
|
+
return e.control === "switch" ? /* @__PURE__ */ h(u, {
|
|
139
|
+
isSelected: r,
|
|
140
|
+
onChange: f,
|
|
141
|
+
"aria-label": e.name
|
|
142
|
+
}) : /* @__PURE__ */ h(n, {
|
|
143
|
+
isSelected: r,
|
|
144
|
+
onChange: f,
|
|
145
|
+
"aria-label": e.name
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
case "number": {
|
|
149
|
+
let e = t, n = typeof d == "number" && Number.isFinite(d) ? d : 0;
|
|
150
|
+
return e.control === "slider" ? /* @__PURE__ */ h(c, {
|
|
151
|
+
value: n,
|
|
152
|
+
onChange: (e) => f(typeof e == "number" ? e : e[0]),
|
|
153
|
+
minValue: e.min,
|
|
154
|
+
maxValue: e.max,
|
|
155
|
+
step: e.step ?? 1,
|
|
156
|
+
"aria-label": e.name
|
|
157
|
+
}) : /* @__PURE__ */ h(a, {
|
|
158
|
+
value: n,
|
|
159
|
+
onChange: f,
|
|
160
|
+
minValue: e.min,
|
|
161
|
+
maxValue: e.max,
|
|
162
|
+
step: e.step ?? 1,
|
|
163
|
+
"aria-label": e.name
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
case "string": {
|
|
167
|
+
let e = t, n = typeof d == "string" ? d : "";
|
|
168
|
+
return e.control === "textarea" ? /* @__PURE__ */ h("textarea", {
|
|
169
|
+
className: b.textarea,
|
|
170
|
+
value: n,
|
|
171
|
+
onChange: (e) => f(e.target.value),
|
|
172
|
+
"aria-label": e.name,
|
|
173
|
+
rows: 3
|
|
174
|
+
}) : /* @__PURE__ */ h(i, {
|
|
175
|
+
value: n,
|
|
176
|
+
onChange: f,
|
|
177
|
+
"aria-label": e.name
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
case "enum": {
|
|
181
|
+
let e = t, n = typeof d == "string" ? d : e.default;
|
|
182
|
+
return e.control === "radio" ? /* @__PURE__ */ h(o, {
|
|
183
|
+
value: n,
|
|
184
|
+
onChange: (e) => f(e),
|
|
185
|
+
"aria-label": e.name,
|
|
186
|
+
children: e.options.map((e) => /* @__PURE__ */ h(s, {
|
|
187
|
+
value: e.value,
|
|
188
|
+
children: e.label
|
|
189
|
+
}, e.value))
|
|
190
|
+
}) : /* @__PURE__ */ h(l, {
|
|
191
|
+
options: e.options.map((e) => ({
|
|
192
|
+
value: e.value,
|
|
193
|
+
label: e.label
|
|
194
|
+
})),
|
|
195
|
+
selectedKey: n,
|
|
196
|
+
onSelectionChange: (e) => f(e),
|
|
197
|
+
"aria-label": e.name
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
case "color": {
|
|
201
|
+
let e = t;
|
|
202
|
+
return /* @__PURE__ */ h(r, {
|
|
203
|
+
value: typeof d == "string" ? d : e.default,
|
|
204
|
+
alpha: e.alpha,
|
|
205
|
+
onChange: f,
|
|
206
|
+
"aria-label": e.name
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
default: return /* @__PURE__ */ g("span", {
|
|
210
|
+
className: b.unrenderable,
|
|
211
|
+
children: [
|
|
212
|
+
"(",
|
|
213
|
+
t.kind,
|
|
214
|
+
": no renderer)"
|
|
215
|
+
]
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/components/Prefs/PrefsDialog.tsx
|
|
221
|
+
function T(e) {
|
|
222
|
+
let { isOpen: t, onOpenChange: n, title: r, headerExtra: i, dialogClassName: a, ...o } = e;
|
|
223
|
+
return /* @__PURE__ */ h(d, {
|
|
224
|
+
isOpen: t,
|
|
225
|
+
onOpenChange: n,
|
|
226
|
+
"aria-label": typeof r == "string" ? r : o.schema.name,
|
|
227
|
+
className: a,
|
|
228
|
+
title: i === void 0 ? r ?? o.schema.name : /* @__PURE__ */ g("span", {
|
|
229
|
+
className: b.titleRow,
|
|
230
|
+
children: [/* @__PURE__ */ h("span", { children: r ?? o.schema.name }), i]
|
|
231
|
+
}),
|
|
232
|
+
children: /* @__PURE__ */ h(x, { ...o })
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
export { y as a, v as i, x as n, _ as r, T as t };
|
|
237
|
+
|
|
238
|
+
//# sourceMappingURL=Prefs-NOoGuUHy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prefs-NOoGuUHy.js","names":[],"sources":["../../src/components/Prefs/schema.ts","../../src/components/Prefs/Prefs.module.css","../../src/components/Prefs/PrefsForm.tsx","../../src/components/Prefs/PrefsDialog.tsx"],"sourcesContent":["// Preference-schema vocabulary for PrefsForm / PrefsDialog.\n//\n// Deliberately field-compatible with core's `ToolPref*` family\n// (src/tools/prefs.ts): this schema module deliberately avoids importing\n// @weasel-js/core, so the contract is structural — a `ToolPrefGroup` (and\n// any host-app superset, like WeaselDraw's registry) assigns into\n// `PrefGroup` with no import and no cast. Keep the two in sync\n// field-for-field.\n\n/** Control-presentation hints per kind — visually-equivalent renderings\n * of the same value type. The persisted value is unchanged either way. */\nexport type PrefNumberControl = 'input' | 'slider';\nexport type PrefBooleanControl = 'checkbox' | 'switch';\nexport type PrefStringControl = 'input' | 'textarea';\nexport type PrefEnumControl = 'select' | 'radio';\n\ninterface PrefBase<K extends string, Value> {\n kind: K;\n /** Human-readable label, e.g. \"Show grid\". */\n name: string;\n /** Longer help text — surfaces as a tooltip on the row label. */\n description: string;\n /** Fallback when `values` holds nothing at this leaf's path. */\n default: Value;\n /** Omitted from the form unless `showHidden` is set. */\n hidden?: boolean;\n /** Render the control full-width with no label/tooltip row — for\n * controls that supply their own chrome (embedded sub-panel editors).\n * The `description` still applies wherever the renderer surfaces it. */\n block?: boolean;\n /** Row-pairing hint for compact property UIs (`SelectionPanel`):\n * leaves sharing a `pair` id render side-by-side on one row labeled\n * with the `pair` string. Purely presentational. */\n pair?: string;\n}\n\n/** Display-unit conversion for number leaves whose stored value uses a\n * canonical unit the user shouldn't see (radians → degrees). Mirrors\n * core's `ToolPrefNumberUnit`. */\nexport interface PrefNumberUnit {\n toDisplay: (stored: number) => number;\n fromDisplay: (display: number) => number;\n suffix?: string;\n}\n\nexport interface PrefNumber extends PrefBase<'number', number> {\n min?: number;\n max?: number;\n step?: number;\n control?: PrefNumberControl;\n unit?: PrefNumberUnit;\n}\nexport interface PrefBoolean extends PrefBase<'boolean', boolean> {\n control?: PrefBooleanControl;\n}\nexport interface PrefString extends PrefBase<'string', string> {\n control?: PrefStringControl;\n}\nexport interface PrefEnum<T extends string = string> extends PrefBase<'enum', T> {\n options: readonly { value: T; label: string }[];\n control?: PrefEnumControl;\n}\n\nexport interface PrefColor extends PrefBase<'color', string> {\n /** Value is `#rrggbb`, or `#rrggbbaa` when `alpha` is set. */\n alpha?: boolean;\n}\n\nexport type BuiltinPref = PrefNumber | PrefBoolean | PrefString | PrefEnum | PrefColor;\n\n/**\n * Open leaf: any node with a `kind` the form doesn't know renders via the\n * `renderers` map (`renderers[kind]`). App schemas keep their extra fields\n * (e.g. a registry-enum's `source`/`filter`) — renderers receive the node\n * and narrow it themselves. Deliberately NOT index-signatured so concrete\n * app interfaces stay assignable.\n */\nexport interface PrefCustom extends PrefBase<string, unknown> {}\n\nexport type PrefLeaf = BuiltinPref | PrefCustom;\n\n/** Nestable group: branch nodes in the schema tree. */\nexport interface PrefGroup {\n name: string;\n description?: string;\n children: Record<string, PrefLeaf | PrefGroup>;\n}\n\nexport function isPrefLeaf(node: PrefLeaf | PrefGroup): node is PrefLeaf {\n return 'kind' in node;\n}\n\n/** Get the value at a dotted path inside a nested value tree. Returns\n * `undefined` when a segment is missing or hits a non-object. */\nexport function prefValueAtPath(values: unknown, path: string): unknown {\n let cur: unknown = values;\n for (const seg of path.split('.')) {\n if (cur == null || typeof cur !== 'object') return undefined;\n cur = (cur as Record<string, unknown>)[seg];\n }\n return cur;\n}\n\n/**\n * Recursively drop `hidden` leaves (unless `showHidden`), pruning groups\n * that end up empty. Returns null when the entire subtree is hidden.\n */\nexport function visiblePrefSubtree<T extends PrefLeaf | PrefGroup>(\n node: T,\n showHidden: boolean,\n): T | null {\n if (isPrefLeaf(node)) return node.hidden && !showHidden ? null : node;\n const group = node as PrefGroup;\n const children: Record<string, PrefLeaf | PrefGroup> = {};\n for (const [key, child] of Object.entries(group.children)) {\n const kept = visiblePrefSubtree(child, showHidden);\n if (kept) children[key] = kept;\n }\n if (Object.keys(children).length === 0) return null;\n return { ...node, children };\n}\n","/* Ported from WeaselDraw's wd-prefs-* rules (apps/draw/src/app.css),\n * generalized onto theme tokens. Column width is overridable via\n * --wzl-prefs-column-width at any ancestor scope. */\n\n.columns {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n align-items: flex-start;\n gap: 12px;\n overflow-y: auto;\n padding-right: 4px;\n}\n\n.column {\n flex: 0 0 var(--wzl-prefs-column-width, 300px);\n width: var(--wzl-prefs-column-width, 300px);\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 10px;\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n}\n\n.subpanel {\n display: flex;\n flex-direction: column;\n gap: 6px;\n margin-top: 6px;\n padding: 8px 8px 8px 10px;\n background: var(--wzl-surface-sunken);\n border-left: 2px solid var(--wzl-border);\n border-radius: 2px;\n}\n\n.groupHeader {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding-bottom: 4px;\n border-bottom: 1px solid var(--wzl-border);\n}\n\n.subpanel .groupHeader {\n border-bottom: none;\n padding-bottom: 2px;\n}\n\n.groupTitle {\n margin: 0;\n font-size: 12px;\n font-weight: 600;\n color: var(--wzl-fg);\n letter-spacing: 0.04em;\n text-transform: uppercase;\n}\n\n.subpanel .groupTitle {\n font-size: 11px;\n text-transform: none;\n letter-spacing: 0;\n}\n\n.groupDesc {\n margin: 0;\n font-size: 11px;\n color: var(--wzl-fg-subtle);\n line-height: 1.35;\n}\n\n.rows {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n font-size: 12px;\n color: var(--wzl-fg);\n cursor: default;\n}\n\n.rowLabel {\n flex: 1 1 auto;\n min-width: 0;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n/* Description affordance — quiet until hovered/focused. */\n.help {\n flex: 0 0 auto;\n padding: 0;\n border: none;\n background: none;\n color: var(--wzl-fg-subtle);\n font-size: 11px;\n line-height: 1;\n cursor: help;\n border-radius: var(--wzl-radius-sm);\n}\n\n.help:hover {\n color: var(--wzl-fg);\n}\n\n.help:focus-visible {\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: 1px;\n color: var(--wzl-fg);\n}\n\n/* Control slot — fixed width so the label can take the rest of the row.\n * Kit form controls render as block-level flex columns that fill it. */\n.rowControl {\n flex: 0 0 110px;\n min-width: 0;\n display: flex;\n align-items: center;\n}\n\n.textarea {\n width: 100%;\n padding: 4px 8px;\n background: var(--wzl-input-bg);\n color: var(--wzl-fg);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n font: inherit;\n font-size: 12px;\n resize: vertical;\n}\n\n.unrenderable {\n font-family: var(--wzl-font-mono);\n font-size: 11px;\n color: var(--wzl-fg-subtle);\n}\n\n/* PrefsDialog header row: title text + optional headerExtra chrome. */\n.titleRow {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n min-width: 0;\n}\n\n.titleRow > span:first-child {\n flex: 1;\n min-width: 0;\n}\n","import { useMemo, type ReactNode } from 'react';\nimport { Focusable } from 'react-aria-components';\nimport { Checkbox } from '../Checkbox';\nimport { ColorField } from '../ColorField';\nimport { Input } from '../Input';\nimport { NumberField } from '../NumberField';\nimport { RadioGroup, Radio } from '../RadioGroup';\nimport { RangeSlider } from '../RangeSlider';\nimport { Select } from '../Select';\nimport { Switch } from '../Switch';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport {\n isPrefLeaf,\n prefValueAtPath,\n visiblePrefSubtree,\n type PrefBoolean,\n type PrefColor,\n type PrefEnum,\n type PrefGroup,\n type PrefLeaf,\n type PrefNumber,\n type PrefString,\n} from './schema';\nimport s from './Prefs.module.css';\n\nexport interface PrefRenderContext {\n /** Dotted path of the leaf within the schema root. */\n path: string;\n /** The schema node. App renderers narrow this to their own kind shape. */\n pref: PrefLeaf;\n /** Current value — `values` at `path`, falling back to `pref.default`. */\n value: unknown;\n setValue: (value: unknown) => void;\n}\n\nexport type PrefRenderer = (ctx: PrefRenderContext) => ReactNode;\n\nexport interface PrefsFormProps {\n /** Root of the schema tree. Core `ToolPrefGroup`s assign structurally. */\n schema: PrefGroup;\n /** Nested value tree (shape mirrors the schema). Sparse is fine —\n * missing leaves fall back to their schema `default`. */\n values?: unknown;\n /** Change callback with the leaf's dotted path. Values apply live;\n * there is no dirty/commit state. */\n onChange: (path: string, value: unknown) => void;\n /**\n * Per-kind renderers for app-defined kinds. Entries also override the\n * built-in kinds when keys collide. A renderer owns the control cell\n * (the label/tooltip row chrome stays with the form, unless the leaf\n * sets `block`); returning `null` collapses the row entirely. Unknown\n * kinds with no renderer show a labeled placeholder instead of\n * crashing.\n */\n renderers?: Record<string, PrefRenderer>;\n /** Reveal `hidden` leaves (dev tooling). Default false. */\n showHidden?: boolean;\n className?: string;\n}\n\n/**\n * Schema-driven preferences form. Top-level groups render as columns,\n * nested groups as indented sub-panels, leaves as label + control rows.\n * Storage-agnostic: pair with `PrefsDialog` for the modal composition,\n * and persist however the app likes via `onChange`.\n */\nexport function PrefsForm(props: PrefsFormProps) {\n const { schema, values, onChange, renderers, showHidden = false, className } = props;\n const visibleRoot = useMemo(\n () => visiblePrefSubtree(schema, showHidden),\n [schema, showHidden],\n );\n const ctx: WalkCtx = { values, onChange, renderers };\n return (\n <div className={[s.columns, className].filter(Boolean).join(' ')}>\n {Object.entries(visibleRoot?.children ?? {}).map(([key, child]) => (\n <div key={key} className={s.column}>\n {isPrefLeaf(child) ? (\n // Top-level leaves are unusual but legal — give each its own\n // column for symmetry with grouped siblings.\n <PrefRow ctx={ctx} path={key} pref={child} />\n ) : (\n <GroupBody ctx={ctx} group={child} path={key} depth={0} />\n )}\n </div>\n ))}\n </div>\n );\n}\n\ninterface WalkCtx {\n values: unknown;\n onChange: (path: string, value: unknown) => void;\n renderers?: Record<string, PrefRenderer>;\n}\n\nfunction GroupBody({ ctx, group, path, depth }: {\n ctx: WalkCtx;\n group: PrefGroup;\n path: string;\n depth: number;\n}) {\n return (\n <div className={depth === 0 ? s.panel : s.subpanel}>\n <div className={s.groupHeader}>\n <h3 className={s.groupTitle}>{group.name}</h3>\n {group.description !== undefined && (\n <p className={s.groupDesc}>{group.description}</p>\n )}\n </div>\n <div className={s.rows}>\n {Object.entries(group.children).map(([key, child]) => {\n const childPath = `${path}.${key}`;\n return isPrefLeaf(child) ? (\n <PrefRow key={key} ctx={ctx} path={childPath} pref={child} />\n ) : (\n <GroupBody key={key} ctx={ctx} group={child} path={childPath} depth={depth + 1} />\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction PrefRow({ ctx, path, pref }: { ctx: WalkCtx; path: string; pref: PrefLeaf }) {\n const stored = prefValueAtPath(ctx.values, path);\n const renderCtx: PrefRenderContext = {\n path,\n pref,\n value: stored !== undefined ? stored : pref.default,\n setValue: (v) => ctx.onChange(path, v),\n };\n\n const custom = ctx.renderers?.[pref.kind];\n const control = custom ? custom(renderCtx) : renderBuiltin(renderCtx);\n if (custom && control === null) return null;\n\n // `block` leaves own their chrome (embedded editors with their own\n // header) — no label/tooltip row.\n if (pref.block) return <>{control}</>;\n\n return (\n <label className={s.row}>\n <span className={s.rowLabel}>\n {pref.name}\n {pref.description ? (\n // Help affordance carries the description tooltip. A tooltip\n // trigger must be interactive (keyboard-reachable), so this is\n // a real button — a bare label span would be neither focusable\n // nor announced.\n <TooltipTrigger>\n <Focusable>\n <button type=\"button\" className={s.help} aria-label={`About ${pref.name}`}>\n ⓘ\n </button>\n </Focusable>\n <Tooltip>{pref.description}</Tooltip>\n </TooltipTrigger>\n ) : null}\n </span>\n <span className={s.rowControl}>{control}</span>\n </label>\n );\n}\n\nfunction renderBuiltin(ctx: PrefRenderContext): ReactNode {\n const { pref, value, setValue } = ctx;\n switch (pref.kind) {\n case 'boolean': {\n const p = pref as PrefBoolean;\n const checked = Boolean(value);\n return p.control === 'switch' ? (\n <Switch isSelected={checked} onChange={setValue} aria-label={p.name} />\n ) : (\n <Checkbox isSelected={checked} onChange={setValue} aria-label={p.name} />\n );\n }\n case 'number': {\n const p = pref as PrefNumber;\n const n = typeof value === 'number' && Number.isFinite(value) ? value : 0;\n if (p.control === 'slider') {\n return (\n <RangeSlider\n value={n}\n onChange={(v) => setValue(typeof v === 'number' ? v : v[0])}\n minValue={p.min}\n maxValue={p.max}\n step={p.step ?? 1}\n aria-label={p.name}\n />\n );\n }\n return (\n <NumberField\n value={n}\n onChange={setValue}\n minValue={p.min}\n maxValue={p.max}\n step={p.step ?? 1}\n aria-label={p.name}\n />\n );\n }\n case 'string': {\n const p = pref as PrefString;\n const text = typeof value === 'string' ? value : '';\n if (p.control === 'textarea') {\n return (\n <textarea\n className={s.textarea}\n value={text}\n onChange={(e) => setValue(e.target.value)}\n aria-label={p.name}\n rows={3}\n />\n );\n }\n return <Input value={text} onChange={setValue} aria-label={p.name} />;\n }\n case 'enum': {\n const p = pref as PrefEnum;\n const selected = typeof value === 'string' ? value : p.default;\n if (p.control === 'radio') {\n return (\n <RadioGroup\n value={selected}\n onChange={(v) => setValue(v)}\n aria-label={p.name}\n >\n {p.options.map((o) => (\n <Radio key={o.value} value={o.value}>{o.label}</Radio>\n ))}\n </RadioGroup>\n );\n }\n return (\n <Select<string>\n options={p.options.map((o) => ({ value: o.value, label: o.label }))}\n selectedKey={selected}\n onSelectionChange={(v) => setValue(v)}\n aria-label={p.name}\n />\n );\n }\n case 'color': {\n const p = pref as PrefColor;\n const hex = typeof value === 'string' ? value : p.default;\n return (\n <ColorField\n value={hex}\n alpha={p.alpha}\n onChange={setValue}\n aria-label={p.name}\n />\n );\n }\n default:\n // Unknown kind with no renderer entry: labeled placeholder, not a\n // crash — a missing wiring should be visible and recoverable.\n return <span className={s.unrenderable}>({pref.kind}: no renderer)</span>;\n }\n}\n","import type { ReactNode } from 'react';\nimport { Dialog } from '../Dialog';\nimport { PrefsForm, type PrefsFormProps } from './PrefsForm';\nimport s from './Prefs.module.css';\n\nexport interface PrefsDialogProps extends PrefsFormProps {\n isOpen: boolean;\n onOpenChange: (open: boolean) => void;\n /** Dialog heading. Defaults to the schema root's `name`. */\n title?: ReactNode;\n /** Extra chrome rendered inline with the title (e.g. a dev-mode\n * \"Show hidden\" switch). */\n headerExtra?: ReactNode;\n /** Class applied to the dialog's modal box. */\n dialogClassName?: string;\n}\n\n/**\n * The kit's preferences dialog: `Dialog` + `PrefsForm`. Changes apply\n * live through `onChange` — there is no OK/Cancel staging. For custom\n * placement (sidebar, popover, inline page), compose `PrefsForm`\n * directly; this wrapper is intentionally thin.\n */\nexport function PrefsDialog(props: PrefsDialogProps) {\n const { isOpen, onOpenChange, title, headerExtra, dialogClassName, ...form } = props;\n return (\n <Dialog\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n aria-label={typeof title === 'string' ? title : form.schema.name}\n className={dialogClassName}\n title={\n headerExtra !== undefined ? (\n <span className={s.titleRow}>\n <span>{title ?? form.schema.name}</span>\n {headerExtra}\n </span>\n ) : (\n title ?? form.schema.name\n )\n }\n >\n <PrefsForm {...form} />\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAwFA,SAAgB,EAAW,GAA8C;CACvE,OAAO,UAAU;;AAKnB,SAAgB,EAAgB,GAAiB,GAAuB;CACtE,IAAI,IAAe;CACnB,KAAK,IAAM,KAAO,EAAK,MAAM,IAAI,EAAE;EACjC,IAAmB,OAAO,KAAQ,aAA9B,GAAwC;EAC5C,IAAO,EAAgC;;CAEzC,OAAO;;AAOT,SAAgB,EACd,GACA,GACU;CACV,IAAI,EAAW,EAAK,EAAE,OAAO,EAAK,UAAU,CAAC,IAAa,OAAO;CACjE,IAAM,IAAQ,GACR,IAAiD,EAAE;CACzD,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,EAAM,SAAS,EAAE;EACzD,IAAM,IAAO,EAAmB,GAAO,EAAW;EAClD,AAAI,MAAM,EAAS,KAAO;;CAG5B,OADI,OAAO,KAAK,EAAS,CAAC,WAAW,IAAU,OACxC;EAAE,GAAG;EAAM;EAAU;;;;;;;;;;;;;;;;;;;;;AErD9B,SAAgB,EAAU,GAAuB;CAC/C,IAAM,EAAE,WAAQ,WAAQ,aAAU,cAAW,gBAAa,IAAO,iBAAc,GACzE,IAAc,QACZ,EAAmB,GAAQ,EAAW,EAC5C,CAAC,GAAQ,EAAW,CACrB,EACK,IAAe;EAAE;EAAQ;EAAU;EAAW;CACpD,OACE,kBAAC,OAAD;EAAK,WAAW,CAAC,EAA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E,kBAAC,GAAD;EACU;EACM;EACd,cAAY,OAAO,KAAU,WAAW,IAAQ,EAAK,OAAO;EAC5D,WAAW;EACX,OACE,MAAgB,KAAA,IAMd,KAAS,EAAK,OAAO,OALrB,kBAAC,QAAD;GAAM,WAAW,EAAE;aAAnB,CACE,kBAAC,QAAD,EAAA,UAAO,KAAS,EAAK,OAAO,MAAY,CAAA,EACvC,EACI;;YAMX,kBAAC,GAAD,EAAW,GAAI,GAAQ,CAAA;EAChB,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { n as e } from "./Field-4cagmYlT.js";
|
|
2
|
+
import { FieldError as t, Label as n, Radio as r, RadioGroup as i, Text as a } from "react-aria-components";
|
|
3
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
var c = {
|
|
5
|
+
group: "_group_1j9o8_1",
|
|
6
|
+
legend: "_legend_1j9o8_14",
|
|
7
|
+
radio: "_radio_1j9o8_20",
|
|
8
|
+
dot: "_dot_1j9o8_36"
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/RadioGroup/RadioGroup.tsx
|
|
12
|
+
function l(r) {
|
|
13
|
+
let { label: l, description: u, errorMessage: d, children: f, className: p, ...m } = r;
|
|
14
|
+
return /* @__PURE__ */ s(i, {
|
|
15
|
+
...m,
|
|
16
|
+
className: [
|
|
17
|
+
c.group,
|
|
18
|
+
e.root,
|
|
19
|
+
p
|
|
20
|
+
].filter(Boolean).join(" "),
|
|
21
|
+
children: [
|
|
22
|
+
l !== void 0 && /* @__PURE__ */ o(n, {
|
|
23
|
+
className: c.legend,
|
|
24
|
+
children: l
|
|
25
|
+
}),
|
|
26
|
+
f,
|
|
27
|
+
u !== void 0 && /* @__PURE__ */ o(a, {
|
|
28
|
+
slot: "description",
|
|
29
|
+
className: e.hint,
|
|
30
|
+
children: u
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ o(t, {
|
|
33
|
+
className: e.error,
|
|
34
|
+
children: d
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function u({ children: e, className: t, ...n }) {
|
|
40
|
+
return /* @__PURE__ */ s(r, {
|
|
41
|
+
...n,
|
|
42
|
+
className: [c.radio, t].filter(Boolean).join(" "),
|
|
43
|
+
children: [/* @__PURE__ */ o("span", { className: c.dot }), e !== void 0 && /* @__PURE__ */ o("span", { children: e })]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { l as n, u as t };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=RadioGroup-DUlTy95a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup-DUlTy95a.js","names":[],"sources":["../../src/components/RadioGroup/RadioGroup.module.css","../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":[".group {\n display: flex;\n flex-direction: column;\n gap: 6px;\n font-family: var(--wzl-font-ui);\n color: var(--wzl-fg);\n}\n\n.group[data-orientation=\"horizontal\"] {\n flex-direction: row;\n gap: 16px;\n}\n\n.legend {\n font-size: 12px;\n font-weight: 500;\n color: var(--wzl-fg);\n}\n\n.radio {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n font-size: 13px;\n color: var(--wzl-fg);\n user-select: none;\n -webkit-user-select: none;\n}\n\n.radio[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.dot {\n position: relative;\n flex: 0 0 auto;\n width: 14px;\n height: 14px;\n background: var(--wzl-input-bg);\n border: 1px solid var(--wzl-border-strong);\n border-radius: 50%;\n transition: border-color var(--wzl-motion-fast), box-shadow var(--wzl-motion-fast);\n}\n\n.radio[data-focus-visible] .dot {\n box-shadow: 0 0 0 2px var(--wzl-focus-ring);\n}\n\n.radio[data-hovered]:not([data-disabled]) .dot {\n border-color: var(--wzl-fg-muted);\n}\n\n.radio[data-selected] .dot {\n border-color: var(--wzl-accent-strong);\n}\n\n.dot::after {\n content: '';\n position: absolute;\n inset: 3px;\n border-radius: 50%;\n background: var(--wzl-accent-strong);\n transform: scale(0);\n transition: transform var(--wzl-motion-fast);\n}\n\n.radio[data-selected] .dot::after {\n transform: scale(1);\n}\n","import type { ReactNode } from 'react';\nimport {\n RadioGroup as RACRadioGroup,\n Radio as RACRadio,\n Label,\n Text,\n FieldError,\n type RadioGroupProps as RACRadioGroupProps,\n type RadioProps as RACRadioProps,\n type ValidationResult,\n} from 'react-aria-components';\nimport { fieldClasses } from '../Field/Field';\nimport s from './RadioGroup.module.css';\n\nexport type RadioGroupProps = Omit<RACRadioGroupProps, 'children' | 'className'> & {\n label?: ReactNode;\n description?: ReactNode;\n errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);\n children?: ReactNode;\n className?: string;\n};\n\nexport function RadioGroup(props: RadioGroupProps) {\n const { label, description, errorMessage, children, className, ...rest } = props;\n return (\n <RACRadioGroup\n {...rest}\n className={[s.group, fieldClasses.root, className].filter(Boolean).join(' ')}\n >\n {label !== undefined && <Label className={s.legend}>{label}</Label>}\n {children}\n {description !== undefined && (\n <Text slot=\"description\" className={fieldClasses.hint}>\n {description}\n </Text>\n )}\n <FieldError className={fieldClasses.error}>{errorMessage}</FieldError>\n </RACRadioGroup>\n );\n}\n\nexport type RadioProps = Omit<RACRadioProps, 'className' | 'children'> & {\n children?: ReactNode;\n className?: string;\n};\n\nexport function Radio({ children, className, ...rest }: RadioProps) {\n return (\n <RACRadio {...rest} className={[s.radio, className].filter(Boolean).join(' ')}>\n <span className={s.dot} />\n {children !== undefined && <span>{children}</span>}\n </RACRadio>\n );\n}\n"],"mappings":";;;;;;;;;;;ACsBA,SAAgB,EAAW,GAAwB;CACjD,IAAM,EAAE,UAAO,gBAAa,iBAAc,aAAU,cAAW,GAAG,MAAS;CAC3E,OACE,kBAAC,GAAD;EACE,GAAI;EACJ,WAAW;GAAC,EAAE;GAAO,EAAa;GAAM;GAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAF9E;GAIG,MAAU,KAAA,KAAa,kBAAC,GAAD;IAAO,WAAW,EAAE;cAAS;IAAc,CAAA;GAClE;GACA,MAAgB,KAAA,KACf,kBAAC,GAAD;IAAM,MAAK;IAAc,WAAW,EAAa;cAC9C;IACI,CAAA;GAET,kBAAC,GAAD;IAAY,WAAW,EAAa;cAAQ;IAA0B,CAAA;GACxD;;;AASpB,SAAgB,EAAM,EAAE,aAAU,cAAW,GAAG,KAAoB;CAClE,OACE,kBAAC,GAAD;EAAU,GAAI;EAAM,WAAW,CAAC,EAAE,OAAO,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAA7E,CACE,kBAAC,QAAD,EAAM,WAAW,EAAE,KAAO,CAAA,EACzB,MAAa,KAAA,KAAa,kBAAC,QAAD,EAAO,aAAgB,CAAA,CACzC"}
|