@instructure/ui-range-input 11.7.8 → 11.7.9-pr-snapshot-1792147648392

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/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.7.9-pr-snapshot-1792147648392](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-pr-snapshot-1792147648392) (2026-10-16)
7
+
8
+ ### Build System
9
+
10
+ * **many:** replace babel with swc ([7e36c54](https://github.com/instructure/instructure-ui/commit/7e36c54d240b4fa483801c03ab18e7f860f561e2))
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ * **many:** `@instructure/ui-babel-preset` and
15
+ `@instructure/browserslist-config-instui` are removed and will no longer be
16
+ published. Packages depend on `@swc/helpers` instead of `@babel/runtime`.
17
+
18
+
6
19
  ## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
7
20
 
8
21
  **Note:** Version bump only for package @instructure/ui-range-input
@@ -1,28 +1,5 @@
1
- var _dec, _dec2, _class;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
1
+ import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
26
3
  import { Component } from 'react';
27
4
  import { warn } from '@instructure/console';
28
5
  import { ContextView } from '@instructure/ui-view/v11_6';
@@ -33,156 +10,141 @@ import { omitProps, pickProps, withDeterministicId } from '@instructure/ui-react
33
10
  import generateStyle from './styles.js';
34
11
  import generateComponentTheme from './theme.js';
35
12
  import { allowedProps } from './props.js';
36
-
37
- /**
38
- ---
39
- category: components
40
- ---
41
- **/
42
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
43
- let RangeInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = class RangeInput extends Component {
44
- static displayName = 'RangeInput';
45
- static componentId = 'RangeInput';
46
- static outputLocatorAttribute = 'data-range-output';
47
- static allowedProps = allowedProps;
48
- static defaultProps = {
49
- step: 1,
50
- formatValue: val => val,
51
- // If min and max has default value, they don't give a warning if not set, even if they are required props.
52
- // TODO: figure out if they don't need to be required or remove defaults in V9.
53
- max: 0,
54
- min: 0,
55
- inline: false,
56
- size: 'medium',
57
- layout: 'stacked',
58
- displayValue: true,
59
- disabled: false,
60
- readOnly: false,
61
- thumbVariant: 'deprecated'
62
- };
63
- ref = null;
64
- _input = null;
65
- _inputListener = null;
66
- _changeListener = null;
67
- defaultId;
68
- handleRef = el => {
69
- this.ref = el;
70
- };
71
- handleInputRef = el => {
72
- this._input = el;
73
- if (typeof this.props.inputRef === 'function') {
74
- this.props.inputRef(el);
13
+ class RangeInput extends Component {
14
+ static{
15
+ this.displayName = 'RangeInput';
16
+ }
17
+ static{
18
+ this.componentId = 'RangeInput';
19
+ }
20
+ static{
21
+ this.outputLocatorAttribute = 'data-range-output';
75
22
  }
76
- };
77
- constructor(props) {
78
- super(props);
79
- if (typeof props.value === 'undefined') {
80
- this.state = {
81
- value: props.defaultValue
82
- };
23
+ static{
24
+ this.allowedProps = allowedProps;
83
25
  }
84
- this.defaultId = props.deterministicId();
85
- }
86
-
87
- /* workaround for https://github.com/facebook/react/issues/554 */
88
- componentDidMount() {
89
- this.props.makeStyles?.();
90
- if (this._input !== null) {
91
- // https://connect.microsoft.com/IE/Feedback/Details/856998
92
- this._inputListener = addEventListener(this._input, 'input', this.handleChange);
93
- this._changeListener = addEventListener(this._input, 'change', this.handleChange);
26
+ static{
27
+ this.defaultProps = {
28
+ step: 1,
29
+ formatValue: (val)=>val,
30
+ max: 0,
31
+ min: 0,
32
+ inline: false,
33
+ size: 'medium',
34
+ layout: 'stacked',
35
+ displayValue: true,
36
+ disabled: false,
37
+ readOnly: false,
38
+ thumbVariant: 'deprecated'
39
+ };
94
40
  }
95
- }
96
- componentWillUnmount() {
97
- if (!this._input) {
98
- return;
41
+ constructor(props){
42
+ super(props), this.ref = null, this._input = null, this._inputListener = null, this._changeListener = null, this.handleRef = (el)=>{
43
+ this.ref = el;
44
+ }, this.handleInputRef = (el)=>{
45
+ this._input = el;
46
+ if (typeof this.props.inputRef === 'function') {
47
+ this.props.inputRef(el);
48
+ }
49
+ }, this.handleChange = (event)=>{
50
+ const { onChange, value } = this.props;
51
+ if (typeof value === 'undefined') {
52
+ this.setState({
53
+ value: event.target.value
54
+ });
55
+ }
56
+ if (typeof onChange === 'function') {
57
+ onChange(event.target.value);
58
+ }
59
+ }, this.noopChange = ()=>{};
60
+ if (typeof props.value === 'undefined') {
61
+ this.state = {
62
+ value: props.defaultValue
63
+ };
64
+ }
65
+ this.defaultId = props.deterministicId();
99
66
  }
100
- this._inputListener?.remove();
101
- this._changeListener?.remove();
102
- }
103
- /* end workaround */
104
-
105
- componentDidUpdate() {
106
- this.props.makeStyles?.();
107
- }
108
- handleChange = event => {
109
- const {
110
- onChange,
111
- value
112
- } = this.props;
113
- if (typeof value === 'undefined') {
114
- this.setState({
115
- value: event.target.value
116
- });
67
+ componentDidMount() {
68
+ this.props.makeStyles?.();
69
+ if (this._input !== null) {
70
+ this._inputListener = addEventListener(this._input, 'input', this.handleChange);
71
+ this._changeListener = addEventListener(this._input, 'change', this.handleChange);
72
+ }
117
73
  }
118
- if (typeof onChange === 'function') {
119
- onChange(event.target.value);
74
+ componentWillUnmount() {
75
+ if (!this._input) {
76
+ return;
77
+ }
78
+ this._inputListener?.remove();
79
+ this._changeListener?.remove();
120
80
  }
121
- };
122
-
123
- // controlled input must have an onChange, but we're handling it with native events
124
- noopChange = () => {};
125
- get value() {
126
- const value = typeof this.props.value === 'undefined' ? this.state.value : this.props.value;
127
- return typeof value === 'string' ? parseInt(value) : value;
128
- }
129
- get id() {
130
- return this.props.id || this.defaultId;
131
- }
132
- renderValue() {
133
- if (this.props.displayValue) {
134
- if (!this.value) {
135
- warn(false, 'RangeInput should have a `value` or `defaultValue` set for the value to be displayed. If no value has to be displayed, set `displayValue={false}`.');
81
+ componentDidUpdate() {
82
+ this.props.makeStyles?.();
83
+ }
84
+ get value() {
85
+ const value = typeof this.props.value === 'undefined' ? this.state.value : this.props.value;
86
+ return typeof value === 'string' ? parseInt(value) : value;
87
+ }
88
+ get id() {
89
+ return this.props.id || this.defaultId;
90
+ }
91
+ renderValue() {
92
+ if (this.props.displayValue) {
93
+ if (!this.value) {
94
+ warn(false, 'RangeInput should have a `value` or `defaultValue` set for the value to be displayed. If no value has to be displayed, set `displayValue={false}`.');
95
+ return null;
96
+ }
97
+ const props = {
98
+ [RangeInput.outputLocatorAttribute]: this.id
99
+ };
100
+ return /*#__PURE__*/ _jsx(ContextView, {
101
+ background: "inverse",
102
+ placement: "end center",
103
+ children: /*#__PURE__*/ _jsx("div", {
104
+ ...props,
105
+ css: this.props.styles?.rangeInputInputValue,
106
+ children: this.props.formatValue(this.value, this.props.max)
107
+ })
108
+ });
109
+ }
136
110
  return null;
137
- }
138
- const props = {
139
- [RangeInput.outputLocatorAttribute]: this.id
140
- };
141
- return _jsx(ContextView, {
142
- background: "inverse",
143
- placement: "end center",
144
- children: _jsx("div", {
145
- ...props,
146
- css: this.props.styles?.rangeInputInputValue,
147
- children: this.props.formatValue(this.value, this.props.max)
148
- })
149
- });
150
111
  }
151
- return null;
152
- }
153
- render() {
154
- const {
155
- formatValue,
156
- disabled,
157
- readOnly
158
- } = this.props;
159
- const props = omitProps(this.props, RangeInput.allowedProps);
160
- return _jsx(FormField, {
161
- ...pickProps(this.props, FormField.allowedProps),
162
- label: this.props.label,
163
- id: this.id,
164
- elementRef: this.handleRef,
165
- "data-cid": "RangeInput",
166
- children: _jsxs("div", {
167
- css: this.props.styles?.rangeInput,
168
- children: [_jsx("input", {
169
- css: this.props.styles?.rangeInputInput,
170
- ref: this.handleInputRef,
171
- type: "range",
172
- id: this.id,
173
- min: this.props.min,
174
- max: this.props.max,
175
- step: this.props.step,
176
- value: this.value,
177
- onChange: this.noopChange,
178
- "aria-valuetext": formatValue(this.value, this.props.max),
179
- ...props,
180
- disabled: disabled || readOnly,
181
- "aria-disabled": disabled || readOnly ? 'true' : undefined
182
- }), this.renderValue()]
183
- })
184
- });
185
- }
186
- }) || _class) || _class);
112
+ render() {
113
+ const { formatValue, disabled, readOnly } = this.props;
114
+ const props = omitProps(this.props, RangeInput.allowedProps);
115
+ return /*#__PURE__*/ _jsx(FormField, {
116
+ ...pickProps(this.props, FormField.allowedProps),
117
+ label: this.props.label,
118
+ id: this.id,
119
+ elementRef: this.handleRef,
120
+ "data-cid": "RangeInput",
121
+ children: /*#__PURE__*/ _jsxs("div", {
122
+ css: this.props.styles?.rangeInput,
123
+ children: [
124
+ /*#__PURE__*/ _jsx("input", {
125
+ css: this.props.styles?.rangeInputInput,
126
+ ref: this.handleInputRef,
127
+ type: "range",
128
+ id: this.id,
129
+ min: this.props.min,
130
+ max: this.props.max,
131
+ step: this.props.step,
132
+ value: this.value,
133
+ onChange: this.noopChange,
134
+ "aria-valuetext": formatValue(this.value, this.props.max),
135
+ ...props,
136
+ disabled: disabled || readOnly,
137
+ "aria-disabled": disabled || readOnly ? 'true' : undefined
138
+ }),
139
+ this.renderValue()
140
+ ]
141
+ })
142
+ });
143
+ }
144
+ }
145
+ RangeInput = _ts_decorate([
146
+ withDeterministicId(),
147
+ withStyle(generateStyle, generateComponentTheme)
148
+ ], RangeInput);
187
149
  export default RangeInput;
188
- export { RangeInput };
150
+ export { RangeInput };
@@ -1,26 +1,21 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- const allowedProps = ['min', 'max', 'defaultValue', 'value', 'onChange', 'messages', 'size', 'layout', 'id', 'label', 'displayValue', 'step', 'formatValue', 'inline', 'disabled', 'readOnly', 'thumbVariant', 'inputRef'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'min',
3
+ 'max',
4
+ 'defaultValue',
5
+ 'value',
6
+ 'onChange',
7
+ 'messages',
8
+ 'size',
9
+ 'layout',
10
+ 'id',
11
+ 'label',
12
+ 'displayValue',
13
+ 'step',
14
+ 'formatValue',
15
+ 'inline',
16
+ 'disabled',
17
+ 'readOnly',
18
+ 'thumbVariant',
19
+ 'inputRef'
20
+ ];
21
+ export { allowedProps };