@cutoff/audio-ui-react 1.0.0-preview.20260123.1125
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/LICENSE.md +690 -0
- package/README.md +228 -0
- package/dist/components/defaults/controls/Button.d.ts +51 -0
- package/dist/components/defaults/controls/Button.d.ts.map +1 -0
- package/dist/components/defaults/controls/ButtonView.d.ts +20 -0
- package/dist/components/defaults/controls/ButtonView.d.ts.map +1 -0
- package/dist/components/defaults/controls/CycleButton.d.ts +82 -0
- package/dist/components/defaults/controls/CycleButton.d.ts.map +1 -0
- package/dist/components/defaults/controls/Knob.d.ts +82 -0
- package/dist/components/defaults/controls/Knob.d.ts.map +1 -0
- package/dist/components/defaults/controls/KnobView.d.ts +43 -0
- package/dist/components/defaults/controls/KnobView.d.ts.map +1 -0
- package/dist/components/defaults/controls/Slider.d.ts +79 -0
- package/dist/components/defaults/controls/Slider.d.ts.map +1 -0
- package/dist/components/defaults/controls/SliderView.d.ts +90 -0
- package/dist/components/defaults/controls/SliderView.d.ts.map +1 -0
- package/dist/components/defaults/devices/Keys.d.ts +104 -0
- package/dist/components/defaults/devices/Keys.d.ts.map +1 -0
- package/dist/components/generic/controls/FilmStripBooleanControl.d.ts +58 -0
- package/dist/components/generic/controls/FilmStripBooleanControl.d.ts.map +1 -0
- package/dist/components/generic/controls/FilmStripContinuousControl.d.ts +82 -0
- package/dist/components/generic/controls/FilmStripContinuousControl.d.ts.map +1 -0
- package/dist/components/generic/controls/FilmStripDiscreteControl.d.ts +55 -0
- package/dist/components/generic/controls/FilmStripDiscreteControl.d.ts.map +1 -0
- package/dist/components/generic/controls/FilmstripView.d.ts +36 -0
- package/dist/components/generic/controls/FilmstripView.d.ts.map +1 -0
- package/dist/components/generic/controls/ImageKnob.d.ts +74 -0
- package/dist/components/generic/controls/ImageKnob.d.ts.map +1 -0
- package/dist/components/generic/controls/ImageKnobView.d.ts +38 -0
- package/dist/components/generic/controls/ImageKnobView.d.ts.map +1 -0
- package/dist/components/generic/controls/ImageRotarySwitch.d.ts +54 -0
- package/dist/components/generic/controls/ImageRotarySwitch.d.ts.map +1 -0
- package/dist/components/generic/controls/ImageSwitch.d.ts +62 -0
- package/dist/components/generic/controls/ImageSwitch.d.ts.map +1 -0
- package/dist/components/generic/controls/ImageSwitchView.d.ts +26 -0
- package/dist/components/generic/controls/ImageSwitchView.d.ts.map +1 -0
- package/dist/components/primitives/AdaptiveBox.d.ts +127 -0
- package/dist/components/primitives/AdaptiveBox.d.ts.map +1 -0
- package/dist/components/primitives/controls/BooleanControl.d.ts +66 -0
- package/dist/components/primitives/controls/BooleanControl.d.ts.map +1 -0
- package/dist/components/primitives/controls/ContinuousControl.d.ts +46 -0
- package/dist/components/primitives/controls/ContinuousControl.d.ts.map +1 -0
- package/dist/components/primitives/controls/DiscreteControl.d.ts +70 -0
- package/dist/components/primitives/controls/DiscreteControl.d.ts.map +1 -0
- package/dist/components/primitives/controls/OptionView.d.ts +12 -0
- package/dist/components/primitives/controls/OptionView.d.ts.map +1 -0
- package/dist/components/primitives/svg/FilmstripImage.d.ts +60 -0
- package/dist/components/primitives/svg/FilmstripImage.d.ts.map +1 -0
- package/dist/components/primitives/svg/Image.d.ts +50 -0
- package/dist/components/primitives/svg/Image.d.ts.map +1 -0
- package/dist/components/primitives/svg/LabelRing.d.ts +42 -0
- package/dist/components/primitives/svg/LabelRing.d.ts.map +1 -0
- package/dist/components/primitives/svg/LinearCursor.d.ts +72 -0
- package/dist/components/primitives/svg/LinearCursor.d.ts.map +1 -0
- package/dist/components/primitives/svg/LinearStrip.d.ts +49 -0
- package/dist/components/primitives/svg/LinearStrip.d.ts.map +1 -0
- package/dist/components/primitives/svg/RadialHtmlOverlay.d.ts +29 -0
- package/dist/components/primitives/svg/RadialHtmlOverlay.d.ts.map +1 -0
- package/dist/components/primitives/svg/RadialImage.d.ts +36 -0
- package/dist/components/primitives/svg/RadialImage.d.ts.map +1 -0
- package/dist/components/primitives/svg/RevealingPath.d.ts +37 -0
- package/dist/components/primitives/svg/RevealingPath.d.ts.map +1 -0
- package/dist/components/primitives/svg/RingArc.d.ts +21 -0
- package/dist/components/primitives/svg/RingArc.d.ts.map +1 -0
- package/dist/components/primitives/svg/RotaryImage.d.ts +43 -0
- package/dist/components/primitives/svg/RotaryImage.d.ts.map +1 -0
- package/dist/components/primitives/svg/TickRing.d.ts +53 -0
- package/dist/components/primitives/svg/TickRing.d.ts.map +1 -0
- package/dist/components/primitives/svg/ValueRing.d.ts +38 -0
- package/dist/components/primitives/svg/ValueRing.d.ts.map +1 -0
- package/dist/components/primitives/svg/ValueStrip.d.ts +59 -0
- package/dist/components/primitives/svg/ValueStrip.d.ts.map +1 -0
- package/dist/components/types.d.ts +451 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/hooks/useAdaptiveSize.d.ts +32 -0
- package/dist/hooks/useAdaptiveSize.d.ts.map +1 -0
- package/dist/hooks/useArcAngle.d.ts +23 -0
- package/dist/hooks/useArcAngle.d.ts.map +1 -0
- package/dist/hooks/useAudioParameter.d.ts +89 -0
- package/dist/hooks/useAudioParameter.d.ts.map +1 -0
- package/dist/hooks/useBooleanInteraction.d.ts +106 -0
- package/dist/hooks/useBooleanInteraction.d.ts.map +1 -0
- package/dist/hooks/useBooleanParameterResolution.d.ts +54 -0
- package/dist/hooks/useBooleanParameterResolution.d.ts.map +1 -0
- package/dist/hooks/useContinuousInteraction.d.ts +94 -0
- package/dist/hooks/useContinuousInteraction.d.ts.map +1 -0
- package/dist/hooks/useContinuousParameterResolution.d.ts +75 -0
- package/dist/hooks/useContinuousParameterResolution.d.ts.map +1 -0
- package/dist/hooks/useDiscreteInteraction.d.ts +70 -0
- package/dist/hooks/useDiscreteInteraction.d.ts.map +1 -0
- package/dist/hooks/useDiscreteParameterResolution.d.ts +120 -0
- package/dist/hooks/useDiscreteParameterResolution.d.ts.map +1 -0
- package/dist/hooks/useNoteInteraction.d.ts +84 -0
- package/dist/hooks/useNoteInteraction.d.ts.map +1 -0
- package/dist/hooks/useThemableProps.d.ts +68 -0
- package/dist/hooks/useThemableProps.d.ts.map +1 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3197 -0
- package/dist/index.js.map +1 -0
- package/dist/stats.html +4949 -0
- package/dist/style.css +1 -0
- package/dist/utils/textUtils.d.ts +15 -0
- package/dist/utils/textUtils.d.ts.map +1 -0
- package/dist/utils/theme.d.ts +88 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type LinearCursorProps = {
|
|
4
|
+
/** X coordinate of the center point of the strip */
|
|
5
|
+
cx: number;
|
|
6
|
+
/** Y coordinate of the center point of the strip */
|
|
7
|
+
cy: number;
|
|
8
|
+
/** Length of the strip */
|
|
9
|
+
length: number;
|
|
10
|
+
/** Rotation angle in degrees (0 = vertical, -90 or 270 = horizontal) */
|
|
11
|
+
rotation?: number;
|
|
12
|
+
/** Normalized value between 0 and 1, driving the cursor position */
|
|
13
|
+
normalizedValue: number;
|
|
14
|
+
/** Width of the cursor (x axis) */
|
|
15
|
+
width: number;
|
|
16
|
+
/** Aspect ratio of the cursor (numeric value, e.g., 1 = 1:1, 1.5 = 1.5:1). Height = width / aspectRatio. Ignored when imageHref is provided. */
|
|
17
|
+
aspectRatio: number;
|
|
18
|
+
/** Optional image URL to display as cursor. When provided, roundness and aspectRatio are ignored (image preserves its natural aspect ratio). */
|
|
19
|
+
imageHref?: string;
|
|
20
|
+
/** Corner roundness (normalized 0.0-1.0, maps to 0-20, or CSS variable string). 1.0 = ellipse/circle, 0.0-1.0 (excl.) = rounded rectangle. Ignored when imageHref is provided. */
|
|
21
|
+
roundness?: number | string;
|
|
22
|
+
/** CSS class name */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Inline styles */
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A reusable SVG primitive that renders a cursor that slides along a linear strip.
|
|
29
|
+
* The cursor position is driven by a normalized value (0.0 to 1.0).
|
|
30
|
+
*
|
|
31
|
+
* The cursor slides along a virtual bar centered at (cx, cy) with a defined length.
|
|
32
|
+
* - normalizedValue 0.0: cursor at the bottom of the virtual bar
|
|
33
|
+
* - normalizedValue 1.0: cursor at the top of the virtual bar
|
|
34
|
+
*
|
|
35
|
+
* The rotation prop represents the rotation of the virtual bar (not the cursor itself).
|
|
36
|
+
* The cursor rotates around the strip center (cx, cy) along with the bar.
|
|
37
|
+
*
|
|
38
|
+
* The cursor can be rendered as:
|
|
39
|
+
* - An image (via imageHref)
|
|
40
|
+
* - An SVG shape (rectangle or ellipse based on roundness)
|
|
41
|
+
*
|
|
42
|
+
* This component is designed to be used inside an <svg> element.
|
|
43
|
+
*
|
|
44
|
+
* @param {number} cx - X coordinate of the center point of the strip
|
|
45
|
+
* @param {number} cy - Y coordinate of the center point of the strip
|
|
46
|
+
* @param {number} length - Length of the strip
|
|
47
|
+
* @param {number} [rotation=0] - Rotation angle in degrees of the virtual bar (0 = vertical, -90 or 270 = horizontal)
|
|
48
|
+
* @param {number} normalizedValue - Normalized value between 0 and 1, driving the cursor position
|
|
49
|
+
* @param {number} width - Width of the cursor (x axis)
|
|
50
|
+
* @param {number} aspectRatio - Aspect ratio of the cursor (numeric value, e.g., 1 = 1:1, 1.5 = 1.5:1). Height = width / aspectRatio. Ignored when imageHref is provided.
|
|
51
|
+
* @param {string} [imageHref] - Optional image URL to display as cursor. When provided, roundness and aspectRatio are ignored (image preserves its natural aspect ratio).
|
|
52
|
+
* @param {number | string} [roundness] - Corner roundness (normalized 0.0-1.0, maps to 0-20, or CSS variable string). 1.0 = ellipse/circle. Ignored when imageHref is provided.
|
|
53
|
+
* @param {string} [className] - CSS class name
|
|
54
|
+
* @param {CSSProperties} [style] - Inline styles
|
|
55
|
+
* @returns {JSX.Element} SVG element representing the cursor
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* // Vertical cursor (rectangle)
|
|
60
|
+
* <LinearCursor cx={50} cy={150} length={260} normalizedValue={0.65} width={6} aspectRatio={1} />
|
|
61
|
+
*
|
|
62
|
+
* // Horizontal cursor (ellipse)
|
|
63
|
+
* <LinearCursor cx={150} cy={50} length={260} rotation={-90} normalizedValue={0.75} width={8} aspectRatio={1} roundness={1} />
|
|
64
|
+
*
|
|
65
|
+
* // Image-based cursor (aspectRatio and roundness ignored, image preserves natural aspect ratio)
|
|
66
|
+
* <LinearCursor cx={50} cy={150} length={260} normalizedValue={0.5} width={20} aspectRatio={1} imageHref="/cursor.png" />
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
declare function LinearCursor({ cx, cy, length, rotation, normalizedValue, width, aspectRatio, imageHref, roundness, className, style, }: LinearCursorProps): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
declare const _default: React.MemoExoticComponent<typeof LinearCursor>;
|
|
71
|
+
export default _default;
|
|
72
|
+
//# sourceMappingURL=LinearCursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinearCursor.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/LinearCursor.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAW,MAAM,OAAO,CAAC;AAGtD,MAAM,MAAM,iBAAiB,GAAG;IAC5B,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,eAAe,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,gJAAgJ;IAChJ,WAAW,EAAE,MAAM,CAAC;IACpB,gJAAgJ;IAChJ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kLAAkL;IAClL,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,iBAAS,YAAY,CAAC,EAClB,EAAE,EACF,EAAE,EACF,MAAM,EACN,QAAY,EACZ,eAAe,EACf,KAAK,EACL,WAAW,EACX,SAAS,EACT,SAA6B,EAC7B,SAAS,EACT,KAAK,GACR,EAAE,iBAAiB,2CA6GnB;;AAED,wBAAwC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type LinearStripProps = {
|
|
4
|
+
/** X coordinate of the center point */
|
|
5
|
+
cx: number;
|
|
6
|
+
/** Y coordinate of the center point */
|
|
7
|
+
cy: number;
|
|
8
|
+
/** Length of the strip */
|
|
9
|
+
length: number;
|
|
10
|
+
/** Rotation angle in degrees (0 = vertical, -90 or 270 = horizontal) */
|
|
11
|
+
rotation?: number;
|
|
12
|
+
/** Width of the strip (thickness) */
|
|
13
|
+
thickness: number;
|
|
14
|
+
/** Corner roundness (normalized 0.0-1.0, maps to 0-20, or CSS variable string) */
|
|
15
|
+
roundness?: number | string;
|
|
16
|
+
/** CSS class name */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Inline styles */
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A reusable SVG primitive that renders a linear strip (rectangle) for linear controls.
|
|
23
|
+
* The strip is positioned at a center point (cx, cy) and can be rotated to any angle.
|
|
24
|
+
*
|
|
25
|
+
* This component is designed to be used inside an <svg> element.
|
|
26
|
+
*
|
|
27
|
+
* @param {number} cx - X coordinate of the center point
|
|
28
|
+
* @param {number} cy - Y coordinate of the center point
|
|
29
|
+
* @param {number} length - Length of the strip (height of the rectangle)
|
|
30
|
+
* @param {number} [rotation=0] - Rotation angle in degrees (0 = vertical, -90 or 270 = horizontal)
|
|
31
|
+
* @param {number} thickness - Width of the strip (thickness of the rectangle)
|
|
32
|
+
* @param {number | string} [roundness] - Corner roundness (normalized 0.0-1.0, maps to 0-20, or CSS variable string)
|
|
33
|
+
* @param {string} [className] - CSS class name
|
|
34
|
+
* @param {CSSProperties} [style] - Inline styles
|
|
35
|
+
* @returns {JSX.Element} SVG rect element representing the linear strip
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // Vertical strip (default)
|
|
40
|
+
* <LinearStrip cx={50} cy={150} length={260} thickness={6} />
|
|
41
|
+
*
|
|
42
|
+
* // Horizontal strip (rotated -90 degrees)
|
|
43
|
+
* <LinearStrip cx={150} cy={50} length={260} thickness={6} rotation={-90} />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare function LinearStrip({ cx, cy, length, rotation, thickness, roundness, className, style, }: LinearStripProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare const _default: React.MemoExoticComponent<typeof LinearStrip>;
|
|
48
|
+
export default _default;
|
|
49
|
+
//# sourceMappingURL=LinearStrip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinearStrip.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/LinearStrip.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAW,MAAM,OAAO,CAAC;AAItD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,iBAAS,WAAW,CAAC,EACjB,EAAE,EACF,EAAE,EACF,MAAM,EACN,QAAY,EACZ,SAAS,EACT,SAA6B,EAC7B,SAAS,EACT,KAAK,GACR,EAAE,gBAAgB,2CA0DlB;;AAED,wBAAuC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type RadialHtmlOverlayProps = {
|
|
4
|
+
/** X coordinate of the center point */
|
|
5
|
+
cx: number;
|
|
6
|
+
/** Y coordinate of the center point */
|
|
7
|
+
cy: number;
|
|
8
|
+
/** Radius from center to the edge of the content box. The content will be a square with side = radius * 2 */
|
|
9
|
+
radius: number;
|
|
10
|
+
/** Content to render inside the overlay */
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/** Additional CSS class name */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Inline styles for the foreignObject */
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
/** Pointer events behavior (default: "none" to let clicks pass through to SVG below, set to "auto" if interactive) */
|
|
17
|
+
pointerEvents?: "none" | "auto";
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A primitive that renders HTML content inside an SVG at a radial position.
|
|
21
|
+
* It creates a square foreignObject centered at (cx, cy) with size based on radius.
|
|
22
|
+
*
|
|
23
|
+
* This is the preferred way to render text inside knobs, as it leverages the browser's
|
|
24
|
+
* native HTML text rendering engine (Flexbox, wrapping, fonts) which is superior to SVG text.
|
|
25
|
+
*/
|
|
26
|
+
declare function RadialHtmlOverlay({ cx, cy, radius, children, className, style, pointerEvents, }: RadialHtmlOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare const _default: React.MemoExoticComponent<typeof RadialHtmlOverlay>;
|
|
28
|
+
export default _default;
|
|
29
|
+
//# sourceMappingURL=RadialHtmlOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadialHtmlOverlay.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/RadialHtmlOverlay.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,sBAAsB,GAAG;IACjC,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,6GAA6G;IAC7G,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,sHAAsH;IACtH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC,CAAC;AAEF;;;;;;GAMG;AACH,iBAAS,iBAAiB,CAAC,EACvB,EAAE,EACF,EAAE,EACF,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,EACL,aAAsB,GACzB,EAAE,sBAAsB,2CAmCxB;;AAED,wBAA6C"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type RadialImageProps = {
|
|
4
|
+
/** X coordinate of the center point */
|
|
5
|
+
cx: number;
|
|
6
|
+
/** Y coordinate of the center point */
|
|
7
|
+
cy: number;
|
|
8
|
+
/** Radius the content should fit within */
|
|
9
|
+
radius: number;
|
|
10
|
+
/** Optional image URL to display */
|
|
11
|
+
imageHref?: string;
|
|
12
|
+
/** Optional SVG content to display (e.g., icon components) */
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
/** Optional SVG transform attribute */
|
|
15
|
+
transform?: string;
|
|
16
|
+
/** Additional CSS class name */
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Inline styles.
|
|
20
|
+
* Supports `color` property for icon theming - icons using currentColor will inherit this value.
|
|
21
|
+
*/
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A primitive component that displays static content at radial coordinates.
|
|
26
|
+
* The content is sized to fit within the specified radius and centered at (cx, cy).
|
|
27
|
+
*
|
|
28
|
+
* This component can display an image (via imageHref) or arbitrary SVG content (via children).
|
|
29
|
+
* It is designed to work alongside ValueRing and RotaryImage components in composing knobs.
|
|
30
|
+
*
|
|
31
|
+
* Useful for displaying icons or static images within knob compositions.
|
|
32
|
+
*/
|
|
33
|
+
declare function RadialImage({ cx, cy, radius, imageHref, children, transform, className, style }: RadialImageProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare const _default: React.MemoExoticComponent<typeof RadialImage>;
|
|
35
|
+
export default _default;
|
|
36
|
+
//# sourceMappingURL=RadialImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadialImage.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/RadialImage.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,MAAM,MAAM,gBAAgB,GAAG;IAC3B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF;;;;;;;;GAQG;AACH,iBAAS,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,gBAAgB,2CA2B1G;;AAED,wBAAuC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React, SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface RevealingPathProps extends Omit<SVGProps<SVGPathElement>, "strokeDasharray" | "strokeDashoffset" | "pathLength"> {
|
|
4
|
+
/**
|
|
5
|
+
* Normalized value between 0 and 1 indicating how much of the path to reveal.
|
|
6
|
+
* 0 = path is completely hidden
|
|
7
|
+
* 1 = path is completely visible
|
|
8
|
+
*/
|
|
9
|
+
normalizedValue: number;
|
|
10
|
+
/**
|
|
11
|
+
* The internal resolution used for the path length calculation.
|
|
12
|
+
* Higher values might offer smoother animations but "100" is usually sufficient for percentage-based fills.
|
|
13
|
+
* Defaults to 100.
|
|
14
|
+
*/
|
|
15
|
+
resolution?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A primitive SVG component that reveals a path from start to end using CSS stroke-dashoffset.
|
|
19
|
+
*
|
|
20
|
+
* This component uses the SVG `pathLength` attribute to normalize the path's length
|
|
21
|
+
* calculation, allowing for performant "filling" animations without calculating
|
|
22
|
+
* the actual geometric length of the path in JavaScript.
|
|
23
|
+
*
|
|
24
|
+
* Usage:
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <RevealingPath
|
|
27
|
+
* d="M..."
|
|
28
|
+
* normalizedValue={0.5} // 50% revealed from the start
|
|
29
|
+
* stroke="currentColor"
|
|
30
|
+
* fill="none"
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare function RevealingPath({ normalizedValue, resolution, className, style, ...props }: RevealingPathProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare const _default: React.MemoExoticComponent<typeof RevealingPath>;
|
|
36
|
+
export default _default;
|
|
37
|
+
//# sourceMappingURL=RevealingPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RevealingPath.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/RevealingPath.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAC5C,QAAQ,CAAC,cAAc,CAAC,EACxB,iBAAiB,GAAG,kBAAkB,GAAG,YAAY,CACxD;IACG;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,aAAa,CAAC,EAAE,eAAe,EAAE,UAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CAyB3G;;AAED,wBAAyC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type RingArcProps = {
|
|
4
|
+
startAngle: number;
|
|
5
|
+
endAngle: number;
|
|
6
|
+
style: CSSProperties | undefined;
|
|
7
|
+
cx: number;
|
|
8
|
+
cy: number;
|
|
9
|
+
radius: number;
|
|
10
|
+
thickness: number;
|
|
11
|
+
strokeLinecap: "round" | "square" | "butt" | string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Helper component to render either a circle or path based on whether it's a full circle.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
declare function RingArc({ startAngle, endAngle, style, cx, cy, radius, thickness, strokeLinecap }: RingArcProps): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
declare const _default: React.MemoExoticComponent<typeof RingArc>;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=RingArc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RingArc.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/RingArc.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAW,MAAM,OAAO,CAAC;AAGtD,MAAM,MAAM,YAAY,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;CACvD,CAAC;AAEF;;;;GAIG;AACH,iBAAS,OAAO,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,YAAY,kDA0CvG;;AAED,wBAAmC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type RotaryImageProps = {
|
|
4
|
+
/** X coordinate of the center point */
|
|
5
|
+
cx: number;
|
|
6
|
+
/** Y coordinate of the center point */
|
|
7
|
+
cy: number;
|
|
8
|
+
/** Radius of the rotary control (used for bounds/image sizing) */
|
|
9
|
+
radius: number;
|
|
10
|
+
/** Normalized value between 0 and 1 */
|
|
11
|
+
normalizedValue: number;
|
|
12
|
+
/** Whether to start the arc from center (bipolar mode) */
|
|
13
|
+
bipolar?: boolean;
|
|
14
|
+
/** Openness of the arc in degrees (default 90) */
|
|
15
|
+
openness?: number;
|
|
16
|
+
/** Optional image URL to display */
|
|
17
|
+
imageHref?: string;
|
|
18
|
+
/** Optional SVG content to rotate */
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/** Optional rotation angle offset in degrees (default 0) */
|
|
21
|
+
rotation?: number;
|
|
22
|
+
/** Optional number of discrete positions. When defined, the value will snap to the nearest position. */
|
|
23
|
+
positions?: number;
|
|
24
|
+
/** Optional X coordinate for the center of rotation (defaults to cx) */
|
|
25
|
+
pivotX?: number;
|
|
26
|
+
/** Optional Y coordinate for the center of rotation (defaults to cy) */
|
|
27
|
+
pivotY?: number;
|
|
28
|
+
/** Additional CSS class name */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Inline styles */
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A primitive component that rotates its content based on a normalized value.
|
|
35
|
+
* Designed to work with the same angle logic as ValueRing.tsx.
|
|
36
|
+
*
|
|
37
|
+
* This component wraps RadialImage and applies rotation based on the normalized value.
|
|
38
|
+
* It can display an image (via imageHref) or arbitrary SVG content (via children).
|
|
39
|
+
*/
|
|
40
|
+
declare function RotaryImage({ cx, cy, radius, normalizedValue, bipolar, openness, imageHref, children, rotation, positions, pivotX, pivotY, className, style, }: RotaryImageProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare const _default: React.MemoExoticComponent<typeof RotaryImage>;
|
|
42
|
+
export default _default;
|
|
43
|
+
//# sourceMappingURL=RotaryImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RotaryImage.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/RotaryImage.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI7C,MAAM,MAAM,gBAAgB,GAAG;IAC3B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wGAAwG;IACxG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,iBAAS,WAAW,CAAC,EACjB,EAAE,EACF,EAAE,EACF,MAAM,EACN,eAAe,EACf,OAAe,EACf,QAAa,EACb,SAAS,EACT,QAAQ,EACR,QAAY,EACZ,SAAS,EACT,MAAM,EACN,MAAM,EACN,SAAS,EACT,KAAK,GACR,EAAE,gBAAgB,2CAqBlB;;AAED,wBAAuC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { default as React, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type TickData = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
angle: number;
|
|
7
|
+
index: number;
|
|
8
|
+
};
|
|
9
|
+
export type TickRingProps = {
|
|
10
|
+
/** X coordinate of the center point */
|
|
11
|
+
cx: number;
|
|
12
|
+
/** Y coordinate of the center point */
|
|
13
|
+
cy: number;
|
|
14
|
+
/** Outer radius of the ring (ticks extend inward) */
|
|
15
|
+
radius: number;
|
|
16
|
+
/** Length of the ticks in pixels (or diameter of dots) */
|
|
17
|
+
thickness?: number;
|
|
18
|
+
/** Openness of the ring in degrees (default 90) */
|
|
19
|
+
openness?: number;
|
|
20
|
+
/** Rotation offset in degrees (default 0) */
|
|
21
|
+
rotation?: number;
|
|
22
|
+
/** Total number of ticks to distribute evenly */
|
|
23
|
+
count?: number;
|
|
24
|
+
/** Angle in degrees between ticks (alternative to count) */
|
|
25
|
+
step?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Shape of the ticks:
|
|
28
|
+
* - "line": Radial lines (optimized single path)
|
|
29
|
+
* - "dot": Circles (optimized single path)
|
|
30
|
+
* - "pill": Rounded lines (using stroke-linecap round)
|
|
31
|
+
*/
|
|
32
|
+
variant?: "line" | "dot" | "pill";
|
|
33
|
+
/**
|
|
34
|
+
* Optional callback to render custom content at each tick position.
|
|
35
|
+
* If provided, the component bails out of single-path optimization and renders generic ReactNodes.
|
|
36
|
+
*/
|
|
37
|
+
renderTick?: (data: TickData) => ReactNode;
|
|
38
|
+
/** CSS class name */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** Inline styles */
|
|
41
|
+
style?: CSSProperties;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* A reusable SVG primitive that renders a ring of tick marks.
|
|
45
|
+
* Useful for creating scales on knobs and dials.
|
|
46
|
+
*
|
|
47
|
+
* Supports optimized single-path rendering for lines and dots,
|
|
48
|
+
* or custom rendering via renderTick callback.
|
|
49
|
+
*/
|
|
50
|
+
declare function TickRing({ cx, cy, radius, thickness, openness, rotation, count, step, variant, renderTick, className, style, }: TickRingProps): import("react/jsx-runtime").JSX.Element | null;
|
|
51
|
+
declare const _default: React.MemoExoticComponent<typeof TickRing>;
|
|
52
|
+
export default _default;
|
|
53
|
+
//# sourceMappingURL=TickRing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TickRing.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/TickRing.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAGjE,MAAM,MAAM,QAAQ,GAAG;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,SAAS,CAAC;IAC3C,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,iBAAS,QAAQ,CAAC,EACd,EAAE,EACF,EAAE,EACF,MAAM,EACN,SAAa,EACb,QAAa,EACb,QAAY,EACZ,KAAK,EACL,IAAI,EACJ,OAAgB,EAChB,UAAU,EACV,SAAS,EACT,KAAK,GACR,EAAE,aAAa,kDAsHf;;AAED,wBAAoC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ValueRingProps = {
|
|
4
|
+
/** X coordinate of the center point */
|
|
5
|
+
cx: number;
|
|
6
|
+
/** Y coordinate of the center point */
|
|
7
|
+
cy: number;
|
|
8
|
+
/** Radius of the ring */
|
|
9
|
+
radius: number;
|
|
10
|
+
/** Normalized value between 0 and 1 */
|
|
11
|
+
normalizedValue: number;
|
|
12
|
+
/** Whether to start the arc from center (bipolar mode) */
|
|
13
|
+
bipolar?: boolean;
|
|
14
|
+
/** Thickness of the knob's stroke (1-20 pixels) */
|
|
15
|
+
thickness?: number;
|
|
16
|
+
/** Roundness for stroke linecap (false = square, true = round, or CSS variable string) */
|
|
17
|
+
roundness?: boolean | string;
|
|
18
|
+
/** Openness of the ring in degrees (value between 0-360º; 0º: closed; 90º: 3/4 open; 180º: half-circle;) */
|
|
19
|
+
openness?: number;
|
|
20
|
+
/** Optional rotation angle offset in degrees (default 0) */
|
|
21
|
+
rotation?: number;
|
|
22
|
+
/** Optional number of discrete positions. When defined, the value will snap to the nearest position. */
|
|
23
|
+
positions?: number;
|
|
24
|
+
/** Optional style overrides for the foreground (value) arc */
|
|
25
|
+
fgArcStyle?: CSSProperties;
|
|
26
|
+
/** Optional style overrides for the background arc */
|
|
27
|
+
bgArcStyle?: CSSProperties;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* A reusable SVG fragment that renders a ring (arc) used in circular controls like knobs.
|
|
31
|
+
* It handles the calculation of SVG paths for both the background track and the foreground value indicator.
|
|
32
|
+
*
|
|
33
|
+
* This component is designed to be used inside an <svg> element.
|
|
34
|
+
*/
|
|
35
|
+
declare function ValueRing({ cx, cy, radius, normalizedValue, bipolar, thickness, roundness, openness, rotation, positions, fgArcStyle, bgArcStyle, }: ValueRingProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
declare const _default: React.MemoExoticComponent<typeof ValueRing>;
|
|
37
|
+
export default _default;
|
|
38
|
+
//# sourceMappingURL=ValueRing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValueRing.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/ValueRing.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAW,MAAM,OAAO,CAAC;AAItD,MAAM,MAAM,cAAc,GAAG;IACzB,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wGAAwG;IACxG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,sDAAsD;IACtD,UAAU,CAAC,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF;;;;;GAKG;AACH,iBAAS,SAAS,CAAC,EACf,EAAE,EACF,EAAE,EACF,MAAM,EACN,eAAe,EACf,OAAe,EACf,SAAa,EACb,SAAS,EACT,QAAa,EACb,QAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,GACb,EAAE,cAAc,2CA8DhB;;AAED,wBAAqC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ValueStripProps = {
|
|
4
|
+
/** X coordinate of the center point */
|
|
5
|
+
cx: number;
|
|
6
|
+
/** Y coordinate of the center point */
|
|
7
|
+
cy: number;
|
|
8
|
+
/** Length of the strip */
|
|
9
|
+
length: number;
|
|
10
|
+
/** Rotation angle in degrees (0 = vertical, -90 or 270 = horizontal) */
|
|
11
|
+
rotation?: number;
|
|
12
|
+
/** Width of the strip (thickness) */
|
|
13
|
+
thickness: number;
|
|
14
|
+
/** Corner roundness (normalized 0.0-1.0, maps to 0-20, or CSS variable string) */
|
|
15
|
+
roundness?: number | string;
|
|
16
|
+
/** Normalized value between 0 and 1 */
|
|
17
|
+
normalizedValue: number;
|
|
18
|
+
/** Whether to start fill from center (bipolar mode) */
|
|
19
|
+
bipolar?: boolean;
|
|
20
|
+
/** CSS class name */
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Inline styles */
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A reusable SVG primitive that renders the active (foreground) portion of a linear strip.
|
|
27
|
+
* Designed to work in tandem with LinearStrip (background).
|
|
28
|
+
*
|
|
29
|
+
* The strip is positioned at a center point (cx, cy) and can be rotated to any angle.
|
|
30
|
+
* - In unipolar mode (default), it fills from the "bottom" (relative to rotation) to the current value.
|
|
31
|
+
* - In bipolar mode, it fills from the center to the current value.
|
|
32
|
+
*
|
|
33
|
+
* This component is designed to be used inside an <svg> element.
|
|
34
|
+
*
|
|
35
|
+
* @param {number} cx - X coordinate of the center point
|
|
36
|
+
* @param {number} cy - Y coordinate of the center point
|
|
37
|
+
* @param {number} length - Length of the strip
|
|
38
|
+
* @param {number} [rotation=0] - Rotation angle in degrees (0 = vertical, -90 or 270 = horizontal)
|
|
39
|
+
* @param {number} thickness - Width of the strip (thickness)
|
|
40
|
+
* @param {number | string} [roundness] - Corner roundness (normalized 0.0-1.0, maps to 0-20, or CSS variable string)
|
|
41
|
+
* @param {number} normalizedValue - Normalized value between 0 and 1
|
|
42
|
+
* @param {boolean} [bipolar=false] - Whether to start fill from center (bipolar mode)
|
|
43
|
+
* @param {string} [className] - CSS class name
|
|
44
|
+
* @param {CSSProperties} [style] - Inline styles
|
|
45
|
+
* @returns {JSX.Element | null} SVG rect element representing the filled portion, or null if height is too small
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* // Vertical value strip (unipolar)
|
|
50
|
+
* <ValueStrip cx={50} cy={150} length={260} thickness={6} normalizedValue={0.65} />
|
|
51
|
+
*
|
|
52
|
+
* // Horizontal value strip (bipolar)
|
|
53
|
+
* <ValueStrip cx={150} cy={50} length={260} thickness={6} rotation={-90} normalizedValue={0.75} bipolar />
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare function ValueStrip({ cx, cy, length, rotation, thickness, roundness, normalizedValue, bipolar, className, style, }: ValueStripProps): import("react/jsx-runtime").JSX.Element | null;
|
|
57
|
+
declare const _default: React.MemoExoticComponent<typeof ValueStrip>;
|
|
58
|
+
export default _default;
|
|
59
|
+
//# sourceMappingURL=ValueStrip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValueStrip.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/ValueStrip.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAW,MAAM,OAAO,CAAC;AAGtD,MAAM,MAAM,eAAe,GAAG;IAC1B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,iBAAS,UAAU,CAAC,EAChB,EAAE,EACF,EAAE,EACF,MAAM,EACN,QAAY,EACZ,SAAS,EACT,SAA6B,EAC7B,eAAe,EACf,OAAe,EACf,SAAS,EACT,KAAK,GACR,EAAE,eAAe,kDAyEjB;;AAED,wBAAsC"}
|