@instructure/ui-date-input 10.11.1-snapshot-18 → 10.12.1-snapshot-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 +16 -2
- package/es/DateInput/__new-tests__/DateInput.test.js +1 -1
- package/es/DateInput2/__new-tests__/DateInput2.test.js +0 -2
- package/es/DateInput2/index.js +2 -2
- package/es/DateInput2/props.js +2 -1
- package/lib/DateInput/__new-tests__/DateInput.test.js +1 -1
- package/lib/DateInput2/__new-tests__/DateInput2.test.js +0 -2
- package/lib/DateInput2/index.js +2 -2
- package/lib/DateInput2/props.js +2 -1
- package/package.json +20 -20
- package/src/DateInput/__new-tests__/DateInput.test.tsx +3 -1
- package/src/DateInput2/__new-tests__/DateInput2.test.tsx +0 -2
- package/src/DateInput2/index.tsx +2 -2
- package/src/DateInput2/props.ts +8 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/DateInput2/index.d.ts +2 -1
- package/types/DateInput2/index.d.ts.map +1 -1
- package/types/DateInput2/props.d.ts +5 -0
- package/types/DateInput2/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,9 +3,23 @@
|
|
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.
|
6
|
+
## [10.12.1-snapshot-0](https://github.com/instructure/instructure-ui/compare/v10.12.0...v10.12.1-snapshot-0) (2025-02-26)
|
7
7
|
|
8
|
-
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **many:** fix form label not read by NVDA in hover mode and other layout issues ([ef77281](https://github.com/instructure/instructure-ui/commit/ef77281890511e8eea794196445d3ef2454537ba))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# [10.12.0](https://github.com/instructure/instructure-ui/compare/v10.11.0...v10.12.0) (2025-02-24)
|
18
|
+
|
19
|
+
|
20
|
+
### Features
|
21
|
+
|
22
|
+
* **many:** introduce new spacing tokens; add margin prop for more components ([048c902](https://github.com/instructure/instructure-ui/commit/048c902406c00611cd117fb2fb8164a6eba62fb8))
|
9
23
|
|
10
24
|
|
11
25
|
|
@@ -263,7 +263,7 @@ describe('<DateInput />', () => {
|
|
263
263
|
onRequestShowCalendar: onRequestShowCalendar
|
264
264
|
}, generateDays())),
|
265
265
|
container = _render5.container;
|
266
|
-
const dateInput = container.querySelector(
|
266
|
+
const dateInput = container.querySelector('span[class$="-formFieldLayout__label"]');
|
267
267
|
expect(dateInput).toHaveTextContent('Choose date');
|
268
268
|
await userEvent.click(dateInput);
|
269
269
|
await waitFor(() => {
|
@@ -71,11 +71,9 @@ describe('<DateInput2 />', () => {
|
|
71
71
|
it('should render an input label', async () => {
|
72
72
|
const _render2 = render(_DateInputExample2 || (_DateInputExample2 = /*#__PURE__*/React.createElement(DateInputExample, null))),
|
73
73
|
container = _render2.container;
|
74
|
-
const dateInput = container.querySelector('input');
|
75
74
|
const label = container.querySelector('label');
|
76
75
|
expect(label).toBeInTheDocument();
|
77
76
|
expect(label).toHaveTextContent(LABEL_TEXT);
|
78
|
-
expect(dateInput === null || dateInput === void 0 ? void 0 : dateInput.id).toBe(label === null || label === void 0 ? void 0 : label.htmlFor);
|
79
77
|
});
|
80
78
|
it('should render an input placeholder', async () => {
|
81
79
|
const placeholder = 'Placeholder';
|
package/es/DateInput2/index.js
CHANGED
@@ -132,7 +132,7 @@ const DateInput2 = ({
|
|
132
132
|
dateFormat,
|
133
133
|
onRequestValidateDate,
|
134
134
|
renderCalendarIcon,
|
135
|
-
|
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,
|
package/es/DateInput2/props.js
CHANGED
@@ -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 };
|
@@ -265,7 +265,7 @@ describe('<DateInput />', () => {
|
|
265
265
|
onRequestShowCalendar: onRequestShowCalendar
|
266
266
|
}, generateDays())),
|
267
267
|
container = _render5.container;
|
268
|
-
const dateInput = container.querySelector(
|
268
|
+
const dateInput = container.querySelector('span[class$="-formFieldLayout__label"]');
|
269
269
|
expect(dateInput).toHaveTextContent('Choose date');
|
270
270
|
await _userEvent.default.click(dateInput);
|
271
271
|
await (0, _react2.waitFor)(() => {
|
@@ -75,11 +75,9 @@ describe('<DateInput2 />', () => {
|
|
75
75
|
it('should render an input label', async () => {
|
76
76
|
const _render2 = (0, _react2.render)(_DateInputExample2 || (_DateInputExample2 = /*#__PURE__*/_react.default.createElement(DateInputExample, null))),
|
77
77
|
container = _render2.container;
|
78
|
-
const dateInput = container.querySelector('input');
|
79
78
|
const label = container.querySelector('label');
|
80
79
|
expect(label).toBeInTheDocument();
|
81
80
|
expect(label).toHaveTextContent(LABEL_TEXT);
|
82
|
-
expect(dateInput === null || dateInput === void 0 ? void 0 : dateInput.id).toBe(label === null || label === void 0 ? void 0 : label.htmlFor);
|
83
81
|
});
|
84
82
|
it('should render an input placeholder', async () => {
|
85
83
|
const placeholder = 'Placeholder';
|
package/lib/DateInput2/index.js
CHANGED
@@ -142,7 +142,7 @@ const DateInput2 = ({
|
|
142
142
|
dateFormat,
|
143
143
|
onRequestValidateDate,
|
144
144
|
renderCalendarIcon,
|
145
|
-
|
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,
|
package/lib/DateInput2/props.js
CHANGED
@@ -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.
|
3
|
+
"version": "10.12.1-snapshot-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.
|
27
|
-
"@instructure/ui-babel-preset": "10.
|
28
|
-
"@instructure/ui-buttons": "10.
|
29
|
-
"@instructure/ui-scripts": "10.
|
30
|
-
"@instructure/ui-test-utils": "10.
|
26
|
+
"@instructure/ui-axe-check": "10.12.1-snapshot-0",
|
27
|
+
"@instructure/ui-babel-preset": "10.12.1-snapshot-0",
|
28
|
+
"@instructure/ui-buttons": "10.12.1-snapshot-0",
|
29
|
+
"@instructure/ui-scripts": "10.12.1-snapshot-0",
|
30
|
+
"@instructure/ui-test-utils": "10.12.1-snapshot-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.
|
39
|
-
"@instructure/shared-types": "10.
|
40
|
-
"@instructure/ui-calendar": "10.
|
41
|
-
"@instructure/ui-form-field": "10.
|
42
|
-
"@instructure/ui-i18n": "10.
|
43
|
-
"@instructure/ui-icons": "10.
|
44
|
-
"@instructure/ui-popover": "10.
|
45
|
-
"@instructure/ui-position": "10.
|
46
|
-
"@instructure/ui-prop-types": "10.
|
47
|
-
"@instructure/ui-react-utils": "10.
|
48
|
-
"@instructure/ui-selectable": "10.
|
49
|
-
"@instructure/ui-testable": "10.
|
50
|
-
"@instructure/ui-text-input": "10.
|
51
|
-
"@instructure/ui-utils": "10.
|
38
|
+
"@instructure/emotion": "10.12.1-snapshot-0",
|
39
|
+
"@instructure/shared-types": "10.12.1-snapshot-0",
|
40
|
+
"@instructure/ui-calendar": "10.12.1-snapshot-0",
|
41
|
+
"@instructure/ui-form-field": "10.12.1-snapshot-0",
|
42
|
+
"@instructure/ui-i18n": "10.12.1-snapshot-0",
|
43
|
+
"@instructure/ui-icons": "10.12.1-snapshot-0",
|
44
|
+
"@instructure/ui-popover": "10.12.1-snapshot-0",
|
45
|
+
"@instructure/ui-position": "10.12.1-snapshot-0",
|
46
|
+
"@instructure/ui-prop-types": "10.12.1-snapshot-0",
|
47
|
+
"@instructure/ui-react-utils": "10.12.1-snapshot-0",
|
48
|
+
"@instructure/ui-selectable": "10.12.1-snapshot-0",
|
49
|
+
"@instructure/ui-testable": "10.12.1-snapshot-0",
|
50
|
+
"@instructure/ui-text-input": "10.12.1-snapshot-0",
|
51
|
+
"@instructure/ui-utils": "10.12.1-snapshot-0",
|
52
52
|
"moment-timezone": "^0.5.45",
|
53
53
|
"prop-types": "^15.8.1"
|
54
54
|
},
|
@@ -381,7 +381,9 @@ describe('<DateInput />', () => {
|
|
381
381
|
{generateDays()}
|
382
382
|
</DateInput>
|
383
383
|
)
|
384
|
-
const dateInput = container.querySelector(
|
384
|
+
const dateInput = container.querySelector(
|
385
|
+
'span[class$="-formFieldLayout__label"]'
|
386
|
+
)
|
385
387
|
|
386
388
|
expect(dateInput).toHaveTextContent('Choose date')
|
387
389
|
|
@@ -77,12 +77,10 @@ describe('<DateInput2 />', () => {
|
|
77
77
|
it('should render an input label', async () => {
|
78
78
|
const { container } = render(<DateInputExample />)
|
79
79
|
|
80
|
-
const dateInput = container.querySelector('input')
|
81
80
|
const label = container.querySelector('label')
|
82
81
|
|
83
82
|
expect(label).toBeInTheDocument()
|
84
83
|
expect(label).toHaveTextContent(LABEL_TEXT)
|
85
|
-
expect(dateInput?.id).toBe(label?.htmlFor)
|
86
84
|
})
|
87
85
|
|
88
86
|
it('should render an input placeholder', async () => {
|
package/src/DateInput2/index.tsx
CHANGED
@@ -153,7 +153,7 @@ const DateInput2 = ({
|
|
153
153
|
dateFormat,
|
154
154
|
onRequestValidateDate,
|
155
155
|
renderCalendarIcon,
|
156
|
-
|
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={
|
package/src/DateInput2/props.ts
CHANGED
@@ -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 }
|