@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,62 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdaptiveBoxProps, AdaptiveSizeProps, BooleanControlProps } from '../../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props specific to image switch controls
|
|
6
|
+
*/
|
|
7
|
+
export type ImageSwitchProps = {
|
|
8
|
+
/** Width of the viewBox (determines viewBox width) */
|
|
9
|
+
frameWidth: number;
|
|
10
|
+
/** Height of the viewBox (determines viewBox height) */
|
|
11
|
+
frameHeight: number;
|
|
12
|
+
/** URL to the image for false/off state */
|
|
13
|
+
imageHrefFalse: string;
|
|
14
|
+
/** URL to the image for true/on state */
|
|
15
|
+
imageHrefTrue: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Props for the ImageSwitch component
|
|
19
|
+
*/
|
|
20
|
+
export type ImageSwitchComponentProps = BooleanControlProps & AdaptiveSizeProps & AdaptiveBoxProps & ImageSwitchProps;
|
|
21
|
+
/**
|
|
22
|
+
* A boolean control that displays one of two images based on the boolean value.
|
|
23
|
+
*
|
|
24
|
+
* This component provides full access to all library features:
|
|
25
|
+
*
|
|
26
|
+
* - Complete layout system: AdaptiveBox with all sizing modes, label positioning, alignment
|
|
27
|
+
* - Full parameter model: BooleanParameter with latch/momentary modes
|
|
28
|
+
* - Complete interaction system: Click, drag-in/drag-out, and keyboard interactions
|
|
29
|
+
* - Full accessibility: ARIA attributes, focus management, keyboard navigation
|
|
30
|
+
*
|
|
31
|
+
* The image displayed is determined by the boolean value:
|
|
32
|
+
* - `false` (normalized 0.0) displays `imageHrefFalse`
|
|
33
|
+
* - `true` (normalized 1.0) displays `imageHrefTrue`
|
|
34
|
+
*
|
|
35
|
+
* Supports two modes of operation:
|
|
36
|
+
* 1. Strict Mode (Parameter only): Model provided via parameter prop.
|
|
37
|
+
* 2. Ad-Hoc Mode (Props only): Model created from individual props (label, latch, etc.).
|
|
38
|
+
*
|
|
39
|
+
* Note: This component does NOT support themable props (color, roundness, thickness) as
|
|
40
|
+
* visuals are entirely determined by the image content.
|
|
41
|
+
*
|
|
42
|
+
* @param props - Component props
|
|
43
|
+
* @returns Rendered ImageSwitch component
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <ImageSwitch
|
|
48
|
+
* value={isFavorite}
|
|
49
|
+
* onChange={(e) => setIsFavorite(e.value)}
|
|
50
|
+
* label="Favorite"
|
|
51
|
+
* latch={true}
|
|
52
|
+
* frameWidth={100}
|
|
53
|
+
* frameHeight={100}
|
|
54
|
+
* imageHrefFalse="/star-off.png"
|
|
55
|
+
* imageHrefTrue="/star-on.png"
|
|
56
|
+
* />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
declare function ImageSwitch({ latch, value, onChange, label, adaptiveSize, size, displayMode, labelMode, labelPosition, labelAlign, frameWidth, frameHeight, imageHrefFalse, imageHrefTrue, parameter, paramId, midiResolution, onClick, onMouseDown, onMouseUp, onMouseEnter, onMouseLeave, className, style, }: ImageSwitchComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
declare const _default: React.MemoExoticComponent<typeof ImageSwitch>;
|
|
61
|
+
export default _default;
|
|
62
|
+
//# sourceMappingURL=ImageSwitch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/generic/controls/ImageSwitch.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAEtH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,iBAAS,WAAW,CAAC,EACjB,KAAa,EACb,KAAa,EACb,QAAQ,EACR,KAAK,EACL,YAAoB,EACpB,IAAe,EACf,WAAW,EACX,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,SAAS,EACT,OAAO,EACP,cAAc,EACd,OAAO,EACP,WAAW,EACX,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,GACR,EAAE,yBAAyB,2CAkC3B;;AAED,wBAAuC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ControlComponent } from '../../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props specific to image switch visualization
|
|
6
|
+
*/
|
|
7
|
+
export type ImageSwitchViewProps = {
|
|
8
|
+
/** Normalized value between 0 and 1 */
|
|
9
|
+
normalizedValue: number;
|
|
10
|
+
/** Width of the viewBox (determines viewBox width) */
|
|
11
|
+
frameWidth: number;
|
|
12
|
+
/** Height of the viewBox (determines viewBox height) */
|
|
13
|
+
frameHeight: number;
|
|
14
|
+
/** URL to the image for false/off state */
|
|
15
|
+
imageHrefFalse: string;
|
|
16
|
+
/** URL to the image for true/on state */
|
|
17
|
+
imageHrefTrue: string;
|
|
18
|
+
/** Additional CSS class name */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** Content to render (unused in image view but required by generic props) */
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
type ImageSwitchViewComponentProps = Omit<ImageSwitchViewProps, "normalizedValue" | "className" | "style" | "children">;
|
|
24
|
+
declare const _default: ControlComponent<ImageSwitchViewComponentProps>;
|
|
25
|
+
export default _default;
|
|
26
|
+
//# sourceMappingURL=ImageSwitchView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageSwitchView.d.ts","sourceRoot":"","sources":["../../../../src/components/generic/controls/ImageSwitchView.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CAAC;AAiDF,KAAK,6BAA6B,GAAG,IAAI,CAAC,oBAAoB,EAAE,iBAAiB,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;wBAEvE,gBAAgB,CAAC,6BAA6B,CAAC;AAAhG,wBAAiG"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { default as React, CSSProperties, PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
export type FlexAlign = "start" | "center" | "end";
|
|
4
|
+
export type DisplayMode = "scaleToFit" | "fill";
|
|
5
|
+
export type LabelMode = "none" | "hidden" | "visible";
|
|
6
|
+
export type LabelPosition = "above" | "below";
|
|
7
|
+
export interface AdaptiveBoxProps extends PropsWithChildren {
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
displayMode?: DisplayMode;
|
|
11
|
+
labelMode?: LabelMode;
|
|
12
|
+
labelHeightUnits?: number;
|
|
13
|
+
labelOverflow?: "ellipsis" | "abbreviate" | "auto";
|
|
14
|
+
/**
|
|
15
|
+
* ViewBox width in the same coordinate system as the content.
|
|
16
|
+
* For SVG content, this maps to the SVG viewBox width.
|
|
17
|
+
* For Canvas/GL content (future), this will map to canvas/gl dimensions.
|
|
18
|
+
*/
|
|
19
|
+
viewBoxWidth: number;
|
|
20
|
+
/**
|
|
21
|
+
* ViewBox height in the same coordinate system as the content.
|
|
22
|
+
* For SVG content, this maps to the SVG viewBox height.
|
|
23
|
+
* For Canvas/GL content (future), this will map to canvas/gl dimensions.
|
|
24
|
+
*/
|
|
25
|
+
viewBoxHeight: number;
|
|
26
|
+
minWidth?: number;
|
|
27
|
+
minHeight?: number;
|
|
28
|
+
debug?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* AdaptiveBox provides a CSS/SVG-based layout system for controls with labels.
|
|
32
|
+
*
|
|
33
|
+
* Handles aspect ratio preservation, label positioning, and responsive sizing using
|
|
34
|
+
* container queries. The component automatically adapts its layout based on labelMode
|
|
35
|
+
* and viewBox dimensions to prevent layout shift during initial render.
|
|
36
|
+
*
|
|
37
|
+
* @param props - Component props including layout configuration and viewBox dimensions
|
|
38
|
+
* @returns Rendered AdaptiveBox with subcomponents (Svg, Label, HtmlOverlay) available via context
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <AdaptiveBox
|
|
43
|
+
* viewBoxWidth={100}
|
|
44
|
+
* viewBoxHeight={100}
|
|
45
|
+
* labelMode="visible"
|
|
46
|
+
* >
|
|
47
|
+
* <AdaptiveBox.Svg>
|
|
48
|
+
* <circle cx={50} cy={50} r={40} />
|
|
49
|
+
* </AdaptiveBox.Svg>
|
|
50
|
+
* <AdaptiveBox.Label>Volume</AdaptiveBox.Label>
|
|
51
|
+
* </AdaptiveBox>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function AdaptiveBox({ className, style, displayMode, labelMode, labelHeightUnits, labelOverflow, viewBoxWidth, viewBoxHeight, minWidth, minHeight, debug, children, }: AdaptiveBoxProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export declare namespace AdaptiveBox {
|
|
56
|
+
var Svg: ({ vAlign, hAlign, className, style, children, onWheel, ...rest }: AdaptiveBoxSvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
var Label: ({ className, style, position, align, children }: AdaptiveBoxLabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
58
|
+
var HtmlOverlay: ({ className, style, pointerEvents, children }: AdaptiveBoxHtmlOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
}
|
|
60
|
+
export interface AdaptiveBoxSvgProps extends PropsWithChildren {
|
|
61
|
+
vAlign?: FlexAlign;
|
|
62
|
+
hAlign?: FlexAlign;
|
|
63
|
+
className?: string;
|
|
64
|
+
style?: CSSProperties;
|
|
65
|
+
onWheel?: (e: React.WheelEvent<SVGSVGElement>) => void;
|
|
66
|
+
onClick?: React.MouseEventHandler<SVGSVGElement>;
|
|
67
|
+
onDoubleClick?: React.MouseEventHandler<SVGSVGElement>;
|
|
68
|
+
onMouseDown?: React.MouseEventHandler<SVGSVGElement>;
|
|
69
|
+
onMouseUp?: React.MouseEventHandler<SVGSVGElement>;
|
|
70
|
+
onMouseEnter?: React.MouseEventHandler<SVGSVGElement>;
|
|
71
|
+
onMouseLeave?: React.MouseEventHandler<SVGSVGElement>;
|
|
72
|
+
onTouchStart?: React.TouchEventHandler<SVGSVGElement>;
|
|
73
|
+
onTouchMove?: React.TouchEventHandler<SVGSVGElement>;
|
|
74
|
+
onTouchEnd?: React.TouchEventHandler<SVGSVGElement>;
|
|
75
|
+
onKeyDown?: React.KeyboardEventHandler<SVGSVGElement>;
|
|
76
|
+
onKeyUp?: React.KeyboardEventHandler<SVGSVGElement>;
|
|
77
|
+
onPointerDown?: React.PointerEventHandler<SVGSVGElement>;
|
|
78
|
+
onPointerMove?: React.PointerEventHandler<SVGSVGElement>;
|
|
79
|
+
onPointerUp?: React.PointerEventHandler<SVGSVGElement>;
|
|
80
|
+
onPointerCancel?: React.PointerEventHandler<SVGSVGElement>;
|
|
81
|
+
tabIndex?: number;
|
|
82
|
+
role?: string;
|
|
83
|
+
"aria-valuenow"?: number;
|
|
84
|
+
"aria-valuemin"?: number;
|
|
85
|
+
"aria-valuemax"?: number;
|
|
86
|
+
"aria-label"?: string;
|
|
87
|
+
"aria-valuetext"?: string;
|
|
88
|
+
"aria-orientation"?: "horizontal" | "vertical";
|
|
89
|
+
"aria-pressed"?: boolean | "mixed";
|
|
90
|
+
}
|
|
91
|
+
declare function Svg({ vAlign, hAlign, className, style, children, onWheel, ...rest }: AdaptiveBoxSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
92
|
+
export interface AdaptiveBoxLabelProps extends PropsWithChildren {
|
|
93
|
+
className?: string;
|
|
94
|
+
style?: CSSProperties;
|
|
95
|
+
position?: LabelPosition;
|
|
96
|
+
align?: FlexAlign;
|
|
97
|
+
}
|
|
98
|
+
declare function Label({ className, style, position, align, children }: AdaptiveBoxLabelProps): import("react/jsx-runtime").JSX.Element | null;
|
|
99
|
+
export interface AdaptiveBoxHtmlOverlayProps extends PropsWithChildren {
|
|
100
|
+
className?: string;
|
|
101
|
+
style?: CSSProperties;
|
|
102
|
+
/**
|
|
103
|
+
* Pointer events behavior.
|
|
104
|
+
* - "none" (default): Clicks pass through to elements below (e.g., SVG)
|
|
105
|
+
* - "auto": Overlay is interactive
|
|
106
|
+
*/
|
|
107
|
+
pointerEvents?: "none" | "auto";
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* HTML overlay positioned over the main content area (same grid cell as Svg/Canvas/GL).
|
|
111
|
+
* Used for rendering text, icons, or other HTML content on top of SVG graphics.
|
|
112
|
+
*
|
|
113
|
+
* This approach avoids Safari's foreignObject rendering bugs with container queries
|
|
114
|
+
* by rendering HTML content outside the SVG as a sibling element.
|
|
115
|
+
*
|
|
116
|
+
* The overlay provides a container query context (`containerType: "size"`) enabling
|
|
117
|
+
* responsive sizing with `cqmin`, `cqmax`, `cqw`, `cqh` units.
|
|
118
|
+
*
|
|
119
|
+
* Uses CSS Grid stacking: multiple elements in the same grid cell overlap
|
|
120
|
+
* in DOM order (later elements appear on top).
|
|
121
|
+
*/
|
|
122
|
+
declare function HtmlOverlay({ className, style, pointerEvents, children }: AdaptiveBoxHtmlOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
123
|
+
export type AdaptiveBoxSvg = typeof Svg;
|
|
124
|
+
export type AdaptiveBoxLabel = typeof Label;
|
|
125
|
+
export type AdaptiveBoxHtmlOverlay = typeof HtmlOverlay;
|
|
126
|
+
export default AdaptiveBox;
|
|
127
|
+
//# sourceMappingURL=AdaptiveBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdaptiveBox.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/AdaptiveBox.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdaptiveBoxProps, AdaptiveBoxLogicalSizeProps, BooleanControlProps, ControlComponent } from '../../types';
|
|
3
|
+
|
|
4
|
+
export type BooleanControlComponentProps<P extends object = Record<string, unknown>> = BooleanControlProps & AdaptiveBoxProps & AdaptiveBoxLogicalSizeProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The Visualization Component.
|
|
7
|
+
* Must adhere to ControlComponent contract.
|
|
8
|
+
*/
|
|
9
|
+
view: ControlComponent<P>;
|
|
10
|
+
/**
|
|
11
|
+
* Props specific to the Visualization Component.
|
|
12
|
+
*/
|
|
13
|
+
viewProps: P;
|
|
14
|
+
/**
|
|
15
|
+
* Content overlay (HTML) rendered over the SVG (e.g. text value, icons).
|
|
16
|
+
* Rendered via AdaptiveBox.HtmlOverlay to avoid foreignObject issues.
|
|
17
|
+
*/
|
|
18
|
+
htmlOverlay?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A Generic Boolean Control that connects a Data Model (BooleanParameter)
|
|
22
|
+
* to a Visualization View (ControlComponent).
|
|
23
|
+
*
|
|
24
|
+
* This component handles parameter resolution, value management, interaction handling,
|
|
25
|
+
* and layout management for boolean controls (Button, Toggle, etc.).
|
|
26
|
+
*
|
|
27
|
+
* Supports two modes of operation:
|
|
28
|
+
* 1. Strict Mode (Parameter only): Model provided via parameter prop.
|
|
29
|
+
* 2. Ad-Hoc Mode (Props only): Model created from individual props (label, latch, etc.).
|
|
30
|
+
*
|
|
31
|
+
* **Interaction Modes:**
|
|
32
|
+
* - **Editable Control**: When `onChange` is provided, the control is editable and responds to
|
|
33
|
+
* all interaction methods (mouse, touch, keyboard) to change the value. The full interaction
|
|
34
|
+
* system handles complex behaviors like drag-in/drag-out for momentary buttons.
|
|
35
|
+
* - **Clickable View**: When only `onClick` is provided (no `onChange`), the control is a
|
|
36
|
+
* clickable view that triggers the onClick handler but does not change its value. Touch events
|
|
37
|
+
* are handled to ensure onClick works on touch devices.
|
|
38
|
+
* - **Both**: When both `onChange` and `onClick` are provided, the control is editable and
|
|
39
|
+
* also triggers onClick for mouse clicks (onChange handles touch events for value changes).
|
|
40
|
+
*
|
|
41
|
+
* @param props - Component props including parameter configuration, view component, and layout options
|
|
42
|
+
* @returns Rendered boolean control component
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Editable control
|
|
47
|
+
* <BooleanControl
|
|
48
|
+
* value={isOn}
|
|
49
|
+
* onChange={(e) => setIsOn(e.value)}
|
|
50
|
+
* view={ButtonView}
|
|
51
|
+
* viewProps={{ color: "blue", roundness: 0.3 }}
|
|
52
|
+
* />
|
|
53
|
+
*
|
|
54
|
+
* // Clickable view (non-editable)
|
|
55
|
+
* <BooleanControl
|
|
56
|
+
* value={false}
|
|
57
|
+
* onClick={() => handleClick()}
|
|
58
|
+
* view={ButtonView}
|
|
59
|
+
* viewProps={{ color: "gray" }}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function BooleanControl<P extends object = Record<string, unknown>>(props: BooleanControlComponentProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
declare const _default: typeof BooleanControl;
|
|
65
|
+
export default _default;
|
|
66
|
+
//# sourceMappingURL=BooleanControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanControl.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/controls/BooleanControl.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM/G,MAAM,MAAM,4BAA4B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAE/E,mBAAmB,GAEf,gBAAgB,GAEhB,2BAA2B,GAAG;IAC1B;;;OAGG;IACH,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAE1B;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC;IAEb;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,4BAA4B,CAAC,CAAC,CAAC,2CAsMhH;wBAE4C,OAAO,cAAc;AAAlE,wBAAmE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdaptiveBoxProps, AdaptiveBoxLogicalSizeProps, ContinuousControlProps, ControlComponent, ValueLabelMode } from '../../types';
|
|
3
|
+
|
|
4
|
+
export type ContinuousControlComponentProps<P extends object = Record<string, unknown>> = ContinuousControlProps & AdaptiveBoxProps & AdaptiveBoxLogicalSizeProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The Visualization Component.
|
|
7
|
+
* Must adhere to ControlComponent contract.
|
|
8
|
+
*/
|
|
9
|
+
view: ControlComponent<P>;
|
|
10
|
+
/**
|
|
11
|
+
* Props specific to the Visualization Component.
|
|
12
|
+
*/
|
|
13
|
+
viewProps: P;
|
|
14
|
+
/**
|
|
15
|
+
* Content overlay (HTML) rendered over the SVG (e.g. text value).
|
|
16
|
+
* Rendered via AdaptiveBox.HtmlOverlay to avoid foreignObject issues.
|
|
17
|
+
*/
|
|
18
|
+
htmlOverlay?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Controls how the label and value are displayed.
|
|
21
|
+
* - "labelOnly": Always shows the label (default)
|
|
22
|
+
* - "valueOnly": Always shows the value
|
|
23
|
+
* - "interactive": Shows label normally, but temporarily swaps to value during interaction
|
|
24
|
+
* @default "labelOnly"
|
|
25
|
+
*/
|
|
26
|
+
valueAsLabel?: ValueLabelMode;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A Generic Continuous Control that connects a Data Model (AudioParameter)
|
|
30
|
+
* to a Visualization View (ControlComponent).
|
|
31
|
+
*
|
|
32
|
+
* This component provides a generic wrapper for continuous controls (Knob, Slider, etc.),
|
|
33
|
+
* decoupling behavior (AudioParameter, interaction logic) from visualization (SVG rendering).
|
|
34
|
+
* It handles parameter resolution, normalization, interaction, and layout automatically.
|
|
35
|
+
*
|
|
36
|
+
* Supports double-click to reset to default value when editable (onChange provided).
|
|
37
|
+
* The default value is determined by the parameter's `defaultValue` property, or
|
|
38
|
+
* calculated as 0.0 for unipolar or 0.5 for bipolar parameters when not specified.
|
|
39
|
+
*
|
|
40
|
+
* @param props Component props including parameter configuration, view component, and layout props
|
|
41
|
+
* @returns Rendered continuous control with AdaptiveBox layout
|
|
42
|
+
*/
|
|
43
|
+
export declare function ContinuousControl<P extends object = Record<string, unknown>>(props: ContinuousControlComponentProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare const _default: typeof ContinuousControl;
|
|
45
|
+
export default _default;
|
|
46
|
+
//# sourceMappingURL=ContinuousControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContinuousControl.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/controls/ContinuousControl.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,EACH,gBAAgB,EAChB,2BAA2B,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACjB,MAAM,SAAS,CAAC;AAMjB,MAAM,MAAM,+BAA+B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAElF,sBAAsB,GAElB,gBAAgB,GAEhB,2BAA2B,GAAG;IAC1B;;;OAGG;IACH,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAE1B;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC;IAEb;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEV;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxE,KAAK,EAAE,+BAA+B,CAAC,CAAC,CAAC,2CAyL5C;wBAE+C,OAAO,iBAAiB;AAAxE,wBAAyE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdaptiveBoxProps, AdaptiveBoxLogicalSizeProps, DiscreteControlProps, ControlComponent } from '../../types';
|
|
3
|
+
|
|
4
|
+
export type DiscreteControlComponentProps<P extends object = Record<string, unknown>> = DiscreteControlProps & AdaptiveBoxProps & AdaptiveBoxLogicalSizeProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The Visualization Component.
|
|
7
|
+
* Must adhere to ControlComponent contract.
|
|
8
|
+
*/
|
|
9
|
+
view: ControlComponent<P>;
|
|
10
|
+
/**
|
|
11
|
+
* Props specific to the Visualization Component.
|
|
12
|
+
*/
|
|
13
|
+
viewProps: P;
|
|
14
|
+
/**
|
|
15
|
+
* Content overlay (HTML) rendered over the SVG (e.g. text value, icons).
|
|
16
|
+
* Rendered via AdaptiveBox.HtmlOverlay to avoid foreignObject issues.
|
|
17
|
+
*/
|
|
18
|
+
htmlOverlay?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A Generic Discrete Control that connects a Data Model (DiscreteParameter)
|
|
22
|
+
* to a Visualization View (ControlComponent).
|
|
23
|
+
*
|
|
24
|
+
* This component handles parameter resolution, value management, interaction handling,
|
|
25
|
+
* and layout management for discrete controls (CycleButton, Selector, etc.).
|
|
26
|
+
*
|
|
27
|
+
* **Important: Options vs Children**
|
|
28
|
+
*
|
|
29
|
+
* - **`options` prop**: Defines the parameter model (value, label, midiValue). Used for parameter structure.
|
|
30
|
+
* - **`children` (OptionView components)**: Provides visual content (ReactNodes) for rendering. Used for display.
|
|
31
|
+
*
|
|
32
|
+
* Supports four modes of operation:
|
|
33
|
+
* 1. **Ad-Hoc Mode (Options prop)**: Model from `options` prop, visual from `children` (if provided) or default rendering
|
|
34
|
+
* 2. **Ad-Hoc Mode (Children only)**: Model inferred from OptionView children, visual from children
|
|
35
|
+
* 3. **Strict Mode (Parameter only)**: Model from `parameter` prop, visual via `renderOption` callback
|
|
36
|
+
* 4. **Hybrid Mode (Parameter + Children)**: Model from `parameter` prop, visual from children (matched by value)
|
|
37
|
+
*
|
|
38
|
+
* @param props - Component props including parameter configuration, view component, and layout options
|
|
39
|
+
* @returns Rendered discrete control component
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Ad-Hoc Mode with options prop
|
|
44
|
+
* <DiscreteControl
|
|
45
|
+
* value="sine"
|
|
46
|
+
* onChange={(e) => setValue(e.value)}
|
|
47
|
+
* options={[
|
|
48
|
+
* { value: "sine", label: "Sine Wave" },
|
|
49
|
+
* { value: "square", label: "Square Wave" }
|
|
50
|
+
* ]}
|
|
51
|
+
* view={KnobView}
|
|
52
|
+
* viewProps={{ color: "blue", thickness: 0.4 }}
|
|
53
|
+
* />
|
|
54
|
+
*
|
|
55
|
+
* // Ad-Hoc Mode with children
|
|
56
|
+
* <DiscreteControl
|
|
57
|
+
* value="sine"
|
|
58
|
+
* onChange={(e) => setValue(e.value)}
|
|
59
|
+
* view={KnobView}
|
|
60
|
+
* viewProps={{ color: "blue", thickness: 0.4 }}
|
|
61
|
+
* >
|
|
62
|
+
* <OptionView value="sine">Sine</OptionView>
|
|
63
|
+
* <OptionView value="square">Square</OptionView>
|
|
64
|
+
* </DiscreteControl>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function DiscreteControl<P extends object = Record<string, unknown>>(props: DiscreteControlComponentProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
declare const _default: typeof DiscreteControl;
|
|
69
|
+
export default _default;
|
|
70
|
+
//# sourceMappingURL=DiscreteControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscreteControl.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/controls/DiscreteControl.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMhH,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAEhF,oBAAoB,GAEhB,gBAAgB,GAEhB,2BAA2B,GAAG;IAC1B;;;OAGG;IACH,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAE1B;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC;IAEb;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,6BAA6B,CAAC,CAAC,CAAC,2CA+HlH;wBAE6C,OAAO,eAAe;AAApE,wBAAqE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type OptionViewProps = {
|
|
4
|
+
/** Value associated with this option */
|
|
5
|
+
value?: string | number;
|
|
6
|
+
/** Child content (Visual representation) */
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/** Optional text label for the parameter model (accessibility/aria-label) */
|
|
9
|
+
label?: string;
|
|
10
|
+
};
|
|
11
|
+
export default function OptionView(_props: OptionViewProps): null;
|
|
12
|
+
//# sourceMappingURL=OptionView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionView.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/controls/OptionView.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,eAAe,GAAG;IAC1B,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAM,EAAE,eAAe,QAEzD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type FilmstripImageProps = {
|
|
4
|
+
/** X coordinate of the top-left corner (default: 0) */
|
|
5
|
+
x?: number;
|
|
6
|
+
/** Y coordinate of the top-left corner (default: 0) */
|
|
7
|
+
y?: number;
|
|
8
|
+
/** Width of a SINGLE frame */
|
|
9
|
+
frameWidth: number;
|
|
10
|
+
/** Height of a SINGLE frame */
|
|
11
|
+
frameHeight: number;
|
|
12
|
+
/** Total number of frames in the strip */
|
|
13
|
+
frameCount: number;
|
|
14
|
+
/** Normalized value between 0 and 1 */
|
|
15
|
+
normalizedValue: number;
|
|
16
|
+
/** URL to the sprite sheet/filmstrip image */
|
|
17
|
+
imageHref: string;
|
|
18
|
+
/** Orientation of the strip (default: "vertical") */
|
|
19
|
+
orientation?: "vertical" | "horizontal";
|
|
20
|
+
/** Optional frame rotation in degrees (default: 0) */
|
|
21
|
+
frameRotation?: number;
|
|
22
|
+
/**
|
|
23
|
+
* If true, inverts the normalized value (0.0 -> 1.0 and 1.0 -> 0.0).
|
|
24
|
+
* Useful for filmstrips where frame 0 represents "on" and frame 1 represents "off".
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
invertValue?: boolean;
|
|
28
|
+
/** Additional CSS class name */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Inline styles */
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A primitive component that displays a single frame from a sprite sheet (filmstrip)
|
|
35
|
+
* based on a normalized value.
|
|
36
|
+
*
|
|
37
|
+
* This is the most performant way to animate complex knobs and UI elements in audio applications.
|
|
38
|
+
* It uses a nested SVG with a shifted viewBox to "scrub" through the filmstrip, which is hardware accelerated.
|
|
39
|
+
*
|
|
40
|
+
* The filmstrip image should contain all frames stacked vertically (default) or horizontally.
|
|
41
|
+
*
|
|
42
|
+
* @param {FilmstripImageProps} props - Component props
|
|
43
|
+
* @param {number} [props.x=0] - X coordinate of the top-left corner
|
|
44
|
+
* @param {number} [props.y=0] - Y coordinate of the top-left corner
|
|
45
|
+
* @param {number} props.frameWidth - Width of a single frame in the filmstrip
|
|
46
|
+
* @param {number} props.frameHeight - Height of a single frame in the filmstrip
|
|
47
|
+
* @param {number} props.frameCount - Total number of frames in the strip
|
|
48
|
+
* @param {number} props.normalizedValue - Normalized value between 0 and 1 (determines which frame to display)
|
|
49
|
+
* @param {string} props.imageHref - URL to the sprite sheet/filmstrip image
|
|
50
|
+
* @param {"vertical" | "horizontal"} [props.orientation="vertical"] - Orientation of the strip
|
|
51
|
+
* @param {number} [props.frameRotation=0] - Optional frame rotation in degrees
|
|
52
|
+
* @param {boolean} [props.invertValue=false] - If true, inverts the normalized value (0.0 -> 1.0 and 1.0 -> 0.0)
|
|
53
|
+
* @param {string} [props.className] - Additional CSS class name
|
|
54
|
+
* @param {CSSProperties} [props.style] - Inline styles
|
|
55
|
+
* @returns {JSX.Element} SVG group element containing the filmstrip frame
|
|
56
|
+
*/
|
|
57
|
+
declare function FilmstripImage({ x, y, frameWidth, frameHeight, frameCount, normalizedValue, imageHref, orientation, frameRotation, invertValue, className, style, }: FilmstripImageProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
declare const _default: React.MemoExoticComponent<typeof FilmstripImage>;
|
|
59
|
+
export default _default;
|
|
60
|
+
//# sourceMappingURL=FilmstripImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilmstripImage.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/FilmstripImage.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,MAAM,MAAM,mBAAmB,GAAG;IAC9B,uDAAuD;IACvD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAS,cAAc,CAAC,EACpB,CAAK,EACL,CAAK,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,SAAS,EACT,WAAwB,EACxB,aAAiB,EACjB,WAAmB,EACnB,SAAS,EACT,KAAK,GACR,EAAE,mBAAmB,2CA6CrB;;AAED,wBAA0C"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ImageProps = {
|
|
4
|
+
/** X coordinate of the top-left corner (default: 0) */
|
|
5
|
+
x?: number;
|
|
6
|
+
/** Y coordinate of the top-left corner (default: 0) */
|
|
7
|
+
y?: number;
|
|
8
|
+
/** Width of the image */
|
|
9
|
+
width: number;
|
|
10
|
+
/** Height of the image */
|
|
11
|
+
height: number;
|
|
12
|
+
/** Optional image URL to display */
|
|
13
|
+
imageHref?: string;
|
|
14
|
+
/** Optional SVG content to display (e.g., icon components) */
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
/** Optional SVG transform attribute */
|
|
17
|
+
transform?: string;
|
|
18
|
+
/** Additional CSS class name */
|
|
19
|
+
className?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Inline styles.
|
|
22
|
+
* Supports `color` property for icon theming - icons using currentColor will inherit this value.
|
|
23
|
+
*/
|
|
24
|
+
style?: CSSProperties;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* A primitive component that displays static content at rectangular coordinates.
|
|
28
|
+
* The content is positioned at (x, y) with the specified width and height.
|
|
29
|
+
*
|
|
30
|
+
* This component can display an image (via imageHref) or arbitrary SVG content (via children).
|
|
31
|
+
* It is designed for straightforward rectangular image placement without radial/centered positioning.
|
|
32
|
+
*
|
|
33
|
+
* Useful for displaying images or icons at specific positions and sizes.
|
|
34
|
+
*
|
|
35
|
+
* @param {ImageProps} props - Component props
|
|
36
|
+
* @param {number} [props.x=0] - X coordinate of the top-left corner
|
|
37
|
+
* @param {number} [props.y=0] - Y coordinate of the top-left corner
|
|
38
|
+
* @param {number} props.width - Width of the image
|
|
39
|
+
* @param {number} props.height - Height of the image
|
|
40
|
+
* @param {string} [props.imageHref] - Optional image URL to display
|
|
41
|
+
* @param {React.ReactNode} [props.children] - Optional SVG content to display
|
|
42
|
+
* @param {string} [props.transform] - Optional SVG transform attribute
|
|
43
|
+
* @param {string} [props.className] - Additional CSS class name
|
|
44
|
+
* @param {CSSProperties} [props.style] - Inline styles
|
|
45
|
+
* @returns {JSX.Element} SVG group element containing the image
|
|
46
|
+
*/
|
|
47
|
+
declare function Image({ x, y, width, height, imageHref, children, transform, className, style }: ImageProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
declare const _default: React.MemoExoticComponent<typeof Image>;
|
|
49
|
+
export default _default;
|
|
50
|
+
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/Image.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,MAAM,MAAM,UAAU,GAAG;IACrB,uDAAuD;IACvD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,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;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,KAAK,CAAC,EAAE,CAAK,EAAE,CAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,UAAU,2CAoB3G;;AAED,wBAAiC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type LabelRingProps = {
|
|
4
|
+
/** X coordinate of the center point */
|
|
5
|
+
cx: number;
|
|
6
|
+
/** Y coordinate of the center point */
|
|
7
|
+
cy: number;
|
|
8
|
+
/** Outer radius of the ring (content is centered at this radius) */
|
|
9
|
+
radius: number;
|
|
10
|
+
/** Array of content to render at each tick position */
|
|
11
|
+
labels: (string | number | ReactNode)[];
|
|
12
|
+
/** Orientation of the labels:
|
|
13
|
+
* - "upright": Text stays upright (default)
|
|
14
|
+
* - "radial": Text rotates to match the angle
|
|
15
|
+
*/
|
|
16
|
+
orientation?: "upright" | "radial";
|
|
17
|
+
/** Openness of the ring in degrees (default 90) */
|
|
18
|
+
openness?: number;
|
|
19
|
+
/** Rotation offset in degrees (default 0) */
|
|
20
|
+
rotation?: number;
|
|
21
|
+
/** CSS class name */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Inline styles */
|
|
24
|
+
style?: CSSProperties;
|
|
25
|
+
/** CSS class name for the text elements (only applies to string/number labels) */
|
|
26
|
+
labelClassName?: string;
|
|
27
|
+
/** Inline styles for the text elements (only applies to string/number labels) */
|
|
28
|
+
labelStyle?: CSSProperties;
|
|
29
|
+
/**
|
|
30
|
+
* Default size for icon labels. Used to center the icons.
|
|
31
|
+
* If not provided, the component attempts to read `size`, `width`, or `height` from the icon props.
|
|
32
|
+
*/
|
|
33
|
+
iconSize?: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A wrapper around TickRing designed for rendering text labels or icons at radial positions.
|
|
37
|
+
* Automatically handles positioning and rotation based on the specified orientation.
|
|
38
|
+
*/
|
|
39
|
+
declare function LabelRing({ cx, cy, radius, labels, orientation, openness, rotation, className, style, labelClassName, labelStyle, iconSize, }: LabelRingProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare const _default: React.MemoExoticComponent<typeof LabelRing>;
|
|
41
|
+
export default _default;
|
|
42
|
+
//# sourceMappingURL=LabelRing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelRing.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/svg/LabelRing.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxD,MAAM,MAAM,cAAc,GAAG;IACzB,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IACxC;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACnC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,iBAAS,SAAS,CAAC,EACf,EAAE,EACF,EAAE,EACF,MAAM,EACN,MAAM,EACN,WAAuB,EACvB,QAAa,EACb,QAAY,EACZ,SAAS,EACT,KAAK,EACL,cAAc,EACd,UAAU,EACV,QAAQ,GACX,EAAE,cAAc,2CAwFhB;;AAED,wBAAqC"}
|