@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
package/README.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# @cutoff/audio-ui-react - Development Guide
|
|
2
|
+
|
|
3
|
+
This package contains the React component library for AudioUI.
|
|
4
|
+
|
|
5
|
+
> **For general usage, installation, and component documentation, see the [main README](../../README.md) at the project root.**
|
|
6
|
+
|
|
7
|
+
## Development Setup
|
|
8
|
+
|
|
9
|
+
### Prerequisites
|
|
10
|
+
|
|
11
|
+
- Node.js (version 18 or higher)
|
|
12
|
+
- pnpm (version 10.20.0 or higher)
|
|
13
|
+
|
|
14
|
+
### Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# From the repository root, install all dependencies
|
|
18
|
+
pnpm install
|
|
19
|
+
|
|
20
|
+
# Build the library
|
|
21
|
+
pnpm build --filter @cutoff/audio-ui-react
|
|
22
|
+
|
|
23
|
+
# Or from this directory
|
|
24
|
+
cd packages/react
|
|
25
|
+
pnpm build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Project Structure
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
packages/react/
|
|
32
|
+
├── src/
|
|
33
|
+
│ ├── components/ # React components
|
|
34
|
+
│ │ ├── defaults/ # Default/built-in components
|
|
35
|
+
│ │ │ ├── controls/ # Interactive controls (Button, Knob, Slider, CycleButton) and SVG views
|
|
36
|
+
│ │ │ └── devices/ # Device components (Keys)
|
|
37
|
+
│ │ ├── generic/ # Generic components (FilmStrip controls, Image-based controls)
|
|
38
|
+
│ │ │ └── controls/ # Filmstrip and image-based control implementations
|
|
39
|
+
│ │ ├── primitives/ # Base components for building final components
|
|
40
|
+
│ │ │ ├── controls/ # Control primitives (ContinuousControl, DiscreteControl, BooleanControl, OptionView)
|
|
41
|
+
│ │ │ └── svg/ # SVG view primitives (ValueRing, RotaryImage, RadialImage, etc.)
|
|
42
|
+
│ │ └── types.ts # Shared type definitions
|
|
43
|
+
│ ├── hooks/ # Hooks wrapping core logic (useContinuousInteraction, useAudioParameter, etc.)
|
|
44
|
+
│ ├── utils/ # Utility functions (theme utilities)
|
|
45
|
+
│ └── index.ts # Main exports
|
|
46
|
+
├── dist/ # Built output (generated)
|
|
47
|
+
├── docs/ # Technical documentation
|
|
48
|
+
└── package.json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Note: Logic, styles, and constants are imported from `@cutoff/audio-ui-core`.
|
|
52
|
+
|
|
53
|
+
## Development Workflow
|
|
54
|
+
|
|
55
|
+
### Building the Library
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# From repository root
|
|
59
|
+
pnpm build --filter @cutoff/audio-ui-react
|
|
60
|
+
|
|
61
|
+
# Or from this directory
|
|
62
|
+
cd packages/react
|
|
63
|
+
pnpm build
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Type Checking
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# From repository root
|
|
70
|
+
pnpm typecheck --filter @cutoff/audio-ui-react
|
|
71
|
+
|
|
72
|
+
# Or from this directory
|
|
73
|
+
cd packages/react
|
|
74
|
+
pnpm typecheck
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Running Tests
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# From repository root
|
|
81
|
+
pnpm test --filter @cutoff/audio-ui-react
|
|
82
|
+
|
|
83
|
+
# Or from this directory
|
|
84
|
+
cd packages/react
|
|
85
|
+
pnpm test
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Local Development with Playground
|
|
89
|
+
|
|
90
|
+
The playground application (`apps/playground-react`) automatically uses the workspace version of this package. No linking is required when using pnpm workspaces.
|
|
91
|
+
|
|
92
|
+
To develop and test changes:
|
|
93
|
+
|
|
94
|
+
1. Make changes to components in `packages/react/src/`
|
|
95
|
+
2. The playground app will pick up changes automatically (or rebuild if needed)
|
|
96
|
+
3. Run the playground: `pnpm dev` from the repository root
|
|
97
|
+
|
|
98
|
+
## React Version Requirements
|
|
99
|
+
|
|
100
|
+
**Critical**: This project requires React 18. Before making changes:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Check React versions
|
|
104
|
+
pnpm ls react @types/react
|
|
105
|
+
|
|
106
|
+
# Should show React 18.x versions consistently
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
If you encounter version conflicts:
|
|
110
|
+
|
|
111
|
+
1. Install React 18 versions: `pnpm add react@^18.3.1 react-dom@^18.3.1 @types/react@^18.3.23 -w`
|
|
112
|
+
2. Run type checks: `pnpm typecheck`
|
|
113
|
+
3. Rebuild: `pnpm build`
|
|
114
|
+
|
|
115
|
+
## Component Development
|
|
116
|
+
|
|
117
|
+
### Adding New Components
|
|
118
|
+
|
|
119
|
+
1. Create component file in:
|
|
120
|
+
- `src/components/defaults/controls/` (for built-in controls with theming)
|
|
121
|
+
- `src/components/generic/controls/` (for generic components like filmstrip/image-based)
|
|
122
|
+
- `src/components/primitives/controls/` (for control primitives)
|
|
123
|
+
- `src/components/primitives/svg/` (for SVG view primitives)
|
|
124
|
+
2. Export from `src/index.ts`
|
|
125
|
+
3. Add demo page in `apps/playground-react/app/controls/[component-name]/page.tsx` (or appropriate category)
|
|
126
|
+
4. Build and test: `pnpm build && pnpm typecheck`
|
|
127
|
+
|
|
128
|
+
### Component Guidelines
|
|
129
|
+
|
|
130
|
+
- Use TypeScript with strict mode
|
|
131
|
+
- Define props interfaces with JSDoc comments
|
|
132
|
+
- Use functional components with hooks
|
|
133
|
+
- Prefix unused parameters with underscore (`_param`)
|
|
134
|
+
- Follow existing patterns for styling and theming
|
|
135
|
+
- All components must have `"use client";` directive (Client Components)
|
|
136
|
+
- **Use TypeScript path aliases** instead of relative paths:
|
|
137
|
+
- `@/primitives/*` for primitives components
|
|
138
|
+
- `@/hooks/*` for hooks
|
|
139
|
+
- `@/defaults/*` for default components
|
|
140
|
+
- `@/utils/*` for utilities
|
|
141
|
+
- `@/types` for type definitions
|
|
142
|
+
|
|
143
|
+
### TypeScript Path Aliases
|
|
144
|
+
|
|
145
|
+
The library uses path aliases to simplify imports. Use these instead of relative paths:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
// ✅ Good - using aliases
|
|
149
|
+
import AdaptiveBox from "@/primitives/AdaptiveBox";
|
|
150
|
+
import { useAudioParameter } from "@/hooks/useAudioParameter";
|
|
151
|
+
import { setThemeColor } from "@/utils/theme";
|
|
152
|
+
import { AdaptiveBoxProps } from "@/types";
|
|
153
|
+
|
|
154
|
+
// ❌ Avoid - relative paths
|
|
155
|
+
import AdaptiveBox from "../../primitives/AdaptiveBox";
|
|
156
|
+
import { useAudioParameter } from "../../../hooks/useAudioParameter";
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Available aliases:
|
|
160
|
+
|
|
161
|
+
- `@/primitives/*` → `src/components/primitives/*`
|
|
162
|
+
- `@/hooks/*` → `src/hooks/*`
|
|
163
|
+
- `@/defaults/*` → `src/components/defaults/*`
|
|
164
|
+
- `@/utils/*` → `src/utils/*`
|
|
165
|
+
- `@/types` → `src/components/types`
|
|
166
|
+
|
|
167
|
+
## Documentation
|
|
168
|
+
|
|
169
|
+
Technical documentation is located in `docs/`:
|
|
170
|
+
|
|
171
|
+
- **`docs/adaptive-box-layout.md`**: AdaptiveBox layout system specification
|
|
172
|
+
- **`docs/color-system.md`**: Complete color system architecture
|
|
173
|
+
- **`docs/color-property-examples.md`**: Practical color property usage examples
|
|
174
|
+
- **`docs/cycle-button-architecture.md`**: CycleButton component architecture and design
|
|
175
|
+
- **`docs/interaction-system.md`**: Complete interaction system architecture (drag, wheel, keyboard)
|
|
176
|
+
- **`docs/keys-middle-c-positions.md`**: MIDI keyboard positioning specifications
|
|
177
|
+
- **`docs/parameter-specs.md`**: Audio parameter specification and tripartite value system
|
|
178
|
+
- **`docs/size-system.md`**: Component sizing system architecture
|
|
179
|
+
- **`docs/svg-view-primitives.md`**: SVG view primitives for building custom controls
|
|
180
|
+
- **`docs/text-rendering-strategy.md`**: Text rendering and measurement strategies
|
|
181
|
+
- **`docs/webkit-foreignobject-issues.md`**: WebKit foreignObject compatibility notes
|
|
182
|
+
|
|
183
|
+
## Common Development Tasks
|
|
184
|
+
|
|
185
|
+
### Testing Changes
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Build and type check
|
|
189
|
+
pnpm build && pnpm typecheck
|
|
190
|
+
|
|
191
|
+
# Run tests
|
|
192
|
+
pnpm test
|
|
193
|
+
|
|
194
|
+
# Test visually in playground app (from root)
|
|
195
|
+
pnpm dev
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Troubleshooting
|
|
199
|
+
|
|
200
|
+
**React type errors**: Usually indicates version mismatch
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
pnpm ls react @types/react
|
|
204
|
+
# Fix by installing consistent React 18 versions
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Build failures**: Check TypeScript errors
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
pnpm typecheck # Shows detailed error information
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Playground app not updating**: Rebuild library first
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# From root
|
|
217
|
+
pnpm build --filter @cutoff/audio-ui-react
|
|
218
|
+
pnpm dev
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Contributing
|
|
222
|
+
|
|
223
|
+
1. Ensure React 18 compatibility
|
|
224
|
+
2. Run type checks before committing: `pnpm typecheck`
|
|
225
|
+
3. Test changes in playground app: `pnpm dev`
|
|
226
|
+
4. Update documentation as needed
|
|
227
|
+
|
|
228
|
+
For detailed component API and usage examples, see the [main README](../../README.md).
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdaptiveBoxProps, AdaptiveSizeProps, BooleanControlProps, ThemableProps } from '../../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Button component (built-in control with theming support)
|
|
6
|
+
*/
|
|
7
|
+
export type ButtonProps = BooleanControlProps & AdaptiveSizeProps & AdaptiveBoxProps & ThemableProps;
|
|
8
|
+
/**
|
|
9
|
+
* A button component for audio applications.
|
|
10
|
+
*
|
|
11
|
+
* Supports both toggle (latch) and momentary modes, with proper handling of
|
|
12
|
+
* global mouse events for momentary buttons to ensure reliable release behavior
|
|
13
|
+
* even when the mouse is dragged outside the button before release.
|
|
14
|
+
*
|
|
15
|
+
* Supports two modes of operation:
|
|
16
|
+
* 1. Strict Mode (Parameter only): Model provided via parameter prop.
|
|
17
|
+
* 2. Ad-Hoc Mode (Props only): Model created from individual props (label, latch, etc.).
|
|
18
|
+
*
|
|
19
|
+
* @param props - Component props
|
|
20
|
+
* @returns Rendered Button component
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // Ad-Hoc Mode - Toggle button
|
|
25
|
+
* <Button
|
|
26
|
+
* label="Power"
|
|
27
|
+
* latch={true}
|
|
28
|
+
* value={isOn}
|
|
29
|
+
* onChange={(e) => setIsOn(e.value)}
|
|
30
|
+
* />
|
|
31
|
+
*
|
|
32
|
+
* // Ad-Hoc Mode - Momentary button
|
|
33
|
+
* <Button
|
|
34
|
+
* label="Record"
|
|
35
|
+
* latch={false}
|
|
36
|
+
* value={isRecording}
|
|
37
|
+
* onChange={(e) => setIsRecording(e.value)}
|
|
38
|
+
* />
|
|
39
|
+
*
|
|
40
|
+
* // Strict Mode with parameter
|
|
41
|
+
* <Button
|
|
42
|
+
* parameter={powerParam}
|
|
43
|
+
* value={isOn}
|
|
44
|
+
* onChange={(e) => setIsOn(e.value)}
|
|
45
|
+
* />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function Button({ latch, value, onChange, label, adaptiveSize, size, displayMode, labelMode, labelPosition, labelAlign, labelOverflow, labelHeightUnits, parameter, paramId, midiResolution, color, roundness, onClick, onMouseDown, onMouseUp, onMouseEnter, onMouseLeave, className, style, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare const _default: React.MemoExoticComponent<typeof Button>;
|
|
50
|
+
export default _default;
|
|
51
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/defaults/controls/Button.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAMlG;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,aAAa,CAAC;AAErG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,iBAAS,MAAM,CAAC,EACZ,KAAa,EACb,KAAa,EACb,QAAQ,EACR,KAAK,EACL,YAAoB,EACpB,IAAe,EACf,WAAW,EACX,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,cAAc,EACd,KAAK,EACL,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,GACR,EAAE,WAAW,2CAsCb;;AAED,wBAAkC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ControlComponent } from '../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props for the ButtonView component
|
|
5
|
+
*/
|
|
6
|
+
export type ButtonViewProps = {
|
|
7
|
+
/** Normalized value between 0 and 1 */
|
|
8
|
+
normalizedValue: number;
|
|
9
|
+
/** Threshold for determining "on" state (default 0.5) */
|
|
10
|
+
threshold?: number;
|
|
11
|
+
/** Corner roundness (normalized 0.0-1.0, maps to 0-50, or CSS variable string) */
|
|
12
|
+
roundness?: number | string;
|
|
13
|
+
/** Color prop (kept for API compatibility, but colors are read from CSS variables) */
|
|
14
|
+
color: string;
|
|
15
|
+
/** Additional CSS class name */
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: ControlComponent<Omit<ButtonViewProps, "normalizedValue" | "className" | "style">>;
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=ButtonView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonView.d.ts","sourceRoot":"","sources":["../../../../src/components/defaults/controls/ButtonView.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;wBAoF0C,gBAAgB,CACxD,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,WAAW,GAAG,OAAO,CAAC,CACnE;AAFD,wBAEE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdaptiveBoxProps, AdaptiveSizeProps, DiscreteControlProps, ThemableProps } from '../../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props for the CycleButton component
|
|
6
|
+
*/
|
|
7
|
+
export type CycleButtonProps = DiscreteControlProps & AdaptiveSizeProps & AdaptiveBoxProps & ThemableProps & {
|
|
8
|
+
/** Custom renderer for options (used when parameter is provided but no children map exists) */
|
|
9
|
+
renderOption?: (option: {
|
|
10
|
+
value: string | number;
|
|
11
|
+
label: string;
|
|
12
|
+
}) => React.ReactNode;
|
|
13
|
+
/** Thickness of the stroke (normalized 0.0-1.0, maps to 1-20). Used by rotary variant. */
|
|
14
|
+
thickness?: number;
|
|
15
|
+
/** Openness of the ring in degrees (value between 0-360º; 0º: closed; 90º: 3/4 open; 180º: half-circle;)
|
|
16
|
+
* @default 90
|
|
17
|
+
*/
|
|
18
|
+
openness?: number;
|
|
19
|
+
/** Optional rotation angle offset in degrees
|
|
20
|
+
* @default 0
|
|
21
|
+
*/
|
|
22
|
+
rotation?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A discrete interaction control that cycles through a set of discrete options.
|
|
26
|
+
*
|
|
27
|
+
* This control supports discrete interaction only (click to cycle, keyboard to step).
|
|
28
|
+
* It does not support continuous interaction (drag/wheel).
|
|
29
|
+
*
|
|
30
|
+
* **Important: Options vs Children**
|
|
31
|
+
*
|
|
32
|
+
* - **`options` prop**: Defines the parameter model (value, label, midiValue). Used for parameter structure.
|
|
33
|
+
* - **`children` (OptionView components)**: Provides visual content (ReactNodes) for rendering. Used for display.
|
|
34
|
+
*
|
|
35
|
+
* Supports multiple visual variants (rotary knob-style, LED indicators, etc.) and
|
|
36
|
+
* four modes of operation:
|
|
37
|
+
* 1. **Ad-Hoc Mode (Options prop)**: Model from `options` prop, visual from `children` (if provided) or default rendering
|
|
38
|
+
* 2. **Ad-Hoc Mode (Children only)**: Model inferred from OptionView children, visual from children
|
|
39
|
+
* 3. **Strict Mode (Parameter only)**: Model from `parameter` prop, visual via `renderOption` callback
|
|
40
|
+
* 4. **Hybrid Mode (Parameter + Children)**: Model from `parameter` prop, visual from children (matched by value)
|
|
41
|
+
*
|
|
42
|
+
* @param props - Component props
|
|
43
|
+
* @returns Rendered CycleButton component
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* // Ad-Hoc Mode with options prop (data-driven)
|
|
48
|
+
* <CycleButton
|
|
49
|
+
* options={[
|
|
50
|
+
* { value: "sine", label: "Sine Wave" },
|
|
51
|
+
* { value: "square", label: "Square Wave" }
|
|
52
|
+
* ]}
|
|
53
|
+
* />
|
|
54
|
+
*
|
|
55
|
+
* // Ad-Hoc Mode with children (visual content)
|
|
56
|
+
* <CycleButton defaultValue="sine" label="Waveform">
|
|
57
|
+
* <OptionView value="sine"><SineIcon /></OptionView>
|
|
58
|
+
* <OptionView value="square"><SquareIcon /></OptionView>
|
|
59
|
+
* </CycleButton>
|
|
60
|
+
*
|
|
61
|
+
* // Hybrid: options for model, children for visuals
|
|
62
|
+
* <CycleButton
|
|
63
|
+
* options={[
|
|
64
|
+
* { value: "sine", label: "Sine Wave", midiValue: 0 },
|
|
65
|
+
* { value: "square", label: "Square Wave", midiValue: 1 }
|
|
66
|
+
* ]}
|
|
67
|
+
* >
|
|
68
|
+
* <OptionView value="sine"><SineIcon /></OptionView>
|
|
69
|
+
* <OptionView value="square"><SquareIcon /></OptionView>
|
|
70
|
+
* </CycleButton>
|
|
71
|
+
*
|
|
72
|
+
* // Strict Mode with custom renderer
|
|
73
|
+
* <CycleButton
|
|
74
|
+
* parameter={waveformParam}
|
|
75
|
+
* renderOption={(opt) => <Icon name={opt.value} />}
|
|
76
|
+
* />
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
declare function CycleButton({ value, defaultValue, onChange, renderOption, label, adaptiveSize, size, displayMode, labelMode, labelPosition, labelAlign, labelOverflow, labelHeightUnits, color, roundness, thickness, openness, rotation, parameter, paramId, options, midiResolution, midiMapping, onClick, onMouseDown, onMouseUp, onMouseEnter, onMouseLeave, className, style, children, }: CycleButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
declare const _default: React.MemoExoticComponent<typeof CycleButton>;
|
|
81
|
+
export default _default;
|
|
82
|
+
//# sourceMappingURL=CycleButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CycleButton.d.ts","sourceRoot":"","sources":["../../../../src/components/defaults/controls/CycleButton.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiCnG;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAC/C,iBAAiB,GACjB,gBAAgB,GAChB,aAAa,GAAG;IACZ,+FAA+F;IAC/F,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IACtF,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,iBAAS,WAAW,CAAC,EACjB,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,YAAoB,EACpB,IAAe,EACf,WAAW,EACX,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,SAAe,EACf,QAA2B,EAC3B,QAA2B,EAC3B,SAAS,EACT,OAAO,EACP,OAAO,EACP,cAAc,EACd,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,EACL,QAAQ,GACX,EAAE,gBAAgB,2CAkGlB;;AAED,wBAAuC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdaptiveBoxProps, AdaptiveSizeProps, ContinuousControlProps, ThemableProps, KnobVariant, ValueLabelMode } from '../../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Default openness for knob ring in degrees (matches ValueRing default)
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_OPENNESS = 90;
|
|
8
|
+
/**
|
|
9
|
+
* Default rotation angle offset in degrees (matches ValueRing default)
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_ROTATION = 0;
|
|
12
|
+
/**
|
|
13
|
+
* Props for the Knob component (built-in control with theming support)
|
|
14
|
+
*/
|
|
15
|
+
export type KnobProps = ContinuousControlProps & AdaptiveSizeProps & AdaptiveBoxProps & ThemableProps & {
|
|
16
|
+
/** Visual variant of the knob
|
|
17
|
+
* @default "abstract"
|
|
18
|
+
*/
|
|
19
|
+
variant?: KnobVariant;
|
|
20
|
+
/** Thickness of the knob's stroke (normalized 0.0-1.0, maps to 1-20)
|
|
21
|
+
* @default Variant-dependent: 0.4 for abstract/simplest, 0.2 for others
|
|
22
|
+
*/
|
|
23
|
+
thickness?: number;
|
|
24
|
+
/** Openness of the ring in degrees (value between 0-360º; 0º: closed; 90º: 3/4 open; 180º: half-circle;)
|
|
25
|
+
* @default 90
|
|
26
|
+
*/
|
|
27
|
+
openness?: number;
|
|
28
|
+
/** Optional rotation angle offset in degrees
|
|
29
|
+
* @default 0
|
|
30
|
+
*/
|
|
31
|
+
rotation?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to use RotaryImage (true) or RadialImage (false) for iconCap overlay.
|
|
34
|
+
* When true, the icon rotates with the knob value; when false, the icon remains static.
|
|
35
|
+
* Only applies when variant is "iconCap" and children is provided.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
rotaryOverlay?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* SVG content to display as overlay in iconCap variant.
|
|
41
|
+
* Typically an icon component (e.g., wave icons) that will be rendered at the center of the knob.
|
|
42
|
+
* The icon inherits color via currentColor, so it will adapt to light/dark mode automatically.
|
|
43
|
+
* Only used when variant is "iconCap".
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <Knob variant="iconCap" value={50} min={0} max={100}>
|
|
48
|
+
* <SineWaveIcon />
|
|
49
|
+
* </Knob>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
children?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Controls how the label and value are displayed.
|
|
55
|
+
* - "labelOnly": Always shows the label (default)
|
|
56
|
+
* - "valueOnly": Always shows the value
|
|
57
|
+
* - "interactive": Shows label normally, but temporarily swaps to value during interaction
|
|
58
|
+
* @default "labelOnly"
|
|
59
|
+
*/
|
|
60
|
+
valueAsLabel?: ValueLabelMode;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Knob component provides a circular control for value adjustment.
|
|
64
|
+
* Supports continuous value ranges with optional bipolar mode, custom formatting,
|
|
65
|
+
* and multiple visual variants.
|
|
66
|
+
*
|
|
67
|
+
* @example Basic usage
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <Knob value={50} min={0} max={100} label="Volume" />
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @example With iconCap variant and icon
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <Knob variant="iconCap" value={64} min={0} max={127} rotaryOverlay={true}>
|
|
75
|
+
* <SineWaveIcon />
|
|
76
|
+
* </Knob>
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
declare function Knob({ min, max, step, bipolar, value, onChange, valueFormatter, label, adaptiveSize, size, displayMode, labelMode, labelPosition, labelAlign, labelOverflow, labelHeightUnits, color, roundness, variant, thickness, openness, rotation, parameter, unit, scale, paramId, interactionMode, interactionDirection, interactionSensitivity, rotaryOverlay: svgOverlayRotary, children: svgOverlay, valueAsLabel, midiResolution, defaultValue, onClick, onMouseDown, onMouseUp, onMouseEnter, onMouseLeave, className, style, }: KnobProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
declare const _default: React.MemoExoticComponent<typeof Knob>;
|
|
81
|
+
export default _default;
|
|
82
|
+
//# sourceMappingURL=Knob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Knob.d.ts","sourceRoot":"","sources":["../../../../src/components/defaults/controls/Knob.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,cAAc,EACjB,MAAM,SAAS,CAAC;AAOjB;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,sBAAsB,GAC1C,iBAAiB,GACjB,gBAAgB,GAChB,aAAa,GAAG;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEN;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,IAAI,CAAC,EACV,GAAG,EACH,GAAG,EACH,IAAI,EACJ,OAAe,EACf,KAAK,EACL,QAAQ,EACR,cAAc,EACd,KAAK,EACL,YAAoB,EACpB,IAAe,EACf,WAAW,EACX,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,OAAoB,EACpB,SAAS,EACT,QAA2B,EAC3B,QAA2B,EAC3B,SAAS,EACT,IAAI,EACJ,KAAK,EACL,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EAAE,gBAAwB,EACvC,QAAQ,EAAE,UAAU,EACpB,YAA0B,EAC1B,cAAc,EACd,YAAY,EACZ,OAAO,EACP,WAAW,EACX,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,GACR,EAAE,SAAS,2CAgGX;;AAED,wBAAgC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ControlComponent, KnobVariant } from '../../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props for the KnobView component
|
|
6
|
+
*/
|
|
7
|
+
export type KnobViewProps = {
|
|
8
|
+
/** Normalized value between 0 and 1 */
|
|
9
|
+
normalizedValue: number;
|
|
10
|
+
/** Whether to start the arc from center (bipolar mode) */
|
|
11
|
+
bipolar?: boolean;
|
|
12
|
+
/** Visual variant of the knob */
|
|
13
|
+
variant?: KnobVariant;
|
|
14
|
+
/** Thickness of the knob's stroke (normalized 0.0-1.0, maps to 1-20) */
|
|
15
|
+
thickness?: number;
|
|
16
|
+
/** Roundness for stroke linecap (normalized 0.0-1.0, 0.0 = square, >0.0 = round, or CSS variable string) */
|
|
17
|
+
roundness?: number | 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 */
|
|
21
|
+
rotation?: number;
|
|
22
|
+
/** Resolved color string */
|
|
23
|
+
color?: string;
|
|
24
|
+
/** Additional CSS class name */
|
|
25
|
+
className?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to use RotaryImage (true) or RadialImage (false) for iconCap overlay.
|
|
28
|
+
* When true, the icon rotates with the knob value; when false, the icon remains static.
|
|
29
|
+
* Only applies when variant is "iconCap" and svgOverlay is provided.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
svgOverlayRotary?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* SVG content to display as overlay in iconCap variant.
|
|
35
|
+
* Typically an icon component (e.g., wave icons) that will be rendered at the center of the knob.
|
|
36
|
+
* The icon inherits color via currentColor, so it will adapt to light/dark mode automatically.
|
|
37
|
+
* Only used when variant is "iconCap".
|
|
38
|
+
*/
|
|
39
|
+
svgOverlay?: React.ReactNode;
|
|
40
|
+
};
|
|
41
|
+
declare const _default: ControlComponent<Omit<KnobViewProps, "normalizedValue" | "className" | "style">>;
|
|
42
|
+
export default _default;
|
|
43
|
+
//# sourceMappingURL=KnobView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KnobView.d.ts","sourceRoot":"","sources":["../../../../src/components/defaults/controls/KnobView.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAOxD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4GAA4G;IAC5G,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC,CAAC;wBA8LwC,gBAAgB,CACtD,IAAI,CAAC,aAAa,EAAE,iBAAiB,GAAG,WAAW,GAAG,OAAO,CAAC,CACjE;AAFD,wBAEE"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdaptiveBoxProps, AdaptiveSizeProps, ContinuousControlProps, ThemableProps, SliderVariant, SliderCursorSize, ValueLabelMode } from '../../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Slider component (built-in control with theming support)
|
|
6
|
+
*/
|
|
7
|
+
export type SliderProps = ContinuousControlProps & AdaptiveSizeProps & AdaptiveBoxProps & ThemableProps & {
|
|
8
|
+
/** Visual variant of the slider
|
|
9
|
+
* @default "abstract"
|
|
10
|
+
*/
|
|
11
|
+
variant?: SliderVariant;
|
|
12
|
+
/** Orientation of the slider
|
|
13
|
+
* @default 'vertical' */
|
|
14
|
+
orientation?: "horizontal" | "vertical";
|
|
15
|
+
/** Thickness of the slider (normalized 0.0-1.0, maps to 1-50)
|
|
16
|
+
* @default 0.4 */
|
|
17
|
+
thickness?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Controls how the label and value are displayed.
|
|
20
|
+
* - "labelOnly": Always shows the label (default)
|
|
21
|
+
* - "valueOnly": Always shows the value
|
|
22
|
+
* - "interactive": Shows label normally, but temporarily swaps to value during interaction
|
|
23
|
+
* @default "labelOnly"
|
|
24
|
+
*/
|
|
25
|
+
valueAsLabel?: ValueLabelMode;
|
|
26
|
+
/** Cursor size option - determines which component's width is used for the cursor */
|
|
27
|
+
cursorSize?: SliderCursorSize;
|
|
28
|
+
/** Aspect ratio of the cursor */
|
|
29
|
+
cursorAspectRatio?: number;
|
|
30
|
+
/** Overrides the roundness factor of the cursor. Defaults to `roundness` */
|
|
31
|
+
cursorRoundness?: number | string;
|
|
32
|
+
/** Optional image URL to display as cursor */
|
|
33
|
+
cursorImageHref?: string;
|
|
34
|
+
/** Optional CSS class name for the cursor */
|
|
35
|
+
cursorClassName?: string;
|
|
36
|
+
/** Optional inline styles for the cursor */
|
|
37
|
+
cursorStyle?: React.CSSProperties;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* A slider component for audio applications.
|
|
41
|
+
* Supports both horizontal and vertical orientations with continuous value adjustment.
|
|
42
|
+
*
|
|
43
|
+
* Features:
|
|
44
|
+
* - Multiple visual variants (abstract, trackless, trackfull, stripless)
|
|
45
|
+
* - Configurable orientation (horizontal or vertical)
|
|
46
|
+
* - Bipolar mode support (centered at zero, grows in both directions)
|
|
47
|
+
* - Customizable thickness and roundness
|
|
48
|
+
* - Full theming support via CSS variables
|
|
49
|
+
* - Adaptive sizing or fixed size variants
|
|
50
|
+
* - Supports drag, wheel, and keyboard interactions
|
|
51
|
+
* - Custom value formatting
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* // Basic vertical slider
|
|
56
|
+
* <Slider value={50} min={0} max={100} onChange={(e) => setValue(e.value)} />
|
|
57
|
+
*
|
|
58
|
+
* // Horizontal bipolar slider (pan control)
|
|
59
|
+
* <Slider
|
|
60
|
+
* orientation="horizontal"
|
|
61
|
+
* bipolar
|
|
62
|
+
* value={0}
|
|
63
|
+
* min={-100}
|
|
64
|
+
* max={100}
|
|
65
|
+
* label="Pan"
|
|
66
|
+
* />
|
|
67
|
+
*
|
|
68
|
+
* // With parameter model
|
|
69
|
+
* <Slider
|
|
70
|
+
* parameter={volumeParam}
|
|
71
|
+
* value={volume}
|
|
72
|
+
* onChange={handleVolumeChange}
|
|
73
|
+
* />
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare function Slider({ orientation, min, max, step, bipolar, value, onChange, valueFormatter, label, adaptiveSize, size, displayMode, labelMode, labelPosition, labelAlign, labelOverflow, labelHeightUnits, color, roundness, variant, thickness, parameter, unit, scale, paramId, interactionMode, interactionDirection, interactionSensitivity, valueAsLabel, midiResolution, defaultValue, onClick, onMouseDown, onMouseUp, onMouseEnter, onMouseLeave, className, style, cursorSize, cursorAspectRatio, cursorRoundness, cursorImageHref, cursorClassName, cursorStyle, }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
declare const _default: React.MemoExoticComponent<typeof Slider>;
|
|
78
|
+
export default _default;
|
|
79
|
+
//# sourceMappingURL=Slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../../src/components/defaults/controls/Slider.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EACH,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,cAAc,EACjB,MAAM,SAAS,CAAC;AAIjB;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,sBAAsB,GAC5C,iBAAiB,GACjB,gBAAgB,GAChB,aAAa,GAAG;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;6BACyB;IACzB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;sBACkB;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,qFAAqF;IACrF,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,8CAA8C;IAC9C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACrC,CAAC;AAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,iBAAS,MAAM,CAAC,EACZ,WAAwB,EACxB,GAAG,EACH,GAAG,EACH,IAAI,EACJ,OAAe,EACf,KAAK,EACL,QAAQ,EACR,cAAc,EACd,KAAK,EACL,YAAoB,EACpB,IAAe,EACf,WAAW,EACX,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,OAAoB,EACpB,SAAe,EACf,SAAS,EACT,IAAI,EACJ,KAAK,EACL,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,YAA0B,EAC1B,cAAc,EACd,YAAY,EACZ,OAAO,EACP,WAAW,EACX,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,WAAW,GACd,EAAE,WAAW,2CAkEb;;AAED,wBAAkC"}
|