kitchen-simulator 5.0.0-test.30 → 5.0.0-test.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "5.0.0-test.30",
3
+ "version": "5.0.0-test.31",
4
4
  "description": "It is a kitchen simulator.",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -54,7 +54,6 @@
54
54
 
55
55
  "dependencies": {
56
56
  "@babel/cli": "^7.24.8",
57
- "@mapbox/react-range": "0.0.7",
58
57
  "@material-ui/core": "^4.12.3",
59
58
  "@material-ui/icons": "^4.11.2",
60
59
  "@material-ui/lab": "^4.0.0-alpha.61",
@@ -1,7 +1,45 @@
1
1
  import React from 'react';
2
- import ReactRange from '@mapbox/react-range';
2
+ import { Slider } from '@material-ui/core';
3
3
  import FormTextInput from './form-text-input';
4
4
 
5
+ // --- Local ReactRange implemented with MUI v4 Slider ---
6
+ // Matches the old API shape and forwards onChange as an event with target.value
7
+ function ReactRange({
8
+ value,
9
+ onChange,
10
+ style,
11
+ min = 0,
12
+ max = 100,
13
+ step = 1,
14
+ disabled = false,
15
+ ...rest
16
+ }) {
17
+ const numericValue = typeof value === 'number' ? value : Number(value) || 0;
18
+
19
+ const handleChange = (event, newValue) => {
20
+ if (typeof onChange === 'function') {
21
+ onChange({
22
+ ...event,
23
+ target: { ...(event?.target || {}), value: newValue }
24
+ });
25
+ }
26
+ };
27
+
28
+ return (
29
+ <Slider
30
+ value={numericValue}
31
+ onChange={handleChange}
32
+ min={min}
33
+ max={max}
34
+ step={step}
35
+ disabled={disabled}
36
+ style={style}
37
+ aria-label="range"
38
+ {...rest}
39
+ />
40
+ );
41
+ }
42
+
5
43
  const sliderContainerStyle = {
6
44
  display: 'inline-block',
7
45
  width: '80%',
@@ -20,11 +58,11 @@ export default function FormNumberInput({ value, onChange, ...rest }) {
20
58
  <div>
21
59
  <div style={sliderContainerStyle}>
22
60
  <ReactRange
23
- type="range"
61
+ type="range" // accepted but ignored; kept for compatibility
24
62
  style={sliderStyle}
25
63
  onChange={onChange}
26
64
  value={value}
27
- {...rest}
65
+ {...rest} // min, max, step, disabled, etc.
28
66
  />
29
67
  </div>
30
68