@instructure/ui-text-input 10.11.1-snapshot-18 → 10.12.0

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,9 +3,12 @@
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.11.1-snapshot-18](https://github.com/instructure/instructure-ui/compare/v10.11.0...v10.11.1-snapshot-18) (2025-02-21)
6
+ # [10.12.0](https://github.com/instructure/instructure-ui/compare/v10.11.0...v10.12.0) (2025-02-24)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-text-input
8
+
9
+ ### Features
10
+
11
+ * **many:** introduce new spacing tokens; add margin prop for more components ([048c902](https://github.com/instructure/instructure-ui/commit/048c902406c00611cd117fb2fb8164a6eba62fb8))
9
12
 
10
13
 
11
14
 
@@ -253,7 +253,8 @@ let TextInput = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
253
253
  width: width,
254
254
  inputContainerRef: inputContainerRef,
255
255
  layout: this.props.layout,
256
- elementRef: this.handleRef
256
+ elementRef: this.handleRef,
257
+ margin: this.props.margin
257
258
  }, jsx("span", {
258
259
  css: styles === null || styles === void 0 ? void 0 : styles.facade
259
260
  }, renderBeforeOrAfter ? jsx("span", {
@@ -48,7 +48,8 @@ const propTypes = {
48
48
  renderAfterInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
49
49
  onChange: PropTypes.func,
50
50
  onBlur: PropTypes.func,
51
- onFocus: PropTypes.func
51
+ onFocus: PropTypes.func,
52
+ margin: PropTypes.string
52
53
  };
53
- const allowedProps = ['renderLabel', 'type', 'id', 'value', 'defaultValue', 'interaction', 'messages', 'size', 'textAlign', 'width', 'htmlSize', 'display', 'shouldNotWrap', 'placeholder', 'isRequired', 'elementRef', 'inputRef', 'inputContainerRef', 'renderBeforeInput', 'renderAfterInput', 'onChange', 'onBlur', 'onFocus'];
54
+ const allowedProps = ['renderLabel', 'type', 'id', 'value', 'defaultValue', 'interaction', 'messages', 'size', 'textAlign', 'width', 'htmlSize', 'display', 'shouldNotWrap', 'placeholder', 'isRequired', 'elementRef', 'inputRef', 'inputContainerRef', 'renderBeforeInput', 'renderAfterInput', 'onChange', 'onBlur', 'onFocus', 'margin'];
54
55
  export { propTypes, allowedProps };
@@ -263,7 +263,8 @@ let TextInput = exports.TextInput = (_dec = (0, _withDeterministicId.withDetermi
263
263
  width: width,
264
264
  inputContainerRef: inputContainerRef,
265
265
  layout: this.props.layout,
266
- elementRef: this.handleRef
266
+ elementRef: this.handleRef,
267
+ margin: this.props.margin
267
268
  }, (0, _emotion.jsx)("span", {
268
269
  css: styles === null || styles === void 0 ? void 0 : styles.facade
269
270
  }, renderBeforeOrAfter ? (0, _emotion.jsx)("span", {
@@ -55,6 +55,7 @@ const propTypes = exports.propTypes = {
55
55
  renderAfterInput: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
56
56
  onChange: _propTypes.default.func,
57
57
  onBlur: _propTypes.default.func,
58
- onFocus: _propTypes.default.func
58
+ onFocus: _propTypes.default.func,
59
+ margin: _propTypes.default.string
59
60
  };
60
- const allowedProps = exports.allowedProps = ['renderLabel', 'type', 'id', 'value', 'defaultValue', 'interaction', 'messages', 'size', 'textAlign', 'width', 'htmlSize', 'display', 'shouldNotWrap', 'placeholder', 'isRequired', 'elementRef', 'inputRef', 'inputContainerRef', 'renderBeforeInput', 'renderAfterInput', 'onChange', 'onBlur', 'onFocus'];
61
+ const allowedProps = exports.allowedProps = ['renderLabel', 'type', 'id', 'value', 'defaultValue', 'interaction', 'messages', 'size', 'textAlign', 'width', 'htmlSize', 'display', 'shouldNotWrap', 'placeholder', 'isRequired', 'elementRef', 'inputRef', 'inputContainerRef', 'renderBeforeInput', 'renderAfterInput', 'onChange', 'onBlur', 'onFocus', 'margin'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-text-input",
3
- "version": "10.11.1-snapshot-18",
3
+ "version": "10.12.0",
4
4
  "description": "A styled HTML text input component.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,12 +23,12 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-axe-check": "10.11.1-snapshot-18",
27
- "@instructure/ui-babel-preset": "10.11.1-snapshot-18",
28
- "@instructure/ui-badge": "10.11.1-snapshot-18",
29
- "@instructure/ui-color-utils": "10.11.1-snapshot-18",
30
- "@instructure/ui-test-utils": "10.11.1-snapshot-18",
31
- "@instructure/ui-themes": "10.11.1-snapshot-18",
26
+ "@instructure/ui-axe-check": "10.12.0",
27
+ "@instructure/ui-babel-preset": "10.12.0",
28
+ "@instructure/ui-badge": "10.12.0",
29
+ "@instructure/ui-color-utils": "10.12.0",
30
+ "@instructure/ui-test-utils": "10.12.0",
31
+ "@instructure/ui-themes": "10.12.0",
32
32
  "@testing-library/jest-dom": "^6.6.3",
33
33
  "@testing-library/react": "^16.0.1",
34
34
  "@testing-library/user-event": "^14.5.2",
@@ -36,15 +36,15 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@babel/runtime": "^7.26.0",
39
- "@instructure/emotion": "10.11.1-snapshot-18",
40
- "@instructure/shared-types": "10.11.1-snapshot-18",
41
- "@instructure/ui-dom-utils": "10.11.1-snapshot-18",
42
- "@instructure/ui-form-field": "10.11.1-snapshot-18",
43
- "@instructure/ui-icons": "10.11.1-snapshot-18",
44
- "@instructure/ui-prop-types": "10.11.1-snapshot-18",
45
- "@instructure/ui-react-utils": "10.11.1-snapshot-18",
46
- "@instructure/ui-tag": "10.11.1-snapshot-18",
47
- "@instructure/ui-testable": "10.11.1-snapshot-18",
39
+ "@instructure/emotion": "10.12.0",
40
+ "@instructure/shared-types": "10.12.0",
41
+ "@instructure/ui-dom-utils": "10.12.0",
42
+ "@instructure/ui-form-field": "10.12.0",
43
+ "@instructure/ui-icons": "10.12.0",
44
+ "@instructure/ui-prop-types": "10.12.0",
45
+ "@instructure/ui-react-utils": "10.12.0",
46
+ "@instructure/ui-tag": "10.12.0",
47
+ "@instructure/ui-testable": "10.12.0",
48
48
  "prop-types": "^15.8.1"
49
49
  },
50
50
  "peerDependencies": {
@@ -347,6 +347,7 @@ class TextInput extends Component<TextInputProps, TextInputState> {
347
347
  inputContainerRef={inputContainerRef}
348
348
  layout={this.props.layout}
349
349
  elementRef={this.handleRef}
350
+ margin={this.props.margin}
350
351
  >
351
352
  <span css={styles?.facade}>
352
353
  {renderBeforeOrAfter ? (
@@ -34,7 +34,11 @@ import type {
34
34
  PropValidators,
35
35
  TextInputTheme
36
36
  } from '@instructure/shared-types'
37
- import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
37
+ import type {
38
+ WithStyleProps,
39
+ ComponentStyle,
40
+ Spacing
41
+ } from '@instructure/emotion'
38
42
  import type {
39
43
  InteractionType,
40
44
  WithDeterministicIdProps
@@ -172,6 +176,11 @@ type TextInputOwnProps = {
172
176
  * Callback fired when input receives focus.
173
177
  */
174
178
  onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void
179
+
180
+ /**
181
+ * Margin around the component. Accepts a `Spacing` token. See token values and example usage in [this guide](https://instructure.design/#layout-spacing).
182
+ */
183
+ margin?: Spacing
175
184
  }
176
185
 
177
186
  type PropKeys = keyof TextInputOwnProps
@@ -221,7 +230,8 @@ const propTypes: PropValidators<PropKeys> = {
221
230
  renderAfterInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
222
231
  onChange: PropTypes.func,
223
232
  onBlur: PropTypes.func,
224
- onFocus: PropTypes.func
233
+ onFocus: PropTypes.func,
234
+ margin: PropTypes.string
225
235
  }
226
236
 
227
237
  const allowedProps: AllowedPropKeys = [
@@ -247,7 +257,8 @@ const allowedProps: AllowedPropKeys = [
247
257
  'renderAfterInput',
248
258
  'onChange',
249
259
  'onBlur',
250
- 'onFocus'
260
+ 'onFocus',
261
+ 'margin'
251
262
  ]
252
263
 
253
264
  type TextInputState = {