@weasel-js/ui 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/ActionBar-xA73vzzF.js +64 -0
- package/dist/chunks/ActionBar-xA73vzzF.js.map +1 -0
- package/dist/chunks/{Badge-D2aD7xVL.js → Badge-jYQjrTKc.js} +235 -264
- package/dist/chunks/{Badge-D2aD7xVL.js.map → Badge-jYQjrTKc.js.map} +1 -1
- package/dist/chunks/BandEditor-Dd0egAgE.js.map +1 -1
- package/dist/chunks/{Button-BIdXHQOx.js → Button-XB-T75YL.js} +2 -2
- package/dist/chunks/{Button-BIdXHQOx.js.map → Button-XB-T75YL.js.map} +1 -1
- package/dist/chunks/{ButtonBar-DIQTe5GQ.js → ButtonBar-CIMKPPRS.js} +7 -9
- package/dist/chunks/{ButtonBar-DIQTe5GQ.js.map → ButtonBar-CIMKPPRS.js.map} +1 -1
- package/dist/chunks/Callout-BUn0dP_S.js +115 -0
- package/dist/chunks/Callout-BUn0dP_S.js.map +1 -0
- package/dist/chunks/Checkbox-DFn-x0JO.js +37 -0
- package/dist/chunks/Checkbox-DFn-x0JO.js.map +1 -0
- package/dist/chunks/{CloseButton-C2J7wVfo.js → CloseButton-BmNmRVtb.js} +3 -3
- package/dist/chunks/{CloseButton-C2J7wVfo.js.map → CloseButton-BmNmRVtb.js.map} +1 -1
- package/dist/chunks/ColorField-BLs9fbeq.js +90 -0
- package/dist/chunks/ColorField-BLs9fbeq.js.map +1 -0
- package/dist/chunks/{ColorModeControl-BewxA0rX.js → ColorModeControl-DaVJ-SyX.js} +3 -3
- package/dist/chunks/{ColorModeControl-BewxA0rX.js.map → ColorModeControl-DaVJ-SyX.js.map} +1 -1
- package/dist/chunks/ComboBox-CuTLRmUg.js +138 -0
- package/dist/chunks/ComboBox-CuTLRmUg.js.map +1 -0
- package/dist/chunks/{CurveEditor-DUVjd25R.js → CurveEditor-jVBEqqdv.js} +90 -87
- package/dist/chunks/CurveEditor-jVBEqqdv.js.map +1 -0
- package/dist/chunks/{DataGrid-LZ2JgY2Y.js → DataGrid-BklgBqS0.js} +2 -2
- package/dist/chunks/{DataGrid-LZ2JgY2Y.js.map → DataGrid-BklgBqS0.js.map} +1 -1
- package/dist/chunks/{DetailList-BKomDzg5.js → DetailList-DFtqdOJj.js} +7 -7
- package/dist/chunks/DetailList-DFtqdOJj.js.map +1 -0
- package/dist/chunks/{DetentSlider-5uQPFucv.js → DetentSlider-Bh7EpMqT.js} +2 -2
- package/dist/chunks/{DetentSlider-5uQPFucv.js.map → DetentSlider-Bh7EpMqT.js.map} +1 -1
- package/dist/chunks/{Dialog-DGFutQ--.js → Dialog-DKfsk5VN.js} +3 -3
- package/dist/chunks/{Dialog-DGFutQ--.js.map → Dialog-DKfsk5VN.js.map} +1 -1
- package/dist/chunks/{DragGhost-B5_hb9W9.js → DragGhost-BeYDJyLZ.js} +2 -2
- package/dist/chunks/{DragGhost-B5_hb9W9.js.map → DragGhost-BeYDJyLZ.js.map} +1 -1
- package/dist/chunks/{FallthroughDiagram-BEHiM5IS.js → FallthroughDiagram-C7BUe8eU.js} +3 -3
- package/dist/chunks/{FallthroughDiagram-BEHiM5IS.js.map → FallthroughDiagram-C7BUe8eU.js.map} +1 -1
- package/dist/chunks/Field-DsBlnFKf.js +25 -0
- package/dist/chunks/Field-DsBlnFKf.js.map +1 -0
- package/dist/chunks/FillStrokeSwatch-CgsYQgew.js +112 -0
- package/dist/chunks/FillStrokeSwatch-CgsYQgew.js.map +1 -0
- package/dist/chunks/{FontFamilySelect-DkRgNtag.js → FontFamilySelect-CGJ5OIOy.js} +2 -2
- package/dist/chunks/FontFamilySelect-CGJ5OIOy.js.map +1 -0
- package/dist/chunks/FontWeightSelect-RbcXYJPS.js +49 -0
- package/dist/chunks/FontWeightSelect-RbcXYJPS.js.map +1 -0
- package/dist/chunks/{GestureRoute-C_YGl7bJ.js → GestureRoute-BXESrHI0.js} +2 -2
- package/dist/chunks/{GestureRoute-C_YGl7bJ.js.map → GestureRoute-BXESrHI0.js.map} +1 -1
- package/dist/chunks/GradientEditor-DypXzMc-.js +325 -0
- package/dist/chunks/GradientEditor-DypXzMc-.js.map +1 -0
- package/dist/chunks/{Icon-CcVjdq2C.js → Icon--B1ME-6c.js} +3 -1
- package/dist/chunks/Icon--B1ME-6c.js.map +1 -0
- package/dist/chunks/{Input-CHmkfYaD.js → Input-CzwvCZs_.js} +10 -15
- package/dist/chunks/Input-CzwvCZs_.js.map +1 -0
- package/dist/chunks/{ItemList-Cm-HUWCi.js → ItemList-CRu9y7hL.js} +2 -2
- package/dist/chunks/ItemList-CRu9y7hL.js.map +1 -0
- package/dist/chunks/{Jog-DRmfrkCg.js → Jog-DfNUYejm.js} +8 -8
- package/dist/chunks/Jog-DfNUYejm.js.map +1 -0
- package/dist/chunks/{LayerList-wCI1EueM.js → LayerList-CsDqwYh-.js} +151 -153
- package/dist/chunks/LayerList-CsDqwYh-.js.map +1 -0
- package/dist/chunks/ListEditor-BnGzqERm.js +72 -0
- package/dist/chunks/ListEditor-BnGzqERm.js.map +1 -0
- package/dist/chunks/MenuButton-L9f5vido.js +75 -0
- package/dist/chunks/MenuButton-L9f5vido.js.map +1 -0
- package/dist/chunks/MeshEditor-GbqqiPk8.js +199 -0
- package/dist/chunks/MeshEditor-GbqqiPk8.js.map +1 -0
- package/dist/chunks/{NumberField-BnJxcazc.js → NumberField-DLXXgh48.js} +26 -23
- package/dist/chunks/NumberField-DLXXgh48.js.map +1 -0
- package/dist/chunks/{OptionsBar-ujxYidhj.js → OptionsBar-DeTAjVb7.js} +6 -8
- package/dist/chunks/{OptionsBar-ujxYidhj.js.map → OptionsBar-DeTAjVb7.js.map} +1 -1
- package/dist/chunks/PaintField-C0hoXc0Y.js +63 -0
- package/dist/chunks/PaintField-C0hoXc0Y.js.map +1 -0
- package/dist/chunks/PaintInput-jQRxM95Y.js +132 -0
- package/dist/chunks/PaintInput-jQRxM95Y.js.map +1 -0
- package/dist/chunks/PatternPicker-CaMYXzhF.js +135 -0
- package/dist/chunks/PatternPicker-CaMYXzhF.js.map +1 -0
- package/dist/chunks/{Plot2D-CTXHkL5p.js → Plot2D-BHNbgCAl.js} +7 -7
- package/dist/chunks/Plot2D-BHNbgCAl.js.map +1 -0
- package/dist/chunks/{PointPlotter-ldI4RrU1.js → PointPlotter-BZ_vk6gV.js} +2 -2
- package/dist/chunks/{PointPlotter-ldI4RrU1.js.map → PointPlotter-BZ_vk6gV.js.map} +1 -1
- package/dist/chunks/{Powerline-DNyH885r.js → Powerline-6wIFmDik.js} +2 -2
- package/dist/chunks/{Powerline-DNyH885r.js.map → Powerline-6wIFmDik.js.map} +1 -1
- package/dist/chunks/{Prefs-ByA-x51i.js → Prefs-CkyldX-e.js} +83 -70
- package/dist/chunks/Prefs-CkyldX-e.js.map +1 -0
- package/dist/chunks/{Properties-DmAeQ3mk.js → Properties-D15c8NP-.js} +25 -25
- package/dist/chunks/{Properties-DmAeQ3mk.js.map → Properties-D15c8NP-.js.map} +1 -1
- package/dist/chunks/PropertyField-CV_Gw57S.js +686 -0
- package/dist/chunks/PropertyField-CV_Gw57S.js.map +1 -0
- package/dist/chunks/{RadioGroup-Bh4-12e-.js → RadioGroup-4dbzqvGy.js} +2 -2
- package/dist/chunks/{RadioGroup-Bh4-12e-.js.map → RadioGroup-4dbzqvGy.js.map} +1 -1
- package/dist/chunks/{RangeSlider-SEGE-7VF.js → RangeSlider-BxokZViJ.js} +8 -8
- package/dist/chunks/RangeSlider-BxokZViJ.js.map +1 -0
- package/dist/chunks/RecentColorsProvider-DHcfk25u.js +84 -0
- package/dist/chunks/RecentColorsProvider-DHcfk25u.js.map +1 -0
- package/dist/chunks/ResizeHandle-CbAgCQOt.js +81 -0
- package/dist/chunks/ResizeHandle-CbAgCQOt.js.map +1 -0
- package/dist/chunks/Select-BppLsJTz.js +236 -0
- package/dist/chunks/Select-BppLsJTz.js.map +1 -0
- package/dist/chunks/{SelectionPanel-BaQnX4Bs.js → SelectionPanel-Cm1qu-ZX.js} +14 -13
- package/dist/chunks/{SelectionPanel-BaQnX4Bs.js.map → SelectionPanel-Cm1qu-ZX.js.map} +1 -1
- package/dist/chunks/{SidebarPanel-BblDEz4G.js → SidebarPanel-AXQ0jRDx.js} +2 -2
- package/dist/chunks/{SidebarPanel-BblDEz4G.js.map → SidebarPanel-AXQ0jRDx.js.map} +1 -1
- package/dist/chunks/{Slider-YofwGOI4.js → Slider-Cl5RCeZ7.js} +19 -19
- package/dist/chunks/Slider-Cl5RCeZ7.js.map +1 -0
- package/dist/chunks/SwatchGrid-9ZPiDmxd.js +78 -0
- package/dist/chunks/SwatchGrid-9ZPiDmxd.js.map +1 -0
- package/dist/chunks/SwatchStrip-Cw0l8Om7.js +577 -0
- package/dist/chunks/SwatchStrip-Cw0l8Om7.js.map +1 -0
- package/dist/chunks/{ThemeSwitcher-BlsInAmR.js → ThemeSwitcher-DiBmMh_B.js} +3 -3
- package/dist/chunks/{ThemeSwitcher-BlsInAmR.js.map → ThemeSwitcher-DiBmMh_B.js.map} +1 -1
- package/dist/chunks/{Timeline-B39cwfMB.js → Timeline-pqnYk5cV.js} +244 -246
- package/dist/chunks/Timeline-pqnYk5cV.js.map +1 -0
- package/dist/chunks/Toast-C3ozq11V.js +170 -0
- package/dist/chunks/Toast-C3ozq11V.js.map +1 -0
- package/dist/chunks/{ToggleBar-BTYkBXU9.js → ToggleBar-Z2jZiguF.js} +6 -8
- package/dist/chunks/{ToggleBar-BTYkBXU9.js.map → ToggleBar-Z2jZiguF.js.map} +1 -1
- package/dist/chunks/{TokenPanel-CMDAOfYH.js → TokenPanel-DAkL6vwQ.js} +32 -32
- package/dist/chunks/TokenPanel-DAkL6vwQ.js.map +1 -0
- package/dist/chunks/{ToolButton-CAHBa08P.js → ToolButton-BURp4YIO.js} +7 -9
- package/dist/chunks/ToolButton-BURp4YIO.js.map +1 -0
- package/dist/chunks/{ToolOptionsBar-D_GCrBAN.js → ToolOptionsBar-COsTJ1cu.js} +3 -2
- package/dist/chunks/{ToolOptionsBar-D_GCrBAN.js.map → ToolOptionsBar-COsTJ1cu.js.map} +1 -1
- package/dist/chunks/{ToolPalette-OOWN51Xx.js → ToolPalette-DKDFWOX-.js} +7 -9
- package/dist/chunks/{ToolPalette-OOWN51Xx.js.map → ToolPalette-DKDFWOX-.js.map} +1 -1
- package/dist/chunks/{Tooltip-Clg2mhSt.js → Tooltip-C6eFCYxw.js} +2 -2
- package/dist/chunks/{Tooltip-Clg2mhSt.js.map → Tooltip-C6eFCYxw.js.map} +1 -1
- package/dist/chunks/Tree-Cc8lIzgM.js.map +1 -1
- package/dist/chunks/checkbox.module-DLQV9tMX.js +5 -0
- package/dist/chunks/checkbox.module-DLQV9tMX.js.map +1 -0
- package/dist/chunks/{createKeyframeLayer-DVl321_l.js → createKeyframeLayer-BTa4LyJE.js} +194 -208
- package/dist/chunks/createKeyframeLayer-BTa4LyJE.js.map +1 -0
- package/dist/chunks/field.module-Bh7BTKMh.js +15 -0
- package/dist/chunks/field.module-Bh7BTKMh.js.map +1 -0
- package/dist/chunks/formatShortcut-DRQrVThu.js.map +1 -1
- package/dist/chunks/handles-CqVANLtu.js +17 -0
- package/dist/chunks/handles-CqVANLtu.js.map +1 -0
- package/dist/chunks/{icons-BhcR1l64.js → icons-Dr2-r30x.js} +2 -2
- package/dist/chunks/icons-Dr2-r30x.js.map +1 -0
- package/dist/chunks/listbox.module-BcdVJMbm.js +8 -0
- package/dist/chunks/listbox.module-BcdVJMbm.js.map +1 -0
- package/dist/chunks/model-B1-gMBIW.js +386 -0
- package/dist/chunks/model-B1-gMBIW.js.map +1 -0
- package/dist/chunks/{portalHost-yTOVuCej.js → portalHost-CE70wLzo.js} +10 -6
- package/dist/chunks/portalHost-CE70wLzo.js.map +1 -0
- package/dist/chunks/prefField-BE_Ytr2H.js +229 -0
- package/dist/chunks/prefField-BE_Ytr2H.js.map +1 -0
- package/dist/chunks/{segmentTooltip-CStYHKzd.js → segmentTooltip-CGxCOWNz.js} +2 -2
- package/dist/chunks/{segmentTooltip-CStYHKzd.js.map → segmentTooltip-CGxCOWNz.js.map} +1 -1
- package/dist/chunks/segmentedControl.module-BzGXUL5G.js +11 -0
- package/dist/chunks/segmentedControl.module-BzGXUL5G.js.map +1 -0
- package/dist/chunks/useReorderDragList-CStYKjHl.js +133 -0
- package/dist/chunks/useReorderDragList-CStYKjHl.js.map +1 -0
- package/dist/chunks/useRovingTabIndex-D7u22Ia_.js +91 -0
- package/dist/chunks/useRovingTabIndex-D7u22Ia_.js.map +1 -0
- package/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/components/ActionBar/index.js +1 -1
- package/dist/components/Badge/bases/ChamferedRect.d.ts.map +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/BandEditor/BandEditor.d.ts +1 -0
- package/dist/components/BandEditor/BandEditor.d.ts.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonBar/ButtonBar.d.ts.map +1 -1
- package/dist/components/ButtonBar/index.js +1 -1
- package/dist/components/Callout/Callout.d.ts.map +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +28 -13
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/CloseButton/index.js +1 -1
- package/dist/components/ColorField/ColorField.d.ts.map +1 -1
- package/dist/components/ColorField/OpacityRange.d.ts +18 -0
- package/dist/components/ColorField/OpacityRange.d.ts.map +1 -0
- package/dist/components/ColorField/index.js +1 -1
- package/dist/components/ColorModeControl/index.js +1 -1
- package/dist/components/ComboBox/ComboBox.d.ts +7 -0
- package/dist/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/CurveEditor/CurveEditor.d.ts.map +1 -1
- package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -1
- package/dist/components/CurveEditor/index.js +2 -2
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/DetailList/index.js +1 -1
- package/dist/components/DetentSlider/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/DragGhost/index.js +1 -1
- package/dist/components/FallthroughDiagram/index.js +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -1
- package/dist/components/FillStrokeSwatch/index.js +1 -1
- package/dist/components/FontFamilySelect/FontFamilySelect.d.ts +20 -0
- package/dist/components/FontFamilySelect/FontFamilySelect.d.ts.map +1 -1
- package/dist/components/FontFamilySelect/index.js +1 -1
- package/dist/components/FontWeightSelect/FontWeightSelect.d.ts +26 -0
- package/dist/components/FontWeightSelect/FontWeightSelect.d.ts.map +1 -0
- package/dist/components/FontWeightSelect/index.d.ts +3 -0
- package/dist/components/FontWeightSelect/index.d.ts.map +1 -0
- package/dist/components/FontWeightSelect/index.js +2 -0
- package/dist/components/GestureRoute/index.js +1 -1
- package/dist/components/GradientEditor/GradientHandles.d.ts +1 -8
- package/dist/components/GradientEditor/GradientHandles.d.ts.map +1 -1
- package/dist/components/GradientEditor/SceneGradientHandles.d.ts +7 -5
- package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -1
- package/dist/components/GradientEditor/handleOverlay.d.ts +41 -0
- package/dist/components/GradientEditor/handleOverlay.d.ts.map +1 -0
- package/dist/components/GradientEditor/index.js +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- 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 +32 -31
- 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/LayerList/LayerList.d.ts.map +1 -1
- package/dist/components/LayerList/index.js +1 -1
- package/dist/components/ListEditor/ListEditor.d.ts.map +1 -1
- package/dist/components/ListEditor/index.js +1 -1
- package/dist/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/dist/components/MenuButton/index.js +1 -1
- package/dist/components/MeshEditor/MeshEditor.d.ts +4 -3
- package/dist/components/MeshEditor/MeshEditor.d.ts.map +1 -1
- package/dist/components/MeshEditor/MeshHandles.d.ts +38 -0
- package/dist/components/MeshEditor/MeshHandles.d.ts.map +1 -0
- package/dist/components/MeshEditor/index.d.ts +2 -0
- package/dist/components/MeshEditor/index.d.ts.map +1 -1
- package/dist/components/MeshEditor/index.js +2 -2
- package/dist/components/NumberField/NumberField.d.ts +1 -1
- package/dist/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OptionsBar/OptionsBar.d.ts.map +1 -1
- package/dist/components/OptionsBar/index.js +1 -1
- package/dist/components/PaintField/PaintField.d.ts.map +1 -1
- package/dist/components/PaintField/index.js +1 -1
- package/dist/components/PaintInput/PaintInput.d.ts.map +1 -1
- package/dist/components/PaintInput/index.js +1 -1
- package/dist/components/PatternPicker/PatternPicker.d.ts +6 -5
- package/dist/components/PatternPicker/PatternPicker.d.ts.map +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/index.js +2 -2
- package/dist/components/Prefs/PrefsForm.d.ts +8 -0
- package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
- package/dist/components/Prefs/PrefsRail.d.ts +3 -2
- package/dist/components/Prefs/PrefsRail.d.ts.map +1 -1
- package/dist/components/Prefs/index.js +2 -2
- package/dist/components/Prefs/prefField.d.ts +13 -0
- package/dist/components/Prefs/prefField.d.ts.map +1 -1
- package/dist/components/Properties/PropertyField.d.ts +13 -2
- package/dist/components/Properties/PropertyField.d.ts.map +1 -1
- package/dist/components/Properties/index.js +3 -3
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/RecentColors/RecentColorsProvider.d.ts +24 -0
- package/dist/components/RecentColors/RecentColorsProvider.d.ts.map +1 -0
- package/dist/components/RecentColors/index.d.ts +5 -0
- package/dist/components/RecentColors/index.d.ts.map +1 -0
- package/dist/components/RecentColors/index.js +2 -0
- package/dist/components/RecentColors/recentColors.d.ts +39 -0
- package/dist/components/RecentColors/recentColors.d.ts.map +1 -0
- package/dist/components/ResizeHandle/ResizeHandle.d.ts.map +1 -1
- package/dist/components/ResizeHandle/index.js +1 -1
- package/dist/components/Select/Select.d.ts +6 -2
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionPanel/index.js +2 -2
- package/dist/components/SelectionPanel/renderLeaf.d.ts +12 -2
- package/dist/components/SelectionPanel/renderLeaf.d.ts.map +1 -1
- package/dist/components/SidebarPanel/index.js +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/SwatchGrid/SwatchGrid.d.ts.map +1 -1
- package/dist/components/SwatchGrid/index.js +1 -1
- package/dist/components/SwatchStrip/SwatchStrip.d.ts +44 -0
- package/dist/components/SwatchStrip/SwatchStrip.d.ts.map +1 -0
- package/dist/components/SwatchStrip/index.d.ts +5 -0
- package/dist/components/SwatchStrip/index.d.ts.map +1 -0
- package/dist/components/SwatchStrip/index.js +2 -0
- package/dist/components/SwatchStrip/palettes.d.ts +21 -0
- package/dist/components/SwatchStrip/palettes.d.ts.map +1 -0
- package/dist/components/ThemeSwitcher/index.js +1 -1
- package/dist/components/Timeline/AnimatedTimeline.d.ts +1 -0
- package/dist/components/Timeline/AnimatedTimeline.d.ts.map +1 -1
- package/dist/components/Timeline/EasingPicker.d.ts +3 -0
- package/dist/components/Timeline/EasingPicker.d.ts.map +1 -1
- package/dist/components/Timeline/LaneGraph.d.ts +1 -1
- package/dist/components/Timeline/LaneGraph.d.ts.map +1 -1
- package/dist/components/Timeline/Timeline.d.ts +10 -1
- package/dist/components/Timeline/Timeline.d.ts.map +1 -1
- package/dist/components/Timeline/Transport.d.ts +6 -0
- package/dist/components/Timeline/Transport.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +1 -1
- package/dist/components/Timeline/keys.d.ts +1 -0
- package/dist/components/Timeline/keys.d.ts.map +1 -1
- package/dist/components/Toast/Toast.d.ts +12 -3
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
- package/dist/components/ToggleBar/index.js +1 -1
- package/dist/components/TokenPanel/index.js +1 -1
- package/dist/components/TokenPanel/tokenTypes.d.ts +1 -0
- package/dist/components/TokenPanel/tokenTypes.d.ts.map +1 -1
- package/dist/components/ToolButton/ToolButton.d.ts +1 -10
- package/dist/components/ToolButton/ToolButton.d.ts.map +1 -1
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -1
- package/dist/components/ToolPalette/formatShortcut.d.ts +2 -0
- package/dist/components/ToolPalette/formatShortcut.d.ts.map +1 -1
- package/dist/components/ToolPalette/index.js +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Tree/Tree.d.ts +27 -26
- package/dist/components/Tree/Tree.d.ts.map +1 -1
- package/dist/icons/index.d.ts +51 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/paths.d.ts +2 -0
- package/dist/icons/paths.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +98 -95
- package/dist/index.js.map +1 -1
- package/dist/overlays/portalHost.d.ts +6 -0
- package/dist/overlays/portalHost.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/useAsyncOptions.d.ts.map +1 -1
- package/dist/useReorderDragList.d.ts.map +1 -1
- package/dist/useRovingTabIndex.d.ts +40 -39
- package/dist/useRovingTabIndex.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/chunks/ActionBar-DCq16yFA.js +0 -57
- package/dist/chunks/ActionBar-DCq16yFA.js.map +0 -1
- package/dist/chunks/Callout-ndW5_Bqx.js +0 -116
- package/dist/chunks/Callout-ndW5_Bqx.js.map +0 -1
- package/dist/chunks/Checkbox-DHXTUHO9.js +0 -47
- package/dist/chunks/Checkbox-DHXTUHO9.js.map +0 -1
- package/dist/chunks/ColorField-Yz_BkcCT.js +0 -69
- package/dist/chunks/ColorField-Yz_BkcCT.js.map +0 -1
- package/dist/chunks/ComboBox-B34H76CW.js +0 -138
- package/dist/chunks/ComboBox-B34H76CW.js.map +0 -1
- package/dist/chunks/CurveEditor-DUVjd25R.js.map +0 -1
- package/dist/chunks/DetailList-BKomDzg5.js.map +0 -1
- package/dist/chunks/Field--onYxXTF.js +0 -32
- package/dist/chunks/Field--onYxXTF.js.map +0 -1
- package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js +0 -111
- package/dist/chunks/FillStrokeSwatch-DNb0KXPk.js.map +0 -1
- package/dist/chunks/FontFamilySelect-DkRgNtag.js.map +0 -1
- package/dist/chunks/GradientEditor-b7v4Ph3i.js +0 -363
- package/dist/chunks/GradientEditor-b7v4Ph3i.js.map +0 -1
- package/dist/chunks/Icon-CcVjdq2C.js.map +0 -1
- package/dist/chunks/Input-CHmkfYaD.js.map +0 -1
- package/dist/chunks/ItemList-Cm-HUWCi.js.map +0 -1
- package/dist/chunks/Jog-DRmfrkCg.js.map +0 -1
- package/dist/chunks/LayerList-wCI1EueM.js.map +0 -1
- package/dist/chunks/ListEditor-BeA60TAA.js +0 -71
- package/dist/chunks/ListEditor-BeA60TAA.js.map +0 -1
- package/dist/chunks/MenuButton-BSqEChJE.js +0 -70
- package/dist/chunks/MenuButton-BSqEChJE.js.map +0 -1
- package/dist/chunks/MeshEditor-D1HLZcAh.js +0 -87
- package/dist/chunks/MeshEditor-D1HLZcAh.js.map +0 -1
- package/dist/chunks/NumberField-BnJxcazc.js.map +0 -1
- package/dist/chunks/PaintField-DadOELMg.js +0 -62
- package/dist/chunks/PaintField-DadOELMg.js.map +0 -1
- package/dist/chunks/PaintInput-v8Y7MDbH.js +0 -121
- package/dist/chunks/PaintInput-v8Y7MDbH.js.map +0 -1
- package/dist/chunks/PatternPicker-R_EQtw2Q.js +0 -93
- package/dist/chunks/PatternPicker-R_EQtw2Q.js.map +0 -1
- package/dist/chunks/Plot2D-CTXHkL5p.js.map +0 -1
- package/dist/chunks/Prefs-ByA-x51i.js.map +0 -1
- package/dist/chunks/PropertyField-DfIJJ5GS.js +0 -673
- package/dist/chunks/PropertyField-DfIJJ5GS.js.map +0 -1
- package/dist/chunks/RangeSlider-SEGE-7VF.js.map +0 -1
- package/dist/chunks/ResizeHandle-rKVWyeTG.js +0 -79
- package/dist/chunks/ResizeHandle-rKVWyeTG.js.map +0 -1
- package/dist/chunks/Select-ClmKtyWg.js +0 -229
- package/dist/chunks/Select-ClmKtyWg.js.map +0 -1
- package/dist/chunks/Slider-YofwGOI4.js.map +0 -1
- package/dist/chunks/SwatchGrid-BYvA8Bmh.js +0 -73
- package/dist/chunks/SwatchGrid-BYvA8Bmh.js.map +0 -1
- package/dist/chunks/Timeline-B39cwfMB.js.map +0 -1
- package/dist/chunks/Toast-BF9GE0HC.js +0 -126
- package/dist/chunks/Toast-BF9GE0HC.js.map +0 -1
- package/dist/chunks/TokenPanel-CMDAOfYH.js.map +0 -1
- package/dist/chunks/ToolButton-CAHBa08P.js.map +0 -1
- package/dist/chunks/createKeyframeLayer-DVl321_l.js.map +0 -1
- package/dist/chunks/icons-BhcR1l64.js.map +0 -1
- package/dist/chunks/model-BaF65rnX.js +0 -365
- package/dist/chunks/model-BaF65rnX.js.map +0 -1
- package/dist/chunks/portalHost-yTOVuCej.js.map +0 -1
- package/dist/chunks/prefField-BopW9bjx.js +0 -201
- package/dist/chunks/prefField-BopW9bjx.js.map +0 -1
- package/dist/chunks/segmentedControl.module-D6SzYJD7.js +0 -11
- package/dist/chunks/segmentedControl.module-D6SzYJD7.js.map +0 -1
- package/dist/chunks/useReorderDragList-FCMoFIzH.js +0 -131
- package/dist/chunks/useReorderDragList-FCMoFIzH.js.map +0 -1
- package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js +0 -65
- package/dist/chunks/useRovingTabIndex-Bp_hYm_h.js.map +0 -1
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { r as e } from "./portalHost-yTOVuCej.js";
|
|
2
|
-
import { n as t, r as n } from "./segmentTooltip-CStYHKzd.js";
|
|
3
|
-
import { n as r } from "./Field--onYxXTF.js";
|
|
4
|
-
import { pastDragThreshold as i } from "@weasel-js/core";
|
|
5
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
-
import { Children as s, isValidElement as c, useEffect as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
7
|
-
import { Button as p, FieldError as m, Header as h, Label as g, ListBox as _, ListBoxItem as v, ListBoxSection as y, Popover as b, Select as x, SelectValue as S, Text as C } from "react-aria-components";
|
|
8
|
-
var w = {
|
|
9
|
-
field: "_field_1dx3a_1",
|
|
10
|
-
row: "_row_1dx3a_11",
|
|
11
|
-
label: "_label_1dx3a_18",
|
|
12
|
-
fit: "_fit_1dx3a_19",
|
|
13
|
-
trigger: "_trigger_1dx3a_19",
|
|
14
|
-
below: "_below_1dx3a_21",
|
|
15
|
-
value: "_value_1dx3a_63",
|
|
16
|
-
bare: "_bare_1dx3a_95",
|
|
17
|
-
chevron: "_chevron_1dx3a_112",
|
|
18
|
-
underlined: "_underlined_1dx3a_124",
|
|
19
|
-
plain: "_plain_1dx3a_135",
|
|
20
|
-
popover: "_popover_1dx3a_148",
|
|
21
|
-
listbox: "_listbox_1dx3a_157",
|
|
22
|
-
option: "_option_1dx3a_170",
|
|
23
|
-
section: "_section_1dx3a_181",
|
|
24
|
-
sectionHeader: "_sectionHeader_1dx3a_188",
|
|
25
|
-
optionLabel: "_optionLabel_1dx3a_195",
|
|
26
|
-
check: "_check_1dx3a_222",
|
|
27
|
-
sizer: "_sizer_1dx3a_255"
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/components/Select/Select.tsx
|
|
31
|
-
function T(e) {
|
|
32
|
-
return "options" in e;
|
|
33
|
-
}
|
|
34
|
-
function E(i) {
|
|
35
|
-
let { label: s, orientation: c = "stacked", description: l, errorMessage: u, placeholder: h, options: v, children: y, selectedKey: E, defaultSelectedKey: D, onSelectionChange: k, width: A = "fill", variant: M = "field", indicator: I = M === "bare" ? "underline" : "chevron", popup: L = "over", triggerId: R, className: z, portalContainer: B, shortcut: V, tooltip: H, ...U } = i, { anchor: W, portalProps: G } = e(B), K = d(null), q = d(null), [J, Y] = f(O);
|
|
36
|
-
return /* @__PURE__ */ o(x, {
|
|
37
|
-
...U,
|
|
38
|
-
selectedKey: E,
|
|
39
|
-
defaultSelectedKey: D,
|
|
40
|
-
onSelectionChange: k ? (e) => k(e) : void 0,
|
|
41
|
-
className: [
|
|
42
|
-
w.field,
|
|
43
|
-
A === "fit" && w.fit,
|
|
44
|
-
M === "bare" && w.bare,
|
|
45
|
-
I === "underline" && w.underlined,
|
|
46
|
-
I === "none" && w.plain,
|
|
47
|
-
r.root,
|
|
48
|
-
c === "row" && r.row,
|
|
49
|
-
c === "row" && w.row,
|
|
50
|
-
z
|
|
51
|
-
].filter(Boolean).join(" "),
|
|
52
|
-
children: [
|
|
53
|
-
W,
|
|
54
|
-
s !== void 0 && /* @__PURE__ */ a(g, {
|
|
55
|
-
className: `${r.label} ${w.label}`,
|
|
56
|
-
children: s
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ a(t, {
|
|
59
|
-
content: n({
|
|
60
|
-
tooltip: H,
|
|
61
|
-
shortcut: V,
|
|
62
|
-
ariaLabel: U["aria-label"],
|
|
63
|
-
label: s
|
|
64
|
-
}),
|
|
65
|
-
disabled: U.isDisabled,
|
|
66
|
-
children: /* @__PURE__ */ o(p, {
|
|
67
|
-
id: R,
|
|
68
|
-
ref: K,
|
|
69
|
-
className: w.trigger,
|
|
70
|
-
onPointerDown: (e) => {
|
|
71
|
-
q.current = {
|
|
72
|
-
x: e.clientX,
|
|
73
|
-
y: e.clientY,
|
|
74
|
-
at: performance.now()
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ a(S, {
|
|
79
|
-
className: w.value,
|
|
80
|
-
children: ({ defaultChildren: e, isPlaceholder: t }) => t ? h ?? e : e
|
|
81
|
-
}),
|
|
82
|
-
A === "fit" && /* @__PURE__ */ o("span", {
|
|
83
|
-
className: w.sizer,
|
|
84
|
-
"aria-hidden": "true",
|
|
85
|
-
children: [h !== void 0 && /* @__PURE__ */ a("span", { children: h }), P(v, y).map((e, t) => /* @__PURE__ */ a("span", { children: e }, t))]
|
|
86
|
-
}),
|
|
87
|
-
I === "chevron" && /* @__PURE__ */ a("svg", {
|
|
88
|
-
className: w.chevron,
|
|
89
|
-
viewBox: "0 0 10 10",
|
|
90
|
-
"aria-hidden": "true",
|
|
91
|
-
children: /* @__PURE__ */ a("path", {
|
|
92
|
-
d: "M2 4 L5 7 L8 4",
|
|
93
|
-
fill: "none",
|
|
94
|
-
stroke: "currentColor",
|
|
95
|
-
strokeWidth: "1.5",
|
|
96
|
-
strokeLinecap: "round",
|
|
97
|
-
strokeLinejoin: "round"
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
]
|
|
101
|
-
})
|
|
102
|
-
}),
|
|
103
|
-
l !== void 0 && /* @__PURE__ */ a(C, {
|
|
104
|
-
slot: "description",
|
|
105
|
-
className: `${r.hint} ${w.below}`,
|
|
106
|
-
children: l
|
|
107
|
-
}),
|
|
108
|
-
/* @__PURE__ */ a(m, {
|
|
109
|
-
className: `${r.error} ${w.below}`,
|
|
110
|
-
children: u
|
|
111
|
-
}),
|
|
112
|
-
/* @__PURE__ */ o(b, {
|
|
113
|
-
className: w.popover,
|
|
114
|
-
"data-weasel-overlay": "",
|
|
115
|
-
placement: "bottom start",
|
|
116
|
-
offset: L === "over" ? J.offset : void 0,
|
|
117
|
-
crossOffset: L === "over" ? J.crossOffset : void 0,
|
|
118
|
-
shouldFlip: L !== "over",
|
|
119
|
-
...G,
|
|
120
|
-
children: [L === "over" && /* @__PURE__ */ a(j, {
|
|
121
|
-
triggerRef: K,
|
|
122
|
-
pressRef: q,
|
|
123
|
-
applied: J,
|
|
124
|
-
onMeasure: Y
|
|
125
|
-
}), /* @__PURE__ */ a(_, {
|
|
126
|
-
className: w.listbox,
|
|
127
|
-
children: v === void 0 ? y : v.map((e, t) => T(e) ? /* @__PURE__ */ a(F, {
|
|
128
|
-
title: e.title,
|
|
129
|
-
children: e.options.map(N)
|
|
130
|
-
}, `section-${t}`) : N(e))
|
|
131
|
-
})]
|
|
132
|
-
})
|
|
133
|
-
]
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
var D = 500, O = {
|
|
137
|
-
offset: 0,
|
|
138
|
-
crossOffset: 0
|
|
139
|
-
}, k = 12, A = {
|
|
140
|
-
offset: 8,
|
|
141
|
-
crossOffset: 0
|
|
142
|
-
};
|
|
143
|
-
function j({ triggerRef: e, pressRef: t, applied: n, onMeasure: r }) {
|
|
144
|
-
let o = d(null), s = d(0);
|
|
145
|
-
return u(() => {
|
|
146
|
-
let t = e.current, i = o.current?.closest("[data-weasel-overlay]");
|
|
147
|
-
if (!t || !i || s.current > 3) return;
|
|
148
|
-
let a = t.querySelector(`.${w.value}`), c = i.querySelector(`[data-selected] .${w.optionLabel}`);
|
|
149
|
-
if (!a || !c) {
|
|
150
|
-
(n.offset !== A.offset || n.crossOffset !== A.crossOffset) && r(A);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
let l = getComputedStyle(t).getPropertyValue("--wzl-select-align").trim(), u = l === "right" || l === "end";
|
|
154
|
-
i.dataset.align = u ? "end" : "start";
|
|
155
|
-
let d = i.getBoundingClientRect(), f = t.getBoundingClientRect(), p = c.getBoundingClientRect(), m = a.getBoundingClientRect(), h = m.top + m.height / 2 - f.top - (p.top + p.height / 2 - d.top) - f.height, g = t.ownerDocument.documentElement.clientHeight - k - d.height - f.bottom, _ = {
|
|
156
|
-
offset: Math.max(k - f.bottom, Math.min(h, g)),
|
|
157
|
-
crossOffset: u ? m.right - f.left - (p.right - d.left) : m.left - f.left - (p.left - d.left)
|
|
158
|
-
};
|
|
159
|
-
Math.abs(_.offset - n.offset) < .5 && Math.abs(_.crossOffset - n.crossOffset) < .5 || (s.current += 1, r(_));
|
|
160
|
-
}), l(() => {
|
|
161
|
-
let n = e.current?.ownerDocument;
|
|
162
|
-
if (!n) return;
|
|
163
|
-
let r = (e) => {
|
|
164
|
-
n.removeEventListener("pointerup", r, !0);
|
|
165
|
-
let a = t.current;
|
|
166
|
-
!a || performance.now() - a.at > D || i({
|
|
167
|
-
clientX: a.x,
|
|
168
|
-
clientY: a.y
|
|
169
|
-
}, e) || (e.preventDefault(), e.stopPropagation());
|
|
170
|
-
};
|
|
171
|
-
return n.addEventListener("pointerup", r, !0), () => n.removeEventListener("pointerup", r, !0);
|
|
172
|
-
}, [e, t]), /* @__PURE__ */ a("span", {
|
|
173
|
-
ref: o,
|
|
174
|
-
hidden: !0
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
function M() {
|
|
178
|
-
return /* @__PURE__ */ a("svg", {
|
|
179
|
-
className: w.check,
|
|
180
|
-
viewBox: "0 0 10 10",
|
|
181
|
-
"aria-hidden": "true",
|
|
182
|
-
children: /* @__PURE__ */ a("polyline", {
|
|
183
|
-
points: "1.5,5 4,7.5 8.5,3",
|
|
184
|
-
fill: "none",
|
|
185
|
-
stroke: "currentColor",
|
|
186
|
-
strokeWidth: "1.6",
|
|
187
|
-
strokeLinecap: "round",
|
|
188
|
-
strokeLinejoin: "round"
|
|
189
|
-
})
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
function N(e) {
|
|
193
|
-
return /* @__PURE__ */ a(L, {
|
|
194
|
-
id: e.value,
|
|
195
|
-
isDisabled: e.isDisabled,
|
|
196
|
-
textValue: e.textValue,
|
|
197
|
-
children: e.label
|
|
198
|
-
}, String(e.value));
|
|
199
|
-
}
|
|
200
|
-
function P(e, t) {
|
|
201
|
-
return e === void 0 ? s.toArray(t).flatMap((e) => c(e) ? e.type === F ? P(void 0, e.props.children) : [e.props.children] : [e]) : e.flatMap((e) => "options" in e ? e.options.map((e) => e.label) : [e.label]);
|
|
202
|
-
}
|
|
203
|
-
function F({ title: e, children: t, className: n }) {
|
|
204
|
-
return /* @__PURE__ */ o(y, {
|
|
205
|
-
className: [w.section, n].filter(Boolean).join(" "),
|
|
206
|
-
children: [e !== void 0 && /* @__PURE__ */ a(h, {
|
|
207
|
-
className: w.sectionHeader,
|
|
208
|
-
children: e
|
|
209
|
-
}), t]
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
function I(e, t) {
|
|
213
|
-
return t === void 0 ? typeof e == "string" || typeof e == "number" ? String(e) : void 0 : t;
|
|
214
|
-
}
|
|
215
|
-
function L({ children: e, className: t, textValue: n, ...r }) {
|
|
216
|
-
return /* @__PURE__ */ o(v, {
|
|
217
|
-
...r,
|
|
218
|
-
textValue: I(e, n),
|
|
219
|
-
className: [w.option, t].filter(Boolean).join(" "),
|
|
220
|
-
children: [/* @__PURE__ */ a(M, {}), /* @__PURE__ */ a("span", {
|
|
221
|
-
className: w.optionLabel,
|
|
222
|
-
children: e
|
|
223
|
-
})]
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
//#endregion
|
|
227
|
-
export { L as n, F as r, E as t };
|
|
228
|
-
|
|
229
|
-
//# sourceMappingURL=Select-ClmKtyWg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select-ClmKtyWg.js","names":["Select","RACSelect","s","RACButton","RACPopover","RACListBox","RACListBoxSection","RACListBoxItem","useOverlayPortal","TriggerTooltip","segmentTooltipContent","fieldClasses","Select_module_default","isGroup","entry","Select$1","variant","rest","props","portalContainer","triggerRef","useRef","pressRef","nudge","setNudge","useState","NO_NUDGE","Select","onSelectionChange","k","width","indicator","orientation","className","anchor","label","Label","Button","triggerId","SelectValue","isPlaceholder","placeholder","defaultChildren","optionLabels","options","children","l","i","description","Text","FieldError","errorMessage","Popover","popup","portalProps","AlignOverTrigger","ListBox","SelectSection","renderOption","CLICK_MS","EDGE","BELOW","markerRef","passes","useLayoutEffect","trigger","popover","value","applied","onMeasure","align","toEnd","box","seat","row","shown","over","lowest","next","useEffect","doc","onUp","press","pastDragThreshold","CheckMark","SelectItem","o","Children","isValidElement","c","g","ListBoxSection","title","Header","textValueOf","explicit","ListBoxItem","textValue"],"sources":["../../src/components/Select/Select.module.css","../../src/components/Select/Select.tsx"],"sourcesContent":[".field {\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 0;\n gap: var(--wzl-space-2);\n}\n\n/* `orientation='row'`: the label keeps its own width and the trigger takes the\n rest; description and error wrap onto a line of their own. */\n.field.row {\n flex-direction: row;\n align-items: center;\n flex-wrap: wrap;\n column-gap: var(--wzl-space-4);\n row-gap: var(--wzl-space-2);\n}\n.field.row .label { flex: 0 0 auto; }\n.field.row:not(.fit) .trigger { flex: 1 1 0; min-width: 0; }\n.field.row.fit .trigger { width: auto; }\n.field.row .below { flex-basis: 100%; }\n\n.trigger {\n display: flex;\n width: 100%;\n align-items: center;\n gap: var(--wzl-space-3);\n /* Hooks, each defaulting to what the trigger already drew: the visible box is\n this button, not the `.field` a consumer's `className` lands on, so a\n surface that has to restyle it sets these rather than reaching in here.\n Together they draw the bare look too, for a surface that wants it from\n context rather than from `variant`: a transparent fill, no padding, the\n chevron hidden, the value underlined and an outline for focus. */\n padding: var(--wzl-select-pad, 0 var(--wzl-space-3) 0 var(--wzl-space-5));\n background: var(--wzl-select-bg, var(--wzl-input-surface, var(--wzl-surface-sunken)));\n height: var(--wzl-select-h, var(--wzl-control-h));\n border: var(--wzl-select-border, 1px solid var(--wzl-border));\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-select-fg, var(--wzl-fg));\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size);\n line-height: 1;\n cursor: pointer;\n transition: border-color var(--wzl-motion-fast), box-shadow var(--wzl-motion-fast);\n}\n\n.trigger[data-focus-visible] {\n border-color: var(--wzl-select-focus-border, var(--wzl-focus-ring));\n box-shadow: var(--wzl-select-focus-shadow, 0 0 0 1px var(--wzl-focus-ring));\n outline: var(--wzl-select-focus-outline, none);\n outline-offset: 2px;\n}\n\n.field[data-invalid] .trigger {\n border-color: var(--wzl-danger);\n}\n\n.trigger[data-disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.value {\n flex: 1;\n min-width: 0;\n text-align: var(--wzl-select-align, left);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n /* The ellipsis needs `overflow: hidden`, which makes the line box a clip —\n the trigger's `line-height: 1` would cut this text's ascenders and\n descenders off. `normal` is the font's own leading, so it never can. */\n line-height: normal;\n /* The underline hook: none unless a surface or `indicator` turns it on. */\n text-decoration-line: var(--wzl-select-underline, none);\n text-decoration-style: dotted;\n text-decoration-thickness: 1px;\n text-decoration-color: var(--wzl-fg-subtle);\n text-underline-offset: 0.25em;\n transition: text-decoration-color var(--wzl-motion-fast);\n}\n\n.trigger:hover .value,\n.trigger[data-focus-visible] .value {\n text-decoration-style: solid;\n text-decoration-color: var(--wzl-fg-muted);\n}\n\n.field[data-open] .value {\n text-decoration-style: solid;\n text-decoration-color: var(--wzl-accent);\n}\n\n/* `variant='bare'`: no box. The focus ring moves to an outline, since there is no border to recolor. */\n.bare .trigger {\n padding: 0;\n background: transparent;\n border: var(--wzl-select-border, 1px solid transparent);\n}\n\n.bare .trigger[data-focus-visible] {\n border-color: transparent;\n box-shadow: none;\n outline: 1px solid var(--wzl-focus-ring);\n outline-offset: 2px;\n}\n\n.value[data-placeholder] {\n color: var(--wzl-fg-subtle);\n}\n\n.chevron {\n display: var(--wzl-select-chevron, block);\n width: 10px;\n height: 10px;\n color: var(--wzl-fg-muted);\n flex: 0 0 auto;\n}\n\n/* `indicator='underline'`: the value carries the affordance itself. A text\n decoration rather than a border, so it hugs the word and adds nothing to the\n box — the row's height and the value's width are the same either way. The\n rest of the underline's look sits on `.value`, shared with the hook. */\n.underlined .value {\n text-decoration-line: underline;\n}\n\n.value[data-placeholder] {\n text-decoration-color: var(--wzl-fg-subtle);\n}\n\n/* Nothing sits beside the value, so the row's gap and the padding kept for a\n caret are the value's to spend. */\n.underlined .trigger,\n.plain .trigger {\n gap: 0;\n}\n\n.bare.underlined .trigger,\n.bare.plain .trigger {\n padding: 0;\n}\n\n/* A list that hangs below its trigger takes the trigger's width, so the two\n read as one control. One that opens over it is already tied to the trigger\n by its selected row — widening it to match would only add blank rule beside\n the labels. `data-align` is set on exactly the ones that do. */\n.popover:not([data-align]) {\n min-width: var(--trigger-width);\n}\n\n.popover {\n max-height: inherit;\n outline: none;\n}\n\n.listbox {\n background: var(--wzl-surface-raised);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-md);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);\n padding: var(--wzl-space-2);\n max-height: 280px;\n overflow: auto;\n outline: none;\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size);\n}\n\n.option {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n padding: var(--wzl-space-2) var(--wzl-space-4);\n border-radius: var(--wzl-radius-sm);\n cursor: pointer;\n color: var(--wzl-fg);\n outline: none;\n}\n\n:is(.option, .section) + .section,\n.section + .option {\n margin-top: var(--wzl-space-2);\n padding-top: var(--wzl-space-2);\n border-top: 1px solid var(--wzl-line-subtle);\n}\n\n.sectionHeader {\n padding: var(--wzl-space-2) var(--wzl-space-4);\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-medium);\n color: var(--wzl-fg-subtle);\n}\n\n.optionLabel {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* A trigger that sets its value against its end edge gets a list that does the\n same, so the row that opened over the value stays on top of it. */\n.popover[data-align='end'] .option {\n justify-content: flex-end;\n}\n\n.option[data-focused] {\n background: var(--wzl-surface-hover);\n}\n\n.option[data-selected] {\n color: var(--wzl-fg);\n font-weight: var(--wzl-font-weight-medium);\n}\n\n.option[data-disabled] {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.check {\n width: 10px;\n height: 10px;\n flex: 0 0 auto;\n opacity: 0;\n}\n\n.option[data-selected] .check {\n opacity: 1;\n}\n\n.value .check {\n display: none;\n}\n\n/* `width='fit'`: a hidden stack of every option label shares the value's grid\n cell, so the trigger sizes to its widest option and never resizes on select. */\n.fit {\n width: auto;\n max-width: 100%;\n}\n\n.fit .trigger {\n display: grid;\n grid-template-columns: auto auto;\n}\n\n.fit.underlined .trigger,\n.fit.plain .trigger {\n grid-template-columns: auto;\n}\n\n.fit .value,\n.fit .sizer {\n grid-area: 1 / 1;\n}\n\n.fit .chevron {\n grid-area: 1 / 2;\n}\n\n.sizer {\n display: grid;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n white-space: nowrap;\n}\n\n.sizer > * {\n grid-area: 1 / 1;\n}\n","import {\n Children,\n isValidElement,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type ReactNode,\n type RefObject,\n} from 'react';\nimport {\n Select as RACSelect,\n Label,\n Button as RACButton,\n SelectValue,\n Popover as RACPopover,\n ListBox as RACListBox,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Header,\n Text,\n FieldError,\n type SelectProps as RACSelectProps,\n type ListBoxItemProps as RACListBoxItemProps,\n type ValidationResult,\n} from 'react-aria-components';\nimport { pastDragThreshold } from '@weasel-js/core';\nimport { fieldClasses, type FieldOrientation } from '../Field/Field';\nimport { useOverlayPortal, type OverlayPortalProps } from '../../overlays/portalHost';\nimport s from './Select.module.css';\nimport { TriggerTooltip, segmentTooltipContent, type SegmentTooltipFields } from '../segmentTooltip';\n\n/** One option in a {@link Select}'s `options` list. */\nexport type SelectOption = {\n value: string;\n label: ReactNode;\n isDisabled?: boolean;\n /**\n * Plain-text form of `label`, for type-to-select and screen readers.\n * Only needed when `label` isn't a bare string — a label built from\n * elements has no text React Aria can read off it. A string label\n * supplies this itself.\n */\n textValue?: string;\n};\n\n/** A titled group of options in a {@link Select}'s `options` list. */\nexport type SelectOptionGroup<T extends Key = string> = {\n title: ReactNode;\n options: ReadonlyArray<SelectOption & { value: T }>;\n};\n\ntype Key = string | number;\n\nfunction isGroup<T extends Key>(\n entry: (SelectOption & { value: T }) | SelectOptionGroup<T>,\n): entry is SelectOptionGroup<T> {\n return 'options' in entry;\n}\n\n/** How a {@link Select} trigger signals that it opens a list. */\nexport type SelectIndicator = 'chevron' | 'underline' | 'none';\n\n/** Where a {@link Select}'s list opens relative to its trigger. */\nexport type SelectPopup = 'over' | 'below';\n\n/**\n * Props for {@link Select}, on top of React Aria's `Select` props, with the\n * selection key narrowed to the option value type.\n */\nexport type SelectProps<T extends Key = string> = Omit<RACSelectProps<object>, 'children' | 'className' | 'selectedKey' | 'defaultSelectedKey' | 'onSelectionChange'> & {\n label?: ReactNode;\n /**\n * `'stacked'` (the default) puts the label above the trigger; `'row'` sets it\n * beside the trigger at its own width, with any description or error on a\n * line below. Same vocabulary as {@link Field}'s `orientation`.\n */\n orientation?: FieldOrientation;\n description?: ReactNode;\n errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);\n placeholder?: string;\n /**\n * Either pass `options` for a quick render, or `children` for full control.\n * An entry with `title` and `options` of its own is a titled section.\n */\n options?: ReadonlyArray<(SelectOption & { value: T }) | SelectOptionGroup<T>>;\n children?: ReactNode;\n selectedKey?: T | null;\n defaultSelectedKey?: T;\n onSelectionChange?: (key: T) => void;\n /**\n * `'fill'` (the default) takes the width of whatever row the select sits in.\n * `'fit'` sizes the trigger to its widest option, so it neither swallows a\n * toolbar's slack nor changes width as the selection moves.\n */\n width?: 'fill' | 'fit';\n /** `'bare'` drops the box, for a select set in a row of other chrome such as a property row. */\n variant?: 'field' | 'bare';\n /**\n * How the trigger says it opens a list. `'chevron'` draws the caret beside\n * the value; `'underline'` marks the value itself, dotted at rest and solid\n * while it is pointed at or open; `'none'` says nothing. Unset takes the\n * variant's own: a boxed select shows the caret, a bare one — set in a row\n * where 10px of caret is a tenth of the value's width — underlines.\n */\n indicator?: SelectIndicator;\n /**\n * Where the list opens. `'over'` (the default) puts the selected row on the\n * trigger, its label in the trigger's own text column, so choosing what is\n * already chosen moves nothing; `'below'` hangs it under the trigger.\n */\n popup?: SelectPopup;\n /**\n * Id for the trigger button. React Aria puts a plain `id` on the wrapper,\n * which is not labelable, so an outer `<label for>` needs this to reach a\n * control the label can actually own.\n */\n triggerId?: string;\n className?: string;\n} & SegmentTooltipFields & OverlayPortalProps;\n\n/**\n * Form select wrapping React Aria's Select. Pass either `options` for a\n * quick declarative render or `children` of `<SelectItem>` for control over\n * each row; `<SelectSection>` (or an `options` entry with a `title`) groups\n * rows under a heading.\n *\n * The selection key type is parameterized so consumers with a string-literal\n * union for `value` (e.g. `'r' | 'g' | 'b'`) get a typed `onSelectionChange`.\n *\n * `shortcut` puts a kit tooltip on the trigger reading `Name (⌘K)`, named by\n * `aria-label` or a string `label`, as `Button` does; `tooltip` replaces that\n * text.\n */\nexport function Select<T extends Key = string>(props: SelectProps<T>) {\n const {\n label,\n orientation = 'stacked',\n description,\n errorMessage,\n placeholder,\n options,\n children,\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n width = 'fill',\n variant = 'field',\n indicator = variant === 'bare' ? 'underline' : 'chevron',\n popup = 'over',\n triggerId,\n className,\n portalContainer,\n shortcut,\n tooltip,\n ...rest\n } = props;\n\n const { anchor, portalProps } = useOverlayPortal(portalContainer);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const pressRef = useRef<Press | null>(null);\n const [nudge, setNudge] = useState(NO_NUDGE);\n\n return (\n <RACSelect\n {...rest}\n selectedKey={selectedKey}\n defaultSelectedKey={defaultSelectedKey}\n onSelectionChange={onSelectionChange ? (k) => onSelectionChange(k as T) : undefined}\n className={[\n s.field,\n width === 'fit' && s.fit,\n variant === 'bare' && s.bare,\n indicator === 'underline' && s.underlined,\n indicator === 'none' && s.plain,\n fieldClasses.root,\n orientation === 'row' && fieldClasses.row,\n orientation === 'row' && s.row,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {anchor}\n {label !== undefined && <Label className={`${fieldClasses.label} ${s.label}`}>{label}</Label>}\n <TriggerTooltip\n content={segmentTooltipContent({ tooltip, shortcut, ariaLabel: rest['aria-label'], label })}\n disabled={rest.isDisabled}\n >\n <RACButton\n id={triggerId}\n ref={triggerRef}\n className={s.trigger}\n onPointerDown={(e) => {\n pressRef.current = { x: e.clientX, y: e.clientY, at: performance.now() };\n }}\n >\n <SelectValue className={s.value}>\n {({ defaultChildren, isPlaceholder }) =>\n isPlaceholder ? (placeholder ?? defaultChildren) : defaultChildren\n }\n </SelectValue>\n {width === 'fit' && (\n <span className={s.sizer} aria-hidden=\"true\">\n {placeholder !== undefined && <span>{placeholder}</span>}\n {optionLabels(options, children).map((l, i) => (\n <span key={i}>{l}</span>\n ))}\n </span>\n )}\n {indicator === 'chevron' && (\n <svg className={s.chevron} viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M2 4 L5 7 L8 4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )}\n </RACButton>\n </TriggerTooltip>\n {description !== undefined && (\n <Text slot=\"description\" className={`${fieldClasses.hint} ${s.below}`}>\n {description}\n </Text>\n )}\n <FieldError className={`${fieldClasses.error} ${s.below}`}>{errorMessage}</FieldError>\n {/* `data-weasel-overlay` marks DOM that belongs to this control but\n renders in a portal, outside the subtree the trigger sits in. Any\n consumer reasoning about \"did focus leave my component?\" via\n `closest()` gets the wrong answer without it — a text editor whose\n font menu lives here would end its session the moment the menu is\n clicked. */}\n <RACPopover\n className={s.popover}\n data-weasel-overlay=\"\"\n placement=\"bottom start\"\n offset={popup === 'over' ? nudge.offset : undefined}\n crossOffset={popup === 'over' ? nudge.crossOffset : undefined}\n shouldFlip={popup !== 'over'}\n {...portalProps}\n >\n {popup === 'over' && (\n <AlignOverTrigger\n triggerRef={triggerRef}\n pressRef={pressRef}\n applied={nudge}\n onMeasure={setNudge}\n />\n )}\n <RACListBox className={s.listbox}>\n {options !== undefined\n ? options.map((entry, i) =>\n isGroup(entry) ? (\n <SelectSection key={`section-${i}`} title={entry.title}>\n {entry.options.map(renderOption)}\n </SelectSection>\n ) : (\n renderOption(entry)\n ),\n )\n : children}\n </RACListBox>\n </RACPopover>\n </RACSelect>\n );\n}\n\ntype Nudge = { offset: number; crossOffset: number };\n\n/** Where and when the pointer went down on the trigger. */\ntype Press = { x: number; y: number; at: number };\n\n/** How long a press may last and how far it may travel and still be a click. */\nconst CLICK_MS = 500;\n\nconst NO_NUDGE: Nudge = { offset: 0, crossOffset: 0 };\n\n/** The gap kept between a list and the viewport edge — React Aria's own\n * `containerPadding` default. */\nconst EDGE = 12;\n\n/** React Aria's own resting place for a popover: hanging under its trigger. */\nconst BELOW: Nudge = { offset: 8, crossOffset: 0 };\n\n/**\n * Lands the list so its selected row covers the trigger: same text column,\n * same line. The shift is handed back as the popover's own `offset` and\n * `crossOffset` rather than a transform, so React Aria keeps owning the\n * position and still holds the list inside the viewport.\n *\n * Measuring needs the list rendered, and the correction is applied by setting\n * state from a layout effect — React finishes that pass before the browser\n * paints, so the list is never seen at the uncorrected position.\n */\nfunction AlignOverTrigger({\n triggerRef,\n pressRef,\n applied,\n onMeasure,\n}: {\n triggerRef: RefObject<HTMLButtonElement | null>;\n pressRef: RefObject<Press | null>;\n applied: Nudge;\n onMeasure: (next: Nudge) => void;\n}) {\n // React Aria positions the popover but hands out no ref to it, so the\n // element is reached from inside: this marker's own parent.\n const markerRef = useRef<HTMLSpanElement>(null);\n // A measurement that settles takes two passes — one to place the list, one\n // to confirm. A cap is what keeps a list whose own placement changes its\n // measurement from renegotiating forever.\n const passes = useRef(0);\n useLayoutEffect(() => {\n const trigger = triggerRef.current;\n const popover = markerRef.current?.closest<HTMLElement>('[data-weasel-overlay]');\n if (!trigger || !popover || passes.current > 3) return;\n const value = trigger.querySelector(`.${s.value}`);\n // Nothing chosen yet, so there is no row that belongs over the trigger —\n // and putting an arbitrary one under the pointer arms it. A select showing\n // its placeholder hangs its list below, like any other dropdown.\n const label = popover.querySelector(`[data-selected] .${s.optionLabel}`);\n if (!value || !label) {\n if (applied.offset !== BELOW.offset || applied.crossOffset !== BELOW.crossOffset)\n onMeasure(BELOW);\n return;\n }\n\n // The trigger's own text alignment decides which edge the two labels are\n // matched on, and the list follows it so the selected row reads as the\n // trigger with the others unfolded around it.\n const align = getComputedStyle(trigger).getPropertyValue('--wzl-select-align').trim();\n const toEnd = align === 'right' || align === 'end';\n popover.dataset.align = toEnd ? 'end' : 'start';\n\n // Stated against each element's own box rather than measured as a gap to\n // close: React Aria repositions after this effect, so what is on screen\n // now is a frame behind, and a correction read off it would be applied to\n // a position that has already moved — the shift compounds every pass.\n // `bottom start` puts the list's top at the trigger's bottom and their\n // left edges together, so the two insets below are the whole story.\n const box = popover.getBoundingClientRect();\n const seat = trigger.getBoundingClientRect();\n const row = label.getBoundingClientRect();\n const shown = value.getBoundingClientRect();\n // React Aria holds the list inside the viewport across the trigger but not\n // along it, and `offset` moves it along: the selected row sits on the\n // trigger only as far as the rest of the list still fits on screen.\n const over = shown.top + shown.height / 2 - seat.top - (row.top + row.height / 2 - box.top) - seat.height;\n const viewHeight = trigger.ownerDocument.documentElement.clientHeight;\n const lowest = viewHeight - EDGE - box.height - seat.bottom;\n const next = {\n offset: Math.max(EDGE - seat.bottom, Math.min(over, lowest)),\n crossOffset: toEnd\n ? shown.right - seat.left - (row.right - box.left)\n : shown.left - seat.left - (row.left - box.left),\n };\n if (Math.abs(next.offset - applied.offset) < 0.5 && Math.abs(next.crossOffset - applied.crossOffset) < 0.5)\n return;\n passes.current += 1;\n onMeasure(next);\n });\n\n // The list covers the trigger, so the release that ends the click opening it\n // lands on a row — and a row selects on release, which shuts the list again\n // before it has been seen. A click is a press and a release in the same\n // place: that one is the opening gesture and belongs to the trigger, and the\n // list keeps every release after it. Press, hold, drag and release still\n // picks a row, which is the gesture a list over its trigger is for.\n useEffect(() => {\n const doc = triggerRef.current?.ownerDocument;\n if (!doc) return;\n const onUp = (e: PointerEvent) => {\n doc.removeEventListener('pointerup', onUp, true);\n const press = pressRef.current;\n if (!press || performance.now() - press.at > CLICK_MS) return;\n if (pastDragThreshold({ clientX: press.x, clientY: press.y }, e)) return;\n e.preventDefault();\n e.stopPropagation();\n };\n doc.addEventListener('pointerup', onUp, true);\n return () => doc.removeEventListener('pointerup', onUp, true);\n }, [triggerRef, pressRef]);\n\n return <span ref={markerRef} hidden />;\n}\n\n/* `SelectValue` copies the selected row into the trigger, mark included; the\n trigger hides it, so the `width='fit'` sizer leaves it out. */\nfunction CheckMark() {\n return (\n <svg className={s.check} viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <polyline points=\"1.5,5 4,7.5 8.5,3\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\nfunction renderOption<T extends Key>(o: SelectOption & { value: T }) {\n return (\n <SelectItem key={String(o.value)} id={o.value} isDisabled={o.isDisabled} textValue={o.textValue}>\n {o.label}\n </SelectItem>\n );\n}\n\n/**\n * The labels a `width='fit'` trigger measures itself against. In the children\n * form the label sits one element deep, inside a `SelectItem`, or two inside a\n * `SelectSection`.\n */\nfunction optionLabels(\n options: ReadonlyArray<SelectOption | SelectOptionGroup<Key>> | undefined,\n children: ReactNode,\n): ReactNode[] {\n if (options !== undefined)\n return options.flatMap((o) => ('options' in o ? o.options.map((g) => g.label) : [o.label]));\n return Children.toArray(children).flatMap((c) => {\n if (!isValidElement<{ children?: ReactNode }>(c)) return [c];\n return c.type === SelectSection ? optionLabels(undefined, c.props.children) : [c.props.children];\n });\n}\n\n/** Props for {@link SelectSection}. */\nexport type SelectSectionProps = {\n /** Heading shown above the section's rows; it also names the group for\n * screen readers. */\n title?: ReactNode;\n children?: ReactNode;\n className?: string;\n};\n\n/** A titled group of `SelectItem` rows in a {@link Select}'s list. */\nexport function SelectSection({ title, children, className }: SelectSectionProps) {\n return (\n <RACListBoxSection className={[s.section, className].filter(Boolean).join(' ')}>\n {title !== undefined && <Header className={s.sectionHeader}>{title}</Header>}\n {children}\n </RACListBoxSection>\n );\n}\n\n/** Props for {@link SelectItem}, on top of React Aria's `ListBoxItem` props. */\nexport type SelectItemProps = Omit<RACListBoxItemProps, 'className' | 'children'> & {\n children?: ReactNode;\n className?: string;\n};\n\n/**\n * Every row renders a check mark beside its label, so from React Aria's\n * side the children are never plain text and it can't derive the string\n * type-to-select and screen readers need — it warns once per row. A string\n * label already *is* that string, so derive it rather than making every\n * call site restate it; anything richer has to say what it reads as.\n */\nfunction textValueOf(children: ReactNode, explicit: string | undefined): string | undefined {\n if (explicit !== undefined) return explicit;\n return typeof children === 'string' || typeof children === 'number'\n ? String(children)\n : undefined;\n}\n\n/**\n * One row in a {@link Select}'s list, with a leading check mark when\n * selected. A string child supplies its own `textValue`; anything richer must\n * pass one so type-to-select and screen readers have something to read.\n */\nexport function SelectItem({ children, className, textValue, ...rest }: SelectItemProps) {\n return (\n <RACListBoxItem\n {...rest}\n textValue={textValueOf(children, textValue)}\n className={[s.option, className].filter(Boolean).join(' ')}\n >\n <CheckMark />\n {/* A box around the label, not just text: landing the list over its\n trigger means measuring where this row's label sits. */}\n <span className={s.optionLabel}>{children}</span>\n </RACListBoxItem>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACsDA,SAASa,EACP,GAC+B;CAC/B,OAAO,aAAaC;AACtB;AA4EA,SAAgBd,EAA+B,GAAuB;CACpE,IAAM,EACJ,UACA,iBAAc,WACd,gBACA,iBACA,gBACA,YACA,aACA,gBACA,uBACA,sBACA,WA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byValue","stop","s","max","seen","a","b","attract","f","toFraction","best","bestGap","tolerance","gap","stepStops","direction","first","count","i","defaultStep","clampOrdered","index","thumbs","resolveBounds","thumb","fallbackMin","fallbackMax","tuple","ctx","fractionToPosition","READOUT","decimal","Slider","props","stopList","useMemo","even","strict","trackRef","useRef","railRef","dragBufferRef","sessionRef","valueToFraction","useCallback","gaps","x","fractionToValue","c","valueAt","q","trackWidth","beginThumbDrag","buf","seed","t","droppedOff","openPointerSession","origin","down","rail","buffer","rect","ev","bLo","bHi","constraint","bandHeight","onInput","next","onChange","beginShiftAllDrag","startValues","dxFraction","anchorX","starts","df","dValue","allowedNeg","allowedPos","onThumbPointerDown","e","onThumbContextMenu","onTrackPointerDown","wantsMove","track","created","moved","onThumbKeyDown","stepSize","delta","stopDelta","snapTo","placement","renderReadout","display","slim","density","rootVars","trackHeight","labelMode","lastStop","labeledStops","stopLabelRow","rootClass","className","isNotched","customRender","cls","qty","ariaLabel"],"sources":["../../src/components/Slider/Slider.module.css","../../src/components/Slider/Slider.tsx"],"sourcesContent":[".root {\n /* The value span stops this far short of each end of the track. Half a\n * thumb puts an end thumb flush with the edge; `fractionToPosition` in\n * Slider.tsx is the same geometry for painters. */\n --rp-thumb-inset: calc(var(--rp-thumb-size, 14px) / 2);\n position: relative;\n user-select: none;\n -webkit-user-select: none;\n touch-action: none;\n}\n\n.row {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-4);\n}\n\n.track {\n position: relative;\n flex: 1;\n min-width: 0;\n height: var(--rp-track-height, 24px);\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n cursor: var(--rp-track-cursor, crosshair);\n /* No `overflow: hidden` here — thumbs at extreme values would get\n * clipped at the track edges. The gradient/track-paint clip is\n * applied to `.trackInner` instead, which lets thumbs spill freely. */\n}\n\n.overhang {\n --rp-thumb-inset: 0px;\n}\n\n.rail {\n position: absolute;\n inset: 0 var(--rp-thumb-inset);\n}\n\n.trackInner {\n position: absolute;\n inset: 0;\n border-radius: var(--wzl-radius-sm);\n overflow: hidden;\n}\n\n.thumb {\n position: absolute;\n /* Thumb extends 2px above + below the track for grabbability + visual\n * weight. Track itself stays its natural height; the thumb just spills. */\n top: -2px;\n bottom: -2px;\n width: var(--rp-thumb-size, 14px);\n margin-left: calc(var(--rp-thumb-size, 14px) / -2);\n display: flex;\n align-items: center;\n justify-content: center;\n background: color-mix(in srgb, var(--wzl-fg-muted) 70%, transparent);\n border: 1px solid var(--wzl-border-strong);\n border-radius: var(--wzl-radius-sm);\n cursor: ew-resize;\n /* Frosted-glass over the (often colorful) track. Cheap on modern GPUs;\n * gracefully degrades to just the partial-alpha background on engines\n * without backdrop-filter support. */\n backdrop-filter: blur(3px);\n -webkit-backdrop-filter: blur(3px);\n /* Subtle raise — sells the \"thumb is on top of the track\" hierarchy. */\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n font: var(--wzl-font-weight-medium) var(--wzl-font-size-xs)/var(--wzl-leading-tight) var(--wzl-font-ui);\n font-variant-numeric: tabular-nums;\n color: var(--wzl-fg-inverse);\n /* White halo so labels stay legible over wildly varying gradient\n * backgrounds (e.g. labels 'T' / 'P' / 'B' over teal, hue 200° over\n * yellow-green, etc.). */\n text-shadow: 0 0 2px rgba(255, 255, 255, 0.7);\n}\n\n/* A slim slider's thumb is round and flush with the track, matching the\n property rows. The default thumb keeps its 2px spill and rounded-rect face. */\n.slim .thumb {\n top: 50%;\n bottom: auto;\n height: var(--rp-thumb-size);\n transform: translateY(-50%);\n border-radius: 50%;\n border: none;\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n box-shadow: none;\n background: color-mix(in srgb, var(--wzl-accent) var(--wzl-slider-thumb-mix), transparent);\n}\n\n.thumb:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: 1px;\n}\n\n.thumbActive {\n /* Visual marker for the dragging/focused thumb; subclass-overridable. */\n z-index: 1;\n}\n\n/* The row holds absolutely-positioned labels, so it has to state its own\n height: the text's, not the thumb's. It said 14px — the default thumb's\n size — which left 4px of dead space under the labels at either density. */\n.readoutsBelow {\n position: relative;\n margin-inline: var(--rp-thumb-inset);\n height: calc(var(--wzl-font-size-xs) * var(--wzl-leading-tight));\n margin-top: var(--wzl-space-2);\n}\n\n.readoutBelow {\n position: absolute;\n transform: translateX(-50%);\n font: var(--wzl-font-weight-medium) var(--wzl-font-size-xs)/var(--wzl-leading-tight) var(--wzl-font-mono);\n color: var(--wzl-fg-muted);\n white-space: nowrap;\n}\n\n.readoutInline {\n display: inline-block;\n margin-left: var(--wzl-space-4);\n font: var(--wzl-font-weight-medium) var(--wzl-font-size-sm)/var(--wzl-leading-tight) var(--wzl-font-mono);\n color: var(--wzl-fg-muted);\n vertical-align: middle;\n}\n\n.notched {\n background: var(--thumb-svg, none);\n background-size: 100% 100%;\n background-repeat: no-repeat;\n background-color: transparent;\n border: none;\n /* Notched thumbs need to disable the .thumb defaults that paint to\n * the bounding box: backdrop-filter and box-shadow both ignore the\n * SVG's polygon/notch and would render through the notch cutout.\n * Use filter: drop-shadow instead — it traces the actual rendered\n * alpha (i.e. the polygon shape including the cut). */\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n box-shadow: none;\n filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));\n /* Default notched SVG (down-pointing pentagon, matches the perceptual-color experiment). */\n --thumb-svg: url(\"data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 30' preserveAspectRatio='none'%3E%3Cpolygon points='0,0 2.52,0 7,10.3 11.48,0 14,0 14,30 0,30' fill='rgba(255,255,255,0.62)' stroke='rgba(0,0,0,0.55)' stroke-width='0.75' stroke-linejoin='miter'/%3E%3C/svg%3E\");\n}\n\n.ticks {\n position: absolute;\n inset: 0;\n /* A mark must never eat the track click that adds a thumb, nor the\n * pointerdown that starts a drag through it. */\n pointer-events: none;\n}\n\n.tick {\n position: absolute;\n top: var(--rp-tick-inset, 20%);\n bottom: var(--rp-tick-inset, 20%);\n width: var(--rp-tick-width, 1px);\n margin-left: calc(var(--rp-tick-width, 1px) / -2);\n border-radius: var(--wzl-radius-pill);\n background: var(--rp-tick-color, var(--wzl-border-strong));\n}\n\n/* The labels hang below the track out of flow, so the row reserves their\n * height and anything after it — the below-thumb readouts — clears them.\n * Padding, not margin: a margin would collapse into whatever follows. */\n.withStopLabels .row {\n padding-bottom: calc(var(--wzl-space-xs) + var(--wzl-font-size-xs) * var(--wzl-leading-tight));\n}\n\n.stopLabels {\n position: absolute;\n left: 0;\n right: 0;\n top: calc(100% + var(--wzl-space-xs));\n height: calc(var(--wzl-font-size-xs) * var(--wzl-leading-tight));\n pointer-events: none;\n}\n\n.stopLabel {\n position: absolute;\n transform: translateX(-50%);\n white-space: nowrap;\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size-xs);\n line-height: var(--wzl-leading-tight);\n font-variant-numeric: tabular-nums;\n color: var(--wzl-fg-subtle);\n}\n\n/* The end labels are pinned inside the track rather than centered on it, so a\n * wide one can't spill past the control and misalign whatever sits beside it. */\n.stopLabel[data-edge=\"start\"] {\n transform: none;\n}\n\n.stopLabel[data-edge=\"end\"] {\n transform: translateX(-100%);\n}\n\n.stopLabel[data-selected] {\n color: var(--wzl-fg);\n font-weight: var(--wzl-font-weight-medium);\n}\n","import { useCallback, useEffect, useMemo, useRef, type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type ReactElement, type ReactNode } from 'react';\nimport { openPointerSession, type PointerSession } from '@weasel-js/core';\nimport s from './Slider.module.css';\nimport { decimal, qty, type Display } from '@weasel-js/quantity';\n\n/**\n * Passed to a custom thumb renderer: the thumb box in CSS px, and whether\n * this thumb is the one being dragged.\n */\nexport type ThumbRenderCtx = {\n width: number;\n height: number;\n isActive: boolean;\n};\n\n/**\n * A thumb's appearance — one of the two built-in shapes, or a custom\n * renderer.\n */\nexport type ThumbShape =\n | 'round'\n | 'notched'\n | { render: (ctx: ThumbRenderCtx) => ReactNode };\n\n/**\n * One handle on a {@link Slider}. `bounds` narrows the range this particular\n * thumb may move within, either fixed or computed from the current thumb\n * list.\n */\nexport type Thumb = {\n value: number;\n label?: string;\n shape?: ThumbShape;\n bounds?: [number, number] | ((ctx: BoundsCtx) => [number, number]);\n /**\n * Spoken form of `value`, published as `aria-valuetext`. Required by ARIA\n * whenever `value` is not the quantity the user is choosing — an index into\n * a value list, a log-scaled position — since `aria-valuenow` alone then\n * announces a number that means nothing.\n */\n valueText?: string;\n};\n\n/**\n * Passed to a thumb's `bounds` function: the full thumb list and this thumb's\n * index in it, so a bound can be expressed relative to its neighbors.\n */\nexport type BoundsCtx = {\n thumbs: readonly Thumb[];\n index: number;\n};\n\n/**\n * Passed to `renderTrack`: the track's width in CSS px, a mapping from a\n * slider value to its 0..1 position along the value span, and the CSS\n * position (a `calc()` against the painted box's width) of a 0..1 fraction of\n * that span. A painter places everything that must line up with the thumbs\n * through `fractionToPosition`: under `thumbFit: 'inside'` the span stops half\n * a thumb short of each end of the track.\n */\nexport type TrackCtx = {\n trackWidth: number;\n valueToFraction: (v: number) => number;\n fractionToPosition: (f: number) => string;\n};\n\n/** A {@link Slider} stop that carries a label, drawn under the track at the stop. */\nexport type SliderStop = {\n value: number;\n label?: ReactNode;\n};\n\n/**\n * Props for {@link Slider}.\n *\n * `onInput` fires continuously through a drag; `onChange` fires once when it\n * ends and is the one to write to history.\n *\n * `stops` are attractors: a drag that passes within a few pixels of one lands\n * on it, and the arrow keys move stop to stop. `step` still quantizes the\n * values between them. Each one is drawn on the track as a mark; pass\n * `showStops: false` for a track whose own paint already reads as the stops.\n * A stop given as a {@link SliderStop} with a `label` gets that label drawn\n * under it; `stopLabels` narrows the row to the two ends or turns it off.\n *\n * `snap: 'strict'` makes every stop a detent the thumb must rest on: drags and\n * track presses land on the nearest one, and `step` no longer applies.\n * `spacing: 'even'` places the stops at equal intervals, runs the track from\n * the first stop to the last, and maps values linearly within each gap — so a\n * geometric list (0.25/0.5/1/2/4) gets usable room for every stop instead of\n * four crowded into the first fifth. Both need stops; with fewer than two,\n * `'even'` falls back to linear.\n *\n * `trackClick: 'move-nearest'` makes a press on bare track send the closest\n * thumb there, focus it, and continue as a drag. It is the default for a\n * single thumb. With several it defaults to `'none'`, because on a\n * multi-thumb editor a stray click would yank a stop the user was not aiming\n * at; `onAddThumb`, where it is set, keeps the track press.\n *\n * `constraint: 'ordered'` keeps thumbs from crossing each other. Supplying\n * `onAddThumb` makes a click on empty track create a thumb, and supplying\n * `onRemoveThumb` lets a right-click or a drag off the track remove one —\n * both callbacks can decline by returning `null`/`false`. `allowShiftAll`\n * makes shift-drag translate every thumb together.\n *\n * `thumbFit: 'inside'`, the default, runs the value span half a thumb short of\n * each end of the track, so a thumb at `min` or `max` sits flush with the\n * track's edge instead of hanging half over it — the layout a native range\n * input has. `'overhang'` runs the span edge to edge and centers an end thumb\n * on the edge.\n */\nexport type SliderProps<T extends Thumb = Thumb> = {\n thumbs: readonly T[];\n onInput: (next: T[]) => void;\n onChange?: (next: T[]) => void;\n min: number;\n max: number;\n step?: number;\n stops?: readonly (number | SliderStop)[];\n showStops?: boolean;\n stopLabels?: 'all' | 'ends' | 'none';\n snap?: 'magnetic' | 'strict';\n spacing?: 'linear' | 'even';\n trackClick?: 'none' | 'move-nearest';\n constraint?: 'free' | 'ordered';\n onAddThumb?: (atValue: number) => T | null;\n onRemoveThumb?: (index: number) => boolean;\n allowShiftAll?: boolean;\n renderTrack?: (ctx: TrackCtx) => ReactNode;\n thumbFit?: 'inside' | 'overhang';\n trackHeight?: number;\n /** `'slim'` drives the track and thumb from the kit's slider tokens, so a\n * Slider matches the property rows. `trackHeight` still wins if given. */\n density?: 'default' | 'slim';\n renderReadout?: (thumb: T, index: number) => ReactNode;\n /** How a thumb's value shows in the default readout and is spoken as its\n * `aria-valuetext` when the thumb gives no `valueText` of its own. Default:\n * three decimals shown, nothing spoken beyond `aria-valuenow`. */\n display?: Display;\n readoutPlacement?: 'none' | 'inline-after' | 'below-thumb';\n ariaLabel?: string;\n className?: string;\n};\n\nfunction quantize(v: number, step: number | undefined, min: number): number {\n if (step === undefined || step <= 0) return v;\n return Math.round((v - min) / step) * step + min;\n}\n\nfunction clamp(v: number, lo: number, hi: number): number {\n return Math.max(lo, Math.min(hi, v));\n}\n\n/** How close a drag has to come to a stop, in track pixels, to land on it. */\nconst STOP_SNAP_PX = 8;\n\n/** A custom `ThumbShape.render` may put interactive content inside the thumb,\n * and capture would retarget pointerup and kill the click on it. */\nconst NO_CAPTURE = { capture: false } as const;\n\n/** The stops that are actually reachable: inside the range, deduped, ascending.\n * A duplicate keeps the first label given for its value. */\nfunction usableStops(stops: SliderProps['stops'], min: number, max: number): SliderStop[] {\n if (!stops || stops.length === 0) return [];\n const byValue = new Map<number, SliderStop>();\n for (const stop of stops) {\n const s = typeof stop === 'number' ? { value: stop } : stop;\n if (s.value < min || s.value > max) continue;\n const seen = byValue.get(s.value);\n if (!seen || (seen.label === undefined && s.label !== undefined)) byValue.set(s.value, s);\n }\n return [...byValue.values()].sort((a, b) => a.value - b.value);\n}\n\n/** The stop nearest `v` along the track, or `v` itself when none lies within\n * `tolerance` (a track fraction). Measured on the track rather than in value\n * units so evenly spaced stops attract over the same distance. */\nfunction attract(v: number, stops: number[], tolerance: number, toFraction: (v: number) => number): number {\n const f = toFraction(v);\n let best = v;\n let bestGap = tolerance;\n for (const stop of stops) {\n const gap = Math.abs(toFraction(stop) - f);\n if (gap <= bestGap) {\n best = stop;\n bestGap = gap;\n }\n }\n return best;\n}\n\n/** The stop `count` places past `v` in `direction`, saturating at either end. */\nfunction stepStops(stops: number[], v: number, direction: 1 | -1, count: number): number {\n if (direction > 0) {\n const first = stops.findIndex(stop => stop > v);\n if (first === -1) return stops[stops.length - 1];\n return stops[Math.min(stops.length - 1, first + count - 1)];\n }\n let first = -1;\n for (let i = stops.length - 1; i >= 0; i--) {\n if (stops[i] < v) {\n first = i;\n break;\n }\n }\n if (first === -1) return stops[0];\n return stops[Math.max(0, first - (count - 1))];\n}\n\nfunction defaultStep(step: number | undefined, min: number, max: number): number {\n if (step !== undefined && step > 0) return step;\n return (max - min) / 100;\n}\n\n/** Keep a thumb inside its neighbors when `constraint` is `'ordered'`. */\nfunction clampOrdered(\n v: number,\n thumbs: readonly Thumb[],\n index: number,\n min: number,\n max: number,\n step: number | undefined,\n): number {\n const gap = step !== undefined && step > 0 ? step : (max - min) / 1000;\n const lower = index > 0 ? thumbs[index - 1].value + gap : min;\n const upper = index < thumbs.length - 1 ? thumbs[index + 1].value - gap : max;\n return clamp(v, lower, upper);\n}\n\nfunction resolveBounds(thumb: Thumb, ctx: BoundsCtx, fallbackMin: number, fallbackMax: number): [number, number] {\n if (!thumb.bounds) return [fallbackMin, fallbackMax];\n const tuple = typeof thumb.bounds === 'function' ? thumb.bounds(ctx) : thumb.bounds;\n return [tuple[0], tuple[1]];\n}\n\n/** Where fraction `f` of the value span falls in a box as wide as the track.\n * The rail element is laid out from the same `--rp-thumb-inset`. */\nfunction fractionToPosition(f: number): string {\n return `calc(var(--rp-thumb-inset) + ${f} * (100% - 2 * var(--rp-thumb-inset)))`;\n}\n\nconst READOUT = decimal({ places: 3 });\n\n/**\n * Multi-thumb slider over a shared track. The thumb list is fully controlled:\n * every change, live or committed, arrives as a whole new array.\n *\n * Thumbs are draggable, and arrow/Home/End move the focused thumb — those\n * keystrokes fire `onInput` and `onChange` together, since there is no\n * in-flight state to buffer.\n */\nexport function Slider<T extends Thumb = Thumb>(props: SliderProps<T>): ReactElement {\n const { thumbs, onInput, onChange, step, constraint, trackHeight, density, ariaLabel, className } = props;\n\n const stopList = useMemo(() => usableStops(props.stops, props.min, props.max), [props.stops, props.min, props.max]);\n const stops = useMemo(() => stopList.map(stop => stop.value), [stopList]);\n const even = props.spacing === 'even' && stops.length >= 2;\n const strict = props.snap === 'strict' && stops.length > 0;\n const min = even ? stops[0] : props.min;\n const max = even ? stops[stops.length - 1] : props.max;\n\n const trackRef = useRef<HTMLDivElement | null>(null);\n // The value span. Every pointer is measured against it, and thumbs, ticks\n // and stop labels are laid out inside it, so they agree by construction.\n const railRef = useRef<HTMLDivElement | null>(null);\n // In-flight thumb buffer during a drag; null when not dragging.\n const dragBufferRef = useRef<T[] | null>(null);\n const sessionRef = useRef<PointerSession | null>(null);\n\n useEffect(() => () => { sessionRef.current?.cancel(); }, []);\n\n const valueToFraction = useCallback(\n (v: number): number => {\n if (max === min) return 0;\n if (!even) return clamp((v - min) / (max - min), 0, 1);\n const gaps = stops.length - 1;\n const x = clamp(v, min, max);\n let i = 0;\n while (i < gaps - 1 && x > stops[i + 1]) i++;\n return (i + (x - stops[i]) / (stops[i + 1] - stops[i])) / gaps;\n },\n [min, max, even, stops],\n );\n\n const fractionToValue = useCallback(\n (f: number): number => {\n const c = clamp(f, 0, 1);\n if (!even) return min + c * (max - min);\n const gaps = stops.length - 1;\n const i = Math.min(gaps - 1, Math.floor(c * gaps));\n return stops[i] + (c * gaps - i) * (stops[i + 1] - stops[i]);\n },\n [min, max, even, stops],\n );\n\n /** The value a pointer at track fraction `f` chooses, before bounds. */\n const valueAt = useCallback(\n (f: number, trackWidth: number): number => {\n const v = fractionToValue(f);\n if (strict) return attract(v, stops, Infinity, valueToFraction);\n const q = clamp(quantize(v, step, min), min, max);\n return stops.length > 0 ? attract(q, stops, STOP_SNAP_PX / trackWidth, valueToFraction) : q;\n },\n [fractionToValue, valueToFraction, strict, stops, step, min, max],\n );\n\n // `seed` replaces the thumb list the drag starts from. A track press moves a\n // thumb before the drag begins, and without seeding, a release with no\n // movement would commit the stale buffer and undo that move.\n const beginThumbDrag = useCallback(\n (origin: Element, down: ReactPointerEvent, index: number, seed?: readonly T[]) => {\n sessionRef.current?.cancel();\n const buf: T[] = (seed ?? thumbs).map(t => ({ ...t }));\n dragBufferRef.current = buf;\n let droppedOff = false;\n\n const onMove = (ev: PointerEvent) => {\n const rail = railRef.current;\n const buffer = dragBufferRef.current;\n if (!rail || !buffer) return;\n const rect = rail.getBoundingClientRect();\n let v = valueAt((ev.clientX - rect.left) / rect.width, rect.width);\n\n const [bLo, bHi] = resolveBounds(buffer[index], { thumbs: buffer, index }, min, max);\n v = clamp(v, bLo, bHi);\n\n if (constraint === 'ordered') v = clampOrdered(v, buffer, index, min, max, step);\n\n // Drop-off detection: pointer exits the track vertically by more than trackHeight.\n const bandHeight = rect.height;\n if (props.onRemoveThumb) {\n if (ev.clientY < rect.top - bandHeight || ev.clientY > rect.bottom + bandHeight) {\n droppedOff = true;\n } else {\n droppedOff = false;\n }\n }\n\n buffer[index] = { ...buffer[index], value: v };\n onInput(buffer.map(t => ({ ...t })));\n };\n\n // A drag that ends without a release — cancelled pointer, lost capture,\n // an unmount — drops the buffer without committing.\n const onCancel = () => {\n sessionRef.current = null;\n dragBufferRef.current = null;\n };\n\n const onEnd = () => {\n sessionRef.current = null;\n const buffer = dragBufferRef.current;\n dragBufferRef.current = null;\n if (!buffer) return;\n\n if (droppedOff && props.onRemoveThumb) {\n const accepted = props.onRemoveThumb(index);\n if (accepted) {\n const next = buffer.filter((_, i) => i !== index).map(t => ({ ...t })) as T[];\n onInput(next);\n onChange?.(next);\n return;\n }\n }\n\n onChange?.(buffer.map(t => ({ ...t })));\n };\n\n sessionRef.current = openPointerSession(origin, down, { onMove, onEnd, onCancel }, NO_CAPTURE);\n },\n [thumbs, onInput, onChange, valueAt, min, max, step, constraint, props],\n );\n\n const beginShiftAllDrag = useCallback(\n (origin: Element, down: ReactPointerEvent, anchorX: number) => {\n sessionRef.current?.cancel();\n const buf: T[] = thumbs.map(t => ({ ...t }));\n const startValues = buf.map(t => t.value);\n dragBufferRef.current = buf;\n\n const onMove = (ev: PointerEvent) => {\n const rail = railRef.current;\n const buffer = dragBufferRef.current;\n if (!rail || !buffer) return;\n const rect = rail.getBoundingClientRect();\n const dxFraction = (ev.clientX - anchorX) / rect.width;\n // Evenly spaced gaps span different amounts of value, so equal value\n // offsets would pull the thumbs apart; move them by track distance.\n if (even) {\n const starts = startValues.map(valueToFraction);\n const df = clamp(dxFraction, -Math.min(...starts), 1 - Math.max(...starts));\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = { ...buffer[i], value: fractionToValue(starts[i] + df) };\n }\n onInput(buffer.map(t => ({ ...t })));\n return;\n }\n let dValue = dxFraction * (max - min);\n dValue = quantize(dValue, step, 0);\n\n // Clamp delta so no thumb leaves [min, max] (per-thumb bounds intentionally\n // not enforced — matches the experiment's hue-band shift-translate semantics).\n let allowedNeg = -Infinity;\n let allowedPos = Infinity;\n for (let i = 0; i < startValues.length; i++) {\n allowedNeg = Math.max(allowedNeg, min - startValues[i]);\n allowedPos = Math.min(allowedPos, max - startValues[i]);\n }\n dValue = clamp(dValue, allowedNeg, allowedPos);\n\n for (let i = 0; i < buffer.length; i++) {\n buffer[i] = { ...buffer[i], value: clamp(startValues[i] + dValue, min, max) };\n }\n onInput(buffer.map(t => ({ ...t })));\n };\n\n const onCancel = () => {\n sessionRef.current = null;\n dragBufferRef.current = null;\n };\n\n const onEnd = () => {\n sessionRef.current = null;\n const buffer = dragBufferRef.current;\n dragBufferRef.current = null;\n if (buffer) onChange?.(buffer.map(t => ({ ...t })));\n };\n\n sessionRef.current = openPointerSession(origin, down, { onMove, onEnd, onCancel }, NO_CAPTURE);\n },\n [thumbs, onInput, onChange, min, max, step, even, valueToFraction, fractionToValue],\n );\n\n const onThumbPointerDown = (index: number) => (e: ReactPointerEvent) => {\n // Only bail on explicit non-primary buttons (button > 0). jsdom's PointerEvent\n // leaves `button` undefined; treat that as primary so tests can drive drags.\n if (typeof e.button === 'number' && e.button > 0) return;\n // preventDefault below suppresses the focus the press would otherwise\n // give the thumb, and the arrow keys are on the thumb.\n (e.currentTarget as HTMLElement).focus?.();\n e.preventDefault();\n e.stopPropagation();\n const origin = e.currentTarget as HTMLElement;\n if (e.shiftKey && props.allowShiftAll) {\n beginShiftAllDrag(origin, e, e.clientX);\n } else {\n beginThumbDrag(origin, e, index);\n }\n };\n\n const onThumbContextMenu = (index: number) => (e: ReactMouseEvent) => {\n if (!props.onRemoveThumb) return;\n e.preventDefault();\n const accepted = props.onRemoveThumb(index);\n if (!accepted) return;\n const next = thumbs.filter((_, i) => i !== index).map(t => ({ ...t })) as T[];\n onInput(next);\n onChange?.(next);\n };\n\n const onTrackPointerDown = (e: ReactPointerEvent<HTMLDivElement>) => {\n if (typeof e.button === 'number' && e.button > 0) return;\n const trackClick = props.trackClick ?? (thumbs.length === 1 ? 'move-nearest' : 'none');\n const wantsMove = trackClick === 'move-nearest' && thumbs.length > 0;\n if (!props.onAddThumb && !wantsMove) return;\n // If the event originated on a thumb, the thumb's own handler ran first; this is a track click.\n if ((e.target as HTMLElement).closest(`.${s.thumb}`)) return;\n e.preventDefault();\n const track = trackRef.current;\n const rail = railRef.current;\n if (!track || !rail) return;\n const rect = rail.getBoundingClientRect();\n const v = valueAt((e.clientX - rect.left) / rect.width, rect.width);\n\n if (props.onAddThumb) {\n const created = props.onAddThumb(v);\n if (!created) return;\n const next = [...thumbs.map(t => ({ ...t })), created] as T[];\n onInput(next);\n onChange?.(next);\n return;\n }\n\n let index = 0;\n for (let i = 1; i < thumbs.length; i++) {\n if (Math.abs(thumbs[i].value - v) < Math.abs(thumbs[index].value - v)) index = i;\n }\n const next = thumbs.map(t => ({ ...t })) as T[];\n const [bLo, bHi] = resolveBounds(next[index], { thumbs: next, index }, min, max);\n let moved = clamp(v, bLo, bHi);\n if (constraint === 'ordered') moved = clampOrdered(moved, next, index, min, max, step);\n next[index] = { ...next[index], value: moved };\n onInput(next);\n // preventDefault above suppresses the focus the press would give; the arrow keys are on the thumb.\n track.querySelectorAll<HTMLElement>(`.${s.thumb}`)[index]?.focus();\n beginThumbDrag(track, e, index, next);\n };\n\n const onThumbKeyDown = (index: number) => (e: ReactKeyboardEvent) => {\n const stepSize = defaultStep(step, min, max);\n let delta = 0;\n // With stops, a keystroke moves by whole stops rather than by value.\n let stopDelta = 0;\n let snapTo: 'home' | 'end' | null = null;\n\n switch (e.key) {\n case 'ArrowRight':\n case 'ArrowUp':\n delta = e.shiftKey ? stepSize * 10 : stepSize;\n stopDelta = e.shiftKey ? 10 : 1;\n break;\n case 'ArrowLeft':\n case 'ArrowDown':\n delta = e.shiftKey ? -stepSize * 10 : -stepSize;\n stopDelta = e.shiftKey ? -10 : -1;\n break;\n case 'PageUp':\n delta = stepSize * 10;\n stopDelta = 10;\n break;\n case 'PageDown':\n delta = -stepSize * 10;\n stopDelta = -10;\n break;\n case 'Home':\n snapTo = 'home';\n break;\n case 'End':\n snapTo = 'end';\n break;\n default:\n return;\n }\n\n e.preventDefault();\n const next = thumbs.map(t => ({ ...t }));\n const [bLo, bHi] = resolveBounds(next[index], { thumbs: next, index }, min, max);\n const lo = Math.max(min, bLo);\n const hi = Math.min(max, bHi);\n let v: number;\n if (snapTo === 'home') v = lo;\n else if (snapTo === 'end') v = hi;\n else if (stops.length > 0) {\n v = stepStops(stops, next[index].value, stopDelta > 0 ? 1 : -1, Math.abs(stopDelta));\n } else {\n v = quantize(next[index].value + delta, step, min);\n }\n v = clamp(v, lo, hi);\n if (constraint === 'ordered') v = clampOrdered(v, next, index, lo, hi, step);\n next[index] = { ...next[index], value: v };\n onInput(next);\n onChange?.(next);\n };\n\n const placement = props.readoutPlacement ?? 'none';\n const renderReadout = props.renderReadout;\n const display = props.display;\n\n const slim = density === 'slim';\n const rootVars: Record<string, string> = {};\n if (slim) {\n rootVars['--rp-track-height'] = 'var(--wzl-slider-track-h)';\n rootVars['--rp-thumb-size'] = 'var(--wzl-slider-thumb-size)';\n }\n // An explicit trackHeight wins: a caller who named a number meant it.\n if (trackHeight !== undefined) rootVars['--rp-track-height'] = `${trackHeight}px`;\n\n const labelMode = props.stopLabels ?? 'all';\n const lastStop = stopList.length - 1;\n const labeledStops = labelMode === 'none'\n ? []\n : stopList\n .map((stop, i) => ({ stop, i }))\n .filter(({ stop, i }) => stop.label !== undefined && (labelMode === 'all' || i === 0 || i === lastStop));\n // Inside the track so it shares the track's width, not the row's — an inline\n // readout beside the track would otherwise shift every label off its stop.\n const stopLabelRow = labeledStops.length > 0 && (\n <div className={s.stopLabels} data-slider-stop-labels aria-hidden=\"true\">\n {labeledStops.map(({ stop, i }) => (\n <span\n key={stop.value}\n className={s.stopLabel}\n data-slider-stop-label\n data-selected={thumbs.some(t => t.value === stop.value) ? 'true' : undefined}\n data-edge={i === 0 ? 'start' : i === lastStop ? 'end' : undefined}\n style={{ left: `${valueToFraction(stop.value) * 100}%` }}\n >\n {stop.label}\n </span>\n ))}\n </div>\n );\n const rootClass = [s.root, slim && s.slim, props.thumbFit === 'overhang' && s.overhang, stopLabelRow && s.withStopLabels, className].filter(Boolean).join(' ');\n\n return (\n <div\n className={rootClass}\n style={Object.keys(rootVars).length > 0 ? (rootVars as CSSProperties) : undefined}\n >\n <div className={s.row}>\n <div className={s.track} ref={trackRef} onPointerDown={onTrackPointerDown}>\n {props.renderTrack && (\n <div className={s.trackInner}>\n {props.renderTrack({\n trackWidth: trackRef.current?.getBoundingClientRect().width ?? 0,\n valueToFraction,\n fractionToPosition,\n })}\n </div>\n )}\n <div className={s.rail} ref={railRef} data-slider-rail>\n {(props.showStops ?? true) && stops.length > 0 && (\n <div className={s.ticks} data-slider-ticks aria-hidden=\"true\">\n {stops.map(v => {\n const f = valueToFraction(v);\n return (\n <span\n key={v}\n className={s.tick}\n data-slider-tick\n data-fraction={String(f)}\n style={{ left: `${f * 100}%` }}\n />\n );\n })}\n </div>\n )}\n {stopLabelRow}\n {thumbs.map((thumb, i) => {\n const isNotched = thumb.shape === 'notched';\n const customRender = typeof thumb.shape === 'object' && thumb.shape !== null ? thumb.shape.render : null;\n const cls = `${s.thumb}${isNotched ? ` ${s.notched}` : ''}`;\n return (\n <div\n key={i}\n role=\"slider\"\n tabIndex={0}\n aria-orientation=\"horizontal\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={thumb.value}\n aria-valuetext={thumb.valueText ?? (display ? qty(thumb.value, display).spoken : undefined)}\n aria-label={[ariaLabel, thumb.label].filter(Boolean).join(' ') || undefined}\n className={cls}\n style={{ left: `${valueToFraction(thumb.value) * 100}%` }}\n onPointerDown={onThumbPointerDown(i)}\n onKeyDown={onThumbKeyDown(i)}\n onContextMenu={onThumbContextMenu(i)}\n >\n {customRender ? customRender({ width: 14, height: 24, isActive: false }) : (thumb.label ?? '')}\n </div>\n );\n })}\n </div>\n </div>\n {placement === 'inline-after' && (\n <span data-readout=\"inline\" className={s.readoutInline}>\n {thumbs.map((t, i) => (\n <span key={i}>{i > 0 ? ' / ' : ''}{renderReadout ? renderReadout(t, i) : qty(t.value, display ?? READOUT).text}</span>\n ))}\n </span>\n )}\n </div>\n {placement === 'below-thumb' && (\n <div className={s.readoutsBelow}>\n {thumbs.map((t, i) => (\n <span\n key={i}\n data-readout=\"below\"\n className={s.readoutBelow}\n style={{ left: `${valueToFraction(t.value) * 100}%` }}\n >\n {renderReadout ? renderReadout(t, i) : qty(t.value, display ?? READOUT).text}\n </span>\n ))}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;ACgJA,SAASE,EAAS,GAAW,GAA0B,GAAqB;CAE1E,OADIC,MAAS,KAAA,KAAaA,KAAQ,IAAUC,IACrC,KAAK,OAAOA,IAAIC,KAAOF,CAAI,IAAIA,IAAOE;AAC/C;AAEA,SAASC,EAAM,GAAW,GAAY,GAAoB;CACxD,OAAO,KAAK,IAAIC,GAAI,KAAK,IAAIC,GAAIJ,CAAC,CAAC;AACrC;AAGA,IAAMK,IAAe,GAIfC,IAAa,EAAE,SAAS,GAAM;AAIpC,SAASC,EAAY,GAA6B,GAAa,GAA2B;CACxF,IAAI,CAACC,KAASA,EAAM,WAAW,GAAG,OAAO,CAAC;CAC1C,IAAMC,oBAAU,IAAI,IAAwB;CAC5C,KAAK,IAAMC,KAAQF,GAAO;EACxB,IAAMG,IAAI,OAAOD,KAAS,WAAW,EAAE,OAAOA,EA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c,iBACb,kBAAC,OAAD;GAAK,WAAW1G,EAAE;GACf,UAAAmC,EAAO,KAAK,GAAG,MACd,kBAAC,QAAD;IAEE,gBAAa;IACb,WAAWnC,EAAE;IACb,OAAO,EAAE,MAAM,GAAGwD,EAAgBY,EAAE,KAAK,IAAI,IAAI,GAAG;IAEnD,UAAAuC,IAAgBA,EAAcvC,GAAGrC,CAAC,IAAI2F,EAAItD,EAAE,OAAOwC,KAAWjE,CAAO,CAAC,CAAC;GACpE,GANCZ,CAMD,CACP;EACE,CAAA,CAEJ;;AAET"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as t } from "react";
|
|
3
|
-
var n = {
|
|
4
|
-
grid: "_grid_1o5ee_1",
|
|
5
|
-
swatch: "_swatch_1o5ee_6"
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/components/SwatchGrid/SwatchGrid.tsx
|
|
9
|
-
function r(e) {
|
|
10
|
-
return e.label ?? e.value ?? "None";
|
|
11
|
-
}
|
|
12
|
-
function i(i) {
|
|
13
|
-
let { options: a, value: o, onChange: s, onAltChange: c, className: l } = i, u = i.columns ?? 6, d = t(null), f = o === void 0 ? -1 : a.findIndex((e) => e.value === o), p = f >= 0 ? f : 0, m = (e) => {
|
|
14
|
-
d.current?.querySelectorAll("button")[e]?.focus();
|
|
15
|
-
}, h = (e) => (t) => {
|
|
16
|
-
let n = a.length - 1, r = -1;
|
|
17
|
-
switch (t.key) {
|
|
18
|
-
case "ArrowLeft":
|
|
19
|
-
r = Math.max(0, e - 1);
|
|
20
|
-
break;
|
|
21
|
-
case "ArrowRight":
|
|
22
|
-
r = Math.min(n, e + 1);
|
|
23
|
-
break;
|
|
24
|
-
case "ArrowUp":
|
|
25
|
-
r = e - u >= 0 ? e - u : e;
|
|
26
|
-
break;
|
|
27
|
-
case "ArrowDown":
|
|
28
|
-
r = e + u <= n ? e + u : e;
|
|
29
|
-
break;
|
|
30
|
-
case "Home":
|
|
31
|
-
r = 0;
|
|
32
|
-
break;
|
|
33
|
-
case "End":
|
|
34
|
-
r = n;
|
|
35
|
-
break;
|
|
36
|
-
case "Enter":
|
|
37
|
-
t.shiftKey && c && (t.preventDefault(), c(a[e].value));
|
|
38
|
-
return;
|
|
39
|
-
default: return;
|
|
40
|
-
}
|
|
41
|
-
t.preventDefault(), r !== e && m(r);
|
|
42
|
-
};
|
|
43
|
-
return /* @__PURE__ */ e("div", {
|
|
44
|
-
ref: d,
|
|
45
|
-
className: [n.grid, l].filter(Boolean).join(" "),
|
|
46
|
-
role: "group",
|
|
47
|
-
"aria-label": i["aria-label"],
|
|
48
|
-
style: { "--columns": u },
|
|
49
|
-
children: a.map((t, i) => {
|
|
50
|
-
let a = r(t);
|
|
51
|
-
return /* @__PURE__ */ e("button", {
|
|
52
|
-
type: "button",
|
|
53
|
-
className: n.swatch,
|
|
54
|
-
"aria-label": a,
|
|
55
|
-
title: a,
|
|
56
|
-
tabIndex: i === p ? 0 : -1,
|
|
57
|
-
"aria-current": i === f ? "true" : void 0,
|
|
58
|
-
...t.value === null ? { "data-none": "" } : { style: { "--swatch": t.value } },
|
|
59
|
-
onClick: (e) => {
|
|
60
|
-
e.shiftKey && c ? c(t.value) : s(t.value);
|
|
61
|
-
},
|
|
62
|
-
onContextMenu: c ? (e) => {
|
|
63
|
-
e.preventDefault(), c(t.value);
|
|
64
|
-
} : void 0,
|
|
65
|
-
onKeyDown: h(i)
|
|
66
|
-
}, t.value ?? `none-${i}`);
|
|
67
|
-
})
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
//#endregion
|
|
71
|
-
export { i as t };
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=SwatchGrid-BYvA8Bmh.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwatchGrid-BYvA8Bmh.js","names":["s","SwatchGrid_module_default","nameOf","o","SwatchGrid","props","columns","rootRef","useRef","current","value","options","tabStop","focusAt","i","onKeyDown","last","next","e","onAltChange","className","name","onChange"],"sources":["../../src/components/SwatchGrid/SwatchGrid.module.css","../../src/components/SwatchGrid/SwatchGrid.tsx"],"sourcesContent":[".grid {\n display: grid;\n grid-template-columns: repeat(var(--columns), minmax(0, 1fr));\n}\n\n.swatch {\n aspect-ratio: 1 / 1;\n min-inline-size: 0;\n padding: 0;\n border: 0.5px solid var(--wzl-border);\n border-radius: 0;\n /* The color over the checker, so a translucent swatch reads as one. */\n background:\n linear-gradient(var(--swatch), var(--swatch)),\n repeating-conic-gradient(var(--wzl-checker-a) 0% 25%, var(--wzl-checker-b) 0% 50%)\n 50% / var(--wzl-checker-size) var(--wzl-checker-size);\n background-clip: padding-box;\n cursor: pointer;\n}\n\n.swatch:hover {\n border-color: var(--wzl-fg-muted);\n}\n\n.swatch[aria-current] {\n border-color: var(--wzl-accent);\n box-shadow: 0 0 0 1px var(--wzl-accent);\n}\n\n.swatch:focus-visible {\n position: relative;\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: 1px;\n}\n\n/* No paint: the checker crossed by the danger diagonal. */\n.swatch[data-none] {\n background:\n linear-gradient(\n 45deg,\n transparent calc(50% - 1px),\n var(--wzl-danger) calc(50% - 1px),\n var(--wzl-danger) calc(50% + 1px),\n transparent calc(50% + 1px)\n ),\n repeating-conic-gradient(var(--wzl-checker-a) 0% 25%, var(--wzl-checker-b) 0% 50%)\n 50% / var(--wzl-checker-size) var(--wzl-checker-size);\n}\n","import { useRef, type CSSProperties, type KeyboardEvent, type ReactElement } from 'react';\nimport s from './SwatchGrid.module.css';\n\n/** One swatch. `value: null` is the \"no paint\" swatch. */\nexport interface SwatchGridOption {\n value: string | null;\n /** Accessible name and tooltip. Defaults to the value, or \"None\". */\n label?: string;\n}\n\n/** Props for {@link SwatchGrid}. */\nexport interface SwatchGridProps {\n options: readonly SwatchGridOption[];\n /** The swatch to mark current, if any matches. */\n value?: string | null;\n /** A click, Enter or Space on a swatch. */\n onChange: (value: string | null) => void;\n /** The alternate target — shift-click, right-click (the browser menu is\n * suppressed) and Shift+Enter. Drawing apps route this to the slot that\n * isn't focused: click for fill, shift-click for stroke. */\n onAltChange?: (value: string | null) => void;\n /** Swatches per row; also the step for ArrowUp/ArrowDown. Default 6. */\n columns?: number;\n 'aria-label'?: string;\n className?: string;\n}\n\nfunction nameOf(o: SwatchGridOption): string {\n return o.label ?? o.value ?? 'None';\n}\n\n/**\n * A palette: a grid of color swatches that apply on click. Keyboard focus\n * roves — one tab stop, on the current swatch, with the arrows moving by one\n * across and by a row up and down.\n *\n * The grid applies nothing itself. `onChange` and `onAltChange` hand the\n * color to the app, which decides what \"apply\" means: set its active paint,\n * write the selection through `useOngoingAction`'s `commit`, or both.\n */\nexport function SwatchGrid(props: SwatchGridProps): ReactElement {\n const { options, value, onChange, onAltChange, className } = props;\n const columns = props.columns ?? 6;\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n const current = value === undefined ? -1 : options.findIndex((o) => o.value === value);\n const tabStop = current >= 0 ? current : 0;\n\n const focusAt = (i: number): void => {\n rootRef.current?.querySelectorAll<HTMLElement>('button')[i]?.focus();\n };\n\n const onKeyDown = (i: number) => (e: KeyboardEvent<HTMLButtonElement>): void => {\n const last = options.length - 1;\n let next = -1;\n switch (e.key) {\n case 'ArrowLeft': next = Math.max(0, i - 1); break;\n case 'ArrowRight': next = Math.min(last, i + 1); break;\n case 'ArrowUp': next = i - columns >= 0 ? i - columns : i; break;\n case 'ArrowDown': next = i + columns <= last ? i + columns : i; break;\n case 'Home': next = 0; break;\n case 'End': next = last; break;\n case 'Enter':\n if (e.shiftKey && onAltChange) {\n e.preventDefault();\n onAltChange(options[i].value);\n }\n return;\n default: return;\n }\n e.preventDefault();\n if (next !== i) focusAt(next);\n };\n\n return (\n <div\n ref={rootRef}\n className={[s.grid, className].filter(Boolean).join(' ')}\n role=\"group\"\n aria-label={props['aria-label']}\n style={{ '--columns': columns } as CSSProperties}\n >\n {options.map((o, i) => {\n const name = nameOf(o);\n return (\n <button\n key={o.value ?? `none-${i}`}\n type=\"button\"\n className={s.swatch}\n aria-label={name}\n title={name}\n tabIndex={i === tabStop ? 0 : -1}\n aria-current={i === current ? 'true' : undefined}\n {...(o.value === null\n ? { 'data-none': '' }\n : { style: { '--swatch': o.value } as CSSProperties })}\n onClick={(e) => {\n if (e.shiftKey && onAltChange) onAltChange(o.value);\n else onChange(o.value);\n }}\n onContextMenu={onAltChange ? (e) => { e.preventDefault(); onAltChange(o.value); } : undefined}\n onKeyDown={onKeyDown(i)}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AC2BA,SAASE,EAAO,GAA6B;CAC3C,OAAOC,EAAE,SAASA,EAAE,SAAS;AAC/B;AAWA,SAAgBC,EAAW,GAAsC;CAC/D,IAAM,EAAE,YAAS,UAAO,aAAU,gBAAa,iBAAcC,GACvDC,IAAUD,EAAM,WAAW,GAC3BE,IAAUC,EAA8B,IAAI,GAE5CC,IAAUC,MAAU,KAAA,IAAY,KAAKC,EAAQ,WAAW,MAAMR,EAAE,UAAUO,CAAK,GAC/EE,IAAUH,KAAW,IAAIA,IAAU,GAEnCI,KAAW,MAAoB;EACnC,EAAQ,SAAS,iBAA8B,QAAQ,CAAC,CAACC,EAAE,EAAE,MAAM;CACrE,GAEMC,KAAa,OAAe,MAA8C;EAC9E,IAAMC,IAAOL,EAAQ,SAAS,GAC1BM,IAAO;EACX,QAAQC,EAAE,KAAV;GACE,KAAK;IAAa,IAAO,KAAK,IAAI,GAAGJ,IAAI,CAAC;IAAG;GAC7C,KAAK;IAAc,IAAO,KAAK,IAAIE,GAAMF,IAAI,CAAC;IAAG;GACjD,KAAK;IAAW,IAAOA,IAAIR,KAAW,IAAIQ,IAAIR,IAAUQ;IAAG;GAC3D,KAAK;IAAa,IAAOA,IAAIR,KAAWU,IAAOF,IAAIR,IAAUQ;IAAG;GAChE,KAAK;IAAQ,IAAO;IAAG;GACvB,KAAK;IAAO,IAAOE;IAAM;GAC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