@instructure/ui-date-input 10.11.1-snapshot-17 → 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-17](https://github.com/instructure/instructure-ui/compare/v10.11.0...v10.11.1-snapshot-17) (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-date-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
 
@@ -132,7 +132,7 @@ const DateInput2 = ({
132
132
  dateFormat,
133
133
  onRequestValidateDate,
134
134
  renderCalendarIcon,
135
- // margin, TODO enable this prop
135
+ margin,
136
136
  ...rest
137
137
  }) => {
138
138
  const localeContext = useContext(ApplyLocaleContext);
@@ -250,7 +250,6 @@ const DateInput2 = ({
250
250
  };
251
251
  const selectedDate = parseDate(value)[1];
252
252
  return jsx(TextInput, Object.assign({}, passthroughProps(rest), {
253
- // margin={'large'} TODO add this prop to TextInput
254
253
  renderLabel: renderLabel,
255
254
  onChange: handleInputChange,
256
255
  onBlur: handleBlur,
@@ -261,6 +260,7 @@ const DateInput2 = ({
261
260
  display: isInline ? 'inline-block' : 'block',
262
261
  messages: inputMessages,
263
262
  interaction: interaction,
263
+ margin: margin,
264
264
  renderAfterInput: jsx(Popover, {
265
265
  renderTrigger: jsx(IconButton, {
266
266
  withBackground: false,
@@ -43,6 +43,7 @@ const propTypes = {
43
43
  withYearPicker: PropTypes.object,
44
44
  dateFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
45
45
  onRequestValidateDate: PropTypes.func,
46
- renderCalendarIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
46
+ renderCalendarIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
47
+ margin: PropTypes.string
47
48
  };
48
49
  export { propTypes };
@@ -142,7 +142,7 @@ const DateInput2 = ({
142
142
  dateFormat,
143
143
  onRequestValidateDate,
144
144
  renderCalendarIcon,
145
- // margin, TODO enable this prop
145
+ margin,
146
146
  ...rest
147
147
  }) => {
148
148
  const localeContext = (0, _react.useContext)(_ApplyLocaleContext.ApplyLocaleContext);
@@ -260,7 +260,6 @@ const DateInput2 = ({
260
260
  };
261
261
  const selectedDate = parseDate(value)[1];
262
262
  return (0, _emotion.jsx)(_TextInput.TextInput, Object.assign({}, (0, _passthroughProps.passthroughProps)(rest), {
263
- // margin={'large'} TODO add this prop to TextInput
264
263
  renderLabel: renderLabel,
265
264
  onChange: handleInputChange,
266
265
  onBlur: handleBlur,
@@ -271,6 +270,7 @@ const DateInput2 = ({
271
270
  display: isInline ? 'inline-block' : 'block',
272
271
  messages: inputMessages,
273
272
  interaction: interaction,
273
+ margin: margin,
274
274
  renderAfterInput: (0, _emotion.jsx)(_Popover.Popover, {
275
275
  renderTrigger: (0, _emotion.jsx)(_IconButton.IconButton, {
276
276
  withBackground: false,
@@ -50,5 +50,6 @@ const propTypes = exports.propTypes = {
50
50
  withYearPicker: _propTypes.default.object,
51
51
  dateFormat: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
52
52
  onRequestValidateDate: _propTypes.default.func,
53
- renderCalendarIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])
53
+ renderCalendarIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
54
+ margin: _propTypes.default.string
54
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-date-input",
3
- "version": "10.11.1-snapshot-17",
3
+ "version": "10.12.0",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,11 +23,11 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-axe-check": "10.11.1-snapshot-17",
27
- "@instructure/ui-babel-preset": "10.11.1-snapshot-17",
28
- "@instructure/ui-buttons": "10.11.1-snapshot-17",
29
- "@instructure/ui-scripts": "10.11.1-snapshot-17",
30
- "@instructure/ui-test-utils": "10.11.1-snapshot-17",
26
+ "@instructure/ui-axe-check": "10.12.0",
27
+ "@instructure/ui-babel-preset": "10.12.0",
28
+ "@instructure/ui-buttons": "10.12.0",
29
+ "@instructure/ui-scripts": "10.12.0",
30
+ "@instructure/ui-test-utils": "10.12.0",
31
31
  "@testing-library/jest-dom": "^6.6.3",
32
32
  "@testing-library/react": "^16.0.1",
33
33
  "@testing-library/user-event": "^14.5.2",
@@ -35,20 +35,20 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@babel/runtime": "^7.26.0",
38
- "@instructure/emotion": "10.11.1-snapshot-17",
39
- "@instructure/shared-types": "10.11.1-snapshot-17",
40
- "@instructure/ui-calendar": "10.11.1-snapshot-17",
41
- "@instructure/ui-form-field": "10.11.1-snapshot-17",
42
- "@instructure/ui-i18n": "10.11.1-snapshot-17",
43
- "@instructure/ui-icons": "10.11.1-snapshot-17",
44
- "@instructure/ui-popover": "10.11.1-snapshot-17",
45
- "@instructure/ui-position": "10.11.1-snapshot-17",
46
- "@instructure/ui-prop-types": "10.11.1-snapshot-17",
47
- "@instructure/ui-react-utils": "10.11.1-snapshot-17",
48
- "@instructure/ui-selectable": "10.11.1-snapshot-17",
49
- "@instructure/ui-testable": "10.11.1-snapshot-17",
50
- "@instructure/ui-text-input": "10.11.1-snapshot-17",
51
- "@instructure/ui-utils": "10.11.1-snapshot-17",
38
+ "@instructure/emotion": "10.12.0",
39
+ "@instructure/shared-types": "10.12.0",
40
+ "@instructure/ui-calendar": "10.12.0",
41
+ "@instructure/ui-form-field": "10.12.0",
42
+ "@instructure/ui-i18n": "10.12.0",
43
+ "@instructure/ui-icons": "10.12.0",
44
+ "@instructure/ui-popover": "10.12.0",
45
+ "@instructure/ui-position": "10.12.0",
46
+ "@instructure/ui-prop-types": "10.12.0",
47
+ "@instructure/ui-react-utils": "10.12.0",
48
+ "@instructure/ui-selectable": "10.12.0",
49
+ "@instructure/ui-testable": "10.12.0",
50
+ "@instructure/ui-text-input": "10.12.0",
51
+ "@instructure/ui-utils": "10.12.0",
52
52
  "moment-timezone": "^0.5.45",
53
53
  "prop-types": "^15.8.1"
54
54
  },
@@ -153,7 +153,7 @@ const DateInput2 = ({
153
153
  dateFormat,
154
154
  onRequestValidateDate,
155
155
  renderCalendarIcon,
156
- // margin, TODO enable this prop
156
+ margin,
157
157
  ...rest
158
158
  }: DateInput2Props) => {
159
159
  const localeContext = useContext(ApplyLocaleContext)
@@ -278,7 +278,6 @@ const DateInput2 = ({
278
278
  return (
279
279
  <TextInput
280
280
  {...passthroughProps(rest)}
281
- // margin={'large'} TODO add this prop to TextInput
282
281
  renderLabel={renderLabel}
283
282
  onChange={handleInputChange}
284
283
  onBlur={handleBlur}
@@ -289,6 +288,7 @@ const DateInput2 = ({
289
288
  display={isInline ? 'inline-block' : 'block'}
290
289
  messages={inputMessages}
291
290
  interaction={interaction}
291
+ margin={margin}
292
292
  renderAfterInput={
293
293
  <Popover
294
294
  renderTrigger={
@@ -33,6 +33,7 @@ import type {
33
33
  Renderable,
34
34
  PropValidators
35
35
  } from '@instructure/shared-types'
36
+ import type { Spacing } from '@instructure/emotion'
36
37
 
37
38
  type DateInput2OwnProps = {
38
39
  /**
@@ -164,12 +165,16 @@ type DateInput2OwnProps = {
164
165
  value: string,
165
166
  utcDateString: string
166
167
  ) => void
167
- // margin?: Spacing // TODO enable this prop
168
168
 
169
169
  /**
170
170
  * Custom icon for the icon button opening the picker.
171
171
  */
172
172
  renderCalendarIcon?: Renderable
173
+
174
+ /**
175
+ * Margin around the component. Accepts a `Spacing` token. See token values and example usage in [this guide](https://instructure.design/#layout-spacing).
176
+ */
177
+ margin?: Spacing
173
178
  }
174
179
 
175
180
  type PropKeys = keyof DateInput2OwnProps
@@ -201,7 +206,8 @@ const propTypes: PropValidators<PropKeys> = {
201
206
  withYearPicker: PropTypes.object,
202
207
  dateFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
203
208
  onRequestValidateDate: PropTypes.func,
204
- renderCalendarIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
209
+ renderCalendarIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
210
+ margin: PropTypes.string
205
211
  }
206
212
 
207
213
  export type { DateInput2Props }