@weasel-js/ui 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ActionBar-BvPEd_GW.js → ActionBar-BTev_ZZl.js} +21 -21
- package/dist/chunks/ActionBar-BTev_ZZl.js.map +1 -0
- package/dist/chunks/{ActionsBar-9aR5N3lU.js → ActionsBar-CBi_dV4B.js} +4 -4
- package/dist/chunks/{ActionsBar-9aR5N3lU.js.map → ActionsBar-CBi_dV4B.js.map} +1 -1
- package/dist/chunks/{Badge-dQzbkk-C.js → Badge-9dPfvYOk.js} +672 -670
- package/dist/chunks/Badge-9dPfvYOk.js.map +1 -0
- package/dist/chunks/{BandEditor-D3i6l299.js → BandEditor-DeE-Nhyh.js} +46 -46
- package/dist/chunks/BandEditor-DeE-Nhyh.js.map +1 -0
- package/dist/chunks/{Button-9QNIYugK.js → Button-CIu40Epu.js} +28 -28
- package/dist/chunks/Button-CIu40Epu.js.map +1 -0
- package/dist/chunks/{Callout-cJHJ4kIN.js → Callout-CxDNb9iE.js} +35 -35
- package/dist/chunks/Callout-CxDNb9iE.js.map +1 -0
- package/dist/chunks/Checkbox-Chtrlh19.js +47 -0
- package/dist/chunks/Checkbox-Chtrlh19.js.map +1 -0
- package/dist/chunks/ColorField-CSSRv3jG.js +60 -0
- package/dist/chunks/ColorField-CSSRv3jG.js.map +1 -0
- package/dist/chunks/{ComboBox-ONQISwtI.js → ComboBox-BIQ8KP4h.js} +28 -28
- package/dist/chunks/ComboBox-BIQ8KP4h.js.map +1 -0
- package/dist/chunks/{CurveEditor-SmwwvrsA.js → CurveEditor-DiJk0NhK.js} +117 -116
- package/dist/chunks/{CurveEditor-SmwwvrsA.js.map → CurveEditor-DiJk0NhK.js.map} +1 -1
- package/dist/chunks/DataGrid-BgiEYBLo.js +107 -0
- package/dist/chunks/DataGrid-BgiEYBLo.js.map +1 -0
- package/dist/chunks/Dialog-RzrboT4Q.js +59 -0
- package/dist/chunks/Dialog-RzrboT4Q.js.map +1 -0
- package/dist/chunks/DragHandleGlyph-CJbzRigu.js +47 -0
- package/dist/chunks/DragHandleGlyph-CJbzRigu.js.map +1 -0
- package/dist/chunks/{Field-VQwmrIna.js → Field-DrRby9vo.js} +6 -6
- package/dist/chunks/Field-DrRby9vo.js.map +1 -0
- package/dist/chunks/GradientEditor-BuVR6pt-.js +308 -0
- package/dist/chunks/GradientEditor-BuVR6pt-.js.map +1 -0
- package/dist/chunks/InlineRange-B-Jkv8AA.js +24 -0
- package/dist/chunks/InlineRange-B-Jkv8AA.js.map +1 -0
- package/dist/chunks/Input-BnxOPY4N.js +55 -0
- package/dist/chunks/Input-BnxOPY4N.js.map +1 -0
- package/dist/chunks/{Keycaps-CFX7UAj8.js → Keycaps-Dk33JOiH.js} +15 -15
- package/dist/chunks/Keycaps-Dk33JOiH.js.map +1 -0
- package/dist/chunks/LayerStack-DQYvGNPA.js +145 -0
- package/dist/chunks/LayerStack-DQYvGNPA.js.map +1 -0
- package/dist/chunks/NumberField-BQ-KaK7T.js +59 -0
- package/dist/chunks/NumberField-BQ-KaK7T.js.map +1 -0
- package/dist/chunks/{OptionsBar-CHvH4n4u.js → OptionsBar-BecAPCID.js} +4 -4
- package/dist/chunks/{OptionsBar-CHvH4n4u.js.map → OptionsBar-BecAPCID.js.map} +1 -1
- package/dist/chunks/PaintInput-K5W4Uho3.js +205 -0
- package/dist/chunks/PaintInput-K5W4Uho3.js.map +1 -0
- package/dist/chunks/PatternPicker-BdLSj_f_.js +93 -0
- package/dist/chunks/PatternPicker-BdLSj_f_.js.map +1 -0
- package/dist/chunks/Plot2D-BEjpJhk-.js +134 -0
- package/dist/chunks/Plot2D-BEjpJhk-.js.map +1 -0
- package/dist/chunks/{PointPlotter-BUIse9c4.js → PointPlotter-C_tZb122.js} +2 -2
- package/dist/chunks/{PointPlotter-BUIse9c4.js.map → PointPlotter-C_tZb122.js.map} +1 -1
- package/dist/chunks/{Powerline-BYWdK8QH.js → Powerline-Cc-Av8Pc.js} +2 -2
- package/dist/chunks/{Powerline-BYWdK8QH.js.map → Powerline-Cc-Av8Pc.js.map} +1 -1
- package/dist/chunks/Prefs-CRTRAud6.js +300 -0
- package/dist/chunks/Prefs-CRTRAud6.js.map +1 -0
- package/dist/chunks/Properties-BRrWSBHM.js +648 -0
- package/dist/chunks/Properties-BRrWSBHM.js.map +1 -0
- package/dist/chunks/RadioGroup-BrtV1Clm.js +49 -0
- package/dist/chunks/RadioGroup-BrtV1Clm.js.map +1 -0
- package/dist/chunks/RangeSlider-CJfhxDn6.js +52 -0
- package/dist/chunks/RangeSlider-CJfhxDn6.js.map +1 -0
- package/dist/chunks/{ResizeHandle-BOpmtOOj.js → ResizeHandle-Csz3DPew.js} +8 -8
- package/dist/chunks/{ResizeHandle-BOpmtOOj.js.map → ResizeHandle-Csz3DPew.js.map} +1 -1
- package/dist/chunks/{Select-CHsuQCp0.js → Select-BYhHGmMl.js} +32 -32
- package/dist/chunks/Select-BYhHGmMl.js.map +1 -0
- package/dist/chunks/SelectionPanel-D2IYlj_K.js +446 -0
- package/dist/chunks/SelectionPanel-D2IYlj_K.js.map +1 -0
- package/dist/chunks/{Sidebar-DP_nyJze.js → Sidebar-DrBQZ9nP.js} +1 -1
- package/dist/chunks/{Sidebar-DP_nyJze.js.map → Sidebar-DrBQZ9nP.js.map} +1 -1
- package/dist/chunks/SidebarPanel-Dbqb79Kx.js +59 -0
- package/dist/chunks/SidebarPanel-Dbqb79Kx.js.map +1 -0
- package/dist/chunks/Slider-DbOt9Dji.js +257 -0
- package/dist/chunks/Slider-DbOt9Dji.js.map +1 -0
- package/dist/chunks/{StatusBar-DBO0E0Yd.js → StatusBar-B6lPbvrF.js} +6 -6
- package/dist/chunks/StatusBar-B6lPbvrF.js.map +1 -0
- package/dist/chunks/Switch-BSr-vaAC.js +27 -0
- package/dist/chunks/Switch-BSr-vaAC.js.map +1 -0
- package/dist/chunks/Tabs-CIa-Idzu.js +41 -0
- package/dist/chunks/Tabs-CIa-Idzu.js.map +1 -0
- package/dist/chunks/{Toast-DFw4IrD_.js → Toast-C0UnBqQu.js} +31 -31
- package/dist/chunks/{Toast-DFw4IrD_.js.map → Toast-C0UnBqQu.js.map} +1 -1
- package/dist/chunks/{ToggleBar-BP1zFcvg.js → ToggleBar-1wDRwSGN.js} +11 -10
- package/dist/chunks/ToggleBar-1wDRwSGN.js.map +1 -0
- package/dist/chunks/{ToolButton-ClPz5L6j.js → ToolButton-Bd9l_I8f.js} +16 -16
- package/dist/chunks/ToolButton-Bd9l_I8f.js.map +1 -0
- package/dist/chunks/{ToolGroup-BTIwd4U4.js → ToolGroup-gizXwttA.js} +1 -1
- package/dist/chunks/{ToolGroup-BTIwd4U4.js.map → ToolGroup-gizXwttA.js.map} +1 -1
- package/dist/chunks/{ToolOptionsBar-JvmY7iNe.js → ToolOptionsBar-CXjeTE1d.js} +4 -4
- package/dist/chunks/ToolOptionsBar-CXjeTE1d.js.map +1 -0
- package/dist/chunks/{ToolPalette-DAiVhdtV.js → ToolPalette-3YpkSNfj.js} +24 -24
- package/dist/chunks/ToolPalette-3YpkSNfj.js.map +1 -0
- package/dist/chunks/Tooltip-Di7vxbFa.js +40 -0
- package/dist/chunks/Tooltip-Di7vxbFa.js.map +1 -0
- package/dist/chunks/dlog-CMYiRF3Q.js +38 -0
- package/dist/chunks/dlog-CMYiRF3Q.js.map +1 -0
- package/dist/chunks/{keyGlyph-BDH5fqkO.js → keyGlyph-D3X08tSp.js} +1 -1
- package/dist/chunks/{keyGlyph-BDH5fqkO.js.map → keyGlyph-D3X08tSp.js.map} +1 -1
- package/dist/chunks/number-llMRJPJW.js +18 -0
- package/dist/chunks/number-llMRJPJW.js.map +1 -0
- package/dist/chunks/segmentedControl.module-YXqIjnmu.js +11 -0
- package/dist/chunks/segmentedControl.module-YXqIjnmu.js.map +1 -0
- package/dist/chunks/useReorderDragList-RSJqj18B.js +109 -0
- package/dist/chunks/useReorderDragList-RSJqj18B.js.map +1 -0
- package/dist/chunks/{useRovingTabIndex-DBZtq4IH.js → useRovingTabIndex-CuUl6DLF.js} +1 -1
- package/dist/chunks/{useRovingTabIndex-DBZtq4IH.js.map → useRovingTabIndex-CuUl6DLF.js.map} +1 -1
- package/dist/components/ActionBar/index.js +1 -1
- package/dist/components/ActionsBar/index.js +1 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/BandEditor/index.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Callout/index.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/ColorField/ColorField.d.ts.map +1 -1
- package/dist/components/ColorField/index.js +1 -1
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/CurveEditor/index.js +1 -1
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts +12 -0
- package/dist/components/DragHandleGlyph/DragHandleGlyph.d.ts.map +1 -0
- package/dist/components/DragHandleGlyph/index.d.ts +3 -0
- package/dist/components/DragHandleGlyph/index.d.ts.map +1 -0
- package/dist/components/DragHandleGlyph/index.js +2 -0
- package/dist/components/Field/index.js +1 -1
- package/dist/components/GradientEditor/SceneGradientHandles.d.ts +41 -0
- package/dist/components/GradientEditor/SceneGradientHandles.d.ts.map +1 -0
- package/dist/components/GradientEditor/index.d.ts +1 -0
- package/dist/components/GradientEditor/index.d.ts.map +1 -1
- package/dist/components/GradientEditor/index.js +2 -2
- package/dist/components/InlineRange/InlineRange.d.ts +17 -0
- package/dist/components/InlineRange/InlineRange.d.ts.map +1 -0
- package/dist/components/InlineRange/index.d.ts +2 -0
- package/dist/components/InlineRange/index.d.ts.map +1 -0
- package/dist/components/InlineRange/index.js +2 -0
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Keycaps/index.js +2 -2
- package/dist/components/LayerStack/LayerStack.d.ts +49 -0
- package/dist/components/LayerStack/LayerStack.d.ts.map +1 -0
- package/dist/components/LayerStack/index.d.ts +2 -0
- package/dist/components/LayerStack/index.d.ts.map +1 -0
- package/dist/components/LayerStack/index.js +2 -0
- package/dist/components/NumberField/NumberField.d.ts +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OptionsBar/index.js +1 -1
- package/dist/components/PaintInput/PaintInput.d.ts +40 -0
- package/dist/components/PaintInput/PaintInput.d.ts.map +1 -0
- package/dist/components/PaintInput/index.d.ts +2 -0
- package/dist/components/PaintInput/index.d.ts.map +1 -0
- package/dist/components/PaintInput/index.js +2 -0
- package/dist/components/PatternPicker/PatternPicker.d.ts +31 -0
- package/dist/components/PatternPicker/PatternPicker.d.ts.map +1 -0
- package/dist/components/PatternPicker/index.d.ts +2 -0
- package/dist/components/PatternPicker/index.d.ts.map +1 -0
- package/dist/components/PatternPicker/index.js +2 -0
- 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.map +1 -1
- package/dist/components/Prefs/index.d.ts +1 -1
- package/dist/components/Prefs/index.d.ts.map +1 -1
- package/dist/components/Prefs/index.js +1 -1
- package/dist/components/Prefs/schema.d.ts +4 -92
- package/dist/components/Prefs/schema.d.ts.map +1 -1
- package/dist/components/Properties/CurveField.d.ts +37 -0
- package/dist/components/Properties/CurveField.d.ts.map +1 -0
- package/dist/components/Properties/EffectCard.d.ts +68 -0
- package/dist/components/Properties/EffectCard.d.ts.map +1 -0
- package/dist/components/Properties/PropertyGroup.d.ts +24 -0
- package/dist/components/Properties/PropertyGroup.d.ts.map +1 -0
- package/dist/components/Properties/PropertyPanel.d.ts +181 -0
- package/dist/components/Properties/PropertyPanel.d.ts.map +1 -0
- package/dist/components/Properties/index.d.ts +9 -0
- package/dist/components/Properties/index.d.ts.map +1 -0
- package/dist/components/Properties/index.js +2 -0
- package/dist/components/Properties/storyLayouts.d.ts +11 -0
- package/dist/components/Properties/storyLayouts.d.ts.map +1 -0
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/ResizeHandle/index.js +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionPanel/SelectionPanel.d.ts +32 -1
- package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
- package/dist/components/SelectionPanel/index.js +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/SidebarPanel/index.js +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/StatusBar/index.js +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleBar/ToggleBar.d.ts +1 -1
- package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -1
- package/dist/components/ToggleBar/index.js +1 -1
- package/dist/components/ToolButton/index.js +1 -1
- package/dist/components/ToolGroup/index.js +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/components/ToolPalette/index.js +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/paintValue.d.ts +8 -0
- package/dist/components/paintValue.d.ts.map +1 -0
- package/dist/format/number.d.ts +13 -0
- package/dist/format/number.d.ts.map +1 -1
- package/dist/icons/Icon.d.ts +17 -0
- package/dist/icons/Icon.d.ts.map +1 -0
- package/dist/icons/index.d.ts +50 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/paths.d.ts +71 -0
- package/dist/icons/paths.d.ts.map +1 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +190 -48
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -3
- package/dist/chunks/ActionBar-BvPEd_GW.js.map +0 -1
- package/dist/chunks/Badge-dQzbkk-C.js.map +0 -1
- package/dist/chunks/BandEditor-D3i6l299.js.map +0 -1
- package/dist/chunks/Button-9QNIYugK.js.map +0 -1
- package/dist/chunks/Callout-cJHJ4kIN.js.map +0 -1
- package/dist/chunks/Checkbox-KQ5L8APP.js +0 -47
- package/dist/chunks/Checkbox-KQ5L8APP.js.map +0 -1
- package/dist/chunks/ColorField-ykpiD3XU.js +0 -60
- package/dist/chunks/ColorField-ykpiD3XU.js.map +0 -1
- package/dist/chunks/ComboBox-ONQISwtI.js.map +0 -1
- package/dist/chunks/DataGrid-DZQ4Chbd.js +0 -210
- package/dist/chunks/DataGrid-DZQ4Chbd.js.map +0 -1
- package/dist/chunks/Dialog-CqwdJv_t.js +0 -59
- package/dist/chunks/Dialog-CqwdJv_t.js.map +0 -1
- package/dist/chunks/Field-VQwmrIna.js.map +0 -1
- package/dist/chunks/GradientEditor-Bg6SX64V.js +0 -280
- package/dist/chunks/GradientEditor-Bg6SX64V.js.map +0 -1
- package/dist/chunks/Input-DpkwYtUY.js +0 -55
- package/dist/chunks/Input-DpkwYtUY.js.map +0 -1
- package/dist/chunks/Keycaps-CFX7UAj8.js.map +0 -1
- package/dist/chunks/NumberField-BbzI0GtU.js +0 -59
- package/dist/chunks/NumberField-BbzI0GtU.js.map +0 -1
- package/dist/chunks/Plot2D-CEnhzodm.js +0 -168
- package/dist/chunks/Plot2D-CEnhzodm.js.map +0 -1
- package/dist/chunks/Prefs-BMR9wMiZ.js +0 -238
- package/dist/chunks/Prefs-BMR9wMiZ.js.map +0 -1
- package/dist/chunks/RadioGroup-CIpHr3g6.js +0 -49
- package/dist/chunks/RadioGroup-CIpHr3g6.js.map +0 -1
- package/dist/chunks/RangeSlider-CaDogGTj.js +0 -52
- package/dist/chunks/RangeSlider-CaDogGTj.js.map +0 -1
- package/dist/chunks/Select-CHsuQCp0.js.map +0 -1
- package/dist/chunks/SelectionPanel-D_wk_8ZN.js +0 -303
- package/dist/chunks/SelectionPanel-D_wk_8ZN.js.map +0 -1
- package/dist/chunks/SidebarPanel-BVTQ1ZyM.js +0 -59
- package/dist/chunks/SidebarPanel-BVTQ1ZyM.js.map +0 -1
- package/dist/chunks/Slider-tGbqoAZH.js +0 -259
- package/dist/chunks/Slider-tGbqoAZH.js.map +0 -1
- package/dist/chunks/StatusBar-DBO0E0Yd.js.map +0 -1
- package/dist/chunks/Switch-JyVSSAzC.js +0 -27
- package/dist/chunks/Switch-JyVSSAzC.js.map +0 -1
- package/dist/chunks/Tabs-Df0sDomx.js +0 -41
- package/dist/chunks/Tabs-Df0sDomx.js.map +0 -1
- package/dist/chunks/ToggleBar-BP1zFcvg.js.map +0 -1
- package/dist/chunks/ToolButton-ClPz5L6j.js.map +0 -1
- package/dist/chunks/ToolOptionsBar-JvmY7iNe.js.map +0 -1
- package/dist/chunks/ToolPalette-DAiVhdtV.js.map +0 -1
- package/dist/chunks/Tooltip-DXJbdR5B.js +0 -40
- package/dist/chunks/Tooltip-DXJbdR5B.js.map +0 -1
- package/dist/chunks/segmentedControl.module-DCyuDbj1.js +0 -11
- package/dist/chunks/segmentedControl.module-DCyuDbj1.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { n as e, t } from "./Tooltip-
|
|
2
|
-
import {
|
|
3
|
-
import { Focusable as r } from "react-aria-components";
|
|
1
|
+
import { n as e, t } from "./Tooltip-Di7vxbFa.js";
|
|
2
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
3
|
import { evaluateEnabled as i, useActionsRegistry as a, useOptionalDepRegistry as o } from "@weasel-js/core";
|
|
5
|
-
import {
|
|
4
|
+
import { useSyncExternalStore as s } from "react";
|
|
5
|
+
import { Focusable as c } from "react-aria-components";
|
|
6
6
|
var l = {
|
|
7
|
-
bar: "
|
|
8
|
-
vertical: "
|
|
9
|
-
button: "
|
|
7
|
+
bar: "_bar_1quk7_7",
|
|
8
|
+
vertical: "_vertical_1quk7_18",
|
|
9
|
+
button: "_button_1quk7_22"
|
|
10
10
|
}, u = Object.freeze([]), d = () => () => {};
|
|
11
11
|
function f(e, t) {
|
|
12
12
|
if (t !== void 0) return t;
|
|
@@ -17,7 +17,7 @@ function p(e, t) {
|
|
|
17
17
|
return t ? `${e} (${t})` : e;
|
|
18
18
|
}
|
|
19
19
|
function m(m) {
|
|
20
|
-
let { group: h, orientation: g = "horizontal", icons: _, labels: v, className: y } = m, b = a(), x = o(), S =
|
|
20
|
+
let { group: h, orientation: g = "horizontal", icons: _, labels: v, className: y } = m, b = a(), x = o(), S = s(b ? b.subscribe : d, b ? b.list : () => u, b ? b.list : () => u).filter((e) => e.group === h), C = x ? {
|
|
21
21
|
selection: x.get("selection"),
|
|
22
22
|
scene: x.get("scene"),
|
|
23
23
|
history: x.get("history"),
|
|
@@ -26,7 +26,7 @@ function m(m) {
|
|
|
26
26
|
activeTool: x.get("activeTool"),
|
|
27
27
|
booleansAdapter: x.get("booleansAdapter")
|
|
28
28
|
} : void 0;
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ n("div", {
|
|
30
30
|
className: [
|
|
31
31
|
l.bar,
|
|
32
32
|
g === "vertical" && l.vertical,
|
|
@@ -34,30 +34,30 @@ function m(m) {
|
|
|
34
34
|
].filter(Boolean).join(" "),
|
|
35
35
|
role: "toolbar",
|
|
36
36
|
"aria-label": `${h} actions`,
|
|
37
|
-
children: S.map((
|
|
38
|
-
let
|
|
39
|
-
return /* @__PURE__ */
|
|
37
|
+
children: S.map((a) => {
|
|
38
|
+
let o = v?.[a.id] ?? a.label, s = f(a, _?.[a.id]), { enabled: u } = i(a, C), d = !u, m = p(o, a.shortcut);
|
|
39
|
+
return /* @__PURE__ */ r(e, {
|
|
40
40
|
isDisabled: d,
|
|
41
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ n(c, {
|
|
42
42
|
isDisabled: d,
|
|
43
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ n("button", {
|
|
44
44
|
type: "button",
|
|
45
|
-
"data-testid": `action-bar-item-${
|
|
46
|
-
"aria-label":
|
|
45
|
+
"data-testid": `action-bar-item-${a.id}`,
|
|
46
|
+
"aria-label": o,
|
|
47
47
|
"aria-disabled": d || void 0,
|
|
48
48
|
disabled: d,
|
|
49
49
|
className: l.button,
|
|
50
50
|
onClick: () => {
|
|
51
|
-
d || b?.trigger(
|
|
51
|
+
d || b?.trigger(a.id);
|
|
52
52
|
},
|
|
53
|
-
children:
|
|
53
|
+
children: s
|
|
54
54
|
})
|
|
55
|
-
}), /* @__PURE__ */
|
|
56
|
-
},
|
|
55
|
+
}), /* @__PURE__ */ n(t, { children: m })]
|
|
56
|
+
}, a.id);
|
|
57
57
|
})
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
//#endregion
|
|
61
61
|
export { m as t };
|
|
62
62
|
|
|
63
|
-
//# sourceMappingURL=ActionBar-
|
|
63
|
+
//# sourceMappingURL=ActionBar-BTev_ZZl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionBar-BTev_ZZl.js","names":[],"sources":["../../src/components/ActionBar/ActionBar.module.css","../../src/components/ActionBar/ActionBar.tsx"],"sourcesContent":["/* `<ActionBar>` shares the segmented widget look of the WeaselDraw\n * pathfinder panel — small chrome on the panel surface so a bar of\n * Action buttons reads as a single control. Tokens are theme-driven\n * via `--wzl-*`. Visual parity with `PathfinderPanel.module.css` is\n * intentional; this is the generic version. */\n\n.bar {\n display: flex;\n flex-direction: row;\n gap: 1px;\n background: var(--wzl-surface);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n padding: 2px;\n user-select: none;\n}\n\n.bar.vertical {\n flex-direction: column;\n}\n\n.button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n background: transparent;\n border: 0;\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n cursor: default;\n}\n\n.button:hover:not([disabled]) {\n background: var(--wzl-border);\n}\n\n.button:active:not([disabled]) {\n background: color-mix(in srgb, var(--wzl-border) 70%, transparent);\n}\n\n.button[disabled] {\n opacity: 0.4;\n cursor: default;\n}\n\n.button > svg {\n display: block;\n}\n","import { useSyncExternalStore, type ReactNode } from 'react';\nimport { Focusable } from 'react-aria-components';\nimport {\n useActionsRegistry,\n useOptionalDepRegistry,\n evaluateEnabled,\n type Action,\n} from '@weasel-js/core';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport s from './ActionBar.module.css';\n\nconst EMPTY_LIST: readonly Action[] = Object.freeze([]);\nconst noopSubscribe = (): (() => void) => () => {};\n\n/** Props for {@link ActionBar}. */\nexport interface ActionBarProps {\n /** Group key — only actions with `action.group === group` are rendered. */\n group: string;\n /** Layout direction. Defaults to `'horizontal'`. */\n orientation?: 'horizontal' | 'vertical';\n /**\n * Per-id icon overrides — keyed by `action.id`. When an entry is provided\n * it replaces the action's own `icon` for this bar only. Mirrors\n * `PathfinderPanelProps.icons` so call sites that ship custom glyph sets\n * can swap them in without re-registering actions.\n */\n icons?: Record<string, ReactNode>;\n /**\n * Per-id label overrides — keyed by `action.id`. Drives both `aria-label`\n * and `title`. When omitted, the action's own `label` is used.\n */\n labels?: Record<string, string>;\n /** Additional class for the toolbar root. */\n className?: string;\n}\n\nfunction resolveIcon(action: Action, override: ReactNode | undefined): ReactNode {\n if (override !== undefined) return override;\n const i = action.icon;\n if (typeof i === 'function') return i();\n return i;\n}\n\nfunction resolveTitle(label: string, shortcut: string | undefined): string {\n return shortcut ? `${label} (${shortcut})` : label;\n}\n\n/**\n * Generic group-keyed action toolbar. Reads the parent `ActionsRegistry`,\n * filters to actions whose `group` matches `props.group`, and renders one\n * icon button per match. Disabled state is derived from each action's\n * `enabled` predicate via `evaluateEnabled` (so the button greys out and\n * swallows clicks while the keybinding — if any — still fires through the\n * registry's keydown listener; that's the registry's contract, not ours).\n *\n * Visual parity with the WeaselDraw `<PathfinderPanel>` is intentional;\n * this is the generic, registry-driven version. No keyboard navigation\n * (roving tabindex) yet — bar consumers today are short flat strips. Add\n * if/when a long bar lands.\n */\nexport function ActionBar(props: ActionBarProps) {\n const { group, orientation = 'horizontal', icons, labels, className } = props;\n const registry = useActionsRegistry();\n const depReg = useOptionalDepRegistry();\n const all = useSyncExternalStore(\n registry ? registry.subscribe : noopSubscribe,\n registry ? registry.list : () => EMPTY_LIST,\n registry ? registry.list : () => EMPTY_LIST,\n );\n const actions = all.filter((a) => a.group === group);\n\n // Build the deps bag fresh each render — predicates read selection / etc.\n // from these. ActionBar relies on its parent re-rendering when the\n // underlying state changes (e.g. the consumer reads `selection.current`\n // somewhere above us) for `enabled` to reflect the latest values.\n const deps = depReg\n ? {\n selection: depReg.get('selection'),\n scene: depReg.get('scene'),\n history: depReg.get('history'),\n view: depReg.get('view'),\n pointer: depReg.get('pointer'),\n activeTool: depReg.get('activeTool'),\n booleansAdapter: depReg.get('booleansAdapter'),\n }\n : undefined;\n\n const cls = [s.bar, orientation === 'vertical' && s.vertical, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={cls} role=\"toolbar\" aria-label={`${group} actions`}>\n {actions.map((action) => {\n const label = labels?.[action.id] ?? action.label;\n const icon = resolveIcon(action, icons?.[action.id]);\n const { enabled } = evaluateEnabled(action, deps);\n const disabled = !enabled;\n const title = resolveTitle(label, action.shortcut);\n return (\n <TooltipTrigger key={action.id} isDisabled={disabled}>\n <Focusable isDisabled={disabled}>\n <button\n type=\"button\"\n data-testid={`action-bar-item-${action.id}`}\n aria-label={label}\n aria-disabled={disabled || undefined}\n disabled={disabled}\n className={s.button}\n onClick={() => {\n if (disabled) return;\n // Dispatch through the registry so the enabled() guard runs.\n // If no registry is in scope the click is a no-op — ActionBar\n // is expected to render under an `ActionsProvider`.\n registry?.trigger(action.id);\n }}\n >\n {icon}\n </button>\n </Focusable>\n <Tooltip>{title}</Tooltip>\n </TooltipTrigger>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;GCWM,IAAgC,OAAO,OAAO,EAAE,CAAC,EACjD,gBAA0C;AAwBhD,SAAS,EAAY,GAAgB,GAA4C;AAC/E,KAAI,MAAa,KAAA,EAAW,QAAO;CACnC,IAAM,IAAI,EAAO;AAEjB,QADI,OAAO,KAAM,aAAmB,GAAG,GAChC;;AAGT,SAAS,EAAa,GAAe,GAAsC;AACzE,QAAO,IAAW,GAAG,EAAM,IAAI,EAAS,KAAK;;AAgB/C,SAAgB,EAAU,GAAuB;CAC/C,IAAM,EAAE,UAAO,iBAAc,cAAc,UAAO,WAAQ,iBAAc,GAClE,IAAW,GAAoB,EAC/B,IAAS,GAAwB,EAMjC,IALM,EACV,IAAW,EAAS,YAAY,GAChC,IAAW,EAAS,aAAa,GACjC,IAAW,EAAS,aAAa,EAEnB,CAAI,QAAQ,MAAM,EAAE,UAAU,EAAM,EAM9C,IAAO,IACT;EACE,WAAW,EAAO,IAAI,YAAY;EAClC,OAAO,EAAO,IAAI,QAAQ;EAC1B,SAAS,EAAO,IAAI,UAAU;EAC9B,MAAM,EAAO,IAAI,OAAO;EACxB,SAAS,EAAO,IAAI,UAAU;EAC9B,YAAY,EAAO,IAAI,aAAa;EACpC,iBAAiB,EAAO,IAAI,kBAAkB;EAC/C,GACD,KAAA;AAMJ,QACE,kBAAC,OAAD;EAAK,WALK;GAAC,EAAE;GAAK,MAAgB,cAAc,EAAE;GAAU;GAAU,CACrE,OAAO,QAAQ,CACf,KAAK,IAGU;EAAK,MAAK;EAAU,cAAY,GAAG,EAAM;YACtD,EAAQ,KAAK,MAAW;GACvB,IAAM,IAAQ,IAAS,EAAO,OAAO,EAAO,OACtC,IAAO,EAAY,GAAQ,IAAQ,EAAO,IAAI,EAC9C,EAAE,eAAY,EAAgB,GAAQ,EAAK,EAC3C,IAAW,CAAC,GACZ,IAAQ,EAAa,GAAO,EAAO,SAAS;AAClD,UACE,kBAAC,GAAD;IAAgC,YAAY;cAA5C,CACE,kBAAC,GAAD;KAAW,YAAY;eACrB,kBAAC,UAAD;MACE,MAAK;MACL,eAAa,mBAAmB,EAAO;MACvC,cAAY;MACZ,iBAAe,KAAY,KAAA;MACjB;MACV,WAAW,EAAE;MACb,eAAe;AACT,YAIJ,GAAU,QAAQ,EAAO,GAAG;;gBAG7B;MACM,CAAA;KACC,CAAA,EACZ,kBAAC,GAAD,EAAA,UAAU,GAAgB,CAAA,CACX;MArBI,EAAO,GAqBX;IAEnB;EACE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./useRovingTabIndex-
|
|
2
|
-
import { t } from "./segmentedControl.module-
|
|
3
|
-
import "react";
|
|
1
|
+
import { t as e } from "./useRovingTabIndex-CuUl6DLF.js";
|
|
2
|
+
import { t } from "./segmentedControl.module-YXqIjnmu.js";
|
|
4
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
5
|
//#region src/components/ActionsBar/ActionsBar.tsx
|
|
6
6
|
function r(r) {
|
|
7
7
|
let { items: i, ariaLabel: a, className: o, height: s, size: c, variant: l } = r, u = (e) => {
|
|
@@ -38,4 +38,4 @@ function r(r) {
|
|
|
38
38
|
//#endregion
|
|
39
39
|
export { r as t };
|
|
40
40
|
|
|
41
|
-
//# sourceMappingURL=ActionsBar-
|
|
41
|
+
//# sourceMappingURL=ActionsBar-CBi_dV4B.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsBar-
|
|
1
|
+
{"version":3,"file":"ActionsBar-CBi_dV4B.js","names":[],"sources":["../../src/components/ActionsBar/ActionsBar.tsx"],"sourcesContent":["import { type CSSProperties, type ReactElement, type ReactNode } from 'react';\nimport s from '../segmentedControl.module.css';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\n\n/**\n * One button in an {@link ActionsBar}. `value` is only a React key; the item\n * carries no selected state.\n */\nexport type ActionsBarItem<V extends string | number = string> = {\n value: V;\n label?: ReactNode;\n ariaLabel?: string;\n disabled?: boolean;\n onAction: () => void;\n};\n\n/** Segment height and type scale for an {@link ActionsBar}. */\nexport type ActionsBarSize = 'sm' | 'md';\n/** Visual treatment of an {@link ActionsBar}. */\nexport type ActionsBarVariant = 'default' | 'minimal';\n\n/** Props for {@link ActionsBar}. */\nexport type ActionsBarProps<V extends string | number = string> = {\n items: readonly ActionsBarItem<V>[];\n ariaLabel?: string;\n className?: string;\n height?: number;\n size?: ActionsBarSize;\n variant?: ActionsBarVariant;\n};\n\n/**\n * Segmented strip of momentary buttons — each press fires and nothing stays\n * selected. Shares the look and the arrow-key navigation of `ToggleBar` and\n * `OptionsBar`.\n *\n * This is a plain callback bar. For buttons driven by the kit's actions\n * registry, use `ActionBar` instead.\n */\nexport function ActionsBar<V extends string | number = string>(props: ActionsBarProps<V>): ReactElement {\n const { items, ariaLabel, className, height, size, variant } = props;\n\n const fire = (index: number) => {\n const item = items[index];\n if (item.disabled) return;\n item.onAction();\n };\n\n const roving = useRovingTabIndex({ items, itemClassName: s.segment, onActivate: fire });\n\n const style: CSSProperties | undefined = height !== undefined\n ? ({ ['--wzl-tb-height' as string]: `${height}px` } as CSSProperties)\n : undefined;\n\n const rootCls = [\n s.root,\n size && s[`size_${size}`],\n variant && s[`variant_${variant}`],\n className,\n ].filter(Boolean).join(' ');\n\n return (\n <div\n ref={roving.rootRef}\n className={rootCls}\n role=\"toolbar\"\n aria-label={ariaLabel}\n style={style}\n >\n {items.map((item, i) => (\n <button\n key={item.value}\n type=\"button\"\n aria-label={item.ariaLabel}\n disabled={item.disabled}\n tabIndex={roving.tabIndexFor(i)}\n className={s.segment}\n onClick={() => fire(i)}\n onKeyDown={roving.onKeyDown(i)}\n >\n {item.label}\n </button>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;AAuCA,SAAgB,EAA+C,GAAyC;CACtG,IAAM,EAAE,UAAO,cAAW,cAAW,WAAQ,SAAM,eAAY,GAEzD,KAAQ,MAAkB;EAC9B,IAAM,IAAO,EAAM;AACf,IAAK,YACT,EAAK,UAAU;IAGX,IAAS,EAAkB;EAAE;EAAO,eAAe,EAAE;EAAS,YAAY;EAAM,CAAC,EAEjF,IAAmC,MAAW,KAAA,IAEhD,KAAA,IADC,EAAG,mBAA8B,GAAG,EAAO,KAAK,EAG/C,IAAU;EACd,EAAE;EACF,KAAQ,EAAE,QAAQ;EAClB,KAAW,EAAE,WAAW;EACxB;EACD,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;AAE3B,QACE,kBAAC,OAAD;EACE,KAAK,EAAO;EACZ,WAAW;EACX,MAAK;EACL,cAAY;EACL;YAEN,EAAM,KAAK,GAAM,MAChB,kBAAC,UAAD;GAEE,MAAK;GACL,cAAY,EAAK;GACjB,UAAU,EAAK;GACf,UAAU,EAAO,YAAY,EAAE;GAC/B,WAAW,EAAE;GACb,eAAe,EAAK,EAAE;GACtB,WAAW,EAAO,UAAU,EAAE;aAE7B,EAAK;GACC,EAVF,EAAK,MAUH,CACT;EACE,CAAA"}
|