@longline/aqua-ui 1.0.61 → 1.0.62

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.
@@ -31,8 +31,8 @@ var SliderBase = function (props) {
31
31
  // while the knob is being dragged. Upon release, this value is called back
32
32
  // with onChange. Or continuously, if `immediate` is set.
33
33
  var value = React.useRef(props.value);
34
- // Reference: slider body
35
- var sliderRef = React.useRef(null);
34
+ // Reference: track body
35
+ var trackRef = React.useRef(null);
36
36
  // Reference: track fill.
37
37
  var trackFillRef = React.useRef(null);
38
38
  // Reference: knob
@@ -98,9 +98,9 @@ var SliderBase = function (props) {
98
98
  };
99
99
  });
100
100
  var handleMouseEvent = function (clientX) {
101
- var rect = sliderRef.current.getBoundingClientRect();
101
+ var rect = trackRef.current.getBoundingClientRect();
102
102
  // Calculate x-position in range 0..1:
103
- var x = clamp((clientX - rect.left) / sliderRef.current.offsetWidth, 0, 1);
103
+ var x = clamp((clientX - rect.left) / trackRef.current.offsetWidth, 0, 1);
104
104
  // Derive value from x-position:
105
105
  var v = Math.round((props.max - props.min) * x + props.min);
106
106
  // Set new value. If props.immediate, then call onChange immediately.
@@ -154,8 +154,8 @@ var SliderBase = function (props) {
154
154
  // Create a number of ticks and return them.
155
155
  return Array(props.ticks).fill(0).map(function (t, idx) { return React.createElement(Tick, { key: idx }); });
156
156
  };
157
- return (React.createElement("div", { className: props.className, ref: sliderRef, onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, tabIndex: 0 },
158
- React.createElement(Track, null,
157
+ return (React.createElement("div", { className: props.className, onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, tabIndex: 0 },
158
+ React.createElement(Track, { ref: trackRef },
159
159
  React.createElement(TrackFill, { "$disabled": props.disabled, "$error": props.error, ref: trackFillRef }),
160
160
  props.ticks && renderTicks(),
161
161
  React.createElement(KnobPosition, { ref: knobRef },
@@ -183,7 +183,7 @@ var SliderStyled = styled(SliderBase)(templateObject_21 || (templateObject_21 =
183
183
  * They're ideal for adjusting settings such as volume and brightness, or for
184
184
  * applying image filters.
185
185
  */
186
- ])), function (p) { return p.fluid == true ? '100%' : '200px'; }, function (p) { return p.padded && css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n margin-left: 20px; // Must use margin; padding throws off mousedown calculations.\n margin-right: 20px;\n "], ["\n margin-left: 20px; // Must use margin; padding throws off mousedown calculations.\n margin-right: 20px;\n "]))); }, function (p) { return p.disabled ? 'auto' : 'pointer'; }, function (p) { return p.disabled && css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "]))); }, function (p) { return !p.disabled && css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n // Focus ring:\n &:focus ", ":before {\n animation: ", " 2s linear infinite;\n }\n\n &:hover ", ":before {\n animation: none;\n opacity: 0.7;\n } \n\n // Active focus ring:\n &:active ", ":before {\n animation: none;\n opacity: 1;\n }\n "], ["\n // Focus ring:\n &:focus ", ":before {\n animation: ", " 2s linear infinite;\n }\n\n &:hover ", ":before {\n animation: none;\n opacity: 0.7;\n } \n\n // Active focus ring:\n &:active ", ":before {\n animation: none;\n opacity: 1;\n }\n "])), Knob, Pulse, Knob, Knob); });
186
+ ])), function (p) { return p.fluid == true ? '100%' : '200px'; }, function (p) { return p.padded && css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n padding-left: 20px;\n padding-right: 20px;\n "], ["\n padding-left: 20px;\n padding-right: 20px;\n "]))); }, function (p) { return p.disabled ? 'auto' : 'pointer'; }, function (p) { return p.disabled && css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "]))); }, function (p) { return !p.disabled && css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n // Focus ring:\n &:focus ", ":before {\n animation: ", " 2s linear infinite;\n }\n\n &:hover ", ":before {\n animation: none;\n opacity: 0.7;\n } \n\n // Active focus ring:\n &:active ", ":before {\n animation: none;\n opacity: 1;\n }\n "], ["\n // Focus ring:\n &:focus ", ":before {\n animation: ", " 2s linear infinite;\n }\n\n &:hover ", ":before {\n animation: none;\n opacity: 0.7;\n } \n\n // Active focus ring:\n &:active ", ":before {\n animation: none;\n opacity: 1;\n }\n "])), Knob, Pulse, Knob, Knob); });
187
187
  /**
188
188
  * Sliders allow users to view and select a value (or range) along a track.
189
189
  * They're ideal for adjusting settings such as volume and brightness, or for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",