@instructure/ui-number-input 8.17.0 → 8.17.1-snapshot.17

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/LICENSE.md ADDED
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: The MIT License (MIT)
3
+ category: Getting Started
4
+ order: 9
5
+ ---
6
+
7
+ # The MIT License (MIT)
8
+
9
+ Copyright (c) 2015 Instructure, Inc.
10
+
11
+ **Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions.**
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _class, _class2, _temp, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
1
+ var _dec, _dec2, _dec3, _class, _class2, _temp, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
2
2
 
3
3
  /*
4
4
  * The MIT License (MIT)
@@ -29,9 +29,8 @@ import React, { Component } from 'react';
29
29
  import keycode from 'keycode';
30
30
  import { FormField } from '@instructure/ui-form-field';
31
31
  import { IconArrowOpenDownLine, IconArrowOpenUpLine } from '@instructure/ui-icons';
32
- import { uid } from '@instructure/uid';
33
32
  import { testable } from '@instructure/ui-testable';
34
- import { omitProps, pickProps, callRenderProp, getInteraction } from '@instructure/ui-react-utils';
33
+ import { omitProps, pickProps, callRenderProp, getInteraction, withDeterministicId } from '@instructure/ui-react-utils';
35
34
  import { withStyle, jsx } from '@instructure/emotion';
36
35
  import generateStyle from './styles';
37
36
  import generateComponentTheme from './theme';
@@ -44,7 +43,7 @@ id: NumberInput
44
43
  ---
45
44
  @tsProps
46
45
  **/
47
- let NumberInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class NumberInput extends Component {
46
+ let NumberInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = class NumberInput extends Component {
48
47
  constructor() {
49
48
  super(...arguments);
50
49
  this.state = {
@@ -132,7 +131,7 @@ let NumberInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
132
131
  }
133
132
 
134
133
  if (!this._id) {
135
- this._id = uid('NumberInput');
134
+ this._id = this.props.deterministicId();
136
135
  }
137
136
 
138
137
  return this._id;
@@ -256,6 +255,6 @@ let NumberInput = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
256
255
  display: 'block',
257
256
  textAlign: 'start',
258
257
  inputMode: 'numeric'
259
- }, _temp)) || _class) || _class);
258
+ }, _temp)) || _class) || _class) || _class);
260
259
  export default NumberInput;
261
260
  export { NumberInput };
@@ -19,8 +19,6 @@ var _IconArrowOpenDownLine = require("@instructure/ui-icons/lib/IconArrowOpenDow
19
19
 
20
20
  var _IconArrowOpenUpLine2 = require("@instructure/ui-icons/lib/IconArrowOpenUpLine.js");
21
21
 
22
- var _uid = require("@instructure/uid");
23
-
24
22
  var _testable = require("@instructure/ui-testable/lib/testable.js");
25
23
 
26
24
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
@@ -31,6 +29,8 @@ var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js
31
29
 
32
30
  var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
33
31
 
32
+ var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
33
+
34
34
  var _emotion = require("@instructure/emotion");
35
35
 
36
36
  var _styles = _interopRequireDefault(require("./styles"));
@@ -39,7 +39,7 @@ var _theme = _interopRequireDefault(require("./theme"));
39
39
 
40
40
  var _props = require("./props");
41
41
 
42
- var _dec, _dec2, _class, _class2, _temp, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
42
+ var _dec, _dec2, _dec3, _class, _class2, _temp, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
43
43
 
44
44
  /**
45
45
  ---
@@ -48,7 +48,7 @@ id: NumberInput
48
48
  ---
49
49
  @tsProps
50
50
  **/
51
- let NumberInput = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class NumberInput extends _react.Component {
51
+ let NumberInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = class NumberInput extends _react.Component {
52
52
  constructor() {
53
53
  super(...arguments);
54
54
  this.state = {
@@ -136,7 +136,7 @@ let NumberInput = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
136
136
  }
137
137
 
138
138
  if (!this._id) {
139
- this._id = (0, _uid.uid)('NumberInput');
139
+ this._id = this.props.deterministicId();
140
140
  }
141
141
 
142
142
  return this._id;
@@ -260,7 +260,7 @@ let NumberInput = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
260
260
  display: 'block',
261
261
  textAlign: 'start',
262
262
  inputMode: 'numeric'
263
- }, _temp)) || _class) || _class);
263
+ }, _temp)) || _class) || _class) || _class);
264
264
  exports.NumberInput = NumberInput;
265
265
  var _default = NumberInput;
266
266
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-number-input",
3
- "version": "8.17.0",
3
+ "version": "8.17.1-snapshot.17+8e38d5a2e",
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,21 +23,21 @@
23
23
  "ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
24
24
  },
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.17.0",
27
- "@instructure/ui-test-locator": "8.17.0",
28
- "@instructure/ui-test-utils": "8.17.0",
29
- "@instructure/ui-themes": "8.17.0"
26
+ "@instructure/ui-babel-preset": "8.17.1-snapshot.17+8e38d5a2e",
27
+ "@instructure/ui-test-locator": "8.17.1-snapshot.17+8e38d5a2e",
28
+ "@instructure/ui-test-utils": "8.17.1-snapshot.17+8e38d5a2e",
29
+ "@instructure/ui-themes": "8.17.1-snapshot.17+8e38d5a2e"
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.13.10",
33
- "@instructure/emotion": "8.17.0",
34
- "@instructure/shared-types": "8.17.0",
35
- "@instructure/ui-form-field": "8.17.0",
36
- "@instructure/ui-icons": "8.17.0",
37
- "@instructure/ui-react-utils": "8.17.0",
38
- "@instructure/ui-testable": "8.17.0",
39
- "@instructure/ui-utils": "8.17.0",
40
- "@instructure/uid": "8.17.0",
33
+ "@instructure/emotion": "8.17.1-snapshot.17+8e38d5a2e",
34
+ "@instructure/shared-types": "8.17.1-snapshot.17+8e38d5a2e",
35
+ "@instructure/ui-form-field": "8.17.1-snapshot.17+8e38d5a2e",
36
+ "@instructure/ui-icons": "8.17.1-snapshot.17+8e38d5a2e",
37
+ "@instructure/ui-react-utils": "8.17.1-snapshot.17+8e38d5a2e",
38
+ "@instructure/ui-testable": "8.17.1-snapshot.17+8e38d5a2e",
39
+ "@instructure/ui-utils": "8.17.1-snapshot.17+8e38d5a2e",
40
+ "@instructure/uid": "8.17.1-snapshot.17+8e38d5a2e",
41
41
  "keycode": "^2",
42
42
  "prop-types": "^15"
43
43
  },
@@ -47,5 +47,6 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "sideEffects": false
50
+ "sideEffects": false,
51
+ "gitHead": "8e38d5a2e11e842eafa2fa270e47a261c6ebb626"
51
52
  }
@@ -31,13 +31,13 @@ import {
31
31
  IconArrowOpenDownLine,
32
32
  IconArrowOpenUpLine
33
33
  } from '@instructure/ui-icons'
34
- import { uid } from '@instructure/uid'
35
34
  import { testable } from '@instructure/ui-testable'
36
35
  import {
37
36
  omitProps,
38
37
  pickProps,
39
38
  callRenderProp,
40
- getInteraction
39
+ getInteraction,
40
+ withDeterministicId
41
41
  } from '@instructure/ui-react-utils'
42
42
 
43
43
  import { withStyle, jsx } from '@instructure/emotion'
@@ -59,6 +59,7 @@ id: NumberInput
59
59
  ---
60
60
  @tsProps
61
61
  **/
62
+ @withDeterministicId()
62
63
  @withStyle(generateStyle, generateComponentTheme)
63
64
  @testable()
64
65
  class NumberInput extends Component<NumberInputProps, NumberInputState> {
@@ -93,7 +94,7 @@ class NumberInput extends Component<NumberInputProps, NumberInputState> {
93
94
  return this.props.id
94
95
  }
95
96
  if (!this._id) {
96
- this._id = uid('NumberInput')
97
+ this._id = this.props.deterministicId!()
97
98
  }
98
99
  return this._id
99
100
  }
@@ -37,6 +37,7 @@ import type {
37
37
  import type { InteractionType } from '@instructure/ui-react-utils'
38
38
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
39
39
  import type { FormFieldOwnProps, FormMessage } from '@instructure/ui-form-field'
40
+ import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
40
41
 
41
42
  type NumberInputOwnProps = {
42
43
  /**
@@ -178,12 +179,13 @@ type NumberInputProps =
178
179
  FormFieldOwnProps,
179
180
  'label' | 'inline' | 'id' | 'elementRef'
180
181
  > &
181
- NumberInputOwnProps &
182
- WithStyleProps<NumberInputTheme, NumberInputStyle> &
183
- OtherHTMLAttributes<
184
- NumberInputOwnProps,
185
- InputHTMLAttributes<NumberInputOwnProps>
186
- >
182
+ NumberInputOwnProps &
183
+ WithStyleProps<NumberInputTheme, NumberInputStyle> &
184
+ OtherHTMLAttributes<
185
+ NumberInputOwnProps,
186
+ InputHTMLAttributes<NumberInputOwnProps>
187
+ >
188
+ & WithDeterministicIdProps
187
189
 
188
190
  type NumberInputStyle = ComponentStyle<
189
191
  | 'numberInput'