@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
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/DragHandleGlyph/DragHandleGlyph.tsx
|
|
3
|
+
function n({ size: n = 16 }) {
|
|
4
|
+
return /* @__PURE__ */ t("svg", {
|
|
5
|
+
width: n * 8 / 16,
|
|
6
|
+
height: n,
|
|
7
|
+
viewBox: "0 0 8 16",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ e("circle", {
|
|
12
|
+
cx: "2",
|
|
13
|
+
cy: "3",
|
|
14
|
+
r: "1.1"
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ e("circle", {
|
|
17
|
+
cx: "6",
|
|
18
|
+
cy: "3",
|
|
19
|
+
r: "1.1"
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ e("circle", {
|
|
22
|
+
cx: "2",
|
|
23
|
+
cy: "8",
|
|
24
|
+
r: "1.1"
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ e("circle", {
|
|
27
|
+
cx: "6",
|
|
28
|
+
cy: "8",
|
|
29
|
+
r: "1.1"
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ e("circle", {
|
|
32
|
+
cx: "2",
|
|
33
|
+
cy: "13",
|
|
34
|
+
r: "1.1"
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ e("circle", {
|
|
37
|
+
cx: "6",
|
|
38
|
+
cy: "13",
|
|
39
|
+
r: "1.1"
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { n as t };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=DragHandleGlyph-CJbzRigu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragHandleGlyph-CJbzRigu.js","names":[],"sources":["../../src/components/DragHandleGlyph/DragHandleGlyph.tsx"],"sourcesContent":["/** Props for `<DragHandleGlyph>`. */\nexport interface DragHandleGlyphProps {\n /** Height in px; width scales with it. Default 16. */\n size?: number;\n}\n\n/** The two-column dot grip used on anything draggable by a handle.\n *\n * Deliberately not part of the icon register: that register is outline strokes\n * at a fixed weight, and a grip is filled dots. Forcing it in would either\n * break the register's rule or produce a worse glyph. */\nexport function DragHandleGlyph({ size = 16 }: DragHandleGlyphProps) {\n return (\n <svg\n width={(size * 8) / 16}\n height={size}\n viewBox=\"0 0 8 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <circle cx=\"2\" cy=\"3\" r=\"1.1\" />\n <circle cx=\"6\" cy=\"3\" r=\"1.1\" />\n <circle cx=\"2\" cy=\"8\" r=\"1.1\" />\n <circle cx=\"6\" cy=\"8\" r=\"1.1\" />\n <circle cx=\"2\" cy=\"13\" r=\"1.1\" />\n <circle cx=\"6\" cy=\"13\" r=\"1.1\" />\n </svg>\n );\n}\n"],"mappings":";;AAWA,SAAgB,EAAgB,EAAE,UAAO,MAA4B;AACnE,QACE,kBAAC,OAAD;EACE,OAAQ,IAAO,IAAK;EACpB,QAAQ;EACR,SAAQ;EACR,MAAK;EACL,eAAY;YALd;GAOE,kBAAC,UAAD;IAAQ,IAAG;IAAI,IAAG;IAAI,GAAE;IAAQ,CAAA;GAChC,kBAAC,UAAD;IAAQ,IAAG;IAAI,IAAG;IAAI,GAAE;IAAQ,CAAA;GAChC,kBAAC,UAAD;IAAQ,IAAG;IAAI,IAAG;IAAI,GAAE;IAAQ,CAAA;GAChC,kBAAC,UAAD;IAAQ,IAAG;IAAI,IAAG;IAAI,GAAE;IAAQ,CAAA;GAChC,kBAAC,UAAD;IAAQ,IAAG;IAAI,IAAG;IAAK,GAAE;IAAQ,CAAA;GACjC,kBAAC,UAAD;IAAQ,IAAG;IAAI,IAAG;IAAK,GAAE;IAAQ,CAAA;GAC7B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
var t = {
|
|
3
|
-
field: "
|
|
4
|
-
label: "
|
|
5
|
-
hint: "
|
|
6
|
-
error: "
|
|
7
|
-
row: "
|
|
3
|
+
field: "_field_do2o0_1",
|
|
4
|
+
label: "_label_do2o0_9",
|
|
5
|
+
hint: "_hint_do2o0_16",
|
|
6
|
+
error: "_error_do2o0_22",
|
|
7
|
+
row: "_row_do2o0_28"
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/components/Field/Field.tsx
|
|
@@ -28,4 +28,4 @@ var r = {
|
|
|
28
28
|
//#endregion
|
|
29
29
|
export { r as n, n as t };
|
|
30
30
|
|
|
31
|
-
//# sourceMappingURL=Field-
|
|
31
|
+
//# sourceMappingURL=Field-DrRby9vo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field-DrRby9vo.js","names":[],"sources":["../../src/components/Field/Field.module.css","../../src/components/Field/Field.tsx"],"sourcesContent":[".field {\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-family: var(--wzl-font-ui);\n color: var(--wzl-fg);\n}\n\n.label {\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-medium);\n color: var(--wzl-fg);\n cursor: default;\n}\n\n.hint {\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-subtle);\n line-height: 1.4;\n}\n\n.error {\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-danger);\n line-height: 1.4;\n}\n\n.row {\n flex-direction: row;\n align-items: center;\n gap: 8px;\n}\n\n.row .label {\n flex: 1;\n min-width: 0;\n}\n","import type { ReactNode } from 'react';\nimport s from './Field.module.css';\n\n/**\n * Whether a {@link Field} stacks its label above the control or sits them\n * side by side.\n */\nexport type FieldOrientation = 'stacked' | 'row';\n\n/** Props for {@link Field}. */\nexport type FieldProps = {\n orientation?: FieldOrientation;\n className?: string;\n children?: ReactNode;\n};\n\n/**\n * Layout primitive that arranges a label, control, hint, and error in the\n * canonical weasel-ui form-row shape. The control itself owns its semantics\n * (RAC `TextField`, `Checkbox`, etc.); this just paints the layout.\n *\n * Most users will instead reach for `Input` / `Checkbox` / `Switch`, which\n * compose Field internally. Use Field directly when you need a custom\n * control to sit in the same visual rhythm.\n */\nexport function Field({ orientation = 'stacked', className, children }: FieldProps) {\n const cls = [s.field, orientation === 'row' && s.row, className].filter(Boolean).join(' ');\n return <div className={cls}>{children}</div>;\n}\n\n/**\n * The class names {@link Field} paints its slots with, so a control composing\n * its own layout can match the same form-row rhythm.\n */\nexport const fieldClasses = {\n root: s.field,\n row: s.row,\n label: s.label,\n hint: s.hint,\n error: s.error,\n};\n"],"mappings":";;;;;;;;;;ACyBA,SAAgB,EAAM,EAAE,iBAAc,WAAW,cAAW,eAAwB;AAElF,QAAO,kBAAC,OAAD;EAAK,WADA;GAAC,EAAE;GAAO,MAAgB,SAAS,EAAE;GAAK;GAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAC/D;EAAM;EAAe,CAAA;;AAO9C,IAAa,IAAe;CAC1B,MAAM,EAAE;CACR,KAAK,EAAE;CACP,OAAO,EAAE;CACT,MAAM,EAAE;CACR,OAAO,EAAE;CACV"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { t as e } from "./Slider-DbOt9Dji.js";
|
|
2
|
+
import { t } from "./ToggleBar-1wDRwSGN.js";
|
|
3
|
+
import { t as n } from "./ColorField-CSSRv3jG.js";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { fillInPoseFrame as o, fillToBoundsFrame as s, gradientGeometry as c, isGradientFill as l, sampleGradientStops as u, useActionsRegistry as d, useHandleDrag as f, useNodeOverlayFrame as p, withGradientKind as m } from "@weasel-js/core";
|
|
6
|
+
import { useCallback as h, useRef as g } from "react";
|
|
7
|
+
//#region src/paintGradientTrack.tsx
|
|
8
|
+
var _ = {
|
|
9
|
+
angleDeg: 135,
|
|
10
|
+
stripe: 2,
|
|
11
|
+
gap: 4,
|
|
12
|
+
dim: 75
|
|
13
|
+
};
|
|
14
|
+
function v(e) {
|
|
15
|
+
let { gradient: t, samples: n = 16, activeRange: r, hatch: a } = e;
|
|
16
|
+
return (e) => {
|
|
17
|
+
let o = [];
|
|
18
|
+
for (let e = 0; e <= n; e++) {
|
|
19
|
+
let r = e / n;
|
|
20
|
+
o.push(`${t(r)} ${(r * 100).toFixed(1)}%`);
|
|
21
|
+
}
|
|
22
|
+
let s = `linear-gradient(to right, ${o.join(", ")})`, c = [];
|
|
23
|
+
if (r) {
|
|
24
|
+
let t = e.valueToFraction(r[0]) * 100, n = e.valueToFraction(r[1]) * 100, i = {
|
|
25
|
+
..._,
|
|
26
|
+
...a
|
|
27
|
+
}, o = `repeating-linear-gradient(${i.angleDeg}deg, transparent 0 ${i.stripe}px, var(--wzl-surface) ${i.stripe}px ${i.stripe + i.gap}px)`, s = `color-mix(in srgb, var(--wzl-surface) ${i.dim}%, transparent)`, l = `linear-gradient(${s}, ${s})`;
|
|
28
|
+
if (t > 0 && (c.push(`${l} left 0 / ${t.toFixed(2)}% 100% no-repeat`), c.push(`${o} left 0 / ${t.toFixed(2)}% 100% no-repeat`)), n < 100) {
|
|
29
|
+
let e = (100 - n).toFixed(2);
|
|
30
|
+
c.push(`${l} right 0 / ${e}% 100% no-repeat`), c.push(`${o} right 0 / ${e}% 100% no-repeat`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return c.push(s), /* @__PURE__ */ i("div", { style: {
|
|
34
|
+
position: "absolute",
|
|
35
|
+
inset: 0,
|
|
36
|
+
background: c.join(", ")
|
|
37
|
+
} });
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
var y = {
|
|
41
|
+
root: "_root_15yko_1",
|
|
42
|
+
swatches: "_swatches_15yko_8",
|
|
43
|
+
swatch: "_swatch_15yko_8"
|
|
44
|
+
}, b = [
|
|
45
|
+
{
|
|
46
|
+
value: "linear-gradient",
|
|
47
|
+
label: "Linear"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "radial-gradient",
|
|
51
|
+
label: "Radial"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: "conic-gradient",
|
|
55
|
+
label: "Conic"
|
|
56
|
+
}
|
|
57
|
+
], x = 2;
|
|
58
|
+
function S(r) {
|
|
59
|
+
let { value: o, onInput: s, onChange: c, kindSwitch: l = !0, className: d } = r, f = o.stops, p = h((e) => ({
|
|
60
|
+
...o,
|
|
61
|
+
stops: e
|
|
62
|
+
}), [o]), g = f.map((e) => ({
|
|
63
|
+
value: e.offset,
|
|
64
|
+
color: e.color
|
|
65
|
+
})), _ = (e) => e.map((e) => ({
|
|
66
|
+
offset: e.value,
|
|
67
|
+
color: e.color
|
|
68
|
+
})), S = (e, t) => f.map((n, r) => r === e ? {
|
|
69
|
+
...n,
|
|
70
|
+
color: t
|
|
71
|
+
} : n), C = f.map((e, t) => ({
|
|
72
|
+
stop: e,
|
|
73
|
+
index: t
|
|
74
|
+
})).sort((e, t) => e.stop.offset - t.stop.offset);
|
|
75
|
+
return /* @__PURE__ */ a("div", {
|
|
76
|
+
className: [y.root, d].filter(Boolean).join(" "),
|
|
77
|
+
children: [
|
|
78
|
+
l && /* @__PURE__ */ i(t, {
|
|
79
|
+
items: b,
|
|
80
|
+
value: o.fill,
|
|
81
|
+
size: "sm",
|
|
82
|
+
ariaLabel: "Gradient kind",
|
|
83
|
+
onChange: (e) => e && c(m(o, e))
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ i(e, {
|
|
86
|
+
min: 0,
|
|
87
|
+
max: 1,
|
|
88
|
+
step: .005,
|
|
89
|
+
constraint: "free",
|
|
90
|
+
thumbs: g,
|
|
91
|
+
ariaLabel: "Gradient stops",
|
|
92
|
+
readoutPlacement: "none",
|
|
93
|
+
onInput: (e) => s?.(p(_(e))),
|
|
94
|
+
onChange: (e) => c(p(_(e))),
|
|
95
|
+
onAddThumb: (e) => ({
|
|
96
|
+
value: e,
|
|
97
|
+
color: u(f, e)
|
|
98
|
+
}),
|
|
99
|
+
onRemoveThumb: () => f.length > x,
|
|
100
|
+
renderTrack: v({
|
|
101
|
+
gradient: (e) => u(f, e),
|
|
102
|
+
samples: 32
|
|
103
|
+
})
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ i("div", {
|
|
106
|
+
className: y.swatches,
|
|
107
|
+
children: C.map(({ stop: e, index: t }) => /* @__PURE__ */ i(n, {
|
|
108
|
+
value: e.color,
|
|
109
|
+
alpha: !0,
|
|
110
|
+
"aria-label": `Stop ${t + 1} at ${Math.round(e.offset * 100)}%`,
|
|
111
|
+
className: y.swatch,
|
|
112
|
+
onInput: (e) => s?.(p(S(t, e))),
|
|
113
|
+
onChange: (e) => c(p(S(t, e)))
|
|
114
|
+
}, t))
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
var C = {
|
|
120
|
+
overlay: "_overlay_6yu3h_3",
|
|
121
|
+
guide: "_guide_6yu3h_13",
|
|
122
|
+
handle: "_handle_6yu3h_21"
|
|
123
|
+
};
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/components/GradientEditor/GradientHandles.tsx
|
|
126
|
+
function w(e) {
|
|
127
|
+
let { value: t, toScreen: n, toLocal: r, onInput: a, onChange: o, width: s, height: c, className: l } = e;
|
|
128
|
+
return /* @__PURE__ */ i("svg", {
|
|
129
|
+
className: [C.overlay, l].filter(Boolean).join(" "),
|
|
130
|
+
width: s,
|
|
131
|
+
height: c,
|
|
132
|
+
children: T(t, n, r, a, o)
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function T(e, t, n, o, s) {
|
|
136
|
+
let l = (e, t) => {
|
|
137
|
+
t === "input" ? o?.(e) : s(e);
|
|
138
|
+
};
|
|
139
|
+
if (e.fill === "linear-gradient") {
|
|
140
|
+
let o = t(e.from), s = t(e.to);
|
|
141
|
+
return /* @__PURE__ */ a(r, { children: [
|
|
142
|
+
/* @__PURE__ */ i(D, {
|
|
143
|
+
x1: o.x,
|
|
144
|
+
y1: o.y,
|
|
145
|
+
x2: s.x,
|
|
146
|
+
y2: s.y
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ i(O, {
|
|
149
|
+
at: o,
|
|
150
|
+
label: "Gradient start",
|
|
151
|
+
onDrag: (t, r) => l({
|
|
152
|
+
...e,
|
|
153
|
+
from: n(t)
|
|
154
|
+
}, r)
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ i(O, {
|
|
157
|
+
at: s,
|
|
158
|
+
label: "Gradient end",
|
|
159
|
+
onDrag: (t, r) => l({
|
|
160
|
+
...e,
|
|
161
|
+
to: n(t)
|
|
162
|
+
}, r)
|
|
163
|
+
})
|
|
164
|
+
] });
|
|
165
|
+
}
|
|
166
|
+
if (e.fill === "radial-gradient") {
|
|
167
|
+
let o = t(e.center), s = t({
|
|
168
|
+
x: e.center.x + e.radius,
|
|
169
|
+
y: e.center.y
|
|
170
|
+
}), c = Math.hypot(s.x - o.x, s.y - o.y);
|
|
171
|
+
return /* @__PURE__ */ a(r, { children: [
|
|
172
|
+
/* @__PURE__ */ i("circle", {
|
|
173
|
+
className: C.guide,
|
|
174
|
+
cx: o.x,
|
|
175
|
+
cy: o.y,
|
|
176
|
+
r: c
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ i(O, {
|
|
179
|
+
at: o,
|
|
180
|
+
label: "Gradient center",
|
|
181
|
+
onDrag: (t, r) => l({
|
|
182
|
+
...e,
|
|
183
|
+
center: n(t)
|
|
184
|
+
}, r)
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ i(O, {
|
|
187
|
+
at: s,
|
|
188
|
+
label: "Gradient radius",
|
|
189
|
+
onDrag: (t, r) => {
|
|
190
|
+
let i = n(t), a = Math.hypot(i.x - e.center.x, i.y - e.center.y);
|
|
191
|
+
l({
|
|
192
|
+
...e,
|
|
193
|
+
radius: Math.max(E, a)
|
|
194
|
+
}, r);
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
] });
|
|
198
|
+
}
|
|
199
|
+
let u = t(e.center), { radius: d } = c(e), f = t({
|
|
200
|
+
x: e.center.x + Math.cos(e.angle) * d,
|
|
201
|
+
y: e.center.y + Math.sin(e.angle) * d
|
|
202
|
+
});
|
|
203
|
+
return /* @__PURE__ */ a(r, { children: [
|
|
204
|
+
/* @__PURE__ */ i(D, {
|
|
205
|
+
x1: u.x,
|
|
206
|
+
y1: u.y,
|
|
207
|
+
x2: f.x,
|
|
208
|
+
y2: f.y
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ i(O, {
|
|
211
|
+
at: u,
|
|
212
|
+
label: "Gradient center",
|
|
213
|
+
onDrag: (t, r) => l({
|
|
214
|
+
...e,
|
|
215
|
+
center: n(t)
|
|
216
|
+
}, r)
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ i(O, {
|
|
219
|
+
at: f,
|
|
220
|
+
label: "Gradient angle",
|
|
221
|
+
onDrag: (t, r) => {
|
|
222
|
+
let i = n(t), a = Math.atan2(i.y - e.center.y, i.x - e.center.x);
|
|
223
|
+
l({
|
|
224
|
+
...e,
|
|
225
|
+
angle: a
|
|
226
|
+
}, r);
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
] });
|
|
230
|
+
}
|
|
231
|
+
var E = 1;
|
|
232
|
+
function D(e) {
|
|
233
|
+
return /* @__PURE__ */ i("line", {
|
|
234
|
+
className: C.guide,
|
|
235
|
+
...e
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
function O({ at: e, label: t, onDrag: n }) {
|
|
239
|
+
let r = g(null), a = g(e), o = f({
|
|
240
|
+
onStart: () => {
|
|
241
|
+
a.current = e, r.current = null;
|
|
242
|
+
},
|
|
243
|
+
onMove: (e) => {
|
|
244
|
+
r.current = e, n(e, "input");
|
|
245
|
+
},
|
|
246
|
+
onEnd: (e) => {
|
|
247
|
+
let t = r.current;
|
|
248
|
+
r.current = null, t !== null && (e.type === "pointercancel" ? n(a.current, "input") : n(t, "commit"));
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
return /* @__PURE__ */ i("circle", {
|
|
252
|
+
className: C.handle,
|
|
253
|
+
cx: e.x,
|
|
254
|
+
cy: e.y,
|
|
255
|
+
r: k,
|
|
256
|
+
role: "button",
|
|
257
|
+
"aria-label": t,
|
|
258
|
+
tabIndex: 0,
|
|
259
|
+
onKeyDown: (t) => {
|
|
260
|
+
let r = t.shiftKey ? A * 10 : A, i = 0, a = 0;
|
|
261
|
+
if (t.key === "ArrowLeft") i = -r;
|
|
262
|
+
else if (t.key === "ArrowRight") i = r;
|
|
263
|
+
else if (t.key === "ArrowUp") a = -r;
|
|
264
|
+
else if (t.key === "ArrowDown") a = r;
|
|
265
|
+
else return;
|
|
266
|
+
t.preventDefault();
|
|
267
|
+
let o = {
|
|
268
|
+
x: e.x + i,
|
|
269
|
+
y: e.y + a
|
|
270
|
+
};
|
|
271
|
+
n(o, "input"), n(o, "commit");
|
|
272
|
+
},
|
|
273
|
+
...o
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
var k = 7, A = 1;
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/components/GradientEditor/SceneGradientHandles.tsx
|
|
279
|
+
function j(e) {
|
|
280
|
+
let { scene: t, containerRef: n, nodeId: r, slot: a, view: c, className: l } = e, u = d(), f = p(t, n, r, { view: c }), m = g(null), h = f ? N(M(t, r, a)) : null;
|
|
281
|
+
if (!f || !h) return null;
|
|
282
|
+
let _ = (e, t) => {
|
|
283
|
+
let n = s(e, f.box), r = a === "fill" ? "setFill" : "setStroke";
|
|
284
|
+
m.current ? m.current.update({ paint: n }) : m.current = u?.begin(r, { paint: n }) ?? null, t === "commit" && m.current && (m.current.end("commit"), m.current = null);
|
|
285
|
+
};
|
|
286
|
+
return /* @__PURE__ */ i(w, {
|
|
287
|
+
value: o(h, f.box),
|
|
288
|
+
toScreen: f.toScreen,
|
|
289
|
+
toLocal: f.toLocal,
|
|
290
|
+
width: f.width,
|
|
291
|
+
height: f.height,
|
|
292
|
+
className: l,
|
|
293
|
+
onInput: (e) => _(e, "input"),
|
|
294
|
+
onChange: (e) => _(e, "commit")
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
function M(e, t, n) {
|
|
298
|
+
if (t == null) return;
|
|
299
|
+
let r = e.nodes.get(t)?.data;
|
|
300
|
+
if (r) return n === "fill" ? r.fill : r.stroke?.paint;
|
|
301
|
+
}
|
|
302
|
+
function N(e) {
|
|
303
|
+
return l(e) ? e : null;
|
|
304
|
+
}
|
|
305
|
+
//#endregion
|
|
306
|
+
export { v as i, w as n, S as r, j as t };
|
|
307
|
+
|
|
308
|
+
//# sourceMappingURL=GradientEditor-BuVR6pt-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GradientEditor-BuVR6pt-.js","names":[],"sources":["../../src/paintGradientTrack.tsx","../../src/components/GradientEditor/GradientEditor.module.css","../../src/components/GradientEditor/GradientEditor.tsx","../../src/components/GradientEditor/GradientHandles.module.css","../../src/components/GradientEditor/GradientHandles.tsx","../../src/components/GradientEditor/SceneGradientHandles.tsx"],"sourcesContent":["import type { ReactNode, CSSProperties } from 'react';\nimport type { TrackCtx } from './components/Slider';\n\n/**\n * Options for {@link paintGradientTrack}.\n *\n * `gradient` maps a normalized position along the track (0 to 1) to a CSS\n * color; `samples` is how many stops the resulting linear-gradient uses.\n * `activeRange`, given in the slider's own value units, keeps that span at\n * full strength and dims + hatches the rest.\n */\nexport type GradientTrackOpts = {\n gradient: (t: number) => string;\n samples?: number;\n activeRange?: [number, number];\n hatch?: {\n angleDeg?: number;\n stripe?: number;\n gap?: number;\n dim?: number;\n };\n};\n\nconst DEFAULT_HATCH = { angleDeg: 135, stripe: 2, gap: 4, dim: 75 };\n\n/**\n * Builds a `Slider` `renderTrack` function that paints the track as a\n * sampled color gradient, optionally dimming and hatching the portions\n * outside an active range.\n */\nexport function paintGradientTrack(opts: GradientTrackOpts): (ctx: TrackCtx) => ReactNode {\n const { gradient, samples = 16, activeRange, hatch } = opts;\n\n return (ctx: TrackCtx) => {\n const stops: string[] = [];\n for (let i = 0; i <= samples; i++) {\n const t = i / samples;\n stops.push(`${gradient(t)} ${(t * 100).toFixed(1)}%`);\n }\n const baseGradient = `linear-gradient(to right, ${stops.join(', ')})`;\n\n const layers: string[] = [];\n if (activeRange) {\n const lowPct = ctx.valueToFraction(activeRange[0]) * 100;\n const highPct = ctx.valueToFraction(activeRange[1]) * 100;\n const h = { ...DEFAULT_HATCH, ...hatch };\n const stripe = `repeating-linear-gradient(${h.angleDeg}deg, transparent 0 ${h.stripe}px, var(--wzl-surface) ${h.stripe}px ${h.stripe + h.gap}px)`;\n const dimColor = `color-mix(in srgb, var(--wzl-surface) ${h.dim}%, transparent)`;\n const dimOverlay = `linear-gradient(${dimColor}, ${dimColor})`;\n\n if (lowPct > 0) {\n layers.push(`${dimOverlay} left 0 / ${lowPct.toFixed(2)}% 100% no-repeat`);\n layers.push(`${stripe} left 0 / ${lowPct.toFixed(2)}% 100% no-repeat`);\n }\n if (highPct < 100) {\n const wR = (100 - highPct).toFixed(2);\n layers.push(`${dimOverlay} right 0 / ${wR}% 100% no-repeat`);\n layers.push(`${stripe} right 0 / ${wR}% 100% no-repeat`);\n }\n }\n layers.push(baseGradient);\n\n const style: CSSProperties = {\n position: 'absolute',\n inset: 0,\n background: layers.join(', '),\n };\n return <div style={style} />;\n };\n}\n",".root {\n display: flex;\n flex-direction: column;\n gap: 8px;\n min-inline-size: 0;\n}\n\n.swatches {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n/* Each stop's opacity slider would otherwise stretch the row to a width no\n * properties panel has; the chip stays legible, the slider yields. */\n.swatch {\n flex: 0 1 auto;\n min-inline-size: 0;\n}\n","import { useCallback, type ReactElement } from 'react';\nimport {\n sampleGradientStops,\n withGradientKind,\n type GradStop,\n type GradientFill,\n type GradientKind,\n} from '@weasel-js/core';\nimport { Slider, type Thumb } from '../Slider';\nimport { ColorField } from '../ColorField';\nimport { ToggleBar, type ToggleBarItem } from '../ToggleBar';\nimport { paintGradientTrack } from '../../paintGradientTrack';\nimport s from './GradientEditor.module.css';\n\nconst KINDS: readonly ToggleBarItem<GradientKind>[] = [\n { value: 'linear-gradient', label: 'Linear' },\n { value: 'radial-gradient', label: 'Radial' },\n { value: 'conic-gradient', label: 'Conic' },\n];\n\n/** Fewer than two stops is not a gradient any renderer can ramp between. */\nconst MIN_STOPS = 2;\n\n/**\n * Props for {@link GradientEditor}. `onInput` fires throughout a gesture and\n * `onChange` once at its end.\n */\nexport interface GradientEditorProps {\n /** The gradient being edited. */\n value: GradientFill;\n /**\n * Live value during a gesture — a stop drag, a color-picker scrub. Wire\n * it for preview; it fires many times per gesture and must not be\n * written to history.\n */\n onInput?: (next: GradientFill) => void;\n /** Committed value: one call per completed gesture. Pair with an\n * undoable write. */\n onChange: (next: GradientFill) => void;\n /** Show the linear / radial / conic switch. Default true; turn it off\n * when the surrounding UI already owns the kind. */\n kindSwitch?: boolean;\n className?: string;\n}\n\ntype StopThumb = Thumb & { color: string };\n\n/**\n * Editor for a gradient's kind and stop list.\n *\n * Geometry (`from`/`to`, `center`, `radius`, `angle`) is deliberately not\n * edited here — on a canvas that belongs on the artwork, via\n * `<GradientHandles>`. This component owns the parts with no spatial\n * meaning, so it composes into a properties panel at any width.\n *\n * Stops are addressed by their position in `value.stops`, which is never\n * reordered — dragging one stop past another leaves both indices alone, so\n * a drag can cross a neighbour without the two swapping under the pointer.\n * Rendering sorts a copy.\n */\nexport function GradientEditor(props: GradientEditorProps): ReactElement {\n const { value, onInput, onChange, kindSwitch = true, className } = props;\n const stops = value.stops;\n\n const withStops = useCallback(\n (next: GradStop[]): GradientFill => ({ ...value, stops: next }),\n [value],\n );\n\n const thumbs: StopThumb[] = stops.map((stop) => ({ value: stop.offset, color: stop.color }));\n\n const applyThumbs = (next: StopThumb[]): GradStop[] =>\n next.map((t) => ({ offset: t.value, color: t.color }));\n\n const setStopColor = (index: number, color: string): GradStop[] =>\n stops.map((stop, i) => (i === index ? { ...stop, color } : stop));\n\n // Sorted view for the swatch row, carrying each stop's real index so a\n // recolor writes back to the right entry.\n const ordered = stops\n .map((stop, index) => ({ stop, index }))\n .sort((a, b) => a.stop.offset - b.stop.offset);\n\n return (\n <div className={[s.root, className].filter(Boolean).join(' ')}>\n {kindSwitch && (\n <ToggleBar<GradientKind>\n items={KINDS}\n value={value.fill}\n size=\"sm\"\n ariaLabel=\"Gradient kind\"\n onChange={(kind) => kind && onChange(withGradientKind(value, kind))}\n />\n )}\n\n <Slider<StopThumb>\n min={0}\n max={1}\n step={0.005}\n constraint=\"free\"\n thumbs={thumbs}\n ariaLabel=\"Gradient stops\"\n readoutPlacement=\"none\"\n onInput={(next) => onInput?.(withStops(applyThumbs(next)))}\n onChange={(next) => onChange(withStops(applyThumbs(next)))}\n onAddThumb={(at) => ({ value: at, color: sampleGradientStops(stops, at) })}\n onRemoveThumb={() => stops.length > MIN_STOPS}\n renderTrack={paintGradientTrack({\n gradient: (t) => sampleGradientStops(stops, t),\n samples: 32,\n })}\n />\n\n <div className={s.swatches}>\n {ordered.map(({ stop, index }) => (\n <ColorField\n key={index}\n value={stop.color}\n alpha\n aria-label={`Stop ${index + 1} at ${Math.round(stop.offset * 100)}%`}\n className={s.swatch}\n onInput={(hex) => onInput?.(withStops(setStopColor(index, hex)))}\n onChange={(hex) => onChange(withStops(setStopColor(index, hex)))}\n />\n ))}\n </div>\n </div>\n );\n}\n","/* The overlay covers the canvas but must not intercept tool input; only the\n * handles opt back into hit-testing. */\n.overlay {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n/* These sit over artwork of unknown color, not over the app's own surface,\n * so they are deliberately not themed: a themed handle disappears against\n * whatever the user painted underneath. White-on-dark reads on anything,\n * which is why every editor draws handles this way. */\n.guide {\n fill: none;\n stroke: #ffffff;\n stroke-opacity: 0.7;\n stroke-dasharray: 4 4;\n paint-order: stroke;\n}\n\n.handle {\n fill: #ffffff;\n stroke: #222222;\n stroke-width: 2;\n cursor: grab;\n pointer-events: auto;\n}\n\n.handle:active {\n cursor: grabbing;\n}\n\n.handle:focus-visible {\n outline: 2px solid var(--wzl-accent, #4a9eff);\n outline-offset: 2px;\n}\n","import { useRef, type KeyboardEvent as ReactKeyboardEvent, type ReactElement, type ReactNode } from 'react';\nimport { useHandleDrag, gradientGeometry, type GradientFill } from '@weasel-js/core';\nimport s from './GradientHandles.module.css';\n\n/** Structural, and deliberately not exported — `Plot2D` and `CurveEditor`\n * each publish their own `Point`, and a third would only be ambiguous at\n * the package barrel. Consumers pass any `{ x, y }`. */\ninterface Point {\n x: number;\n y: number;\n}\n\n/**\n * Props for {@link GradientHandles}. `onInput` fires throughout a drag and\n * `onChange` once at its end.\n */\nexport interface GradientHandlesProps {\n /**\n * The gradient whose geometry these handles move, in a **resolved,\n * isotropic** frame — one where `radius` is a length in the same units as\n * `center.x` and a right angle is a right angle.\n *\n * A `units: 'bounds'` gradient is not such a frame: `x` and `y` are\n * fractions of two different lengths, so a circle there is an ellipse on\n * screen and polar math silently mixes scales. Resolve it first with\n * `fillInPoseFrame(fill, box)` and convert edits back with\n * `fillToBoundsFrame(next, box)`.\n */\n value: GradientFill;\n /**\n * Gradient space → overlay pixels. For a `units: 'local'` gradient this\n * is the node's local-to-screen transform; for `'world'`, the view.\n */\n toScreen: (p: Point) => Point;\n /** Overlay pixels → gradient space. Must invert `toScreen`. */\n toLocal: (p: Point) => Point;\n /** Live during a drag — wire for preview, do not write to history. */\n onInput?: (next: GradientFill) => void;\n /** Committed at drag end: one call per gesture. */\n onChange: (next: GradientFill) => void;\n /** Overlay size in CSS pixels. */\n width: number;\n height: number;\n className?: string;\n}\n\n/**\n * Direct-manipulation handles for a gradient's geometry, drawn as an SVG\n * overlay above a canvas: endpoints for linear, center and radius for\n * radial, center and angle arm for conic.\n *\n * Positioning is entirely the consumer's `toScreen` / `toLocal` — this\n * component never sees a view or a scene node, so the same handles serve a\n * node-local gradient, a world-space one, and a plain unzoomed preview.\n *\n * The overlay ignores pointer events except on the handles themselves, so\n * it can sit over live canvas content without swallowing tool input.\n */\nexport function GradientHandles(props: GradientHandlesProps): ReactElement {\n const { value, toScreen, toLocal, onInput, onChange, width, height, className } = props;\n\n return (\n <svg\n className={[s.overlay, className].filter(Boolean).join(' ')}\n width={width}\n height={height}\n >\n {renderForKind(value, toScreen, toLocal, onInput, onChange)}\n </svg>\n );\n}\n\nfunction renderForKind(\n value: GradientFill,\n toScreen: (p: Point) => Point,\n toLocal: (p: Point) => Point,\n onInput: ((next: GradientFill) => void) | undefined,\n onChange: (next: GradientFill) => void,\n): ReactNode {\n const emit = (next: GradientFill, phase: 'input' | 'commit'): void => {\n if (phase === 'input') onInput?.(next);\n else onChange(next);\n };\n\n if (value.fill === 'linear-gradient') {\n const from = toScreen(value.from);\n const to = toScreen(value.to);\n return (\n <>\n <Guide x1={from.x} y1={from.y} x2={to.x} y2={to.y} />\n <DragPoint\n at={from}\n label=\"Gradient start\"\n onDrag={(p, phase) => emit({ ...value, from: toLocal(p) }, phase)}\n />\n <DragPoint\n at={to}\n label=\"Gradient end\"\n onDrag={(p, phase) => emit({ ...value, to: toLocal(p) }, phase)}\n />\n </>\n );\n }\n\n if (value.fill === 'radial-gradient') {\n const center = toScreen(value.center);\n // The radius handle rides the +x axis of gradient space, so it stays on\n // the drawn circle under a rotated or anisotropic transform.\n const edge = toScreen({ x: value.center.x + value.radius, y: value.center.y });\n const screenRadius = Math.hypot(edge.x - center.x, edge.y - center.y);\n return (\n <>\n <circle className={s.guide} cx={center.x} cy={center.y} r={screenRadius} />\n <DragPoint\n at={center}\n label=\"Gradient center\"\n onDrag={(p, phase) => emit({ ...value, center: toLocal(p) }, phase)}\n />\n <DragPoint\n at={edge}\n label=\"Gradient radius\"\n onDrag={(p, phase) => {\n const local = toLocal(p);\n const radius = Math.hypot(local.x - value.center.x, local.y - value.center.y);\n emit({ ...value, radius: Math.max(MIN_RADIUS, radius) }, phase);\n }}\n />\n </>\n );\n }\n\n const center = toScreen(value.center);\n const { radius } = gradientGeometry(value);\n const tip = toScreen({\n x: value.center.x + Math.cos(value.angle) * radius,\n y: value.center.y + Math.sin(value.angle) * radius,\n });\n return (\n <>\n <Guide x1={center.x} y1={center.y} x2={tip.x} y2={tip.y} />\n <DragPoint\n at={center}\n label=\"Gradient center\"\n onDrag={(p, phase) => emit({ ...value, center: toLocal(p) }, phase)}\n />\n <DragPoint\n at={tip}\n label=\"Gradient angle\"\n onDrag={(p, phase) => {\n const local = toLocal(p);\n const angle = Math.atan2(local.y - value.center.y, local.x - value.center.x);\n emit({ ...value, angle }, phase);\n }}\n />\n </>\n );\n}\n\n/** A radius of zero divides by zero in the shader's `t`; keep it off the floor. */\nconst MIN_RADIUS = 1;\n\nfunction Guide(props: { x1: number; y1: number; x2: number; y2: number }): ReactElement {\n return <line className={s.guide} {...props} />;\n}\n\nfunction DragPoint({\n at,\n label,\n onDrag,\n}: {\n at: Point;\n label: string;\n onDrag: (p: Point, phase: 'input' | 'commit') => void;\n}): ReactElement {\n // `useHandleDrag` reports the pointer on move but not on end, so the last\n // position is held here to commit with. It stays null until the pointer\n // actually moves: a press that never moves must not write anything.\n const last = useRef<Point | null>(null);\n const start = useRef<Point>(at);\n const drag = useHandleDrag<SVGCircleElement>({\n onStart: () => {\n start.current = at;\n last.current = null;\n },\n onMove: (p) => {\n last.current = p;\n onDrag(p, 'input');\n },\n onEnd: (e) => {\n const moved = last.current;\n last.current = null;\n if (moved === null) return;\n // A canceled pointer is not an edit — put the live preview back where\n // the gesture started rather than committing where it was abandoned.\n if (e.type === 'pointercancel') onDrag(start.current, 'input');\n else onDrag(moved, 'commit');\n },\n });\n const onKeyDown = (e: ReactKeyboardEvent<SVGCircleElement>): void => {\n const amount = e.shiftKey ? KEY_STEP * 10 : KEY_STEP;\n let dx = 0;\n let dy = 0;\n if (e.key === 'ArrowLeft') dx = -amount;\n else if (e.key === 'ArrowRight') dx = amount;\n else if (e.key === 'ArrowUp') dy = -amount;\n else if (e.key === 'ArrowDown') dy = amount;\n else return;\n e.preventDefault();\n const next = { x: at.x + dx, y: at.y + dy };\n onDrag(next, 'input');\n onDrag(next, 'commit');\n };\n return (\n <circle\n className={s.handle}\n cx={at.x}\n cy={at.y}\n r={HANDLE_RADIUS}\n // Not `slider`: the handle carries a 2-D position, not one value, so\n // it has no `aria-valuenow` to honor the role's contract with.\n role=\"button\"\n aria-label={label}\n tabIndex={0}\n onKeyDown={onKeyDown}\n {...drag}\n />\n );\n}\n\nconst HANDLE_RADIUS = 7;\n\n/** One arrow-key step, in overlay pixels. */\nconst KEY_STEP = 1;\n","import { useRef, type ReactElement, type RefObject } from 'react';\nimport {\n fillInPoseFrame,\n fillToBoundsFrame,\n isGradientFill,\n useActionsRegistry,\n useNodeOverlayFrame,\n type FillStyle,\n type GradientFill,\n type RectPose,\n type Scene,\n type Stroke,\n type UiOngoingControl,\n type View,\n} from '@weasel-js/core';\nimport { GradientHandles } from './GradientHandles';\n\n/** The paint slots a node carries. Either may hold a gradient, and each has\n * its own action, so the overlay is told which one it is editing. */\nexport type PaintSlot = 'fill' | 'stroke';\n\n/** What `SceneGradientHandles` reads off a node. Every field is optional, so\n * any richer app data shape satisfies it. */\nexport interface PaintedNodeData {\n fill?: FillStyle | null;\n stroke?: Stroke | null;\n}\n\nexport interface SceneGradientHandlesProps<\n TData extends PaintedNodeData,\n TLayer extends string,\n TPose extends RectPose,\n> {\n scene: Scene<TData, TLayer, TPose>;\n /** The element the overlay is positioned in. Must be the canvas's own box,\n * or the handles land somewhere other than the paint. */\n containerRef: RefObject<HTMLElement | null>;\n /** The node whose paint is being edited — usually the lone selected id. */\n nodeId: string | null | undefined;\n /** Which of the node's two paints these handles move. */\n slot: PaintSlot;\n /** Current viewport; a thunk is re-read per projection. See\n * `useNodeOverlayFrame`. */\n view?: View | (() => View);\n className?: string;\n}\n\n/**\n * Scene-aware `GradientHandles`: on-canvas geometry handles for the gradient\n * in one node's `fill` or `stroke`, committed through the `setFill` /\n * `setStroke` actions as a single undo entry per drag.\n *\n * Renders nothing unless the targeted slot holds a gradient. The node stores\n * its gradient in `units: 'bounds'` — fractions of its own box, so the paint\n * survives pan, zoom and resize — which is not a frame polar math can work\n * in; the handles get it resolved onto the box and every edit is normalized\n * back on the way out.\n *\n * `slot` is a prop rather than state the kit keeps: an app that edits fill\n * and stroke separately already knows which one has focus.\n */\nexport function SceneGradientHandles<\n TData extends PaintedNodeData,\n TLayer extends string,\n TPose extends RectPose,\n>(props: SceneGradientHandlesProps<TData, TLayer, TPose>): ReactElement | null {\n const { scene, containerRef, nodeId, slot, view, className } = props;\n const actions = useActionsRegistry();\n const frame = useNodeOverlayFrame(scene, containerRef, nodeId, { view });\n const ctrlRef = useRef<UiOngoingControl | null>(null);\n\n const gradient = frame ? gradientInSlot(paintOf(scene, nodeId, slot)) : null;\n if (!frame || !gradient) return null;\n\n const dispatch = (next: GradientFill, phase: 'input' | 'commit'): void => {\n const paint = fillToBoundsFrame(next, frame.box);\n const id = slot === 'fill' ? 'setFill' : 'setStroke';\n if (!ctrlRef.current) ctrlRef.current = actions?.begin(id, { paint }) ?? null;\n else ctrlRef.current.update({ paint });\n if (phase === 'commit' && ctrlRef.current) {\n ctrlRef.current.end('commit');\n ctrlRef.current = null;\n }\n };\n\n return (\n <GradientHandles\n value={fillInPoseFrame(gradient, frame.box) as GradientFill}\n toScreen={frame.toScreen}\n toLocal={frame.toLocal}\n width={frame.width}\n height={frame.height}\n className={className}\n onInput={(next) => dispatch(next, 'input')}\n onChange={(next) => dispatch(next, 'commit')}\n />\n );\n}\n\nfunction paintOf<TData extends PaintedNodeData, TLayer extends string, TPose extends RectPose>(\n scene: Scene<TData, TLayer, TPose>,\n nodeId: string | null | undefined,\n slot: PaintSlot,\n): FillStyle | null | undefined {\n if (nodeId == null) return undefined;\n const data = (scene.nodes as ReadonlyMap<string, { data: TData }>).get(nodeId)?.data;\n if (!data) return undefined;\n return slot === 'fill' ? data.fill : data.stroke?.paint;\n}\n\nfunction gradientInSlot(paint: FillStyle | null | undefined): GradientFill | null {\n return isGradientFill(paint) ? paint : null;\n}\n"],"mappings":";;;;;;;AAuBA,IAAM,IAAgB;CAAE,UAAU;CAAK,QAAQ;CAAG,KAAK;CAAG,KAAK;CAAI;AAOnE,SAAgB,EAAmB,GAAuD;CACxF,IAAM,EAAE,aAAU,aAAU,IAAI,gBAAa,aAAU;AAEvD,SAAQ,MAAkB;EACxB,IAAM,IAAkB,EAAE;AAC1B,OAAK,IAAI,IAAI,GAAG,KAAK,GAAS,KAAK;GACjC,IAAM,IAAI,IAAI;AACd,KAAM,KAAK,GAAG,EAAS,EAAE,CAAC,IAAI,IAAI,KAAK,QAAQ,E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
|
+
//#endregion
|
|
5
|
+
//#region src/components/InlineRange/InlineRange.tsx
|
|
6
|
+
function n(n) {
|
|
7
|
+
let { value: r, min: i = 0, max: a = 100, className: o, style: s, ...c } = n, l = a - i, u = l > 0 ? (Math.min(Math.max(r, i), a) - i) / l * 100 : 0;
|
|
8
|
+
return /* @__PURE__ */ e("input", {
|
|
9
|
+
...c,
|
|
10
|
+
type: "range",
|
|
11
|
+
value: r,
|
|
12
|
+
min: i,
|
|
13
|
+
max: a,
|
|
14
|
+
className: [t.range, o].filter(Boolean).join(" "),
|
|
15
|
+
style: {
|
|
16
|
+
"--slider-fill": `${u}%`,
|
|
17
|
+
...s
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as t };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=InlineRange-B-Jkv8AA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineRange-B-Jkv8AA.js","names":[],"sources":["../../src/components/InlineRange/InlineRange.module.css","../../src/components/InlineRange/InlineRange.tsx"],"sourcesContent":["/* The track is painted here rather than left to `accent-color`. A UA fills\n the left of the track with the accent but draws the remainder near-white on\n a dark surface whatever `color-scheme` says, and overriding the track's\n background removes the accent fill instead of recolouring the remainder —\n so the whole track is ours. `--slider-fill` carries the value, since no\n static rule expresses \"filled to N%\". */\n.range {\n flex: 1;\n min-inline-size: 48px;\n appearance: none;\n -webkit-appearance: none;\n block-size: 4px;\n border-radius: var(--wzl-radius-pill);\n background: linear-gradient(\n to right,\n var(--wzl-accent) 0 var(--slider-fill, 0%),\n var(--wzl-border-strong) var(--slider-fill, 0%) 100%\n );\n cursor: pointer;\n}\n\n.range::-webkit-slider-thumb {\n appearance: none;\n -webkit-appearance: none;\n inline-size: 12px;\n block-size: 12px;\n border-radius: 50%;\n background: var(--wzl-accent);\n}\n\n.range::-moz-range-thumb {\n inline-size: 12px;\n block-size: 12px;\n border: none;\n border-radius: 50%;\n background: var(--wzl-accent);\n}\n\n.range:focus-visible {\n outline: 2px solid var(--wzl-accent);\n outline-offset: 2px;\n}\n\n.range:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n","import { type CSSProperties, type InputHTMLAttributes, type ReactElement } from 'react';\nimport s from './InlineRange.module.css';\n\n/** Props for {@link InlineRange} — a range input's, with `value` required. */\nexport type InlineRangeProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'type' | 'value' | 'min' | 'max'\n> & {\n value: number;\n min?: number;\n max?: number;\n};\n\n/**\n * Compact range input for a property row: one track, no label, no output.\n *\n * Distinct from the kit's other two — `Slider` is shaped for canvas scrubbing,\n * and `RangeSlider` is a full-width labelled form control on React Aria. This\n * one exists to sit inline beside a swatch or a readout, and to own the track\n * painting both of those surfaces need.\n */\nexport function InlineRange(props: InlineRangeProps): ReactElement {\n const { value, min = 0, max = 100, className, style, ...rest } = props;\n const span = max - min;\n const filled = span > 0 ? ((Math.min(Math.max(value, min), max) - min) / span) * 100 : 0;\n return (\n <input\n {...rest}\n type=\"range\"\n value={value}\n min={min}\n max={max}\n className={[s.range, className].filter(Boolean).join(' ')}\n style={{ ['--slider-fill' as string]: `${filled}%`, ...style } as CSSProperties}\n />\n );\n}\n"],"mappings":";;;;;ACqBA,SAAgB,EAAY,GAAuC;CACjE,IAAM,EAAE,UAAO,SAAM,GAAG,SAAM,KAAK,cAAW,UAAO,GAAG,MAAS,GAC3D,IAAO,IAAM,GACb,IAAS,IAAO,KAAM,KAAK,IAAI,KAAK,IAAI,GAAO,EAAI,EAAE,EAAI,GAAG,KAAO,IAAQ,MAAM;AACvF,QACE,kBAAC,SAAD;EACE,GAAI;EACJ,MAAK;EACE;EACF;EACA;EACL,WAAW,CAAC,EAAE,OAAO,EAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EACzD,OAAO;GAAG,iBAA4B,GAAG,EAAO;GAAI,GAAG;GAAO;EAC9D,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { n as e } from "./Field-DrRby9vo.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as r } from "react";
|
|
4
|
+
import { FieldError as i, Input as a, Label as o, Text as s, TextField as c } from "react-aria-components";
|
|
5
|
+
var l = {
|
|
6
|
+
field: "_field_zwx85_1",
|
|
7
|
+
frame: "_frame_zwx85_9",
|
|
8
|
+
adornment: "_adornment_zwx85_54"
|
|
9
|
+
}, u = r(function(r, u) {
|
|
10
|
+
let { label: d, description: f, errorMessage: p, placeholder: m, leadingAdornment: h, trailingAdornment: g, className: _, ...v } = r;
|
|
11
|
+
return /* @__PURE__ */ n(c, {
|
|
12
|
+
...v,
|
|
13
|
+
className: [
|
|
14
|
+
l.field,
|
|
15
|
+
e.root,
|
|
16
|
+
_
|
|
17
|
+
].filter(Boolean).join(" "),
|
|
18
|
+
children: [
|
|
19
|
+
d !== void 0 && /* @__PURE__ */ t(o, {
|
|
20
|
+
className: e.label,
|
|
21
|
+
children: d
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ n("div", {
|
|
24
|
+
className: l.frame,
|
|
25
|
+
children: [
|
|
26
|
+
h !== void 0 && /* @__PURE__ */ t("span", {
|
|
27
|
+
className: l.adornment,
|
|
28
|
+
children: h
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ t(a, {
|
|
31
|
+
ref: u,
|
|
32
|
+
placeholder: m
|
|
33
|
+
}),
|
|
34
|
+
g !== void 0 && /* @__PURE__ */ t("span", {
|
|
35
|
+
className: l.adornment,
|
|
36
|
+
children: g
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
}),
|
|
40
|
+
f !== void 0 && /* @__PURE__ */ t(s, {
|
|
41
|
+
slot: "description",
|
|
42
|
+
className: e.hint,
|
|
43
|
+
children: f
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ t(i, {
|
|
46
|
+
className: e.error,
|
|
47
|
+
children: p
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//#endregion
|
|
53
|
+
export { u as t };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=Input-BnxOPY4N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input-BnxOPY4N.js","names":[],"sources":["../../src/components/Input/Input.module.css","../../src/components/Input/Input.tsx"],"sourcesContent":[".field {\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 0;\n gap: 4px;\n}\n\n.frame {\n display: flex;\n align-items: center;\n gap: 6px;\n height: var(--wzl-control-h);\n padding: 0 8px;\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-ui);\n font-size: var(--wzl-font-size);\n line-height: 1;\n transition: border-color var(--wzl-motion-fast), box-shadow var(--wzl-motion-fast);\n}\n\n.frame:focus-within {\n border-color: var(--wzl-focus-ring);\n box-shadow: 0 0 0 1px var(--wzl-focus-ring);\n}\n\n.field[data-invalid] .frame {\n border-color: var(--wzl-danger);\n}\n\n.field[data-disabled] .frame {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.frame input {\n flex: 1;\n min-width: 0;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font: inherit;\n padding: 0;\n}\n\n.frame input::placeholder {\n color: var(--wzl-fg-subtle);\n}\n\n.adornment {\n display: inline-flex;\n align-items: center;\n color: var(--wzl-fg-subtle);\n font-size: var(--wzl-font-size-sm);\n pointer-events: none;\n}\n","import { forwardRef, type ReactNode, type Ref } from 'react';\nimport {\n TextField,\n Label,\n Input as RACInput,\n Text,\n FieldError,\n type TextFieldProps as RACTextFieldProps,\n type ValidationResult,\n} from 'react-aria-components';\nimport { fieldClasses } from '../Field/Field';\nimport s from './Input.module.css';\n\n/** Props for {@link Input}, on top of React Aria's `TextField` props. */\nexport type InputProps = Omit<RACTextFieldProps, 'children' | 'className'> & {\n label?: ReactNode;\n description?: ReactNode;\n errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);\n placeholder?: string;\n leadingAdornment?: ReactNode;\n trailingAdornment?: ReactNode;\n className?: string;\n};\n\n/**\n * Single-line text input wrapping React Aria's TextField. Supplies a\n * default skin against the `--wzl-*` token system, and exposes the\n * familiar label / description / errorMessage / adornment slot shape.\n *\n * `ref` forwards to the underlying `<input>`.\n */\nexport const Input = forwardRef(function Input(\n props: InputProps,\n ref: Ref<HTMLInputElement>,\n) {\n const {\n label,\n description,\n errorMessage,\n placeholder,\n leadingAdornment,\n trailingAdornment,\n className,\n ...textFieldProps\n } = props;\n\n return (\n <TextField {...textFieldProps} className={[s.field, fieldClasses.root, className].filter(Boolean).join(' ')}>\n {label !== undefined && <Label className={fieldClasses.label}>{label}</Label>}\n <div className={s.frame}>\n {leadingAdornment !== undefined && <span className={s.adornment}>{leadingAdornment}</span>}\n <RACInput ref={ref} placeholder={placeholder} />\n {trailingAdornment !== undefined && <span className={s.adornment}>{trailingAdornment}</span>}\n </div>\n {description !== undefined && (\n <Text slot=\"description\" className={fieldClasses.hint}>\n {description}\n </Text>\n )}\n <FieldError className={fieldClasses.error}>{errorMessage}</FieldError>\n </TextField>\n );\n});\n"],"mappings":";;;;;;;;GC+Ba,IAAQ,EAAW,SAC9B,GACA,GACA;CACA,IAAM,EACJ,UACA,gBACA,iBACA,gBACA,qBACA,sBACA,cACA,GAAG,MACD;AAEJ,QACE,kBAAC,GAAD;EAAW,GAAI;EAAgB,WAAW;GAAC,EAAE;GAAO,EAAa;GAAM;GAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;YAA3G;GACG,MAAU,KAAA,KAAa,kBAAC,GAAD;IAAO,WAAW,EAAa;cAAQ;IAAc,CAAA;GAC7E,kBAAC,OAAD;IAAK,WAAW,EAAE;cAAlB;KACG,MAAqB,KAAA,KAAa,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAY;MAAwB,CAAA;KAC1F,kBAAC,GAAD;MAAe;MAAkB;MAAe,CAAA;KAC/C,MAAsB,KAAA,KAAa,kBAAC,QAAD;MAAM,WAAW,EAAE;gBAAY;MAAyB,CAAA;KACxF;;GACL,MAAgB,KAAA,KACf,kBAAC,GAAD;IAAM,MAAK;IAAc,WAAW,EAAa;cAC9C;IACI,CAAA;GAET,kBAAC,GAAD;IAAY,WAAW,EAAa;cAAQ;IAA0B,CAAA;GAC5D;;EAEd"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as n } from "react";
|
|
3
3
|
var r = {
|
|
4
|
-
keys: "
|
|
5
|
-
keysEmpty: "
|
|
6
|
-
sep: "
|
|
7
|
-
key: "
|
|
4
|
+
keys: "_keys_1cdok_2",
|
|
5
|
+
keysEmpty: "_keysEmpty_1cdok_16",
|
|
6
|
+
sep: "_sep_1cdok_20",
|
|
7
|
+
key: "_key_1cdok_2"
|
|
8
8
|
}, i = new Set([
|
|
9
9
|
"⌘",
|
|
10
10
|
"⇪",
|
|
@@ -19,24 +19,24 @@ var r = {
|
|
|
19
19
|
function o(e) {
|
|
20
20
|
return i.has(e) ? "modifier" : a.has(e) || e.length > 1 ? "wide" : "square";
|
|
21
21
|
}
|
|
22
|
-
function s({ label:
|
|
22
|
+
function s({ label: t, inverted: n = !1, variant: i = "default", className: a, style: s, font: c }) {
|
|
23
23
|
let l = c ? {
|
|
24
24
|
...s,
|
|
25
25
|
fontFamily: c
|
|
26
26
|
} : s;
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ e("kbd", {
|
|
28
28
|
className: [r.key, a].filter(Boolean).join(" "),
|
|
29
|
-
"data-kind": o(
|
|
29
|
+
"data-kind": o(t),
|
|
30
30
|
"data-variant": i === "default" ? void 0 : i,
|
|
31
31
|
"data-inverted": n || void 0,
|
|
32
32
|
style: l,
|
|
33
|
-
children:
|
|
33
|
+
children: t
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/components/Keycaps/Keycaps.tsx
|
|
38
38
|
function c({ keys: i, separator: a = "+", variant: c = "default", font: l, className: u }) {
|
|
39
|
-
if (!i || i.length === 0) return /* @__PURE__ */
|
|
39
|
+
if (!i || i.length === 0) return /* @__PURE__ */ e("span", {
|
|
40
40
|
className: [r.keysEmpty, u].filter(Boolean).join(" "),
|
|
41
41
|
children: "—"
|
|
42
42
|
});
|
|
@@ -44,12 +44,12 @@ function c({ keys: i, separator: a = "+", variant: c = "default", font: l, class
|
|
|
44
44
|
k: e,
|
|
45
45
|
i: t
|
|
46
46
|
})).sort((e, t) => (o(e.k.label) === "modifier" ? 0 : 1) - (o(t.k.label) === "modifier" ? 0 : 1) || e.i - t.i).map(({ k: e }) => e), f = d.findIndex((e) => o(e.label) !== "modifier"), p = !!a && f > 0 && f < d.length;
|
|
47
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ e("span", {
|
|
48
48
|
className: [r.keys, u].filter(Boolean).join(" "),
|
|
49
|
-
children: d.map((i, o) => /* @__PURE__ */ n
|
|
49
|
+
children: d.map((i, o) => /* @__PURE__ */ t(n, { children: [p && o === f ? /* @__PURE__ */ e("span", {
|
|
50
50
|
className: r.sep,
|
|
51
51
|
children: a
|
|
52
|
-
}) : null, /* @__PURE__ */
|
|
52
|
+
}) : null, /* @__PURE__ */ e(s, {
|
|
53
53
|
label: i.label,
|
|
54
54
|
inverted: i.optional ?? !1,
|
|
55
55
|
variant: c,
|
|
@@ -394,4 +394,4 @@ function p(e, t = {}) {
|
|
|
394
394
|
//#endregion
|
|
395
395
|
export { s as a, c as i, p as n, o, d as r, u as t };
|
|
396
396
|
|
|
397
|
-
//# sourceMappingURL=Keycaps-
|
|
397
|
+
//# sourceMappingURL=Keycaps-Dk33JOiH.js.map
|