@instructure/ui-number-input 10.26.1-snapshot-2 → 10.26.1

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,30 +3,9 @@
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
- ## [10.26.1-snapshot-2](https://github.com/instructure/instructure-ui/compare/v10.26.0...v10.26.1-snapshot-2) (2025-10-06)
6
+ ## [10.26.1](https://github.com/instructure/instructure-ui/compare/v10.26.0...v10.26.1) (2025-10-06)
7
7
 
8
-
9
- ### Features
10
-
11
- * **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
12
-
13
-
14
- ### BREAKING CHANGES
15
-
16
- * **many:** InstUI v11 contains the following breaking changes:
17
- - React 16 and 17 are no longer supported
18
- - remove `PropTypes` from all packages
19
- - remove `CodeEditor` component
20
- - remove `@instui/theme-registry` package
21
- - remove `@testable`, `@experimental`, `@hack` decorators
22
- - InstUISettingsProvider's `as` prop is removed
23
- - `canvas.use()`, `canvasHighContrast.use()` functions are removed
24
- - `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
25
- - `variables` field on theme objects are removed
26
- - remove deprecated props from Table: Row's `isStacked`, Body's
27
- `isStacked`, `hover`, and `headers`
28
- - `Table`'s `caption` prop is now required
29
- - `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
8
+ **Note:** Version bump only for package @instructure/ui-number-input
30
9
 
31
10
 
32
11
 
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _class, _NumberInput, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
1
+ var _dec, _dec2, _dec3, _class, _NumberInput, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -27,12 +27,13 @@ import { Fragment, Component } from 'react';
27
27
  import keycode from 'keycode';
28
28
  import { FormField } from '@instructure/ui-form-field';
29
29
  import { IconArrowOpenDownLine, IconArrowOpenUpLine } from '@instructure/ui-icons';
30
+ import { testable } from '@instructure/ui-testable';
30
31
  import { omitProps, pickProps, callRenderProp, getInteraction, withDeterministicId } from '@instructure/ui-react-utils';
31
32
  import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
32
33
  import { withStyle } from '@instructure/emotion';
33
34
  import generateStyle from './styles';
34
35
  import generateComponentTheme from './theme';
35
- import { allowedProps } from './props';
36
+ import { allowedProps, propTypes } from './props';
36
37
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
37
38
  /**
38
39
  ---
@@ -40,7 +41,7 @@ category: components
40
41
  id: NumberInput
41
42
  ---
42
43
  **/
43
- let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_NumberInput = class NumberInput extends Component {
44
+ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_NumberInput = class NumberInput extends Component {
44
45
  constructor(...args) {
45
46
  super(...args);
46
47
  this.state = {
@@ -200,7 +201,6 @@ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle
200
201
  id: this.id,
201
202
  elementRef: this.handleRef,
202
203
  margin: margin,
203
- "data-cid": "NumberInput",
204
204
  children: _jsx("span", {
205
205
  css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.inputWidth,
206
206
  style: width ? {
@@ -230,7 +230,7 @@ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle
230
230
  })
231
231
  });
232
232
  }
233
- }, _NumberInput.displayName = "NumberInput", _NumberInput.componentId = 'NumberInput', _NumberInput.allowedProps = allowedProps, _NumberInput.defaultProps = {
233
+ }, _NumberInput.displayName = "NumberInput", _NumberInput.componentId = 'NumberInput', _NumberInput.allowedProps = allowedProps, _NumberInput.propTypes = propTypes, _NumberInput.defaultProps = {
234
234
  // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
235
235
  interaction: void 0,
236
236
  messages: [],
@@ -241,6 +241,6 @@ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle
241
241
  textAlign: 'start',
242
242
  inputMode: 'numeric',
243
243
  allowStringValue: false
244
- }, _NumberInput)) || _class) || _class);
244
+ }, _NumberInput)) || _class) || _class) || _class);
245
245
  export default NumberInput;
246
246
  export { NumberInput };
@@ -22,5 +22,35 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
+ import PropTypes from 'prop-types';
26
+ import { FormPropTypes } from '@instructure/ui-form-field';
27
+ const propTypes = {
28
+ renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
29
+ id: PropTypes.string,
30
+ interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
31
+ messages: PropTypes.arrayOf(FormPropTypes.message),
32
+ placeholder: PropTypes.string,
33
+ isRequired: PropTypes.bool,
34
+ showArrows: PropTypes.bool,
35
+ size: PropTypes.oneOf(['medium', 'large']),
36
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
37
+ width: PropTypes.string,
38
+ display: PropTypes.oneOf(['inline-block', 'block']),
39
+ inputRef: PropTypes.func,
40
+ onFocus: PropTypes.func,
41
+ onBlur: PropTypes.func,
42
+ onChange: PropTypes.func,
43
+ onDecrement: PropTypes.func,
44
+ onIncrement: PropTypes.func,
45
+ onKeyDown: PropTypes.func,
46
+ inputMode: PropTypes.oneOf(['numeric', 'decimal', 'tel']),
47
+ textAlign: PropTypes.oneOf(['start', 'center']),
48
+ allowStringValue: PropTypes.bool,
49
+ renderIcons: PropTypes.shape({
50
+ increase: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
51
+ decrease: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired
52
+ }),
53
+ margin: PropTypes.string
54
+ };
25
55
  const allowedProps = ['renderLabel', 'id', 'interaction', 'messages', 'placeholder', 'isRequired', 'showArrows', 'size', 'value', 'width', 'display', 'inputRef', 'onFocus', 'onBlur', 'onChange', 'onDecrement', 'onIncrement', 'onKeyDown', 'inputMode', 'textAlign', 'allowStringValue', 'renderIcons', 'margin'];
26
- export { allowedProps };
56
+ export { propTypes, allowedProps };
@@ -10,6 +10,7 @@ var _keycode = _interopRequireDefault(require("keycode"));
10
10
  var _FormField = require("@instructure/ui-form-field/lib/FormField");
11
11
  var _IconArrowOpenDownLine = require("@instructure/ui-icons/lib/IconArrowOpenDownLine.js");
12
12
  var _IconArrowOpenUpLine2 = require("@instructure/ui-icons/lib/IconArrowOpenUpLine.js");
13
+ var _testable = require("@instructure/ui-testable/lib/testable.js");
13
14
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
14
15
  var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
15
16
  var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
@@ -21,7 +22,7 @@ var _styles = _interopRequireDefault(require("./styles"));
21
22
  var _theme = _interopRequireDefault(require("./theme"));
22
23
  var _props = require("./props");
23
24
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
24
- var _dec, _dec2, _class, _NumberInput, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
25
+ var _dec, _dec2, _dec3, _class, _NumberInput, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
25
26
  /*
26
27
  * The MIT License (MIT)
27
28
  *
@@ -51,7 +52,7 @@ category: components
51
52
  id: NumberInput
52
53
  ---
53
54
  **/
54
- let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_NumberInput = class NumberInput extends _react.Component {
55
+ let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_NumberInput = class NumberInput extends _react.Component {
55
56
  constructor(...args) {
56
57
  super(...args);
57
58
  this.state = {
@@ -211,7 +212,6 @@ let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDet
211
212
  id: this.id,
212
213
  elementRef: this.handleRef,
213
214
  margin: margin,
214
- "data-cid": "NumberInput",
215
215
  children: (0, _jsxRuntime.jsx)("span", {
216
216
  css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.inputWidth,
217
217
  style: width ? {
@@ -241,7 +241,7 @@ let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDet
241
241
  })
242
242
  });
243
243
  }
244
- }, _NumberInput.displayName = "NumberInput", _NumberInput.componentId = 'NumberInput', _NumberInput.allowedProps = _props.allowedProps, _NumberInput.defaultProps = {
244
+ }, _NumberInput.displayName = "NumberInput", _NumberInput.componentId = 'NumberInput', _NumberInput.allowedProps = _props.allowedProps, _NumberInput.propTypes = _props.propTypes, _NumberInput.defaultProps = {
245
245
  // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
246
246
  interaction: void 0,
247
247
  messages: [],
@@ -252,5 +252,5 @@ let NumberInput = exports.NumberInput = (_dec = (0, _withDeterministicId.withDet
252
252
  textAlign: 'start',
253
253
  inputMode: 'numeric',
254
254
  allowStringValue: false
255
- }, _NumberInput)) || _class) || _class);
255
+ }, _NumberInput)) || _class) || _class) || _class);
256
256
  var _default = exports.default = NumberInput;
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
- exports.allowedProps = void 0;
7
+ exports.propTypes = exports.allowedProps = void 0;
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _FormPropTypes = require("@instructure/ui-form-field/lib/FormPropTypes.js");
7
10
  /*
8
11
  * The MIT License (MIT)
9
12
  *
@@ -28,4 +31,32 @@ exports.allowedProps = void 0;
28
31
  * SOFTWARE.
29
32
  */
30
33
 
34
+ const propTypes = exports.propTypes = {
35
+ renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
36
+ id: _propTypes.default.string,
37
+ interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
38
+ messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
39
+ placeholder: _propTypes.default.string,
40
+ isRequired: _propTypes.default.bool,
41
+ showArrows: _propTypes.default.bool,
42
+ size: _propTypes.default.oneOf(['medium', 'large']),
43
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
44
+ width: _propTypes.default.string,
45
+ display: _propTypes.default.oneOf(['inline-block', 'block']),
46
+ inputRef: _propTypes.default.func,
47
+ onFocus: _propTypes.default.func,
48
+ onBlur: _propTypes.default.func,
49
+ onChange: _propTypes.default.func,
50
+ onDecrement: _propTypes.default.func,
51
+ onIncrement: _propTypes.default.func,
52
+ onKeyDown: _propTypes.default.func,
53
+ inputMode: _propTypes.default.oneOf(['numeric', 'decimal', 'tel']),
54
+ textAlign: _propTypes.default.oneOf(['start', 'center']),
55
+ allowStringValue: _propTypes.default.bool,
56
+ renderIcons: _propTypes.default.shape({
57
+ increase: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
58
+ decrease: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired
59
+ }),
60
+ margin: _propTypes.default.string
61
+ };
31
62
  const allowedProps = exports.allowedProps = ['renderLabel', 'id', 'interaction', 'messages', 'placeholder', 'isRequired', 'showArrows', 'size', 'value', 'width', 'display', 'inputRef', 'onFocus', 'onBlur', 'onChange', 'onDecrement', 'onIncrement', 'onKeyDown', 'inputMode', 'textAlign', 'allowStringValue', 'renderIcons', 'margin'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-number-input",
3
- "version": "10.26.1-snapshot-2",
3
+ "version": "10.26.1",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "homepage": "https://instructure.github.io/instructure-ui/",
@@ -23,27 +23,29 @@
23
23
  "ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
24
24
  },
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "10.26.1-snapshot-2",
27
- "@instructure/ui-scripts": "10.26.1-snapshot-2",
28
- "@instructure/ui-themes": "10.26.1-snapshot-2",
26
+ "@instructure/ui-babel-preset": "10.26.1",
27
+ "@instructure/ui-scripts": "10.26.1",
28
+ "@instructure/ui-themes": "10.26.1",
29
29
  "@testing-library/jest-dom": "^6.6.3",
30
- "@testing-library/react": "15.0.7",
30
+ "@testing-library/react": "^16.0.1",
31
31
  "@testing-library/user-event": "^14.6.1",
32
32
  "vitest": "^3.2.2"
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.27.6",
36
- "@instructure/emotion": "10.26.1-snapshot-2",
37
- "@instructure/shared-types": "10.26.1-snapshot-2",
38
- "@instructure/ui-form-field": "10.26.1-snapshot-2",
39
- "@instructure/ui-icons": "10.26.1-snapshot-2",
40
- "@instructure/ui-react-utils": "10.26.1-snapshot-2",
41
- "@instructure/ui-utils": "10.26.1-snapshot-2",
42
- "@instructure/uid": "10.26.1-snapshot-2",
43
- "keycode": "^2"
36
+ "@instructure/emotion": "10.26.1",
37
+ "@instructure/shared-types": "10.26.1",
38
+ "@instructure/ui-form-field": "10.26.1",
39
+ "@instructure/ui-icons": "10.26.1",
40
+ "@instructure/ui-react-utils": "10.26.1",
41
+ "@instructure/ui-testable": "10.26.1",
42
+ "@instructure/ui-utils": "10.26.1",
43
+ "@instructure/uid": "10.26.1",
44
+ "keycode": "^2",
45
+ "prop-types": "^15.8.1"
44
46
  },
45
47
  "peerDependencies": {
46
- "react": ">=18 <=19"
48
+ "react": ">=16.14 <=18"
47
49
  },
48
50
  "publishConfig": {
49
51
  "access": "public"
@@ -30,6 +30,7 @@ import {
30
30
  IconArrowOpenDownLine,
31
31
  IconArrowOpenUpLine
32
32
  } from '@instructure/ui-icons'
33
+ import { testable } from '@instructure/ui-testable'
33
34
  import {
34
35
  omitProps,
35
36
  pickProps,
@@ -44,7 +45,7 @@ import { withStyle } from '@instructure/emotion'
44
45
  import generateStyle from './styles'
45
46
  import generateComponentTheme from './theme'
46
47
 
47
- import { allowedProps } from './props'
48
+ import { allowedProps, propTypes } from './props'
48
49
  import type {
49
50
  NumberInputProps,
50
51
  NumberInputState,
@@ -60,9 +61,11 @@ id: NumberInput
60
61
  **/
61
62
  @withDeterministicId()
62
63
  @withStyle(generateStyle, generateComponentTheme)
64
+ @testable()
63
65
  class NumberInput extends Component<NumberInputProps, NumberInputState> {
64
66
  static readonly componentId = 'NumberInput'
65
67
  static allowedProps = allowedProps
68
+ static propTypes = propTypes
66
69
  static defaultProps = {
67
70
  // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
68
71
  interaction: undefined,
@@ -276,7 +279,6 @@ class NumberInput extends Component<NumberInputProps, NumberInputState> {
276
279
  id={this.id}
277
280
  elementRef={this.handleRef}
278
281
  margin={margin}
279
- data-cid="NumberInput"
280
282
  >
281
283
  <span
282
284
  css={this.props.styles?.inputWidth}
@@ -24,8 +24,12 @@
24
24
 
25
25
  import React from 'react'
26
26
  import type { InputHTMLAttributes } from 'react'
27
+ import PropTypes from 'prop-types'
28
+
29
+ import { FormPropTypes } from '@instructure/ui-form-field'
27
30
 
28
31
  import type {
32
+ PropValidators,
29
33
  NumberInputTheme,
30
34
  OtherHTMLAttributes,
31
35
  PickPropsWithExceptions
@@ -216,6 +220,36 @@ type NumberInputStyle = ComponentStyle<
216
220
  | 'input'
217
221
  | 'requiredInvalid'
218
222
  >
223
+
224
+ const propTypes: PropValidators<PropKeys> = {
225
+ renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
226
+ id: PropTypes.string,
227
+ interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
228
+ messages: PropTypes.arrayOf(FormPropTypes.message),
229
+ placeholder: PropTypes.string,
230
+ isRequired: PropTypes.bool,
231
+ showArrows: PropTypes.bool,
232
+ size: PropTypes.oneOf(['medium', 'large']),
233
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
234
+ width: PropTypes.string,
235
+ display: PropTypes.oneOf(['inline-block', 'block']),
236
+ inputRef: PropTypes.func,
237
+ onFocus: PropTypes.func,
238
+ onBlur: PropTypes.func,
239
+ onChange: PropTypes.func,
240
+ onDecrement: PropTypes.func,
241
+ onIncrement: PropTypes.func,
242
+ onKeyDown: PropTypes.func,
243
+ inputMode: PropTypes.oneOf(['numeric', 'decimal', 'tel']),
244
+ textAlign: PropTypes.oneOf(['start', 'center']),
245
+ allowStringValue: PropTypes.bool,
246
+ renderIcons: PropTypes.shape({
247
+ increase: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
248
+ decrease: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired
249
+ }),
250
+ margin: PropTypes.string
251
+ }
252
+
219
253
  const allowedProps: AllowedPropKeys = [
220
254
  'renderLabel',
221
255
  'id',
@@ -248,4 +282,4 @@ export type {
248
282
  NumberInputStyleProps,
249
283
  NumberInputStyle
250
284
  }
251
- export { allowedProps }
285
+ export { propTypes, allowedProps }
@@ -15,6 +15,7 @@
15
15
  { "path": "../ui-form-field/tsconfig.build.json" },
16
16
  { "path": "../ui-icons/tsconfig.build.json" },
17
17
  { "path": "../ui-react-utils/tsconfig.build.json" },
18
+ { "path": "../ui-testable/tsconfig.build.json" },
18
19
  { "path": "../ui-utils/tsconfig.build.json" },
19
20
  { "path": "../uid/tsconfig.build.json" }
20
21
  ]