@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,14 @@
|
|
|
1
|
+
export type ChromaCurve = {
|
|
2
|
+
lRange: [number, number];
|
|
3
|
+
midL: number;
|
|
4
|
+
cBot: number;
|
|
5
|
+
cPeak: number;
|
|
6
|
+
cTop: number;
|
|
7
|
+
};
|
|
8
|
+
export type ChromaCurvePoint = {
|
|
9
|
+
L: number;
|
|
10
|
+
C: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function oklchToHex(L: number, C: number, Hdeg: number): string;
|
|
13
|
+
export declare function chromaAt(L: number, curve: ChromaCurve): number;
|
|
14
|
+
//# sourceMappingURL=oklch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oklch.d.ts","sourceRoot":"","sources":["../../src/color/oklch.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrE;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,CAM9D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface ActionBarProps {
|
|
3
|
+
/** Group key — only actions with `action.group === group` are rendered. */
|
|
4
|
+
group: string;
|
|
5
|
+
/** Layout direction. Defaults to `'horizontal'`. */
|
|
6
|
+
orientation?: 'horizontal' | 'vertical';
|
|
7
|
+
/**
|
|
8
|
+
* Per-id icon overrides — keyed by `action.id`. When an entry is provided
|
|
9
|
+
* it replaces the action's own `icon` for this bar only. Mirrors
|
|
10
|
+
* `PathfinderPanelProps.icons` so call sites that ship custom glyph sets
|
|
11
|
+
* can swap them in without re-registering actions.
|
|
12
|
+
*/
|
|
13
|
+
icons?: Record<string, ReactNode>;
|
|
14
|
+
/**
|
|
15
|
+
* Per-id label overrides — keyed by `action.id`. Drives both `aria-label`
|
|
16
|
+
* and `title`. When omitted, the action's own `label` is used.
|
|
17
|
+
*/
|
|
18
|
+
labels?: Record<string, string>;
|
|
19
|
+
/** Additional class for the toolbar root. */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generic group-keyed action toolbar. Reads the parent `ActionsRegistry`,
|
|
24
|
+
* filters to actions whose `group` matches `props.group`, and renders one
|
|
25
|
+
* icon button per match. Disabled state is derived from each action's
|
|
26
|
+
* `enabled` predicate via `evaluateEnabled` (so the button greys out and
|
|
27
|
+
* swallows clicks while the keybinding — if any — still fires through the
|
|
28
|
+
* registry's keydown listener; that's the registry's contract, not ours).
|
|
29
|
+
*
|
|
30
|
+
* Visual parity with the WeaselDraw `<PathfinderPanel>` is intentional;
|
|
31
|
+
* this is the generic, registry-driven version. No keyboard navigation
|
|
32
|
+
* (roving tabindex) yet — bar consumers today are short flat strips. Add
|
|
33
|
+
* if/when a long bar lands.
|
|
34
|
+
*/
|
|
35
|
+
export declare function ActionBar(props: ActionBarProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=ActionBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../../src/components/ActionBar/ActionBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc7D,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAaD;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAkE9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ActionBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export type ActionsBarItem<V extends string | number = string> = {
|
|
3
|
+
value: V;
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onAction: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type ActionsBarSize = 'sm' | 'md';
|
|
10
|
+
export type ActionsBarVariant = 'default' | 'minimal';
|
|
11
|
+
export type ActionsBarProps<V extends string | number = string> = {
|
|
12
|
+
items: readonly ActionsBarItem<V>[];
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
height?: number;
|
|
16
|
+
size?: ActionsBarSize;
|
|
17
|
+
variant?: ActionsBarVariant;
|
|
18
|
+
};
|
|
19
|
+
export declare function ActionsBar<V extends string | number = string>(props: ActionsBarProps<V>): ReactElement;
|
|
20
|
+
//# sourceMappingURL=ActionsBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionsBar.d.ts","sourceRoot":"","sources":["../../../src/components/ActionsBar/ActionsBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhI,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI;IAC/D,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI;IAChE,KAAK,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AA8BF,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,YAAY,CAoFtG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ActionsBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ReactNode, type CSSProperties } from 'react';
|
|
2
|
+
import { type BadgeShapeParams } from './shapes';
|
|
3
|
+
import { type BadgeBase, type BadgeBaseParams } from './bases';
|
|
4
|
+
import { type EffectSpec } from './effects';
|
|
5
|
+
import type { BadgeShape, BadgeTone, BadgeVariant, BadgeSize } from './types';
|
|
6
|
+
interface BadgeBaseProps {
|
|
7
|
+
tone?: BadgeTone;
|
|
8
|
+
variant?: BadgeVariant;
|
|
9
|
+
size?: BadgeSize;
|
|
10
|
+
/** "Edge bloat": offset every base perimeter sample outward by N CSS px along the normal
|
|
11
|
+
* before any compose effects run. Negative values shrink the silhouette. Photoshop-style
|
|
12
|
+
* expand-selection on the body. */
|
|
13
|
+
bloat?: number;
|
|
14
|
+
padding?: number | string;
|
|
15
|
+
/**
|
|
16
|
+
* For CSS-rendered shapes (pill, plain) that fragment across line wraps, controls how the
|
|
17
|
+
* background/border behaves at each break.
|
|
18
|
+
* - `'slice'` (default): decoration is severed at the break (looks like one continuous badge cut by the line).
|
|
19
|
+
* - `'clone'`: each fragment paints its own complete decoration (looks like two separate badges).
|
|
20
|
+
*/
|
|
21
|
+
breakStyle?: 'slice' | 'clone';
|
|
22
|
+
/** When set, perimeter-pattern shapes (beavis, cloud, postage, scalloped) continuously shift their pattern. */
|
|
23
|
+
crawl?: boolean | number;
|
|
24
|
+
/** Compose-mode: base shape underneath the badge content. When set, overrides the `shape` prop. */
|
|
25
|
+
base?: BadgeBase;
|
|
26
|
+
baseParams?: BadgeBaseParams[BadgeBase];
|
|
27
|
+
/** Compose-mode: layered effects applied around / over the base. */
|
|
28
|
+
effects?: EffectSpec[];
|
|
29
|
+
onClick?: () => void;
|
|
30
|
+
onRemove?: () => void;
|
|
31
|
+
removeLabel?: string;
|
|
32
|
+
href?: string;
|
|
33
|
+
as?: 'span' | 'button' | 'a';
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
/** Optional style overrides merged with the badge's own style. Useful for setting CSS
|
|
37
|
+
* custom properties (e.g. `--badge-edge` to inject a custom tone color). */
|
|
38
|
+
style?: CSSProperties;
|
|
39
|
+
'aria-label'?: string;
|
|
40
|
+
}
|
|
41
|
+
type BadgePropsByShape = {
|
|
42
|
+
[S in BadgeShape]: BadgeBaseProps & {
|
|
43
|
+
shape?: S;
|
|
44
|
+
shapeParams?: BadgeShapeParams[S];
|
|
45
|
+
};
|
|
46
|
+
}[BadgeShape];
|
|
47
|
+
export type BadgeProps = BadgePropsByShape;
|
|
48
|
+
export declare function Badge(props: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuD,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAEhH,OAAO,EAAU,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAS,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,EAAW,KAAK,UAAU,EAAoB,MAAM,WAAW,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE9E,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;wCAEoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC/B,+GAA+G;IAC/G,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,mGAAmG;IACnG,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACxC,oEAAoE;IACpE,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,GAAG,CAAC;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;iFAC6E;IAC7E,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,KAAK,iBAAiB,GAAG;KACtB,CAAC,IAAI,UAAU,GAAG,cAAc,GAAG;QAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;KAAE;CACrF,CAAC,UAAU,CAAC,CAAC;AAEd,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAS3C,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CAqQtC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BaseModule } from './types';
|
|
2
|
+
export interface ChamferedRectParams {
|
|
3
|
+
/** CSS px length of each 45° corner chamfer. */
|
|
4
|
+
chamfer?: number;
|
|
5
|
+
}
|
|
6
|
+
declare const ChamferedRect: BaseModule<ChamferedRectParams>;
|
|
7
|
+
export default ChamferedRect;
|
|
8
|
+
//# sourceMappingURL=ChamferedRect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChamferedRect.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/ChamferedRect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAA+B,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,QAAA,MAAM,aAAa,EAAE,UAAU,CAAC,mBAAmB,CAmElD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { BaseModule } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Symmetric polar NURBS base. Same anchor concept as `octant-spline` but the curve is an
|
|
4
|
+
* **approximating** cubic NURBS — the control points pull the curve without sitting on it.
|
|
5
|
+
* Each anchor's weight increases the local pull toward that control point.
|
|
6
|
+
*
|
|
7
|
+
* Endpoint behaviour: the curve uses mirror-phantom control points just outside [0, 1]
|
|
8
|
+
* derived from the second-from-end anchors, which enforces zero slope at s=0 and s=1 so
|
|
9
|
+
* the reflected/rotated full silhouette closes cleanly across the symmetry axes.
|
|
10
|
+
*/
|
|
11
|
+
export interface OctantBSplineParams {
|
|
12
|
+
mode?: 'octant' | 'quadrant';
|
|
13
|
+
count?: number;
|
|
14
|
+
s0?: number;
|
|
15
|
+
s1?: number;
|
|
16
|
+
s2?: number;
|
|
17
|
+
s3?: number;
|
|
18
|
+
s4?: number;
|
|
19
|
+
s5?: number;
|
|
20
|
+
s6?: number;
|
|
21
|
+
s7?: number;
|
|
22
|
+
s8?: number;
|
|
23
|
+
s9?: number;
|
|
24
|
+
s10?: number;
|
|
25
|
+
s11?: number;
|
|
26
|
+
r0?: number;
|
|
27
|
+
r1?: number;
|
|
28
|
+
r2?: number;
|
|
29
|
+
r3?: number;
|
|
30
|
+
r4?: number;
|
|
31
|
+
r5?: number;
|
|
32
|
+
r6?: number;
|
|
33
|
+
r7?: number;
|
|
34
|
+
r8?: number;
|
|
35
|
+
r9?: number;
|
|
36
|
+
r10?: number;
|
|
37
|
+
r11?: number;
|
|
38
|
+
w0?: number;
|
|
39
|
+
w1?: number;
|
|
40
|
+
w2?: number;
|
|
41
|
+
w3?: number;
|
|
42
|
+
w4?: number;
|
|
43
|
+
w5?: number;
|
|
44
|
+
w6?: number;
|
|
45
|
+
w7?: number;
|
|
46
|
+
w8?: number;
|
|
47
|
+
w9?: number;
|
|
48
|
+
w10?: number;
|
|
49
|
+
w11?: number;
|
|
50
|
+
rotation?: number;
|
|
51
|
+
samples?: number;
|
|
52
|
+
}
|
|
53
|
+
export declare const OCTANT_BSPLINE_MAX_ANCHORS = 12;
|
|
54
|
+
interface Anchor {
|
|
55
|
+
s: number;
|
|
56
|
+
r: number;
|
|
57
|
+
w: number;
|
|
58
|
+
}
|
|
59
|
+
export declare function extractAnchorPairs(params?: OctantBSplineParams): Anchor[];
|
|
60
|
+
interface CompiledNurbs {
|
|
61
|
+
extended: Anchor[];
|
|
62
|
+
knots: number[];
|
|
63
|
+
degree: number;
|
|
64
|
+
}
|
|
65
|
+
export declare function compileNurbs(anchors: Anchor[]): CompiledNurbs;
|
|
66
|
+
/** Invert S(u) = s by bisection. The NURBS is monotonic in s because the underlying knot
|
|
67
|
+
* vector and control sequence are monotonic, so bisection converges quickly. */
|
|
68
|
+
export declare function evalNurbsAtS(s: number, nurbs: CompiledNurbs): number;
|
|
69
|
+
declare const OctantBSpline: BaseModule<OctantBSplineParams>;
|
|
70
|
+
export default OctantBSpline;
|
|
71
|
+
//# sourceMappingURL=OctantBSpline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OctantBSpline.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/OctantBSpline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAC/E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAC/E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAe7C,UAAU,MAAM;IAAG,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE;AAEpD,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,mBAAwB,GAAG,MAAM,EAAE,CAsB7E;AAwED,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,aAAa,CAK7D;AAqBD;iFACiF;AACjF,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,CAWpE;AAED,QAAA,MAAM,aAAa,EAAE,UAAU,CAAC,mBAAmB,CA2BlD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { BaseModule } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Symmetric polar-spline base. The silhouette comes from a single curve r(s) over
|
|
4
|
+
* s ∈ [0, 1] that gets reflected/rotated to fill the full circle:
|
|
5
|
+
*
|
|
6
|
+
* - `mode: 'octant'`: 1/8 of the perimeter (cardinal → diagonal), mirrored within each
|
|
7
|
+
* quadrant and rotated to fill the rest. 8-fold symmetric.
|
|
8
|
+
* - `mode: 'quadrant'`: 1/4 of the perimeter (cardinal → next cardinal), rotated 4 times
|
|
9
|
+
* with no internal mirror. 4-fold rotational symmetry; endpoints share radius.
|
|
10
|
+
*
|
|
11
|
+
* The interpolant is a **clamped natural cubic spline** with zero slope at both endpoints
|
|
12
|
+
* (so the reflected/rotated full curve has no kink crossing the symmetry axes). C² across
|
|
13
|
+
* the whole octant — continuous curvature, not just slope — which removes the "lumpy" feel
|
|
14
|
+
* that local Hermite splines have when anchors are uneven.
|
|
15
|
+
*/
|
|
16
|
+
export interface OctantSplineParams {
|
|
17
|
+
mode?: 'octant' | 'quadrant';
|
|
18
|
+
/** Number of active anchors (3..12). */
|
|
19
|
+
count?: number;
|
|
20
|
+
s0?: number;
|
|
21
|
+
s1?: number;
|
|
22
|
+
s2?: number;
|
|
23
|
+
s3?: number;
|
|
24
|
+
s4?: number;
|
|
25
|
+
s5?: number;
|
|
26
|
+
s6?: number;
|
|
27
|
+
s7?: number;
|
|
28
|
+
s8?: number;
|
|
29
|
+
s9?: number;
|
|
30
|
+
s10?: number;
|
|
31
|
+
s11?: number;
|
|
32
|
+
r0?: number;
|
|
33
|
+
r1?: number;
|
|
34
|
+
r2?: number;
|
|
35
|
+
r3?: number;
|
|
36
|
+
r4?: number;
|
|
37
|
+
r5?: number;
|
|
38
|
+
r6?: number;
|
|
39
|
+
r7?: number;
|
|
40
|
+
r8?: number;
|
|
41
|
+
r9?: number;
|
|
42
|
+
r10?: number;
|
|
43
|
+
r11?: number;
|
|
44
|
+
/** Per-anchor weight (0..3). The spline is constructed to pass through every anchor exactly;
|
|
45
|
+
* the weight biases how strongly that anchor influences the rest of the curve. Implementation
|
|
46
|
+
* detail: blends the C² interpolant with a polynomial fit weighted by w. Default 1 = pure
|
|
47
|
+
* C² interpolation; <1 lets the curve sweep past the anchor (anchor still passed through);
|
|
48
|
+
* >1 makes the curve hug the anchor more tightly (sharper local bend). */
|
|
49
|
+
w0?: number;
|
|
50
|
+
w1?: number;
|
|
51
|
+
w2?: number;
|
|
52
|
+
w3?: number;
|
|
53
|
+
w4?: number;
|
|
54
|
+
w5?: number;
|
|
55
|
+
w6?: number;
|
|
56
|
+
w7?: number;
|
|
57
|
+
w8?: number;
|
|
58
|
+
w9?: number;
|
|
59
|
+
w10?: number;
|
|
60
|
+
w11?: number;
|
|
61
|
+
rotation?: number;
|
|
62
|
+
samples?: number;
|
|
63
|
+
}
|
|
64
|
+
export declare const OCTANT_SPLINE_MAX_ANCHORS = 12;
|
|
65
|
+
interface Anchor {
|
|
66
|
+
s: number;
|
|
67
|
+
r: number;
|
|
68
|
+
w: number;
|
|
69
|
+
}
|
|
70
|
+
export declare function extractAnchorPairs(params?: OctantSplineParams): Anchor[];
|
|
71
|
+
interface CompiledSpline {
|
|
72
|
+
anchors: Anchor[];
|
|
73
|
+
M: number[];
|
|
74
|
+
}
|
|
75
|
+
export declare function compileSpline(anchors: Anchor[]): CompiledSpline;
|
|
76
|
+
export declare function evalCompiled(s: number, spline: CompiledSpline): number;
|
|
77
|
+
declare const OctantSpline: BaseModule<OctantSplineParams>;
|
|
78
|
+
export default OctantSpline;
|
|
79
|
+
//# sourceMappingURL=OctantSpline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OctantSpline.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/OctantSpline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAC/E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAC/E;;;;+EAI2E;IAC3E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAe5C,UAAU,MAAM;IAAG,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE;AAEpD,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,kBAAuB,GAAG,MAAM,EAAE,CAsB5E;AA8CD,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,CAAC,EAAE,MAAM,EAAE,CAAC;CACb;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,CAE/D;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,MAAM,CAwBtE;AAED,QAAA,MAAM,YAAY,EAAE,UAAU,CAAC,kBAAkB,CA2BhD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BaseModule } from './types';
|
|
2
|
+
export interface PolygonParams {
|
|
3
|
+
/** Vertices in viewBox 0..100 coordinates, traced clockwise. */
|
|
4
|
+
vertices?: [number, number][];
|
|
5
|
+
}
|
|
6
|
+
declare const Polygon: BaseModule<PolygonParams>;
|
|
7
|
+
export default Polygon;
|
|
8
|
+
//# sourceMappingURL=Polygon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Polygon.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/Polygon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAC/B;AAMD,QAAA,MAAM,OAAO,EAAE,UAAU,CAAC,aAAa,CAOtC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type EdgeCap } from './edgeProfiles';
|
|
2
|
+
import type { BaseModule } from './types';
|
|
3
|
+
export interface PowerlineParams {
|
|
4
|
+
/** Profile for the left edge (the cap segment N inherits from segment N-1). */
|
|
5
|
+
leftEdge?: EdgeCap;
|
|
6
|
+
/** Profile for the right edge (this segment's own end cap). */
|
|
7
|
+
rightEdge?: EdgeCap;
|
|
8
|
+
/** Protrusion depth in CSS px (positive values stick out beyond the rect). */
|
|
9
|
+
depth?: number;
|
|
10
|
+
}
|
|
11
|
+
declare const Powerline: BaseModule<PowerlineParams>;
|
|
12
|
+
export default Powerline;
|
|
13
|
+
//# sourceMappingURL=Powerline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Powerline.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/Powerline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAA+B,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAYD,QAAA,MAAM,SAAS,EAAE,UAAU,CAAC,eAAe,CAsH1C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BaseModule } from './types';
|
|
2
|
+
export type PuzzleEdge = 'flat' | 'out' | 'in';
|
|
3
|
+
export interface PuzzleParams {
|
|
4
|
+
top?: PuzzleEdge;
|
|
5
|
+
right?: PuzzleEdge;
|
|
6
|
+
bottom?: PuzzleEdge;
|
|
7
|
+
left?: PuzzleEdge;
|
|
8
|
+
/** Tab radius in viewBox units (0..50). */
|
|
9
|
+
tabSize?: number;
|
|
10
|
+
/** Sample density per tab arc. */
|
|
11
|
+
arcSamples?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const Puzzle: BaseModule<PuzzleParams>;
|
|
14
|
+
export default Puzzle;
|
|
15
|
+
//# sourceMappingURL=Puzzle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Puzzle.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/Puzzle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAoED,QAAA,MAAM,MAAM,EAAE,UAAU,CAAC,YAAY,CAuBpC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { BaseModule } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 8-fold-symmetric polar shape. The whole silhouette is defined by a single curve r(s)
|
|
4
|
+
* over s ∈ [0, 1], where s=0 is the cardinal direction and s=1 is the diagonal. The full
|
|
5
|
+
* shape comes from reflecting that octant curve eight times around the center. The curve
|
|
6
|
+
* itself is two superellipse segments meeting at a valley:
|
|
7
|
+
*
|
|
8
|
+
* s ∈ [0, valleyAt] → spike segment, from `spikeR` down to `valleyR`
|
|
9
|
+
* s ∈ [valleyAt, 1] → lobe segment, from `valleyR` up to `lobeR`
|
|
10
|
+
*
|
|
11
|
+
* Each segment has its own curvature, bend bias, and tip-erosion controls.
|
|
12
|
+
*/
|
|
13
|
+
export interface QuatrefoilParams {
|
|
14
|
+
/** Radius at s=0 (cardinal direction). */
|
|
15
|
+
spikeR?: number;
|
|
16
|
+
/** Radius at s=1 (diagonal direction). */
|
|
17
|
+
lobeR?: number;
|
|
18
|
+
/** Radius at the junction between spike and lobe segments. */
|
|
19
|
+
valleyR?: number;
|
|
20
|
+
/** Position of the junction in [0, 1]. 0.5 = symmetric octant; <0.5 narrows the spike side. */
|
|
21
|
+
valleyAt?: number;
|
|
22
|
+
/** Spike-segment curvature (superellipse exponent). 1 = flat diagonal sides; <1 caves
|
|
23
|
+
* inward (concave/star); >1 bulges outward (convex/square-shouldered). */
|
|
24
|
+
spikeCurvature?: number;
|
|
25
|
+
/** Spike-segment bend bias. Positive shifts the curve's bend toward the tip; negative
|
|
26
|
+
* toward the base. */
|
|
27
|
+
spikeBend?: number;
|
|
28
|
+
/** Flat-top truncation of the cardinal tip (0..1). */
|
|
29
|
+
spikeTipErosion?: number;
|
|
30
|
+
/** Lobe-segment curvature, same semantics as spike. */
|
|
31
|
+
lobeCurvature?: number;
|
|
32
|
+
/** Lobe-segment bend bias. */
|
|
33
|
+
lobeBend?: number;
|
|
34
|
+
/** Flat-top truncation of the diagonal lobe peak (0..1). */
|
|
35
|
+
lobeTipErosion?: number;
|
|
36
|
+
/** Smooth the corner at the valley junction. 0 = sharp, higher = puffier crossover. */
|
|
37
|
+
valleySmooth?: number;
|
|
38
|
+
/** Rotate the pattern in degrees. */
|
|
39
|
+
rotation?: number;
|
|
40
|
+
/** Polygon sample count. */
|
|
41
|
+
samples?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare function quatrefoilVertices(params?: QuatrefoilParams): [number, number][];
|
|
44
|
+
declare const Quatrefoil: BaseModule<QuatrefoilParams>;
|
|
45
|
+
export default Quatrefoil;
|
|
46
|
+
//# sourceMappingURL=Quatrefoil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Quatrefoil.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/Quatrefoil.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;+EAC2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;2BACuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAkCD,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,gBAAqB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAiCpF;AAED,QAAA,MAAM,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAI5C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BaseModule } from './types';
|
|
2
|
+
export type RibbonEnd = 'inward' | 'outward' | 'flat';
|
|
3
|
+
export interface RibbonParams {
|
|
4
|
+
left?: RibbonEnd;
|
|
5
|
+
right?: RibbonEnd;
|
|
6
|
+
/** Taper depth in CSS px. Stays fixed regardless of badge width — viewBox
|
|
7
|
+
* vertices are computed at build time using `boxW`. */
|
|
8
|
+
taperWidth?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const Ribbon: BaseModule<RibbonParams>;
|
|
11
|
+
export default Ribbon;
|
|
12
|
+
//# sourceMappingURL=Ribbon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ribbon.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/Ribbon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;4DACwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAsCD,QAAA,MAAM,MAAM,EAAE,UAAU,CAAC,YAAY,CA2BpC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BaseModule } from './types';
|
|
2
|
+
export interface RoundedRectParams {
|
|
3
|
+
/** 0..1 fraction of the maximum corner rounding (1 = full pill / ellipse). */
|
|
4
|
+
erosion?: number;
|
|
5
|
+
/** Stretch the corner arcs horizontally vs vertically. 1 = circular at the badge's
|
|
6
|
+
* native aspect; >1 wider corner arcs; <1 taller corner arcs. */
|
|
7
|
+
eccentricity?: number;
|
|
8
|
+
/** 0..1 vertical squeeze applied to the left and right ends, linearly tapering toward
|
|
9
|
+
* the middle. 1 = ends fully collapsed to the centerline (lemon/lens silhouette). */
|
|
10
|
+
pinch?: number;
|
|
11
|
+
}
|
|
12
|
+
declare const RoundedRect: BaseModule<RoundedRectParams>;
|
|
13
|
+
export default RoundedRect;
|
|
14
|
+
//# sourceMappingURL=RoundedRect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoundedRect.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/RoundedRect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAA+B,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;sEACkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;0FACsF;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,QAAA,MAAM,WAAW,EAAE,UAAU,CAAC,iBAAiB,CAyJ9C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type EdgeProfile = (t: number, depth: number) => number;
|
|
2
|
+
export type BuiltInEdgeName = 'flat' | 'chevron' | 'slant' | 'slant-up' | 'round' | 'scallop' | 'concave-chevron';
|
|
3
|
+
export type EdgeCap = BuiltInEdgeName | EdgeProfile;
|
|
4
|
+
export declare const EDGE_PROFILES: Record<BuiltInEdgeName, EdgeProfile>;
|
|
5
|
+
export declare function resolveEdge(cap: EdgeCap): EdgeProfile;
|
|
6
|
+
//# sourceMappingURL=edgeProfiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edgeProfiles.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/edgeProfiles.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAE/D,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,SAAS,GACT,OAAO,GACP,UAAU,GACV,OAAO,GACP,SAAS,GACT,iBAAiB,CAAC;AAEtB,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,WAAW,CAAC;AAEpD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,eAAe,EAAE,WAAW,CAQ9D,CAAC;AAEF,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CAGrD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BaseModule } from './types';
|
|
2
|
+
import { type ChamferedRectParams } from './ChamferedRect';
|
|
3
|
+
import { type RoundedRectParams } from './RoundedRect';
|
|
4
|
+
import { type PolygonParams } from './Polygon';
|
|
5
|
+
import { type PuzzleParams } from './Puzzle';
|
|
6
|
+
import { type QuatrefoilParams } from './Quatrefoil';
|
|
7
|
+
import { type OctantSplineParams } from './OctantSpline';
|
|
8
|
+
import { type OctantBSplineParams } from './OctantBSpline';
|
|
9
|
+
import { type RibbonParams } from './Ribbon';
|
|
10
|
+
import { type PowerlineParams } from './Powerline';
|
|
11
|
+
export type BadgeBase = 'chamfered-rect' | 'rounded-rect' | 'polygon' | 'puzzle' | 'quatrefoil' | 'octant-spline' | 'octant-bspline' | 'ribbon' | 'powerline';
|
|
12
|
+
export interface BadgeBaseParams {
|
|
13
|
+
'chamfered-rect': ChamferedRectParams;
|
|
14
|
+
'rounded-rect': RoundedRectParams;
|
|
15
|
+
'polygon': PolygonParams;
|
|
16
|
+
'puzzle': PuzzleParams;
|
|
17
|
+
'quatrefoil': QuatrefoilParams;
|
|
18
|
+
'octant-spline': OctantSplineParams;
|
|
19
|
+
'octant-bspline': OctantBSplineParams;
|
|
20
|
+
'ribbon': RibbonParams;
|
|
21
|
+
'powerline': PowerlineParams;
|
|
22
|
+
}
|
|
23
|
+
export declare const BASES: Record<BadgeBase, BaseModule<any>>;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAsB,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpE,OAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AACxD,OAAe,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACrD,OAAmB,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAsB,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAe,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACrD,OAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,MAAM,SAAS,GACjB,gBAAgB,GAChB,cAAc,GACd,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,eAAe,GACf,gBAAgB,GAChB,QAAQ,GACR,WAAW,CAAC;AAEhB,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,cAAc,EAAE,iBAAiB,CAAC;IAClC,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,eAAe,EAAE,kBAAkB,CAAC;IACpC,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,eAAe,CAAC;CAC9B;AAED,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,CAAC,CAUpD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BaseSampler } from './types';
|
|
2
|
+
/** Build a BaseSampler from a clockwise polygon's vertex list (viewBox 0..100). */
|
|
3
|
+
export declare function polygonSampler(verts: [number, number][], boxW: number, boxH: number): BaseSampler;
|
|
4
|
+
//# sourceMappingURL=polygonSampler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polygonSampler.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/polygonSampler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,SAAS,CAAC;AAE3D,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAuCjG"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BadgeVariant, ShapeInsets } from '../types';
|
|
3
|
+
export interface PerimeterPoint {
|
|
4
|
+
/** viewBox coordinate (0..100). */
|
|
5
|
+
x: number;
|
|
6
|
+
/** viewBox coordinate (0..100). */
|
|
7
|
+
y: number;
|
|
8
|
+
/** Outward-pointing normal, unit length in viewBox terms. */
|
|
9
|
+
nx: number;
|
|
10
|
+
ny: number;
|
|
11
|
+
}
|
|
12
|
+
export interface BaseSampler {
|
|
13
|
+
/** SVG path for the body's outline. */
|
|
14
|
+
bodyPath: string;
|
|
15
|
+
/** Sample a perimeter point at CSS arc length `s`. Wraps around `totalCss`. */
|
|
16
|
+
perimeterAt: (s: number) => PerimeterPoint;
|
|
17
|
+
/** Total perimeter length in CSS pixels. */
|
|
18
|
+
totalCss: number;
|
|
19
|
+
}
|
|
20
|
+
export interface BaseModule<P = Record<string, never>> {
|
|
21
|
+
build: (params: P, boxW: number, boxH: number) => BaseSampler;
|
|
22
|
+
defaults?: P;
|
|
23
|
+
insets?: ShapeInsets | ((params: P) => ShapeInsets);
|
|
24
|
+
}
|
|
25
|
+
export interface EffectRenderProps<P = Record<string, never>> {
|
|
26
|
+
sampler: BaseSampler;
|
|
27
|
+
boxW: number;
|
|
28
|
+
boxH: number;
|
|
29
|
+
variant: BadgeVariant;
|
|
30
|
+
params: P;
|
|
31
|
+
phase: number;
|
|
32
|
+
}
|
|
33
|
+
export interface EffectOffsetCtx<P = Record<string, never>> {
|
|
34
|
+
/** CSS px offset from the base perimeter point, in CSS px (caller scales to viewBox). */
|
|
35
|
+
totalCss: number;
|
|
36
|
+
perimeterAt: (s: number) => PerimeterPoint;
|
|
37
|
+
params: P;
|
|
38
|
+
phase: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* An effect layers visual treatment on top of the base shape. Two modes:
|
|
42
|
+
*
|
|
43
|
+
* - **offsetAt**: warp the perimeter. At each sample point `s` along the base perimeter,
|
|
44
|
+
* the effect contributes an additive (dx, dy) in CSS px to displace that sample.
|
|
45
|
+
* Spikes/puffs/bites/scallops use this. Multiple offset-style effects in the same badge
|
|
46
|
+
* compose by summing their offsets — so `[bites, spikes]` honestly draws a bitten outline
|
|
47
|
+
* with spikes radiating from it (the spike center samples just sit further out, but the
|
|
48
|
+
* inner bite samples between spikes still dip in).
|
|
49
|
+
* - **Component + zone**: draw decoration (bevel, sheen, woodgrain, rivets, shadow)
|
|
50
|
+
* without changing the silhouette. `zone: 'background'` draws before the body,
|
|
51
|
+
* `'foreground'` draws after. Decorations typically clip to the current sampler.
|
|
52
|
+
*
|
|
53
|
+
* An effect may provide either or both.
|
|
54
|
+
*/
|
|
55
|
+
export interface EffectModule<P = Record<string, never>> {
|
|
56
|
+
offsetAt?: (s: number, ctx: EffectOffsetCtx<P>) => {
|
|
57
|
+
dx: number;
|
|
58
|
+
dy: number;
|
|
59
|
+
};
|
|
60
|
+
Component?: (props: EffectRenderProps<P>) => ReactNode;
|
|
61
|
+
/** Where decoration sits relative to the body silhouette.
|
|
62
|
+
* - `'background'` paints before the body (under the fill/stroke).
|
|
63
|
+
* - `'foreground'` (default) paints after the body.
|
|
64
|
+
* - `'mask'` contributes black shapes to an SVG mask applied to the body fill/stroke,
|
|
65
|
+
* effectively punching holes through the silhouette. */
|
|
66
|
+
zone?: 'background' | 'foreground' | 'mask';
|
|
67
|
+
defaults?: P;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Badge/bases/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,mCAAmC;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,6DAA6D;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,cAAc,CAAC;IAC3C,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IACnD,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,WAAW,CAAC;IAC9D,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,MAAM,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,WAAW,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAC1D,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,CAAC,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IACxD,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,cAAc,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IACrD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9E,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;IACvD;;;;+DAI2D;IAC3D,IAAI,CAAC,EAAE,YAAY,GAAG,YAAY,GAAG,MAAM,CAAC;IAC5C,QAAQ,CAAC,EAAE,CAAC,CAAC;CACd"}
|