@antimatter-audio/antimatter-ui 16.6.0 → 16.8.0

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.
Files changed (130) hide show
  1. package/dist/index.js +314 -252
  2. package/dist/index.js.map +1 -1
  3. package/dist/types/advanced/BevelContainer/BevelContainer.d.ts +2 -2
  4. package/dist/types/advanced/BevelContainer/BevelContainer.d.ts.map +1 -1
  5. package/dist/types/advanced/CircularDiagramStyleVisualization/CircularDiagramStyleVisualization.d.ts +1 -1
  6. package/dist/types/advanced/CircularDiagramStyleVisualization/CircularDiagramStyleVisualization.d.ts.map +1 -1
  7. package/dist/types/advanced/CircularDiagramStyleVisualization/CircularDiagramStyleVisualizationSVG.d.ts +1 -1
  8. package/dist/types/advanced/CircularDiagramStyleVisualization/CircularDiagramStyleVisualizationSVG.d.ts.map +1 -1
  9. package/dist/types/advanced/ControlGroupWrapper/ControlGroupWrapper.d.ts +1 -1
  10. package/dist/types/advanced/ControlGroupWrapper/ControlGroupWrapper.d.ts.map +1 -1
  11. package/dist/types/advanced/IconButton/IconButton.d.ts +1 -1
  12. package/dist/types/advanced/IconButton/IconButton.d.ts.map +1 -1
  13. package/dist/types/advanced/KeyValueDisplayScreen/KeyValueDisplayScreen.d.ts +1 -1
  14. package/dist/types/advanced/KeyValueDisplayScreen/KeyValueDisplayScreen.d.ts.map +1 -1
  15. package/dist/types/advanced/LFOIntensityMeter/LFOIntensityMeter.d.ts +1 -1
  16. package/dist/types/advanced/LFOIntensityMeter/LFOIntensityMeter.d.ts.map +1 -1
  17. package/dist/types/advanced/LFOVisualizer/LFOVisualizer.d.ts +1 -1
  18. package/dist/types/advanced/LFOVisualizer/LFOVisualizer.d.ts.map +1 -1
  19. package/dist/types/advanced/ModMatrix/ModMatrix.d.ts +1 -1
  20. package/dist/types/advanced/ModMatrix/ModMatrix.d.ts.map +1 -1
  21. package/dist/types/advanced/ModMatrix/ModMatrixCell.d.ts +1 -1
  22. package/dist/types/advanced/ModMatrix/ModMatrixCell.d.ts.map +1 -1
  23. package/dist/types/advanced/ModMatrix/ModMatrixComboboxCell.d.ts +1 -1
  24. package/dist/types/advanced/ModMatrix/ModMatrixComboboxCell.d.ts.map +1 -1
  25. package/dist/types/advanced/ModMatrix/ModMatrixRow.d.ts +1 -1
  26. package/dist/types/advanced/ModMatrix/ModMatrixRow.d.ts.map +1 -1
  27. package/dist/types/advanced/ModMatrix/ModMatrixToggleCell.d.ts +1 -1
  28. package/dist/types/advanced/ModMatrix/ModMatrixToggleCell.d.ts.map +1 -1
  29. package/dist/types/advanced/ModuleFooter/InputModTab.d.ts +1 -1
  30. package/dist/types/advanced/ModuleFooter/InputModTab.d.ts.map +1 -1
  31. package/dist/types/advanced/ModuleFooter/LFOBox.d.ts +1 -1
  32. package/dist/types/advanced/ModuleFooter/LFOBox.d.ts.map +1 -1
  33. package/dist/types/advanced/ModuleFooter/LFOTab.d.ts +1 -1
  34. package/dist/types/advanced/ModuleFooter/LFOTab.d.ts.map +1 -1
  35. package/dist/types/advanced/ModuleFooter/ModuleFooter.d.ts +4 -4
  36. package/dist/types/advanced/ModuleFooter/ModuleFooter.d.ts.map +1 -1
  37. package/dist/types/advanced/ModuleFooter/SeqPanel.d.ts +1 -1
  38. package/dist/types/advanced/ModuleFooter/SeqPanel.d.ts.map +1 -1
  39. package/dist/types/advanced/ModuleFooter/SeqTab.d.ts +1 -1
  40. package/dist/types/advanced/ModuleFooter/SeqTab.d.ts.map +1 -1
  41. package/dist/types/advanced/ModuleHeader/ModuleHeader.d.ts +1 -1
  42. package/dist/types/advanced/ModuleHeader/ModuleHeader.d.ts.map +1 -1
  43. package/dist/types/advanced/Oscilloscope/LinePlot.d.ts +1 -1
  44. package/dist/types/advanced/Oscilloscope/LinePlot.d.ts.map +1 -1
  45. package/dist/types/advanced/Oscilloscope/Oscilloscope.d.ts +1 -1
  46. package/dist/types/advanced/Oscilloscope/Oscilloscope.d.ts.map +1 -1
  47. package/dist/types/advanced/OuterGlowFilter.d.ts +1 -1
  48. package/dist/types/advanced/OuterGlowFilter.d.ts.map +1 -1
  49. package/dist/types/advanced/PresetManager/PresetManager.d.ts +1 -1
  50. package/dist/types/advanced/PresetManager/PresetManager.d.ts.map +1 -1
  51. package/dist/types/advanced/StepSequencer/StepSequencer.d.ts +1 -1
  52. package/dist/types/advanced/StepSequencer/StepSequencer.d.ts.map +1 -1
  53. package/dist/types/advanced/ThemeWrapper/ThemeWrapper.d.ts +1 -1
  54. package/dist/types/advanced/ThemeWrapper/ThemeWrapper.d.ts.map +1 -1
  55. package/dist/types/advanced/VUMeter/VUMeter.d.ts +1 -1
  56. package/dist/types/advanced/VUMeter/VUMeter.d.ts.map +1 -1
  57. package/dist/types/common/types.d.ts +11 -1
  58. package/dist/types/common/types.d.ts.map +1 -1
  59. package/dist/types/common/utils.d.ts +67 -14
  60. package/dist/types/common/utils.d.ts.map +1 -1
  61. package/dist/types/common/utils.test.d.ts +2 -0
  62. package/dist/types/common/utils.test.d.ts.map +1 -0
  63. package/dist/types/context/GlobalContextProvider.d.ts +1 -1
  64. package/dist/types/context/GlobalContextProvider.d.ts.map +1 -1
  65. package/dist/types/core/Box/Box.d.ts +1 -1
  66. package/dist/types/core/Box/Box.d.ts.map +1 -1
  67. package/dist/types/core/Button/Button.d.ts +1 -1
  68. package/dist/types/core/Button/Button.d.ts.map +1 -1
  69. package/dist/types/core/Chart/AnimationDataWrapper.d.ts +1 -1
  70. package/dist/types/core/Chart/AnimationDataWrapper.d.ts.map +1 -1
  71. package/dist/types/core/Chart/Area.d.ts +1 -1
  72. package/dist/types/core/Chart/Area.d.ts.map +1 -1
  73. package/dist/types/core/Chart/Bar.d.ts +1 -1
  74. package/dist/types/core/Chart/Bar.d.ts.map +1 -1
  75. package/dist/types/core/Chart/Chart.d.ts +1 -1
  76. package/dist/types/core/Chart/Chart.d.ts.map +1 -1
  77. package/dist/types/core/Chart/Line.d.ts +1 -1
  78. package/dist/types/core/Chart/Line.d.ts.map +1 -1
  79. package/dist/types/core/Chart/LineChart/LineChart.d.ts +1 -1
  80. package/dist/types/core/Chart/LineChart/LineChart.d.ts.map +1 -1
  81. package/dist/types/core/Chart/LineChart/LineChartCanvas.d.ts +1 -1
  82. package/dist/types/core/Chart/LineChart/LineChartCanvas.d.ts.map +1 -1
  83. package/dist/types/core/Chart/LineChart/LineChartSvg.d.ts +1 -1
  84. package/dist/types/core/Chart/LineChart/LineChartSvg.d.ts.map +1 -1
  85. package/dist/types/core/Chart/StackedChart.d.ts +1 -1
  86. package/dist/types/core/Chart/StackedChart.d.ts.map +1 -1
  87. package/dist/types/core/Chart/Ticks.d.ts +1 -1
  88. package/dist/types/core/Chart/Ticks.d.ts.map +1 -1
  89. package/dist/types/core/Combobox/Combobox.d.ts +1 -1
  90. package/dist/types/core/Combobox/Combobox.d.ts.map +1 -1
  91. package/dist/types/core/Combobox/ComboboxComponent.d.ts +1 -1
  92. package/dist/types/core/Combobox/ComboboxComponent.d.ts.map +1 -1
  93. package/dist/types/core/Combobox/ListboxComponent.d.ts +1 -1
  94. package/dist/types/core/Combobox/ListboxComponent.d.ts.map +1 -1
  95. package/dist/types/core/DataViz/SingleBarViz.d.ts +1 -1
  96. package/dist/types/core/DataViz/SingleBarViz.d.ts.map +1 -1
  97. package/dist/types/core/Heading/Heading.d.ts +1 -1
  98. package/dist/types/core/Heading/Heading.d.ts.map +1 -1
  99. package/dist/types/core/Icon/Icon.d.ts +29 -29
  100. package/dist/types/core/Icon/Icon.d.ts.map +1 -1
  101. package/dist/types/core/Indicators/IndicatorLight.d.ts +1 -1
  102. package/dist/types/core/Indicators/IndicatorLight.d.ts.map +1 -1
  103. package/dist/types/core/Input/Input.d.ts +1 -1
  104. package/dist/types/core/Input/Input.d.ts.map +1 -1
  105. package/dist/types/core/Label/Label.d.ts +1 -1
  106. package/dist/types/core/Label/Label.d.ts.map +1 -1
  107. package/dist/types/core/PositioningWrapper/PositioningWrapper.d.ts +1 -1
  108. package/dist/types/core/PositioningWrapper/PositioningWrapper.d.ts.map +1 -1
  109. package/dist/types/core/Slider/BarSlider.d.ts +5 -2
  110. package/dist/types/core/Slider/BarSlider.d.ts.map +1 -1
  111. package/dist/types/core/Slider/RotaryCircle.d.ts +1 -1
  112. package/dist/types/core/Slider/RotaryCircle.d.ts.map +1 -1
  113. package/dist/types/core/Slider/RotaryCombobox.d.ts +1 -1
  114. package/dist/types/core/Slider/RotaryCombobox.d.ts.map +1 -1
  115. package/dist/types/core/Slider/RotarySlider.d.ts +1 -1
  116. package/dist/types/core/Slider/RotarySlider.d.ts.map +1 -1
  117. package/dist/types/core/Slider/Slider.d.ts +1 -1
  118. package/dist/types/core/Slider/Slider.d.ts.map +1 -1
  119. package/dist/types/core/Slider/SliderSVG.d.ts +3 -3
  120. package/dist/types/core/Slider/SliderSVG.d.ts.map +1 -1
  121. package/dist/types/core/Tabs/Tabs.d.ts +1 -1
  122. package/dist/types/core/Tabs/Tabs.d.ts.map +1 -1
  123. package/dist/types/core/Toggle/Toggle.d.ts +2 -1
  124. package/dist/types/core/Toggle/Toggle.d.ts.map +1 -1
  125. package/dist/types/hooks/useCombobox.d.ts +2 -2
  126. package/dist/types/hooks/useCombobox.d.ts.map +1 -1
  127. package/dist/types/hooks/useGroupFocus.d.ts +2 -1
  128. package/dist/types/hooks/useGroupFocus.d.ts.map +1 -1
  129. package/dist/types/hooks/useSlider.d.ts.map +1 -1
  130. package/package.json +9 -3
package/dist/index.js CHANGED
@@ -193,7 +193,19 @@ var IncrementType;
193
193
  IncrementType["fine"] = "fine";
194
194
  IncrementType["standard"] = "standard";
195
195
  IncrementType["button"] = "button";
196
+ IncrementType["index"] = "index";
197
+ IncrementType["indexButton"] = "indexButton";
196
198
  })(IncrementType || (IncrementType = {}));
199
+ var NumberType;
200
+ (function(NumberType) {
201
+ NumberType["float"] = "float";
202
+ NumberType["integer"] = "integer";
203
+ })(NumberType || (NumberType = {}));
204
+ var StepDirection;
205
+ (function(StepDirection) {
206
+ StepDirection["up"] = "up";
207
+ StepDirection["down"] = "down";
208
+ })(StepDirection || (StepDirection = {}));
197
209
 
198
210
  var SliderType;
199
211
  (function(SliderType) {
@@ -262,7 +274,7 @@ const clamp = (val, min = 0, max = 1)=>{
262
274
  };
263
275
  function snapToLegalValue({ value, properties }) {
264
276
  const { interval, start, end } = properties;
265
- if (interval == 0) return value;
277
+ if (interval === 0) return value;
266
278
  const roundedInterval = parseFloat(interval?.toFixed(2));
267
279
  const formattedValue = start + roundedInterval * Math.floor((value - start) / roundedInterval + 0.5);
268
280
  return parseFloat(clamp(formattedValue, start, end)?.toFixed(2));
@@ -371,25 +383,59 @@ const randomizeValue = (min, max)=>{
371
383
  // min?: number;
372
384
  // max?: number;
373
385
  // }
374
- const incrementValue = ({ incrementType, numSteps, delta, prevVal, interval, incrementBy })=>{
375
- const velocityMultiplier = incrementType === IncrementType.standard ? Math.abs(delta ?? 1) : incrementType === IncrementType.button && incrementBy ? incrementBy : 1;
376
- const constrainedNumStepsMultiplier = incrementType === IncrementType.standard ? Math.abs(numSteps * 0.01) : 1;
377
- const newValue = parseFloat(((prevVal ?? 0) + interval * velocityMultiplier * constrainedNumStepsMultiplier * Math.sign(delta ?? 1))?.toFixed(2));
378
- return newValue;
386
+ const getTotalNumStepsMultiplier = (incrementType, numSteps)=>{
387
+ return incrementType === IncrementType.standard || incrementType === IncrementType.button ? Math.max(Math.abs(numSteps * 0.01), 1) : 1;
379
388
  };
380
- const incrementIndex = ({ velocity = 0, numOptions, incrementBy, selectedIndex })=>{
381
- let spreadMultiplier = 1;
382
- if (numOptions) {
383
- if (numOptions < 50) {
384
- spreadMultiplier = 0.7;
385
- } else if (numOptions >= 50 && numOptions < 150) {
386
- spreadMultiplier = 3;
387
- } else {
388
- spreadMultiplier = 4;
389
- }
390
- }
391
- const velocityMultiplier = Math.max(velocity, 1);
392
- return velocity && velocity > 0.5 ? selectedIndex + incrementBy * velocityMultiplier * spreadMultiplier : selectedIndex + incrementBy;
389
+ const incrementValue = ({ incrementType, sliderNumSteps, comboboxNumChoices, delta, startingValue, buttonIncrement, buttonDirection = StepDirection.up, sliderInterval, sliderMin, sliderMax })=>{
390
+ const hasButtonIncrementType = incrementType === IncrementType.button || incrementType === IncrementType.indexButton;
391
+ const hasVelocity = incrementType === IncrementType.standard || incrementType === IncrementType.index;
392
+ const isFloatValue = incrementType === IncrementType.standard || incrementType === IncrementType.fine || incrementType === IncrementType.button;
393
+ // const velocityMultiplier: number = 1;
394
+ const buttonIncrementMultiplier = hasButtonIncrementType && buttonIncrement ? Math.abs(buttonIncrement) : 1;
395
+ const totalNumStepsMultiplier = getTotalNumStepsMultiplier(incrementType, (isFloatValue ? sliderNumSteps : comboboxNumChoices) ?? 0);
396
+ const deltaMultiplier = hasVelocity ? Math.abs(delta ?? 1) : 1;
397
+ const signMultiplier = hasButtonIncrementType ? Math.sign(buttonDirection === StepDirection.down ? -1 : 1) : Math.sign(delta ?? 1);
398
+ const returnVal = (startingValue ?? 0) + (incrementType === IncrementType.indexButton || incrementType === IncrementType.index ? 1 : sliderInterval ?? 0) * signMultiplier * deltaMultiplier * buttonIncrementMultiplier * totalNumStepsMultiplier;
399
+ return isFloatValue ? Math.max(sliderMin, Math.min(parseFloat(returnVal?.toFixed(2)), sliderMax)) : Math.max(0, Math.min((comboboxNumChoices ?? 0) - 1, Math.round(returnVal)));
400
+ };
401
+ const incrementSlider = ({ delta, incrementType, startingValue, sliderInterval, sliderNumSteps, sliderMin, sliderMax })=>{
402
+ return incrementValue({
403
+ delta,
404
+ incrementType,
405
+ startingValue,
406
+ sliderInterval,
407
+ sliderNumSteps,
408
+ sliderMin,
409
+ sliderMax
410
+ });
411
+ };
412
+ const incrementSliderButton = ({ startingValue, buttonIncrement, buttonDirection, sliderInterval, sliderNumSteps, sliderMin, sliderMax })=>{
413
+ return incrementValue({
414
+ incrementType: IncrementType.button,
415
+ startingValue,
416
+ buttonIncrement,
417
+ buttonDirection,
418
+ sliderInterval,
419
+ sliderNumSteps,
420
+ sliderMin,
421
+ sliderMax
422
+ });
423
+ };
424
+ const incrementIndex = ({ delta, startingValue, comboboxNumChoices })=>{
425
+ return incrementValue({
426
+ delta,
427
+ incrementType: IncrementType.index,
428
+ startingValue,
429
+ comboboxNumChoices
430
+ });
431
+ };
432
+ const incrementIndexButton = ({ startingValue, comboboxNumChoices, buttonDirection })=>{
433
+ return incrementValue({
434
+ incrementType: IncrementType.indexButton,
435
+ startingValue,
436
+ comboboxNumChoices,
437
+ buttonDirection
438
+ });
393
439
  };
394
440
  const generateDropShadowFilterString = (colors, radius)=>{
395
441
  let output = [];
@@ -405,7 +451,7 @@ const generateDropShadowFilterString = (colors, radius)=>{
405
451
  };
406
452
  const getTextOuterGlowString = (outerGlowColor, outerGlowRadius)=>`${outerGlowColor} 0px 0px ${outerGlowRadius / 2}px, ${outerGlowColor} 0px 0px ${outerGlowRadius}px`;
407
453
  const getNumericValue = (value)=>typeof value === 'string' ? +(value?.match(/\d+/)?.[0] ?? '') : value;
408
- const getIncrementValue = (value)=>typeof value === 'string' ? value.match(/[a-z]/g)?.[0] : 'px';
454
+ const getUnit = (value)=>typeof value === 'string' ? value.match(/[a-z]/g)?.[0] : 'px';
409
455
  const getStringSizeValue = (value, increment = 'px')=>typeof value === 'string' ? value : `${value}${increment}`;
410
456
  const getBorderValue = (borderArray, borderDirection, returnNumericValue)=>{
411
457
  switch(borderDirection){
@@ -1342,11 +1388,17 @@ function Tabs({ items, initialSelectedIndex = undefined, id = '', className, pad
1342
1388
  useEffect(()=>{
1343
1389
  if (dataSource === DataSource.JuceCombobox) {
1344
1390
  setTimeout(()=>{
1345
- setChoices(comboBoxState.properties.choices);
1346
- setSelectedIndex(comboBoxState.getChoiceIndex());
1391
+ if (comboBoxState.properties.choices.length > 0) {
1392
+ setChoices(comboBoxState.properties.choices);
1393
+ setSelectedIndex(comboBoxState.getChoiceIndex());
1394
+ }
1347
1395
  });
1348
1396
  } else {
1349
- setChoices(items?.length ? items : []);
1397
+ setTimeout(()=>{
1398
+ if (items?.length) {
1399
+ setChoices(items);
1400
+ }
1401
+ });
1350
1402
  }
1351
1403
  }, []);
1352
1404
  useEffect(()=>{
@@ -1911,8 +1963,6 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
1911
1963
  const [properties, setProperties] = useState(comboBoxState?.properties);
1912
1964
  const [selectedIndex, setSelectedIndex] = useState(comboBoxState?.getChoiceIndex());
1913
1965
  const prevIndex = useRef(null);
1914
- const nextIndex = useRef(null);
1915
- const prevDragDirection = useRef(null);
1916
1966
  const { highlightedItemChanged, getModSlotPreview, updateModSlotRowTarget } = useGlobalContext();
1917
1967
  const modSlotPreview = getModSlotPreview();
1918
1968
  //TODO: Filter choices for subsequent rows
@@ -1978,7 +2028,7 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
1978
2028
  const filteredChoices = getFilteredChoices(items, filter);
1979
2029
  // Used in RotaryCombobox
1980
2030
  const bindDrag = useGesture({
1981
- onDrag: ({ direction, velocity })=>{
2031
+ onDrag: ({ direction, delta })=>{
1982
2032
  //TODO: Move this out of useSlider
1983
2033
  if (updateModSlotPreview) {
1984
2034
  updateModSlotRowTarget({
@@ -1987,34 +2037,12 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
1987
2037
  saveToBackend: false
1988
2038
  });
1989
2039
  }
1990
- let directionY;
1991
- if (direction[1] * -1 === 1 && directionY !== prevDragDirection.current) {
1992
- directionY = 1;
1993
- } else if (direction[1] * -1 === -1 && directionY !== prevDragDirection.current) {
1994
- directionY = -1;
1995
- }
1996
- if (selectedIndex < choices.length && directionY && directionY === 1) {
1997
- // throttle(() => {
1998
- nextIndex.current = incrementIndex({
1999
- velocity: velocity[1],
2000
- incrementBy: 1,
2001
- numOptions: properties?.choices?.length,
2002
- selectedIndex
2003
- });
2004
- // }, 90);
2005
- } else if (selectedIndex > 0 && directionY && directionY === -1) {
2006
- // throttle(() => {
2007
- nextIndex.current = incrementIndex({
2008
- velocity: velocity[1],
2009
- incrementBy: -1,
2010
- numOptions: properties?.choices?.length,
2011
- selectedIndex
2012
- });
2013
- // }, 90);
2014
- }
2015
- if (nextIndex.current !== null && nextIndex.current !== undefined && nextIndex.current !== selectedIndex.current) {
2016
- comboBoxState?.setChoiceIndex(nextIndex.current);
2017
- }
2040
+ const newValue = incrementIndex({
2041
+ delta: delta[1] * -1,
2042
+ startingValue: selectedIndex,
2043
+ comboboxNumChoices: properties?.choices?.length ?? 0
2044
+ });
2045
+ comboBoxState?.setChoiceIndex(newValue);
2018
2046
  }
2019
2047
  }, {
2020
2048
  enabled: !isDisabled,
@@ -2055,20 +2083,22 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
2055
2083
  });
2056
2084
  }
2057
2085
  };
2058
- const incrementComboboxIndex = ()=>{
2059
- if (selectedIndex < properties.choices.length - 1) {
2060
- const newIndex = incrementIndex({
2061
- selectedIndex,
2062
- incrementBy: 1
2086
+ const incrementComboboxButton = ()=>{
2087
+ if (selectedIndex <= properties.choices.length - 1) {
2088
+ const newIndex = incrementIndexButton({
2089
+ startingValue: selectedIndex,
2090
+ comboboxNumChoices: properties?.choices?.length,
2091
+ buttonDirection: StepDirection.up
2063
2092
  });
2064
2093
  handleChange(newIndex);
2065
2094
  }
2066
2095
  };
2067
- const decrementComboboxIndex = ()=>{
2096
+ const decrementComboboxButton = ()=>{
2068
2097
  if (selectedIndex > 0) {
2069
- const newIndex = incrementIndex({
2070
- selectedIndex,
2071
- incrementBy: -1
2098
+ const newIndex = incrementIndexButton({
2099
+ startingValue: selectedIndex,
2100
+ comboboxNumChoices: properties?.choices?.length,
2101
+ buttonDirection: StepDirection.down
2072
2102
  });
2073
2103
  handleChange(newIndex);
2074
2104
  }
@@ -2086,8 +2116,8 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
2086
2116
  onClick,
2087
2117
  onDoubleClick,
2088
2118
  bindDrag,
2089
- incrementComboboxIndex,
2090
- decrementComboboxIndex
2119
+ incrementComboboxButton,
2120
+ decrementComboboxButton
2091
2121
  };
2092
2122
  };
2093
2123
 
@@ -2148,7 +2178,7 @@ function ComboboxComponent({ id, anchorTo, excludeItems = [], items, onChange, c
2148
2178
  }) : null,
2149
2179
  jsxs(Combobox$2, {
2150
2180
  value: selectedIndexLabel,
2151
- onChange: (selectedIndexLabel)=>handleChange(selectedIndexLabel),
2181
+ onChange: (selectedIndexLabel)=>selectedIndexLabel && handleChange(selectedIndexLabel),
2152
2182
  onClose: ()=>{
2153
2183
  setIncludeFilterString('');
2154
2184
  },
@@ -2206,7 +2236,7 @@ function ComboboxComponent({ id, anchorTo, excludeItems = [], items, onChange, c
2206
2236
  style: {
2207
2237
  visibility: numVisibleItems === 0 ? 'hidden' : 'visible',
2208
2238
  // bottom: `${-(listItemHeight * numVisibleItems)}px`,
2209
- height: getStringSizeValue(getNumericValue(listItemHeight) * numVisibleItems, getIncrementValue(listItemHeight)),
2239
+ height: getStringSizeValue(getNumericValue(listItemHeight) * numVisibleItems, getUnit(listItemHeight)),
2210
2240
  border: `${dropdownBorderWidth}px solid ${dropdownBorderColor}`,
2211
2241
  background: dropdownBackgroundColor,
2212
2242
  width: width && getStringSizeValue(width)
@@ -2247,7 +2277,7 @@ function Combobox$1({ label, showLabel, color = 'var(--color-text)', labelColor,
2247
2277
  0,
2248
2278
  0
2249
2279
  ], buttonBackgroundColor = 'var(--bg-lv4)', buttonHighlightColor, buttonHeight = 34, outerGlowRadius, outerGlowColors, className, onChange, isDisabled, anchorTo = AnchorTo.bottomLeft, width = 110, listItemHeight = 34, id, style }) {
2250
- const { selectedIndexLabel, choices, onMouseEnter, onMouseExit, handleChange, onClick, incrementComboboxIndex, properties, decrementComboboxIndex } = useCombobox({
2280
+ const { selectedIndexLabel, choices, onMouseEnter, onMouseExit, handleChange, onClick, incrementComboboxButton, properties, decrementComboboxButton } = useCombobox({
2251
2281
  id,
2252
2282
  label,
2253
2283
  onChange
@@ -2385,7 +2415,7 @@ function Combobox$1({ label, showLabel, color = 'var(--color-text)', labelColor,
2385
2415
  IconButton.padding.xSmall,
2386
2416
  IconButton.padding.small
2387
2417
  ],
2388
- onClick: decrementComboboxIndex
2418
+ onClick: decrementComboboxButton
2389
2419
  }),
2390
2420
  jsx(IconButton, {
2391
2421
  id: "Combobox-down-arrow",
@@ -2405,7 +2435,7 @@ function Combobox$1({ label, showLabel, color = 'var(--color-text)', labelColor,
2405
2435
  IconButton.padding.small,
2406
2436
  IconButton.padding.small
2407
2437
  ],
2408
- onClick: incrementComboboxIndex
2438
+ onClick: incrementComboboxButton
2409
2439
  })
2410
2440
  ]
2411
2441
  })
@@ -2818,12 +2848,14 @@ const useSlider = ({ id, rowId, label, displayValInHeader = true, mockProperties
2818
2848
  }
2819
2849
  if (dragOrientation !== DragOrientation.followCursor) {
2820
2850
  const deltaVal = dragOrientation === DragOrientation.vertical ? delta[1] * -1 : delta[0];
2821
- const newValue = incrementValue({
2851
+ const newValue = incrementSlider({
2822
2852
  delta: deltaVal,
2823
2853
  incrementType: optionIsDown ? IncrementType.fine : IncrementType.standard,
2824
- prevVal: previousScaledValueRef.current || 0,
2825
- interval: properties?.interval ?? 0,
2826
- numSteps: properties?.numSteps ?? 0
2854
+ startingValue: previousScaledValueRef.current || 0,
2855
+ sliderInterval: properties?.interval ?? 0,
2856
+ sliderNumSteps: properties?.numSteps ?? 0,
2857
+ sliderMin: properties?.start ?? 0,
2858
+ sliderMax: properties?.end ?? 0
2827
2859
  });
2828
2860
  setJuceScaledValue(newValue);
2829
2861
  }
@@ -3533,13 +3565,14 @@ activeColor = 'var(--color-brand)', inactiveColor = 'var(--bg-lv1)', shape = Ind
3533
3565
  });
3534
3566
  }
3535
3567
 
3536
- function useGroupFocus({ isDisabled, id, inputRef }) {
3568
+ function useGroupFocus({ isDisabled, id, inputRef, incrementBy }) {
3537
3569
  const [isFocused, setIsFocused] = useState(false);
3538
3570
  const isOptionPressed = useRef(false);
3539
3571
  const groupId = `${id}-control-group`;
3540
3572
  const inputId = `${id}-input`;
3541
3573
  const sliderState = Juce.getSliderState(id);
3542
3574
  const comboBoxState = Juce.getComboBoxState(id);
3575
+ const isMainSliderACombobox = comboBoxState?.properties?.choices?.length > 0;
3543
3576
  const mousedownListener = (event)=>{
3544
3577
  if (!isDisabled) {
3545
3578
  if (event.target.closest('.ControlGroup')?.id === groupId) {
@@ -3566,15 +3599,16 @@ function useGroupFocus({ isDisabled, id, inputRef }) {
3566
3599
  }
3567
3600
  };
3568
3601
  const increment = ()=>{
3569
- const isMainSliderACombobox = comboBoxState?.properties?.choices?.length > 0;
3570
3602
  if (!isMainSliderACombobox) {
3571
3603
  const scaledVal = sliderState?.scaledValue;
3572
- const newValue = incrementValue({
3573
- incrementType: IncrementType.button,
3574
- incrementBy: 5,
3575
- numSteps: sliderState?.properties?.numSteps,
3576
- prevVal: scaledVal,
3577
- interval: sliderState?.properties?.interval
3604
+ const newValue = incrementSliderButton({
3605
+ sliderNumSteps: sliderState?.properties?.numSteps,
3606
+ startingValue: scaledVal,
3607
+ buttonDirection: StepDirection.up,
3608
+ sliderInterval: sliderState?.properties?.interval,
3609
+ sliderMin: sliderState?.properties?.start,
3610
+ sliderMax: sliderState?.properties?.end,
3611
+ buttonIncrement: 1
3578
3612
  });
3579
3613
  sliderState.setScaledValue(newValue);
3580
3614
  } else {
@@ -3583,15 +3617,16 @@ function useGroupFocus({ isDisabled, id, inputRef }) {
3583
3617
  }
3584
3618
  };
3585
3619
  const decrement = ()=>{
3586
- const isMainSliderACombobox = comboBoxState?.properties?.choices?.length > 0;
3587
3620
  if (!isMainSliderACombobox) {
3588
3621
  const scaledVal = sliderState?.scaledValue;
3589
- const newValue = incrementValue({
3590
- incrementType: IncrementType.button,
3591
- incrementBy: -5,
3592
- numSteps: sliderState?.properties?.numSteps,
3593
- prevVal: scaledVal,
3594
- interval: sliderState?.properties?.interval
3622
+ const newValue = incrementSliderButton({
3623
+ sliderNumSteps: sliderState?.properties?.numSteps,
3624
+ startingValue: scaledVal,
3625
+ buttonDirection: StepDirection.down,
3626
+ sliderInterval: sliderState?.properties?.interval,
3627
+ sliderMin: sliderState?.properties?.start,
3628
+ sliderMax: sliderState?.properties?.end,
3629
+ buttonIncrement: 1
3595
3630
  });
3596
3631
  sliderState?.setScaledValue(newValue);
3597
3632
  } else {
@@ -3638,6 +3673,14 @@ function useGroupFocus({ isDisabled, id, inputRef }) {
3638
3673
  event.preventDefault();
3639
3674
  increment();
3640
3675
  }
3676
+ if (event.key === 'ArrowUp') {
3677
+ event.preventDefault();
3678
+ increment();
3679
+ }
3680
+ if (event.key === 'ArrowDown') {
3681
+ event.preventDefault();
3682
+ decrement();
3683
+ }
3641
3684
  }
3642
3685
  }
3643
3686
  }
@@ -3804,7 +3847,7 @@ RotarySlider.trackWidth = TrackWidths;
3804
3847
  var css_248z$9 = ".BarSlider-innerWrapper:hover {\n cursor: pointer;\n}\n\n.BarSlider-Track {\n touch-action: none;\n position: relative;\n width: 100%;\n height: 100%;\n max-height: 100%;\n max-width: 100%;\n background-color: var(--bg-lv5);\n}\n\n.BarSlider-Track.isHighlighted {\n background-color: var(--bg-lv6);\n}\n.Barslider-IndicatorLineWrapper,\n.BarSlider-HandleWrapper {\n position: absolute;\n pointer-events: none;\n}\n\n.BarSlider-IndicatorLine {\n position: absolute;\n top: 0;\n /* left: 0; */\n right: 0;\n bottom: 0;\n pointer-events: none;\n}\n.BarSlider-Handle {\n position: absolute;\n pointer-events: none;\n}\n\n.BarSliderHandle {\n pointer-events: auto;\n}\n.Barslider-IndicatorLineWrapper {\n /* border-radius: var(--trackBorderRadius); */\n overflow: hidden;\n}\n\n.BarSlider-Input {\n font-weight: bold;\n width: 100%;\n}\n\n.BarSlider-Input.includeValueInHeightIsFalse {\n position: absolute;\n bottom: -1.7em;\n left: 0;\n right: 0;\n z-index: 10;\n}\n";
3805
3848
  styleInject(css_248z$9);
3806
3849
 
3807
- function Slider$1({ polarity = Polarity.unipolar, orientation = Orientation.vertical, dragOrientation = DragOrientation.followCursor, isRandomizable = false, randomizerObject, isStandalone = true, isHighlighted = false, showValue = true, showHandle = true, showLabel = true, showInsetBoxShadow = true, resetterObject, className, id, width, height = '100%', onChange, outerGlowRadius, outerGlowColors, trackBorderRadius = 20, blur, style, indicatorLineColor = 'var(--color-brand)', indicatorLineGradient, trackColor = 'var(--bg-lv3)', markColor = 'var(--bg-lv7)', markHighlightColor = 'var(--color-text)', trackStrokeColor, handleFillColor, handleStrokeColor, trackWidth = TrackWidths.small, label, labelColor, marks = [], inputHighlightColor = 'var(--color-brand)', includeValueInHeight = true, // Mocks the initial scaled value of the slider for web veiws outside of JUCE
3850
+ function Slider$1({ polarity = Polarity.unipolar, orientation = Orientation.vertical, dragOrientation = DragOrientation.followCursor, isRandomizable = false, randomizerObject, isStandalone = true, isHighlighted = false, showValue = true, showHandle = true, showLabel = true, showInsetBoxShadow = true, resetterObject, className, id, width, height = Height.full, onChange, outerGlowRadius, outerGlowColors, trackBorderRadius = 20, blur, style, indicatorLineColor = 'var(--color-brand)', indicatorLineGradient, trackColor = 'var(--bg-lv3)', markColor = 'var(--bg-lv7)', markHighlightColor = 'var(--color-text)', trackStrokeColor, handleFillColor, handleStrokeColor, cornerBorderHighlightColor, trackWidth = TrackWidths.small, label, labelColor, marks = [], inputHighlightColor = 'var(--color-brand)', includeValueInHeight = true, // Mocks the initial scaled value of the slider for web veiws outside of JUCE
3808
3851
  mockInitialNormalisedValue = 0, mockProperties = {
3809
3852
  start: 20.0,
3810
3853
  end: 15000.0,
@@ -3814,6 +3857,7 @@ mockInitialNormalisedValue = 0, mockProperties = {
3814
3857
  const sliderElementRef = useRef(null);
3815
3858
  const handleElementRef = useRef(null);
3816
3859
  const barSliderIndicatorRef = useRef(null);
3860
+ const inputRef = useRef(null);
3817
3861
  const isHorizontal = orientation === Orientation.horizontal;
3818
3862
  const isVertical = orientation === Orientation.vertical;
3819
3863
  const handleWidth = 18;
@@ -3822,6 +3866,10 @@ mockInitialNormalisedValue = 0, mockProperties = {
3822
3866
  // const elementRef = useRef<HTMLDivElement>(null);
3823
3867
  const animationFrameRef = useRef(null);
3824
3868
  const prevValRef = useRef(null);
3869
+ const { isFocused } = useGroupFocus({
3870
+ id,
3871
+ inputRef
3872
+ });
3825
3873
  const animate = animateBarChart({
3826
3874
  animationFrameRef,
3827
3875
  elementRef: barSliderIndicatorRef,
@@ -3854,6 +3902,7 @@ mockInitialNormalisedValue = 0, mockProperties = {
3854
3902
  marks
3855
3903
  });
3856
3904
  const drag = isStandalone ? bindDrag : bindSequenceDrag;
3905
+ // const focusBorderMargin = 10;
3857
3906
  useEffect(()=>{
3858
3907
  if (normalisedValue !== null && normalisedValue !== undefined && normalisedValue !== prevValRef.current) {
3859
3908
  animate(normalisedValue);
@@ -3879,6 +3928,7 @@ mockInitialNormalisedValue = 0, mockProperties = {
3879
3928
  [GradientStyles.multicolor]: multiColorGradient,
3880
3929
  [GradientStyles.unicolor]: singleColorGradient
3881
3930
  };
3931
+ const marginSize = Spacing.mediumSmall;
3882
3932
  // const handleRef = useRef(null);
3883
3933
  // useEffect(() => {
3884
3934
  // console.log(normalisedValue, 'NORMALIZEDVAL');
@@ -3890,7 +3940,7 @@ mockInitialNormalisedValue = 0, mockProperties = {
3890
3940
  className: classnames('BarSlider', isVertical && 'BarSlider--isVertical', isHorizontal && 'BarSlider--isHorizontal', className),
3891
3941
  id: id,
3892
3942
  ref: sliderElementRef,
3893
- gap: Box.gap.xSmall,
3943
+ gap: Box.gap.none,
3894
3944
  height: isVertical ? height : 'auto',
3895
3945
  width: isHorizontal ? width : width ?? '100%',
3896
3946
  style: {
@@ -3904,185 +3954,196 @@ mockInitialNormalisedValue = 0, mockProperties = {
3904
3954
  color: labelColor,
3905
3955
  outerGlowRadius: outerGlowRadius,
3906
3956
  outerGlowColor: labelColor,
3907
- blur: blur,
3908
- padding: [
3909
- Label.padding.none,
3910
- Label.padding.none,
3911
- Label.padding.small,
3912
- Label.padding.none
3913
- ]
3957
+ blur: blur
3914
3958
  }) : null,
3915
3959
  polarity === Polarity.bipolar && jsx("div", {
3916
3960
  className: 'Slider-center-marker'
3917
3961
  }),
3918
- jsxs(Box, {
3919
- style: {
3920
- position: 'relative'
3921
- },
3922
- fullHeight: true,
3923
- padding: [
3924
- Label.padding.none,
3925
- Label.padding.none,
3926
- Label.padding.small,
3927
- Label.padding.none
3928
- ],
3962
+ jsxs(ControlGroupWrapper, {
3963
+ id: id,
3964
+ width: '100%',
3965
+ height: '100%',
3966
+ isFocused: isFocused,
3967
+ className: `RotarySlider-HighlightWrapper`,
3968
+ borderHighlightColor: cornerBorderHighlightColor,
3929
3969
  children: [
3930
- marks && marks?.length > 0 ? marks?.map((item)=>jsxs(Box, {
3931
- width: '2.5rem',
3932
- height: '2rem',
3933
- flexDirection: Box.flexDirection.column,
3934
- style: {
3935
- position: 'absolute',
3936
- pointerEvents: 'none',
3937
- top: `1px`,
3938
- height: '2rem',
3939
- width: '2rem',
3940
- left: `calc(${item?.value * 100}% - 1rem)`,
3941
- zIndex: 1
3942
- },
3943
- children: [
3944
- jsx("div", {
3945
- className: "BarSlider-Mark",
3946
- style: {
3947
- width: '5px',
3948
- height: '5px',
3949
- borderRadius: '100%',
3950
- background: hoveredMark === item?.label ? markHighlightColor : markColor,
3951
- zIndex: 1,
3952
- cursor: 'pointer',
3953
- pointerEvents: 'auto'
3954
- },
3955
- onMouseEnter: ()=>setHoveredMark(item?.label),
3956
- onMouseLeave: ()=>setHoveredMark(null),
3957
- onClick: ()=>{
3958
- setNormalisedState(item?.value);
3959
- }
3960
- }),
3961
- item?.label ? jsx(Label, {
3962
- id: item?.label,
3963
- value: item?.label,
3964
- fontSize: Label.fontSize.xXSmall,
3965
- onMouseEnter: ()=>setHoveredMark(item?.label),
3966
- onMouseLeave: ()=>setHoveredMark(null),
3967
- color: +normalisedValue?.toFixed(2) === +item?.value?.toFixed(2) || hoveredMark === item?.label ? markHighlightColor : markColor,
3968
- highlightColor: markHighlightColor,
3969
- onClick: ()=>{
3970
- setNormalisedState(item?.value);
3971
- },
3972
- style: {
3973
- cursor: 'pointer',
3974
- pointerEvents: 'auto'
3975
- }
3976
- }) : null
3977
- ]
3978
- })) : null,
3979
- jsx(Box, {
3980
- className: "BarSlider-innerWrapper",
3981
- height: isHorizontal && showHandle ? `${handleWidth}px` : isHorizontal && !showHandle ? 'auto' : '100%',
3982
- width: isVertical && showHandle ? `${handleWidth}px` : '100%',
3970
+ jsxs(Box, {
3983
3971
  style: {
3984
- filter: `blur(${blur}px)`,
3985
- touchAction: 'none'
3972
+ position: 'relative'
3986
3973
  },
3987
- "data-sliderElement": "true",
3988
- ...drag(),
3989
- children: jsxs("div", {
3990
- className: classnames('BarSlider-Track', isHighlighted && 'isHighlighted'),
3991
- // onMouseEnter={onMouseEnter}
3992
- id: id,
3993
- style: {
3994
- background: trackColor,
3995
- stroke: trackStrokeColor ? `1px solid ${trackStrokeColor}` : 'none',
3996
- width: isHorizontal ? '100%' : trackStringWidth,
3997
- height: isHorizontal ? trackStringWidth : '100%',
3998
- borderRadius: trackBorderRadius ? `${trackBorderRadius}px` : '0',
3999
- boxShadow: showInsetBoxShadow ? `inset 0px 2px 6px rgba(0, 0, 0, 0.25)` : 'none',
4000
- filter: generateDropShadowFilterString(outerGlowColors, outerGlowRadius),
4001
- ...style
4002
- },
4003
- children: [
4004
- normalisedValue !== null && normalisedValue !== undefined ? jsx("div", {
4005
- className: "Barslider-IndicatorLineWrapper",
3974
+ fullHeight: true,
3975
+ padding: isStandalone ? isVertical ? [
3976
+ Box.padding.none
3977
+ ] : [
3978
+ marginSize,
3979
+ Box.padding.small,
3980
+ Box.padding.none,
3981
+ Box.padding.small
3982
+ ] : [
3983
+ Box.padding.none
3984
+ ],
3985
+ children: [
3986
+ marks && marks?.length > 0 ? marks?.map((item)=>jsxs(Box, {
3987
+ width: '2.5rem',
3988
+ height: '2rem',
3989
+ flexDirection: Box.flexDirection.column,
4006
3990
  style: {
4007
- borderRadius: trackBorderRadius ? `${trackBorderRadius}px` : '0',
4008
- bottom: '0',
4009
- left: '0',
4010
- width: isHorizontal ? '100%' : trackStringWidth,
4011
- height: '100%'
3991
+ position: 'absolute',
3992
+ pointerEvents: 'none',
3993
+ top: `var(--spacing-${marginSize})`,
3994
+ height: '2rem',
3995
+ width: '2rem',
3996
+ left: `calc(${item?.value * 100}% - 1rem)`,
3997
+ zIndex: 1
4012
3998
  },
4013
- children: jsx("div", {
4014
- // TODO: Why aren't the Tailwind classes working?
4015
- // className={classnames('h-full', 'w-full', 'absolute', 'bg-panel')}
4016
- ref: barSliderIndicatorRef,
4017
- className: "BarSlider-IndicatorLine",
4018
- style: {
4019
- background: indicatorLineGradient ? selectedGradientMap[indicatorLineGradient] : indicatorLineColor,
4020
- opacity: isStandalone || isHighlighted ? '100%' : '80%',
4021
- top: `${isHorizontal && 'calc(50% - 3px)'}`,
4022
- left: `${isVertical && 'calc(50% - 3px)'}`,
4023
- filter: generateDropShadowFilterString(outerGlowColors, outerGlowRadius),
4024
- ...getBarTransformStyles({
4025
- orientation: orientation,
4026
- polarity
4027
- })
4028
- }
4029
- })
4030
- }) : '',
4031
- showHandle ? jsx("div", {
4032
- className: "BarSlider-HandleWrapper",
3999
+ children: [
4000
+ jsx("div", {
4001
+ className: "BarSlider-Mark",
4002
+ style: {
4003
+ width: '5px',
4004
+ height: '5px',
4005
+ borderRadius: '100%',
4006
+ background: hoveredMark === item?.label ? markHighlightColor : markColor,
4007
+ zIndex: 1,
4008
+ cursor: 'pointer',
4009
+ pointerEvents: 'auto'
4010
+ },
4011
+ onMouseEnter: ()=>setHoveredMark(item?.label),
4012
+ onMouseLeave: ()=>setHoveredMark(null),
4013
+ onClick: ()=>{
4014
+ setNormalisedState(item?.value);
4015
+ }
4016
+ }),
4017
+ item?.label ? jsx(Label, {
4018
+ id: item?.label,
4019
+ value: item?.label,
4020
+ fontSize: Label.fontSize.xXSmall,
4021
+ onMouseEnter: ()=>setHoveredMark(item?.label),
4022
+ onMouseLeave: ()=>setHoveredMark(null),
4023
+ color: +normalisedValue?.toFixed(2) === +item?.value?.toFixed(2) || hoveredMark === item?.label ? markHighlightColor : markColor,
4024
+ highlightColor: markHighlightColor,
4025
+ onClick: ()=>{
4026
+ setNormalisedState(item?.value);
4027
+ },
4028
+ style: {
4029
+ cursor: 'pointer',
4030
+ pointerEvents: 'auto'
4031
+ }
4032
+ }) : null
4033
+ ]
4034
+ })) : null,
4035
+ jsx(Box, {
4036
+ className: "BarSlider-innerWrapper",
4037
+ height: isHorizontal && showHandle ? `${handleWidth}px` : isHorizontal && !showHandle ? 'auto' : '100%',
4038
+ width: isVertical && showHandle ? `${handleWidth}px` : '100%',
4039
+ style: {
4040
+ filter: `blur(${blur}px)`,
4041
+ touchAction: 'none'
4042
+ },
4043
+ "data-sliderElement": "true",
4044
+ ...drag(),
4045
+ children: jsxs("div", {
4046
+ className: classnames('BarSlider-Track', isHighlighted && 'isHighlighted'),
4047
+ // onMouseEnter={onMouseEnter}
4048
+ id: id,
4033
4049
  style: {
4034
- top: isHorizontal ? 0 : handleMargin / 2,
4035
- left: isHorizontal ? handleMargin / 2 : 0,
4036
- width: isHorizontal ? `calc(100% - ${handleMargin}px)` : '100%',
4037
- height: isHorizontal ? '100%' : `calc(100% - ${handleMargin}px)`,
4038
- zIndex: 2
4050
+ background: trackColor,
4051
+ stroke: trackStrokeColor ? `1px solid ${trackStrokeColor}` : 'none',
4052
+ width: isHorizontal ? '100%' : trackStringWidth,
4053
+ height: isHorizontal ? trackStringWidth : '100%',
4054
+ borderRadius: trackBorderRadius ? `${trackBorderRadius}px` : '0',
4055
+ boxShadow: showInsetBoxShadow ? `inset 0px 2px 6px rgba(0, 0, 0, 0.25)` : 'none',
4056
+ filter: generateDropShadowFilterString(outerGlowColors, outerGlowRadius),
4057
+ ...style
4039
4058
  },
4040
- children: jsx("div", {
4041
- ref: handleElementRef,
4042
- className: "BarSlider-Handle",
4043
- style: {
4044
- borderRadius: trackBorderRadius ? `${trackBorderRadius}px` : 'none'
4045
- },
4046
- children: jsx(BarSliderHandle, {
4047
- handleFillColor: handleFillColor,
4048
- handleStrokeColor: handleStrokeColor,
4049
- strokeWidth: 5,
4050
- width: handleWidth
4051
- })
4052
- })
4053
- }) : null
4054
- ]
4055
- })
4056
- })
4059
+ children: [
4060
+ normalisedValue !== null && normalisedValue !== undefined ? jsx("div", {
4061
+ className: "Barslider-IndicatorLineWrapper",
4062
+ style: {
4063
+ borderRadius: trackBorderRadius ? `${trackBorderRadius}px` : '0',
4064
+ bottom: '0',
4065
+ left: '0',
4066
+ width: isHorizontal ? '100%' : trackStringWidth,
4067
+ height: '100%'
4068
+ },
4069
+ children: jsx("div", {
4070
+ // TODO: Why aren't the Tailwind classes working?
4071
+ // className={classnames('h-full', 'w-full', 'absolute', 'bg-panel')}
4072
+ ref: barSliderIndicatorRef,
4073
+ className: "BarSlider-IndicatorLine",
4074
+ style: {
4075
+ background: indicatorLineGradient ? selectedGradientMap[indicatorLineGradient] : indicatorLineColor,
4076
+ opacity: isStandalone || isHighlighted ? '100%' : '80%',
4077
+ top: `${isHorizontal && 'calc(50% - 3px)'}`,
4078
+ left: `${isVertical && 'calc(50% - 3px)'}`,
4079
+ filter: generateDropShadowFilterString(outerGlowColors, outerGlowRadius),
4080
+ ...getBarTransformStyles({
4081
+ orientation: orientation,
4082
+ polarity
4083
+ })
4084
+ }
4085
+ })
4086
+ }) : '',
4087
+ showHandle ? jsx("div", {
4088
+ className: "BarSlider-HandleWrapper",
4089
+ style: {
4090
+ top: isHorizontal ? 0 : handleMargin / 2,
4091
+ left: isHorizontal ? handleMargin / 2 : 0,
4092
+ width: isHorizontal ? `calc(100% - ${handleMargin}px)` : '100%',
4093
+ height: isHorizontal ? '100%' : `calc(100% - ${handleMargin}px)`,
4094
+ zIndex: 2
4095
+ },
4096
+ children: jsx("div", {
4097
+ ref: handleElementRef,
4098
+ className: "BarSlider-Handle",
4099
+ style: {
4100
+ borderRadius: trackBorderRadius ? `${trackBorderRadius}px` : 'none'
4101
+ },
4102
+ children: jsx(BarSliderHandle, {
4103
+ handleFillColor: handleFillColor,
4104
+ handleStrokeColor: handleStrokeColor,
4105
+ strokeWidth: 5,
4106
+ width: handleWidth
4107
+ })
4108
+ })
4109
+ }) : null
4110
+ ]
4111
+ })
4112
+ })
4113
+ ]
4114
+ }),
4115
+ showValue ? jsx(Input, {
4116
+ className: `BarSlider-Input ${includeValueInHeight ? 'includeValueInHeightIsTrue' : 'includeValueInHeightIsFalse'}`,
4117
+ ref: inputRef,
4118
+ value: scaledValue,
4119
+ id: id,
4120
+ min: properties?.start || 0,
4121
+ max: properties?.end || 0,
4122
+ type: Input.type.number,
4123
+ textColor: labelColor,
4124
+ highlightColor: inputHighlightColor,
4125
+ outerGlowRadius: outerGlowRadius,
4126
+ outerGlowColor: labelColor,
4127
+ style: {
4128
+ },
4129
+ blur: blur,
4130
+ textAlign: Input.textAlign.center,
4131
+ onComplete: (value)=>{
4132
+ // normalisedValue !== undefined &&
4133
+ // setScaledState(normalisedValue);
4134
+ value !== undefined && setScaledState(value);
4135
+ }
4136
+ }) : null
4057
4137
  ]
4058
- }),
4059
- showValue ? jsx(Input, {
4060
- className: `BarSlider-Input ${includeValueInHeight ? 'includeValueInHeightIsTrue' : 'includeValueInHeightIsFalse'}`,
4061
- value: scaledValue,
4062
- id: id,
4063
- min: properties?.start || 0,
4064
- max: properties?.end || 0,
4065
- type: Input.type.number,
4066
- textColor: labelColor,
4067
- highlightColor: inputHighlightColor,
4068
- outerGlowRadius: outerGlowRadius,
4069
- outerGlowColor: labelColor,
4070
- style: {
4071
- },
4072
- blur: blur,
4073
- textAlign: Input.textAlign.center,
4074
- onComplete: (value)=>{
4075
- // normalisedValue !== undefined &&
4076
- // setScaledState(normalisedValue);
4077
- value !== undefined && setScaledState(value);
4078
- }
4079
- }) : null
4138
+ })
4080
4139
  ]
4081
4140
  });
4082
4141
  }
4083
4142
  Slider$1.sliderType = SliderType;
4084
4143
  Slider$1.polarity = Polarity;
4085
4144
  Slider$1.orientation = Orientation;
4145
+ Slider$1.width = Width;
4146
+ Slider$1.height = Height;
4086
4147
 
4087
4148
  // Rotary Slider UI component.
4088
4149
  // Connects to Juce's Slider element
@@ -4286,6 +4347,7 @@ mockInitialNormalisedValue = 0, showValue, includeValueInHeight, marks, isRandom
4286
4347
  isStandalone: isStandalone,
4287
4348
  isHighlighted: isHighlighted,
4288
4349
  includeValueInHeight: includeValueInHeight,
4350
+ cornerBorderHighlightColor: cornerBorderHighlightColor,
4289
4351
  randomizerObject: randomizerObject,
4290
4352
  blur: blur
4291
4353
  }) : null