@weasel-js/ui 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/color/oklch.d.ts +14 -0
- package/dist/color/oklch.d.ts.map +1 -0
- package/dist/components/ActionBar/ActionBar.d.ts +36 -0
- package/dist/components/ActionBar/ActionBar.d.ts.map +1 -0
- package/dist/components/ActionBar/index.d.ts +3 -0
- package/dist/components/ActionBar/index.d.ts.map +1 -0
- package/dist/components/ActionsBar/ActionsBar.d.ts +20 -0
- package/dist/components/ActionsBar/ActionsBar.d.ts.map +1 -0
- package/dist/components/ActionsBar/index.d.ts +3 -0
- package/dist/components/ActionsBar/index.d.ts.map +1 -0
- package/dist/components/Badge/Badge.d.ts +50 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/bases/ChamferedRect.d.ts +8 -0
- package/dist/components/Badge/bases/ChamferedRect.d.ts.map +1 -0
- package/dist/components/Badge/bases/OctantBSpline.d.ts +71 -0
- package/dist/components/Badge/bases/OctantBSpline.d.ts.map +1 -0
- package/dist/components/Badge/bases/OctantSpline.d.ts +79 -0
- package/dist/components/Badge/bases/OctantSpline.d.ts.map +1 -0
- package/dist/components/Badge/bases/Polygon.d.ts +8 -0
- package/dist/components/Badge/bases/Polygon.d.ts.map +1 -0
- package/dist/components/Badge/bases/Powerline.d.ts +13 -0
- package/dist/components/Badge/bases/Powerline.d.ts.map +1 -0
- package/dist/components/Badge/bases/Puzzle.d.ts +15 -0
- package/dist/components/Badge/bases/Puzzle.d.ts.map +1 -0
- package/dist/components/Badge/bases/Quatrefoil.d.ts +46 -0
- package/dist/components/Badge/bases/Quatrefoil.d.ts.map +1 -0
- package/dist/components/Badge/bases/Ribbon.d.ts +12 -0
- package/dist/components/Badge/bases/Ribbon.d.ts.map +1 -0
- package/dist/components/Badge/bases/RoundedRect.d.ts +14 -0
- package/dist/components/Badge/bases/RoundedRect.d.ts.map +1 -0
- package/dist/components/Badge/bases/edgeProfiles.d.ts +6 -0
- package/dist/components/Badge/bases/edgeProfiles.d.ts.map +1 -0
- package/dist/components/Badge/bases/index.d.ts +24 -0
- package/dist/components/Badge/bases/index.d.ts.map +1 -0
- package/dist/components/Badge/bases/polygonSampler.d.ts +4 -0
- package/dist/components/Badge/bases/polygonSampler.d.ts.map +1 -0
- package/dist/components/Badge/bases/types.d.ts +69 -0
- package/dist/components/Badge/bases/types.d.ts.map +1 -0
- package/dist/components/Badge/effects/Aqua.d.ts +49 -0
- package/dist/components/Badge/effects/Aqua.d.ts.map +1 -0
- package/dist/components/Badge/effects/Bevel.d.ts +11 -0
- package/dist/components/Badge/effects/Bevel.d.ts.map +1 -0
- package/dist/components/Badge/effects/Bevel2.d.ts +11 -0
- package/dist/components/Badge/effects/Bevel2.d.ts.map +1 -0
- package/dist/components/Badge/effects/Bites.d.ts +10 -0
- package/dist/components/Badge/effects/Bites.d.ts.map +1 -0
- package/dist/components/Badge/effects/Metal.d.ts +41 -0
- package/dist/components/Badge/effects/Metal.d.ts.map +1 -0
- package/dist/components/Badge/effects/Outline.d.ts +17 -0
- package/dist/components/Badge/effects/Outline.d.ts.map +1 -0
- package/dist/components/Badge/effects/Perforations.d.ts +11 -0
- package/dist/components/Badge/effects/Perforations.d.ts.map +1 -0
- package/dist/components/Badge/effects/Puffs.d.ts +10 -0
- package/dist/components/Badge/effects/Puffs.d.ts.map +1 -0
- package/dist/components/Badge/effects/Rivets.d.ts +13 -0
- package/dist/components/Badge/effects/Rivets.d.ts.map +1 -0
- package/dist/components/Badge/effects/Scallops.d.ts +10 -0
- package/dist/components/Badge/effects/Scallops.d.ts.map +1 -0
- package/dist/components/Badge/effects/Shadow.d.ts +11 -0
- package/dist/components/Badge/effects/Shadow.d.ts.map +1 -0
- package/dist/components/Badge/effects/Sheen.d.ts +10 -0
- package/dist/components/Badge/effects/Sheen.d.ts.map +1 -0
- package/dist/components/Badge/effects/Spikes.d.ts +20 -0
- package/dist/components/Badge/effects/Spikes.d.ts.map +1 -0
- package/dist/components/Badge/effects/Sunbeams.d.ts +29 -0
- package/dist/components/Badge/effects/Sunbeams.d.ts.map +1 -0
- package/dist/components/Badge/effects/Woodgrain.d.ts +12 -0
- package/dist/components/Badge/effects/Woodgrain.d.ts.map +1 -0
- package/dist/components/Badge/effects/index.d.ts +40 -0
- package/dist/components/Badge/effects/index.d.ts.map +1 -0
- package/dist/components/Badge/effects/rangeMask.d.ts +13 -0
- package/dist/components/Badge/effects/rangeMask.d.ts.map +1 -0
- package/dist/components/Badge/index.d.ts +4 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Badge/shapeControls.d.ts +29 -0
- package/dist/components/Badge/shapeControls.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Beavis.d.ts +11 -0
- package/dist/components/Badge/shapes/Beavis.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Cloud.d.ts +11 -0
- package/dist/components/Badge/shapes/Cloud.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Coffin.d.ts +12 -0
- package/dist/components/Badge/shapes/Coffin.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Crest.d.ts +8 -0
- package/dist/components/Badge/shapes/Crest.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Hexagon.d.ts +10 -0
- package/dist/components/Badge/shapes/Hexagon.d.ts.map +1 -0
- package/dist/components/Badge/shapes/House.d.ts +9 -0
- package/dist/components/Badge/shapes/House.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Notched.d.ts +10 -0
- package/dist/components/Badge/shapes/Notched.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Perforated.d.ts +8 -0
- package/dist/components/Badge/shapes/Perforated.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Pill.d.ts +4 -0
- package/dist/components/Badge/shapes/Pill.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Plain.d.ts +4 -0
- package/dist/components/Badge/shapes/Plain.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Plaque.d.ts +12 -0
- package/dist/components/Badge/shapes/Plaque.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Postage.d.ts +9 -0
- package/dist/components/Badge/shapes/Postage.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Quatrefoil.d.ts +19 -0
- package/dist/components/Badge/shapes/Quatrefoil.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Receipt.d.ts +9 -0
- package/dist/components/Badge/shapes/Receipt.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Ribbon.d.ts +13 -0
- package/dist/components/Badge/shapes/Ribbon.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Scalloped.d.ts +9 -0
- package/dist/components/Badge/shapes/Scalloped.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Shield.d.ts +11 -0
- package/dist/components/Badge/shapes/Shield.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Sparkler.d.ts +10 -0
- package/dist/components/Badge/shapes/Sparkler.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Square.d.ts +8 -0
- package/dist/components/Badge/shapes/Square.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Starburst.d.ts +11 -0
- package/dist/components/Badge/shapes/Starburst.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Urn.d.ts +4 -0
- package/dist/components/Badge/shapes/Urn.d.ts.map +1 -0
- package/dist/components/Badge/shapes/Wood.d.ts +4 -0
- package/dist/components/Badge/shapes/Wood.d.ts.map +1 -0
- package/dist/components/Badge/shapes/index.d.ts +46 -0
- package/dist/components/Badge/shapes/index.d.ts.map +1 -0
- package/dist/components/Badge/types.d.ts +39 -0
- package/dist/components/Badge/types.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +29 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Callout/Callout.d.ts +67 -0
- package/dist/components/Callout/Callout.d.ts.map +1 -0
- package/dist/components/Callout/index.d.ts +3 -0
- package/dist/components/Callout/index.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +15 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/ColorField/ColorField.d.ts +28 -0
- package/dist/components/ColorField/ColorField.d.ts.map +1 -0
- package/dist/components/ColorField/index.d.ts +2 -0
- package/dist/components/ColorField/index.d.ts.map +1 -0
- package/dist/components/ComboBox/ComboBox.d.ts +36 -0
- package/dist/components/ComboBox/ComboBox.d.ts.map +1 -0
- package/dist/components/ComboBox/index.d.ts +3 -0
- package/dist/components/ComboBox/index.d.ts.map +1 -0
- package/dist/components/CurveEditor/CurveEditor.d.ts +41 -0
- package/dist/components/CurveEditor/CurveEditor.d.ts.map +1 -0
- package/dist/components/CurveEditor/LayeredCurveEditor.d.ts +40 -0
- package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -0
- package/dist/components/CurveEditor/catmullRom.d.ts +35 -0
- package/dist/components/CurveEditor/catmullRom.d.ts.map +1 -0
- package/dist/components/CurveEditor/createFunctionLayer.d.ts +72 -0
- package/dist/components/CurveEditor/createFunctionLayer.d.ts.map +1 -0
- package/dist/components/CurveEditor/hitTest.d.ts +29 -0
- package/dist/components/CurveEditor/hitTest.d.ts.map +1 -0
- package/dist/components/CurveEditor/index.d.ts +7 -0
- package/dist/components/CurveEditor/index.d.ts.map +1 -0
- package/dist/components/CurveEditor/interpolation.d.ts +15 -0
- package/dist/components/CurveEditor/interpolation.d.ts.map +1 -0
- package/dist/components/CurveEditor/layerTypes.d.ts +103 -0
- package/dist/components/CurveEditor/layerTypes.d.ts.map +1 -0
- package/dist/components/CurveEditor/monotone.d.ts +25 -0
- package/dist/components/CurveEditor/monotone.d.ts.map +1 -0
- package/dist/components/CurveEditor/setCurveOp.d.ts +35 -0
- package/dist/components/CurveEditor/setCurveOp.d.ts.map +1 -0
- package/dist/components/DataGrid/DataGrid.d.ts +34 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -0
- package/dist/components/DataGrid/index.d.ts +3 -0
- package/dist/components/DataGrid/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +29 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/index.d.ts +3 -0
- package/dist/components/Dialog/index.d.ts.map +1 -0
- package/dist/components/Field/Field.d.ts +25 -0
- package/dist/components/Field/Field.d.ts.map +1 -0
- package/dist/components/Field/index.d.ts +3 -0
- package/dist/components/Field/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +28 -0
- package/dist/components/Input/Input.d.ts.map +1 -0
- package/dist/components/Input/index.d.ts +3 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Keycaps/Keycap.d.ts +34 -0
- package/dist/components/Keycaps/Keycap.d.ts.map +1 -0
- package/dist/components/Keycaps/Keycaps.d.ts +29 -0
- package/dist/components/Keycaps/Keycaps.d.ts.map +1 -0
- package/dist/components/Keycaps/index.d.ts +8 -0
- package/dist/components/Keycaps/index.d.ts.map +1 -0
- package/dist/components/Keycaps/keyGlyph.d.ts +7 -0
- package/dist/components/Keycaps/keyGlyph.d.ts.map +1 -0
- package/dist/components/Keycaps/keySpecsFromMods.d.ts +81 -0
- package/dist/components/Keycaps/keySpecsFromMods.d.ts.map +1 -0
- package/dist/components/NumberField/NumberField.d.ts +25 -0
- package/dist/components/NumberField/NumberField.d.ts.map +1 -0
- package/dist/components/NumberField/index.d.ts +3 -0
- package/dist/components/NumberField/index.d.ts.map +1 -0
- package/dist/components/OptionsBar/OptionsBar.d.ts +25 -0
- package/dist/components/OptionsBar/OptionsBar.d.ts.map +1 -0
- package/dist/components/OptionsBar/index.d.ts +3 -0
- package/dist/components/OptionsBar/index.d.ts.map +1 -0
- package/dist/components/Plot2D/Plot2D.d.ts +60 -0
- package/dist/components/Plot2D/Plot2D.d.ts.map +1 -0
- package/dist/components/Plot2D/geometry.d.ts +24 -0
- package/dist/components/Plot2D/geometry.d.ts.map +1 -0
- package/dist/components/Plot2D/index.d.ts +3 -0
- package/dist/components/Plot2D/index.d.ts.map +1 -0
- package/dist/components/PointPlotter/PointPlotter.d.ts +51 -0
- package/dist/components/PointPlotter/PointPlotter.d.ts.map +1 -0
- package/dist/components/PointPlotter/index.d.ts +2 -0
- package/dist/components/PointPlotter/index.d.ts.map +1 -0
- package/dist/components/Powerline/Powerline.d.ts +32 -0
- package/dist/components/Powerline/Powerline.d.ts.map +1 -0
- package/dist/components/Powerline/index.d.ts +5 -0
- package/dist/components/Powerline/index.d.ts.map +1 -0
- package/dist/components/Prefs/PrefsDialog.d.ts +21 -0
- package/dist/components/Prefs/PrefsDialog.d.ts.map +1 -0
- package/dist/components/Prefs/PrefsForm.d.ts +42 -0
- package/dist/components/Prefs/PrefsForm.d.ts.map +1 -0
- package/dist/components/Prefs/index.d.ts +4 -0
- package/dist/components/Prefs/index.d.ts.map +1 -0
- package/dist/components/Prefs/schema.d.ts +85 -0
- package/dist/components/Prefs/schema.d.ts.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +16 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup/index.d.ts +3 -0
- package/dist/components/RadioGroup/index.d.ts.map +1 -0
- package/dist/components/RangeSlider/RangeSlider.d.ts +18 -0
- package/dist/components/RangeSlider/RangeSlider.d.ts.map +1 -0
- package/dist/components/RangeSlider/index.d.ts +3 -0
- package/dist/components/RangeSlider/index.d.ts.map +1 -0
- package/dist/components/Select/Select.d.ts +39 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/SelectionPanel/SelectionPanel.d.ts +46 -0
- package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -0
- package/dist/components/SelectionPanel/index.d.ts +3 -0
- package/dist/components/SelectionPanel/index.d.ts.map +1 -0
- package/dist/components/SelectionPanel/model.d.ts +43 -0
- package/dist/components/SelectionPanel/model.d.ts.map +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +31 -0
- package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar/index.d.ts +3 -0
- package/dist/components/Sidebar/index.d.ts.map +1 -0
- package/dist/components/SidebarPanel/SidebarPanel.d.ts +35 -0
- package/dist/components/SidebarPanel/SidebarPanel.d.ts.map +1 -0
- package/dist/components/SidebarPanel/index.d.ts +3 -0
- package/dist/components/SidebarPanel/index.d.ts.map +1 -0
- package/dist/components/Slider/Slider.d.ts +43 -0
- package/dist/components/Slider/Slider.d.ts.map +1 -0
- package/dist/components/Slider/index.d.ts +3 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Switch/Switch.d.ts +11 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +22 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/index.d.ts +3 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Toast/Toast.d.ts +18 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/index.d.ts +5 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toast/queue.d.ts +56 -0
- package/dist/components/Toast/queue.d.ts.map +1 -0
- package/dist/components/ToggleBar/ToggleBar.d.ts +35 -0
- package/dist/components/ToggleBar/ToggleBar.d.ts.map +1 -0
- package/dist/components/ToggleBar/index.d.ts +3 -0
- package/dist/components/ToggleBar/index.d.ts.map +1 -0
- package/dist/components/ToolButton/ToolButton.d.ts +41 -0
- package/dist/components/ToolButton/ToolButton.d.ts.map +1 -0
- package/dist/components/ToolButton/index.d.ts +3 -0
- package/dist/components/ToolButton/index.d.ts.map +1 -0
- package/dist/components/ToolGroup/ToolGroup.d.ts +25 -0
- package/dist/components/ToolGroup/ToolGroup.d.ts.map +1 -0
- package/dist/components/ToolGroup/index.d.ts +3 -0
- package/dist/components/ToolGroup/index.d.ts.map +1 -0
- package/dist/components/ToolPalette/ToolPalette.d.ts +27 -0
- package/dist/components/ToolPalette/ToolPalette.d.ts.map +1 -0
- package/dist/components/ToolPalette/formatShortcut.d.ts +17 -0
- package/dist/components/ToolPalette/formatShortcut.d.ts.map +1 -0
- package/dist/components/ToolPalette/index.d.ts +4 -0
- package/dist/components/ToolPalette/index.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +24 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/dlog.d.ts +33 -0
- package/dist/dlog.d.ts.map +1 -0
- package/dist/format/number.d.ts +13 -0
- package/dist/format/number.d.ts.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/paintGradientTrack.d.ts +15 -0
- package/dist/paintGradientTrack.d.ts.map +1 -0
- package/dist/useReorderDragList.d.ts +35 -0
- package/dist/useReorderDragList.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type KeyCapVariant } from './Keycap';
|
|
2
|
+
export interface KeySpec {
|
|
3
|
+
/** Glyph rendered in the chip (modifier or key). */
|
|
4
|
+
label: string;
|
|
5
|
+
/** When true, the chip renders inverted to mark it as not required to
|
|
6
|
+
* trigger the action (e.g. an optional modifier). Defaults to false. */
|
|
7
|
+
optional?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface KeySequenceProps {
|
|
10
|
+
/** Keys to render. `undefined` or empty renders a muted em-dash.
|
|
11
|
+
* Modifiers are always rendered first regardless of input order; relative
|
|
12
|
+
* order within each group is preserved. */
|
|
13
|
+
keys: readonly KeySpec[] | undefined;
|
|
14
|
+
/** Character inserted between the trailing modifier chip and the first
|
|
15
|
+
* non-modifier chip (e.g. `'+'` renders `⌘ + K`). `null` or `''`
|
|
16
|
+
* suppresses it. Defaults to `'+'`. */
|
|
17
|
+
separator?: string | null;
|
|
18
|
+
/** Forwarded to every `KeyCap` in the sequence. `'minimal'` renders
|
|
19
|
+
* unfilled chips whose border + legend are `currentColor`. */
|
|
20
|
+
variant?: KeyCapVariant;
|
|
21
|
+
/** Forwarded to every `KeyCap` in the sequence. Overrides the design-
|
|
22
|
+
* system UI font for that chip only. */
|
|
23
|
+
font?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Renders a shortcut as a row of `KeyCap` chips, one per key. Optional
|
|
27
|
+
* keys render inverted to distinguish them from required ones. */
|
|
28
|
+
export declare function KeySequence({ keys, separator, variant, font, className }: KeySequenceProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=Keycaps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Keycaps.d.ts","sourceRoot":"","sources":["../../../src/components/Keycaps/Keycaps.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,MAAM,WAAW,OAAO;IACtB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd;6EACyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;gDAE4C;IAC5C,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,CAAC;IACrC;;4CAEwC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;mEAC+D;IAC/D,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;6CACyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;mEACmE;AACnE,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,SAAe,EAAE,OAAmB,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,gBAAgB,2CAwB5G"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { KeyCap, inferKeycapKind } from './Keycap';
|
|
2
|
+
export type { KeyCapProps, KeyCapVariant, KeycapKind } from './Keycap';
|
|
3
|
+
export { KeySequence } from './Keycaps';
|
|
4
|
+
export type { KeySequenceProps, KeySpec } from './Keycaps';
|
|
5
|
+
export { keyGlyph } from './keyGlyph';
|
|
6
|
+
export { keySpecsFromMods, keySpecFromKey, detectPlatform } from './keySpecsFromMods';
|
|
7
|
+
export type { LogicalMod, LogicalModSpec, Platform, LegendStyle, KeySpecsFromModsOptions, } from './keySpecsFromMods';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Keycaps/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACtF,YAAY,EACV,UAAU,EACV,cAAc,EACd,QAAQ,EACR,WAAW,EACX,uBAAuB,GACxB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Apple-style glyph for a DOM `KeyboardEvent.key` value. Covers escape,
|
|
2
|
+
* delete/backspace, arrows, enter/return, tab, space. Unknown keys are
|
|
3
|
+
* upper-cased (so `'a'` reads as `A` on a keycap) and returned unchanged
|
|
4
|
+
* otherwise — making this safe to apply uniformly without a `has-glyph`
|
|
5
|
+
* check at the call site. */
|
|
6
|
+
export declare function keyGlyph(rawKey: string): string;
|
|
7
|
+
//# sourceMappingURL=keyGlyph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyGlyph.d.ts","sourceRoot":"","sources":["../../../src/components/Keycaps/keyGlyph.ts"],"names":[],"mappings":"AAAA;;;;8BAI8B;AAC9B,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAgB/C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { KeySpec } from './Keycaps';
|
|
2
|
+
/** Logical modifier name. Matches the kit's `ModifierKey` in shape — kept as a
|
|
3
|
+
* local type so `weasel-ui` stays independent of `@weasel-js/core`. */
|
|
4
|
+
export type LogicalMod = 'mod' | 'shift' | 'alt' | 'ctrl' | 'meta';
|
|
5
|
+
/** Detected (or overridden) platform. `'mod'` resolves to ⌘ on macOS,
|
|
6
|
+
* Ctrl on Windows / Linux. */
|
|
7
|
+
export type Platform = 'macos' | 'windows' | 'linux';
|
|
8
|
+
/** Visual form of a modifier or named-key label.
|
|
9
|
+
*
|
|
10
|
+
* - `'auto'` (default): the per-entry, per-platform default — whatever
|
|
11
|
+
* label is actually printed on the physical key. macOS keys show the
|
|
12
|
+
* Apple glyphs (⌘ ⌥ ⌃ ⇧ ⎋ ↵ ⇥). Windows keys mostly show text
|
|
13
|
+
* (Ctrl, Alt, Shift) BUT the Win key shows its logo (⊞) and the
|
|
14
|
+
* context-menu key shows ▤. Linux mirrors Windows with Super (⊞).
|
|
15
|
+
* - `'symbol'` forces the Apple-style glyph everywhere a symbolic form
|
|
16
|
+
* exists. Entries without a widely-recognized symbol still fall
|
|
17
|
+
* back to text.
|
|
18
|
+
* - `'text'` always spells the label out (Cmd / Option / Esc / Enter). */
|
|
19
|
+
export type LegendStyle = 'auto' | 'symbol' | 'text';
|
|
20
|
+
export interface LogicalModSpec {
|
|
21
|
+
name: LogicalMod;
|
|
22
|
+
/** Marks this modifier as optional (may be held but isn't required).
|
|
23
|
+
* Forwarded as the resulting `KeySpec.optional`. */
|
|
24
|
+
optional?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface KeySpecsFromModsOptions {
|
|
27
|
+
/** Override OS detection. Defaults to the detected platform, or
|
|
28
|
+
* `'macos'` when detection is unavailable (e.g. in tests, or when
|
|
29
|
+
* `navigator` is missing). */
|
|
30
|
+
platform?: Platform;
|
|
31
|
+
/** Defaults to `'auto'` (symbol on macOS, text everywhere else). Pass
|
|
32
|
+
* `'symbol'` or `'text'` to force a specific style regardless of
|
|
33
|
+
* platform. */
|
|
34
|
+
legend?: LegendStyle;
|
|
35
|
+
}
|
|
36
|
+
/** Detect the user's OS from the browser environment. UA sniffing — not
|
|
37
|
+
* 100% reliable, but adequate for picking a modifier-glyph convention.
|
|
38
|
+
* Falls back to `'macos'` (matches the kit's docs convention) when
|
|
39
|
+
* `navigator` is unavailable. */
|
|
40
|
+
export declare function detectPlatform(): Platform;
|
|
41
|
+
/**
|
|
42
|
+
* Map a list of **logical** modifiers (`'mod'`, `'shift'`, …) to **visual**
|
|
43
|
+
* `KeySpec`s appropriate for the current platform.
|
|
44
|
+
*
|
|
45
|
+
* The kit-side gesture grammar uses logical names so the same route reads
|
|
46
|
+
* correctly on every OS — `'mod'` means "Cmd on Mac, Ctrl on Win/Linux".
|
|
47
|
+
* `KeySequence` is purely visual and renders the labels you give it; this
|
|
48
|
+
* helper is the bridge.
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* <KeySequence
|
|
52
|
+
* keys={keySpecsFromMods([{ name: 'mod' }, { name: 'shift', optional: true }])}
|
|
53
|
+
* />
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* On a Mac: renders `⌘ ⇧`. On Windows: renders `Ctrl Shift`. Pass an
|
|
57
|
+
* explicit `platform` to override detection (e.g. for docs that always
|
|
58
|
+
* show the macOS form). Pass `legend: 'text'` to force "Cmd" over "⌘"
|
|
59
|
+
* even on macOS.
|
|
60
|
+
*/
|
|
61
|
+
export declare function keySpecsFromMods(mods: readonly LogicalModSpec[], opts?: KeySpecsFromModsOptions): readonly KeySpec[];
|
|
62
|
+
/**
|
|
63
|
+
* Render a raw `KeyboardEvent.key` value as a platform-appropriate
|
|
64
|
+
* `KeySpec`. Named non-modifier keys (Esc, Enter, Tab, Space, Backspace,
|
|
65
|
+
* Delete, arrows) get the platform's conventional form. Letter / digit /
|
|
66
|
+
* other keys pass through upper-cased.
|
|
67
|
+
*
|
|
68
|
+
* ```ts
|
|
69
|
+
* keySpecFromKey('Escape', { platform: 'macos' }) // { label: '⎋' }
|
|
70
|
+
* keySpecFromKey('Escape', { platform: 'windows' }) // { label: 'Esc' }
|
|
71
|
+
* keySpecFromKey('p') // { label: 'P' }
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* Symbol mode is only meaningful on macOS — Windows / Linux keyboards
|
|
75
|
+
* print the text form on the physical key, so symbol mode there falls
|
|
76
|
+
* back to text.
|
|
77
|
+
*/
|
|
78
|
+
export declare function keySpecFromKey(raw: string, opts?: KeySpecsFromModsOptions & {
|
|
79
|
+
optional?: boolean;
|
|
80
|
+
}): KeySpec;
|
|
81
|
+
//# sourceMappingURL=keySpecsFromMods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keySpecsFromMods.d.ts","sourceRoot":"","sources":["../../../src/components/Keycaps/keySpecsFromMods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;wEACwE;AACxE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnE;+BAC+B;AAC/B,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAErD;;;;;;;;;;2EAU2E;AAC3E,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB;yDACqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC;;mCAE+B;IAC/B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;oBAEgB;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAgCD;;;kCAGkC;AAClC,wBAAgB,cAAc,IAAI,QAAQ,CASzC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,cAAc,EAAE,EAC/B,IAAI,GAAE,uBAA4B,GACjC,SAAS,OAAO,EAAE,CAOpB;AAuBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,uBAAuB,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1D,OAAO,CAMT"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type NumberFieldProps as RACNumberFieldProps, type ValidationResult } from 'react-aria-components';
|
|
3
|
+
export type NumberFieldProps = Omit<RACNumberFieldProps, 'children' | 'className'> & {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);
|
|
7
|
+
/** Hide the up/down stepper buttons. Defaults to false. */
|
|
8
|
+
hideSteppers?: boolean;
|
|
9
|
+
/** Native input placeholder — e.g. `'Mixed'` for a multi-selection
|
|
10
|
+
* editor with no shared value. */
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const NumberField: import("react").ForwardRefExoticComponent<Omit<RACNumberFieldProps, "children" | "className"> & {
|
|
15
|
+
label?: ReactNode;
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);
|
|
18
|
+
/** Hide the up/down stepper buttons. Defaults to false. */
|
|
19
|
+
hideSteppers?: boolean;
|
|
20
|
+
/** Native input placeholder — e.g. `'Mixed'` for a multi-selection
|
|
21
|
+
* editor with no shared value. */
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
25
|
+
//# sourceMappingURL=NumberField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/NumberField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAC7D,OAAO,EAQL,KAAK,gBAAgB,IAAI,mBAAmB,EAC5C,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAI/B,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,WAAW,CAAC,GAAG;IACnF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,gBAAgB,KAAK,SAAS,CAAC,CAAC;IAChE,2DAA2D;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;uCACmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,WAAW;YAXd,SAAS;kBACH,SAAS;mBACR,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,gBAAgB,KAAK,SAAS,CAAC;IAC/D,2DAA2D;mBAC5C,OAAO;IACtB;uCACmC;kBACrB,MAAM;gBACR,MAAM;oDA+BlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NumberField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export type OptionsBarItem<V extends string | number = string> = {
|
|
3
|
+
value: V;
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
selected: boolean;
|
|
8
|
+
onChange: (next: boolean) => void;
|
|
9
|
+
};
|
|
10
|
+
export type OptionsBarSize = 'sm' | 'md';
|
|
11
|
+
export type OptionsBarVariant = 'default' | 'minimal';
|
|
12
|
+
export type OptionsBarProps<V extends string | number = string> = {
|
|
13
|
+
items: readonly OptionsBarItem<V>[];
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
height?: number;
|
|
17
|
+
/** Size variant. `sm` is ~60% of the default height with reduced padding
|
|
18
|
+
* and font size — sized for dense surfaces like lab control panels. */
|
|
19
|
+
size?: OptionsBarSize;
|
|
20
|
+
/** Visual variant. `minimal` strips the pill track and glass treatment;
|
|
21
|
+
* selection becomes a flat accent. For dense diagnostic surfaces. */
|
|
22
|
+
variant?: OptionsBarVariant;
|
|
23
|
+
};
|
|
24
|
+
export declare function OptionsBar<V extends string | number = string>(props: OptionsBarProps<V>): ReactElement;
|
|
25
|
+
//# sourceMappingURL=OptionsBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionsBar.d.ts","sourceRoot":"","sources":["../../../src/components/Options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AAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type Point } from './geometry';
|
|
3
|
+
export interface GridSettings {
|
|
4
|
+
/** Number of evenly-spaced internal grid lines per axis (excluding
|
|
5
|
+
* the edges). Applied to both x and y. Default 3. */
|
|
6
|
+
divisions?: number;
|
|
7
|
+
/** Stroke color override. When omitted, uses `var(--plot-grid)`. */
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AxesSettings {
|
|
11
|
+
/** Stroke color override. When omitted, uses `var(--plot-axis)`. */
|
|
12
|
+
color?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Plot2DCoords {
|
|
15
|
+
plot: Point;
|
|
16
|
+
model: Point;
|
|
17
|
+
}
|
|
18
|
+
export interface Plot2DProps {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
/** Model-space x range. Default [0, 1]. */
|
|
22
|
+
xRange?: readonly [number, number];
|
|
23
|
+
/** Model-space y range. Default [0, 1]. */
|
|
24
|
+
yRange?: readonly [number, number];
|
|
25
|
+
/** Background grid. `false` / `null` / omitted = no grid. Pass `{}`
|
|
26
|
+
* for default (3 divisions per axis) or populated GridSettings. */
|
|
27
|
+
grid?: GridSettings | false | null;
|
|
28
|
+
/** Axis lines. `false` / `null` = no axes. Omitted = default-styled
|
|
29
|
+
* axes (on). Pass AxesSettings to customize. */
|
|
30
|
+
axes?: AxesSettings | false | null;
|
|
31
|
+
/** Forwarded to the underlying svg. Consumer opts into focus this way. */
|
|
32
|
+
tabIndex?: number;
|
|
33
|
+
className?: string;
|
|
34
|
+
style?: CSSProperties;
|
|
35
|
+
/** Pointer down on the SVG. Receives both plot- and model-space coords
|
|
36
|
+
* pre-computed so consumers don't repeat the rect/transform dance. */
|
|
37
|
+
onPointerDown?: (e: ReactPointerEvent<SVGSVGElement>, coords: Plot2DCoords) => void;
|
|
38
|
+
onKeyDown?: (e: ReactKeyboardEvent<SVGSVGElement>) => void;
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export interface Plot2DHandle {
|
|
42
|
+
readonly svg: SVGSVGElement | null;
|
|
43
|
+
plotToModel(pt: Point): Point;
|
|
44
|
+
modelToPlot(pt: Point): Point;
|
|
45
|
+
/** Convert a DOM event's clientX/clientY (e.g. from a window-attached
|
|
46
|
+
* pointermove during drag) to plot-space. */
|
|
47
|
+
clientToPlot(e: {
|
|
48
|
+
clientX: number;
|
|
49
|
+
clientY: number;
|
|
50
|
+
}): Point;
|
|
51
|
+
/** Convenience: clientToPlot → plotToModel. */
|
|
52
|
+
clientToModel(e: {
|
|
53
|
+
clientX: number;
|
|
54
|
+
clientY: number;
|
|
55
|
+
}): Point;
|
|
56
|
+
readonly width: number;
|
|
57
|
+
readonly height: number;
|
|
58
|
+
}
|
|
59
|
+
export declare const Plot2D: import("react").ForwardRefExoticComponent<Plot2DProps & import("react").RefAttributes<Plot2DHandle>>;
|
|
60
|
+
//# sourceMappingURL=Plot2D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plot2D.d.ts","sourceRoot":"","sources":["../../../src/components/Plot2D/Plot2D.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,aAAa,IAAI,kBAAkB,EACxC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAEY,KAAK,KAAK,EAC5B,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,YAAY;IAC3B;0DACsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IAC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A+C;IAC/C,aAAa,CAAC,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,CAAC;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,MAAM,sGA2HjB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coordinate transforms (model ↔ plot) for Plot2D. Pure / deterministic —
|
|
3
|
+
* no DOM, no React, no state.
|
|
4
|
+
*
|
|
5
|
+
* Model space: caller-defined xRange × yRange. Y axis goes UP.
|
|
6
|
+
* Plot space: 0..width × 0..height in CSS pixels. Y axis goes DOWN (SVG).
|
|
7
|
+
*/
|
|
8
|
+
export interface Point {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ModelRange {
|
|
13
|
+
xMin: number;
|
|
14
|
+
xMax: number;
|
|
15
|
+
yMin: number;
|
|
16
|
+
yMax: number;
|
|
17
|
+
}
|
|
18
|
+
export interface PlotSize {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function modelToPlot(p: Point, m: ModelRange, plot: PlotSize): Point;
|
|
23
|
+
export declare function plotToModel(p: Point, m: ModelRange, plot: PlotSize): Point;
|
|
24
|
+
//# sourceMappingURL=geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../src/components/Plot2D/geometry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,KAAK,CAQ1E;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,KAAK,CAO1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Plot2D/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,QAAQ,GACd,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { type AnchorRenderProps, type ControlPoint } from '../CurveEditor';
|
|
3
|
+
import type { GridSettings, AxesSettings } from '../Plot2D';
|
|
4
|
+
export interface PointPlotterProps {
|
|
5
|
+
/** Plotted points; caller-owned. */
|
|
6
|
+
value: readonly ControlPoint[];
|
|
7
|
+
/** Fires every frame during drag with the live in-flight value. */
|
|
8
|
+
onChange: (next: ControlPoint[]) => void;
|
|
9
|
+
/** Fires once per discrete user action (drag-end, add, delete) with
|
|
10
|
+
* the new value and the value at gesture start. Wire history here. */
|
|
11
|
+
onChangeCommit?: (next: ControlPoint[], prev: readonly ControlPoint[]) => void;
|
|
12
|
+
/** Model-space x range. Default [0, 1]. */
|
|
13
|
+
xRange?: readonly [number, number];
|
|
14
|
+
/** Model-space y range. Default [0, 1]. */
|
|
15
|
+
yRange?: readonly [number, number];
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
grid?: GridSettings | false | null;
|
|
19
|
+
axes?: AxesSettings | false | null;
|
|
20
|
+
/** Minimum allowed point count. User-initiated deletion is refused
|
|
21
|
+
* while `value.length <= minPoints`. */
|
|
22
|
+
minPoints?: number;
|
|
23
|
+
/** Maximum allowed point count. User-initiated insertion is refused
|
|
24
|
+
* while `value.length >= maxPoints`. */
|
|
25
|
+
maxPoints?: number;
|
|
26
|
+
/** How new points are added. Default `'click-empty'`. Set to `'never'`
|
|
27
|
+
* to disable insertion entirely. */
|
|
28
|
+
addPointMode?: 'click-empty' | 'never';
|
|
29
|
+
/** Built-in undo/redo via keyboard when the component has focus.
|
|
30
|
+
* Default `true`. See `CurveEditor.history` for details. */
|
|
31
|
+
history?: boolean;
|
|
32
|
+
/** Custom per-anchor renderer. See `CurveEditor.renderAnchor`. */
|
|
33
|
+
renderAnchor?: (info: AnchorRenderProps) => ReactNode;
|
|
34
|
+
/** Extra SVG content beneath the anchors. See `CurveEditor.decorations`. */
|
|
35
|
+
decorations?: ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: CSSProperties;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 2D point plotter — a CurveEditor with the curve hidden. Anchors,
|
|
41
|
+
* drag, shift+click delete, right-click delete, and click-empty insert
|
|
42
|
+
* are inherited from CurveEditor verbatim, so the two components share
|
|
43
|
+
* gesture semantics and stay in sync as CurveEditor evolves.
|
|
44
|
+
*
|
|
45
|
+
* Differences from CurveEditor: no curve `<path>` drawn, no fill, no
|
|
46
|
+
* endpoint pinning, no interpolation, default `addPointMode` is
|
|
47
|
+
* `'click-empty'` (CurveEditor defaults to `'click-curve'`, which
|
|
48
|
+
* doesn't make sense without a curve to hit-test against).
|
|
49
|
+
*/
|
|
50
|
+
export declare function PointPlotter(props: PointPlotterProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
//# sourceMappingURL=PointPlotter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointPlotter.d.ts","sourceRoot":"","sources":["../../../src/components/PointPlotter/PointPlotter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;IACzC;2EACuE;IACvE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,YAAY,EAAE,KAAK,IAAI,CAAC;IAC/E,2CAA2C;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,2CAA2C;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,YAAY,GAAG,KAAK,GAAG,IAAI,CAAC;IACnC,IAAI,CAAC,EAAE,YAAY,GAAG,KAAK,GAAG,IAAI,CAAC;IACnC;6CACyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;6CACyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;yCACqC;IACrC,YAAY,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;IACvC;iEAC6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,SAAS,CAAC;IACtD,4EAA4E;IAC5E,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CASpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PointPlotter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BadgeSize, BadgeTone, BadgeVariant } from '../Badge/types';
|
|
3
|
+
import type { EdgeCap } from '../Badge/bases/edgeProfiles';
|
|
4
|
+
export interface PowerlineSegment {
|
|
5
|
+
text: ReactNode;
|
|
6
|
+
/** Cap on this segment's right edge. Next segment's left edge adopts the same profile. */
|
|
7
|
+
endCap?: EdgeCap;
|
|
8
|
+
tone?: BadgeTone;
|
|
9
|
+
variant?: BadgeVariant;
|
|
10
|
+
size?: BadgeSize;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
href?: string;
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface PowerlineProps {
|
|
16
|
+
segments: PowerlineSegment[];
|
|
17
|
+
/** Left edge of the first segment. Defaults to 'flat'. */
|
|
18
|
+
startCap?: EdgeCap;
|
|
19
|
+
/** Default size for every segment (per-segment `size` wins). */
|
|
20
|
+
size?: BadgeSize;
|
|
21
|
+
/** Default variant for every segment (per-segment `variant` wins). */
|
|
22
|
+
variant?: BadgeVariant;
|
|
23
|
+
/** Protrusion depth in CSS px, passed through to every segment's base. */
|
|
24
|
+
depth?: number;
|
|
25
|
+
/** Visible gap between adjacent segments. Number → px; string → literal CSS length.
|
|
26
|
+
* Default: `0.2em` (scales with the row's font size). Pass `0` for flush. */
|
|
27
|
+
gap?: number | string;
|
|
28
|
+
className?: string;
|
|
29
|
+
'aria-label'?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function Powerline({ segments, startCap, size, variant, depth, gap, className, ...rest }: PowerlineProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=Powerline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Powerline.d.ts","sourceRoot":"","sources":["../../../src/components/Powerline/Powerline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG3D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,sEAAsE;IACtE,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;kFAC8E;IAC9E,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,QAAiB,EACjB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,GAAG,EACH,SAAS,EACT,GAAG,IAAI,EACR,EAAE,cAAc,2CA6BhB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Powerline } from './Powerline';
|
|
2
|
+
export type { PowerlineProps, PowerlineSegment } from './Powerline';
|
|
3
|
+
export type { EdgeCap, EdgeProfile, BuiltInEdgeName } from '../Badge/bases/edgeProfiles';
|
|
4
|
+
export { EDGE_PROFILES } from '../Badge/bases/edgeProfiles';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Powerline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type PrefsFormProps } from './PrefsForm';
|
|
3
|
+
export interface PrefsDialogProps extends PrefsFormProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
/** Dialog heading. Defaults to the schema root's `name`. */
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
/** Extra chrome rendered inline with the title (e.g. a dev-mode
|
|
9
|
+
* "Show hidden" switch). */
|
|
10
|
+
headerExtra?: ReactNode;
|
|
11
|
+
/** Class applied to the dialog's modal box. */
|
|
12
|
+
dialogClassName?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The kit's preferences dialog: `Dialog` + `PrefsForm`. Changes apply
|
|
16
|
+
* live through `onChange` — there is no OK/Cancel staging. For custom
|
|
17
|
+
* placement (sidebar, popover, inline page), compose `PrefsForm`
|
|
18
|
+
* directly; this wrapper is intentionally thin.
|
|
19
|
+
*/
|
|
20
|
+
export declare function PrefsDialog(props: PrefsDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=PrefsDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrefsDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Prefs/PrefsDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7D,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,4DAA4D;IAC5D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;iCAC6B;IAC7B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAsBlD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type PrefGroup, type PrefLeaf } from './schema';
|
|
3
|
+
export interface PrefRenderContext {
|
|
4
|
+
/** Dotted path of the leaf within the schema root. */
|
|
5
|
+
path: string;
|
|
6
|
+
/** The schema node. App renderers narrow this to their own kind shape. */
|
|
7
|
+
pref: PrefLeaf;
|
|
8
|
+
/** Current value — `values` at `path`, falling back to `pref.default`. */
|
|
9
|
+
value: unknown;
|
|
10
|
+
setValue: (value: unknown) => void;
|
|
11
|
+
}
|
|
12
|
+
export type PrefRenderer = (ctx: PrefRenderContext) => ReactNode;
|
|
13
|
+
export interface PrefsFormProps {
|
|
14
|
+
/** Root of the schema tree. Core `ToolPrefGroup`s assign structurally. */
|
|
15
|
+
schema: PrefGroup;
|
|
16
|
+
/** Nested value tree (shape mirrors the schema). Sparse is fine —
|
|
17
|
+
* missing leaves fall back to their schema `default`. */
|
|
18
|
+
values?: unknown;
|
|
19
|
+
/** Change callback with the leaf's dotted path. Values apply live;
|
|
20
|
+
* there is no dirty/commit state. */
|
|
21
|
+
onChange: (path: string, value: unknown) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Per-kind renderers for app-defined kinds. Entries also override the
|
|
24
|
+
* built-in kinds when keys collide. A renderer owns the control cell
|
|
25
|
+
* (the label/tooltip row chrome stays with the form, unless the leaf
|
|
26
|
+
* sets `block`); returning `null` collapses the row entirely. Unknown
|
|
27
|
+
* kinds with no renderer show a labeled placeholder instead of
|
|
28
|
+
* crashing.
|
|
29
|
+
*/
|
|
30
|
+
renderers?: Record<string, PrefRenderer>;
|
|
31
|
+
/** Reveal `hidden` leaves (dev tooling). Default false. */
|
|
32
|
+
showHidden?: boolean;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Schema-driven preferences form. Top-level groups render as columns,
|
|
37
|
+
* nested groups as indented sub-panels, leaves as label + control rows.
|
|
38
|
+
* Storage-agnostic: pair with `PrefsDialog` for the modal composition,
|
|
39
|
+
* and persist however the app likes via `onChange`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function PrefsForm(props: PrefsFormProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=PrefsForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrefsForm.d.ts","sourceRoot":"","sources":["../../../src/components/Prefs/PrefsForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAWhD,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,QAAQ,EAGd,MAAM,UAAU,CAAC;AAGlB,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,IAAI,EAAE,QAAQ,CAAC;IACf,0EAA0E;IAC1E,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,iBAAiB,KAAK,SAAS,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,MAAM,EAAE,SAAS,CAAC;IAClB;8DAC0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;0CACsC;IACtC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAsB9C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { PrefsForm, type PrefsFormProps, type PrefRenderer, type PrefRenderContext } from './PrefsForm';
|
|
2
|
+
export { PrefsDialog, type PrefsDialogProps } from './PrefsDialog';
|
|
3
|
+
export { isPrefLeaf, prefValueAtPath, visiblePrefSubtree, type BuiltinPref, type PrefBoolean, type PrefBooleanControl, type PrefColor, type PrefCustom, type PrefEnum, type PrefEnumControl, type PrefGroup, type PrefLeaf, type PrefNumber, type PrefNumberControl, type PrefNumberUnit, type PrefString, type PrefStringControl, } from './schema';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Prefs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EACL,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** Control-presentation hints per kind — visually-equivalent renderings
|
|
2
|
+
* of the same value type. The persisted value is unchanged either way. */
|
|
3
|
+
export type PrefNumberControl = 'input' | 'slider';
|
|
4
|
+
export type PrefBooleanControl = 'checkbox' | 'switch';
|
|
5
|
+
export type PrefStringControl = 'input' | 'textarea';
|
|
6
|
+
export type PrefEnumControl = 'select' | 'radio';
|
|
7
|
+
interface PrefBase<K extends string, Value> {
|
|
8
|
+
kind: K;
|
|
9
|
+
/** Human-readable label, e.g. "Show grid". */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Longer help text — surfaces as a tooltip on the row label. */
|
|
12
|
+
description: string;
|
|
13
|
+
/** Fallback when `values` holds nothing at this leaf's path. */
|
|
14
|
+
default: Value;
|
|
15
|
+
/** Omitted from the form unless `showHidden` is set. */
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
/** Render the control full-width with no label/tooltip row — for
|
|
18
|
+
* controls that supply their own chrome (embedded sub-panel editors).
|
|
19
|
+
* The `description` still applies wherever the renderer surfaces it. */
|
|
20
|
+
block?: boolean;
|
|
21
|
+
/** Row-pairing hint for compact property UIs (`SelectionPanel`):
|
|
22
|
+
* leaves sharing a `pair` id render side-by-side on one row labeled
|
|
23
|
+
* with the `pair` string. Purely presentational. */
|
|
24
|
+
pair?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Display-unit conversion for number leaves whose stored value uses a
|
|
27
|
+
* canonical unit the user shouldn't see (radians → degrees). Mirrors
|
|
28
|
+
* core's `ToolPrefNumberUnit`. */
|
|
29
|
+
export interface PrefNumberUnit {
|
|
30
|
+
toDisplay: (stored: number) => number;
|
|
31
|
+
fromDisplay: (display: number) => number;
|
|
32
|
+
suffix?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface PrefNumber extends PrefBase<'number', number> {
|
|
35
|
+
min?: number;
|
|
36
|
+
max?: number;
|
|
37
|
+
step?: number;
|
|
38
|
+
control?: PrefNumberControl;
|
|
39
|
+
unit?: PrefNumberUnit;
|
|
40
|
+
}
|
|
41
|
+
export interface PrefBoolean extends PrefBase<'boolean', boolean> {
|
|
42
|
+
control?: PrefBooleanControl;
|
|
43
|
+
}
|
|
44
|
+
export interface PrefString extends PrefBase<'string', string> {
|
|
45
|
+
control?: PrefStringControl;
|
|
46
|
+
}
|
|
47
|
+
export interface PrefEnum<T extends string = string> extends PrefBase<'enum', T> {
|
|
48
|
+
options: readonly {
|
|
49
|
+
value: T;
|
|
50
|
+
label: string;
|
|
51
|
+
}[];
|
|
52
|
+
control?: PrefEnumControl;
|
|
53
|
+
}
|
|
54
|
+
export interface PrefColor extends PrefBase<'color', string> {
|
|
55
|
+
/** Value is `#rrggbb`, or `#rrggbbaa` when `alpha` is set. */
|
|
56
|
+
alpha?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export type BuiltinPref = PrefNumber | PrefBoolean | PrefString | PrefEnum | PrefColor;
|
|
59
|
+
/**
|
|
60
|
+
* Open leaf: any node with a `kind` the form doesn't know renders via the
|
|
61
|
+
* `renderers` map (`renderers[kind]`). App schemas keep their extra fields
|
|
62
|
+
* (e.g. a registry-enum's `source`/`filter`) — renderers receive the node
|
|
63
|
+
* and narrow it themselves. Deliberately NOT index-signatured so concrete
|
|
64
|
+
* app interfaces stay assignable.
|
|
65
|
+
*/
|
|
66
|
+
export interface PrefCustom extends PrefBase<string, unknown> {
|
|
67
|
+
}
|
|
68
|
+
export type PrefLeaf = BuiltinPref | PrefCustom;
|
|
69
|
+
/** Nestable group: branch nodes in the schema tree. */
|
|
70
|
+
export interface PrefGroup {
|
|
71
|
+
name: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
children: Record<string, PrefLeaf | PrefGroup>;
|
|
74
|
+
}
|
|
75
|
+
export declare function isPrefLeaf(node: PrefLeaf | PrefGroup): node is PrefLeaf;
|
|
76
|
+
/** Get the value at a dotted path inside a nested value tree. Returns
|
|
77
|
+
* `undefined` when a segment is missing or hits a non-object. */
|
|
78
|
+
export declare function prefValueAtPath(values: unknown, path: string): unknown;
|
|
79
|
+
/**
|
|
80
|
+
* Recursively drop `hidden` leaves (unless `showHidden`), pruning groups
|
|
81
|
+
* that end up empty. Returns null when the entire subtree is hidden.
|
|
82
|
+
*/
|
|
83
|
+
export declare function visiblePrefSubtree<T extends PrefLeaf | PrefGroup>(node: T, showHidden: boolean): T | null;
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Prefs/schema.ts"],"names":[],"mappings":"AASA;2EAC2E;AAC3E,MAAM,MAAM,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